Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Bliss
bliss
Commits
2a498ba0
Commit
2a498ba0
authored
Jul 13, 2021
by
Perceval Guillou
Browse files
IntegAcqSlave finishes reading before stopping device
parent
7bc47bc5
Pipeline
#50571
passed with stages
in 116 minutes and 15 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bliss/scanning/acquisition/counter.py
View file @
2a498ba0
...
...
@@ -514,30 +514,31 @@ class IntegratingCounterAcquisitionSlave(BaseCounterAcquisitionSlave):
self
.
start_device
()
def
stop
(
self
):
# --- call a hook that users can implement in order to stop the associated device
self
.
stop_device
()
self
.
_stop_flag
=
True
def
trigger
(
self
):
pass
def
reading
(
self
):
from_index
=
0
while
(
not
self
.
npoints
or
self
.
_nb_acq_points
<
self
.
npoints
)
and
not
self
.
_stop_flag
:
try
:
from_index
=
0
while
(
not
self
.
npoints
or
self
.
_nb_acq_points
<
self
.
npoints
)
and
not
self
.
_stop_flag
:
counters
=
list
(
self
.
_counters
.
keys
())
data
=
[
counters
[
i
].
conversion_function
(
x
)
for
i
,
x
in
enumerate
(
self
.
device
.
get_values
(
from_index
,
*
counters
))
]
counters
=
list
(
self
.
_counters
.
keys
())
data
=
[
counters
[
i
].
conversion_function
(
x
)
for
i
,
x
in
enumerate
(
self
.
device
.
get_values
(
from_index
,
*
counters
))
]
if
not
all_equal
([
len
(
d
)
for
d
in
data
]):
raise
RuntimeError
(
"Read data can't have different sizes"
)
if
len
(
data
[
0
])
>
0
:
from_index
+=
len
(
data
[
0
])
self
.
_nb_acq_points
+=
len
(
data
[
0
])
self
.
_emit_new_data
(
data
)
gevent
.
sleep
(
0.02
)
if
not
all_equal
([
len
(
d
)
for
d
in
data
]):
raise
RuntimeError
(
"Read data can't have different sizes"
)
if
len
(
data
[
0
])
>
0
:
from_index
+=
len
(
data
[
0
])
self
.
_nb_acq_points
+=
len
(
data
[
0
])
self
.
_emit_new_data
(
data
)
gevent
.
sleep
(
0.02
)
finally
:
# killing the reading task raise an exception in the try above
self
.
stop_device
()
bliss/scanning/acquisition/ct2.py
View file @
2a498ba0
...
...
@@ -230,7 +230,11 @@ class CT2CounterAcquisitionSlave(IntegratingCounterAcquisitionSlave):
event
.
disconnect
(
self
.
device
.
_master_controller
.
server
,
DataSignal
,
self
.
rx_data
)
def
stop
(
self
):
self
.
_stop_flag
=
True
self
.
__buffer_event
.
set
()
self
.
stop_device
()
def
rx_data
(
self
,
data
,
signal
):
self
.
__buffer
.
extend
(
data
)
...
...
bliss/scanning/acquisition/musst.py
View file @
2a498ba0
...
...
@@ -12,7 +12,6 @@ import numpy
from
bliss.scanning.chain
import
AcquisitionMaster
,
AcquisitionSlave
from
bliss.scanning.channel
import
AcquisitionChannel
from
bliss.scanning.acquisition.counter
import
IntegratingCounterAcquisitionSlave
class
MusstDefaultAcquisitionMaster
(
AcquisitionMaster
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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