Results: Add results model, view scheme and mage results reading.

This commit is contained in:
Pierre-Antoine Rouby committed 2023-08-08 13:48:01 +02:00
1 parent 798d9198d6
commit d78310476e
5 files changed
+174 -2

No files matched your search

+14 -1
View File
@@ -16,8 +16,9 @@
# -*- coding: utf-8 -*-
import tempfile
import os
import logging
import tempfile
from queue import Queue
from tools import trace, timer
@@ -53,6 +54,8 @@ except:
_translate = QCoreApplication.translate
logger = logging.getLogger()
class SelectSolverWindow(ASubWindow, ListedSubWindow):
def __init__(self, title="Select solver",
study=None, config=None,
@@ -110,6 +113,8 @@ class SolverLogWindow(ASubMainWindow, ListedSubWindow):
self._config = config
self._solver = solver
self._results = None
super(SolverLogWindow, self).__init__(
name=self._title, ui="SolverLog", parent=parent
)
@@ -169,6 +174,7 @@ class SolverLogWindow(ASubMainWindow, ListedSubWindow):
self.find(QAction, "action_pause").triggered.connect(self.pause)
self.find(QAction, "action_stop").triggered.connect(self.stop)
self.find(QAction, "action_log_file").triggered.connect(self.log_file)
self.find(QAction, "action_results").triggered.connect(self.results)
self._alarm.timeout.connect(self.update)
@@ -193,6 +199,7 @@ class SolverLogWindow(ASubMainWindow, ListedSubWindow):
self.find(QAction, "action_start").setEnabled(True)
self.find(QAction, "action_pause").setEnabled(False)
self.find(QAction, "action_stop").setEnabled(False)
self.find(QAction, "action_results").setEnabled(True)
if self._solver.log_file() != "":
self.find(QAction, "action_log_file").setEnabled(True)
@@ -221,6 +228,7 @@ class SolverLogWindow(ASubMainWindow, ListedSubWindow):
self.find(QAction, "action_pause").setEnabled(False)
self.find(QAction, "action_stop").setEnabled(True)
self.find(QAction, "action_log_file").setEnabled(False)
self.find(QAction, "action_results").setEnabled(False)
def pause(self):
self._log(" *** Pause", color="blue")
@@ -229,6 +237,7 @@ class SolverLogWindow(ASubMainWindow, ListedSubWindow):
self.find(QAction, "action_start").setEnabled(True)
self.find(QAction, "action_pause").setEnabled(False)
self.find(QAction, "action_stop").setEnabled(True)
self.find(QAction, "action_results").setEnabled(False)
def stop(self):
self._log(" *** Stop", color="blue")
@@ -237,9 +246,13 @@ class SolverLogWindow(ASubMainWindow, ListedSubWindow):
self.find(QAction, "action_start").setEnabled(True)
self.find(QAction, "action_pause").setEnabled(False)
self.find(QAction, "action_stop").setEnabled(False)
self.find(QAction, "action_results").setEnabled(True)
if self._solver.log_file() != "":
self.find(QAction, "action_log_file").setEnabled(True)
def results(self):
self._results = self._solver.results(self._study, self._workdir, qlog = self._output)
def log_file(self):
file_name = os.path.join(self._workdir, self._solver.log_file())
log = SolverLogFileWindow(
+6
View File
@@ -63,6 +63,7 @@
<addaction name="action_pause"/>
<addaction name="action_stop"/>
<addaction name="action_log_file"/>
<addaction name="action_results"/>
</widget>
<action name="action_stop">
<property name="icon">
@@ -100,6 +101,11 @@
<string>LogFile</string>
</property>
</action>
<action name="action_results">
<property name="text">
<string>results</string>
</property>
</action>
</widget>
<resources/>
<connections/>