def superClasses(softpkg):
        # Start with the superclasses from the pull mapping, overriding only
        # what's different for FRONTEND devices
        classes = PullComponentMapper.superClasses(softpkg)

        # Only plain devices are supported for FRONTEND
        if softpkg.type() == ComponentTypes.DEVICE:
            deviceinfo = FrontendComponentMapper.getImplementedInterfaces(
                softpkg)
            # If this device is any type of tuner, replace the Device_impl base
            # class with the FRONTEND-specific tuner device class
            if 'FrontendTuner' in deviceinfo:
                for parent in classes:
                    if parent['name'] == 'Device_impl':
                        parent[
                            'name'] = 'frontend::FrontendTunerDevice<frontend_tuner_status_struct_struct>'
                        parent['header'] = '<frontend/frontend.h>'

                    # Set the parent to scanner if needed
                    if 'DigitalScanningTuner' in deviceinfo or 'AnalogScanningTuner' in deviceinfo:
                        if parent[
                                'name'] == 'frontend::FrontendTunerDevice<frontend_tuner_status_struct_struct>':
                            parent[
                                'name'] = 'frontend::FrontendScanningTunerDevice<frontend_tuner_status_struct_struct>'

        return classes
    def _mapComponent(self, softpkg):
        '''
        Extends the pull mapper _mapComponent method by defining the
        'mFunction' and 'license' key/value pairs to the component dictionary.

        '''

        component = PullComponentMapper._mapComponent(self, softpkg)

        mFunction = None
        for prop in softpkg.properties():
            if str(prop.identifier()) == "__mFunction":
                mFunction = prop.value()
                break

        if mFunction:
            # point towards the m file that has been copied
            # to the implementation directory
            mFilePath = os.path.join(softpkg.path(), self._outputdir, mFunction+".m")
            parameters = mfile.parse(mFilePath)
            name = parameters.functionName
            inputs = parameters.inputs
            outputs = parameters.outputs
        else:
            name = ""
            inputs = []
            outputs = []

        component['mFunction'] = {'name'      : name,
                                  'inputs'    : inputs,
                                  'numInputs' : len(inputs),
                                  'outputs'   : outputs}
        component['license'] = "GPL"

        return component
Exemple #3
0
 def _mapComponent(self, softpkg):
     cppcomp = PullComponentMapper._mapComponent(self, softpkg)
     cppcomp['programmable'] = True
     cppcomp['reprogclass'] = self.reprogClass(softpkg)
     cppcomp['executesHWComponents'] = False # TODO: Implement this 
     self._validateAggregateDevice(cppcomp)
     return cppcomp
Exemple #4
0
    def superClasses(softpkg):
        # Start with the superclasses from the pull mapping, overriding only
        # what's different for FRONTEND devices
        classes = PullComponentMapper.superClasses(softpkg)

        # Only plain devices are supported for FRONTEND
        if softpkg.type() == ComponentTypes.DEVICE:
            deviceinfo = FrontendComponentMapper.getImplementedInterfaces(
                softpkg)
            # If this device is any type of tuner, replace the Device_impl base
            # class with the FRONTEND-specific tuner device class
            if 'FrontendTuner' in deviceinfo:
                for parent in classes:
                    if parent['name'] == 'Device_impl':
                        parent[
                            'name'] = 'frontend::FrontendTunerDevice<frontend_tuner_status_struct_struct>'
                        parent['header'] = '<frontend/frontend.h>'

                # Add the most specific tuner delegate interface:
                #   (Digital > Analog > Frontend)
                if 'DigitalTuner' in deviceinfo:
                    classes.append({
                        'name': 'virtual frontend::digital_tuner_delegation',
                        'header': ''
                    })
                elif 'AnalogTuner' in deviceinfo:
                    classes.append({
                        'name': 'virtual frontend::analog_tuner_delegation',
                        'header': ''
                    })
                else:
                    classes.append({
                        'name': 'virtual frontend::frontend_tuner_delegation',
                        'header': ''
                    })

            # Add additonal FRONTEND delegate interfaces
            if 'RFInfo' in deviceinfo:
                classes.append({
                    'name': 'virtual frontend::rfinfo_delegation',
                    'header': ''
                })
            if 'RFSource' in deviceinfo:
                classes.append({
                    'name': 'virtual frontend::rfsource_delegation',
                    'header': ''
                })
            if 'GPS' in deviceinfo:
                classes.append({
                    'name': 'virtual frontend::gps_delegation',
                    'header': ''
                })
            if 'NavData' in deviceinfo:
                classes.append({
                    'name': 'virtual frontend::nav_delegation',
                    'header': ''
                })

        return classes
    def superClasses(softpkg):
        # Start with the superclasses from the pull mapping, overriding only
        # what's different for FRONTEND devices
        classes = PullComponentMapper.superClasses(softpkg)

        # Only plain devices are supported for FRONTEND
        if softpkg.type() == ComponentTypes.DEVICE:
            deviceinfo = FrontendComponentMapper.getImplementedInterfaces(softpkg)
            # If this device is any type of tuner, replace the Device_impl base
            # class with the FRONTEND-specific tuner device class
            if 'FrontendTuner' in deviceinfo:
                for parent in classes:
                    if parent['name'] == 'Device_impl':
                        parent['name'] = 'frontend::FrontendTunerDevice<frontend_tuner_status_struct_struct>'
                        parent['header'] = '<frontend/frontend.h>'

                # Add the most specific tuner delegate interface:
                #   (Digital > Analog > Frontend)
                if 'DigitalTuner' in deviceinfo:
                    classes.append({'name': 'virtual frontend::digital_tuner_delegation', 'header': ''})
                elif 'AnalogTuner' in deviceinfo:
                    classes.append({'name': 'virtual frontend::analog_tuner_delegation', 'header': ''})
                else:
                    classes.append({'name': 'virtual frontend::frontend_tuner_delegation', 'header': ''})

            # Add additonal FRONTEND delegate interfaces
            if 'RFInfo' in deviceinfo:
                classes.append({'name': 'virtual frontend::rfinfo_delegation', 'header': ''})
            if 'RFSource' in deviceinfo:
                classes.append({'name': 'virtual frontend::rfsource_delegation', 'header': ''})
            if 'GPS' in deviceinfo:
                classes.append({'name': 'virtual frontend::gps_delegation', 'header': ''})
            if 'NavData' in deviceinfo:
                classes.append({'name': 'virtual frontend::nav_delegation', 'header': ''})

        return classes
 def _mapComponent(self, softpkg):
     cppcomp = PullComponentMapper._mapComponent(self, softpkg)
     cppcomp['reprogclass'] = self.reprogClass(softpkg)
     cppcomp['executesHWComponents'] = False # TODO: Implement this 
     self._validateAggregateDevice(cppcomp)
     return cppcomp
 def __init__(self, outputdir):
     PullComponentMapper.__init__(self)
     self._outputdir = outputdir
 def _mapComponent(self, softpkg):
     cppcomp = PullComponentMapper._mapComponent(self, softpkg)
     cppcomp['reprogclass'] = self.reprogClass(softpkg)
     return cppcomp
 def _mapComponent(self, softpkg):
     cppcomp = PullComponentMapper._mapComponent(self, softpkg)
     cppcomp['reprogclass'] = self.reprogClass(softpkg)
     return cppcomp