Commit 0c039793 authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

IC: Add speed column in table.

Showing with 17 additions and 5 deletions
+17 -5
...@@ -104,7 +104,18 @@ class InitialConditionTableModel(PamhyrTableModel): ...@@ -104,7 +104,18 @@ class InitialConditionTableModel(PamhyrTableModel):
row = index.row() row = index.row()
column = index.column() column = index.column()
if self._headers[column] not in ["name", "comment"]: if self._headers[column] is "speed":
z = self._lst.get(row)["elevation"]
q = self._lst.get(row)["discharge"]
profile = self._reach.reach.get_profiles_from_kp(
self._lst.get(row)["kp"]
)
if len(profile) >= 1:
speed = profile[0].speed(q, z)
return f"{speed:.4f}"
return ""
elif self._headers[column] not in ["name", "comment"]:
v = self._lst.get(row)[self._headers[column]] v = self._lst.get(row)[self._headers[column]]
return f"{v:.4f}" return f"{v:.4f}"
else: else:
......
...@@ -41,7 +41,7 @@ class ICTranslate(MainTranslate): ...@@ -41,7 +41,7 @@ class ICTranslate(MainTranslate):
self._sub_dict["table_headers"] = { self._sub_dict["table_headers"] = {
# "name": _translate("InitialCondition", "Name"), # "name": _translate("InitialCondition", "Name"),
"kp": self._dict["unit_kp"], "kp": self._dict["unit_kp"],
# "speed": _translate("InitialCondition", "Speed (m/s)"), "speed": self._dict["unit_speed"],
"discharge": self._dict["unit_discharge"], "discharge": self._dict["unit_discharge"],
"elevation": self._dict["unit_elevation"], "elevation": self._dict["unit_elevation"],
"height": self._dict["unit_height"], "height": self._dict["unit_height"],
......
...@@ -61,6 +61,7 @@ class UnitTranslate(CommonWordTranslate): ...@@ -61,6 +61,7 @@ class UnitTranslate(CommonWordTranslate):
self._dict["unit_water_elevation"] = _translate( self._dict["unit_water_elevation"] = _translate(
"Unit", "Water elevation (m)" "Unit", "Water elevation (m)"
) )
self._dict["unit_speed"] = _translate("Unit", "Speed (m/s)")
self._dict["unit_discharge"] = _translate("Unit", "Discharge (m³/s)") self._dict["unit_discharge"] = _translate("Unit", "Discharge (m³/s)")
self._dict["unit_area"] = _translate("Unit", "Area (hectare)") self._dict["unit_area"] = _translate("Unit", "Area (hectare)")
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>889</width> <width>1024</width>
<height>480</height> <height>576</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>889</width> <width>1024</width>
<height>22</height> <height>22</height>
</rect> </rect>
</property> </property>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment