本文整理汇总了Python中Acspy.Clients.SimpleClient.PySimpleClient.getComponent方法的典型用法代码示例。如果您正苦于以下问题:Python PySimpleClient.getComponent方法的具体用法?Python PySimpleClient.getComponent怎么用?Python PySimpleClient.getComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Acspy.Clients.SimpleClient.PySimpleClient
的用法示例。
在下文中一共展示了PySimpleClient.getComponent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: set_array_frec
# 需要导入模块: from Acspy.Clients.SimpleClient import PySimpleClient [as 别名]
# 或者: from Acspy.Clients.SimpleClient.PySimpleClient import getComponent [as 别名]
def set_array_frec():
client = PySimpleClient()
master = client.getComponent("CONTROL/MASTER")
arrayList = master.getAutomaticArrayComponents() + master.getManualArrayComponents()
for array in arrayList:
master.destroyArray(array.ComponentName)
arrayList = []
antennas = master.getAvailableAntennas()
master.createManualArray(antennas)
arrayList = master.getAutomaticArrayComponents() + master.getManualArrayComponents()
if ( arrayList != 1 ):
if( len(arrayList) == 0):
print "Could not create an array!!"
client.releaseComponent("CONTROL/MASTER")
sys.exit(0)
else:
print "Could not destroy previosly arrays and create a new fresh array!"
client.releaseComponent("CONTROL/MASTER")
sys.exist(0)
currentArray = client.getComponent(arrayList[0].ComponentName)
client.releaseComponent("CONTROL/MASTER")
setArrayName(currentArray.getArrayName())
array = getArray()
tp = array.getTotalPowerObservingMode()
return tp
示例2: __init__
# 需要导入模块: from Acspy.Clients.SimpleClient import PySimpleClient [as 别名]
# 或者: from Acspy.Clients.SimpleClient.PySimpleClient import getComponent [as 别名]
def __init__(self):
try:
#This stuff is only for get the antennas of a manual array
from Acspy.Clients.SimpleClient import PySimpleClient
c = PySimpleClient()
master = c.getComponent('CONTROL/MASTER')
arrayname = master.getManualArrays()
array = c.getComponent('CONTROL/'+arrayname[0])
self.antennalist = array.getAntennas()
self.logger = getLogger()
del master
del array
c.disconnect()
except Exception, e:
print e
示例3: TestStorageMethods
# 需要导入模块: from Acspy.Clients.SimpleClient import PySimpleClient [as 别名]
# 或者: from Acspy.Clients.SimpleClient.PySimpleClient import getComponent [as 别名]
class TestStorageMethods(unittest.TestCase):
def test_full(self):
self.client = PySimpleClient()
self.storage = self.client.getComponent("STORAGE")
self.storage.clearAllData()
targets = []
images = []
for i in range(10):
targets.append(TYPES.Target(i, TYPES.Position(10.0, 45.0), 2))
image = bytearray()
for j in range(1000000):
image.append(j % 256)
images.append(bytes(image))
proposal = TYPES.Proposal(0, targets, 0)
self.storage.storeObservation(proposal, images)
id = self.storage.getNextValidId()
print "ID", id
self.assertEqual(1, id, "Checking ID")
result = self.storage.getObservation(0)
self.assertEqual(10, len(result), "Number of observations")
self.storage.clearAllData()
self.client.releaseComponent(self.storage._get_name())
示例4: subsystemsOffline
# 需要导入模块: from Acspy.Clients.SimpleClient import PySimpleClient [as 别名]
# 或者: from Acspy.Clients.SimpleClient.PySimpleClient import getComponent [as 别名]
def subsystemsOffline(self, subsystem):
from Acspy.Clients.SimpleClient import PySimpleClient
client = PySimpleClient()
mcI = client._ContainerServices__importComponentStubs(comp_type="IDL:alma/ACS/MasterComponent:1.0")
subsystem = client.getComponent(subsystem)
subsystem.doTransition(mcI.SUBSYSEVENT_SHUTDOWNPASS1)
(state, flag) = self.__waitForSubsystemState(subsystem._get_currentStateHierarchy(), "AVAILABLE.OFFLINE.PRESHUTDOWN", 300)
if flag is False:
return (state, flag)
subsystem.doTransition(mcI.SUBSYSEVENT_SHUTDOWNPASS2)
(state, flag) = self.__waitForSubsystemState(subsystem._get_currentStateHierarchy(), "AVAILABLE.OFFLINE.SHUTDOWN", 300)
if flag is False:
return (state, flag)
return (state, flag)
示例5: checkOnline
# 需要导入模块: from Acspy.Clients.SimpleClient import PySimpleClient [as 别名]
# 或者: from Acspy.Clients.SimpleClient.PySimpleClient import getComponent [as 别名]
def checkOnline(self):
masters_states = []
from Acspy.Clients.SimpleClient import PySimpleClient
masters_comps = self.parser.get_masters_from_execconfig()
for master in masters_comps:
client = PySimpleClient()
subsystem = client.getComponent(master)
currentStateHierarchy = subsystem._get_currentStateHierarchy()
state = currentStateHierarchy.get_sync()
#if (state[0][1] is 'OPERATIONAL'):
masters_states.append([master,state[0][1]])
for state in masters_states:
if(state[1] == 'OPERATIONAL'):
print state
pass
else:
return state
return "OK"
示例6: mostRecentAsdm
# 需要导入模块: from Acspy.Clients.SimpleClient import PySimpleClient [as 别名]
# 或者: from Acspy.Clients.SimpleClient.PySimpleClient import getComponent [as 别名]
def mostRecentAsdm(date = None):
'''
Get the most recent Asdm, given a date.
If the date is None, it takes the actual hour.
return asdm or None
'''
from Acspy.Clients.SimpleClient import PySimpleClient
from ArchivedAsdm import ArchivedAsdm
if date == None :
date_T = '%4.2d-%2.2d-%2.2dT00:00:00.000' % (gmtime()[0] , gmtime()[1] , gmtime()[2])
date = '%4.2d-%2.2d-%2.2d'% (gmtime()[0] , gmtime()[1] , gmtime()[2])
else:
date_T = '%4.2d-%2.2d-%2.2dT%2.2d:00:00.00' % (date[0] , date[1] , date[2] , date[3])
date = '%4.2d-%2.2d-%2.2d'% (date[0] , date[1] , date[2])
client = PySimpleClient()
archConn = client.getComponent('ARCHIVE_CONNECTION')
archOp = archConn.getOperational('XMLQueryTest')
uids = archOp.queryRecent('ASDM' , date_T)
print "Connection entablish with archive ..."
asdm_name = []
for uid in uids:
print "Checking date of " +str(uid),
result = archOp.retrieveDirty(uid)
dataSet = ArchivedAsdm(result.xmlString)
dateOfCreation = dataSet.getDateOfCreation()
print " created: "+str(dataSet.getDateTimeOfCreation()),
if dataSet.isAsdm() & (dateOfCreation==date):
asdm_name.append("%s \t%s" % (dataSet.getDateTimeOfCreation() , uid))
print " --> is an asdm!",
print ""
asdm_name.sort()
client.releaseComponent('ARCHIVE_CONNECTION')
client.disconnect()
if len(asdm_name) == 0 :
print 'There are no asdms for %s' % date
return None
else :
return asdm_name[-1].split('\t')[1]
示例7: mostRecentAsdm
# 需要导入模块: from Acspy.Clients.SimpleClient import PySimpleClient [as 别名]
# 或者: from Acspy.Clients.SimpleClient.PySimpleClient import getComponent [as 别名]
def mostRecentAsdm(date=None) :
if date == None :
date='%4.2d-%2.2d-%2.2d'%(time.gmtime()[0], time.gmtime()[1], time.gmtime()[2])
client = PySimpleClient()
archConn = client.getComponent('ARCHIVE_CONNECTION')
archOp = archConn.getOperational('XMLQueryTest')
uids = archOp.queryRecent('ASDM',date+'T00:00:00.000')
asdm_name=[]
for uid in uids:
result = archOp.retrieveDirty(uid)
dataSet = ArchivedAsdm(result.xmlString)
dateOfCreation = dataSet.getDateOfCreation()
if dataSet.isAsdm() & (dateOfCreation==date):
asdm_name.append("%s \t%s" % (dateOfCreation,uid))
asdm_name.sort()
client.releaseComponent('ARCHIVE_CONNECTION')
client.disconnect()
if len(asdm_name) == 0 :
print 'there are no asdms for %s' % date
return None
else :
return asdm_name[-1].split('\t')[1]
示例8: PySimpleClient
# 需要导入模块: from Acspy.Clients.SimpleClient import PySimpleClient [as 别名]
# 或者: from Acspy.Clients.SimpleClient.PySimpleClient import getComponent [as 别名]
#!/usr/bin/env python
from Acspy.Clients.SimpleClient import PySimpleClient
remoteComponent="MOUNT2_LOOP"
#Make an instance of the PySimpleClient
simpleClient = PySimpleClient()
#Get the MOUNT1 Mount device
mount = simpleClient.getComponent(remoteComponent)
#Get the actAz property
actAzProperty = mount._get_actAz()
#Get the current value of the property
(azm, compl) = actAzProperty.get_sync()
print "MOUNT actual azimuth: ", azm
#Cleanly disconnect
simpleClient.releaseComponent(remoteComponent)
simpleClient.disconnect()
示例9: PySimpleClient
# 需要导入模块: from Acspy.Clients.SimpleClient import PySimpleClient [as 别名]
# 或者: from Acspy.Clients.SimpleClient.PySimpleClient import getComponent [as 别名]
# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
# MA 02111-1307 USA
#
# @(#) $Id: acspyTestCompReload.py,v 1.1 2005/04/29 21:15:40 dfugate Exp $
###############################################################################
'''
Tests reloading components
'''
from Acspy.Clients.SimpleClient import PySimpleClient
from time import sleep
###############################################################################
if __name__ == "__main__":
simpleClient = PySimpleClient()
#this bit a code should make the container print out one special statement
print "...should see 1 module message now..."
c1 = simpleClient.getComponent("RELOADCOMP1")
sleep(4)
#releasing it should do the same thing
print "...and another one after it's released..."
simpleClient.releaseComponent("RELOADCOMP1")
sleep(4)
print "...there should not be one here though..."
c1 = simpleClient.getComponent("RELOADCOMP1")
sleep(4)
print "...or here..."
c2 = simpleClient.getComponent("RELOADCOMP2")
sleep(4)
print "...or even here"
simpleClient.releaseComponent("RELOADCOMP1")
sleep(4)
示例10: PySimpleClient
# 需要导入模块: from Acspy.Clients.SimpleClient import PySimpleClient [as 别名]
# 或者: from Acspy.Clients.SimpleClient.PySimpleClient import getComponent [as 别名]
Tests a callback void method.
'''
from sys import argv
from time import sleep
from Acspy.Clients.SimpleClient import PySimpleClient
from Acspy.Common.Callbacks import CBvoid
from ACS import CBDescIn
compName = argv[1]
compMethod = argv[2]
print "Parameters to this generic test script are:", argv[1:]
# Make an instance of the PySimpleClient
simpleClient = PySimpleClient()
comp = simpleClient.getComponent(compName)
myCB = CBvoid()
myCorbaCB = simpleClient.activateOffShoot(myCB)
myDescIn = CBDescIn(0L, 0L, 0L)
joe = eval("comp." + compMethod + "(myCorbaCB, myDescIn)")
print "Method executed...now just waiting on CB status"
for i in range(0, 50):
if myCB.status == 'DONE':
print "The callback has finished!"
break
else:
sleep(1)
示例11: PySimpleClient
# 需要导入模块: from Acspy.Clients.SimpleClient import PySimpleClient [as 别名]
# 或者: from Acspy.Clients.SimpleClient.PySimpleClient import getComponent [as 别名]
from Acspy.Clients.SimpleClient import PySimpleClient
from sys import argv
from sys import exit
from sys import stdout
from TMCDB import MonitorCollector
from TMCDB import propertySerailNumber
from omniORB import any
import MonitorErrImpl
import MonitorErr
import time
# Make an instance of the PySimpleClient
simpleClient = PySimpleClient()
mc = simpleClient.getComponent(argv[1])
try:
tc = simpleClient.getComponent('MC_TEST_PROPERTIES_COMPONENT')
psns =[propertySerailNumber('doubleROProp', ['1' ]),
propertySerailNumber('floatROProp', ['2' ]),
propertySerailNumber('longROProp', ['3' ]),
propertySerailNumber('uLongROProp', ['4' ]),
propertySerailNumber('patternROProp', ['5' ]),
propertySerailNumber('stringROProp', ['6' ]),
propertySerailNumber('longLongROProp', ['7' ]),
propertySerailNumber('uLongLongROProp', ['8' ]),
propertySerailNumber('booleanROProp', ['9' ]),
propertySerailNumber('doubleSeqROProp', ['10']),
propertySerailNumber('floatSeqROProp', ['11']),
propertySerailNumber('longSeqROProp', ['12']),
示例12: PySimpleClient
# 需要导入模块: from Acspy.Clients.SimpleClient import PySimpleClient [as 别名]
# 或者: from Acspy.Clients.SimpleClient.PySimpleClient import getComponent [as 别名]
from Acspy.Clients.SimpleClient import PySimpleClient
c = PySimpleClient()
tmcdb = c.getComponent('TMCDBAccess')
antenna_cai = {}
for i in range(1,25+1):
antenna = 'DV'+str(i).zfill(2)
# print "%s -> %s" % (antenna, tmcdb.getAntennaAcaCAI(antenna))
antenna_cai[tmcdb.getAntennaAcaCAI(antenna)] = antenna
for i in range(1,4+1):
antenna = 'PM'+str(i).zfill(2)
# print "%s -> %s" % (antenna, tmcdb.getAntennaAcaCAI(antenna))
antenna_cai[tmcdb.getAntennaAcaCAI(antenna)] = antenna
for i in range(1,12+1):
antenna = 'CM'+str(i).zfill(2)
# print "%s -> %s" % (antenna, tmcdb.getAntennaAcaCAI(antenna))
antenna_cai[tmcdb.getAntennaAcaCAI(antenna)] = antenna
for i in range(41,65+1):
antenna = 'DA'+str(i).zfill(2)
# print "%s -> %s" % (antenna, tmcdb.getAntennaAcaCAI(antenna))
antenna_cai[tmcdb.getAntennaAcaCAI(antenna)] = antenna
print "#################-----#############"
under = {}
upper = {}
for cai in sorted(antenna_cai):
# print "%s -> %s" % (cai, antenna_cai[cai])
if int(cai) <= 31:
if int(cai) == -1:
pass
示例13: exitGracefully
# 需要导入模块: from Acspy.Clients.SimpleClient import PySimpleClient [as 别名]
# 或者: from Acspy.Clients.SimpleClient.PySimpleClient import getComponent [as 别名]
"""
from Acspy.Clients.SimpleClient import PySimpleClient
import Acspy.Common.QoS as QofS
import sys
def exitGracefully(client):
client.releaseComponent("TEST_QOS_COMPONENT")
client.disconnect()
sys.exit()
# instantiate the simple client
mySimpleClient = PySimpleClient()
# get the test component used for the method invocations that we invoke to test timeouts
testQoSComponent = mySimpleClient.getComponent("TEST_QOS_COMPONENT")
# first, call method on the servant with no QoS timeout set
try:
testQoSComponent.echo(0, 1000)
print "Method w/o timeout executed successfully."
except Exception, e:
print "ERROR 0: timeout exception caught on method invocation when not expected."
exitGracefully(mySimpleClient)
# test setting/resetting of a (local) timeout and also test invocation of a method
# (with a timeout set) that doesn't exceed the time out
try:
timeoutOne = QofS.Timeout(400)
示例14: PySimpleClient
# 需要导入模块: from Acspy.Clients.SimpleClient import PySimpleClient [as 别名]
# 或者: from Acspy.Clients.SimpleClient.PySimpleClient import getComponent [as 别名]
#!/usr/bin/env python
from Acspy.Clients.SimpleClient import PySimpleClient
import sys
client = PySimpleClient()
supplier = client.getComponent('NC_Reliability')
supplier.sendEvents(int(sys.argv[1]))
示例15: str
# 需要导入模块: from Acspy.Clients.SimpleClient import PySimpleClient [as 别名]
# 或者: from Acspy.Clients.SimpleClient.PySimpleClient import getComponent [as 别名]
'''
global count
if count < 5:
count = count + 1
LOGGER.logInfo('The temperature difference is ' + str(someParam.absoluteDiff))
return
#------------------------------------------------------------------------------
if __name__ == "__main__":
print 'Making sure there is a fridge available...'
#Start publishing events through a C++ Supplier
simpleClient = PySimpleClient()
aFridge = simpleClient.getComponent("FRIDGE1")
aFridge.on()
#Create a FridgeConsumer
simpleClient.getLogger().logInfo('Creating FridgeConsumer')
g = Consumer(FRIDGE.CHANNELNAME_FRIDGE)
#Subscribe to temperatureDataBlockEvent events and register this handler to process
#those events
g.addSubscription(FRIDGE.temperatureDataBlockEvent, fridgeDataHandler)
#Let the Notification Service know we are ready to start processing events.
g.consumerReady()
#After five events have been received, disconnect from the channel
simpleClient.getLogger().logInfo("Waiting for events . . .")