#!/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 main(): Pref = widget.getParent().getMacroValue("pref") LogZFlag = int(PVUtil.getDouble(pvs[3]) + 0.00001); ManualFlag = int(PVUtil.getDouble(pvs[4]) + 0.00001); #PVs are: AutoMax:non-logz, AutoMax:logz, UserMax, logzflag, ManualFlag, DisplayRange #trigger on AutoRange and UserRange min if ManualFlag == 1: pvs[5].setValue(PVUtil.getDouble(pvs[2])) elif LogZFlag == 1: pvs[5].setValue(PVUtil.getDouble(pvs[1])) else: pvs[5].setValue(PVUtil.getDouble(pvs[0])) #ConsoleUtil.writeInfo("input pvs = " + str(PVUtil.getDouble(pvs[0])) + ", " + str(PVUtil.getDouble(pvs[1])) + ", " + str(PVUtil.getDouble(pvs[2]))) #UserMax = PVUtil.getDouble(pvs[0]) #pvs[1].setValue(UserMax) #ECAL:scaler_r1_max #pvs[2].setValue(0) #ECAL:scaler_r1_automax #time.sleep(2); #ConsoleUtil.writeInfo("set pvs = " + str(PVUtil.getDouble(pvs[0])) + ", " + str(PVUtil.getDouble(pvs[1])) + ", " + str(PVUtil.getDouble(pvs[2]))) if __name__ == "__main__": main()