本文整理汇总了Python中org.csstudio.opibuilder.scriptUtil.PVUtil.getString方法的典型用法代码示例。如果您正苦于以下问题:Python PVUtil.getString方法的具体用法?Python PVUtil.getString怎么用?Python PVUtil.getString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.csstudio.opibuilder.scriptUtil.PVUtil
的用法示例。
在下文中一共展示了PVUtil.getString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from org.csstudio.opibuilder.scriptUtil import PVUtil [as 别名]
# 或者: from org.csstudio.opibuilder.scriptUtil.PVUtil import getString [as 别名]
def main():
if spectrumPv.isConnected():
spectrum = PVUtil.getLong(spectrumPv)
if spectrum is None:
spectrum = 1
else:
spectrum = 1
if periodPv.isConnected():
period = PVUtil.getLong(periodPv)
if period is None:
period = 1
else:
period = 1
if modePv.isConnected() and PVUtil.getString(modePv).lower() == "counts":
mode = "YC"
axis_title = "Counts"
else:
mode = "Y"
axis_title = "Counts/us"
widget.setPropertyValue("trace_0_x_pv","$(P)DAE:SPEC:" + str(period) + ":" + str(spectrum) + ":X")
widget.setPropertyValue("trace_0_y_pv","$(P)DAE:SPEC:" + str(period) + ":" + str(spectrum) + ":" + mode)
widget.setPropertyValue("axis_1_axis_title", axis_title)
示例2: getWidgetPVString
# 需要导入模块: from org.csstudio.opibuilder.scriptUtil import PVUtil [as 别名]
# 或者: from org.csstudio.opibuilder.scriptUtil.PVUtil import getString [as 别名]
def getWidgetPVString(display, widget):
"""Fetch value of a widget's PV
@param display BOY Display
@param widget Widget name
@return Value of that PV as string
"""
pv = display.getWidget(widget).getPV()
return str(PVUtil.getString(pv))
示例3: get_pv_value
# 需要导入模块: from org.csstudio.opibuilder.scriptUtil import PVUtil [as 别名]
# 或者: from org.csstudio.opibuilder.scriptUtil.PVUtil import getString [as 别名]
def get_pv_value(pv, max_wait=1.0):
"""
Gets the value of a PV as a string. Returns None if no value available
"""
steps = 100
for i in range(steps):
try:
return PVUtil.getString(pv)
except:
sleep(max_wait/steps)
return None
示例4: get_motor_pvs
# 需要导入模块: from org.csstudio.opibuilder.scriptUtil import PVUtil [as 别名]
# 或者: from org.csstudio.opibuilder.scriptUtil.PVUtil import getString [as 别名]
def get_motor_pvs():
"""
Get the PVs containing the names of the motors associated with the specified soft motors
"""
motor_pvs = []
for name in [PVUtil.getString(pv) for pv in pvs[1:]]: # pvs[0] is for the number of motors
if is_unexpanded_macro(name) or len(name) == 0:
motor_pvs.append(None)
else:
# Associate all PVs with the top-level display for ease. Shouldn't be any conflict
motor_pvs.append(PVUtil.createPV(display.getMacroValue("P") + name + ":MOTOR", display))
return motor_pvs
示例5: is_number
# 需要导入模块: from org.csstudio.opibuilder.scriptUtil import PVUtil [as 别名]
# 或者: from org.csstudio.opibuilder.scriptUtil.PVUtil import getString [as 别名]
from org.csstudio.opibuilder.scriptUtil import PVUtil
import os, time
numberofboxes = 19
check_eemem_boxarray =[]
eemem_message = display.getWidget("eemem_message")
set_eemem = display.getWidget("eemem_choice").getPV()
set_eemem_choice = PVUtil.getString(set_eemem)
def is_number(s):
try:
float(s)
return True
except ValueError:
return False
if set_eemem_choice == "":
eemem_message.setPropertyValue("text","Please select which values to change and alter at least one of them.")
####################### SetEemem => Cards ###############################
elif set_eemem_choice == "Cards":
cardscount = 0
empty_cards = 0
cards_message =""
################ check if calibration file exists #################
filepath = display.getWidget("eemem_cards_cal_file").getValue()
示例6:
# 需要导入模块: from org.csstudio.opibuilder.scriptUtil import PVUtil [as 别名]
# 或者: from org.csstudio.opibuilder.scriptUtil.PVUtil import getString [as 别名]
from org.csstudio.opibuilder.scriptUtil import PVUtil
op1=PVUtil.getDouble(pvs[0])
op2=PVUtil.getDouble(pvs[1])
operator = PVUtil.getString(pvs[2])
resultPV=pvs[3]
if operator=="+":
resultPV.setValue(op1 + op2)
elif operator=="-":
resultPV.setValue(op1 - op2)
elif operator=="*":
resultPV.setValue(op1 * op2)
elif operator=="/":
resultPV.setValue(op1 / op2)
示例7:
# 需要导入模块: from org.csstudio.opibuilder.scriptUtil import PVUtil [as 别名]
# 或者: from org.csstudio.opibuilder.scriptUtil.PVUtil import getString [as 别名]
#Fill PV Name only once
if widget.getVar("firstTime") == None:
widget.setVar("firstTime", True)
i=0
for pv in pvs:
table.setCellText(i, 0, pv.getName())
if not pv.isConnected():
table.setCellText(i, 1, "Disconnected")
i+=1
#find index of the trigger PV
i=0
while triggerPV != pvs[i]:
i+=1
table.setCellText(i, 1, PVUtil.getString(triggerPV))
table.setCellText(i, 2, PVUtil.getTimeString(triggerPV))
table.setCellText(i, 3, PVUtil.getStatus(triggerPV))
table.setCellText(i, 4, PVUtil.getSeverityString(triggerPV))
s = PVUtil.getSeverity(triggerPV)
color = ColorFontUtil.WHITE
if s == 0:
color = ColorFontUtil.GREEN
elif s == 1:
color = ColorFontUtil.RED
elif s == 2:
color = ColorFontUtil.YELLOW
elif s == 3:
color = ColorFontUtil.PINK
示例8: action
# 需要导入模块: from org.csstudio.opibuilder.scriptUtil import PVUtil [as 别名]
# 或者: from org.csstudio.opibuilder.scriptUtil.PVUtil import getString [as 别名]
from org.csstudio.opibuilder.scriptUtil import PVUtil,WidgetUtil,ConsoleUtil
nodefull = PVUtil.getString(pvArray[0]) #Full name of the node Eg. B_SYS_HV_ECAL_SEC1
bgcol = widget.getMacroValue("BGCOL") #BG color for button
#Write this command as the tooltip, to make it available as a macro for the action (a fudge suggested in the CSS/Boy forum)
widget.setPropertyValue("tooltip",nodefull)
widget.setPropertyValue("background_color",bgcol)
示例9: int
# 需要导入模块: from org.csstudio.opibuilder.scriptUtil import PVUtil [as 别名]
# 或者: from org.csstudio.opibuilder.scriptUtil.PVUtil import getString [as 别名]
#Warning - some danger of infinite recursion here. Careful"
#The $(LCID) macro is used to make local PVs per instance. So several instances could be run from the same CSS
#without interfering.
#For example loc://$(LCID)_NODE pv is like this: B_SYS_HV_ECAL_SEC1_.....
#split into list with elements 0 1 2 3 4 5
#eg - with N for the menu N = 3 *
#
nodeLoader.readTree() #Read in the node tree
n = int(widget.getMacroValue("N")) #Get N,B and NODE
topnode=widget.getMacroValue("TOP")
node = PVUtil.getString(pvArray[0])
if not node in nodeLoader.NodeIndex: # check node defined, or force to top node
node=topnode
nlist=node.split("_") #make a list of the parts of node nlist = (B,SYS,HV,ECAL,SEC1,....)
#widget.setPropertyValue("height",24 ) #and size
#widget.setPropertyValue("visible","false") #assume invisible until other decision made
widget.setPropertyValue("enabled","false") #assume invisible until other decision made
widget.setPropertyValue("background_color","OPI_Background") #assume invisible until other decision made
if n<=len(nlist): #if this level is included in the node
parent=topnode
if n>1:
for e in range(1,n):
示例10:
# 需要导入模块: from org.csstudio.opibuilder.scriptUtil import PVUtil [as 别名]
# 或者: from org.csstudio.opibuilder.scriptUtil.PVUtil import getString [as 别名]
from org.csstudio.opibuilder.scriptUtil import PVUtil
from org.csstudio.opibuilder.scriptUtil import ConsoleUtil
value = PVUtil.getString(pvs[0])
units = PVUtil.getString(pvs[1])
widget.setValue(value + " " + units)
示例11:
# 需要导入模块: from org.csstudio.opibuilder.scriptUtil import PVUtil [as 别名]
# 或者: from org.csstudio.opibuilder.scriptUtil.PVUtil import getString [as 别名]
"""from org.csstudio.opibuilder.scriptUtil import PVUtil
from org.eclipse.ui import PlatformUI
## Define Window Title
title = PVUtil.getString(pvArray[1])
## Set Window Title
window = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
window.getShell().setText(title)"""
from org.csstudio.opibuilder.scriptUtil import PVUtil
from org.eclipse.ui import PlatformUI
selection_type = PVUtil.getString(pvs[0]).upper()
title = selection_type + ' Selection'
## Define Window Title
title = PVUtil.getString(pvArray[1])
## Set Window Title
window = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
window.getShell().setText(title)
示例12:
# 需要导入模块: from org.csstudio.opibuilder.scriptUtil import PVUtil [as 别名]
# 或者: from org.csstudio.opibuilder.scriptUtil.PVUtil import getString [as 别名]
from org.csstudio.opibuilder.scriptUtil import PVUtil
from org.csstudio.opibuilder.scriptUtil import DataUtil
macroInput = DataUtil.createMacrosInput(True)
pvname = widget.getPVByName("loc://SetEemem")
pvvalue = PVUtil.getString(pvname)
if pvvalue == "IP":
pvvalue = "Ip"
elif pvvalue == "MAC":
pvvalue = "Mac"
macroInput.put("EEMEM_VALUE", "%s" % pvvalue)
widgetController.setPropertyValue("macros", macroInput)
widgetController.setPropertyValue("opi_file",
widgetController.getPropertyValue("opi_file"), True)
示例13: int
# 需要导入模块: from org.csstudio.opibuilder.scriptUtil import PVUtil [as 别名]
# 或者: from org.csstudio.opibuilder.scriptUtil.PVUtil import getString [as 别名]
#Warning - some danger of infinite recursion here. Careful"
#The $(LCID) macro is used to make local PVs per instance. So several instances could be run from the same CSS
#without interfering.
#For example loc://$(LCID)_NODE pv is like this: B_SYS_HV_ECAL_SEC1_.....
#split into list with elements 0 1 2 3 4 5
#eg - with N for the menu N = 3 *
#
# 3 clicked to set DC changes loc://$(LCID)_NODE pv to B_SYS_HV_DC
n = int(widget.getMacroValue("N")) #Get N,TOP and NODE and MOUT_$(N)
topnode=widget.getMacroValue("TOP")
node = PVUtil.getString(pvArray[0])
sel = PVUtil.getString(pvArray[1])
nlist=node.split("_") #make a list of the parts of node nlist = (B,SYS,HV,ECAL,SEC1,....)
#ConsoleUtil.writeInfo("Action:"+str(n)+", mode= "+node+", sel= "+sel)
if not sel == 'select..':
if n>=len(nlist) or ((n<len(nlist)) and (not sel==nlist[n])):
newnode=topnode
if n>=1:
for e in range(1,n):
newnode+="_"+nlist[e]
newnode+="_"+sel
pvArray[0].setValue(newnode)
示例14: open
# 需要导入模块: from org.csstudio.opibuilder.scriptUtil import PVUtil [as 别名]
# 或者: from org.csstudio.opibuilder.scriptUtil.PVUtil import getString [as 别名]
from org.csstudio.opibuilder.scriptUtil import PVUtil, DataUtil, ConsoleUtil
register_pv = pvArray[0]
display_mode_pv = pvArray[1]
deviation_register_pv = pvArray[2]
numBPM = 160
## Get Orbit Widgets
graph_orbit_x = display.getWidget("Graph Orbit X")
graph_orbit_y = display.getWidget("Graph Orbit Y")
## Update Graphical Data
try:
if triggerPV == register_pv:
register = PVUtil.getString(register_pv)
registers = widget.getWidget("Register Selection").getPropertyValue("items")
if register == registers[0]:
orbit_x_pv = widget.getMacroValue("orbit_x_ioc")
orbit_y_pv = widget.getMacroValue("orbit_y_ioc")
trigger = 1
else:
orbit_x_pv = widget.getMacroValue("orbit_x_graph")
orbit_y_pv = widget.getMacroValue("orbit_y_graph")
orbit_x = DataUtil.createDoubleArray(numBPM)
orbit_y = DataUtil.createDoubleArray(numBPM)
if register == registers[1] or register == registers[2]:
orbit_filename = register[-1] + ".txt"
orbit_pathname = "/home/fac_files/hla/sirius/machine_apps/si_sofb/"
orbit_x_data = open(orbit_pathname+"reforbit_x/"+orbit_filename).readlines()
orbit_y_data = open(orbit_pathname+"reforbit_y/"+orbit_filename).readlines()
示例15:
# 需要导入模块: from org.csstudio.opibuilder.scriptUtil import PVUtil [as 别名]
# 或者: from org.csstudio.opibuilder.scriptUtil.PVUtil import getString [as 别名]
button.setPropertyValue("pv_name", power_supply)
#button.setPropertyValue("text", power_supply)
#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("quadrupole")')
linkingContainer.setPropertyValue("macros", macro_inputs)
subsystem = "SIPS-"
family = PVUtil.getString(pvs[0]).upper()
power_supplies = get_power_supply_list(family)
header_opi = "table/selection_table_low_header.opi"
line_opi = "table/selection_table_line.opi"
table_container = display.getWidget("table_container")
#fam_table = display.getWidget("fam_table")
#shunt_table_1 = display.getWidget("shunt_table_1")
#shunt_table_2 = display.getWidget("shunt_table_2")
#fam_table.removeAllChildren()
#shunt_table_1.removeAllChildren()
#shunt_table_2.removeAllChildren()
if power_supplies is None:
table_container.setPropertyValue("visible", False)