compare_results
Theophile Terraz 2025-01-15 14:05:11 +01:00
parent 41d1fb9d59
commit 1289967abb
5 changed files with 31 additions and 26 deletions

View File

@ -1436,9 +1436,8 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
ResultsWindow, ResultsWindow,
data=[ data=[
self._study, self._study,
None, # No config None, # No config
results results]
]
): ):
return return
@ -1493,7 +1492,8 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
self._study, self._study,
None, # No config None, # No config
solver, solver,
results results,
self
] ]
): ):
return return
@ -1583,17 +1583,17 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
ResultsWindow, ResultsWindow,
data=[ data=[
self._study, self._study,
None, # No config None] + # No config
results[0] results
]
): ):
w = self.get_sub_window( #w = self.get_sub_window(
ResultsWindow, #ResultsWindow,
data=[ #data=[
self._study, #self._study,
None, # No config #None, # No config
results[0] #results,
]) #parent=self
#])
#w.add_result(result[1], run.solver2) #w.add_result(result[1], run.solver2)
return return

View File

@ -45,6 +45,7 @@ _translate = QCoreApplication.translate
class TableModel(PamhyrTableModel): class TableModel(PamhyrTableModel):
def _setup_lst(self): def _setup_lst(self):
_river = self._data.river _river = self._data.river
self._timestamp = min(list(self._data.get("timestamps")))
if self._opt_data == "reach": if self._opt_data == "reach":
self._lst = _river.reachs self._lst = _river.reachs
elif self._opt_data == "profile": elif self._opt_data == "profile":
@ -57,7 +58,6 @@ class TableModel(PamhyrTableModel):
self._lst = tmp_list self._lst = tmp_list
def __init__(self, type_pol, **kwargs): def __init__(self, type_pol, **kwargs):
self._timestamp = 0.0
self._type_pol = type_pol self._type_pol = type_pol
super(TableModel, self).__init__(**kwargs) super(TableModel, self).__init__(**kwargs)

View File

@ -89,14 +89,13 @@ class ResultsWindow(PamhyrWindow):
self._solvers = [r._solver for r in results] self._solvers = [r._solver for r in results]
self._results = results self._results = results
self._current_results = 0 self._current_results = 0
print("solver: " + results[0]._solver.name)
if trad is None: if trad is None:
trad = ResultsTranslate() trad = ResultsTranslate()
name = ( name = (
trad[self._pamhyr_name] + " - " trad[self._pamhyr_name] + " - "
+ study.name + " - " + study.name + " - "
+ self._solvers[self._current_results].name + " - ".join([s.name for s in self._solvers])
) )
super(ResultsWindow, self).__init__( super(ResultsWindow, self).__init__(
@ -107,7 +106,8 @@ class ResultsWindow(PamhyrWindow):
parent=parent parent=parent
) )
self._hash_data.append(self._results) for r in results:
self._hash_data.append(r)
self._additional_plot = {} self._additional_plot = {}

View File

@ -379,9 +379,13 @@ class ResultsWindowAdisTS(PamhyrWindow):
else: else:
pollutant = self._results.pollutants_list[indexes[0].row()] pollutant = self._results.pollutants_list[indexes[0].row()]
return (f"Reach: {reach.name} | " + #return (f"Reach: {reach.name} | " +
f"Profile: {pname} | " + #f"Profile: {pname} | " +
f"Pollutant: {pollutant}") #f"Pollutant: {pollutant}")
return (f"{self._trad['reach']}: {reach.name} | " +
f"{self._trad['cross_section']}: {pname} | " +
f"Pollutant: {pollutant} | " +
f"{self._trad['unit_time_s']} : {fts} ({ts} sec)")
def setup_statusbar(self): def setup_statusbar(self):
txt = self._compute_status_label() txt = self._compute_status_label()

View File

@ -131,6 +131,12 @@ class ResultsTranslate(MainTranslate):
"max_depth": self._dict["unit_max_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"],
"unit_thickness": self._dict["unit_thickness"],
}
class CompareResultsTranslate(ResultsTranslate): class CompareResultsTranslate(ResultsTranslate):
def __init__(self): def __init__(self):
super(CompareResultsTranslate, self).__init__() super(CompareResultsTranslate, self).__init__()
@ -162,8 +168,3 @@ class CompareResultsTranslate(ResultsTranslate):
"froude": u"Δ "+self._dict["unit_froude"], "froude": u"Δ "+self._dict["unit_froude"],
"wet_area": u"Δ "+self._dict["unit_wet_area"], "wet_area": u"Δ "+self._dict["unit_wet_area"],
} }
self._sub_dict["values_y_pol"] = {
"unit_C": self._dict["unit_concentration"],
"unit_M": self._dict["unit_mass"],
"unit_thickness": self._dict["unit_thickness"],
}