Multiple Positions object
To create a multi-purpose multiple discrete positions object.
features
- Motor(s)
- ref to 1..N motors
- Label (mandatory):
- Short identifier (name/mnemonic)
- Usable as a name to call to move to corresponding position:
att1.Al2O3.move()
- Description:
- Longer string
- To be printable in a GUI for example
- Positions in user unit
- Delta (0 by default)
- tolerance window in user units to be in a specific position
- required by users to know where is the motor even in case of approximation
- "expert mode" to forbid end-users to change positions.
Needs:
-
simple way to change label/description/position
-
way to have hooked functions
- Ex: You must close the shutter before moving the attenuators
- How ?
- "check before move" callback functions ??? ( similar to Axis motion hook)
- external feature ???
-
Calibration ? scanable ?
-
attGUI
- to call the GUI from command line or
- recall if already open
- CLI-not-blocking
-
GB for 21 23 24: dynamic creation of a new MP object
- register user-defined positions of 1..N motors to be able to come back to registered positions.
- examples:
- sample IN / OUT
- list of targets on VLM (ex id21)
Configuration examples
Single motor configuration example
class: MultiplePositions
plugin: bliss
name: att1
positions:
- label: Al3
description: Aluminum filter 3 mmm
axes:
- axis: $filt1
target: 2.5
delta: 0.01
[...]
- label: Al8
description: Aluminum filter 8 mmm
axes:
- axis: $filt1
target: 7.5
delta: 0.01
multi motors configuration example:
class: MultiplePositions
plugin: bliss
name: beamstop
positions:
- label: IN
description: Beamstop position IN beam
axes:
- axis: $roby
target: 2.5
delta: 0.01
- axis: $robz
target: 1.0
delta: 0.2
- label: OUT
description: Beamstop position OFF beam
axes:
- axis: $roby
target: 7.5
delta: 0.01
- axis: $robz
target: 4.0
delta: 0.2
- label: PARK
description: Beamstop parking position
axes:
- axis: $roby
target: 25.0
delta: 0.01
- axis: $robz
target: 10.0
delta: 0.2
Usage examples
#
att1.move("Al3", wait=False) # wait is True by default
att1.wait()
# if Axis compatible:
umv(att1, "Al3", att2, "Cu5", att3, "Zn4") # no more need to add "wait=False"
example for CLI:
att1.Al3.move() # <--- moves attenuator to position Al3
att1.Al8.move()
att1 # display infos
Management of targets:
# to CREATE new "position" or to CHANGE an existing one:
att1.set_position(<label>, <motorS>, <positionS>, <description>, <deltaS>)
att1.set_position("Al10", (filt1), (15.6), "Aluminum 10mm", (0.01))
# the method saves the "position" in the yml file!!!
# cassepied si juste un moteur a changer ?
# cassepied si juste un delta a changer ?
# to REMOVE a "position":
att1.remove_position(<label>)
att1.remove_position("Al10")
# "position" rempoved from the yml file as well!!!
# access to the underlying motor:
att1.filt1.velocity
movement examples
att1
LABEL DESCRIPTION MOTOR POSITION(S)
-> "Al3" "Aluminum filter 3 mm" filt1: 2.5 (± 0.01)
"Al8" "Aluminum filter 8 mm" filt1: 7.5 (± 0.01)
"Al10" "Aluminum filter 10 mm" filt1: 15.6 (± 0.01)
att1.Al8.move()
att1
LABEL DESCRIPTION MOTOR POSITION(S)
"Al3" "Aluminum filter 3 mm" filt1: 2.5 (± 0.01)
-> "Al8" "Aluminum filter 8 mm" filt1: 7.5 (± 0.01)
"Al10" "Aluminum filter 10 mm" filt1: 15.6 (± 0.01)
if outside of a known position (or moving ??)
att1
LABEL AXES DESCRIPTION
"Al3" filt1: 2.5 (± 0.01) "Aluminum filter 3 mm"
"Al8" filt1: 7.5 (± 0.01) "Aluminum filter 8 mm"
"Al10" filt1: 15.6 (± 0.01) "Aluminum filter 10 mm"
-> UNKNOWN
beamstop example:
LABEL DESCRIPTION AXES
-> "IN" "Beamstop position IN beam" roby: 2.5 (± 0.01)
robz: 1.0 (± 0.2)
"OUT" "Beamstop position OFF beam" roby: 7.5 (± 0.01)
robz: 4.0 (± 0.2)
"PARK" "Beamstop parking position" roby: 25.0 (± 0.01)
robz: 10.0 (± 0.2)
roby = 2.5043
robz = 1.0032
change:
beamstop.set(IN, roby, target, 2.5)
beamstop.set(IN, roby, delta, 0.03)
beamstop.IN.roby.delta = 0.03
beamstop.IN.roby.delta
0.03
beamstop.save()
or:
beamstop["IN"]["roby"]["delta"] = 0.03
beamstop.save()
GB wishes:
# vendredi_list_of_Point_Of_Interest
vlPOI = MP()
vlPOI.add_target("Cu4B14", [sampy, sampz]) # creates "Cu4B14" target with motors sampy, sampz
# and registers their current positions
vlPOI.add_target("FeKa", [(sampy, 33.2), (sampz, 35.14)]) # idem with given positions
vlPOI.Cu4B14.register() # registers current positions of defined motors
vlPOI.Cu4B14.register( [(sampy, 13.2), (sampz, 3.14)] ) # registers given positions
vlPOI.save() # saving is not allowed... because not added in the setup of the session.
# instead: prints corresponding yml file. to be copy/past by hand by user
vlPOI # display info
Edited by Cyril Guilloud