@@ -226,7 +226,7 @@ class MainWindow(QMainWindow):
226226 config_quad_step : QDoubleSpinBox
227227 config_warning_current : QDoubleSpinBox
228228 config_sofb_run_time : QDoubleSpinBox
229- config_run_time : QDoubleSpinBox
229+ config_fofb_run_time : QDoubleSpinBox
230230 config_wait_time : QDoubleSpinBox
231231 config_sbba_min_frac : QDoubleSpinBox
232232 config_sbba_stdev : QDoubleSpinBox
@@ -288,7 +288,6 @@ def __init__(self, *args, **kwargs) -> None:
288288 self .selection_strings : list [str ] | None = None
289289 self .selected : list [str ] | str | None = None
290290 self .loadfolder : str | None = None
291- self .savepath : str | None = None
292291 self .loadfile : str | None = None
293292 self .selected_toggle : int = 0
294293 self .tmp_single_filepath : str | None = None
@@ -476,14 +475,17 @@ def create_worker(self) -> Worker:
476475 if isinstance (self .selected , str ):
477476 self .selected = [self .selected ]
478477 assert isinstance (self .selected , list ) and isinstance (self .selected [0 ], str )
478+
479+ latest_config = self .get_config_from_gui ()
480+
479481 return Worker (
480482 method ,
481483 self .selected ,
482484 self .create_question_box ,
483485 machine = self .machine ,
484- folder_path = self . machine . config ["SAVE_LOCATION" ],
486+ folder_path = latest_config ["SAVE_LOCATION" ],
485487 logger = self .logger ,
486- additional_options = self . get_config_from_gui () ,
488+ additional_options = latest_config ,
487489 )
488490
489491 def reset_iocs (self ) -> None :
@@ -551,8 +553,6 @@ def load_config_file(self) -> None:
551553 list_file = [file [0 ]]
552554 self .machine .update_config (extra_config_files = list_file )
553555 self .show_config ()
554- # Allow for lattice reload.
555- cothread .Yield () # TODO: Why does this need to yield?
556556 self .display_config_load .setText (f"Config File Applied at { get_isotime ()} " )
557557
558558 def get_ringmode_options (self ) -> list [str ]:
@@ -574,36 +574,41 @@ def get_config_from_gui(self) -> dict[str, Any]:
574574 A dictionary of the new config.
575575 """
576576 config_dict = {
577- "SAVE_LOCATION" : self . display_save_loc . toPlainText (),
577+ # Main Page
578578 "USE_FEEDBACKS" : self .config_use_feedbacks .isChecked (),
579579 "FOFB_FEEDBACKS" : self .config_use_fofb .isChecked (),
580580 "MAX_ORBIT_CORRECTION_MICRONS" : self .config_max_orbit .value (),
581581 "MIN_CURRENT" : self .config_current_limit .value (),
582+ ## Additional Options and Plotting#
583+ # General Options
582584 "CORRECTOR_KICK_RADIANS" : self .config_corr_kick .value () / RAD_TO_URAD_CONV ,
583585 "QUADRUPOLE_STEP_PERCENT" : self .config_quad_step .value (),
584586 "WARNING_CURRENT_DROP" : self .config_warning_current .value (),
585- "FEEDBACK_WAIT_TIME" : self .config_wait_time .value (),
586- "FEEDBACK_RUN_TIME" : self .config_run_time .value (),
587587 "SOFB_RUN_TIME" : self .config_sofb_run_time .value (),
588- "MIN_SLOPE_FRACTION" : self .config_sbba_min_frac .value (),
589- "CENTER_OUTLIER_FACTOR" : self .config_sbba_stdev .value (),
590- "OUTLIER_FACTOR" : self .config_sbba_fit_diff .value (),
588+ "FOFB_RUN_TIME" : self .config_fofb_run_time .value (),
589+ "FEEDBACK_WAIT_TIME" : self .config_wait_time .value (),
591590 "DECIMATED" : self .config_use_decimation .isChecked (),
592591 "X_CYCLES" : self .config_x_cycles .value (),
593592 "X_FREQUENCY" : self .config_x_freq .value (),
594593 "Y_CYCLES" : self .config_y_cycles .value (),
595594 "Y_FREQUENCY" : self .config_y_freq .value (),
595+ "RESELECTION_LIMIT" : self .config_reselection .value (),
596596 "SAVE_RAWDATA" : self .save_rawdata .isChecked (),
597597 "SAVE_RESULTS" : self .save_results .isChecked (),
598598 "SAVE_PLOTS" : self .save_plots .isChecked (),
599- "RESELECTION_LIMIT" : self . config_reselection . value (),
599+ # Advanced Options
600600 "RINGMODE" : self .config_ringmode .currentText (),
601601 "COTHREAD_CONTROL_SYSTEM_TIMEOUT" : self .config_ccs_timeout .value (),
602602 "COTHREAD_CONTROL_SYSTEM_WAIT_FLAG" : self .config_ccs_wait .isChecked (),
603- "FOFB_EXECUTABLE_PATH" : self .config_fofb_executable_path .toPlainText (),
603+ "MIN_SLOPE_FRACTION" : self .config_sbba_min_frac .value (),
604+ "OUTLIER_FACTOR" : self .config_sbba_fit_diff .value (),
605+ "CENTER_OUTLIER_FACTOR" : self .config_sbba_stdev .value (),
604606 "FOFB_MAX_ORBIT_MICRONS" : self .config_fofb_max_orbit .value (),
605607 "ORBIT_RESPONSE_MATRIX_PATH" : self .config_orm_path .toPlainText (),
606608 "CORRECTORS_TXT_PATH" : self .config_corrector_txt_path .toPlainText (),
609+ "FOFB_EXECUTABLE_PATH" : self .config_fofb_executable_path .toPlainText (),
610+ # Save Location and Config
611+ "SAVE_LOCATION" : self .display_save_loc .toPlainText (),
607612 }
608613 return config_dict
609614
@@ -629,7 +634,7 @@ def show_config(self) -> None:
629634 self .config_quad_step .setValue (config ["QUADRUPOLE_STEP_PERCENT" ])
630635 self .config_warning_current .setValue (config ["WARNING_CURRENT_DROP" ])
631636 self .config_wait_time .setValue (config ["FEEDBACK_WAIT_TIME" ])
632- self .config_run_time .setValue (config ["FEEDBACK_RUN_TIME " ])
637+ self .config_fofb_run_time .setValue (config ["FOFB_RUN_TIME " ])
633638 self .config_sofb_run_time .setValue (config ["SOFB_RUN_TIME" ])
634639 self .config_sbba_min_frac .setValue (config ["MIN_SLOPE_FRACTION" ])
635640 self .config_sbba_stdev .setValue (config ["CENTER_OUTLIER_FACTOR" ])
@@ -703,11 +708,9 @@ def select_save_location_folder(self) -> None:
703708 self , "Select Folder to Save to" , self .machine .config ["SAVE_LOCATION" ]
704709 )
705710 if folderpath == "" :
706- self .display_save_loc .clear ()
707- self .display_save_loc .setPlainText (self .machine .config ["SAVE_LOCATION" ])
708- else :
709- self .display_save_loc .setPlainText (folderpath )
710- self .savepath = folderpath
711+ folderpath = self .machine .config ["SAVE_LOCATION" ]
712+
713+ self .display_save_loc .setPlainText (folderpath )
711714
712715 def select_bba_folder (self ) -> None :
713716 """Select a folder of old data to load."""
0 commit comments