本文整理汇总了Python中Acspy.Clients.SimpleClient.PySimpleClient.getDynamicComponent方法的典型用法代码示例。如果您正苦于以下问题:Python PySimpleClient.getDynamicComponent方法的具体用法?Python PySimpleClient.getDynamicComponent怎么用?Python PySimpleClient.getDynamicComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Acspy.Clients.SimpleClient.PySimpleClient
的用法示例。
在下文中一共展示了PySimpleClient.getDynamicComponent方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_mgr_instance
# 需要导入模块: from Acspy.Clients.SimpleClient import PySimpleClient [as 别名]
# 或者: from Acspy.Clients.SimpleClient.PySimpleClient import getDynamicComponent [as 别名]
def get_mgr_instance(self,antenna):
'''
Get dinamic component instance
'''
from Acspy.Clients.SimpleClient import PySimpleClient
mgr = None
sys.stdout = open("/dev/null", "w")
client = PySimpleClient("CAN STATUS")
sys.stdout = sys.__stdout__
deployed_mgrs = client.availableComponents(type_wildcard='IDL:alma/Control/AmbManager:1.0')
for deployed_mgr in deployed_mgrs:
if deployed_mgr.name.__contains__(antenna) :
print "Trying to get ambManager from %s" % antenna
try:
mgr= client.getDynamicComponent(deployed_mgr.name, deployed_mgr.type, deployed_mgr.code, deployed_mgr.container_name)
except maciErrType.CannotGetComponentEx, e:
print e[0].shortDescription
sys.exit(-1)
except Exception, e:
print e
sys.exit(-1)
break
示例2: PySimpleClient
# 需要导入模块: from Acspy.Clients.SimpleClient import PySimpleClient [as 别名]
# 或者: from Acspy.Clients.SimpleClient.PySimpleClient import getDynamicComponent [as 别名]
#!/usr/bin/env python
from Acspy.Clients.SimpleClient import PySimpleClient
client = PySimpleClient()
f1 = client.getDynamicComponent("FRIDGE001", 'IDL:alma/FRIDGE/FridgeControl:1.0', 'Acssim.Servants.Simulator', 'pyContainer')
f2 = client.getDynamicComponent("FRIDGE002", 'IDL:alma/FRIDGE/FridgeControl:1.0', 'Acssim.Servants.Simulator', 'pyContainer')
示例3: PySimpleClient
# 需要导入模块: from Acspy.Clients.SimpleClient import PySimpleClient [as 别名]
# 或者: from Acspy.Clients.SimpleClient.PySimpleClient import getDynamicComponent [as 别名]
from Acspy.Clients.SimpleClient import PySimpleClient
client = PySimpleClient("CAN STATUS")
mgr = client.getDynamicComponent('CONTROL/DA41/AmbManager', 'IDL:alma/Control/AmbManager:1.0', 'ambManagerImpl', 'CONTROL/DA41/cppHGContainer')
for j in range(0,5):
for i in mgr.getNodes(j)[0]:
print "channel %d , node %d => %s" %(i.channel, i.node, str(hex(i.node)))
示例4: PySimpleClient
# 需要导入模块: from Acspy.Clients.SimpleClient import PySimpleClient [as 别名]
# 或者: from Acspy.Clients.SimpleClient.PySimpleClient import getDynamicComponent [as 别名]
- <a href="../../idl/html/interfaceHelloWorld_1_1HelloWorld.html">HelloWorld IDL Documentation</a>
'''
# Import command-line arguments
from sys import argv
# Import the SimpleClient class
from Acspy.Clients.SimpleClient import PySimpleClient
# Make an instance of the PySimpleClient
simpleClient = PySimpleClient()
# Obtain a reference to a dynamic component using the ContainerServices
# getComponent method.
hwRef = simpleClient.getDynamicComponent(None,
"IDL:alma/acsexmplHelloWorld/HelloWorld:1.0",
"acsexmplHelloWorldImpl",
str(argv[1]))
if hwRef != None:
simpleClient.getLogger().logInfo("Retrieved valid reference from manager.")
#Do something useful with the reference.
hwRef.displayMessage()
simpleClient.getLogger().logInfo("Method of dynamic component successfully invoked. Have a nice day!")
else:
simpleClient.getLogger().logAlert("Bad reference retrieved from manager")
simpleClient.disconnect()
print "The end __oOo__"
示例5: PySimpleClient
# 需要导入模块: from Acspy.Clients.SimpleClient import PySimpleClient [as 别名]
# 或者: from Acspy.Clients.SimpleClient.PySimpleClient import getDynamicComponent [as 别名]
#!/usr/bin/env python
from Acspy.Clients.SimpleClient import PySimpleClient
client = PySimpleClient()
f1 = client.getDynamicComponent("FRIDGE001", 'IDL:alma/FRIDGE/FridgeControl:1.0', 'Acssim.Servants.Simulator', 'pyContainer')
f2 = client.getDynamicComponent("FRIDGE002", 'IDL:alma/FRIDGE/FridgeControl:1.0', 'Acssim.Servants.Simulator', 'pyContainer')
h3 = client.getDynamicComponent("HELLOWORLD001", 'IDL:alma/acsexmplHelloWorld/HelloWorld:1.0', 'Acssim.Servants.Simulator', 'pyContainer')
f1.doorStatus
f2.doorStatus
h3.displayMessage()