Skip to content

Commit

Permalink
can toggle afc to turn off during acquisition
Browse files Browse the repository at this point in the history
  • Loading branch information
fcollman committed Jun 12, 2017
1 parent 30f0405 commit d7c5c06
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 5 additions & 2 deletions MosaicPlanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,13 +690,16 @@ def hardware_acquire(z=presentZ):


if self.cfg['MosaicPlanner']['autofocus_toggle']:
self.imgSrc.set_hardware_autofocus_state(False)
print 'toggle autofocus'
self.imgSrc.set_hardware_autofocus_state(False,False)

if (self.cfg['MosaicPlanner']['hardware_trigger'] == True) and (chrome_correction == False) and (success != False):
hardware_acquire()
else:
software_acquire()

if self.cfg['MosaicPlanner']['autofocus_toggle']:
self.imgSrc.set_hardware_autofocus_state(True,True)
if not hold_focus:
self.imgSrc.set_z(current_z)
if self.imgSrc.has_hardware_autofocus():
Expand Down Expand Up @@ -1954,7 +1957,7 @@ def __init__(self, parent, title):
#default_image=""

#recursively call old init function
wx.Frame.__init__(self, parent, title=title, size=(2000,885),pos=(5,5))
wx.Frame.__init__(self, parent, title=title, size=(1800,885),pos=(5,5))
#self.cfg = wx.Config('settings')
if not os.path.isfile(SETTINGS_FILE):
from shutil import copyfile
Expand Down
5 changes: 3 additions & 2 deletions imageSourceMM.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,11 @@ def get_hardware_autofocus_state(self):
if self.has_hardware_autofocus():
return self.mmc.isContinuousFocusEnabled()

def set_hardware_autofocus_state(self,state):
def set_hardware_autofocus_state(self,state,dowait=True):
if self.has_hardware_autofocus():
self.mmc.enableContinuousFocus(state)
self.mmc.waitForDevice(self.mmc.getAutoFocusDevice())
if dowait:
self.mmc.waitForDevice(self.mmc.getAutoFocusDevice())

def has_hardware_autofocus(self):
#NEED TO IMPLEMENT IF NOT MICROMANAGER
Expand Down

0 comments on commit d7c5c06

Please sign in to comment.