mirror of https://gitlab.com/pamhyr/pamhyr2
Ensemble: Results: Add method to open ensemble results window.
parent
c40e28ed0f
commit
ef36eba039
|
|
@ -404,6 +404,8 @@ class River(SQLSubModel):
|
|||
|
||||
# Dict with timestamps as key
|
||||
self._reachs = []
|
||||
for i, _ in enumerate(self._study.river.enable_edges()):
|
||||
self.add(i)
|
||||
|
||||
def __len__(self):
|
||||
return len(self._reachs)
|
||||
|
|
|
|||
|
|
@ -1160,7 +1160,7 @@ class Mage8(Mage):
|
|||
|
||||
for i in range(nb_reach):
|
||||
# Add results reach to reach list
|
||||
r = results.river.add(i)
|
||||
r = results.river.reach(i)
|
||||
reachs.append(r)
|
||||
|
||||
# ID of first and last reach profiles
|
||||
|
|
|
|||
|
|
@ -1696,6 +1696,12 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
|||
if not self.msg_box_results_continue():
|
||||
return
|
||||
|
||||
if self._study.status.scenario.is_ensemble():
|
||||
self.open_solver_ens_results_window(solver, results)
|
||||
else:
|
||||
self.open_solver_results_window(solver, results)
|
||||
|
||||
def open_solver_results_window(self, solver, results):
|
||||
# Windows already opened
|
||||
if self.sub_window_exists(
|
||||
ResultsWindow,
|
||||
|
|
@ -1715,6 +1721,26 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
|||
)
|
||||
res.show()
|
||||
|
||||
def open_solver_ens_results_window(self, solver, results):
|
||||
# Windows already opened
|
||||
if self.sub_window_exists(
|
||||
ResultsEnsembleWindow,
|
||||
data=[
|
||||
self._study,
|
||||
None, # No config,
|
||||
results._solver,
|
||||
results._repertory,
|
||||
results._name]
|
||||
):
|
||||
return
|
||||
|
||||
res = ResultsEnsembleWindow(
|
||||
study=self._study,
|
||||
results=[results],
|
||||
parent=self
|
||||
)
|
||||
res.show()
|
||||
|
||||
def msg_open_results_no_results(self):
|
||||
self.message_box(
|
||||
window_title=self._trad["Warning"],
|
||||
|
|
|
|||
|
|
@ -1638,6 +1638,7 @@ class ResultsEnsembleWindow(ResultsWindow):
|
|||
# unselect all profiles but the first one
|
||||
profile_id = self._get_current_profile()
|
||||
self.update_table_selection_profile(profile_id)
|
||||
|
||||
tab_widget = self.find(QTabWidget, f"tabWidget")
|
||||
tab_index = tab_widget.currentIndex()
|
||||
name = tab_widget.tabText(tab_index)
|
||||
|
|
|
|||
Loading…
Reference in New Issue