adists_release
Theophile Terraz 2024-08-07 17:56:12 +02:00
parent 3693c32d4b
commit 845bf3c325
5 changed files with 16 additions and 13 deletions

View File

@ -374,8 +374,8 @@ class BoundaryCondition(SQLSubModel):
def reach(self, river):
edges = []
if self._node != None:
if river != None:
if self._node is not None:
if river is not None:
for edge in river.edges():
if edge.node1.name == self._node.name:
edges.append(edge.reach)

View File

@ -211,4 +211,3 @@ class TableModel(PamhyrTableModel):
)
self.layoutAboutToBeChanged.emit()
self.update()

View File

@ -182,6 +182,7 @@ class PasteCommand(QUndoCommand):
for bc in self._bcs:
self._data.insert(self._row, bc)
class ReplaceDataCommand(QUndoCommand):
def __init__(self, data, data1, data2):
QUndoCommand.__init__(self)

View File

@ -196,8 +196,12 @@ class EditBoundaryConditionWindow(PamhyrWindow):
self.find(QAction, "action_add").triggered.connect(self.add)
self.find(QAction, "action_del").triggered.connect(self.delete)
self.find(QAction, "action_sort").triggered.connect(self.sort)
self.find(QAction, "action_generate_uniform").triggered.connect(self.generate_uniform)
self.find(QAction, "action_generate_critical").triggered.connect(self.generate_critical)
self.find(QAction, "action_generate_uniform").triggered.connect(
self.generate_uniform
)
self.find(QAction, "action_generate_critical").triggered.connect(
self.generate_critical
)
if self._data.bctype != "ZD" or not self._data.has_node:
self.find(QAction, "action_generate_uniform").setVisible(False)
self.find(QAction, "action_generate_critical").setVisible(False)
@ -334,10 +338,8 @@ class EditBoundaryConditionWindow(PamhyrWindow):
strickler = 25
height = [(i)*(z_max-z_min)/50 for i in range(51)]
q = [((profile.wet_width(z_min + h) * 0.8) * strickler
* (h ** (5/3))
* (abs(incline) ** (0.5)))
for h in height
]
* (h ** (5/3)) * (abs(incline) ** (0.5)))
for h in height]
self._table.replace_data(height, q)
return
@ -351,8 +353,8 @@ class EditBoundaryConditionWindow(PamhyrWindow):
z_min = profile.z_min()
z_max = profile.z_max()
height = [(i)*(z_max-z_min)/50 for i in range(51)]
q = [sqrt(9.81 * (profile.wet_area(z_min + h) ** 3) / profile.wet_width(z_min + h))
for h in height
]
q = [sqrt(9.81 * (profile.wet_area(z_min + h) ** 3)
/ profile.wet_width(z_min + h))
for h in height]
self._table.replace_data(height, q)
return

View File

@ -128,7 +128,8 @@ class ResultsWindow(PamhyrWindow):
undo=self._undo_stack,
opt_data=t
)
self._table[t]._timestamp = self._timestamps[self._slider_time.value()]
self._table[t]._timestamp = self._timestamps[
self._slider_time.value()]
def setup_slider(self):
self._slider_profile = self.find(QSlider, f"verticalSlider_profile")