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
81a7c694
Commit
81a7c694
authored
May 23, 2021
by
Matias Guijarro
Committed by
Wout De Nolf
May 27, 2021
Browse files
metadata: fix global map registration on some controllers
parent
47b6ccd5
Changes
5
Hide whitespace changes
Inline
Side-by-side
bliss/controllers/lima/image.py
View file @
81a7c694
...
...
@@ -9,6 +9,7 @@ from typing import Iterable
import
typeguard
import
numpy
from
bliss
import
global_map
from
bliss.common.counter
import
Counter
from
bliss.config.beacon_object
import
BeaconObject
from
bliss.common.logtools
import
log_debug
...
...
@@ -159,8 +160,12 @@ def _to_list(setting, value):
class
LimaImageParameters
(
BeaconObject
):
def
__init__
(
self
,
config
,
name
):
def
__init__
(
self
,
controller
,
name
):
config
=
controller
.
_config_node
super
().
__init__
(
config
,
name
=
name
,
share_hardware
=
False
,
path
=
[
"image"
])
# properly put in map, to have "parameters" under the corresponding Lima controller node
# (and not in "controllers")
global_map
.
register
(
self
,
parents_list
=
[
controller
],
tag
=
"image_parameters"
)
binning
=
BeaconObject
.
property_setting
(
"binning"
,
default
=
[
1
,
1
],
set_marshalling
=
_to_list
,
set_unmarshalling
=
_to_list
...
...
@@ -231,7 +236,7 @@ class ImageCounter(Counter):
super
().
__init__
(
"image"
,
controller
)
self
.
_image_params
=
LimaImageParameters
(
controller
.
_config_node
,
f
"
{
controller
.
_name_prefix
}
:image"
controller
,
f
"
{
controller
.
_name_prefix
}
:image"
)
def
__info__
(
self
):
...
...
bliss/controllers/lima/lima_base.py
View file @
81a7c694
...
...
@@ -584,6 +584,9 @@ class Lima(CounterController, HasMetadataForScan):
def
image
(
self
):
if
self
.
_image
is
None
:
self
.
_image
=
ImageCounter
(
self
)
global_map
.
register
(
self
.
_image
,
parents_list
=
[
self
],
children_list
=
[
self
.
_proxy
]
)
return
self
.
_image
@
autocomplete_property
...
...
bliss/controllers/mca/base.py
View file @
81a7c694
...
...
@@ -19,6 +19,7 @@ import tabulate
import
gevent
from
bliss
import
global_map
from
bliss.controllers.mca.roi
import
RoiConfig
from
bliss.common.logtools
import
log_debug
from
bliss.common.protocols
import
HasMetadataForScan
...
...
@@ -103,6 +104,8 @@ class BaseMCA(CounterController, HasMetadataForScan):
# Life cycle
def
__init__
(
self
,
name
,
config
,
beacon_obj_class
=
MCABeaconObject
):
global_map
.
register
(
self
)
# register as controller
CounterController
.
__init__
(
self
,
name
)
self
.
beacon_obj
=
beacon_obj_class
(
self
,
config
)
...
...
bliss/controllers/motors/esrf_hexapode.py
View file @
81a7c694
...
...
@@ -80,8 +80,6 @@ class esrf_hexapode(Controller, HasMetadataForScan):
def
__init__
(
self
,
*
args
,
**
kwargs
):
Controller
.
__init__
(
self
,
*
args
,
**
kwargs
)
global_map
.
register
(
self
)
self
.
device
=
None
self
.
roles
=
{}
self
.
last_read
=
None
...
...
bliss/controllers/transfocator.py
View file @
81a7c694
...
...
@@ -188,6 +188,8 @@ class Transfocator(HasMetadataForScan):
)
if
self
.
wago
:
global_map
.
register
(
self
,
children_list
=
[
self
.
wago
])
else
:
global_map
.
register
(
self
)
if
"lenses"
in
config
:
self
.
nb_lens
=
int
(
config
[
"lenses"
])
...
...
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