mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
IC: Add speed column in table.
This commit is contained in:
1 parent
4cec45131e
commit
0c039793df
4 files changed
+17
-5
No files matched your search
@@ -104,7 +104,18 @@ class InitialConditionTableModel(PamhyrTableModel):
|
||||
row = index.row()
|
||||
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]]
|
||||
return f"{v:.4f}"
|
||||
else:
|
||||
|
||||
Reference in new issue
Block a user