Skip to content
Merged
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
26 changes: 19 additions & 7 deletions src/navigate/model/devices/filter_wheel/asi.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,13 @@ def set_filter(self, filter_name, wait_until_done=True):
self.filter_wheel.select_filter_wheel(
filter_wheel_number=self.filter_wheel_number
)
self.filter_wheel.move_filter_wheel(self.filter_dictionary[filter_name])

try:
self.filter_wheel.move_filter_wheel(self.filter_dictionary[filter_name])
self.filter_wheel_position = self.filter_dictionary[filter_name]
except Exception as e:
logger.error(f"Filter wheel movement failed: {e}")
raise

# Wheel Position Change Delay
if wait_until_done:
Expand Down Expand Up @@ -277,12 +283,18 @@ def set_filter(self, filter_name, wait_until_done=True):

# Calculate the Delay Needed to Change the Positions
self.filter_change_delay(filter_name)
dichroic_position = self.filter_dictionary[filter_name]

assert dichroic_position in range(4)
self.dichroic.move_dichroic(
dichroic_id=self.dichroic_id, dichroic_position=dichroic_position
)
target_position = self.filter_dictionary[filter_name] # Where we want to move the filter.

assert target_position in range(4)

try:
self.dichroic.move_dichroic(
dichroic_id=self.dichroic_id, dichroic_position=target_position
)
self.dichroic_position = target_position
except Exception as e:
logger.error(f"Dichroic movement failed: {e}")
raise

# Wheel Position Change Delay
if wait_until_done:
Expand Down