@@ -81,15 +81,13 @@ def __init__(
81
81
self .side_frame .setLayout (self .vbox_layout )
82
82
83
83
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
85
87
self ._add_sidebar_button (
86
88
"Start simulation" , QIcon ("img:play_circle_outlined.svg" )
87
89
)
88
-
89
- self ._plot_window : Optional [PlotWindow ] = None
90
90
self ._add_sidebar_button ("Create plot" , QIcon ("img:timeline.svg" ))
91
-
92
- self ._manage_experiments_panel : Optional [ManageExperimentsPanel ] = None
93
91
self ._add_sidebar_button ("Manage experiments" , QIcon ("img:build_wrench.svg" ))
94
92
self .results_button = self ._add_sidebar_button (
95
93
"Simulation status" , QIcon ("img:in_progress.svg" )
@@ -154,16 +152,18 @@ def slot_add_widget(self, run_dialog: RunDialog) -> None:
154
152
date_time = datetime .datetime .now (datetime .timezone .utc ).strftime (
155
153
"%Y-%d-%m %H:%M:%S"
156
154
)
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
158
158
self .run_dialog_counter += 1
159
159
self .central_layout .addWidget (run_dialog )
160
160
161
- def add_sim_run_option (datetime : str ) -> None :
161
+ def add_sim_run_option (simulation_id : str ) -> None :
162
162
menu = self .results_button .menu ()
163
163
if menu :
164
164
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 )
167
167
act .triggered .connect (self .select_central_widget )
168
168
169
169
if action_list :
@@ -193,7 +193,8 @@ def post_init(self) -> None:
193
193
self .facade .get_ensemble_size (),
194
194
)
195
195
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
197
198
198
199
experiment_panel .experiment_started .connect (self .slot_add_widget )
199
200
0 commit comments