Results: Update to async db load for results.

This commit is contained in:
parouby committed 2025-09-26 14:27:19 +02:00
1 parent 6c4f6e269c
commit 8f6255c2cd
3 files changed
+28 -13

No files matched your search

+22 -12
View File
@@ -573,7 +573,7 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
def setup_results(self):
self._last_solver = None
self._last_results = None
self.last_results = None
default = None
@@ -590,10 +590,23 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
# Last solver note found, use default-mage if exists
self._last_solver = default
@property
def last_results(self):
if self._study is None:
return None
return self._study.results
@last_results.setter
def last_results(self, results):
if self._study is None:
return
self._study.results = results
def set_results(self, solver, results):
self._last_solver = solver
self._last_results = results
self._study.results = results
self.last_results = results
self.enable_actions("action_menu_results_last", True)
@@ -1479,9 +1492,9 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
# If no specific results, get last results
if results is None:
def reading_fn():
self._tmp_results = self._last_results
self._tmp_results = self.last_results
if self._last_results is None:
if self.last_results is None:
def reading_fn():
self._tmp_results = solver.results(
self._study,
@@ -1543,9 +1556,9 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
# If no specific results, get last results
if results is None:
def reading_fn():
self._tmp_results = self._last_results
self._tmp_results = self.last_results
if self._last_results is None:
if self.last_results is None:
def reading_fn():
self._tmp_results = solver.results(
self._study,
@@ -1608,15 +1621,12 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit):
if self._last_solver is None:
return
if self._study is not None and self._study.results is not None:
self._last_results = self._study.results
if self._last_solver._type == "mage8":
self.open_solver_results(self._last_solver,
self._last_results)
self.last_results)
elif self._last_solver._type == "adistswc":
self.open_solver_results_adists(self._last_solver,
self._last_results)
self.last_results)
def open_results_from_file(self):
if self._study is None: