mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
Merge branch 'scenario-dev-pa' into dev_dylan
This commit is contained in:
commit
bbd8f7f832
57 files changed
+5439
-464
No files matched your search
+80
-1
@@ -67,6 +67,7 @@ from View.Configure.Window import ConfigureWindow
|
||||
from View.Study.Window import NewStudyWindow
|
||||
from View.About.Window import AboutWindow
|
||||
from View.Scenarios.Window import ScenariosWindow
|
||||
from View.Ensembles.Window import EnsemblesWindow
|
||||
from View.Network.Window import NetworkWindow
|
||||
from View.Geometry.Window import GeometryWindow
|
||||
from View.BoundaryCondition.Window import BoundaryConditionWindow
|
||||
@@ -83,11 +84,14 @@ from View.GeoTIFF.Window import GeoTIFFListWindow
|
||||
from View.REPLines.Window import REPLineListWindow
|
||||
from View.SolverParameters.Window import SolverParametersWindow
|
||||
from View.RunSolver.Window import (
|
||||
EnsembleRunNumberDialog,
|
||||
SelectSolverWindow,
|
||||
SolverLogWindow,
|
||||
SolverLogEnsWindow,
|
||||
)
|
||||
|
||||
from View.Results.Window import ResultsWindow
|
||||
|
||||
from View.Results.Window import ResultsWindow, ResultsEnsembleWindow
|
||||
from View.Results.CompareDialog import (
|
||||
CompareScenariosWindow
|
||||
)
|
||||
@@ -1339,6 +1343,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||
"""
|
||||
if self._study is None:
|
||||
return
|
||||
|
||||
if self._study.filename is None or self._study.filename == "":
|
||||
self.message_box(
|
||||
window_title=self._trad["Warning"],
|
||||
@@ -1372,6 +1377,29 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||
self.scenarios = ScenariosWindow(study=self._study, parent=self)
|
||||
self.scenarios.show()
|
||||
|
||||
def open_ensemble_scenario(self):
|
||||
"""Open ensemble scenario window
|
||||
|
||||
Returns:
|
||||
Nothing
|
||||
"""
|
||||
if self._study is None:
|
||||
return
|
||||
|
||||
if self.sub_window_exists(
|
||||
EnsemblesWindow,
|
||||
data=[self._study, self.conf]
|
||||
):
|
||||
return
|
||||
|
||||
ensemble = EnsemblesWindow(
|
||||
ensembles=self._study.river._ensembles,
|
||||
study=self._study,
|
||||
config=self.conf,
|
||||
parent=self
|
||||
)
|
||||
ensemble.show()
|
||||
|
||||
def open_geometry(self):
|
||||
"""Open geometry window
|
||||
|
||||
@@ -1728,6 +1756,9 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||
sol.show()
|
||||
|
||||
def solver_log(self, solver):
|
||||
if self._study.status.scenario.is_ensemble():
|
||||
return self._solver_log_ensemble(solver)
|
||||
|
||||
sol = SolverLogWindow(
|
||||
study=self._study,
|
||||
config=self.conf,
|
||||
@@ -1736,6 +1767,28 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||
)
|
||||
sol.show()
|
||||
|
||||
def _solver_log_ensemble(self, solver):
|
||||
run_number = 1
|
||||
|
||||
dlg = EnsembleRunNumberDialog(
|
||||
trad=self._trad,
|
||||
parent=self
|
||||
)
|
||||
if dlg.exec():
|
||||
function = dlg.function
|
||||
number_of_run = dlg.number
|
||||
seed = dlg.seed
|
||||
|
||||
sol = SolverLogEnsWindow(
|
||||
number_of_run=number_of_run,
|
||||
seed=seed, function=function,
|
||||
study=self._study,
|
||||
config=self.conf,
|
||||
solver=solver,
|
||||
parent=self
|
||||
)
|
||||
sol.show()
|
||||
|
||||
def msg_box_results_continue(self):
|
||||
dlg = QMessageBox(self)
|
||||
|
||||
@@ -1812,6 +1865,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,
|
||||
@@ -1831,6 +1890,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"],
|
||||
|
||||
Reference in new issue
Block a user