mirror of https://gitlab.com/pamhyr/pamhyr2
BC: Edit: Add X and Y column name for not defined bc type.
parent
0546b304be
commit
e987962510
|
|
@ -13,7 +13,7 @@ class BoundaryCondition(object):
|
||||||
self._node = None
|
self._node = None
|
||||||
self._data = []
|
self._data = []
|
||||||
self._header = []
|
self._header = []
|
||||||
self._types = [int, float]
|
self._types = [float, float]
|
||||||
|
|
||||||
def __len__(self):
|
def __len__(self):
|
||||||
return len(self._data)
|
return len(self._data)
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,11 @@ class NotDefined(BoundaryCondition):
|
||||||
super(NotDefined, self).__init__(name=name)
|
super(NotDefined, self).__init__(name=name)
|
||||||
|
|
||||||
self._type = "ND"
|
self._type = "ND"
|
||||||
self._header = ["", ""]
|
self._header = ["x", "y"]
|
||||||
|
|
||||||
|
@property
|
||||||
|
def _default_0(self):
|
||||||
|
return 0.0
|
||||||
|
|
||||||
class PonctualContribution(BoundaryCondition):
|
class PonctualContribution(BoundaryCondition):
|
||||||
def __init__(self, name:str = ""):
|
def __init__(self, name:str = ""):
|
||||||
|
|
@ -18,6 +22,7 @@ class PonctualContribution(BoundaryCondition):
|
||||||
|
|
||||||
self._type = "PC"
|
self._type = "PC"
|
||||||
self._header = ["time", "debit"]
|
self._header = ["time", "debit"]
|
||||||
|
self._types = [int, float]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def compatibility(cls):
|
def compatibility(cls):
|
||||||
|
|
@ -29,6 +34,7 @@ class TimeOverZ(BoundaryCondition):
|
||||||
|
|
||||||
self._type = "TZ"
|
self._type = "TZ"
|
||||||
self._header = ["time", "z"]
|
self._header = ["time", "z"]
|
||||||
|
self._types = [int, float]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def compatibility(cls):
|
def compatibility(cls):
|
||||||
|
|
@ -40,6 +46,7 @@ class TimeOverDebit(BoundaryCondition):
|
||||||
|
|
||||||
self._type = "TD"
|
self._type = "TD"
|
||||||
self._header = ["time", "debit"]
|
self._header = ["time", "debit"]
|
||||||
|
self._types = [int, float]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def compatibility(cls):
|
def compatibility(cls):
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ class BoundaryConditionWindow(ASubMainWindow, ListedSubWindow):
|
||||||
)
|
)
|
||||||
|
|
||||||
self._study = study
|
self._study = study
|
||||||
self._lst = self._study.river.boundary_condition
|
self._bcs = self._study.river.boundary_condition
|
||||||
|
|
||||||
self.setup_sc()
|
self.setup_sc()
|
||||||
self.setup_table()
|
self.setup_table()
|
||||||
|
|
@ -154,7 +154,7 @@ class BoundaryConditionWindow(ASubMainWindow, ListedSubWindow):
|
||||||
def add(self):
|
def add(self):
|
||||||
tab = self.current_tab()
|
tab = self.current_tab()
|
||||||
rows = self.index_selected_rows()
|
rows = self.index_selected_rows()
|
||||||
if self._lst.len(tab) == 0 or len(rows) == 0:
|
if self._bcs.len(tab) == 0 or len(rows) == 0:
|
||||||
self._table[tab].add(0)
|
self._table[tab].add(0)
|
||||||
else:
|
else:
|
||||||
self._table[tab].add(rows[0])
|
self._table[tab].add(rows[0])
|
||||||
|
|
@ -196,10 +196,11 @@ class BoundaryConditionWindow(ASubMainWindow, ListedSubWindow):
|
||||||
self._table[tab].redo()
|
self._table[tab].redo()
|
||||||
|
|
||||||
def edit(self):
|
def edit(self):
|
||||||
|
tab = self.current_tab()
|
||||||
rows = self.index_selected_rows()
|
rows = self.index_selected_rows()
|
||||||
for row in rows:
|
for row in rows:
|
||||||
win = EditBoundaryConditionWindow(
|
win = EditBoundaryConditionWindow(
|
||||||
data=self._lst[row],
|
data=self._bcs.get(tab, row),
|
||||||
parent=self
|
parent=self
|
||||||
)
|
)
|
||||||
win.show()
|
win.show()
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,8 @@ from PyQt5.QtCore import QCoreApplication
|
||||||
_translate = QCoreApplication.translate
|
_translate = QCoreApplication.translate
|
||||||
|
|
||||||
table_headers = {
|
table_headers = {
|
||||||
|
"x": _translate("BoundaryCondition", "X"),
|
||||||
|
"y": _translate("BoundaryCondition", "Y"),
|
||||||
"time": _translate("BoundaryCondition", "Time"),
|
"time": _translate("BoundaryCondition", "Time"),
|
||||||
"debit": _translate("BoundaryCondition", "Debit"),
|
"debit": _translate("BoundaryCondition", "Debit"),
|
||||||
"z": _translate("BoundaryCondition", "Z (m)")
|
"z": _translate("BoundaryCondition", "Z (m)")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue