Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
total_control_app
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Martin Drechsler
total_control_app
Commits
1908d2d6
Commit
1908d2d6
authored
May 17, 2019
by
Martin Drechsler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some changes to make it work on the real camera
parent
1dc78886
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
244 additions
and
233 deletions
+244
-233
MCDAQcontrolsignals.py
MCDAQcontrolsignals.py
+6
-2
cameraGui.py
cameraGui.py
+2
-0
controlGui.py
controlGui.py
+3
-4
andorzyla.py
drivers/andorzyla.py
+2
-1
main.py
main.py
+18
-18
webcams.py
resources/webcams.py
+2
-2
cameraParameterTree.py
subclasses/cameraParameterTree.py
+1
-1
controllayouts.py
subclasses/controllayouts.py
+206
-203
zylaCameraWorker.py
zylaCameraWorker.py
+4
-2
No files found.
MCDAQcontrolsignals.py
View file @
1908d2d6
...
...
@@ -2,7 +2,11 @@
"""
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
subclasses.controllayouts
import
LaserControlLayout
from
subclasses.controllayouts
import
LaserScanLayout
...
...
@@ -104,7 +108,7 @@ class anal_control_signal(QtCore.QObject):
class
digital_control_signal
(
QtCore
.
QObject
):
_registry
=
[]
def
__init__
(
self
,
name
,
channel
,
inverse
=
Fals
e
):
def
__init__
(
self
,
name
,
channel
,
inverse
=
Tru
e
):
super
()
.
__init__
()
self
.
_registry
.
append
(
self
)
...
...
cameraGui.py
View file @
1908d2d6
...
...
@@ -89,6 +89,7 @@ class CameraGuiMainWindow(QMainWindow):
# image layout
self
.
img
=
pg
.
ImageItem
(
border
=
"w"
)
self
.
img
.
rotate
(
90
)
self
.
imv
=
pg
.
ImageView
(
imageItem
=
self
.
img
,
view
=
self
.
imageView
)
self
.
imv
.
ui
.
roiBtn
.
setText
(
'Useless'
)
self
.
dCameraView
.
addWidget
(
self
.
imv
)
...
...
@@ -271,6 +272,7 @@ class CameraGuiMainWindow(QMainWindow):
#@QtCore.pyqtSlot()
def
measurement_ending
(
self
):
print
(
'entering gui measure ending'
)
self
.
cameraButton
.
setEnabled
(
True
)
self
.
measurementFrame
.
startMeasureButton
.
setEnabled
(
True
)
self
.
measurementFrame
.
saveMeasureButton
.
setEnabled
(
True
)
...
...
controlGui.py
View file @
1908d2d6
...
...
@@ -56,12 +56,12 @@ class ControlGui(QtGui.QFrame):
self
.
laser397_control_layout
=
LaserControlLayout
(
'397'
,
checkboxes
=
[
'shutter397'
],
spinboxes
=
[
'piezoA397'
,
'piezoB397'
])
self
.
laser397_scan_layout
=
LaserScanLayout
(
name
=
'piezo
A
397'
,
signal_to_scan_layout
=
self
.
laser397_control_layout
)
self
.
laser397_scan_layout
=
LaserScanLayout
(
name
=
'piezo
B
397'
,
signal_to_scan_layout
=
self
.
laser397_control_layout
)
self
.
dock_397
.
addWidget
(
self
.
laser397_control_layout
,
0
,
0
)
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_scan_layout
=
LaserScanLayout
(
name
=
'piezo
A
866'
,
signal_to_scan_layout
=
self
.
laser866_control_layout
)
self
.
laser866_control_layout
=
LaserControlLayout
(
'866'
,
checkboxes
=
[
'shutter866'
,
'shut
t
er866WM'
],
spinboxes
=
[
'piezoA866'
,
'piezoB866'
],
blinkCheckbox
=
[
'shutter866'
])
self
.
laser866_scan_layout
=
LaserScanLayout
(
name
=
'piezo
B
866'
,
signal_to_scan_layout
=
self
.
laser866_control_layout
)
self
.
dock_866
.
addWidget
(
self
.
laser866_control_layout
)
self
.
dock_866_scan
.
addWidget
(
self
.
laser866_scan_layout
)
...
...
@@ -87,7 +87,6 @@ class ControlGui(QtGui.QFrame):
self
.
electrodes_control_layout
.
addWidget
(
self
.
electrodes_control_layout
.
spinboxes
[
'compExYb'
],
1
,
5
)
self
.
toolbar
=
myToolbarMenu
(
self
)
self
.
toolbar
.
load
()
self
.
autosave_timer
=
QtCore
.
QTimer
()
self
.
autosave_timer
.
timeout
.
connect
(
lambda
:
self
.
toolbar
.
save
(
'config.ini'
))
self
.
autosave_timer
.
start
(
10000
)
...
...
drivers/andorzyla.py
View file @
1908d2d6
...
...
@@ -749,10 +749,11 @@ class AndorBase(SDK3Camera):
def
live_acquisition_loop
(
self
):
t
=
threading
.
currentThread
()
timeout
=
self
.
ExposureTime
.
getValue
()
*
5000
while
getattr
(
t
,
"do_run"
,
True
):
a_s
,
px_encoding
,
xs
,
ys
,
bufs
=
self
.
_live_acq_auxs
try
:
pData
,
lData
=
SDK3
.
WaitBuffer
(
self
.
handle
,
10000
)
pData
,
lData
=
SDK3
.
WaitBuffer
(
self
.
handle
,
int
(
timeout
)
)
except
:
return
img
=
create_aligned_array
(
xs
*
ys
,
'uint16'
)
...
...
main.py
View file @
1908d2d6
from
PyQt5
import
QtGui
,
QtCore
#
from drivers.andorzyla import AndorZyla
from
drivers.dummyAndor
import
AndorZyla
from
drivers.andorzyla
import
AndorZyla
#
from drivers.dummyAndor import AndorZyla
from
cameraGui
import
CameraGuiMainWindow
from
zylaCameraWorker
import
CameraWorker
#from measurement import MeasurementWorker, MeasurementGui
from
MCDAQcontrolsignals
import
anal_control_signal
from
MCDAQcontrolsignals
import
digital_control_signal
from
controlGui
import
ControlGui
...
...
@@ -20,24 +19,24 @@ if __name__ == "__main__":
camera
=
AndorZyla
(
0
)
piezoA397
=
anal_control_signal
(
'piezoA397'
,
channel
=
0
,
ao_type
=
'cavity_piezo'
,
out_minimum
=
0
,
out_maximum
=
4
)
piezoB397
=
anal_control_signal
(
'piezoB397'
,
channel
=
1
,
ao_type
=
'cavity_piezo'
)
piezoA866
=
anal_control_signal
(
'piezoA866'
,
channel
=
2
,
ao_type
=
'cavity_piezo'
,
out_minimum
=
0
,
out_maximum
=
4
)
piezoB866
=
anal_control_signal
(
'piezoB866'
,
channel
=
3
,
ao_type
=
'cavity_piezo'
)
piezo423
=
anal_control_signal
(
'piezo423'
,
channel
=
4
,
ao_type
=
'laser_piezo'
)
piezoA397
=
anal_control_signal
(
'piezoA397'
,
channel
=
13
,
ao_type
=
'cavity_piezo'
,
out_minimum
=
0
,
out_maximum
=
4
)
piezoB397
=
anal_control_signal
(
'piezoB397'
,
channel
=
7
,
ao_type
=
'cavity_piezo'
)
piezoA866
=
anal_control_signal
(
'piezoA866'
,
channel
=
14
,
ao_type
=
'cavity_piezo'
,
out_minimum
=
0
,
out_maximum
=
4
)
piezoB866
=
anal_control_signal
(
'piezoB866'
,
channel
=
9
,
ao_type
=
'cavity_piezo'
,
out_minimum
=
-
2
,
out_maximum
=
10
)
piezo423
=
anal_control_signal
(
'piezo423'
,
channel
=
3
,
ao_type
=
'laser_piezo'
)
trapDCA
=
anal_control_signal
(
'dcA'
,
channel
=
5
,
ao_type
=
'electrode'
)
trapDCB
=
anal_control_signal
(
'dcB'
,
channel
=
6
,
ao_type
=
'electrode'
)
trapCOMPC
=
anal_control_signal
(
'compC'
,
channel
=
7
,
ao_type
=
'electrode'
)
trapCOMPD
=
anal_control_signal
(
'compD'
,
channel
=
8
,
ao_type
=
'electrode'
)
trapOven
=
anal_control_signal
(
'compOven'
,
channel
=
9
,
ao_type
=
'electrode'
)
trapExYb
=
anal_control_signal
(
'compExYb'
,
channel
=
10
,
ao_type
=
'electrode'
)
trapDCA
=
anal_control_signal
(
'dcA'
,
channel
=
2
,
ao_type
=
'electrode'
)
trapDCB
=
anal_control_signal
(
'dcB'
,
channel
=
1
,
ao_type
=
'electrode'
)
trapCOMPC
=
anal_control_signal
(
'compC'
,
channel
=
4
,
ao_type
=
'electrode'
)
trapCOMPD
=
anal_control_signal
(
'compD'
,
channel
=
5
,
ao_type
=
'electrode'
)
trapOven
=
anal_control_signal
(
'compOven'
,
channel
=
0
,
ao_type
=
'electrode'
)
trapExYb
=
anal_control_signal
(
'compExYb'
,
channel
=
6
,
ao_type
=
'electrode'
)
shutter866
=
digital_control_signal
(
'shutter866'
,
channel
=
0
)
shutter397
=
digital_control_signal
(
'shutter397'
,
channel
=
1
)
shutter423
=
digital_control_signal
(
'shutter423'
,
channel
=
2
)
shutter866WM
=
digital_control_signal
(
'shutter866WM'
,
channel
=
3
)
shutter866
=
digital_control_signal
(
'shutter866'
,
channel
=
2
,
inverse
=
True
)
shutter397
=
digital_control_signal
(
'shutter397'
,
channel
=
0
,
inverse
=
True
)
shutter423
=
digital_control_signal
(
'shutter423'
,
channel
=
1
,
inverse
=
True
)
shutter866WM
=
digital_control_signal
(
'shutter866WM'
,
channel
=
3
,
inverse
=
True
)
controlGui
=
ControlGui
()
mcDAQthread
=
QtCore
.
QThread
()
...
...
@@ -65,5 +64,6 @@ if __name__ == "__main__":
cameraThread
.
start
()
mcDAQthread
.
start
()
controlGui
.
toolbar
.
load
()
sys
.
exit
(
app
.
exec_
())
resources/webcams.py
View file @
1908d2d6
...
...
@@ -7,8 +7,8 @@ This is a temporary script file.
import
cv2
cap
=
cv2
.
VideoCapture
(
0
)
cap1
=
cv2
.
VideoCapture
(
1
)
cap
=
cv2
.
VideoCapture
(
2
)
cap1
=
cv2
.
VideoCapture
(
3
)
while
(
True
):
# Capture frame-by-frame
...
...
subclasses/cameraParameterTree.py
View file @
1908d2d6
...
...
@@ -26,7 +26,7 @@ class BasicAcquisitonParameters(pTypes.GroupParameter):
[
'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'
:
'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'
:
'Temperature Status'
,
'type'
:
'str'
,
'value'
:
'?'
,
'readonly'
:
True
})
...
...
subclasses/controllayouts.py
View file @
1908d2d6
...
...
@@ -125,6 +125,9 @@ class LaserScanLayout(pg.LayoutWidget):
self
.
spinboxes
[
'start'
]
=
CustomSpinBox
(
siPrefix
=
True
,
suffix
=
'V'
)
self
.
spinboxes
[
'stop'
]
=
CustomSpinBox
(
siPrefix
=
True
,
suffix
=
'V'
)
self
.
spinboxes
[
'period'
]
=
CustomSpinBox
(
siPrefix
=
True
,
suffix
=
's'
,
step
=
1
)
self
.
spinboxes
[
'period'
]
.
setMinimum
(
0
)
self
.
scan_button
=
QPushButton
(
'Start scan'
)
self
.
scanpBar
=
QProgressBar
(
self
)
self
.
scanLabelValue
=
QLabel
(
self
)
...
...
zylaCameraWorker.py
View file @
1908d2d6
...
...
@@ -112,7 +112,7 @@ class CameraWorker(QtCore.QObject):
params
.
child
(
'Basic acq parameters'
)
.
child
(
'Dynamic Range'
)
.
value
()
)
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
)
...
...
@@ -157,11 +157,13 @@ class CameraWorker(QtCore.QObject):
def
simple_scan_measurement_end
(
self
):
self
.
_stop_acquisition_loop
()
self
.
cam
.
TriggerMode
.
setString
(
'Internal'
)
self
.
cam
.
helper
.
imageAquiredSignal
.
disconnect
(
self
.
new_image_acquired_with_trigger
)
self
.
cam
.
helper
.
imageAquiredSignal
.
connect
(
self
.
new_image_acquired
)
self
.
measurementEndingSignal
.
emit
()
print
(
'exiting scan ending in worker'
)
def
simple_scan_measurement_step
(
self
):
try
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment