Skip to content

Commit

Permalink
changes based on pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Alpaca233 committed Feb 2, 2025
1 parent be8e7a7 commit abf0951
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
4 changes: 2 additions & 2 deletions software/control/_def.py
Original file line number Diff line number Diff line change
Expand Up @@ -855,5 +855,5 @@ def load_formats():
USE_XERYON = False
XERYON_SERIAL_NUMBER = '95130303033351E02050'
XERYON_SPEED = 80
XERYON_OBJECTIVE_SWITCHER_POS_1 = '4x'
XERYON_OBJECTIVE_SWITCHER_POS_2 = '10x'
XERYON_OBJECTIVE_SWITCHER_POS_1 = ['4x', '10x']
XERYON_OBJECTIVE_SWITCHER_POS_2 = ['20x', '40x', '60x']
8 changes: 4 additions & 4 deletions software/control/gui_hcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,11 +493,11 @@ def setupHardware(self):
self.squid_filter_wheel.homing()

if USE_XERYON:
self.objective_changer.homing()
self.objective_changer.setSpeed(80)
if DEFAULT_OBJECTIVE == XERYON_OBJECTIVE_SWITCHER_POS_1:
self.objective_changer.home()
self.objective_changer.setSpeed(XERYON_SPEED)
if DEFAULT_OBJECTIVE in XERYON_OBJECTIVE_SWITCHER_POS_1:
self.objective_changer.moveToPosition1()
elif DEFAULT_OBJECTIVE == XERYON_OBJECTIVE_SWITCHER_POS_2:
elif DEFAULT_OBJECTIVE in XERYON_OBJECTIVE_SWITCHER_POS_2:
self.objective_changer.moveToPosition2()

def waitForMicrocontroller(self, timeout=5.0, error_message=None):
Expand Down
8 changes: 2 additions & 6 deletions software/control/objective_changer_2_pos_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,10 @@ def __init__(self, sn: str):
self.position1 = -19
self.position2 = 19

self.current_position = 1

def stopScan(self):
self.axisX.stopScan()
self.current_position = None

def homing(self):
def home(self):
self.axisX.findIndex()
self.axisX.stopScan()

def moveToPosition1(self):
self.axisX.setDPOS(self.position1)
Expand Down
4 changes: 2 additions & 2 deletions software/control/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,9 +548,9 @@ def init_ui(self):
def on_objective_changed(self, objective_name):
self.objectiveStore.set_current_objective(objective_name)
if USE_XERYON:
if objective_name == XERYON_OBJECTIVE_SWITCHER_POS_1 and self.objective_changer.currentPosition() != 1:
if objective_name in XERYON_OBJECTIVE_SWITCHER_POS_1 and self.objective_changer.currentPosition() != 1:
self.objective_changer.moveToPosition1()
elif objective_name == XERYON_OBJECTIVE_SWITCHER_POS_2 and self.objective_changer.currentPosition() != 2:
elif objective_name in XERYON_OBJECTIVE_SWITCHER_POS_2 and self.objective_changer.currentPosition() != 2:
self.objective_changer.moveToPosition2()
self.signal_objective_changed.emit()

Expand Down

0 comments on commit abf0951

Please sign in to comment.