Ejemplo n.º 1
0
    def __init__(self, name, charCompRef, devIORef):
        '''
        Constructor

        Params:
        - name is the quite literally the name of the property
        - charCompRef is the characteristic component object which contains this
        property
        - devIORef is a reference to a DevIO to be used with this property

        Returns: Nothing

        Raises: Nothing.
        '''
        #------------------------------------------------------------------------------
        #determine the real type of the BACI property using the IFR
        #First determine the property's name
        self.enumIFRName = None

        IR = interfaceRepository()
        interf = IR.lookup_id(self._NP_RepositoryId)

        #determine the underlying enumeration type
        for attr in interf._narrow(
                CORBA.InterfaceDef).describe_interface().attributes:
            #we can use the default_value to get at an instance of the real enumeration
            if attr.name == "default_value":
                #ifr name of the enum
                self.enumIFRName = attr.type.id()
                break

        #determine the IDL type
        self.enumName = self.enumIFRName.split(':')[1].split('/')[1:]
        self.modName = self.enumName[0]

        #convert the list to a stringified Python package structure which can
        #be used with eval
        self.enumName = reduce((lambda x, y: str(x) + '.' + str(y)),
                               self.enumName)

        #now comes the complicated part...importing the correct CORBA stub
        #without polluting the local namespace...
        self.tGlobals = {}
        self.tLocals = {}
        exec "import " + self.modName in self.tGlobals, self.tLocals

        GenericProperty.__init__(self, name, charCompRef, devIORef)

        return
Ejemplo n.º 2
0
    def __init__(self, name, charCompRef, devIORef):
        '''
        Constructor

        Params:
        - name is the quite literally the name of the property
        - charCompRef is the characteristic component object which contains this
        property
        - devIORef is a reference to a DevIO to be used with this property

        Returns: Nothing

        Raises: Nothing.
        '''
        GenericProperty.__init__(self, name, charCompRef, devIORef)
Ejemplo n.º 3
0
    def __init__(self, name, charCompRef, devIORef):
        '''
        Constructor

        Params:
        - name is the quite literally the name of the property
        - charCompRef is the characteristic component object which contains this
        property
        - devIORef is a reference to a DevIO to be used with this property

        Returns: Nothing

        Raises: Nothing.
        '''
        GenericProperty.__init__(self, name, charCompRef, devIORef)
Ejemplo n.º 4
0
    def __init__(self, name, charCompRef, devIORef):
        """
        Constructor

        Params:
        - name is the quite literally the name of the property
        - charCompRef is the characteristic component object which contains this
        property
        - devIORef is a reference to a DevIO to be used with this property

        Returns: Nothing

        Raises: Nothing.
        """
        # ------------------------------------------------------------------------------
        # determine the real type of the BACI property using the IFR
        # First determine the property's name
        self.enumIFRName = None

        IR = interfaceRepository()
        interf = IR.lookup_id(self._NP_RepositoryId)

        # determine the underlying enumeration type
        for attr in interf._narrow(CORBA.InterfaceDef).describe_interface().attributes:
            # we can use the default_value to get at an instance of the real enumeration
            if attr.name == "default_value":
                # ifr name of the enum
                self.enumIFRName = attr.type.id()
                break

        # determine the IDL type
        self.enumName = self.enumIFRName.split(":")[1].split("/")[1:]
        self.modName = self.enumName[0]

        # convert the list to a stringified Python package structure which can
        # be used with eval
        self.enumName = reduce((lambda x, y: str(x) + "." + str(y)), self.enumName)

        # now comes the complicated part...importing the correct CORBA stub
        # without polluting the local namespace...
        self.tGlobals = {}
        self.tLocals = {}
        exec "import " + self.modName in self.tGlobals, self.tLocals

        GenericProperty.__init__(self, name, charCompRef, devIORef)

        return
Ejemplo n.º 5
0
 def get_sync(self):
     '''
     Overriden.
     '''
     retVal = list(GenericProperty.get_sync(self))
     try:
         retVal[0] = list(retVal[0])
     except:
         retVal[0] = [retVal[0]]
     return tuple(retVal)