Solver: Minor change.

This commit is contained in:
Pierre-Antoine Rouby committed 2023-06-20 09:40:55 +02:00
1 parent 21c59dbcac
commit d893db4ef7
2 files changed
+26 -13

No files matched your search

+11 -5
View File
@@ -74,6 +74,7 @@ class SolverLogWindow(ASubMainWindow, ListedSubWindow):
study=None, config=None,
solver=None, parent=None):
self._title = title
self._parent = parent
self._study = study
self._config = config
@@ -123,18 +124,25 @@ class SolverLogWindow(ASubMainWindow, ListedSubWindow):
color = "blue" if msg == 0 else "red"
self.find(QTextEdit, "textEdit")\
.append(f"<font color=\"{color}\">" +
f"*** Solver finished with code {msg}" +
f" *** Finished with code {msg}" +
"</font>")
def update(self):
if self._solver.is_stoped():
self.find(QAction, "action_start").setEnabled(True)
self.find(QAction, "action_pause").setEnabled(False)
self.find(QAction, "action_stop").setEnabled(False)
while self._output.qsize() != 0:
s = self._output.get()
self._log(s)
def start(self):
self._log(" *** Start", color="blue")
self._solver.start()
if self._solver.is_stoped():
self._process = QProcess(self._parent)
self._solver.start(self._process)
self.find(QAction, "action_start").setEnabled(False)
self.find(QAction, "action_pause").setEnabled(True)
@@ -142,7 +150,6 @@ class SolverLogWindow(ASubMainWindow, ListedSubWindow):
def pause(self):
self._log(" *** Pause", color="blue")
self._solver.pause()
self.find(QAction, "action_start").setEnabled(True)
@@ -151,7 +158,6 @@ class SolverLogWindow(ASubMainWindow, ListedSubWindow):
def stop(self):
self._log(" *** Stop", color="blue")
self._solver.kill()
self.find(QAction, "action_start").setEnabled(True)