mirror of https://gitlab.com/pamhyr/pamhyr2
Compare commits
3 Commits
5adb0bdee5
...
3c3ac1f1df
| Author | SHA1 | Date |
|---|---|---|
|
|
3c3ac1f1df | |
|
|
80af278a0f | |
|
|
f254eaee25 |
|
|
@ -197,7 +197,7 @@ class AdisTS(CommandLineSolver):
|
|||
_nodes_views = set()
|
||||
|
||||
def get_reach_name(self, reach):
|
||||
return f"Reach_{reach.id:>3}".replace(" ", "0")
|
||||
return f"Reach_{reach.id + 1:>3}".replace(" ", "0")
|
||||
|
||||
def get_node_name(self, node):
|
||||
"""Generate a 3 char name for node
|
||||
|
|
@ -338,9 +338,9 @@ class AdisTSwc(AdisTS):
|
|||
) as f:
|
||||
for LC in POL_LC:
|
||||
reach = next(filter(
|
||||
lambda edge: edge.id == LC.edge, study.river.edges()
|
||||
lambda edge: edge.id == LC.edge, study.river.enable_edges()
|
||||
)) # .name
|
||||
reach_name = self.get_reach_name(self, reach)
|
||||
reach_name = self.get_reach_name(reach)
|
||||
f.write(f"${reach_name} {LC.begin_rk} {LC.end_rk}\n")
|
||||
f.write(f"*temps |débit massique (kg/s)\n")
|
||||
f.write(f"*---------++++++++++\n")
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
from View.Tools.PamhyrWindow import PamhyrDialog
|
||||
|
||||
from PyQt5.QtWidgets import (
|
||||
QRadioButton, QCheckBox, QVBoxLayout, QLabel,
|
||||
QRadioButton, QCheckBox, QVBoxLayout, QLabel, QFrame
|
||||
)
|
||||
|
||||
from View.Results.translate import ResultsTranslate
|
||||
|
|
@ -43,6 +43,7 @@ class CustomExportDialog(PamhyrDialog):
|
|||
|
||||
self.setup_radio_buttons_x()
|
||||
self.setup_radio_buttons_res()
|
||||
self.setup_label()
|
||||
self.setup_envelop_box()
|
||||
self.setup_check_boxes()
|
||||
|
||||
|
|
@ -87,6 +88,22 @@ class CustomExportDialog(PamhyrDialog):
|
|||
|
||||
layout.addStretch()
|
||||
|
||||
def setup_label(self):
|
||||
self._label = self.find(QLabel, "label_4")
|
||||
self._label.setFrameStyle(QFrame.StyledPanel)
|
||||
self._label.setStyleSheet('background-color: white')
|
||||
self.set_label()
|
||||
for r in self._radio:
|
||||
r[1].clicked.connect(self.set_label)
|
||||
|
||||
def set_label(self):
|
||||
if self._radio[0][1].isChecked():
|
||||
self._label.setText(self._parent.text_bief() + "\n" +
|
||||
self._parent.text_time())
|
||||
else:
|
||||
self._label.setText(self._parent.text_bief() + "\n" +
|
||||
self._parent.text_profile())
|
||||
|
||||
def setup_envelop_box(self):
|
||||
layout = self.find(QVBoxLayout, "verticalLayout_x")
|
||||
self._envelop = QCheckBox(
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
from View.Tools.PamhyrWindow import PamhyrDialog
|
||||
|
||||
from PyQt5.QtWidgets import (
|
||||
QRadioButton, QCheckBox, QVBoxLayout,
|
||||
QRadioButton, QCheckBox, QVBoxLayout, QLabel, QFrame
|
||||
)
|
||||
|
||||
from View.Results.translate import ResultsTranslate
|
||||
|
|
@ -50,6 +50,7 @@ class CustomExportAdisDialog(PamhyrDialog):
|
|||
|
||||
self.setup_radio_buttons_x()
|
||||
self.setup_radio_buttons_pol()
|
||||
self.setup_label()
|
||||
self.setup_check_boxes()
|
||||
|
||||
self.value = None
|
||||
|
|
@ -84,6 +85,22 @@ class CustomExportAdisDialog(PamhyrDialog):
|
|||
self._radio2[0][1].setChecked(True)
|
||||
layout.addStretch()
|
||||
|
||||
def setup_label(self):
|
||||
self._label = self.find(QLabel, "label_4")
|
||||
self._label.setFrameStyle(QFrame.StyledPanel)
|
||||
self._label.setStyleSheet('background-color: white')
|
||||
self.set_label()
|
||||
for r in self._radio:
|
||||
r[1].clicked.connect(self.set_label)
|
||||
|
||||
def set_label(self):
|
||||
if self._radio[0][1].isChecked():
|
||||
self._label.setText(self._parent.text_bief() + "\n" +
|
||||
self._parent.text_time())
|
||||
else:
|
||||
self._label.setText(self._parent.text_bief() + "\n" +
|
||||
self._parent.text_profile())
|
||||
|
||||
def setup_check_boxes(self):
|
||||
self._check = []
|
||||
layout = self.find(QVBoxLayout, "verticalLayout_y")
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
from View.Tools.PamhyrWindow import PamhyrDialog
|
||||
|
||||
from PyQt5.QtWidgets import (
|
||||
QRadioButton, QCheckBox, QVBoxLayout,
|
||||
QRadioButton, QCheckBox, QVBoxLayout, QLabel, QFrame
|
||||
)
|
||||
|
||||
from View.Results.CustomPlot.Translate import CustomPlotTranslate
|
||||
|
|
@ -38,10 +38,12 @@ class CustomPlotValuesSelectionDialog(PamhyrDialog):
|
|||
parent=parent
|
||||
)
|
||||
|
||||
self._parent = parent
|
||||
self._available_values_x = self._trad.get_dict("values_x")
|
||||
self._available_values_y = self._trad.get_dict("values_y")
|
||||
|
||||
self.setup_radio_buttons()
|
||||
self.setup_label()
|
||||
self.setup_envelop_box()
|
||||
self.setup_check_boxs()
|
||||
|
||||
|
|
@ -62,6 +64,22 @@ class CustomPlotValuesSelectionDialog(PamhyrDialog):
|
|||
self._radio[0][1].setChecked(True)
|
||||
layout.addStretch()
|
||||
|
||||
def setup_label(self):
|
||||
self._label = self.find(QLabel, "label_3")
|
||||
self._label.setFrameStyle(QFrame.StyledPanel)
|
||||
self._label.setStyleSheet('background-color: white')
|
||||
self.set_label()
|
||||
for r in self._radio:
|
||||
r[1].clicked.connect(self.set_label)
|
||||
|
||||
def set_label(self):
|
||||
if self._radio[0][1].isChecked():
|
||||
self._label.setText(self._parent.text_bief() + "\n" +
|
||||
self._parent.text_time())
|
||||
else:
|
||||
self._label.setText(self._parent.text_bief() + "\n" +
|
||||
self._parent.text_profile())
|
||||
|
||||
def setup_envelop_box(self):
|
||||
self._envelop = []
|
||||
layout = self.find(QVBoxLayout, "verticalLayout_x")
|
||||
|
|
|
|||
|
|
@ -288,16 +288,12 @@ class ResultsWindow(PamhyrWindow):
|
|||
super(ResultsWindow, self).closeEvent(event)
|
||||
|
||||
def _compute_status_label(self):
|
||||
# Timestamp
|
||||
ts = self._timestamps[self._slider_time.value()]
|
||||
|
||||
t0 = datetime.fromtimestamp(0)
|
||||
fts = str(
|
||||
datetime.fromtimestamp(ts) - t0
|
||||
)
|
||||
fts.replace("days", _translate("Results", "days"))\
|
||||
.replace("day", _translate("Results", "day"))
|
||||
return (self.text_bief() + " | " +
|
||||
self.text_profile() + " | " +
|
||||
self.text_time())
|
||||
|
||||
def text_bief(self):
|
||||
# Reach
|
||||
table = self.find(QTableView, f"tableView_reach")
|
||||
indexes = table.selectedIndexes()
|
||||
|
|
@ -305,7 +301,16 @@ class ResultsWindow(PamhyrWindow):
|
|||
reach = self._study.river.enable_edges()[0]
|
||||
else:
|
||||
reach = self._study.river.enable_edges()[indexes[0].row()]
|
||||
return f"{self._trad['reach']}: {reach.name}"
|
||||
|
||||
def text_profile(self):
|
||||
# Reach
|
||||
table = self.find(QTableView, f"tableView_reach")
|
||||
indexes = table.selectedIndexes()
|
||||
if len(indexes) == 0:
|
||||
reach = self._study.river.enable_edges()[0]
|
||||
else:
|
||||
reach = self._study.river.enable_edges()[indexes[0].row()]
|
||||
# Profile
|
||||
table = self.find(QTableView, f"tableView_profile")
|
||||
indexes = table.selectedIndexes()
|
||||
|
|
@ -315,10 +320,22 @@ class ResultsWindow(PamhyrWindow):
|
|||
profile = reach.reach.profile(indexes[0].row())
|
||||
|
||||
pname = profile.name if profile.name != "" else profile.rk
|
||||
return f"{self._trad['cross_section']}: {pname}"
|
||||
|
||||
return (f"{self._trad['reach']}: {reach.name} | " +
|
||||
f"{self._trad['cross_section']}: {pname} | " +
|
||||
f"{self._trad['unit_time_s']} : {fts} ({ts} sec)")
|
||||
def text_time(self):
|
||||
# Timestamp
|
||||
ts = self._timestamps[self._slider_time.value()]
|
||||
|
||||
t0 = datetime.fromtimestamp(0)
|
||||
fts = str(
|
||||
datetime.fromtimestamp(ts) - t0
|
||||
)
|
||||
fts = str(
|
||||
datetime.fromtimestamp(ts) - t0
|
||||
)
|
||||
fts.replace("days", _translate("Results", "days"))\
|
||||
.replace("day", _translate("Results", "day"))
|
||||
return f"{self._trad['time']} : {fts} ({ts} sec)"
|
||||
|
||||
def setup_statusbar(self):
|
||||
txt = self._compute_status_label()
|
||||
|
|
|
|||
|
|
@ -7,23 +7,13 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>194</width>
|
||||
<height>70</height>
|
||||
<height>126</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="4" column="0">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QSplitter" name="splitter">
|
||||
<property name="orientation">
|
||||
|
|
@ -64,6 +54,23 @@
|
|||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
|
|
|
|||
|
|
@ -7,14 +7,24 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>414</width>
|
||||
<height>70</height>
|
||||
<height>132</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<item row="3" column="0">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QSplitter" name="splitter">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
|
|
@ -43,13 +53,10 @@
|
|||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>TextLabel</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!DOCTYPE TS><TS version="2.0" language="fr_FR" sourcelanguage="en_150">
|
||||
<!DOCTYPE TS>
|
||||
<TS version="2.1" language="fr_FR" sourcelanguage="en_150">
|
||||
<context>
|
||||
<name>About</name>
|
||||
<message>
|
||||
|
|
@ -1295,14 +1296,9 @@ Cette fonctionnalité nécessite un bief muni d'une géométrie.</translati
|
|||
<translation>Version : @version @codename</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/ui/about.ui" line="94"/>
|
||||
<source>Copyright © 2022-2025 INRAE</source>
|
||||
<translation type="obsolete">Copyright © 2022-2025 INRAE</translation>
|
||||
</message>
|
||||
<message encoding="UTF-8">
|
||||
<location filename="../View/ui/about.ui" line="94"/>
|
||||
<source>Copyright © 2022-2025 INRAE</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation type="obsolete">Copyright © 2022-2025 INRAE</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
|
|
@ -2689,17 +2685,17 @@ Cette fonctionnalité nécessite un bief muni d'une géométrie.</translati
|
|||
<message>
|
||||
<location filename="../View/ui/InitialConditions.ui" line="30"/>
|
||||
<source>Generate uniform depth</source>
|
||||
<translation>Générer une profondeur uniforme</translation>
|
||||
<translation>Profondeur uniforme</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/ui/InitialConditions.ui" line="37"/>
|
||||
<source>Generate uniform discharge</source>
|
||||
<translation>Générer un débit uniforme</translation>
|
||||
<translation>Débit uniforme</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/ui/InitialConditions.ui" line="44"/>
|
||||
<source>Generate uniform elevation</source>
|
||||
<translation>Générer une cote uniforme</translation>
|
||||
<translation>Cote uniforme</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../View/ui/Results.ui" line="149"/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue