feat: use PV external in tunefbx
Deploy / deploy (push) Successful in 17s

This commit is contained in:
Benjamin Labrecque
2026-07-17 11:03:50 +02:00
parent 8dfa9299ae
commit f0d00393be
@@ -3,7 +3,7 @@ from time import perf_counter
import numpy as np
from epics import dbr
from agebd.pv import get_pv_class
from agebd.pv import get_pv_class, get_pv_external_class
from agebd.service.base import BaseService
from agebd.service.pvs import BasePVs
from agebd.utils import printgetversion
@@ -11,6 +11,7 @@ from agebd.utils import printgetversion
__version__ = printgetversion(__file__)
PV = get_pv_class()
PV_EXTERNAL = get_pv_external_class()
class PVs(BasePVs):
@@ -41,21 +42,21 @@ class PVs(BasePVs):
qx_stepsiz = PV("AGEBD-TUNEBUMP:QX-STEPSIZE.VAL")
## Service specific PVs from other IOCs
inj_active = PV("AGEBD-PARAMS:INJECTION-ACTIVE.VAL")
dump_valve = PV("ARS01-VVPG-0210:PLC_STATUS.VAL")
hor_pinger_trig = PV("AGETI-CVME-MASTER-TMA:Evt-SR-Pinger-H-Ena-Sel.VAL")
ver_pinger_trig = PV("AGETI-CVME-MASTER-TMA:Evt-SR-Pinger-V-Ena-Sel.VAL")
bpm_qx_pilot_int = PV("ARS07-DBPM-0840:PILOT-INT-SWITCH.VAL") # must be: 0 No Pilot
bpm_qx_pilot_ext = PV("ARS07-DBPM-0840:PILOT-EXT-SWITCH.VAL") # must be: 0 No Pilot
bpm_qx_chopper = PV("ARS07-DBPM-0840:CHOPPER-MODE.VAL") # must be: 0 Periodic
cur = PV("ARS07-DPCT-0000:CURR.VAL")
inj_active = PV_EXTERNAL("AGEBD-PARAMS:INJECTION-ACTIVE.VAL")
dump_valve = PV_EXTERNAL("ARS01-VVPG-0210:PLC_STATUS.VAL")
hor_pinger_trig = PV_EXTERNAL("AGETI-CVME-MASTER-TMA:Evt-SR-Pinger-H-Ena-Sel.VAL")
ver_pinger_trig = PV_EXTERNAL("AGETI-CVME-MASTER-TMA:Evt-SR-Pinger-V-Ena-Sel.VAL")
bpm_qx_pilot_int = PV_EXTERNAL("ARS07-DBPM-0840:PILOT-INT-SWITCH.VAL") # must be: 0 No Pilot
bpm_qx_pilot_ext = PV_EXTERNAL("ARS07-DBPM-0840:PILOT-EXT-SWITCH.VAL") # must be: 0 No Pilot
bpm_qx_chopper = PV_EXTERNAL("ARS07-DBPM-0840:CHOPPER-MODE.VAL") # must be: 0 Periodic
cur = PV_EXTERNAL("ARS07-DPCT-0000:CURR.VAL")
def __init__(self, service_name: str, pv_factory=PV):
super().__init__(service_name, pv_factory)
PV = pv_factory
# usually it is advisable to trigger the mainloop of a service on changes of certain PVs:
self.CallbackPV = PV("AGEBD-TUNEBUMP:QX.VAL", auto_monitor=dbr.DBE_VALUE)
self.CallbackPV = PV_EXTERNAL("AGEBD-TUNEBUMP:QX.VAL", auto_monitor=dbr.DBE_VALUE)
class PID: