mirror of https://gitlab.com/pamhyr/pamhyr2
Ensemble: Run: Add function combobox and seed spin box.
parent
345f24996f
commit
3325ba935b
|
|
@ -42,7 +42,7 @@ from PyQt5.QtWidgets import (
|
||||||
QFileDialog, QTableView, QAbstractItemView,
|
QFileDialog, QTableView, QAbstractItemView,
|
||||||
QUndoStack, QShortcut, QAction, QItemDelegate,
|
QUndoStack, QShortcut, QAction, QItemDelegate,
|
||||||
QComboBox, QVBoxLayout, QHeaderView, QTabWidget,
|
QComboBox, QVBoxLayout, QHeaderView, QTabWidget,
|
||||||
QTextEdit, QProgressBar,
|
QTextEdit, QProgressBar, QCheckBox,
|
||||||
)
|
)
|
||||||
|
|
||||||
from View.RunSolver.Log.Window import SolverLogFileWindow
|
from View.RunSolver.Log.Window import SolverLogFileWindow
|
||||||
|
|
@ -72,10 +72,21 @@ class EnsembleRunNumberDialog(PamhyrDialog):
|
||||||
)
|
)
|
||||||
|
|
||||||
self._init_default_values()
|
self._init_default_values()
|
||||||
|
self._init_connection()
|
||||||
|
|
||||||
def _init_default_values(self):
|
def _init_default_values(self):
|
||||||
|
self.combobox_add_items("comboBox", ["Random"])
|
||||||
|
self.set_combobox_text("comboBox", "Random")
|
||||||
|
|
||||||
self.set_spin_box("spinBox", 100)
|
self.set_spin_box("spinBox", 100)
|
||||||
|
|
||||||
|
def _init_connection(self):
|
||||||
|
self._checkbox = self.find(QCheckBox, f"checkBox")
|
||||||
|
self._checkbox.clicked.connect(self._set_random_seed_spin_box_state)
|
||||||
|
|
||||||
|
def _set_random_seed_spin_box_state(self):
|
||||||
|
self.set_spin_box_enable("spinBox_seed", self._checkbox.isChecked())
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def number(self):
|
def number(self):
|
||||||
return self._number
|
return self._number
|
||||||
|
|
|
||||||
|
|
@ -390,6 +390,19 @@ class ASubWindowFeatures(object):
|
||||||
"""
|
"""
|
||||||
return self.find(QSpinBox, name).value()
|
return self.find(QSpinBox, name).value()
|
||||||
|
|
||||||
|
|
||||||
|
def set_spin_box_enable(self, name: str, value: bool):
|
||||||
|
"""Set status of spinbox component
|
||||||
|
|
||||||
|
Args:
|
||||||
|
name: The spinbox component name
|
||||||
|
value: The boolean value
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
Nothing
|
||||||
|
"""
|
||||||
|
self.find(QSpinBox, name).setEnabled(value)
|
||||||
|
|
||||||
def set_double_spin_box(self, name: str, value: int):
|
def set_double_spin_box(self, name: str, value: int):
|
||||||
"""Set value of spinbox component
|
"""Set value of spinbox component
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>400</width>
|
<width>400</width>
|
||||||
<height>79</height>
|
<height>152</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
|
@ -15,13 +15,29 @@
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Run number</string>
|
<string>Draw function</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item>
|
||||||
|
<widget class="QComboBox" name="comboBox"/>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>Number of run</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
<widget class="QSpinBox" name="spinBox">
|
<widget class="QSpinBox" name="spinBox">
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>1</number>
|
<number>1</number>
|
||||||
|
|
@ -34,7 +50,27 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0" colspan="2">
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Custom random seed</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QSpinBox" name="spinBox_seed">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
<widget class="QDialogButtonBox" name="buttonBox">
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Horizontal</enum>
|
<enum>Qt::Horizontal</enum>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue