Skip to content

Commit 40a813c

Browse files
committed
Add simulation type to menu
1 parent 835c22a commit 40a813c

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/ert/gui/main_window.py

+11-10
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,13 @@ def __init__(
8181
self.side_frame.setLayout(self.vbox_layout)
8282

8383
self.central_panels_map: Dict[str, QWidget] = {}
84-
84+
self._experiment_panel: Optional[ExperimentPanel] = None
85+
self._plot_window: Optional[PlotWindow] = None
86+
self._manage_experiments_panel: Optional[ManageExperimentsPanel] = None
8587
self._add_sidebar_button(
8688
"Start simulation", QIcon("img:play_circle_outlined.svg")
8789
)
88-
89-
self._plot_window: Optional[PlotWindow] = None
9090
self._add_sidebar_button("Create plot", QIcon("img:timeline.svg"))
91-
92-
self._manage_experiments_panel: Optional[ManageExperimentsPanel] = None
9391
self._add_sidebar_button("Manage experiments", QIcon("img:build_wrench.svg"))
9492
self.results_button = self._add_sidebar_button(
9593
"Simulation status", QIcon("img:in_progress.svg")
@@ -154,16 +152,18 @@ def slot_add_widget(self, run_dialog: RunDialog) -> None:
154152
date_time = datetime.datetime.now(datetime.timezone.utc).strftime(
155153
"%Y-%d-%m %H:%M:%S"
156154
)
157-
self.central_panels_map[date_time] = run_dialog
155+
experiment_type = run_dialog._run_model.name()
156+
simulation_id = experiment_type + " : " + date_time
157+
self.central_panels_map[simulation_id] = run_dialog
158158
self.run_dialog_counter += 1
159159
self.central_layout.addWidget(run_dialog)
160160

161-
def add_sim_run_option(datetime: str) -> None:
161+
def add_sim_run_option(simulation_id: str) -> None:
162162
menu = self.results_button.menu()
163163
if menu:
164164
action_list = menu.actions()
165-
act = QAction(text=datetime, parent=menu)
166-
act.setProperty("index", datetime)
165+
act = QAction(text=simulation_id, parent=menu)
166+
act.setProperty("index", simulation_id)
167167
act.triggered.connect(self.select_central_widget)
168168

169169
if action_list:
@@ -193,7 +193,8 @@ def post_init(self) -> None:
193193
self.facade.get_ensemble_size(),
194194
)
195195
self.central_layout.addWidget(experiment_panel)
196-
self.central_panels_map["Start simulation"] = experiment_panel
196+
self._experiment_panel = experiment_panel
197+
self.central_panels_map["Start simulation"] = self._experiment_panel
197198

198199
experiment_panel.experiment_started.connect(self.slot_add_widget)
199200

0 commit comments

Comments
 (0)