Skip to content

Implement magnet hardware link #4

@JeanLucPons

Description

@JeanLucPons

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

if hardware is not None:

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions