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
338b0a2a
Commit
338b0a2a
authored
Dec 04, 2020
by
Sebastien Petitdemange
Browse files
axis: check if ready for the movement in controller.
Check if an axis can move or not is now done in the controller.
parent
2a242c9d
Changes
2
Hide whitespace changes
Inline
Side-by-side
bliss/common/axis.py
View file @
338b0a2a
...
...
@@ -1725,16 +1725,8 @@ class Axis:
self
.
__move_done_callback
.
set
()
def
_check_ready
(
self
):
initial_state
=
self
.
state
if
not
initial_state
.
READY
and
not
initial_state
.
MOVING
:
# read state from hardware
initial_state
=
self
.
hw_state
self
.
_update_settings
(
state
=
initial_state
)
if
not
initial_state
.
READY
:
raise
RuntimeError
(
"axis %s state is "
"%r"
%
(
self
.
name
,
str
(
initial_state
))
)
if
not
self
.
controller
.
check_ready_to_move
(
self
,
self
.
state
):
raise
RuntimeError
(
"axis %s state is "
"%r"
%
(
self
.
name
,
str
(
self
.
state
)))
@
lazy_init
def
move
(
self
,
user_target_pos
,
wait
=
True
,
relative
=
False
,
polling_time
=
None
):
...
...
bliss/controllers/motor.py
View file @
338b0a2a
...
...
@@ -361,6 +361,17 @@ class Controller:
def
state
(
self
,
axis
):
raise
NotImplementedError
def
check_ready_to_move
(
self
,
axis
,
state
):
"""
method to check if the axis can move with the current state
"""
if
not
state
.
READY
and
not
state
.
MOVING
:
# read state from hardware
state
=
axis
.
hw_state
axis
.
_update_settings
(
state
=
state
)
return
state
.
READY
def
get_info
(
self
,
axis
):
raise
NotImplementedError
...
...
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