本文整理汇总了Python中org.csstudio.opibuilder.scriptUtil.PVUtil.createPV方法的典型用法代码示例。如果您正苦于以下问题:Python PVUtil.createPV方法的具体用法?Python PVUtil.createPV怎么用?Python PVUtil.createPV使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.csstudio.opibuilder.scriptUtil.PVUtil
的用法示例。
在下文中一共展示了PVUtil.createPV方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_motor_pvs
# 需要导入模块: from org.csstudio.opibuilder.scriptUtil import PVUtil [as 别名]
# 或者: from org.csstudio.opibuilder.scriptUtil.PVUtil import createPV [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
示例2:
# 需要导入模块: from org.csstudio.opibuilder.scriptUtil import PVUtil [as 别名]
# 或者: from org.csstudio.opibuilder.scriptUtil.PVUtil import createPV [as 别名]
if element == -1 and voltage != 0:
message.setPropertyValue("text", "Choose an element.")
elif voltage == 0 and element != -1:
message.setPropertyValue("text", "Choose a voltage value.")
elif voltage == 0 and element == -1:
message.setPropertyValue("text", "Choose a voltage value and an element.")
else:
PVUtil.createPV("CB:HV:ELEMENT:%s:set_volt" % (element), widget).setValue(voltage)
######################## Element -> File ###########################
if radio_target == "Element" and radio_source == "File":
if element == -1 and filepath != "":
message.setPropertyValue("text", "Choose an element.")
elif filepath == "" and element != -1:
message.setPropertyValue("text", "Choose a filepath.")
elif filepath == "" and element == -1:
示例3: int
# 需要导入模块: from org.csstudio.opibuilder.scriptUtil import PVUtil [as 别名]
# 或者: from org.csstudio.opibuilder.scriptUtil.PVUtil import createPV [as 别名]
from org.csstudio.opibuilder.scriptUtil import PVUtil
from org.csstudio.opibuilder.scriptUtil import ConsoleUtil
from time import sleep
remote_pv = widget.getPV();
setpoint_pv = PVUtil.createPV(widget.getPropertyValue("pv_name")+":SP", widget)
current_value = int(PVUtil.getDouble(remote_pv))
for _ in range(10):
if remote_pv.isConnected() and setpoint_pv.isConnected():
setpoint_pv.setValue(1 if current_value==0 else 0)
break
else:
sleep(0.1)
else:
ConsoleUtil.writeError("Error: Unable to connect to rate PVs")