当前位置: 首页>>代码示例>>Python>>正文


Python PySimpleClient.availableComponents方法代码示例

本文整理汇总了Python中Acspy.Clients.SimpleClient.PySimpleClient.availableComponents方法的典型用法代码示例。如果您正苦于以下问题:Python PySimpleClient.availableComponents方法的具体用法?Python PySimpleClient.availableComponents怎么用?Python PySimpleClient.availableComponents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Acspy.Clients.SimpleClient.PySimpleClient的用法示例。


在下文中一共展示了PySimpleClient.availableComponents方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_mgr_instance

# 需要导入模块: from Acspy.Clients.SimpleClient import PySimpleClient [as 别名]
# 或者: from Acspy.Clients.SimpleClient.PySimpleClient import availableComponents [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
开发者ID:normansaez,项目名称:scripts,代码行数:24,代码来源:getCanAntennaStatus.py

示例2: PySimpleClient

# 需要导入模块: from Acspy.Clients.SimpleClient import PySimpleClient [as 别名]
# 或者: from Acspy.Clients.SimpleClient.PySimpleClient import availableComponents [as 别名]
from Acspy.Util import ACSCorba
import CDB
import xml.dom.minidom
import datetime
import numpy as np

from Acspy.Clients.SimpleClient import PySimpleClient
client = PySimpleClient()
all_comp = client.availableComponents()
#
# DAL
#
dal = ACSCorba.cdb()
#
# WDAL
#
cdb_obj = ACSCorba.getClient().getService('CDB')
dal_ = cdb_obj._narrow(CDB.WDAL)

prof = {}
prof_wdal = {}
for comp in all_comp:
    print comp.name
    curl = "MACI/Components/"+comp.name
    #
    # DAO
    #
    t0 = datetime.datetime.utcnow()
    xmlstring = dal.get_DAO(curl)
    t1 = datetime.datetime.utcnow()
    delta = (t1 - t0)#.total_seconds()
开发者ID:normansaez,项目名称:scripts,代码行数:33,代码来源:cdbTest.py

示例3: PySimpleClient

# 需要导入模块: from Acspy.Clients.SimpleClient import PySimpleClient [as 别名]
# 或者: from Acspy.Clients.SimpleClient.PySimpleClient import availableComponents [as 别名]
parser.add_option("--levelMax", dest="levelMax", type=float, default=5.0,
    help="White level in dBm for when not using fullscale option [default 5.0] (note optimal levels for TDM and FDM observations are 3.8 and 2.4 dBm respectively, so if you go below these expect to white-out a lot!)")

parser.add_option("--levelMin", dest="levelMin", type=float, default=-2.0, 
    help="Black level in dBm for when not using fullscale option [default -2.0]")

(options, args) = parser.parse_args()

print 'finding configured antennas'


# get_configured_antennas:
if options.antennaList == 'All':
    from Acspy.Clients.SimpleClient import PySimpleClient
    client = PySimpleClient("ping_abm")
    ant_info = client.availableComponents(type_wildcard='IDL:alma/Control/Antenna:1.0', activated=1)
    availableAnts = []
    notAvailableAntennas = []
    if len(ant_info) > 0:
    	for antenna_info in ant_info:
	    try:
		name = antenna_info.name
		antenna = client.getComponentNonSticky(antenna_info.name)
		name.split('/')
		antName = name.split('/')[1]
                sys.stdout.write(antName+'\r')
#                sys.stdout.flush()
                print antName
                if str(antenna.getState())=="Shutdown":
                    notAvailableAntennas.append(antenna[1])                
		if str(antenna.getState())!="Shutdown":
开发者ID:normansaez,项目名称:scripts,代码行数:33,代码来源:tp.py

示例4: PySimpleClient

# 需要导入模块: from Acspy.Clients.SimpleClient import PySimpleClient [as 别名]
# 或者: from Acspy.Clients.SimpleClient.PySimpleClient import availableComponents [as 别名]
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# Lesser General Public License for more details.
# 
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
#
# "@(#) $Id$"
#
# who       when      what
# --------  --------  ----------------------------------------------
# nsaez  2010-08-26  created
#

#!/usr/bin/env python
from CCL.ArrayTime import ArrayTime
from CCL.TimeSource import TimeSource
from CCL.CRD import CRD
from CCL.IFProc import IFProc
import optparse
import time
from Acspy.Clients.SimpleClient import PySimpleClient

    client = PySimpleClient()
    #getting array_time actives
    arrays_time= client.availableComponents(type_wildcard='*ArrayTime*', activated=1)

#
# ___oOo___
开发者ID:normansaez,项目名称:scripts,代码行数:32,代码来源:isAcdSimulated.py

示例5: Accessing

# 需要导入模块: from Acspy.Clients.SimpleClient import PySimpleClient [as 别名]
# 或者: from Acspy.Clients.SimpleClient.PySimpleClient import availableComponents [as 别名]
- Accessing (remote) components.
- Manipulating BACI properties

LINKS
- <li><a href="../../idl/html/interfaceMOUNT_ACS_1_1Mount.html">Mount IDL Documentation</a>
'''

# Import the acspy.PySimpleClient class
from Acspy.Clients.SimpleClient import PySimpleClient


# Make an instance of the PySimpleClient
simpleClient = PySimpleClient()

# Print information about the available COBs
components = simpleClient.availableComponents()

simpleClient.getLogger().logInfo("COBs available are: ")
for cob in components:
    simpleClient.getLogger().logInfo(cob.name + " of type " + cob.type)

# Do something on a device.
simpleClient.getLogger().logInfo("We can directly manipulate a device once we get it, which is easy.")
try:
    # Get the standard MOUNT1 Mount device
    mount = simpleClient.getComponent("MOUNT1")

    # Get the actAz property
    actAzProperty = mount._get_actAz()

    # Ask the current value of the property
开发者ID:ACS-Community,项目名称:ACS,代码行数:33,代码来源:acspyexmplMountClient.py

示例6: PySimpleClient

# 需要导入模块: from Acspy.Clients.SimpleClient import PySimpleClient [as 别名]
# 或者: from Acspy.Clients.SimpleClient.PySimpleClient import availableComponents [as 别名]
to access an ACS DO from a Python program
"""

from Acspy.Clients.SimpleClient import PySimpleClient

# Make an instance of the PySimpleClient
simpleClient = PySimpleClient()

# Get the standard MOUNT1 Mount device
mount = simpleClient.getComponent("MOUNT1")

# Get the actAz property and print it out
print "MOUNT1 actual azimuth: ", mount._get_actAz().get_sync()[0]

# See what's available
components = [ c.name for c in simpleClient.availableComponents() ]
components.sort()
print "Available components: ", components

from ACS__POA import OffShoot

class MyOffShoot(OffShoot):
    pass

simpleClient.activateOffShoot(MyOffShoot())

#cleanly disconnect
simpleClient.releaseComponent("MOUNT1")
simpleClient.disconnect()

print "The end __oOo__"
开发者ID:ACS-Community,项目名称:ACS,代码行数:33,代码来源:acspyTestClientMinimum.py


注:本文中的Acspy.Clients.SimpleClient.PySimpleClient.availableComponents方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。