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
BCU-Vercors
ID26
id26
Commits
ad101cb1
Commit
ad101cb1
authored
Feb 21, 2022
by
bliss administrator
Browse files
undulators: write move attribute only when target is outside tolerance
parent
0adaae67
Pipeline
#67806
failed
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
id26/controllers/id26undulators.py
View file @
ad101cb1
import
pytest
from
bliss.common.axis
import
NoSettingsAxis
from
bliss.common.logtools
import
log_debug
,
log_warning
from
bliss.controllers.motors.esrf_undulator
import
ESRF_Undulator
from
bliss.controllers.motors
import
esrf_undulator
...
...
@@ -41,4 +43,23 @@ class ID26_Undulator(ESRF_Undulator):
def
__init__
(
self
,
*
args
,
**
kwargs
):
ESRF_Undulator
.
__init__
(
self
,
*
args
,
**
kwargs
)
def
start_one
(
self
,
motion
,
t0
=
None
):
if
motion
.
target_pos
!=
pytest
.
approx
(
motion
.
axis
.
position
,
abs
=
motion
.
axis
.
tolerance
):
self
.
_set_attribute
(
motion
.
axis
,
"attr_pos_name"
,
float
(
motion
.
target_pos
/
motion
.
axis
.
steps_per_unit
),
)
else
:
log_warning
(
self
,
"{0} within tolerance {1}: {2} (requested new pos id: {3})"
.
format
(
motion
.
axis
.
name
,
motion
.
axis
.
tolerance
,
motion
.
axis
.
position
,
motion
.
target_pos
,
)
)
log_debug
(
self
,
f
"end of start
{
motion
.
axis
.
name
}
"
)
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