class SimpleBACIComponent(perftest__POA.SimpleBACIComponent, BasePerfComp):
    #------------------------------------------------------------------------------
    def initialize(self):
        '''
        '''
        self.scheduler = Scheduler()

        addProperty(self, "property")
        return

    #------------------------------------------------------------------------------
    def action(self, cb, desc):
        '''
        void action(in ACS::CBvoid cb, in ACS::CBDescIn desc);
        '''
        self.scheduler.scheduleTimeout(self.actionImpl, 0, 0, (cb, desc))
        return

    #------------------------------------------------------------------------------
    def actionImpl(self, cb, desc):
        '''
        '''
        print "Aysnc. action finished"
        compl = Completion(
            long(getTimeStamp().value),  #unsigned long long timeStamp;
            0L,  #ACSErr::CompletionType type;
            0L,  #ACSErr::CompletionCode code;
            ())  #ErrorLinkedList  previousError;

        cb.done(compl, CBDescOut(0L, desc.id_tag))
        return
    def initialize(self):
        '''
        '''
        self.scheduler = Scheduler()

        addProperty(self, "property")
        return
class SimpleBACIComponent(perftest__POA.SimpleBACIComponent,
                          BasePerfComp):
    #------------------------------------------------------------------------------
    def initialize(self):
        '''
        '''
        self.scheduler = Scheduler()
        
        addProperty(self, "property")
        return
    #------------------------------------------------------------------------------
    def action(self, cb, desc):
        '''
        void action(in ACS::CBvoid cb, in ACS::CBDescIn desc);
        '''
        self.scheduler.scheduleTimeout(self.actionImpl,
                                       0,
                                       0,
                                       (cb, desc))
        return
    #------------------------------------------------------------------------------
    def actionImpl(self, cb, desc):
        '''
        '''
        print "Aysnc. action finished"
        compl = Completion(long(getTimeStamp().value),  #unsigned long long timeStamp;
                           0L,  #ACSErr::CompletionType type;
                           0L,  #ACSErr::CompletionCode code;
                           ())  #ErrorLinkedList  previousError;
        
        cb.done(compl, CBDescOut(0L, desc.id_tag))
        return
 def initialize(self):
     '''
     '''
     self.scheduler = Scheduler()
     
     addProperty(self, "property")
     return
 def initialize(self):
     '''
     '''
     self.scheduler = Scheduler()
     
     addProperty(self, "property01")
     addProperty(self, "property02")
     addProperty(self, "property03")
     addProperty(self, "property04")
     addProperty(self, "property05")
     addProperty(self, "property06")
     addProperty(self, "property07")
     addProperty(self, "property08")
     addProperty(self, "property09")
     addProperty(self, "property10")
     addProperty(self, "property11")
     addProperty(self, "property12")
     addProperty(self, "property13")
     addProperty(self, "property14")
     addProperty(self, "property15")
     addProperty(self, "property16")
     return
Exemple #6
0
from random import randrange
from time import sleep
#--CORBA STUBS-----------------------------------------------------------------

#--ACS Imports-----------------------------------------------------------------
from Acssim.Goodies import supplyEventByType, supplyEventByInstance
from Acspy.Util.Scheduler import Scheduler
from Acssim.Goodies import getComponentXMLObj
from Acssim.Goodies import getCompLocalNSList
from Acssim.Corba.Utilities import listToCodeObj
from Acspy.Common.Log import getLogger
from Acspy.Common.Log import acsPrintExcDebug
from Acspy.Nc.Consumer import Consumer
#--GLOBALS---------------------------------------------------------------------
#a single scheduler will publish all events
SCHEDULER = Scheduler()


