def add_line(table, line_opi, power_supply): linkingContainer = WidgetUtil.createWidgetModel("org.csstudio.opibuilder.widgets.linkingContainer") linkingContainer.setPropertyValue("opi_file", line_opi) linkingContainer.setPropertyValue("resize_behaviour", 1) linkingContainer.setPropertyValue("border_style", 0) table.addChildToBottom(linkingContainer) children = linkingContainer.getChildren() for w in children: if w.getPropertyValue("widget_type") == "Action Button": button = w elif w.getPropertyValue("widget_type") == "Spinner": spinner = w elif w.getPropertyValue("widget_type") == "Text Update": text_update = w elif w.getPropertyValue("widget_type") == "Grouping Container": container = w led = container.getChildren()[0] setpoint = subsystem + power_supply.upper() + '-SP' readback = subsystem + power_supply.upper() + '-RB' button.setPropertyValue("text", power_supply.replace("-FAM", "")) spinner.setPropertyValue("pv_name", setpoint) text_update.setPropertyValue("pv_name", readback) led.setPropertyValue("pv_name", '$(power_supply_status)') macro_inputs = DataUtil.createMacrosInput(True) macro_inputs.put("power_supply", power_supply) macro_inputs.put("power_supply_sp", setpoint) macro_inputs.put("power_supply_rb", readback) macro_inputs.put("power_supply_start", 'sim://const("sextupole")') linkingContainer.setPropertyValue("macros", macro_inputs)
def _add_line(table, line_opi, device): linkingContainer = WidgetUtil.createWidgetModel("org.csstudio.opibuilder.widgets.linkingContainer") linkingContainer.setPropertyValue("opi_file", line_opi) linkingContainer.setPropertyValue("resize_behaviour", 1) linkingContainer.setPropertyValue("border_style", 0) table.addChildToBottom(linkingContainer) children = linkingContainer.getChildren() for w in children: if w.getPropertyValue("widget_type") == "Grouping Container": container = w button = container.getChildren()[0] led = container.getChildren()[1] setpoint = prefix + device.upper() + sufix readback = prefix + device.upper() + '-RB' button.setPropertyValue("pv_name", setpoint) led.setPropertyValue("pv_name", readback) macro_inputs = DataUtil.createMacrosInput(True) macro_inputs.put("device", device) macro_inputs.put("power_supply_sp", setpoint) macro_inputs.put("power_supply_rb", readback) linkingContainer.setPropertyValue("macros", macro_inputs)
def selectionChanged(self, selection): cuIndex="" phyName="" for row in selection: cuIndex=row[0]; phyName=row[1] # change $(CU_INDEX) substitution macroInput = DataUtil.createMacrosInput(True) macroInput.put("CUB", cuIndex) macroInput.put("PHY_NAME", phyName) macroInput.put("FCT_NAME", fct_name) # open OPI # see https://svnpub.iter.org/codac/iter/codac/dev/units/m-css-boy/trunk/org.csstudio.opibuilder/src/org/csstudio/opibuilder/scriptUtil/ScriptUtil.java ScriptUtil.openOPI(display.getWidget("Table"), fct_name+"-CubicleDetails.opi", 1, macroInput)
def selectionChanged(self, selection): cuIndex = "" phyName = "" for row in selection: cuIndex = row[0] phyName = row[1] # change $(CU_INDEX) substitution macroInput = DataUtil.createMacrosInput(True) macroInput.put("CUB", cuIndex) macroInput.put("PHY_NAME", phyName) macroInput.put("FCT_NAME", fct_name) # open OPI # see https://svnpub.iter.org/codac/iter/codac/dev/units/m-css-boy/trunk/org.csstudio.opibuilder/src/org/csstudio/opibuilder/scriptUtil/ScriptUtil.java ScriptUtil.openOPI(display.getWidget("Table"), fct_name + "-CubicleDetails.opi", 1, macroInput)
def selectionChanged(self, selection): cuName = "" phyName = "" for row in selection: phyName = row[1] cuName = row[0] # change $(CU) substitution macroInput = DataUtil.createMacrosInput(True) macroInput.put("CU", cuName) macroInput.put("PHY_NAME", phyName) macroInput.put("FCT_NAME", fct_name) # open OPI # see https://svnpub.iter.org/codac/iter/codac/dev/units/m-css-boy/trunk/org.csstudio.opibuilder/src/org/csstudio/opibuilder/scriptUtil/ScriptUtil.java if cuName.startswith("P"): ScriptUtil.openOPI(display.getWidget("Table"), fct_name + "-PLCDetails.opi", 1, macroInput) else: ScriptUtil.openOPI(display.getWidget("Table"), fct_name + "-CubiclePLCDetails.opi", 0, macroInput)
def selectionChanged(self, selection): cuName="" phyName="" plcIocHlts ="" for row in selection: phyName=row[1] cuName=row[0] plcIocHlts=row[6]; # change $(CU) substitution macroInput = DataUtil.createMacrosInput(True) macroInput.put("CU", cuName) macroInput.put("PHY_NAME", phyName) macroInput.put("FCT_NAME", fct_name) if plcIocHlts == "": macroInput.put("SHOW_PLC_IOC", "false") else: macroInput.put("SHOW_PLC_IOC", "true") # open OPI # see https://svnpub.iter.org/codac/iter/codac/dev/units/m-css-boy/trunk/org.csstudio.opibuilder/src/org/csstudio/opibuilder/scriptUtil/ScriptUtil.java ScriptUtil.openOPI(display.getWidget("Table"), fct_name+"-CtrlUnitDetails.opi", 1, macroInput)
def selectionChanged(self, selection): cuName = "" phyName = "" for row in selection: phyName = row[1] cuName = row[0] # change $(CU) substitution macroInput = DataUtil.createMacrosInput(True) macroInput.put("CU", cuName) macroInput.put("PHY_NAME", phyName) macroInput.put("FCT_NAME", fct_name) # open OPI # see https://svnpub.iter.org/codac/iter/codac/dev/units/m-css-boy/trunk/org.csstudio.opibuilder/src/org/csstudio/opibuilder/scriptUtil/ScriptUtil.java if cuName.startswith('P'): ScriptUtil.openOPI(display.getWidget("Table"), fct_name + "-PLCDetails.opi", 1, macroInput) else: ScriptUtil.openOPI(display.getWidget("Table"), fct_name + "-CubiclePLCDetails.opi", 0, macroInput)
def selectionChanged(self, selection): cuName = "" phyName = "" plcIocHlts = "" for row in selection: phyName = row[1] cuName = row[0] plcIocHlts = row[6] # change $(CU) substitution macroInput = DataUtil.createMacrosInput(True) macroInput.put("CU", cuName) macroInput.put("PHY_NAME", phyName) macroInput.put("FCT_NAME", fct_name) if plcIocHlts == "": macroInput.put("SHOW_PLC_IOC", "false") else: macroInput.put("SHOW_PLC_IOC", "true") # open OPI # see https://svnpub.iter.org/codac/iter/codac/dev/units/m-css-boy/trunk/org.csstudio.opibuilder/src/org/csstudio/opibuilder/scriptUtil/ScriptUtil.java ScriptUtil.openOPI(display.getWidget("Table"), fct_name + "-CtrlUnitDetails.opi", 1, macroInput)
from org.csstudio.opibuilder.scriptUtil import PVUtil from org.csstudio.opibuilder.scriptUtil import DataUtil macroInput = DataUtil.createMacrosInput(True) pvvalue = display.getWidget("eemem_read_value_combo").getValue() macroInput.put("EEMEM_VALUE", "%s" % pvvalue) widgetController.setPropertyValue("macros", macroInput) widgetController.setPropertyValue( "opi_file", widgetController.getPropertyValue("opi_file"), True)
from org.csstudio.opibuilder.scriptUtil import PVUtil from org.csstudio.opibuilder.scriptUtil import DataUtil macroInput = DataUtil.createMacrosInput(True) boxpv = widget.getPVByName("loc://monitor_box") boxnumber = PVUtil.getLong(boxpv) macroInput.put("BOXNO", "%s" % boxnumber) macroInput.put("BOX", "BOX:%s" % boxnumber) macroInput.put("P", "CB:CB:HV") widgetController.setPropertyValue("macros", macroInput) widgetController.setPropertyValue("opi_file", widgetController.getPropertyValue("opi_file"), True)
# FOFB fofb_corr_h_locpv = "loc://fofb_corr_h(0)" fofb_corr_v_locpv = "loc://fofb_corr_v(0)" fofb_corr_coupling_locpv = "loc://fofb_coupling(0)" # Features feature_type_locpv = "loc://feature_type(0)" ## Control Panel # Get Widgets control_panel = display.getWidget("Control Panel") # Set Macros control_panel_macros = DataUtil.createMacrosInput(True) control_panel_macros.put("ref_orbit_x_ioc", ref_orbit_x_pv) control_panel_macros.put("orbit_x_ioc", orbit_x_pv) control_panel_macros.put("ref_orbit_x_ioc_sel", ref_orbit_x_sel_pv) control_panel_macros.put("ref_orbit_y_ioc", ref_orbit_y_pv) control_panel_macros.put("orbit_y_ioc", orbit_y_pv) control_panel_macros.put("ref_orbit_y_ioc_sel", ref_orbit_y_sel_pv) control_panel_macros.put("ref_orbit_x_graph", ref_orbit_x_locpv) control_panel_macros.put("orbit_x_graph", orbit_x_locpv) control_panel_macros.put("delta_orbit_x", delta_orbit_x_locpv) control_panel_macros.put("ref_orbit_y_graph", ref_orbit_y_locpv) control_panel_macros.put("orbit_y_graph", orbit_y_locpv) control_panel_macros.put("delta_orbit_y", delta_orbit_y_locpv) control_panel_macros.put("bpm_pos", bpm_pos_pv) control_panel_macros.put("register", register_locpv) control_panel_macros.put("display_mode", display_mode_locpv)