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): def reach(self, river):
edges = [] edges = []
if self._node != None: if self._node is not None:
if river != None: if river is not None:
for edge in river.edges(): for edge in river.edges():
if edge.node1.name == self._node.name: if edge.node1.name == self._node.name:
edges.append(edge.reach) edges.append(edge.reach)

View File

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

View File

@ -182,6 +182,7 @@ class PasteCommand(QUndoCommand):
for bc in self._bcs: for bc in self._bcs:
self._data.insert(self._row, bc) self._data.insert(self._row, bc)
class ReplaceDataCommand(QUndoCommand): class ReplaceDataCommand(QUndoCommand):
def __init__(self, data, data1, data2): def __init__(self, data, data1, data2):
QUndoCommand.__init__(self) 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_add").triggered.connect(self.add)
self.find(QAction, "action_del").triggered.connect(self.delete) self.find(QAction, "action_del").triggered.connect(self.delete)
self.find(QAction, "action_sort").triggered.connect(self.sort) 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_uniform").triggered.connect(
self.find(QAction, "action_generate_critical").triggered.connect(self.generate_critical) 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: if self._data.bctype != "ZD" or not self._data.has_node:
self.find(QAction, "action_generate_uniform").setVisible(False) self.find(QAction, "action_generate_uniform").setVisible(False)
self.find(QAction, "action_generate_critical").setVisible(False) self.find(QAction, "action_generate_critical").setVisible(False)
@ -334,10 +338,8 @@ class EditBoundaryConditionWindow(PamhyrWindow):
strickler = 25 strickler = 25
height = [(i)*(z_max-z_min)/50 for i in range(51)] height = [(i)*(z_max-z_min)/50 for i in range(51)]
q = [((profile.wet_width(z_min + h) * 0.8) * strickler q = [((profile.wet_width(z_min + h) * 0.8) * strickler
* (h ** (5/3)) * (h ** (5/3)) * (abs(incline) ** (0.5)))
* (abs(incline) ** (0.5))) for h in height]
for h in height
]
self._table.replace_data(height, q) self._table.replace_data(height, q)
return return
@ -351,8 +353,8 @@ class EditBoundaryConditionWindow(PamhyrWindow):
z_min = profile.z_min() z_min = profile.z_min()
z_max = profile.z_max() z_max = profile.z_max()
height = [(i)*(z_max-z_min)/50 for i in range(51)] 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)) q = [sqrt(9.81 * (profile.wet_area(z_min + h) ** 3)
for h in height / profile.wet_width(z_min + h))
] for h in height]
self._table.replace_data(height, q) self._table.replace_data(height, q)
return return

View File

@ -128,7 +128,8 @@ class ResultsWindow(PamhyrWindow):
undo=self._undo_stack, undo=self._undo_stack,
opt_data=t 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): def setup_slider(self):
self._slider_profile = self.find(QSlider, f"verticalSlider_profile") self._slider_profile = self.find(QSlider, f"verticalSlider_profile")