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
68a9d71e
Commit
68a9d71e
authored
Jun 21, 2021
by
Benoit Formet
Browse files
NewportXPS: allow starting several motors of the same group at once
parent
41b43b9b
Pipeline
#49165
passed with stages
in 107 minutes and 53 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bliss/controllers/motors/newport/newportxps.py
View file @
68a9d71e
...
...
@@ -101,6 +101,11 @@ class NewportXPS(Controller):
def
finalize_axis
(
self
):
log_debug
(
self
,
"finalize_axis() called"
)
def
_get_axis_from_group
(
self
,
group
,
channel
):
for
axis
in
self
.
axes
.
values
():
if
axis
.
group
==
group
and
axis
.
channel
==
str
(
channel
):
return
axis
def
initialize_encoder
(
self
,
encoder
):
log_debug
(
self
,
"initialize_encoder() called"
)
...
...
@@ -183,12 +188,20 @@ class NewportXPS(Controller):
if
len
(
motion_list
)
==
1
:
self
.
start_one
(
motion_list
[
0
])
else
:
target_positions
=
[
0
,
0
]
group
=
motion_list
[
0
].
axis
.
group
target_positions
=
[
None
]
*
self
.
__nbAxesPerGroup
[
group
]
for
motion
in
motion_list
:
# if motors are not from the same group, fallback to start_one
if
motion
.
axis
.
group
!=
group
:
raise
NotImplementedError
target_positions
[
int
(
motion
.
axis
.
channel
)
-
1
]
=
motion
.
target_pos
error
,
reply
=
self
.
__xps
.
GroupMoveAbsolute
(
motion
.
axis
.
group
,
target_positions
)
for
i
,
target
in
enumerate
(
target_positions
):
# fill missing target positions in the group with current positions
if
target
is
None
:
target_positions
[
i
]
=
self
.
_get_axis_from_group
(
group
,
i
+
1
).
position
error
,
reply
=
self
.
__xps
.
GroupMoveAbsolute
(
group
,
target_positions
)
if
error
!=
0
:
log_error
(
self
,
"NewportXPS Error: "
+
reply
)
...
...
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