33 LatticeElementPropertyID ,
44 DevicePropertyID ,
55)
6- from p4p .asLib .yacc import start
76
87from .handlers import handle_device_update , update_manager
98from ..data .constants import config , special_pvs , cavity_names
@@ -113,10 +112,10 @@ def add_pc_pvs(builder, pc_name, prefix):
113112 DevicePropertyID (device_name = pc_name , property = "set_current" )
114113 )
115114 start_val = np .asarray (vals ).mean ()
116- rdbk = builder .aOut (f"{ pc_name } :rdbk" , initial_value = start_val )
115+ rdbk = builder .aOut (f"{ pc_name } :rdbk" , initial_value = start_val , PREC = 2 )
117116
118117 async def handle_pc_update (device_id : str , property_id : str , value : float ):
119- logger .debug ("%s:%s updating setpoint val=%s" , device_id , property_id , value )
118+ logger .warning ("%s:%s updating setpoint val=%s" , device_id , property_id , value )
120119 r = await handle_device_update (
121120 device_id = device_id , property_id = property_id , value = value
122121 )
@@ -128,6 +127,7 @@ async def handle_pc_update(device_id: str, property_id: str, value: float):
128127 f"{ pc_name } :set" ,
129128 initial_value = start_val ,
130129 on_update = lambda val : handle_pc_update (pc_name , "set_current" , val ),
130+ PREC = 2 ,
131131 )
132132
133133
@@ -147,6 +147,12 @@ def initialize_orbit_pvs(builder):
147147 builder .aOut (f"beam:orbit:found" , initial_value = 0 )
148148
149149
150+ def initialize_tune_pvs (builder ):
151+ for axis in ["x" , "y" ]:
152+ builder .aOut (f"TUNECC:{ axis } " , initial_value = 0.0 , PREC = 9 )
153+ builder .longOut (f"TUNECC:count" , initial_value = 0 )
154+
155+
150156def initialize_twiss_pvs (builder ):
151157 """
152158 Initializes PVs for Twiss parameters, which describe beam optics.
0 commit comments