#!/usr/bin/env python # # P. Mattione November 2015 # from org.csstudio.opibuilder.scriptUtil import PVUtil from org.csstudio.opibuilder.scriptUtil import WidgetUtil from org.csstudio.opibuilder.scriptUtil import ConsoleUtil from org.csstudio.utility.pv import PVFactory from org.csstudio.opibuilder.scriptUtil import ColorFontUtil import re import os import time import sys linkingContainer = [] Arr=[] def Update_Channel(ECALChannel, Index): #Get Widget DisplayWidget = widget#.getParent().getParent().getWidget("ECAL_Channel") DisplayWidget.removeAllChildren() linkingContainer.append( WidgetUtil.createWidgetModel("org.csstudio.opibuilder.widgets.linkingContainer") ) # ConsoleUtil.writeInfo("NAME = " + linkingContainer[Index].getPropertyValue("name")) linkingContainer[Index].setPropertyValue("opi_file", "ECAL_scaler_graphic_channel.opi") #create linking container linkingContainer[Index].setPropertyValue("height",47) linkingContainer[Index].setPropertyValue("width", 515) linkingContainer[Index].setPropertyValue("auto_size", False) linkingContainer[Index].setPropertyValue("zoom_to_fit", False) linkingContainer[Index].setPropertyValue("border_style", 0) #add macros linkingContainer[Index].addMacro("ECAL_Selected_Channel", ECALChannel) DisplayWidget.addChildToBottom(linkingContainer[Index]) DisplayWidget.performAutosize() def main(): Pref = widget.getParent().getMacroValue("pref") ECALChannel = PVUtil.getString(pvs[0]) if ECALChannel == "0.000": ECALChannel = "ECAL:17:19:scaler_r1" # ConsoleUtil.writeInfo("MODULE: ReadoutString, ModuleString = " + ReadoutString + ", " + ModuleString) ################################################# Update module ################################################ #Update Channel Update_Channel(ECALChannel, 0) #Update Channel label ChannelLabelWidget = widget.getWidget("Selection_Label") ChannelLabelWidget.setPropertyValue("text", "Selected Channel, " + ECALChannel + ":") if __name__ == "__main__": main()