mirror of https://gitlab.com/pamhyr/pamhyr2
add make increasing button in boundary condition rating curve
parent
0b78522ca5
commit
f755b7ce74
|
|
@ -204,12 +204,17 @@ class EditBoundaryConditionWindow(PamhyrWindow):
|
||||||
self.find(QAction, "action_generate_critical").triggered.connect(
|
self.find(QAction, "action_generate_critical").triggered.connect(
|
||||||
self.generate_critical
|
self.generate_critical
|
||||||
)
|
)
|
||||||
|
self.find(QAction, "action_increasing").triggered.connect(
|
||||||
|
self.make_increasing
|
||||||
|
)
|
||||||
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)
|
||||||
|
self.find(QAction, "action_increasing").setVisible(False)
|
||||||
else:
|
else:
|
||||||
self.find(QAction, "action_generate_uniform").setVisible(True)
|
self.find(QAction, "action_generate_uniform").setVisible(True)
|
||||||
self.find(QAction, "action_generate_critical").setVisible(True)
|
self.find(QAction, "action_generate_critical").setVisible(True)
|
||||||
|
self.find(QAction, "action_increasing").setVisible(True)
|
||||||
|
|
||||||
self._table.dataChanged.connect(self.update)
|
self._table.dataChanged.connect(self.update)
|
||||||
self._table.layoutChanged.connect(self.update)
|
self._table.layoutChanged.connect(self.update)
|
||||||
|
|
@ -382,3 +387,21 @@ class EditBoundaryConditionWindow(PamhyrWindow):
|
||||||
height[i] += z_min
|
height[i] += z_min
|
||||||
self._table.replace_data(height, q)
|
self._table.replace_data(height, q)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def make_increasing(self):
|
||||||
|
if self._data.has_node:
|
||||||
|
node = self._data.node
|
||||||
|
if node is None:
|
||||||
|
return
|
||||||
|
if len(self._table._data) < 2:
|
||||||
|
return
|
||||||
|
h = [self._data.get_i(0)[0]]
|
||||||
|
q = [self._data.get_i(0)[1]]
|
||||||
|
for i in range(len(self._table._data)):
|
||||||
|
if i == 0:
|
||||||
|
continue
|
||||||
|
row = self._data.get_i(i)
|
||||||
|
if row[1] > q[-1]:
|
||||||
|
h.append(row[0])
|
||||||
|
q.append(row[1])
|
||||||
|
self._table.replace_data(h, q)
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,7 @@
|
||||||
<addaction name="action_sort"/>
|
<addaction name="action_sort"/>
|
||||||
<addaction name="action_generate_uniform"/>
|
<addaction name="action_generate_uniform"/>
|
||||||
<addaction name="action_generate_critical"/>
|
<addaction name="action_generate_critical"/>
|
||||||
|
<addaction name="action_increasing"/>
|
||||||
</widget>
|
</widget>
|
||||||
<action name="action_add">
|
<action name="action_add">
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
|
|
@ -140,6 +141,14 @@
|
||||||
<string>Generate rating curve as Q(z) = Sqrt(g*S(z)^3/L(z))</string>
|
<string>Generate rating curve as Q(z) = Sqrt(g*S(z)^3/L(z))</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="action_increasing">
|
||||||
|
<property name="text">
|
||||||
|
<string>Make increasing</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Remove points to make the curve increasing</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Upstream Height (m)</string>
|
<string>Upstream height (m)</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -64,7 +64,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Downstream Height (m)</string>
|
<string>Downstream height (m)</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -95,7 +95,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="checkBox">
|
<widget class="QCheckBox" name="checkBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Generate Constant Discharge</string>
|
<string>Generate constant discharge</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue