Skip to content

Commit

Permalink
Added and commented out some bias on the turret.
Browse files Browse the repository at this point in the history
  • Loading branch information
hickerson committed Apr 25, 2023
1 parent f7aabfc commit fa601aa
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 6 deletions.
1 change: 1 addition & 0 deletions lumascope_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ def tmove(self, degrees):

if not self.motion: return
# MUST home move objective home first to prevent crash
self.zhome()
#self.xyhome()
#self.xycenter()

Expand Down
14 changes: 14 additions & 0 deletions lumaviewpro.kv
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,13 @@
size_hint_y: None
height: '30dp'

Button:
id: turret_left_btn
size_hint_x: None
width: '40dp'
text: '<'
on_release: root.turret_left()

Button:
id: turret_home_btn
size_hint_x: None
Expand All @@ -423,6 +430,13 @@
id: turret_pos_4_btn
text: '4'
on_release: root.turret_select('4')

Button:
id: turret_right_btn
size_hint_x: None
width: '40dp'
text: '>'
on_release: root.turret_right()

ZStack:
id: zstack_id
Expand Down
27 changes: 21 additions & 6 deletions lumaviewpro.py
Original file line number Diff line number Diff line change
Expand Up @@ -1049,40 +1049,55 @@ def Richardson_Lucy(self, image):
# plot_deconvolution.html#sphx-glr-download-auto-examples-filters-plot-deconvolution-py
pass

def turret_left(self):
lumaview.scope.turret_bias -= 1
angle = 90*lumaview.scope.turret_id + lumaview.scope.turret_bias
lumaview.scope.tmove(angle)

def turret_right(self):
lumaview.scope.turret_bias += 1
angle = 90*lumaview.scope.turret_id + lumaview.scope.turret_bias
lumaview.scope.tmove(angle)

def turret_home(self):
lumaview.scope.turret_bias = 0
lumaview.scope.thome()
self.ids['turret_pos_1_btn'].state = 'normal'
self.ids['turret_pos_2_btn'].state = 'normal'
self.ids['turret_pos_3_btn'].state = 'normal'
self.ids['turret_pos_4_btn'].state = 'normal'

def turret_select(self, position):

#TODO check if turret has been HOMED turret first

lumaview.scope.turret_id = int(position) - 1
angle = 90*lumaview.scope.turret_id #+ lumaview.scope.turret_bias
lumaview.scope.tmove(angle)

#self.ids['turret_pos_1_btn'].state = 'normal'
#self.ids['turret_pos_2_btn'].state = 'normal'
#self.ids['turret_pos_3_btn'].state = 'normal'
#self.ids['turret_pos_4_btn'].state = 'normal'
#self.ids[f'turret_pos_{position}_btn'].state = 'down'

if position == '1':
lumaview.scope.tmove(0)
self.ids['turret_pos_1_btn'].state = 'down'
self.ids['turret_pos_2_btn'].state = 'normal'
self.ids['turret_pos_3_btn'].state = 'normal'
self.ids['turret_pos_4_btn'].state = 'normal'

elif position == '2':
lumaview.scope.tmove(90)
self.ids['turret_pos_1_btn'].state = 'normal'
self.ids['turret_pos_2_btn'].state = 'down'
self.ids['turret_pos_3_btn'].state = 'normal'
self.ids['turret_pos_4_btn'].state = 'normal'

elif position == '3':
lumaview.scope.tmove(180)
self.ids['turret_pos_1_btn'].state = 'normal'
self.ids['turret_pos_2_btn'].state = 'normal'
self.ids['turret_pos_3_btn'].state = 'down'
self.ids['turret_pos_4_btn'].state = 'normal'

elif position == '4':
lumaview.scope.tmove(270)
self.ids['turret_pos_1_btn'].state = 'normal'
self.ids['turret_pos_2_btn'].state = 'normal'
self.ids['turret_pos_3_btn'].state = 'normal'
Expand Down

0 comments on commit fa601aa

Please sign in to comment.