@mytec: 1.1iter ready for testing
This commit is contained in:
0
backend/app/models/__init__.py
Normal file
0
backend/app/models/__init__.py
Normal file
BIN
backend/app/models/__pycache__/__init__.cpython-311.pyc
Normal file
BIN
backend/app/models/__pycache__/__init__.cpython-311.pyc
Normal file
Binary file not shown.
BIN
backend/app/models/__pycache__/project.cpython-311.pyc
Normal file
BIN
backend/app/models/__pycache__/project.cpython-311.pyc
Normal file
Binary file not shown.
BIN
backend/app/models/__pycache__/site.cpython-311.pyc
Normal file
BIN
backend/app/models/__pycache__/site.cpython-311.pyc
Normal file
Binary file not shown.
21
backend/app/models/project.py
Normal file
21
backend/app/models/project.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional
|
||||
from datetime import datetime
|
||||
|
||||
from app.models.site import Site
|
||||
|
||||
|
||||
class CoverageSettings(BaseModel):
|
||||
radius: float = 10000.0
|
||||
resolution: float = 200.0
|
||||
min_signal: float = -105.0
|
||||
max_signal: float = -65.0
|
||||
|
||||
|
||||
class Project(BaseModel):
|
||||
id: Optional[str] = None
|
||||
name: str = "global"
|
||||
created_at: datetime = Field(default_factory=datetime.utcnow)
|
||||
updated_at: datetime = Field(default_factory=datetime.utcnow)
|
||||
sites: list[Site] = []
|
||||
settings: CoverageSettings = Field(default_factory=CoverageSettings)
|
||||
35
backend/app/models/site.py
Normal file
35
backend/app/models/site.py
Normal file
@@ -0,0 +1,35 @@
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional
|
||||
|
||||
|
||||
class Sector(BaseModel):
|
||||
id: str
|
||||
name: str = "Alpha"
|
||||
power: float = 43.0
|
||||
gain: float = 8.0
|
||||
height: float = 30.0
|
||||
frequency: float = 1800.0
|
||||
azimuth: float = 0.0
|
||||
beamwidth: float = 65.0
|
||||
tilt: float = 0.0
|
||||
antenna_type: str = "directional"
|
||||
|
||||
|
||||
class Site(BaseModel):
|
||||
id: str
|
||||
name: str
|
||||
lat: float
|
||||
lon: float
|
||||
height: float = 30.0
|
||||
power: float = 43.0
|
||||
gain: float = 8.0
|
||||
frequency: float = 1800.0
|
||||
antenna_type: str = "omni"
|
||||
azimuth: Optional[float] = None
|
||||
beamwidth: Optional[float] = None
|
||||
tilt: Optional[float] = None
|
||||
color: str = "#ef4444"
|
||||
visible: bool = True
|
||||
notes: Optional[str] = None
|
||||
equipment: Optional[str] = None
|
||||
sectors: list[Sector] = []
|
||||
Reference in New Issue
Block a user