Implement an identity MagnetModel that directly maps to strength (or current) of a control system.
TODO:
- Adapt __hardware and __strength of pyaml/magnet/magnet.py according to the configuration below.
- Remove hardware attribute from above magnet pydantic model.
- Write pyaml/magnet/identity_model.py
Mapping current:
- type: pyaml.magnet.quadrupole
name: QF1A-C05
model:
type: pyaml.magnet.identity_model
unit: A
powerconverter:
type: tango.pyaml.attribute
attribute: srmag/vps-qf1/c05-a/current
unit: A
m = sr.live.get_magnet(MagnetType.QUADRUPOLE," QF1A-C05")
m.hardware.set(0.1) # Write directly 0.1 on srmag/vps-qf1/c05-a/current
m.strength.set(0.1) # Fails
m = sr.design.get_magnet(MagnetType.QUADRUPOLE," QF1A-C05")
m.hardware.set(0.1) # Fails
m.strength.set(0.1) # Fails
Mapping strength:
- type: pyaml.magnet.quadrupole
name: QF1A-C05
model:
type: pyaml.magnet.identity_model
unit: 1/m
magnet:
type: tango.pyaml.attribute
attribute: srmag/m-qf1/c05-a/strength
unit: 1/m
m = sr.live.get_magnet(MagnetType.QUADRUPOLE," QF1A-C05")
m.hardware.set(0.1) # Fails
m.strength.set(0.1) # Write directly 0.1 on srmag/m-qf1/c05-a/strength
m = sr.design.get_magnet(MagnetType.QUADRUPOLE," QF1A-C05")
m.hardware.set(0.1) # Fails
m.strength.set(0.1) # Write 0.1 on AT element QF1A-C05
Implement an identity
MagnetModelthat directly maps to strength (or current) of a control system.TODO:
pyaml/pyaml/magnet/magnet.py
Line 37 in 0e306fb
Mapping current:
Mapping strength: