@@ -161,7 +161,9 @@ def __init__(self, view, parent_controller, waveform_constants_path):
161161 self .variables ["Delay" ].trace_add ("write" , self .update_waveform_parameters )
162162 self .variables ["Duty" ].trace_add ("write" , self .update_waveform_parameters )
163163 self .variables ["Smoothing" ].trace_add ("write" , self .update_waveform_parameters )
164- self .variables ["Ramp_falling" ].trace_add ("write" , self .update_waveform_parameters )
164+ self .variables ["Ramp_falling" ].trace_add (
165+ "write" , self .update_waveform_parameters
166+ )
165167
166168 # Save waveform constants
167169 self .view .get_buttons ()["Save" ].configure (command = self .save_waveform_constants )
@@ -205,19 +207,29 @@ def configure_widget_range(self):
205207 0.01 for low mode.
206208
207209 """
208- self .laser_min = self .configuration_controller .remote_focus_dict ["hardware" ]["min" ]
209- self .laser_max = self .configuration_controller .remote_focus_dict ["hardware" ]["max" ]
210-
211- precision = int (self .configuration_controller .remote_focus_dict ["hardware" ].get ("precision" , 0 ))
212- increment = int (self .configuration_controller .remote_focus_dict ["hardware" ].get ("step" , 0 ))
210+ self .laser_min = self .configuration_controller .remote_focus_dict ["hardware" ][
211+ "min"
212+ ]
213+ self .laser_max = self .configuration_controller .remote_focus_dict ["hardware" ][
214+ "max"
215+ ]
216+
217+ precision = int (
218+ self .configuration_controller .remote_focus_dict ["hardware" ].get (
219+ "precision" , 0
220+ )
221+ )
222+ increment = int (
223+ self .configuration_controller .remote_focus_dict ["hardware" ].get ("step" , 0 )
224+ )
213225 if precision == 0 :
214226 precision = - 4 if self .laser_max < 1 else - 3
215227 elif precision > 0 :
216- precision = - precision
228+ precision = - precision
217229 if increment == 0 :
218230 increment = 0.0001 if self .laser_max < 1 else 0.001
219231 elif increment < 0 :
220- increment = - increment
232+ increment = - increment
221233
222234 # set ranges of value for those lasers
223235 for laser in self .lasers :
@@ -375,7 +387,9 @@ def show_laser_info(self, *args):
375387 self .resolution_info ["other_constants" ].get ("percent_smoothing" , 0 )
376388 )
377389 self .widgets ["Smoothing" ].widget .trigger_focusout_validation ()
378- self .widgets ["Delay" ].set (self .resolution_info ["other_constants" ].get ("remote_focus_delay" , 7.5 ))
390+ self .widgets ["Delay" ].set (
391+ self .resolution_info ["other_constants" ].get ("remote_focus_delay" , 7.5 )
392+ )
379393 self .widgets ["Delay" ].widget .trigger_focusout_validation ()
380394 self .widgets ["Duty" ].set (
381395 self .resolution_info ["other_constants" ]["remote_focus_settle_duration" ]
@@ -430,7 +444,7 @@ def func_laser(*args):
430444 # tell parent controller (the device)
431445 if self .event_id :
432446 self .view .popup .after_cancel (self .event_id )
433-
447+
434448 try :
435449 value = float (variable_value )
436450 except ValueError :
@@ -468,7 +482,7 @@ def update_waveform_parameters(self, *args, **wargs):
468482 """
469483 if not self .update_waveform_parameters_flag :
470484 return
471-
485+
472486 if self .event_id :
473487 self .view .popup .after_cancel (self .event_id )
474488 # Get the values from the widgets.
@@ -485,7 +499,9 @@ def update_waveform_parameters(self, *args, **wargs):
485499 self .resolution_info ["other_constants" ][
486500 "remote_focus_settle_duration"
487501 ] = duty_cycle
488- self .resolution_info ["other_constants" ]["remote_focus_ramp_falling" ] = ramp_falling
502+ self .resolution_info ["other_constants" ][
503+ "remote_focus_ramp_falling"
504+ ] = ramp_falling
489505 self .resolution_info ["other_constants" ]["remote_focus_delay" ] = delay
490506 self .resolution_info ["other_constants" ]["percent_smoothing" ] = smoothing
491507
@@ -587,18 +603,21 @@ def func_galvo(*args):
587603 # change any galvo parameters as one event
588604 if self .event_id :
589605 self .view .popup .after_cancel (self .event_id )
590-
606+
591607 try :
592608 value = float (variable_value )
593609 except ValueError :
594610 return
595- if value < self .galvo_min [galvo_name ] or value > self .galvo_max [galvo_name ]:
611+ if "Freq" not in widget_name and (
612+ value < self .galvo_min [galvo_name ]
613+ or value > self .galvo_max [galvo_name ]
614+ ):
596615 return
597616 self .galvo_setting [galvo_name ][self .resolution ][self .mag ][
598617 parameter
599618 ] = variable_value
600619 logger .debug (f"Galvo parameter { parameter } changed: { variable_value } " )
601-
620+
602621 self .event_id = self .view .popup .after (
603622 500 ,
604623 lambda : self .parent_controller .execute ("update_setting" , "galvo" ),
0 commit comments