Skip to content

Commit

Permalink
Add helpful text in load_results_panel
Browse files Browse the repository at this point in the history
  • Loading branch information
DanSava committed Nov 1, 2024
1 parent 46351fe commit 009e0ef
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/ert/gui/tools/load_results/load_results_panel.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

from qtpy.QtCore import Qt, Signal
from qtpy.QtWidgets import QFormLayout, QMessageBox, QWidget
from qtpy.QtWidgets import QFormLayout, QLabel, QMessageBox, QWidget

from ert.gui.ertnotifier import ErtNotifier
from ert.gui.ertwidgets import (
Expand Down Expand Up @@ -42,9 +42,14 @@ def __init__(self, facade: LibresFacade, notifier: ErtNotifier):
self._run_path_text.getValidationSupport().validationChanged.connect(
self.panelConfigurationChanged
)
self._run_path_text.textChanged.connect(self.text_change)

self.help_iter_lbl = QLabel("<ITER> will be replace by: 0")
self.help_iens_lbl = QLabel("<IENS> will be replace by %")
layout.addRow("Load data from run path: ", self._run_path_text)
ensemble_selector = EnsembleSelector(self._notifier)
layout.addRow("", self.help_iens_lbl)
layout.addRow("", self.help_iter_lbl)
layout.addRow("Load into ensemble:", ensemble_selector)
self._ensemble_selector = ensemble_selector

Expand All @@ -54,15 +59,24 @@ def __init__(self, facade: LibresFacade, notifier: ErtNotifier):
self._active_realizations_model, # type: ignore
"load_results_manually/Realizations",
)
self._active_realizations_field.textChanged.connect(self.text_change)
self._active_realizations_field.setValidator(RangeStringArgument(ensemble_size))
self._active_realizations_field.setObjectName("active_realizations_lrm")
self.help_iens_lbl.setText(
f"<IENS> will be replace by {self._active_realizations_field.get_text}"
)
layout.addRow("Realizations to load:", self._active_realizations_field)

self._active_realizations_field.getValidationSupport().validationChanged.connect(
self.panelConfigurationChanged
)
self.setLayout(layout)

def text_change(self) -> None:
active_realizations = self._active_realizations_field.get_text
self.help_iens_lbl.setText(f"<IENS> will be replace by {active_realizations}")
self.help_iter_lbl.setVisible("<ITER>" in self._run_path_text.get_text)

def readCurrentRunPath(self) -> str:
current_ensemble = self._notifier.current_ensemble_name
run_path = self._facade.resolved_run_path
Expand Down

0 comments on commit 009e0ef

Please sign in to comment.