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
207cc8e3
Commit
207cc8e3
authored
May 21, 2019
by
Martin Drechsler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
when ending measurement, it goes softly to value, and it saves initial and final comment
parent
8785f039
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
16 deletions
+40
-16
camera_testing.py
camera_testing.py
+11
-2
andorzyla.py
drivers/andorzyla.py
+5
-2
main.py
main.py
+2
-2
zylaCameraWorker.py
zylaCameraWorker.py
+22
-10
No files found.
camera_testing.py
View file @
207cc8e3
...
...
@@ -7,6 +7,7 @@ Created on Fri May 3 10:32:30 2019
"""
from
drivers.andorzyla
import
AndorZyla
import
threading
cam
=
AndorZyla
(
0
)
cam
.
Init
()
...
...
@@ -15,5 +16,13 @@ cam.GetMetaData()
#%%
cam
.
shutdown
()
#%%
def
f
():
print
(
'hola'
)
\ No newline at end of file
cam
.
AcquisitionStart
()
cameraThread
=
threading
.
Thread
(
target
=
cam
.
live_acquisition_loop
)
cam
.
live_acquisition_configure
()
cameraThread
.
start
()
cam
.
AcquisitionStart
()
\ No newline at end of file
drivers/andorzyla.py
View file @
207cc8e3
...
...
@@ -755,11 +755,14 @@ class AndorBase(SDK3Camera):
timeout
=
1000000
while
getattr
(
t
,
"do_run"
,
True
):
a_s
,
px_encoding
,
xs
,
ys
,
bufs
=
self
.
_live_acq_auxs
try
:
a_s
,
px_encoding
,
xs
,
ys
,
bufs
=
self
.
_live_acq_auxs
except
AttributeError
:
print
(
'AndorZyla object has no attribute _live_acq_auxs'
)
try
:
pData
,
lData
=
SDK3
.
WaitBuffer
(
self
.
handle
,
int
(
timeout
))
except
:
raise
(
'Timeout in the camera'
)
raise
Exception
(
'Timeout in the camera'
)
img
=
create_aligned_array
(
xs
*
ys
,
'uint16'
)
SDK3
.
ConvertBuffer
(
bufs
[
self
.
acq_index_i
%
len
(
bufs
)]
.
ctypes
.
data_as
(
ctypes
.
POINTER
(
ctypes
.
c_uint8
)),
img
.
ctypes
.
data_as
(
ctypes
.
POINTER
(
ctypes
.
c_uint8
)),
...
...
main.py
View file @
207cc8e3
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
...
...
zylaCameraWorker.py
View file @
207cc8e3
...
...
@@ -35,7 +35,8 @@ class CameraWorker(QtCore.QObject):
self
.
ao_to_scan
=
None
self
.
scan_array_gen
=
None
self
.
_lock
=
threading
.
Lock
()
self
.
measure_params
=
dict
()
def
make_connections
(
self
,
frontend
):
# frontend connections
live_acq_params
=
frontend
.
cameraParamFrame
.
paramTree
.
p
...
...
@@ -43,7 +44,11 @@ class CameraWorker(QtCore.QObject):
frontend
.
signalWithMeasurementParameters
.
connect
(
self
.
simple_scan_measurement_start
)
frontend
.
roiDataReadySignal
.
connect
(
self
.
save_data_from_scan_step
)
frontend
.
measurementFrame
.
saveMeasureButton
.
clicked
.
connect
(
self
.
storage
.
permanent_save_current_data
)
lambda
:
self
.
permanent_save_measurement
(
comment
=
frontend
.
measurementFrame
.
comments
.
toPlainText
()
)
)
# internal connections
self
.
cam
.
helper
.
imageAquiredSignal
.
connect
(
self
.
new_image_acquired
)
...
...
@@ -128,15 +133,16 @@ class CameraWorker(QtCore.QObject):
self
.
measurementStartingSignal
.
emit
()
self
.
ao_to_scan
=
self
.
get_scan_signal
(
measure_params
[
'signal_to_scan'
])
start
=
measure_params
[
'start'
]
end
=
measure_params
[
'end'
]
step_num
=
measure_params
[
'steps'
]
self
.
measure_params
=
measure_params
start
=
self
.
measure_params
[
'start'
]
end
=
self
.
measure_params
[
'end'
]
step_num
=
self
.
measure_params
[
'steps'
]
self
.
scan_array_gen
=
yield_array
(
create_measurement_array
(
start
,
end
,
step_num
))
self
.
ao_to_scan
.
go_softly_to_value
(
start
)
self
.
storage
.
set_directory
(
measure_params
[
'directory'
])
self
.
storage
.
create_data_file
(
'Time'
,
measure_params
[
'signal_to_scan'
],
'Roi data'
)
self
.
storage
.
append_metadata_to_current_file
(
measure_params
[
'spinboxes_dict'
],
self
.
cam
.
GetMetaData
(),
measure_params
)
self
.
storage
.
append_metadata_to_current_file
(
self
.
cam
.
GetMetaData
(),
self
.
measure_params
)
self
.
cam
.
TriggerMode
.
setString
(
'Software'
)
...
...
@@ -152,7 +158,8 @@ class CameraWorker(QtCore.QObject):
def
simple_scan_measurement_end
(
self
):
self
.
_stop_acquisition_loop
()
self
.
cam
.
TriggerMode
.
setString
(
'Internal'
)
self
.
cam
.
TriggerMode
.
setString
(
'Internal'
)
self
.
ao_to_scan
.
go_softly_to_value
(
self
.
measure_params
[
'end'
])
self
.
measurementEndingSignal
.
emit
()
print
(
'exiting scan ending in worker'
)
...
...
@@ -166,7 +173,7 @@ class CameraWorker(QtCore.QObject):
# aca puede esperar o chequear algo, por ahora nada
self
.
cam
.
trigger
()
print
(
'trigger'
)
except
:
except
StopIteration
:
self
.
simple_scan_measurement_end
()
def
get_scan_signal
(
self
,
ao_name
):
...
...
@@ -183,6 +190,11 @@ class CameraWorker(QtCore.QObject):
self
.
scan_array_gen
.
close
()
print
(
'Measurement aborted'
)
@
QtCore
.
pyqtSlot
(
str
)
def
permanent_save_measurement
(
self
,
comment
=
''
):
self
.
storage
.
append_metadata_to_current_file
(
{
'Final comment'
:
comment
}
)
self
.
storage
.
permanent_save_current_data
()
\ No newline at end of file
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