diff --git a/src/View/RunSolver/Window.py b/src/View/RunSolver/Window.py index 4126f71a..5c80f65d 100644 --- a/src/View/RunSolver/Window.py +++ b/src/View/RunSolver/Window.py @@ -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 diff --git a/src/View/Tools/ASubWindow.py b/src/View/Tools/ASubWindow.py index 01f2cd25..70fc90b0 100644 --- a/src/View/Tools/ASubWindow.py +++ b/src/View/Tools/ASubWindow.py @@ -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 diff --git a/src/View/ui/EnsembleRunNumberDialog.ui b/src/View/ui/EnsembleRunNumberDialog.ui index 8d06f31e..2af69ee3 100644 --- a/src/View/ui/EnsembleRunNumberDialog.ui +++ b/src/View/ui/EnsembleRunNumberDialog.ui @@ -7,7 +7,7 @@ 0 0 400 - 79 + 152 @@ -15,26 +15,62 @@ - - - Run number - - + + + + + Draw function + + + + + + + - - - - 1 - - - 1000000 - - - 100 - - + + + + + + Number of run + + + + + + + 1 + + + 1000000 + + + 100 + + + + - + + + + + + Custom random seed + + + + + + + false + + + + + + Qt::Horizontal