Commit 1908d2d6 authored by Martin Drechsler's avatar Martin Drechsler

some changes to make it work on the real camera

parent 1dc78886
...@@ -2,7 +2,11 @@ ...@@ -2,7 +2,11 @@
""" """
Here the class of control signals are created. There are two types: analog and digital. Here the class of control signals are created. There are two types: analog and digital.
""" """
from drivers.ADoutputs import daq_AO, daq_DO import sys
if sys.platform == 'linux':
from drivers.ADoutputs_linux import daq_AO, daq_DO
else:
from drivers.ADoutputs import daq_AO, daq_DO
from PyQt5 import QtCore from PyQt5 import QtCore
from subclasses.controllayouts import LaserControlLayout from subclasses.controllayouts import LaserControlLayout
from subclasses.controllayouts import LaserScanLayout from subclasses.controllayouts import LaserScanLayout
...@@ -104,7 +108,7 @@ class anal_control_signal(QtCore.QObject): ...@@ -104,7 +108,7 @@ class anal_control_signal(QtCore.QObject):
class digital_control_signal(QtCore.QObject): class digital_control_signal(QtCore.QObject):
_registry = [] _registry = []
def __init__(self, name, channel, inverse=False): def __init__(self, name, channel, inverse=True):
super().__init__() super().__init__()
self._registry.append(self) self._registry.append(self)
......
...@@ -89,6 +89,7 @@ class CameraGuiMainWindow(QMainWindow): ...@@ -89,6 +89,7 @@ class CameraGuiMainWindow(QMainWindow):
# image layout # image layout
self.img = pg.ImageItem(border="w") self.img = pg.ImageItem(border="w")
self.img.rotate(90)
self.imv = pg.ImageView(imageItem=self.img, view=self.imageView) self.imv = pg.ImageView(imageItem=self.img, view=self.imageView)
self.imv.ui.roiBtn.setText('Useless') self.imv.ui.roiBtn.setText('Useless')
self.dCameraView.addWidget(self.imv) self.dCameraView.addWidget(self.imv)
...@@ -271,6 +272,7 @@ class CameraGuiMainWindow(QMainWindow): ...@@ -271,6 +272,7 @@ class CameraGuiMainWindow(QMainWindow):
#@QtCore.pyqtSlot() #@QtCore.pyqtSlot()
def measurement_ending(self): def measurement_ending(self):
print('entering gui measure ending')
self.cameraButton.setEnabled(True) self.cameraButton.setEnabled(True)
self.measurementFrame.startMeasureButton.setEnabled(True) self.measurementFrame.startMeasureButton.setEnabled(True)
self.measurementFrame.saveMeasureButton.setEnabled(True) self.measurementFrame.saveMeasureButton.setEnabled(True)
......
...@@ -56,12 +56,12 @@ class ControlGui(QtGui.QFrame): ...@@ -56,12 +56,12 @@ class ControlGui(QtGui.QFrame):
self.laser397_control_layout = LaserControlLayout('397', checkboxes=['shutter397'], spinboxes = ['piezoA397', 'piezoB397']) self.laser397_control_layout = LaserControlLayout('397', checkboxes=['shutter397'], spinboxes = ['piezoA397', 'piezoB397'])
self.laser397_scan_layout = LaserScanLayout(name='piezoA397', signal_to_scan_layout=self.laser397_control_layout) self.laser397_scan_layout = LaserScanLayout(name='piezoB397', signal_to_scan_layout=self.laser397_control_layout)
self.dock_397.addWidget(self.laser397_control_layout, 0, 0) self.dock_397.addWidget(self.laser397_control_layout, 0, 0)
self.dock_397_scan.addWidget(self.laser397_scan_layout, 0, 1) self.dock_397_scan.addWidget(self.laser397_scan_layout, 0, 1)
self.laser866_control_layout = LaserControlLayout('866', checkboxes=['shutter866', 'shuter866WM'], spinboxes = ['piezoA866', 'piezoB866'], blinkCheckbox = ['shutter866']) self.laser866_control_layout = LaserControlLayout('866', checkboxes=['shutter866', 'shutter866WM'], spinboxes = ['piezoA866', 'piezoB866'], blinkCheckbox = ['shutter866'])
self.laser866_scan_layout = LaserScanLayout(name='piezoA866', signal_to_scan_layout=self.laser866_control_layout) self.laser866_scan_layout = LaserScanLayout(name='piezoB866', signal_to_scan_layout=self.laser866_control_layout)
self.dock_866.addWidget(self.laser866_control_layout) self.dock_866.addWidget(self.laser866_control_layout)
self.dock_866_scan.addWidget(self.laser866_scan_layout) self.dock_866_scan.addWidget(self.laser866_scan_layout)
...@@ -87,7 +87,6 @@ class ControlGui(QtGui.QFrame): ...@@ -87,7 +87,6 @@ class ControlGui(QtGui.QFrame):
self.electrodes_control_layout.addWidget(self.electrodes_control_layout.spinboxes['compExYb'], 1, 5) self.electrodes_control_layout.addWidget(self.electrodes_control_layout.spinboxes['compExYb'], 1, 5)
self.toolbar = myToolbarMenu(self) self.toolbar = myToolbarMenu(self)
self.toolbar.load()
self.autosave_timer = QtCore.QTimer() self.autosave_timer = QtCore.QTimer()
self.autosave_timer.timeout.connect(lambda: self.toolbar.save('config.ini')) self.autosave_timer.timeout.connect(lambda: self.toolbar.save('config.ini'))
self.autosave_timer.start(10000) self.autosave_timer.start(10000)
......
...@@ -749,10 +749,11 @@ class AndorBase(SDK3Camera): ...@@ -749,10 +749,11 @@ class AndorBase(SDK3Camera):
def live_acquisition_loop(self): def live_acquisition_loop(self):
t = threading.currentThread() t = threading.currentThread()
timeout = self.ExposureTime.getValue() * 5000
while getattr(t, "do_run", True): while getattr(t, "do_run", True):
a_s, px_encoding, xs, ys, bufs = self._live_acq_auxs a_s, px_encoding, xs, ys, bufs = self._live_acq_auxs
try: try:
pData, lData = SDK3.WaitBuffer(self.handle, 10000) pData, lData = SDK3.WaitBuffer(self.handle, int(timeout))
except: except:
return return
img = create_aligned_array(xs*ys, 'uint16') img = create_aligned_array(xs*ys, 'uint16')
......
from PyQt5 import QtGui, QtCore from PyQt5 import QtGui, QtCore
#from drivers.andorzyla import AndorZyla from drivers.andorzyla import AndorZyla
from drivers.dummyAndor import AndorZyla #from drivers.dummyAndor import AndorZyla
from cameraGui import CameraGuiMainWindow from cameraGui import CameraGuiMainWindow
from zylaCameraWorker import CameraWorker from zylaCameraWorker import CameraWorker
#from measurement import MeasurementWorker, MeasurementGui
from MCDAQcontrolsignals import anal_control_signal from MCDAQcontrolsignals import anal_control_signal
from MCDAQcontrolsignals import digital_control_signal from MCDAQcontrolsignals import digital_control_signal
from controlGui import ControlGui from controlGui import ControlGui
...@@ -20,24 +19,24 @@ if __name__ == "__main__": ...@@ -20,24 +19,24 @@ if __name__ == "__main__":
camera = AndorZyla(0) camera = AndorZyla(0)
piezoA397 = anal_control_signal('piezoA397', channel=0, ao_type='cavity_piezo', out_minimum = 0, out_maximum = 4) piezoA397 = anal_control_signal('piezoA397', channel=13, ao_type='cavity_piezo', out_minimum = 0, out_maximum = 4)
piezoB397 = anal_control_signal('piezoB397', channel=1, ao_type='cavity_piezo') piezoB397 = anal_control_signal('piezoB397', channel=7, ao_type='cavity_piezo')
piezoA866 = anal_control_signal('piezoA866', channel=2, ao_type='cavity_piezo', out_minimum = 0, out_maximum = 4) piezoA866 = anal_control_signal('piezoA866', channel=14, ao_type='cavity_piezo', out_minimum = 0, out_maximum = 4)
piezoB866 = anal_control_signal('piezoB866', channel=3, ao_type='cavity_piezo') piezoB866 = anal_control_signal('piezoB866', channel=9, ao_type='cavity_piezo', out_minimum = -2, out_maximum = 10)
piezo423 = anal_control_signal('piezo423', channel=4, ao_type='laser_piezo') piezo423 = anal_control_signal('piezo423', channel=3, ao_type='laser_piezo')
trapDCA = anal_control_signal('dcA', channel = 5, ao_type='electrode') trapDCA = anal_control_signal('dcA', channel = 2, ao_type='electrode')
trapDCB = anal_control_signal('dcB', channel = 6, ao_type='electrode') trapDCB = anal_control_signal('dcB', channel = 1, ao_type='electrode')
trapCOMPC = anal_control_signal('compC', channel = 7, ao_type='electrode') trapCOMPC = anal_control_signal('compC', channel = 4, ao_type='electrode')
trapCOMPD = anal_control_signal('compD', channel = 8, ao_type='electrode') trapCOMPD = anal_control_signal('compD', channel = 5, ao_type='electrode')
trapOven = anal_control_signal('compOven', channel = 9, ao_type='electrode') trapOven = anal_control_signal('compOven', channel = 0, ao_type='electrode')
trapExYb = anal_control_signal('compExYb', channel = 10, ao_type='electrode') trapExYb = anal_control_signal('compExYb', channel = 6, ao_type='electrode')
shutter866 = digital_control_signal('shutter866', channel = 0) shutter866 = digital_control_signal('shutter866', channel = 2, inverse=True)
shutter397 = digital_control_signal('shutter397', channel = 1) shutter397 = digital_control_signal('shutter397', channel = 0, inverse=True)
shutter423 = digital_control_signal('shutter423', channel = 2) shutter423 = digital_control_signal('shutter423', channel = 1, inverse=True)
shutter866WM = digital_control_signal('shutter866WM', channel = 3) shutter866WM = digital_control_signal('shutter866WM', channel = 3, inverse=True)
controlGui = ControlGui() controlGui = ControlGui()
mcDAQthread = QtCore.QThread() mcDAQthread = QtCore.QThread()
...@@ -65,5 +64,6 @@ if __name__ == "__main__": ...@@ -65,5 +64,6 @@ if __name__ == "__main__":
cameraThread.start() cameraThread.start()
mcDAQthread.start() mcDAQthread.start()
controlGui.toolbar.load()
sys.exit(app.exec_()) sys.exit(app.exec_())
...@@ -7,8 +7,8 @@ This is a temporary script file. ...@@ -7,8 +7,8 @@ This is a temporary script file.
import cv2 import cv2
cap = cv2.VideoCapture(0) cap = cv2.VideoCapture(2)
cap1 = cv2.VideoCapture(1) cap1 = cv2.VideoCapture(3)
while(True): while(True):
# Capture frame-by-frame # Capture frame-by-frame
......
...@@ -26,7 +26,7 @@ class BasicAcquisitonParameters(pTypes.GroupParameter): ...@@ -26,7 +26,7 @@ class BasicAcquisitonParameters(pTypes.GroupParameter):
['12-bit (high well capacity)', '12-bit (low noise)', '16-bit (low noise & high well capacity)']} ['12-bit (high well capacity)', '12-bit (low noise)', '16-bit (low noise & high well capacity)']}
) )
self.addChild({'name': 'Readout Time', 'type': 'float', 'value': 0, 'readonly': True}) self.addChild({'name': 'Readout Time', 'type': 'float', 'value': 0, 'readonly': True})
self.addChild({'name': 'Spurious Noise Filter', 'type': 'list', 'values': ['True', 'False']}) self.addChild({'name': 'Spurious Noise Filter', 'type': 'list', 'values': [True, False]})
self.addChild({'name': 'Sensor Temperature', 'type': 'float', 'value': 25, 'readonly': True}) self.addChild({'name': 'Sensor Temperature', 'type': 'float', 'value': 25, 'readonly': True})
self.addChild({'name': 'Temperature Status', 'type': 'str', 'value': '?', 'readonly': True}) self.addChild({'name': 'Temperature Status', 'type': 'str', 'value': '?', 'readonly': True})
......
This diff is collapsed.
...@@ -110,9 +110,9 @@ class CameraWorker(QtCore.QObject): ...@@ -110,9 +110,9 @@ class CameraWorker(QtCore.QObject):
) )
self.cam.SimplePreAmpGainControl.setString( self.cam.SimplePreAmpGainControl.setString(
params.child('Basic acq parameters').child('Dynamic Range').value() params.child('Basic acq parameters').child('Dynamic Range').value()
) )
self.cam.SpuriousNoiseFilter.setValue( self.cam.SpuriousNoiseFilter.setValue(
params.child('Basic acq parameters').child('Spurious Noise Filter').value() params.child('Basic acq parameters').child('Spurious Noise Filter').value()=='True'
) )
@QtCore.pyqtSlot(int) @QtCore.pyqtSlot(int)
...@@ -157,11 +157,13 @@ class CameraWorker(QtCore.QObject): ...@@ -157,11 +157,13 @@ class CameraWorker(QtCore.QObject):
def simple_scan_measurement_end(self): def simple_scan_measurement_end(self):
self._stop_acquisition_loop() self._stop_acquisition_loop()
self.cam.TriggerMode.setString('Internal') self.cam.TriggerMode.setString('Internal')
self.cam.helper.imageAquiredSignal.disconnect(self.new_image_acquired_with_trigger) self.cam.helper.imageAquiredSignal.disconnect(self.new_image_acquired_with_trigger)
self.cam.helper.imageAquiredSignal.connect(self.new_image_acquired) self.cam.helper.imageAquiredSignal.connect(self.new_image_acquired)
self.measurementEndingSignal.emit() self.measurementEndingSignal.emit()
print('exiting scan ending in worker')
def simple_scan_measurement_step(self): def simple_scan_measurement_step(self):
try: try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment