mirror of https://gitlab.com/pamhyr/pamhyr2
debug enable hydraulic structures
parent
fd1b2b1041
commit
d871bbfc3b
|
|
@ -302,7 +302,7 @@ class MeshingWithMageMailleurTT(AMeshingTool):
|
||||||
|
|
||||||
with tempfile.TemporaryDirectory() as tmp:
|
with tempfile.TemporaryDirectory() as tmp:
|
||||||
logger.debug(f"temp file: {tmp}")
|
logger.debug(f"temp file: {tmp}")
|
||||||
st_file = self.export_reach_to_st(reach, tmp)
|
st_file = self.export_reach_to_st(reach, "tmp")
|
||||||
m_file = st_file.rsplit(".ST", 1)[0] + ".M"
|
m_file = st_file.rsplit(".ST", 1)[0] + ".M"
|
||||||
|
|
||||||
os.sync()
|
os.sync()
|
||||||
|
|
|
||||||
|
|
@ -495,6 +495,9 @@ class Mage(CommandLineSolver):
|
||||||
if not hs.input_reach.is_enable():
|
if not hs.input_reach.is_enable():
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if not hs.enabled:
|
||||||
|
continue
|
||||||
|
|
||||||
if hs.input_kp is None:
|
if hs.input_kp is None:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
|
@ -510,25 +513,26 @@ class Mage(CommandLineSolver):
|
||||||
|
|
||||||
def _export_SIN_bhs(self, study, sin_dict, hs, f):
|
def _export_SIN_bhs(self, study, sin_dict, hs, f):
|
||||||
for bhs in hs.basic_structures:
|
for bhs in hs.basic_structures:
|
||||||
reach_id = study.river.get_edge_id(hs.input_reach) + 1
|
if bhs.enabled:
|
||||||
param_str = ' '.join(
|
reach_id = study.river.get_edge_id(hs.input_reach) + 1
|
||||||
[
|
param_str = ' '.join(
|
||||||
f'{p:>10.3f}'
|
[
|
||||||
for p in self._export_SIN_parameters(bhs)
|
f'{p:>10.3f}'
|
||||||
]
|
for p in self._export_SIN_parameters(bhs)
|
||||||
)
|
]
|
||||||
|
)
|
||||||
|
|
||||||
name = bhs.name
|
name = bhs.name
|
||||||
if name == "":
|
if name == "":
|
||||||
name = f"HS_{bhs.id:>3}".replace(" ", "0")
|
name = f"HS_{bhs.id:>3}".replace(" ", "0")
|
||||||
else:
|
else:
|
||||||
name = name.replace(" ", "_")
|
name = name.replace(" ", "_")
|
||||||
|
|
||||||
f.write(
|
f.write(
|
||||||
f"{sin_dict[bhs._type]} " +
|
f"{sin_dict[bhs._type]} " +
|
||||||
f"{reach_id} {float(hs.input_kp):>12.3f} " +
|
f"{reach_id} {float(hs.input_kp):>12.3f} " +
|
||||||
f"{param_str} {name}\n"
|
f"{param_str} {name}\n"
|
||||||
)
|
)
|
||||||
|
|
||||||
def _export_SIN_parameters(self, bhs):
|
def _export_SIN_parameters(self, bhs):
|
||||||
res = [9999.999] * 5
|
res = [9999.999] * 5
|
||||||
|
|
|
||||||
|
|
@ -252,13 +252,14 @@ class BasicHydraulicStructuresWindow(PamhyrWindow):
|
||||||
self._checkbox.setChecked(self._hs.basic_structure(row).enabled)
|
self._checkbox.setChecked(self._hs.basic_structure(row).enabled)
|
||||||
|
|
||||||
def _set_basic_structure_state(self):
|
def _set_basic_structure_state(self):
|
||||||
row = self.index_selected_row()
|
rows = self.index_selected_rows()
|
||||||
|
if len(rows) != 0:
|
||||||
if row is not None:
|
for row in rows:
|
||||||
self._table.enabled(
|
if row is not None:
|
||||||
row,
|
self._table.enabled(
|
||||||
self._checkbox.isChecked()
|
row,
|
||||||
)
|
self._checkbox.isChecked()
|
||||||
|
)
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
self._set_checkbox_state()
|
self._set_checkbox_state()
|
||||||
|
|
|
||||||
|
|
@ -262,12 +262,14 @@ class HydraulicStructuresWindow(PamhyrWindow):
|
||||||
self._checkbox.setChecked(self._hs_lst.get(row).enabled)
|
self._checkbox.setChecked(self._hs_lst.get(row).enabled)
|
||||||
|
|
||||||
def _set_structure_state(self):
|
def _set_structure_state(self):
|
||||||
row = self.index_selected_row()
|
rows = self.index_selected_rows()
|
||||||
if row is not None:
|
if len(rows) != 0:
|
||||||
self._table.enabled(
|
for row in rows:
|
||||||
row,
|
if row is not None:
|
||||||
self._checkbox.isChecked()
|
self._table.enabled(
|
||||||
)
|
row,
|
||||||
|
self._checkbox.isChecked()
|
||||||
|
)
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
self._set_checkbox_state()
|
self._set_checkbox_state()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue