improve previous commit

terraz_dev
Theophile Terraz 2025-03-20 11:14:43 +01:00
parent 46738cec6b
commit e9315d9be7
2 changed files with 17 additions and 3 deletions

View File

@ -134,9 +134,9 @@ class PlotH(PamhyrPlot):
y = profile.get_key("Q")
if res_id == 2:
label = "Δ " + self.label_discharge
label = "Δ " + self.label_discharge + f" {profile.name}"
else:
label = self.label_discharge
label = self.label_discharge + f" {profile.name}"
if len(self._current_res_id) > 1:
if res_id != 2:

View File

@ -370,6 +370,10 @@ class ResultsWindow(PamhyrWindow):
self._button_last.clicked.connect(self._last)
self._timer.timeout.connect(self._update_slider)
# tabs
tab_widget = self.find(QTabWidget, f"tabWidget")
tab_widget.currentChanged.connect(self.tab_changed)
def update_table_selection_reach(self, ind):
table = self.find(QTableView, f"tableView_reach")
selectionModel = table.selectionModel()
@ -440,7 +444,9 @@ class ResultsWindow(PamhyrWindow):
for plot in self._additional_plot:
self._additional_plot[plot].set_profile(profile_id[0])
# self.update_table_selection_profile(profile_id[0])
tab_widget = self.find(QTabWidget, f"tabWidget")
if tab_widget.currentIndex() != 2:
self.update_table_selection_profile(profile_id[0])
if solver_id is not None:
self._current_results = solver_id
@ -1148,3 +1154,11 @@ class ResultsWindow(PamhyrWindow):
def get_timestamps(self):
self._timestamps = sorted(list(self._results[0].get("timestamps")))
def tab_changed(self, i):
if i != 2:
if len(self._get_current_profiles_list()) > 1:
# unselect all profiles but the first one
profile_id = self._get_current_profile()
self.update_table_selection_profile(profile_id)