Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix laser config issue #602 #1061

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/navigate/controller/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ def change_microscope(self, microscope_name, zoom=None):
# update widgets
self.stage_controller.initialize()
self.channels_tab_controller.initialize()
self.channels_tab_controller.populate_experiment_values()
self.camera_setting_controller.update_camera_device_related_setting()
self.camera_setting_controller.populate_experiment_values()
self.camera_setting_controller.calculate_physical_dimensions()
Expand Down
16 changes: 13 additions & 3 deletions src/navigate/controller/sub_controllers/channels_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,18 @@ def populate_empty_values(self):
to be populated with a default value.
"""
for i in range(self.num):
if self.view.laser_pulldowns[i].get() == "":
if (
self.view.laser_pulldowns[i].get()
not in self.view.laser_pulldowns[i]["values"]
):
self.view.laser_pulldowns[i].set(
self.view.laser_pulldowns[i]["values"][0]
)

if self.view.filterwheel_pulldowns[i].get() == "":
if (
self.view.filterwheel_pulldowns[i].get()
not in self.view.filterwheel_pulldowns[i]["values"]
):
self.view.filterwheel_pulldowns[i].set(
self.view.filterwheel_pulldowns[i]["values"][0]
)
Expand Down Expand Up @@ -431,7 +437,11 @@ def get_index(self, dropdown_name, value):
if not value:
return -1
if dropdown_name == "laser":
return self.view.laser_pulldowns[0]["values"].index(value)
try:
laser_id = self.view.laser_pulldowns[0]["values"].index(value)
except ValueError:
return 0
return laser_id
elif dropdown_name.startswith("filter"):
idx = int(dropdown_name[dropdown_name.rfind("_") + 1 :])
return self.view.filterwheel_pulldowns[idx]["values"].index(value)
Expand Down