def __init__(self, prefix: str): if not prefix: raise ValueError(f"parameter prefix cannot be empty {prefix}") self.prefix = prefix self.on_off_pv = create_connected_pv(pvname=f"{self.prefix}:ACP:OnOff") self.speed_rpm = create_connected_pv( pvname=f"{self.prefix}:ACP:SpeedRPM")
def __init__(self, prefix: str): if not prefix: raise ValueError(f"parameter prefix cannot be empty {prefix}") self.prefix = prefix self.off_frequency_pv = create_connected_pv( pvname=f"{self.prefix}:SYSTEM:OffFrequency") self.off_pressure_base_pv = create_connected_pv( pvname=f"{self.prefix}:SYSTEM:OffPressureBase") self.off_pressure_exp_pv = create_connected_pv( pvname=f"{self.prefix}:SYSTEM:OffPressureExp") self.on_pressure_base_pv = create_connected_pv( pvname=f"{self.prefix}:SYSTEM:OnPressureBase") self.on_pressure_exp_pv = create_connected_pv( pvname=f"{self.prefix}:SYSTEM:OnPressureExp")
def set_venting_valve_state(prefix: str, state: bool): """Set venting valve state :param state: On=True, Off=False""" _logger.info(f"set turbo venting valve state {state}") turbovac_venting_valve_pv = create_connected_pv( pvname=f"{prefix}:TURBOVAC:VentingValve-SW") turbovac_venting_valve_pv.value = 1 if state else 0
def check_pressure(prefix: str, first_time: bool): """ this script runs after the user hits the "ON" button under the "system_tab.ui" window. It checks whether the pressure is lower or higher than 0.05 Torr. - if it's value is higher than 0.05, then the "process_on" script is executed - if it's value is lower, then the "system_pressurized" window will pop-up """ _logger.info(f"check_pressure {prefix} first_time={first_time}") pressure_pv = create_connected_pv(pvname=f"{prefix}:BBB:Torr") torr_base_pv = create_connected_pv(pvname=f"{prefix}:BBB:TorrBase") torr_exp_pv = create_connected_pv(pvname=f"{prefix}:BBB:TorrExp") torr_base_msg_pv = create_connected_pv(pvname=f"{prefix}:BBB:TorrBaseMsg") torr_exp_msg_pv = create_connected_pv(pvname=f"{prefix}:BBB:TorrExpMsg") process_trigger_on_pv = create_connected_pv( pvname=f"{prefix}:Process:TriggerOn") process_trigger_pressurized_pv = create_connected_pv( pvname=f"{prefix}:Process:TriggerPressurized") torr_base_msg_pv.value = torr_base_pv.value torr_exp_msg_pv.value = torr_exp_pv.value # update value showed in "system_pressurized.ui" window # if pressure value is bigger than 0.05 Torr, trigger "process_on" script if pressure_pv.value > 0.05: if not first_time: process_trigger_on_pv.value = 1 process_trigger_on_pv.value = 0 # if pressure is between 0.05 and 1*10**-8, trigger "process_recovery" script elif (pressure_pv.value < 0.05) & (pressure_pv.value > 10**-8): process_trigger_pressurized_pv.value = 1 process_trigger_pressurized_pv.value = 0
def _relay(prefix: str, valve: int, confirmed: bool): """ this is script is used to commute a valve value """ _logger.info("relay prefix={prefix} valve={valve} confirmed={confirmed}") sw_pv = create_connected_pv(pvname=f"{prefix}:BBB:Relay{valve}-SW") ui_pv = create_connected_pv(pvname=f"{prefix}:BBB:Relay{valve}-UI.RVAL") time.sleep(1) # why?! _logger.info( f"pv sw update prefix={prefix} valve={valve} confirmed={confirmed}") # if relay swtiching message is confirmed, change PV SW values: if confirmed: sw_pv.value = not (sw_pv.value) # if relay swtiching message is canceled, do nothing: else: ui_pv.value = sw_pv.value
def _commute_venting_valve(prefix: str, confirmed: bool): """ this is script is used to commute a valve value """ _logger.info(f"{prefix} confirmed={confirmed}") turbovac_venting_valve_pv = create_connected_pv( pvname=f"{prefix}:TURBOVAC:VentingValve-SW") turbovac_venting_valve_ui_pv = create_connected_pv( pvname=f"{prefix}:TURBOVAC:VentingValve-UI.RVAL") time.sleep(1) # why?! _logger.info(f"pv sw update {prefix} confirmed={confirmed}") # if relay swtiching message is confirmed, change PV SW values: if confirmed: turbovac_venting_valve_pv.value = not (turbovac_venting_valve_pv.value) # if relay swtiching message is canceled, do nothing: else: turbovac_venting_valve_ui_pv.value = turbovac_venting_valve_pv.value
def __init__(self, prefix: str): if not prefix: raise ValueError(f"parameter prefix cannot be empty {prefix}") self.prefix = prefix self.off_fv_status1_pv = create_connected_pv( pvname=f"{prefix}:ProcessOffFV:Status1") self.off_fv_status2_pv = create_connected_pv( pvname=f"{prefix}:ProcessOffFV:Status2") self.off_fv_status3_pv = create_connected_pv( pvname=f"{prefix}:ProcessOffFV:Status3") self.off_fv_status4_pv = create_connected_pv( pvname=f"{prefix}:ProcessOffFV:Status4") self.off_fv_status5_pv = create_connected_pv( pvname=f"{prefix}:ProcessOffFV:Status5") self.off_fv_status6_pv = create_connected_pv( pvname=f"{prefix}:ProcessOffFV:Status6") self.bool = create_connected_pv( pvname=f"{self.prefix}:ProcessOff:Bool")
def __init__(self, prefix: str): if not prefix: raise ValueError(f"parameter prefix cannot be empty {prefix}") self.prefix = prefix # Create process recovery status PVs self.status1_pv = create_connected_pv( pvname=f"{self.prefix}:ProcessRecovery:Status1") self.status2_pv = create_connected_pv( pvname=f"{self.prefix}:ProcessRecovery:Status2") self.status3_pv = create_connected_pv( pvname=f"{self.prefix}:ProcessRecovery:Status3") self.status4_pv = create_connected_pv( pvname=f"{self.prefix}:ProcessRecovery:Status4") self.status5_pv = create_connected_pv( pvname=f"{self.prefix}:ProcessRecovery:Status5") self.bool = create_connected_pv( pvname=f"{self.prefix}:ProcessRec:Bool")
def __init__(self, prefix: str): if not prefix: raise ValueError(f"parameter prefix cannot be empty {prefix}") self.prefix = prefix self.pressure_pv = create_connected_pv( pvname=f"{self.prefix}:BBB:Torr") self.pre_vacuum_valve_sw_pv = create_connected_pv( pvname=f"{self.prefix}:BBB:Relay1-SW") self.gate_valve_sw_pv = create_connected_pv( pvname=f"{self.prefix}:BBB:Relay2-SW") self.gate_valve_ui_pv = create_connected_pv( pvname=f"{self.prefix}:BBB:Relay2-UI") self.valve_open_pv = create_connected_pv( pvname=f"{self.prefix}:BBB:ValveOpen") self.valve_closed_pv = create_connected_pv( pvname=f"{self.prefix}:BBB:ValveClosed")
def __init__(self, prefix: str): if not prefix: raise ValueError(f"parameter prefix cannot be empty {prefix}") self.prefix = prefix self.pzd1_sp_tevl_pv = create_connected_pv( pvname=f"{self.prefix}:TURBOVAC:PZD1-SP.TEVL") self.pzd1_sp_zrvl_pv = create_connected_pv( pvname=f"{self.prefix}:TURBOVAC:PZD1-SP.ZRVL") self.pzd1_sp_sxvl_pv = create_connected_pv( pvname=f"{self.prefix}:TURBOVAC:PZD1-SP.SXVL") self.pzd2_rb_pv = create_connected_pv( pvname=f"{self.prefix}:TURBOVAC:PZD2-RB") self.pzd2_sp_pv = create_connected_pv( pvname=f"{self.prefix}:TURBOVAC:PZD2-SP") self.ak_sp_pv = create_connected_pv( pvname=f"{self.prefix}:TURBOVAC:AK-SP") self.ind_sp_pv = create_connected_pv( pvname=f"{self.prefix}:TURBOVAC:IND-SP") self.pnu_sp_pv = create_connected_pv( pvname=f"{self.prefix}:TURBOVAC:PNU-SP") self.pwe_sp_pv = create_connected_pv( pvname=f"{self.prefix}:TURBOVAC:PWE-SP") self.pre_vacuum_valve_sw_pv = create_connected_pv( pvname=f"{self.prefix}:BBB:Relay1-SW") self.venting_valve_sw_pv = create_connected_pv( pvname=f"{self.prefix}:TURBOVAC:VentingValve-SW") self.venting_valve_ui_pv_rval = create_connected_pv( pvname=f"{self.prefix}:TURBOVAC:VentingValve-UI.RVAL")