From 1289967abbe2a7c41df7e0a5d05a0b9acf65ce03 Mon Sep 17 00:00:00 2001 From: Theophile Terraz Date: Wed, 15 Jan 2025 14:05:11 +0100 Subject: [PATCH] debug --- src/View/MainWindow.py | 28 ++++++++++++++-------------- src/View/Results/TableAdisTS.py | 2 +- src/View/Results/Window.py | 6 +++--- src/View/Results/WindowAdisTS.py | 10 +++++++--- src/View/Results/translate.py | 11 ++++++----- 5 files changed, 31 insertions(+), 26 deletions(-) diff --git a/src/View/MainWindow.py b/src/View/MainWindow.py index 12bbf07f..0b13a0b5 100644 --- a/src/View/MainWindow.py +++ b/src/View/MainWindow.py @@ -1436,9 +1436,8 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit): ResultsWindow, data=[ self._study, - None, # No config - results - ] + None, # No config + results] ): return @@ -1493,7 +1492,8 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit): self._study, None, # No config solver, - results + results, + self ] ): return @@ -1583,17 +1583,17 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit): ResultsWindow, data=[ self._study, - None, # No config - results[0] - ] + None] + # No config + results ): - w = self.get_sub_window( - ResultsWindow, - data=[ - self._study, - None, # No config - results[0] - ]) + #w = self.get_sub_window( + #ResultsWindow, + #data=[ + #self._study, + #None, # No config + #results, + #parent=self + #]) #w.add_result(result[1], run.solver2) return diff --git a/src/View/Results/TableAdisTS.py b/src/View/Results/TableAdisTS.py index f88ce179..20605372 100644 --- a/src/View/Results/TableAdisTS.py +++ b/src/View/Results/TableAdisTS.py @@ -45,6 +45,7 @@ _translate = QCoreApplication.translate class TableModel(PamhyrTableModel): def _setup_lst(self): _river = self._data.river + self._timestamp = min(list(self._data.get("timestamps"))) if self._opt_data == "reach": self._lst = _river.reachs elif self._opt_data == "profile": @@ -57,7 +58,6 @@ class TableModel(PamhyrTableModel): self._lst = tmp_list def __init__(self, type_pol, **kwargs): - self._timestamp = 0.0 self._type_pol = type_pol super(TableModel, self).__init__(**kwargs) diff --git a/src/View/Results/Window.py b/src/View/Results/Window.py index 930572f6..6f9e8ce9 100644 --- a/src/View/Results/Window.py +++ b/src/View/Results/Window.py @@ -89,14 +89,13 @@ class ResultsWindow(PamhyrWindow): self._solvers = [r._solver for r in results] self._results = results self._current_results = 0 - print("solver: " + results[0]._solver.name) if trad is None: trad = ResultsTranslate() name = ( trad[self._pamhyr_name] + " - " + study.name + " - " - + self._solvers[self._current_results].name + + " - ".join([s.name for s in self._solvers]) ) super(ResultsWindow, self).__init__( @@ -107,7 +106,8 @@ class ResultsWindow(PamhyrWindow): parent=parent ) - self._hash_data.append(self._results) + for r in results: + self._hash_data.append(r) self._additional_plot = {} diff --git a/src/View/Results/WindowAdisTS.py b/src/View/Results/WindowAdisTS.py index 66dd3334..89db646c 100644 --- a/src/View/Results/WindowAdisTS.py +++ b/src/View/Results/WindowAdisTS.py @@ -379,9 +379,13 @@ class ResultsWindowAdisTS(PamhyrWindow): else: pollutant = self._results.pollutants_list[indexes[0].row()] - return (f"Reach: {reach.name} | " + - f"Profile: {pname} | " + - f"Pollutant: {pollutant}") + #return (f"Reach: {reach.name} | " + + #f"Profile: {pname} | " + + #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): txt = self._compute_status_label() diff --git a/src/View/Results/translate.py b/src/View/Results/translate.py index 408d542e..14bb2364 100644 --- a/src/View/Results/translate.py +++ b/src/View/Results/translate.py @@ -131,6 +131,12 @@ class ResultsTranslate(MainTranslate): "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): def __init__(self): super(CompareResultsTranslate, self).__init__() @@ -162,8 +168,3 @@ class CompareResultsTranslate(ResultsTranslate): "froude": u"Δ "+self._dict["unit_froude"], "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"], - }