Skip to content

Commit

Permalink
fix test - handle startup case before flux/angle unit are both populated
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Aug 22, 2024
1 parent 0277081 commit 8149cf4
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def _on_glue_y_display_unit_changed(self, y_unit_str):
if self.app.data_collection[0]:
dc_unit = self.app.data_collection[0].get_component("flux").units
self.angle_unit.choices = create_angle_equivalencies_list(dc_unit)
self.angle_unit.selected = self.angle_unit.choices[0]
self.angle_unit.select_default()
self.sb_unit_selected = self._append_angle_correctly(
self.flux_unit.selected,
self.angle_unit.selected
Expand Down Expand Up @@ -235,6 +235,9 @@ def _on_flux_or_angle_unit_changed(self, msg):
return
if not self.flux_unit.choices:
return
if self.flux_unit.selected == '' or self.angle_unit.selected == '':
# wait until flux AND angle unit are both populated during init
return

# various plugins are listening for changes in either flux or sb and
# need to be able to filter messages accordingly, so broadcast both when
Expand Down

0 comments on commit 8149cf4

Please sign in to comment.