diff --git a/imswitch/imcontrol/controller/controllers/JoystickController.py b/imswitch/imcontrol/controller/controllers/JoystickController.py index 6d2048c8d..08ffdb32f 100644 --- a/imswitch/imcontrol/controller/controllers/JoystickController.py +++ b/imswitch/imcontrol/controller/controllers/JoystickController.py @@ -12,7 +12,7 @@ def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # scaler - self.scaler = 10 + self.scaler = 100 # initialize the positioner self.positioner_name = self._master.positionersManager.getAllDeviceNames()[0] @@ -30,7 +30,6 @@ def moveXY(self, x, y): return x, y def moveZA(self, a, z): - print(z) if abs(a)>0 or abs(z) >0: self.positioner.moveForever(speed=(a*self.scaler, 0, 0, z*self.scaler), is_stop=False) else: diff --git a/imswitch/imcontrol/controller/controllers/LightsheetController.py b/imswitch/imcontrol/controller/controllers/LightsheetController.py index 49892fdc6..fe6b43e18 100644 --- a/imswitch/imcontrol/controller/controllers/LightsheetController.py +++ b/imswitch/imcontrol/controller/controllers/LightsheetController.py @@ -19,7 +19,7 @@ class LightsheetController(ImConWidgetController): """Linked to LightsheetWidget.""" sigImageReceived = Signal() - + sigSliderIlluValueChanged = Signal(float) def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self._logger = initLogger(self) @@ -29,7 +29,6 @@ def __init__(self, *args, **kwargs): self._widget.startButton.clicked.connect(self.startLightsheet) self._widget.stopButton.clicked.connect(self.stopLightsheet) #self._widget.mctShowLastButton.clicked.connect(self.showLast) - #self._widget.sigSliderIlluValueChanged.connect(self.valueIlluChanged) # select detectors allDetectorNames = self._master.detectorsManager.getAllDeviceNames() @@ -44,7 +43,7 @@ def __init__(self, *args, **kwargs): self._widget.setAvailableStageAxes(self.stages.axes) self.isLightsheetRunning = False - + self._widget.sigSliderIlluValueChanged.connect(self.valueIlluChanged) self.sigImageReceived.connect(self.displayImage) def displayImage(self): @@ -52,6 +51,15 @@ def displayImage(self): name = "Lightsheet Stack" self._widget.setImage(np.uint16(self.lightsheetStack ), colormap="gray", name=name, pixelsize=(1,1), translation=(0,0)) + def valueIlluChanged(self): + illuSource = self._widget.getIlluminationSource() + illuValue = self._widget.illuminationSlider.value() + self._master.lasersManager + if not self._master.lasersManager[illuSource].enabled: + self._master.lasersManager[illuSource].setEnabled(1) + + illuValue = illuValue/100*self._master.lasersManager[illuSource].valueRangeMax + self._master.lasersManager[illuSource].setValue(illuValue) def startLightsheet(self): minPos = self._widget.getMinPosition() diff --git a/imswitch/imcontrol/view/widgets/LightsheetWidget.py b/imswitch/imcontrol/view/widgets/LightsheetWidget.py index 9a8b8b02a..fec3beff1 100644 --- a/imswitch/imcontrol/view/widgets/LightsheetWidget.py +++ b/imswitch/imcontrol/view/widgets/LightsheetWidget.py @@ -8,8 +8,8 @@ class LightsheetWidget(NapariHybridWidget): """ Widget containing mct interface. """ - - + sigSliderIlluValueChanged = QtCore.Signal(float) # (value) + def __post_init__(self): #super().__init__(*args, **kwargs) @@ -26,6 +26,10 @@ def __post_init__(self): self.illuminationSlider = QtWidgets.QSlider(QtCore.Qt.Horizontal) self.illuminationSlider.setMinimum(0) self.illuminationSlider.setMaximum(100) + self.illuminationSlider.valueChanged.connect( + lambda value: self.sigSliderIlluValueChanged.emit(value) + ) + self.grid.addWidget(self.illuminationSlider, 3, 1, 1, 1) # Pull-down menu for the stage axis