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,
|
||||
QUndoStack, QShortcut, QAction, QItemDelegate,
|
||||
QComboBox, QVBoxLayout, QHeaderView, QTabWidget,
|
||||
QTextEdit, QProgressBar,
|
||||
QTextEdit, QProgressBar, QCheckBox,
|
||||
)
|
||||
|
||||
from View.RunSolver.Log.Window import SolverLogFileWindow
|
||||
|
|
@ -72,10 +72,21 @@ class EnsembleRunNumberDialog(PamhyrDialog):
|
|||
)
|
||||
|
||||
self._init_default_values()
|
||||
self._init_connection()
|
||||
|
||||
def _init_default_values(self):
|
||||
self.combobox_add_items("comboBox", ["Random"])
|
||||
self.set_combobox_text("comboBox", "Random")
|
||||
|
||||
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
|
||||
def number(self):
|
||||
return self._number
|
||||
|
|
|
|||
|
|
@ -390,6 +390,19 @@ class ASubWindowFeatures(object):
|
|||
"""
|
||||
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):
|
||||
"""Set value of spinbox component
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>79</height>
|
||||
<height>152</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
|
|
@ -15,26 +15,62 @@
|
|||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Run number</string>
|
||||
</property>
|
||||
</widget>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Draw function</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QSpinBox" name="spinBox">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>1000000</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
<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">
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>1000000</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>100</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<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">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
|
|
|
|||
Loading…
Reference in New Issue