Skip to content
GitLab
Menu
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):
...
@@ -514,30 +514,31 @@ class IntegratingCounterAcquisitionSlave(BaseCounterAcquisitionSlave):
self
.
start_device
()
self
.
start_device
()
def
stop
(
self
):
def
stop
(
self
):
# --- call a hook that users can implement in order to stop the associated device
self
.
stop_device
()
self
.
_stop_flag
=
True
self
.
_stop_flag
=
True
def
trigger
(
self
):
def
trigger
(
self
):
pass
pass
def
reading
(
self
):
def
reading
(
self
):
from_index
=
0
try
:
while
(
from_index
=
0
not
self
.
npoints
or
self
.
_nb_acq_points
<
self
.
npoints
while
(
)
and
not
self
.
_stop_flag
:
not
self
.
npoints
or
self
.
_nb_acq_points
<
self
.
npoints
)
and
not
self
.
_stop_flag
:
counters
=
list
(
self
.
_counters
.
keys
())
counters
=
list
(
self
.
_counters
.
keys
())
data
=
[
data
=
[
counters
[
i
].
conversion_function
(
x
)
counters
[
i
].
conversion_function
(
x
)
for
i
,
x
in
enumerate
(
self
.
device
.
get_values
(
from_index
,
*
counters
))
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
]):
finally
:
# killing the reading task raise an exception in the try above
raise
RuntimeError
(
"Read data can't have different sizes"
)
self
.
stop_device
()
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
)
bliss/scanning/acquisition/ct2.py
View file @
2a498ba0
...
@@ -230,7 +230,11 @@ class CT2CounterAcquisitionSlave(IntegratingCounterAcquisitionSlave):
...
@@ -230,7 +230,11 @@ class CT2CounterAcquisitionSlave(IntegratingCounterAcquisitionSlave):
event
.
disconnect
(
event
.
disconnect
(
self
.
device
.
_master_controller
.
server
,
DataSignal
,
self
.
rx_data
self
.
device
.
_master_controller
.
server
,
DataSignal
,
self
.
rx_data
)
)
def
stop
(
self
):
self
.
_stop_flag
=
True
self
.
__buffer_event
.
set
()
self
.
__buffer_event
.
set
()
self
.
stop_device
()
def
rx_data
(
self
,
data
,
signal
):
def
rx_data
(
self
,
data
,
signal
):
self
.
__buffer
.
extend
(
data
)
self
.
__buffer
.
extend
(
data
)
...
...
bliss/scanning/acquisition/musst.py
View file @
2a498ba0
...
@@ -12,7 +12,6 @@ import numpy
...
@@ -12,7 +12,6 @@ import numpy
from
bliss.scanning.chain
import
AcquisitionMaster
,
AcquisitionSlave
from
bliss.scanning.chain
import
AcquisitionMaster
,
AcquisitionSlave
from
bliss.scanning.channel
import
AcquisitionChannel
from
bliss.scanning.channel
import
AcquisitionChannel
from
bliss.scanning.acquisition.counter
import
IntegratingCounterAcquisitionSlave
class
MusstDefaultAcquisitionMaster
(
AcquisitionMaster
):
class
MusstDefaultAcquisitionMaster
(
AcquisitionMaster
):
...
...
Write
Preview
Supports
Markdown
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