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
4887c141
Commit
4887c141
authored
May 27, 2020
by
Sebastien Petitdemange
Committed by
Matias Guijarro
Aug 20, 2020
Browse files
axis: Use client redis cache for axis.
+ link settings with configuration
parent
278946fd
Changes
2
Hide whitespace changes
Inline
Side-by-side
bliss/common/axis.py
View file @
4887c141
...
...
@@ -663,7 +663,6 @@ class Axis:
def
__init__
(
self
,
name
,
controller
,
config
):
self
.
__name
=
name
self
.
__controller
=
controller
self
.
__settings
=
AxisSettings
(
self
)
self
.
__move_done
=
gevent
.
event
.
Event
()
self
.
__move_done_callback
=
gevent
.
event
.
Event
()
self
.
__move_done
.
set
()
...
...
@@ -676,6 +675,7 @@ class Axis:
if
self
.
__encoder
is
not
None
:
self
.
__encoder
.
axis
=
self
self
.
__config
=
StaticConfig
(
config
)
self
.
__settings
=
AxisSettings
(
self
)
self
.
__init_config_properties
()
self
.
_group_move
=
GroupMove
()
self
.
_beacon_channels
=
dict
()
...
...
bliss/common/motor_settings.py
View file @
4887c141
...
...
@@ -7,7 +7,7 @@
from
bliss.common
import
event
from
bliss.common.greenlet_utils
import
KillMask
from
bliss.config
import
settings
from
bliss.config
import
settings
,
settings_cache
import
sys
...
...
@@ -85,8 +85,7 @@ class ControllerAxisSettings:
if
self
.
persistent_setting
[
setting_name
]:
with
KillMask
():
hash_setting
=
settings
.
HashSetting
(
"axis.%s"
%
axis
.
name
)
value
=
hash_setting
.
get
(
setting_name
)
value
=
axis
.
settings
.
_hash
.
get
(
setting_name
)
else
:
chan
=
axis
.
_beacon_channels
.
get
(
setting_name
)
if
chan
:
...
...
@@ -100,7 +99,7 @@ class ControllerAxisSettings:
return
value
def
_clear
(
self
,
axis
,
setting_name
):
settings
.
HashSetting
(
"axis.%s"
%
axis
.
name
)
[
setting_name
]
=
None
axis
.
settings
.
_hash
[
setting_name
]
=
None
def
set
(
self
,
axis
,
setting_name
,
value
):
"""
...
...
@@ -118,7 +117,7 @@ class ControllerAxisSettings:
if
self
.
persistent_setting
[
setting_name
]:
with
KillMask
():
settings
.
HashSetting
(
"axis.%s"
%
axis
.
name
)
[
setting_name
]
=
value
axis
.
settings
.
_hash
[
setting_name
]
=
value
axis
.
_beacon_channels
[
setting_name
].
value
=
value
event
.
send
(
axis
,
"internal_"
+
setting_name
,
value
)
...
...
@@ -132,6 +131,14 @@ class AxisSettings:
def
__init__
(
self
,
axis
):
self
.
__axis
=
axis
self
.
__state
=
None
cnx_cache
=
settings_cache
.
get_redis_client_cache
()
self
.
_hash
=
settings
.
HashSetting
(
"axis.%s"
%
axis
.
name
,
default_values
=
axis
.
config
.
config_dict
,
connection
=
cnx_cache
,
)
# Activate prefetch
cnx_cache
.
add_prefetch
(
self
.
_hash
)
def
set
(
self
,
setting_name
,
value
):
if
setting_name
==
"state"
:
...
...
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