mirror of https://gitlab.com/pamhyr/pamhyr2
windiow results adists mage
parent
501000fa6b
commit
018192714c
|
|
@ -156,13 +156,14 @@ class SelectSolverWindowAdisTS(PamhyrDialog):
|
||||||
super(SelectSolverWindowAdisTS, self).accept()
|
super(SelectSolverWindowAdisTS, self).accept()
|
||||||
|
|
||||||
class SolverLogWindowAdisTS(PamhyrWindow):
|
class SolverLogWindowAdisTS(PamhyrWindow):
|
||||||
_pamhyr_ui = "SolverLog"
|
_pamhyr_ui = "SolverLogAdisTS"
|
||||||
_pamhyr_name = "Solver Log"
|
_pamhyr_name = "Solver Log"
|
||||||
|
|
||||||
def __init__(self, study=None, config=None,
|
def __init__(self, study=None, config=None,
|
||||||
solver=None, parent=None, mage_rep=None):
|
solver=None, parent=None, mage_rep=None):
|
||||||
self._solver = solver
|
self._solver = solver
|
||||||
self._results = None
|
self._results = None
|
||||||
|
self._results_mage = None
|
||||||
self._mage_rep = mage_rep
|
self._mage_rep = mage_rep
|
||||||
|
|
||||||
name = _translate("Solver", "Select log")
|
name = _translate("Solver", "Select log")
|
||||||
|
|
@ -209,6 +210,7 @@ class SolverLogWindowAdisTS(PamhyrWindow):
|
||||||
self.find(QAction, "action_stop").triggered.connect(self.stop)
|
self.find(QAction, "action_stop").triggered.connect(self.stop)
|
||||||
self.find(QAction, "action_log_file").triggered.connect(self.log_file)
|
self.find(QAction, "action_log_file").triggered.connect(self.log_file)
|
||||||
self.find(QAction, "action_results").triggered.connect(self.results)
|
self.find(QAction, "action_results").triggered.connect(self.results)
|
||||||
|
self.find(QAction, "action_results_Mage").triggered.connect(self.resultsMage)
|
||||||
|
|
||||||
self._alarm.timeout.connect(self.update)
|
self._alarm.timeout.connect(self.update)
|
||||||
|
|
||||||
|
|
@ -414,6 +416,28 @@ class SolverLogWindowAdisTS(PamhyrWindow):
|
||||||
|
|
||||||
self._solver.has_results_loaded()
|
self._solver.has_results_loaded()
|
||||||
|
|
||||||
|
def resultsMage(self):
|
||||||
|
if self._results_mage is None:
|
||||||
|
mage_solver = next(filter(lambda x: x._name == self._mage_rep, self._config.solvers))
|
||||||
|
workdir_mage = os.path.join(
|
||||||
|
os.path.dirname(self._study.filename),
|
||||||
|
"_PAMHYR_",
|
||||||
|
self._study.name.replace(" ", "_"),
|
||||||
|
mage_solver.name.replace(" ", "_"),
|
||||||
|
)
|
||||||
|
def reading_fn():
|
||||||
|
self._results_mage = mage_solver.results(
|
||||||
|
self._study, workdir_mage, qlog=self._output
|
||||||
|
)
|
||||||
|
|
||||||
|
dlg = ReadingResultsDialog(reading_fn=reading_fn, parent=self)
|
||||||
|
dlg.exec_()
|
||||||
|
|
||||||
|
self._parent.set_results(mage_solver, self._results_mage)
|
||||||
|
self._parent.open_solver_results(mage_solver, self._results_mage)
|
||||||
|
|
||||||
|
mage_solver.has_results_loaded()
|
||||||
|
|
||||||
def log_file(self):
|
def log_file(self):
|
||||||
file_name = os.path.join(self._workdir, self._solver.log_file())
|
file_name = os.path.join(self._workdir, self._solver.log_file())
|
||||||
log = SolverLogFileWindow(
|
log = SolverLogFileWindow(
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,122 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>MainWindow</class>
|
||||||
|
<widget class="QMainWindow" name="MainWindow">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>1152</width>
|
||||||
|
<height>648</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>MainWindow</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="centralwidget">
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QTextEdit" name="textEdit">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<family>Monospace</family>
|
||||||
|
<pointsize>10</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="locale">
|
||||||
|
<locale language="English" country="Europe"/>
|
||||||
|
</property>
|
||||||
|
<property name="documentTitle">
|
||||||
|
<string notr="true"/>
|
||||||
|
</property>
|
||||||
|
<property name="undoRedoEnabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="readOnly">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QMenuBar" name="menubar">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>1152</width>
|
||||||
|
<height>22</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QStatusBar" name="statusbar"/>
|
||||||
|
<widget class="QToolBar" name="toolBar">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>toolBar</string>
|
||||||
|
</property>
|
||||||
|
<attribute name="toolBarArea">
|
||||||
|
<enum>TopToolBarArea</enum>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="toolBarBreak">
|
||||||
|
<bool>false</bool>
|
||||||
|
</attribute>
|
||||||
|
<addaction name="action_start"/>
|
||||||
|
<addaction name="action_pause"/>
|
||||||
|
<addaction name="action_stop"/>
|
||||||
|
<addaction name="action_log_file"/>
|
||||||
|
<addaction name="action_results"/>
|
||||||
|
<addaction name="action_results_Mage"/>
|
||||||
|
</widget>
|
||||||
|
<action name="action_stop">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<normaloff>ressources/close.png</normaloff>ressources/close.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Stop</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="action_start">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<normaloff>ressources/run.png</normaloff>ressources/run.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Start</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="action_pause">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<normaloff>ressources/player_pause.png</normaloff>ressources/player_pause.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Pause</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="action_log_file">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<normaloff>ressources/zoom.png</normaloff>ressources/zoom.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>LogFile</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="action_results">
|
||||||
|
<property name="text">
|
||||||
|
<string>results</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="action_results_Mage">
|
||||||
|
<property name="text">
|
||||||
|
<string>results_Mage</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
Loading…
Reference in New Issue