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
deba5562
Commit
deba5562
authored
Apr 22, 2021
by
Valentin Valls
Browse files
Fill metadata per controllers imprementing HasMetadataForScan
parent
e3a0ac68
Changes
2
Hide whitespace changes
Inline
Side-by-side
bliss/common/protocols.py
View file @
deba5562
...
...
@@ -116,3 +116,16 @@ class IcatPublisher(ABC):
Return a dict containing metadata
"""
raise
NotImplementedError
class
HasMetadataForScan
(
ABC
):
"""
Any controller which provides metadata during a scan life cycle.
"""
def
metadata_when_prepared
(
self
)
->
dict
:
"""
Return a dict containing metadata when the device was prepared by the
scan.
"""
raise
NotImplementedError
bliss/scanning/chain.py
View file @
deba5562
...
...
@@ -15,6 +15,7 @@ import collections
import
gevent
from
treelib
import
Tree
from
bliss.common.protocols
import
HasMetadataForScan
from
bliss.common.event
import
dispatcher
from
bliss.common.alias
import
CounterAlias
from
bliss.common.cleanup
import
capture_exceptions
...
...
@@ -463,13 +464,16 @@ class AcquisitionObject:
In this method, acquisition device should collect and meta data
related to this device and prepare it for publishing. it is called
during the scan initialization.
This can be used in two ways:
1) attaching meta data to the scan_meta object and publishing it in scan_info
i.e: scan_meta.instrument.set(self,{"timing mode":"fast"})
2) the return value of this function is used to fill the meta data of the
node attached to this AcqObj
"""
device
=
self
.
device
if
isinstance
(
device
,
HasMetadataForScan
):
return
device
.
metadata_when_prepared
()
return
None
def
fill_meta_at_scan_end
(
self
,
scan_meta
):
...
...
@@ -477,7 +481,7 @@ class AcquisitionObject:
In this method, acquisition device should collect and meta data
related to this device and prepare it for publishing. it is called
at the end of the scan.
This can be used in two ways:
1) attaching meta data to the scan_meta object and publishing it in scan_info
...
...
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