mirror of
https://gitlab.com/pamhyr/pamhyr2.git
synced 2026-10-30 03:20:41 +01:00
results adists tables
This commit is contained in:
1 parent
018192714c
commit
0719db17ed
5 files changed
+992
-1
No files matched your search
@@ -24,6 +24,8 @@ import subprocess
|
||||
from queue import Queue
|
||||
from functools import reduce
|
||||
from platformdirs import user_cache_dir
|
||||
|
||||
from Solver.AdisTS import AdisTS
|
||||
from tools import logger_exception
|
||||
|
||||
from PyQt5 import QtGui
|
||||
@@ -75,6 +77,7 @@ from View.RunSolver.WindowAdisTS import SelectSolverWindowAdisTS, SolverLogWindo
|
||||
from View.CheckList.Window import CheckListWindow
|
||||
from View.CheckList.WindowAdisTS import CheckListWindowAdisTS
|
||||
from View.Results.Window import ResultsWindow
|
||||
from View.Results.WindowAdisTS import ResultsWindowAdisTS
|
||||
from View.Results.ReadingResultsDialog import ReadingResultsDialog
|
||||
from View.Debug.Window import ReplWindow
|
||||
from View.OutputKpAdisTS.Window import OutputKpAdisTSWindow
|
||||
@@ -1398,6 +1401,63 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
|
||||
)
|
||||
res.show()
|
||||
|
||||
def open_solver_results_adists(self, solver, results=None):
|
||||
def reading_fn():
|
||||
self._tmp_results = results
|
||||
|
||||
# If no specific results, get last results
|
||||
if results is None:
|
||||
def reading_fn():
|
||||
self._tmp_results = self._last_results
|
||||
|
||||
if self._last_results is None:
|
||||
def reading_fn():
|
||||
self._tmp_results = solver.results(
|
||||
self._study,
|
||||
self._solver_workdir(solver),
|
||||
)
|
||||
|
||||
# Open from file
|
||||
if type(results) is str:
|
||||
logger.info(f"Open results from {os.path.dirname(results)}")
|
||||
|
||||
name = os.path.basename(results).replace(".BIN", "")
|
||||
|
||||
def reading_fn():
|
||||
self._tmp_results = solver.results(
|
||||
self._study,
|
||||
os.path.dirname(results),
|
||||
name=name
|
||||
)
|
||||
|
||||
dlg = ReadingResultsDialog(reading_fn=reading_fn, parent=self)
|
||||
dlg.exec_()
|
||||
results = self._tmp_results
|
||||
|
||||
# No results available
|
||||
if results is None:
|
||||
return
|
||||
|
||||
# Windows already opened
|
||||
if self.sub_window_exists(
|
||||
ResultsWindowAdisTS,
|
||||
data=[
|
||||
self._study,
|
||||
None, # No config
|
||||
solver,
|
||||
results
|
||||
]
|
||||
):
|
||||
return
|
||||
|
||||
res = ResultsWindowAdisTS(
|
||||
study=self._study,
|
||||
solver=solver,
|
||||
results=results,
|
||||
parent=self
|
||||
)
|
||||
res.show()
|
||||
|
||||
def _solver_workdir(self, solver):
|
||||
workdir = os.path.join(
|
||||
os.path.dirname(self._study.filename),
|
||||
|
||||
Reference in new issue
Block a user