#------------------------------------------------------------------------------
class EventDispatcher:
    '''
    EventDispatcher dispatches events at given frequencies and also sends
    events in reponse to receiving an event of a particular type.
    '''
    def __init__(self, comp_ref):
        '''
        Constructor
        
        Parameters: comp_ref - reference to the component
        
        Raises: ???
class ComplexBACIComponent(perftest__POA.ComplexBACIComponent,
                           BasePerfComp):
    #------------------------------------------------------------------------------
    def initialize(self):
        '''
        '''
        self.scheduler = Scheduler()
        
        addProperty(self, "property01")
        addProperty(self, "property02")
        addProperty(self, "property03")
        addProperty(self, "property04")
        addProperty(self, "property05")
        addProperty(self, "property06")
        addProperty(self, "property07")
        addProperty(self, "property08")
        addProperty(self, "property09")
        addProperty(self, "property10")
        addProperty(self, "property11")
        addProperty(self, "property12")
        addProperty(self, "property13")
        addProperty(self, "property14")
        addProperty(self, "property15")
        addProperty(self, "property16")
        return
    #------------------------------------------------------------------------------
    def action01(self, cb, desc):
        '''
        void action01(in ACS::CBvoid cb, in ACS::CBDescIn desc);
        '''
        self.scheduler.scheduleTimeout(self.actionImpl,
                                       0,
                                       0,
                                       (cb, desc))
        return
    #------------------------------------------------------------------------------
    def action02(self, cb, desc):
        '''
        void action02(in ACS::CBvoid cb, in ACS::CBDescIn desc);
        '''
        self.scheduler.scheduleTimeout(self.actionImpl,
                                       0,
                                       0,
                                       (cb, desc))
        return
    #------------------------------------------------------------------------------
    def action03(self, cb, desc):
        '''
        void action03(in ACS::CBvoid cb, in ACS::CBDescIn desc);
        '''
        self.scheduler.scheduleTimeout(self.actionImpl,
                                       0,
                                       0,
                                       (cb, desc))
        return
    #------------------------------------------------------------------------------
    def action04(self, cb, desc):
        '''
        void action04(in ACS::CBvoid cb, in ACS::CBDescIn desc);
        '''
        self.scheduler.scheduleTimeout(self.actionImpl,
                                       0,
                                       0,
                                       (cb, desc))
        return
    #------------------------------------------------------------------------------
    def action05(self, cb, desc):
        '''
        void action05(in ACS::CBvoid cb, in ACS::CBDescIn desc);
        '''
        self.scheduler.scheduleTimeout(self.actionImpl,
                                       0,
                                       0,
                                       (cb, desc))
        return
    #------------------------------------------------------------------------------
    def action06(self, cb, desc):
        '''
        void action(in ACS::CBvoid cb, in ACS::CBDescIn desc);
        '''
        self.scheduler.scheduleTimeout(self.actionImpl,
                                       0,
                                       0,
                                       (cb, desc))
        return
    #------------------------------------------------------------------------------
    def action07(self, cb, desc):
        '''
        void action(in ACS::CBvoid cb, in ACS::CBDescIn desc);
        '''
        self.scheduler.scheduleTimeout(self.actionImpl,
                                       0,
                                       0,
                                       (cb, desc))
        return
    #------------------------------------------------------------------------------
    def action08(self, cb, desc):
        '''
        void action(in ACS::CBvoid cb, in ACS::CBDescIn desc);
        '''
        self.scheduler.scheduleTimeout(self.actionImpl,
                                       0,
                                       0,
                                       (cb, desc))
        return
    #------------------------------------------------------------------------------
    def action09(self, cb, desc):
        '''
        void action(in ACS::CBvoid cb, in ACS::CBDescIn desc);
        '''
        self.scheduler.scheduleTimeout(self.actionImpl,
                                       0,
                                       0,
                                       (cb, desc))
        return
    #------------------------------------------------------------------------------
    def action10(self, cb, desc):
        '''
        void action(in ACS::CBvoid cb, in ACS::CBDescIn desc);
        '''
        self.scheduler.scheduleTimeout(self.actionImpl,
                                       0,
                                       0,
                                       (cb, desc))
        return
    #------------------------------------------------------------------------------
    def action11(self, cb, desc):
        '''
        void action(in ACS::CBvoid cb, in ACS::CBDescIn desc);
        '''
        self.scheduler.scheduleTimeout(self.actionImpl,
                                       0,
                                       0,
                                       (cb, desc))
        return
    #------------------------------------------------------------------------------
    def action12(self, cb, desc):
        '''
        void action(in ACS::CBvoid cb, in ACS::CBDescIn desc);
        '''
        self.scheduler.scheduleTimeout(self.actionImpl,
                                       0,
                                       0,
                                       (cb, desc))
        return
    #------------------------------------------------------------------------------
    def action13(self, cb, desc):
        '''
        void action(in ACS::CBvoid cb, in ACS::CBDescIn desc);
        '''
        self.scheduler.scheduleTimeout(self.actionImpl,
                                       0,
                                       0,
                                       (cb, desc))
        return
    #------------------------------------------------------------------------------
    def action14(self, cb, desc):
        '''
        void action(in ACS::CBvoid cb, in ACS::CBDescIn desc);
        '''
        self.scheduler.scheduleTimeout(self.actionImpl,
                                       0,
                                       0,
                                       (cb, desc))
        return
    #------------------------------------------------------------------------------
    def action15(self, cb, desc):
        '''
        void action(in ACS::CBvoid cb, in ACS::CBDescIn desc);
        '''
        self.scheduler.scheduleTimeout(self.actionImpl,
                                       0,
                                       0,
                                       (cb, desc))
        return
    #------------------------------------------------------------------------------
    def action16(self, cb, desc):
        '''
        void action(in ACS::CBvoid cb, in ACS::CBDescIn desc);
        '''
        self.scheduler.scheduleTimeout(self.actionImpl,
                                       0,
                                       0,
                                       (cb, desc))
        return
    #------------------------------------------------------------------------------
    def actionImpl(self, cb, desc):
        '''
        '''
        print "Aysnc. action finished"
        compl = Completion(long(getTimeStamp().value),  #unsigned long long timeStamp;
                           0L,  #ACSErr::CompletionType type;
                           0L,  #ACSErr::CompletionCode code;
                           ())  #ErrorLinkedList  previousError;
        
        cb.done(compl, CBDescOut(0L, desc.id_tag))
        return
Exemple #8
0
from CORBA import NO_IMPLEMENT
from ACSErr import Completion
from ACS import CBDescOut
from ACSErrTypeCommonImpl import CouldntAccessPropertyCompletionImpl
#--ACS Imports-----------------------------------------------------------------
from ACSImpl.CharacteristicModel import CharacteristicModel
from Acspy.Common.CDBAccess import CDBaccess
from ACSImpl.DevIO import DevIO
from Acspy.Common.TimeHelper import getTimeStamp
from Acspy.Util.Scheduler import Scheduler
from Acspy.Util.XmlObjectifier import XmlObject
#--GLOBALS---------------------------------------------------------------------

#------------------------------------------------------------------------------
#Scheduler which is responsible for handling monitors/alarms
GLOBAL_SCHEDULER = Scheduler()


class Property(CharacteristicModel):
    '''
    Properties can be derived from Property only if their IDL derives from
    ACS::Property.
    '''

    #--------------------------------------------------------------------------
    def __init__(self, name, charCompRef):
        '''
        Constructor

        Params:
        - name is the quite literally the name of the property