[2,3,3,3,3,3,3,3], [2,3,3,3,3,3,3,2], [3,3,3,3,3,3,3], [2,3,3,3,3,3,3], [2,3,3,3,3,3,2], [3,3,3,3,3,3], [2,3,3,3,3,3], [2,3,3,3,3,2], [3,3,3,3,3], [2,3,3,3,3], [2,3,3,3,2], [3,3,3,3], [2,3,3,3], [2,3,3,2], [3,3,3], [3,2,3], [2,3,2], [3,3]]; panelnum=1 rowcount=1 for i in ARRAY: for j in i: pv = PREFIX+"_ROW"+str(rowcount)+"_PANEL"+str(panelnum)+":pwonoff" PVUtil.writePV(pv,1) panelnum+=1 rowcount+=1 panelnum=1
from org.csstudio.opibuilder.scriptUtil import PVUtil import time sys = widget.getMacroValue("SYS") subsys = widget.getMacroValue("SUBSYS") dev = widget.getMacroValue("DEV") par = widget.getMacroValue("PAR") pv_name_absolute_angle = sys + "-" + subsys + ":" + dev + ":SEQ:Aabs" pv_name_absolute_move = sys + "-" + subsys + ":" + dev + ":SEQ:Mabs" widget_text_box = "text_user_" + par widget_text_box_value = display.getWidget(widget_text_box).getPropertyValue( "text") PVUtil.writePV(pv_name_absolute_angle, widget_text_box_value) time.sleep(0.5) PVUtil.writePV(pv_name_absolute_move, "1")
from org.csstudio.opibuilder.scriptUtil import ConsoleUtil from org.csstudio.opibuilder.scriptUtil import PVUtil from org.csstudio.opibuilder.scriptUtil import ColorFontUtil import WidgetUtil value = PVUtil.getDouble(pvs[0]) name = pvs[1].getName() if value == 0: PVUtil.writePV(name, "Model") elif value == 1: PVUtil.writePV(name, "CONST") elif value == 2: PVUtil.writePV(name, "AWG") elif value == 3: PVUtil.writePV(name, "0")
from org.csstudio.opibuilder.scriptUtil import ConsoleUtil from org.csstudio.opibuilder.scriptUtil import PVUtil import WidgetUtil from org.eclipse.jface.dialogs import MessageDialog meas = PVUtil.getString(pvs[0]) temp = PVUtil.getString(pvs[1]) value = PVUtil.getString(pvs[2]) if meas=="" or temp =="" or value == "": MessageDialog.openWarning(None, "Warning", "At least one field is empty!") flag = 0 else: flag = 1 if flag ==1: StringToSend = meas+":"+temp+":"+value PVUtil.writePV("LLRF_USER:CavitySimulator:StringToSendTemp", StringToSend)
from org.csstudio.opibuilder.scriptUtil import PVUtil from org.csstudio.opibuilder.scriptUtil import ConsoleUtil sys = widget.getMacroValue("SYS") subsys = widget.getMacroValue("SUBSYS") dev = widget.getMacroValue("DEV") par = widget.getMacroValue("PAR") pv_name = sys + "-" + subsys + ":" + dev + ":" + "v0set" text_box = "text_set_voltage_" + par value = display.getWidget(text_box).getPropertyValue("text") PVUtil.writePV(pv_name, value) #ConsoleUtil.writeInfo(value)
[2,3,3,3,3,3,3,3], [2,3,3,3,3,3,3,2], [3,3,3,3,3,3,3], [2,3,3,3,3,3,3], [2,3,3,3,3,3,2], [3,3,3,3,3,3], [2,3,3,3,3,3], [2,3,3,3,3,2], [3,3,3,3,3], [2,3,3,3,3], [2,3,3,3,2], [3,3,3,3], [2,3,3,3], [2,3,3,2], [3,3,3], [3,2,3], [2,3,2], [3,3]]; panelnum=1 rowcount=1 for i in ARRAY: for j in i: pv = PREFIX+"_ROW"+str(rowcount)+"_PANEL"+str(panelnum)+":pwonoff" PVUtil.writePV(pv,0) panelnum+=1 rowcount+=1 panelnum=1
from org.csstudio.opibuilder.scriptUtil import PVUtil import time sys = widget.getMacroValue("SYS") subsys = widget.getMacroValue("SUBSYS") dev = widget.getMacroValue("DEV") text_pos = "text_abs_pos" val_pos = display.getWidget(text_pos).getPropertyValue("text") pv_name_set_angle = sys + "-" + subsys + ":" + dev + ":SEQ:Aabs" PVUtil.writePV(pv_name_set_angle, val_pos) time.sleep(0.5) pv_name_move = sys + "-" + subsys + ":" + dev + ":SEQ:Mabs" PVUtil.writePV(pv_name_move, "1")
#looks at host name to see if it development PC import socket devList = ['dsg-c-linux1.jlab.org'] dev = socket.gethostname() in devList #screen = 'HMS-Hodo-1-X-list.opi' screen = str(PVUtil.getString(pvs[0])) if PVUtil.getDouble(pvs[1]) == 1: #path = '/home/tlemon/CSS-Workspaces/dev/CSS/' path = os.getcwd() if path[-1] != '/': path += '/' inFile = path+screen+'-list.opi' with open(inFile,'r') as f: data = f.readlines() pwPVs = [] count = 0 for line in data: line = line.strip() if '<pv_name>' in line and '</pv_name>' in line: pv = line.split('<pv_name>')[1].split('</pv_name>')[0] if 'Pw' in pv: count += 1 if dev: PVUtil.writePV('devIOC:ai'+str(count),0) else: PVUtil.writePV(pv,0)
'/CLAS12_Share/apps/caenHvApp/caenhv_channel.opi') #try { lc.setPropertyValue('resize_behaviour',1) } #catch (err) { lc.setPropertyValue('auto_size',true) } # lc.setPropertyValue('resize_behavior',2) lc.setPropertyValue('auto_size', True) lc.setPropertyValue('zoom_to_fit', False) lc.setPropertyValue('border_style', 0) lc.setPropertyValue('background_color', 'Header_Background') lc.addMacro('C', str(ichan)) lc.addMacro('P', str(pv)) widget.addChildToBottom(lc) ichan = 0 for sec in range(1, NSECTORS + 1): if SECTOR in range(1, NSECTORS + 1) and SECTOR != sec: continue for reg in range(1, NREGIONS + 1): if REGION in range(1, NREGIONS + 1) and REGION != reg: continue for slay in SLREG[reg]: if SLAYER in [1, 2, 3, 4, 5, 6] and SLAYER != slay: continue for sfg in ['S', 'F', 'G']: if SFG in ['S', 'F', 'G'] and SFG != sfg: continue for wrange in WSFG[sfg]: pv = '%s_SEC%d_R%d_SL%d_%s%s' % (PREFIX, sec, reg, slay, sfg, wrange) print pv if FUNCTION == 'ON': PVUtil.writePV(pv + ':pwonoff', 1) elif FUNCTION == 'OFF': PVUtil.writePV(pv + ':pwonoff', 0) elif FUNCTION == 'LIST': generateRow(ichan, pv) ichan += 1