Skip to content

Commit

Permalink
Updating Software Updater, Integrating Histoscanner
Browse files Browse the repository at this point in the history
  • Loading branch information
beniroquai committed Oct 30, 2022
1 parent 5dc4b76 commit 8f07785
Show file tree
Hide file tree
Showing 17 changed files with 1,045 additions and 39 deletions.
3 changes: 2 additions & 1 deletion imswitch/imcommon/controller/CheckUpdatesController.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def run(self):
def dlImSwitch(downloadURL, fileName):
resultDL = urllib.request.urlretrieve(downloadURL, fileName)

# download the new version in a separate thread
ImSwitchExeFilename = "ImSwitch.exe"
mThread = threading.Thread(target=dlImSwitch, args=(downloadURL, ImSwitchExeFilename+"*"))
mThread.start()
Expand All @@ -86,7 +87,7 @@ def dlImSwitch(downloadURL, fileName):
if os.path.isfile(ImSwitchExeFilename):
self.__logger.debug("Renaming old ImSwitch.exe file")
tz = datetime.timezone.utc
ft = "%Y-%m-%dT%H:%M:%S%z"
ft = "%Y-%m-%dT%H-%M-%S"
tt = datetime.datetime.now(tz=tz).strftime(ft)
os.rename(ImSwitchExeFilename, ImSwitchExeFilename+"_BAK_"+tt)

Expand Down
2 changes: 1 addition & 1 deletion imswitch/imcontrol/controller/CommunicationChannel.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class CommunicationChannel(SignalInterface):

#sigSendScannersInScan = Signal(object) # (scannerList)

sigAutoFocus = Signal(int, int) # scanrange and stepsize
sigAutoFocus = Signal(int, int, bool) # scanrange and stepsize and run in background?

sigBroadcast = Signal(str, str, object)

Expand Down
3 changes: 2 additions & 1 deletion imswitch/imcontrol/controller/MasterController.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from imswitch.imcommon.model import VFileItem
from imswitch.imcontrol.model import (
DetectorsManager, LasersManager, MultiManager, PositionersManager,
RecordingManager, RS232sManager, ScanManager, SLMManager, SIMManager, LEDMatrixsManager, MCTManager, ISMManager, UC2ConfigManager, AutofocusManager
RecordingManager, RS232sManager, ScanManager, SLMManager, SIMManager, LEDMatrixsManager, MCTManager, ISMManager, UC2ConfigManager, AutofocusManager, HistoScanManager
)


Expand Down Expand Up @@ -39,6 +39,7 @@ def __init__(self, setupInfo, commChannel, moduleCommChannel):
self.UC2ConfigManager = UC2ConfigManager(self.__setupInfo.uc2Config, lowLevelManagers)
self.simManager = SIMManager(self.__setupInfo.sim)
self.mctManager = MCTManager(self.__setupInfo.mct)
self.HistoScanManager = HistoScanManager(self.__setupInfo.HistoScan)
self.AutoFocusManager = AutofocusManager(self.__setupInfo.autofocus)
self.ismManager = ISMManager(self.__setupInfo.ism)

Expand Down
12 changes: 7 additions & 5 deletions imswitch/imcontrol/controller/controllers/AufofocusController.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def focusButton(self):

@APIExport(runOnUIThread=True)
# Update focus lock
def autoFocus(self, rangez=100, resolutionz=10):
def autoFocus(self, rangez=100, resolutionz=10, isRunInBackground=True):

'''
The stage moves from -rangez...+rangez with a resolution of resolutionz
Expand All @@ -79,10 +79,12 @@ def autoFocus(self, rangez=100, resolutionz=10):
pass

# this should decouple the hardware-related actions from the GUI - but it doesn't
self.isAutofocusRunning = True
self.AutofocusThread = threading.Thread(target=self.performAutofocusThread, args=(rangez,resolutionz), daemon=True)
self.AutofocusThread.start()

if isRunInBackground:
self.isAutofocusRunning = True
self.AutofocusThread = threading.Thread(target=self.performAutofocusThread, args=(rangez,resolutionz), daemon=True)
self.AutofocusThread.start()
else:
self.performAutofocusThread(rangez,resolutionz)
# determine optimal focus position by stepping through all z-positions and cacluate the focus metric
#self.focusPointSignal = self.__processDataThread.update(rangez,resolutionz)

Expand Down
Loading

0 comments on commit 8f07785

Please sign in to comment.