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
Mauro Rovezzi
bliss
Commits
25ffbdb7
Commit
25ffbdb7
authored
Sep 22, 2017
by
Sebastien Petitdemange
Browse files
measument: added callback methods (prepare,start,stop) in Counter.
parent
2ea1f3aa
Changes
2
Hide whitespace changes
Inline
Side-by-side
bliss/common/measurement.py
View file @
25ffbdb7
...
...
@@ -222,7 +222,7 @@ class GroupedReadMixin(object):
def
start
(
self
,
*
counters
):
pass
def
end
(
self
,
*
counters
):
def
stop
(
self
,
*
counters
):
pass
class
Counter
(
object
):
...
...
@@ -237,6 +237,15 @@ class Counter(object):
@
property
def
name
(
self
):
return
self
.
__name
def
prepare
(
self
):
pass
def
start
(
self
):
pass
def
stop
(
self
):
pass
class
SamplingCounter
(
Counter
):
class
GroupedReadHandler
(
GroupedReadMixin
):
...
...
@@ -263,7 +272,7 @@ class SamplingCounter(Counter):
try
:
return
grouped_read_handler
.
read
(
self
)[
0
]
finally
:
grouped_read_handler
.
end
(
self
)
grouped_read_handler
.
stop
(
self
)
def
DefaultSamplingCounterGroupedReadHandler
(
controller
,
handlers
=
weakref
.
WeakValueDictionary
()):
class
DefaultSamplingCounterGroupedReadHandler
(
SamplingCounter
.
GroupedReadHandler
):
...
...
bliss/scanning/acquisition/counter.py
View file @
25ffbdb7
...
...
@@ -95,15 +95,19 @@ class SamplingCounterAcquisitionDevice(BaseCounterAcquisitionDevice):
self
.
__mode
=
value
def
prepare
(
self
):
self
.
device
.
prepare
(
*
self
.
grouped_read_counters
)
self
.
_nb_acq_points
=
0
self
.
_stop_flag
=
False
self
.
_ready_flag
=
True
self
.
_event
.
clear
()
def
start
(
self
):
pass
self
.
device
.
start
(
*
self
.
grouped_read_counters
)
def
stop
(
self
):
self
.
device
.
stop
(
*
self
.
grouped_read_counters
)
self
.
_stop_flag
=
True
self
.
_trig_time
=
None
self
.
_event
.
set
()
...
...
@@ -173,13 +177,15 @@ class IntegratingCounterAcquisitionDevice(BaseCounterAcquisitionDevice):
BaseCounterAcquisitionDevice
.
__init__
(
self
,
counter
,
count_time
,
auto_add_channel
,
**
keys
)
def
prepare
(
self
):
self
.
device
.
prepare
(
*
self
.
grouped_read_counters
)
self
.
_nb_acq_points
=
0
self
.
_stop_flag
=
False
def
start
(
self
):
pass
self
.
device
.
start
(
*
self
.
grouped_read_counters
)
def
stop
(
self
):
self
.
device
.
stop
(
*
self
.
grouped_read_counters
)
self
.
_stop_flag
=
True
def
trigger
(
self
):
...
...
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