mirror of https://gitlab.com/pamhyr/pamhyr2
work on results adis
parent
b85962bfcd
commit
d6f152958f
|
|
@ -53,6 +53,7 @@ class PlotAdis_dt(PamhyrPlot):
|
|||
self._key = key
|
||||
|
||||
self.label_x = self._trad["unit_time_s"]
|
||||
self._available_values_y = self._trad.get_dict("values_y_pol")
|
||||
|
||||
self.label = {}
|
||||
self.label["C"] = _translate("Results", "Concentration")
|
||||
|
|
@ -64,6 +65,8 @@ class PlotAdis_dt(PamhyrPlot):
|
|||
self.sed_id["C"] = 0
|
||||
self.sed_id["M"] = 1
|
||||
|
||||
self.label_y = self._available_values_y["unit_"+self._key]
|
||||
|
||||
self._isometric_axis = False
|
||||
|
||||
@property
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ class PlotAdis_dx(PamhyrPlot):
|
|||
self._key = key
|
||||
|
||||
self.label_x = self._trad["unit_pk"]
|
||||
self._available_values_y = self._trad.get_dict("values_y_pol")
|
||||
|
||||
self.label = {}
|
||||
self.label["C"] = _translate("Results", "Concentration")
|
||||
|
|
@ -64,6 +65,8 @@ class PlotAdis_dx(PamhyrPlot):
|
|||
self.sed_id["C"] = 0
|
||||
self.sed_id["M"] = 1
|
||||
|
||||
self.label_y = self._available_values_y["unit_"+self._key]
|
||||
|
||||
self._isometric_axis = False
|
||||
|
||||
@property
|
||||
|
|
@ -259,4 +262,8 @@ class PlotAdis_dx(PamhyrPlot):
|
|||
|
||||
self.y_max = np.max(y)
|
||||
self.y_min = np.min(y)
|
||||
if self.y_max - self.y_min < 1:
|
||||
self.y_min = (self.y_max + self.y_min)/2 - 0.5
|
||||
self.y_max = (self.y_max + self.y_min)/2 + 0.5
|
||||
|
||||
self.canvas.axes.set_ylim(self.y_min, self.y_max)
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class ResultsWindowAdisTS(PamhyrWindow):
|
|||
self._hash_data.append(self._results)
|
||||
|
||||
self._additional_plot = {}
|
||||
self._pol_id = 0
|
||||
self._pol_id = 1
|
||||
self._reach_id = 0
|
||||
self._profile_id = 0
|
||||
|
||||
|
|
@ -178,95 +178,114 @@ class ResultsWindowAdisTS(PamhyrWindow):
|
|||
self._timer = QTimer(self)
|
||||
|
||||
def setup_plots(self):
|
||||
self.canvas_dt = MplCanvas(width=5, height=4, dpi=100)
|
||||
self.canvas_dt.setObjectName("canvas_dt")
|
||||
self.toolbar_dt = PamhyrPlotToolbar(
|
||||
self.canvas_dt, self, items=[
|
||||
self.canvas_cdt = MplCanvas(width=5, height=4, dpi=100)
|
||||
self.canvas_cdt.setObjectName("canvas_cdt")
|
||||
self.toolbar_cdt = PamhyrPlotToolbar(
|
||||
self.canvas_cdt, self, items=[
|
||||
"home", "move", "zoom", "save",
|
||||
"iso", "back/forward"
|
||||
]
|
||||
)
|
||||
self.plot_layout_dt = self.find(
|
||||
self.plot_layout_cdt = self.find(
|
||||
QVBoxLayout, "verticalLayout_concentration_dt")
|
||||
self.plot_layout_dt.addWidget(self.toolbar_dt)
|
||||
self.plot_layout_dt.addWidget(self.canvas_dt)
|
||||
#self.plot_layout_cdt = self.find(
|
||||
#QVBoxLayout, "verticalLayout_cdt")
|
||||
self.plot_layout_cdt.addWidget(self.toolbar_cdt)
|
||||
self.plot_layout_cdt.addWidget(self.canvas_cdt)
|
||||
|
||||
self.plot_c_dt = PlotAdis_dt(
|
||||
canvas=self.canvas_dt,
|
||||
self.plot_cdt = PlotAdis_dt(
|
||||
canvas=self.canvas_cdt,
|
||||
results=self._results,
|
||||
reach_id=self._reach_id,
|
||||
profile_id=self._profile_id,
|
||||
pol_id=self._pol_id,
|
||||
key="C",
|
||||
trad=self._trad,
|
||||
toolbar=self.toolbar_dt
|
||||
toolbar=self.toolbar_cdt
|
||||
)
|
||||
self.plot_c_dt.draw()
|
||||
self.plot_cdt.draw()
|
||||
|
||||
self.canvas_dx = MplCanvas(width=5, height=4, dpi=100)
|
||||
self.canvas_dx.setObjectName("canvas_dx")
|
||||
self.toolbar_dx = PamhyrPlotToolbar(
|
||||
self.canvas_dt, self, items=[
|
||||
self.canvas_cdx = MplCanvas(width=5, height=4, dpi=100)
|
||||
self.canvas_cdx.setObjectName("canvas_cdx")
|
||||
self.toolbar_cdx = PamhyrPlotToolbar(
|
||||
self.canvas_cdx, self, items=[
|
||||
"home", "move", "zoom", "save",
|
||||
"iso", "back/forward"
|
||||
]
|
||||
)
|
||||
self.plot_layout_dx = self.find(
|
||||
self.plot_layout_cdx = self.find(
|
||||
QVBoxLayout, "verticalLayout_concentration_dx")
|
||||
self.plot_layout_dx.addWidget(self.toolbar_dx)
|
||||
self.plot_layout_dx.addWidget(self.canvas_dx)
|
||||
#self.plot_layout_cdx = self.find(
|
||||
#QVBoxLayout, "verticalLayout_cdx")
|
||||
self.plot_layout_cdx.addWidget(self.toolbar_cdx)
|
||||
self.plot_layout_cdx.addWidget(self.canvas_cdx)
|
||||
|
||||
self.plot_c_dx = PlotAdis_dx(
|
||||
canvas=self.canvas_dx,
|
||||
self.plot_cdx = PlotAdis_dx(
|
||||
canvas=self.canvas_cdx,
|
||||
results=self._results,
|
||||
reach_id=self._reach_id,
|
||||
profile_id=self._profile_id,
|
||||
pol_id=self._pol_id,
|
||||
key="C",
|
||||
trad=self._trad,
|
||||
toolbar=self.toolbar_dx
|
||||
toolbar=self.toolbar_cdx
|
||||
)
|
||||
self.plot_c_dx.draw()
|
||||
self.plot_cdx.draw()
|
||||
|
||||
self.canvas_3 = MplCanvas(width=5, height=4, dpi=100)
|
||||
self.canvas_3.setObjectName("canvas_3")
|
||||
self.toolbar_3 = PamhyrPlotToolbar(
|
||||
self.canvas_3, self, items=[
|
||||
self.canvas_mdx = MplCanvas(width=5, height=4, dpi=100)
|
||||
self.canvas_mdx.setObjectName("canvas_mdx")
|
||||
self.toolbar_mdx = PamhyrPlotToolbar(
|
||||
self.canvas_mdx, self, items=[
|
||||
"home", "move", "zoom", "save",
|
||||
"iso", "back/forward"
|
||||
]
|
||||
)
|
||||
self.plot_layout_3 = self.find(
|
||||
QVBoxLayout, "verticalLayout_mass")
|
||||
self.plot_layout_3.addWidget(self.toolbar_3)
|
||||
self.plot_layout_3.addWidget(self.canvas_3)
|
||||
self.plot_layout_mdx = self.find(
|
||||
QVBoxLayout, "verticalLayout_mass_dx2")
|
||||
self.plot_layout_mdx.addWidget(self.toolbar_mdx)
|
||||
self.plot_layout_mdx.addWidget(self.canvas_mdx)
|
||||
|
||||
#self.plot_m = PlotM(
|
||||
#canvas=self.canvas_3,
|
||||
#results=self._results,
|
||||
#reach_id=self._reach_id,
|
||||
#profile_id=self._profile_id,
|
||||
#pol_id=self._pol_id,
|
||||
#trad=self._trad,
|
||||
#toolbar=self.toolbar_3
|
||||
#)
|
||||
|
||||
|
||||
self.plot_m = PlotAdis_dx(
|
||||
canvas=self.canvas_3,
|
||||
self.plot_mdx = PlotAdis_dx(
|
||||
canvas=self.canvas_mdx,
|
||||
results=self._results,
|
||||
reach_id=self._reach_id,
|
||||
profile_id=self._profile_id,
|
||||
pol_id=self._pol_id,
|
||||
key="M",
|
||||
trad=self._trad,
|
||||
toolbar=self.toolbar_3
|
||||
toolbar=self.toolbar_mdx
|
||||
)
|
||||
|
||||
self.plot_m.draw()
|
||||
self.plot_mdx.draw()
|
||||
|
||||
self.canvas_mdt = MplCanvas(width=5, height=4, dpi=100)
|
||||
self.canvas_mdt.setObjectName("canvas_mdt")
|
||||
self.toolbar_mdt = PamhyrPlotToolbar(
|
||||
self.canvas_mdt, self, items=[
|
||||
"home", "move", "zoom", "save",
|
||||
"iso", "back/forward"
|
||||
]
|
||||
)
|
||||
self.plot_layout_mdt = self.find(
|
||||
QVBoxLayout, "verticalLayout_mass_dt2")
|
||||
self.plot_layout_mdt.addWidget(self.toolbar_mdt)
|
||||
self.plot_layout_mdt.addWidget(self.canvas_mdt)
|
||||
|
||||
self.plot_mdt = PlotAdis_dt(
|
||||
canvas=self.canvas_mdt,
|
||||
results=self._results,
|
||||
reach_id=self._reach_id,
|
||||
profile_id=self._profile_id,
|
||||
pol_id=self._pol_id,
|
||||
key="M",
|
||||
trad=self._trad,
|
||||
toolbar=self.toolbar_mdt
|
||||
)
|
||||
|
||||
self.plot_mdt.draw()
|
||||
|
||||
if self._type_pol[self._pol_id] != 7:
|
||||
self.find(QTabWidget, "tabWidget").setTabVisible(3, False)
|
||||
self.find(QTabWidget, "tabWidget").setTabVisible(2, False)
|
||||
|
||||
self.canvas_2 = MplCanvas(width=5, height=4, dpi=100)
|
||||
self.canvas_2.setObjectName("canvas_2")
|
||||
|
|
@ -511,10 +530,11 @@ class ResultsWindowAdisTS(PamhyrWindow):
|
|||
|
||||
def update(self, reach_id=None, profile_id=None, pol_id=None, timestamp=None):
|
||||
if reach_id is not None:
|
||||
self.plot_c_dt.set_reach(reach_id)
|
||||
self.plot_c_dx.set_reach(reach_id)
|
||||
self.plot_cdt.set_reach(reach_id)
|
||||
self.plot_cdx.set_reach(reach_id)
|
||||
if self._type_pol[self._pol_id] == 7:
|
||||
self.plot_m.set_reach(reach_id)
|
||||
self.plot_mdx.set_reach(reach_id)
|
||||
self.plot_mdt.set_reach(reach_id)
|
||||
self.plot_tot_c.set_reach(reach_id)
|
||||
self.plot_tot_eg.set_reach(reach_id)
|
||||
self.plot_tot_em.set_reach(reach_id)
|
||||
|
|
@ -525,10 +545,11 @@ class ResultsWindowAdisTS(PamhyrWindow):
|
|||
self.update_table_selection_pol(0)
|
||||
|
||||
if profile_id is not None:
|
||||
self.plot_c_dt.set_profile(profile_id)
|
||||
self.plot_c_dx.set_profile(profile_id)
|
||||
self.plot_cdt.set_profile(profile_id)
|
||||
self.plot_cdx.set_profile(profile_id)
|
||||
if self._type_pol[self._pol_id] == 7:
|
||||
self.plot_m.set_profile(profile_id)
|
||||
self.plot_mdx.set_profile(profile_id)
|
||||
self.plot_mdt.set_profile(profile_id)
|
||||
self.plot_tot_c.set_profile(profile_id)
|
||||
self.plot_tot_eg.set_profile(profile_id)
|
||||
self.plot_tot_em.set_profile(profile_id)
|
||||
|
|
@ -538,21 +559,23 @@ class ResultsWindowAdisTS(PamhyrWindow):
|
|||
|
||||
if pol_id is not None:
|
||||
self._pol_id = pol_id
|
||||
self.plot_c_dt.set_pollutant(self._pol_id)
|
||||
self.plot_c_dx.set_pollutant(self._pol_id)
|
||||
self.plot_cdt.set_pollutant(self._pol_id)
|
||||
self.plot_cdx.set_pollutant(self._pol_id)
|
||||
if self._type_pol[self._pol_id] == 7:
|
||||
self.find(QTabWidget, "tabWidget").setTabVisible(3, True)
|
||||
self.plot_m.set_pollutant(self._pol_id)
|
||||
self.find(QTabWidget, "tabWidget").setTabVisible(2, True)
|
||||
self.plot_mdx.set_pollutant(self._pol_id)
|
||||
self.plot_mdt.set_pollutant(self._pol_id)
|
||||
else:
|
||||
self.find(QTabWidget, "tabWidget").setTabVisible(3, False)
|
||||
self.find(QTabWidget, "tabWidget").setTabVisible(2, False)
|
||||
|
||||
self.update_table_selection_pol(self._pol_id)
|
||||
|
||||
if timestamp is not None:
|
||||
self.plot_c_dt.set_timestamp(timestamp)
|
||||
self.plot_c_dx.set_timestamp(timestamp)
|
||||
self.plot_cdt.set_timestamp(timestamp)
|
||||
self.plot_cdx.set_timestamp(timestamp)
|
||||
if self._type_pol[self._pol_id] == 7:
|
||||
self.plot_m.set_timestamp(timestamp)
|
||||
self.plot_mdx.set_timestamp(timestamp)
|
||||
self.plot_mdt.set_timestamp(timestamp)
|
||||
#self.plot_tot_c.set_timestamp(timestamp)
|
||||
#self.plot_tot_eg.set_timestamp(timestamp)
|
||||
#self.plot_tot_em.set_timestamp(timestamp)
|
||||
|
|
@ -582,7 +605,6 @@ class ResultsWindowAdisTS(PamhyrWindow):
|
|||
return
|
||||
|
||||
self.update(profile_id=indexes[0].row())
|
||||
###self._slider_profile.setValue(ind)
|
||||
|
||||
def _set_current_pol(self):
|
||||
table = self.find(QTableView, f"tableView_pollutants")
|
||||
|
|
@ -602,28 +624,26 @@ class ResultsWindowAdisTS(PamhyrWindow):
|
|||
self.update(profile_id=ind)
|
||||
self._slider_profile.setValue(ind)
|
||||
|
||||
def _set_current_profile_slider(self):
|
||||
pid = self._slider_profile.value()
|
||||
self.update(profile_id=pid)
|
||||
|
||||
def _set_current_timestamp(self):
|
||||
timestamp = self._timestamps[self._slider_time.value()]
|
||||
self.update(timestamp=timestamp)
|
||||
|
||||
def _reload_plots(self):
|
||||
self.plot_c_dt.results = self._results
|
||||
self.plot_c_dx.results = self._results
|
||||
self.plot_cdt.results = self._results
|
||||
self.plot_cdx.results = self._results
|
||||
if self._type_pol[self._pol_id] == 7:
|
||||
self.plot_m.results = self._results
|
||||
self.plot_mdx.results = self._results
|
||||
self.plot_mdt.results = self._results
|
||||
self.plot_tot_c.results = self._results
|
||||
self.plot_tot_eg.results = self._results
|
||||
self.plot_tot_em.results = self._results
|
||||
self.plot_tot_ed.results = self._results
|
||||
|
||||
self.plot_c_dt.draw()
|
||||
self.plot_c_dx.draw()
|
||||
self.plot_cdt.draw()
|
||||
self.plot_cdx.draw()
|
||||
if self._type_pol[self._pol_id] == 7:
|
||||
self.plot_m.draw()
|
||||
self.plot_mdx.draw()
|
||||
self.plot_mdt.draw()
|
||||
self.plot_tot_c.draw()
|
||||
self.plot_tot_eg.draw()
|
||||
self.plot_tot_em.draw()
|
||||
|
|
|
|||
|
|
@ -125,3 +125,9 @@ class ResultsTranslate(MainTranslate):
|
|||
"min_depth": self._dict["unit_min_depth"],
|
||||
"max_depth": self._dict["unit_max_depth"],
|
||||
}
|
||||
|
||||
self._sub_dict["values_y_pol"] = {
|
||||
"unit_C": self._dict["unit_concentration"],
|
||||
"unit_M": self._dict["unit_mass"],
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -144,6 +144,8 @@ class UnitTranslate(CommonWordTranslate):
|
|||
"Unit", "Hydraulic Radius (m)"
|
||||
)
|
||||
self._dict["unit_froude"] = _translate("Unit", "Froude number")
|
||||
self._dict["unit_mass"] = _translate("Unit", "Mass (kg)")
|
||||
self._dict["unit_concentration"] = _translate("Unit", "Concentration (kg/m^3)")
|
||||
|
||||
|
||||
class MainTranslate(UnitTranslate):
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1097</width>
|
||||
<height>720</height>
|
||||
<width>1410</width>
|
||||
<height>821</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
|
@ -129,8 +129,11 @@
|
|||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
<number>3</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_4">
|
||||
<attribute name="title">
|
||||
|
|
@ -149,39 +152,96 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="Concentration_dt">
|
||||
<widget class="QWidget" name="Concentration">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>Concentration dt</string>
|
||||
<string>Concentration</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_concentration_dt"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="Concentration_dx">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget_c">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_cdx">
|
||||
<attribute name="title">
|
||||
<string>Concentration dx</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_11">
|
||||
<layout class="QGridLayout" name="gridLayout_17">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_concentration_dx"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_3">
|
||||
<widget class="QWidget" name="tab_cdt">
|
||||
<attribute name="title">
|
||||
<string>Concentration dt</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_18">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_concentration_dt"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="Mass">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="title">
|
||||
<string>Mass</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_13">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_mass"/>
|
||||
<widget class="QTabWidget" name="tabWidget_m">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="mdx">
|
||||
<attribute name="title">
|
||||
<string>Mass dx</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_15">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_mass_dx2"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="mdt">
|
||||
<attribute name="title">
|
||||
<string>Mass dt</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_14">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_mass_dt2"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_2">
|
||||
<attribute name="title">
|
||||
<string>Page</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_5">
|
||||
<attribute name="title">
|
||||
<string>Total Sediments</string>
|
||||
|
|
@ -190,9 +250,9 @@
|
|||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_tot">
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget_2">
|
||||
<widget class="QTabWidget" name="tabWidget_tot">
|
||||
<property name="currentIndex">
|
||||
<number>3</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
|
|
@ -253,7 +313,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1097</width>
|
||||
<width>1410</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
|
|
|||
Loading…
Reference in New Issue