本文整理汇总了Python中Acspy.Clients.SimpleClient.PySimpleClient.getDefaultComponent方法的典型用法代码示例。如果您正苦于以下问题:Python PySimpleClient.getDefaultComponent方法的具体用法?Python PySimpleClient.getDefaultComponent怎么用?Python PySimpleClient.getDefaultComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Acspy.Clients.SimpleClient.PySimpleClient
的用法示例。
在下文中一共展示了PySimpleClient.getDefaultComponent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Server
# 需要导入模块: from Acspy.Clients.SimpleClient import PySimpleClient [as 别名]
# 或者: from Acspy.Clients.SimpleClient.PySimpleClient import getDefaultComponent [as 别名]
class Server(BaseRepresentation):
#--------------------------------------------------------------------------
def __init__(self, compname, comp_type):
BaseRepresentation.__init__(self, compname)
self.comp_type = comp_type
self.simulator = None
self.client = PySimpleClient()
self.simulator = None
try:
self.simulator = self.client.getDefaultComponent("IDL:alma/ACSSim/Simulator:1.0")
except NoDefaultComponentEx, ex:
# fine, no Simulator Server component defined in the CDB
pass
示例2: PySimpleClient
# 需要导入模块: from Acspy.Clients.SimpleClient import PySimpleClient [as 别名]
# 或者: from Acspy.Clients.SimpleClient.PySimpleClient import getDefaultComponent [as 别名]
This method is overriden to do something useful
once a timeout occurs
'''
print "The current time is: ", e.value
#---------------------------------------------------
# Make an instance of the PySimpleClient
simpleClient = PySimpleClient()
# Get the current time from the standard CLOCK1 Clock device and add 3 seconds to it
# This is when the timeout will occur.
start = long(getTimeStamp().value) + long(30000000)
# Get the standard Timer component which will
# schedule the timeout
timer = simpleClient.getDefaultComponent("IDL:alma/acstime/Timer:1.0")
# Create timeout handler and schedule its timeout
myHandler = TimeoutHandlerImpl()
myHandler2 = TimeoutHandlerImpl()
# A Duration of 0 implies the timeout will only occur once
id1 = timer.schedule(simpleClient.activateOffShoot(myHandler),
acstime.Epoch(start),
acstime.Duration(long(20000000)))
# A Duration of 0 implies the timeout will only occur once
id2 = timer.schedule(simpleClient.activateOffShoot(myHandler2),
acstime.Epoch(start),
acstime.Duration(long(0)))
示例3: len
# 需要导入模块: from Acspy.Clients.SimpleClient import PySimpleClient [as 别名]
# 或者: from Acspy.Clients.SimpleClient.PySimpleClient import getDefaultComponent [as 别名]
#!/usr/bin/env python
from Acspy.Clients.SimpleClient import PySimpleClient
import APDMEntities.SchedBlock
import sys, traceback
import pyxb
pyxb.namespace.builtin.XMLSchema_instance.ProcessTypeAttribute(pyxb.namespace.builtin.XMLSchema_instance.PT_skip)
pyxb.RequireValidWhenParsing(False)
if len(sys.argv) < 2:
print "Nothing to do. This script requires as arguments SB uids"
exit()
client = PySimpleClient()
stateSystem = client.getDefaultComponent("IDL:alma/projectlifecycle/StateSystem:1.0")
archive = client.getDefaultComponent("IDL:alma/xmlstore/ArchiveConnection:1.0")
ops = archive.getOperational("SCRIPT")
for uid in sys.argv[1:]:
print "Trying to transition SB with UID:", uid
xml = ops.retrieve(uid)
sb = APDMEntities.SchedBlock.CreateFromDocument(xml.xmlString)
sbs_id = sb.SBStatusRef.entityId
try:
# First try with CSV SB
# stateSystem.changeSBStatus(str(sbs_id), 'Running', 'scheduling', 'user_with_all_roles')
# stateSystem.changeSBStatus(str(sbs_id), 'CSVReady', 'scheduling', 'aod')
stateSystem.changeSBStatus(str(sbs_id), "CSVReady", "scheduling", "user_with_all_roles")
except:
# Then with a Regular SB