Exemplo n.º 1
0
 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
Exemplo n.º 2
0
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()
Exemplo n.º 3
0
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":
Exemplo n.º 4
0
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()
Exemplo n.º 5
0
# 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___
Exemplo n.º 6
0
- 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
Exemplo n.º 7
0
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__"
Exemplo n.º 8
0
- Using manager to dynamically determine what components are available.
- 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()