mirror of https://gitlab.com/pamhyr/pamhyr2
Merge branch 'scenarios' into dev_dylan
commit
e755459004
|
|
@ -951,6 +951,13 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
|||
elif res == QMessageBox.Cancel:
|
||||
return False
|
||||
|
||||
def msg_results_warning(self, text="", info=""):
|
||||
self.message_box(
|
||||
window_title=self._trad["Warning"],
|
||||
text=text,
|
||||
informative_text=info
|
||||
)
|
||||
|
||||
#########################
|
||||
# SUB WINDOWS MENU LIST #
|
||||
#########################
|
||||
|
|
@ -2033,12 +2040,22 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
|||
|
||||
bin_list = list(filter(lambda s: "bin" in s, dir_list))
|
||||
if len(bin_list) < 1:
|
||||
# TODO message
|
||||
self.msg_results_warning(
|
||||
info=self._trad["mb_results_not_found"],
|
||||
text=self._trad["mb_results_bin_not_found"]
|
||||
)
|
||||
return
|
||||
path = os.path.normpath(dir_path)
|
||||
solver_name = path.split(os.sep)[-2]
|
||||
solver_results = next(filter(lambda x: x.name == solver_name,
|
||||
self.conf.solvers))
|
||||
self.conf.solvers), None)
|
||||
if solver_results is None:
|
||||
self.msg_results_warning(
|
||||
info=self._trad["mb_results_not_found"],
|
||||
text=self._trad["mb_results_folder_not_found"]
|
||||
)
|
||||
return
|
||||
|
||||
solver_results_adists = solver_results.results(
|
||||
self._study,
|
||||
repertory=dir_path, qlog=None) # self._output)
|
||||
|
|
@ -2050,13 +2067,10 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
|||
results=solver_results_adists,
|
||||
)
|
||||
else:
|
||||
dlg = QDialog(self)
|
||||
dlg.setWindowTitle("AdisTS Results")
|
||||
layout = QVBoxLayout()
|
||||
message = QLabel("AdisTS Results not found")
|
||||
layout.addWidget(message)
|
||||
dlg.setLayout(layout)
|
||||
dlg.exec()
|
||||
self.msg_results_warning(
|
||||
info=self._trad["mb_results_not_found"],
|
||||
text=self._trad["mb_results_bin_not_found"]
|
||||
)
|
||||
|
||||
#################
|
||||
# DOCUMENTATION #
|
||||
|
|
@ -2100,7 +2114,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
|||
|
||||
def open_doc_user(self):
|
||||
self.open_doc(
|
||||
"https://gitlab.irstea.fr/theophile.terraz/pamhyr/-/wikis/home"
|
||||
"https://gitlab.com/pamhyr/pamhyr2/-/wikis/home"
|
||||
)
|
||||
|
||||
def open_doc_dev(self, ext="pdf"):
|
||||
|
|
|
|||
|
|
@ -283,3 +283,17 @@ class MainTranslate(UnitTranslate):
|
|||
self._dict["Save"] = _translate("MainWindow", "Save")
|
||||
self._dict["Close"] = _translate("MainWindow", "Close")
|
||||
self._dict["Solver"] = _translate("MainWindow", "Solver")
|
||||
|
||||
self._dict["mb_results_not_found"] = _translate(
|
||||
"MainWindow", "Results can not be loaded"
|
||||
)
|
||||
self._dict["mb_results_folder_not_found"] = _translate(
|
||||
"MainWindow",
|
||||
"Results folder does not correspond to a Pamhyr2 solver name"
|
||||
)
|
||||
self._dict["mb_results_bin_not_found"] = _translate(
|
||||
"MainWindow", "Results binary files not found"
|
||||
)
|
||||
self._dict["mb_results_total_bin_not_found"] = _translate(
|
||||
"MainWindow", "total_sediment.bin file not found"
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue