Skip to content

Commit

Permalink
Schema 300 forms with timeseries (#285)
Browse files Browse the repository at this point in the history
* More schema 219 -> 300 plugin refactoring.
---------

Co-authored-by: lukasz.debek <[email protected]>
  • Loading branch information
ldebek and ldebek committed Jan 21, 2025
1 parent d4c0d1c commit ba08fe7
Show file tree
Hide file tree
Showing 12 changed files with 4,406 additions and 821 deletions.
40 changes: 6 additions & 34 deletions threedi_schematisation_editor/data_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ class BoundaryCondition2D(ModelObject):
__geometrytype__ = GeometryType.Linestring

id: int
code: str
display_name: str
type: BoundaryType
timeseries: str
Expand Down Expand Up @@ -923,20 +924,6 @@ class CrossSectionDefinition(ModelObject):
vegetation_drag_coefficients: Optional[str]


@dataclass
class Timeseries(ModelObject):
__tablename__ = "timeseries"
__layername__ = "Timeseries"
__geometrytype__ = GeometryType.NoGeometry

id: int
reference_layer: str
reference_id: int
offset: int # seconds
duration: int # seconds
value: float


@dataclass
class MeasureLocation(ModelObject):
__tablename__ = "measure_location"
Expand Down Expand Up @@ -1030,13 +1017,6 @@ class VegetationDrag2DSettings(ModelObject):
vegetation_drag_coefficient_file: Optional[str]


MODEL_BOUNDARY_CONDITION_ELEMENTS = (
BoundaryCondition1D,
BoundaryCondition2D,
Lateral1D,
Lateral2D,
)

MODEL_1D_ELEMENTS = (
ConnectionNode,
BoundaryCondition1D,
Expand All @@ -1054,6 +1034,8 @@ class VegetationDrag2DSettings(ModelObject):
)

MODEL_2D_ELEMENTS = (
BoundaryCondition2D,
Lateral2D,
DEMAverageArea,
GridRefinementArea,
GridRefinementLine,
Expand All @@ -1068,9 +1050,9 @@ class VegetationDrag2DSettings(ModelObject):
MODEL_0D_INFLOW_ELEMENTS = (
Surface,
SurfaceMap,
SurfaceParameters,
DryWeatherFlow,
DryWeatherFlowMap,
SurfaceParameters,
DryWeatherFlowDistribution,
)

Expand Down Expand Up @@ -1099,18 +1081,8 @@ class VegetationDrag2DSettings(ModelObject):

HIDDEN_ELEMENTS = tuple()

ALL_MODELS = (
MODEL_BOUNDARY_CONDITION_ELEMENTS
+ MODEL_1D_ELEMENTS
+ MODEL_2D_ELEMENTS
+ MODEL_1D2D_ELEMENTS
+ MODEL_0D_INFLOW_ELEMENTS
+ SETTINGS_ELEMENTS
)
ALL_MODELS = ALL_MODELS + (
Timeseries,
CrossSectionDefinition,
)
ALL_MODELS = MODEL_1D_ELEMENTS + MODEL_2D_ELEMENTS + MODEL_1D2D_ELEMENTS + MODEL_0D_INFLOW_ELEMENTS + SETTINGS_ELEMENTS
ALL_MODELS = ALL_MODELS + (CrossSectionDefinition,)
ALL_MODELS = ALL_MODELS + STRUCTURE_CONTROL_ELEMENTS + HIDDEN_ELEMENTS

ELEMENTS_WITH_XS_DEF = (
Expand Down
Loading

0 comments on commit ba08fe7

Please sign in to comment.