Exemple #1
0
    def __init__(self, compname, supported_interfaces):
        '''
        Constructor.

        Paramters:
        - compname is the name of the component being simulated
        - supported_interfaces is an optional list of IDL interfaces which 
        this particular component supports.
        
        Returns: Nothing

        Raises: ???
        '''
        #superclass constructor
        BaseRepresentation.__init__(self, compname)

        #setup the logger
        self.__logger = getLogger(str(CDB) + "(" + compname + ")")

        #bool value showing whether the CDB entry exists or not
        self.exists = 0

        #determine if this simulated component allows inheritence
        allows_inheritence = self.handleCDB(compname)

        if allows_inheritence:
            #look at all supported IDL interfaces first
            self.handleInterfaces(supported_interfaces)

        #add this individual component one more time to override
        #anything defined in the subinterfaces. this is necessary if
        #the component is of type IDL:alma/x/y:1.0 and this entry
        #exists in the CDB
        self.handleCDB(compname)
Exemple #2
0
    def __init__ (self, compname, supported_interfaces):
        '''
        Constructor.

        Paramters:
        - compname is the name of the component being simulated
        - supported_interfaces is an optional list of IDL interfaces which 
        this particular component supports.
        
        Returns: Nothing

        Raises: ???
        '''
        #superclass constructor
        BaseRepresentation.__init__(self, compname)
        
        #setup the logger
        self.__logger = getLogger(str(CDB) + "(" + compname + ")")
        
        #bool value showing whether the CDB entry exists or not
        self.exists=0
        
        #determine if this simulated component allows inheritence
        allows_inheritence = self.handleCDB(compname)
        
        if allows_inheritence:
            #look at all supported IDL interfaces first
            self.handleInterfaces(supported_interfaces)
            
        #add this individual component one more time to override
        #anything defined in the subinterfaces. this is necessary if
        #the component is of type IDL:alma/x/y:1.0 and this entry
        #exists in the CDB
        self.handleCDB(compname)
Exemple #3
0
 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
Exemple #4
0
    def __init__(self, compname):
        '''
        Constructor.
        
        Parameters:
        - compname is the name of the component to be simulated

        Returns: Nothing

        Raises: Nothing
        '''
        BaseRepresentation.__init__(self, compname)
Exemple #5
0
 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
Exemple #6
0
    def __init__(self, compname):
        '''
        Constructor.
        
        Parameters:
        - compname is the name of the component to be simulated

        Returns: Nothing

        Raises: Nothing
        '''
        BaseRepresentation.__init__(self, compname)
Exemple #7
0
    def __init__ (self, compname, comptype):
        '''
        Constructor
        '''
        #superclass constructor
        BaseRepresentation.__init__(self, compname)
        
        self.__logger = getLogger(str(Dynamic) + "(" + compname + ")")

        #---------------------------------------------------------------------
        def __initialize(args):
            '''
            Fake lifecycle method.
            '''
            self.__logger.logDebug("Simulated lifecyle method")
            return
    
        def __cleanUp(args):
            '''
            Fake lifecycle method.
            '''
            self.__logger.logDebug("Simulated lifecyle method")
            return
        
        self.setMethod('initialize',
                        {'Timeout' : 0.0,
                          'Value' : __initialize}
                       )
        
        self.setMethod('cleanUp',
                        {'Timeout' : 0.0,
                          'Value' : __cleanUp}
                       )

        #save the IDL type
        self.comp_type = comptype

        self.__interf = IR.lookup_id(comptype)
        try:
            self.__interf = self.__interf._narrow(CORBA.InterfaceDef)
            self.__interf = self.__interf.describe_interface()
        except Exception, ex:
            self.__logger.logCritical("Cannot find a definition for '" +
                                       self.comp_type + "' components!")
            raise CORBA.NO_RESOURCES()
Exemple #8
0
    def __init__(self, compname, comptype):
        '''
        Constructor
        '''
        #superclass constructor
        BaseRepresentation.__init__(self, compname)

        self.__logger = getLogger(str(Dynamic) + "(" + compname + ")")

        #---------------------------------------------------------------------
        def __initialize(args):
            '''
            Fake lifecycle method.
            '''
            self.__logger.logDebug("Simulated lifecyle method")
            return

        def __cleanUp(args):
            '''
            Fake lifecycle method.
            '''
            self.__logger.logDebug("Simulated lifecyle method")
            return

        self.setMethod('initialize', {'Timeout': 0.0, 'Value': __initialize})

        self.setMethod('cleanUp', {'Timeout': 0.0, 'Value': __cleanUp})

        #save the IDL type
        self.comp_type = comptype

        self.__interf = IR.lookup_id(comptype)
        try:
            self.__interf = self.__interf._narrow(CORBA.InterfaceDef)
            self.__interf = self.__interf.describe_interface()
        except Exception, ex:
            self.__logger.logCritical("Cannot find a definition for '" +
                                      self.comp_type + "' components!")
            raise CORBA.NO_RESOURCES()
 def __init__(self):
     BaseRepresentation.__init__(self, "HELLOWORLD1")
     self.setMethod("displayMessage", {"nonempty": "constructor"})
 def __init__(self):
     BaseRepresentation.__init__(self, "HELLOWORLD1")
     self.setMethod("displayMessage", { "nonempty" : "constructor"})