Compare commits

..

No commits in common. "f54dc0743240cabdaf8ed3f341bca8e18aa60327" and "c0d4aced5ea097be41c27d1fc207c6c9c91c3b4e" have entirely different histories.

2 changed files with 11 additions and 56 deletions

View File

@ -860,13 +860,6 @@ 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 #
#########################
@ -1621,16 +1614,10 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
def diff_results(self, solver1, solver2):
if solver1 is None:
logger.warning(f"diff_results: solver1 is None")
self.msg_results_warning(
info=self._trad["mb_results_not_found"]
)
# TODO message
return None
if solver2 is None:
logger.warning(f"diff_results: solver2 is None")
self.msg_results_warning(
info=self._trad["mb_results_not_found"]
)
# TODO message
return None
solver3 = GenericSolver(solver1.name+" - "+solver2.name)
@ -1644,9 +1631,6 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
if result1 is None:
logger.warning(f"diff_results: result1 is None")
self.msg_results_warning(
info=self._trad["mb_results_not_found"]
)
return None
result2 = solver2.results(
@ -1656,23 +1640,14 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
if result2 is None:
logger.warning(f"diff_results: result2 is None")
self.msg_results_warning(
info=self._trad["mb_results_not_found"]
)
return None
if result2.get("nb_reach") != result1.get("nb_reach"):
logger.warning(f"diff_results: nb_reach missmatch")
self.msg_results_warning(
info=self._trad["mb_results_not_found"]
)
return None
if result2.get("nb_profile") != result1.get("nb_profile"):
logger.warning(f"diff_results: nb_profile missmatch")
self.msg_results_warning(
info=self._trad["mb_results_not_found"]
)
return None
result3 = Results(self._study, solver3)
@ -1776,22 +1751,12 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
bin_list = list(filter(lambda s: "bin" in s, dir_list))
if len(bin_list) < 1:
self.msg_results_warning(
info=self._trad["mb_results_not_found"],
text=self._trad["mb_results_bin_not_found"]
)
# TODO message
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), 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)
@ -1802,10 +1767,13 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
results=solver_results_adists,
)
else:
self.msg_results_warning(
info=self._trad["mb_results_not_found"],
text=self._trad["mb_results_total_bin_not_found"]
)
dlg = QDialog(self)
dlg.setWindowTitle("AdisTS Results")
layout = QVBoxLayout()
message = QLabel("AdisTS Results not found")
layout.addWidget(message)
dlg.setLayout(layout)
dlg.exec()
#################
# DOCUMENTATION #
@ -1849,7 +1817,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
def open_doc_user(self):
self.open_doc(
"https://gitlab.com/pamhyr/pamhyr2/-/wikis/home"
"https://gitlab.irstea.fr/theophile.terraz/pamhyr/-/wikis/home"
)
def open_doc_dev(self, ext="pdf"):

View File

@ -204,16 +204,3 @@ class MainTranslate(UnitTranslate):
self._dict["Cancel"] = _translate("MainWindow", "Cancel")
self._dict["Save"] = _translate("MainWindow", "Save")
self._dict["Close"] = _translate("MainWindow", "Close")
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"
)
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"
)