def setTunerCenterFrequency(self, allocation_id, freq):
        idx = self.getTunerMapping(allocation_id)
        if idx < 0: raise FRONTEND.FrontendException("Invalid allocation id")
        if allocation_id != self.getControlAllocationId(idx):
            raise FRONTEND.FrontendException(
                ("ID " + str(allocation_id) +
                 " does not have authorization to modify the tuner"))
        if freq < 0: raise FRONTEND.BadParameterException("Bad CF")
        # set hardware to new value. Raise an exception if it's not possible

        #Check Frequency again min/max Range
        #Convert CF based on RFInfo.
        tuneFreq = self.convert_rf_to_if(freq)

        # Check the CF
        if not (validateRequestSingle(self.MINFREQ, self.MAXFREQ, tuneFreq)):
            self._log.debug("Center Freq Does not fit %s, %s, %s" %
                            (tuneFreq, self.MINFREQ, self.MAXFREQ))
            raise FRONTEND.BadParameterException(
                "Radio Center Freq of %s Does not fit in %s, %s" %
                (tuneFreq, self.MINFREQ, self.MAXFREQ))

        #set tuner new freq
        self.datagenerators[idx].cf = tuneFreq
        self.datagenerators[idx].keyword_dict['COL_RF'] = freq
        self.datagenerators[idx].keyword_dict['CHAN_RF'] = freq
        self.datagenerators[idx].updateandPushSRI()
        self.frontend_tuner_status[idx].center_frequency = freq
Beispiel #2
0
 def testRFInfo(self):
     _port = None
     for port in self.comp.ports:
         if port.name == 'RFInfo_in':
             _port = port
             break
     _antennainfo = FRONTEND.AntennaInfo('testAnt', 'testType', 'testSize',
                                         'testDescription')
     _freqrange = FRONTEND.FreqRange(0, 100, [1])
     _feedinfo = FRONTEND.FeedInfo('testFeed', 'testPol', _freqrange)
     _sensorinfo = FRONTEND.SensorInfo('testMission', 'testCollector',
                                       'testRX', _antennainfo, _feedinfo)
     _pathdelays = [
         FRONTEND.PathDelay(100, 200),
         FRONTEND.PathDelay(300, 400)
     ]
     _rfcapabilities = FRONTEND.RFCapabilities(FRONTEND.FreqRange(1, 2, []),
                                               FRONTEND.FreqRange(3, 4, []))
     _additionalinfo = [
         CF.DataType(id='a', value=any.to_any(1)),
         CF.DataType(id='b', value=any.to_any(2)),
         CF.DataType(id='c', value=any.to_any(3))
     ]
     _rfinfopkt = FRONTEND.RFInfoPkt('TestID', 256.0, 101.0, 412.0, False,
                                     _sensorinfo, _pathdelays,
                                     _rfcapabilities, _additionalinfo)
     _port.ref._set_rfinfo_pkt(_rfinfopkt)
 def setTunerEnable(self, allocation_id, enable):
     idx = self.getTunerMapping(allocation_id)
     if idx < 0: raise FRONTEND.FrontendException("Invalid allocation id")
     if allocation_id != self.getControlAllocationId(idx):
         raise FRONTEND.FrontendException(
             ("ID " + str(allocation_id) +
              " does not have authorization to modify the tuner"))
     # set hardware to new value. Raise an exception if it's not possible
     self.frontend_tuner_status[idx].enabled = enable
 def fe_setTunerEnable(self, alloc_id, enable):
     tuner_id = self.getTunerMapping(alloc_id)
     if tuner_id < 0:
         raise  FRONTEND.FrontendException("ERROR: ID: %s IS NOT ASSOCIATED WITH ANY TUNER!"%(alloc_id))
     if alloc_id != self.tunerChannels[tuner_id].control_allocation_id:
         raise  FRONTEND.FrontendException("ERROR: ID: %s DOES NOT HAVE AUTHORIZATION TO MODIFY TUNER!"%(alloc_id))
     try:
         self.enableTuner(tuner_id, enable)
     except Exception, e:
         raise  FRONTEND.FrontendException("WARNING: Exception Caught during enableTuner: %s"%(e))
 def setTunerGain(self, allocation_id, gain):
     idx = self.getTunerMapping(allocation_id)
     if idx < 0: raise FRONTEND.FrontendException("Invalid allocation id")
     if allocation_id != self.getControlAllocationId(idx):
         raise FRONTEND.FrontendException(
             ("ID " + str(allocation_id) +
              " does not have authorization to modify the tuner"))
     if (gain < 0 or gain > 10):
         raise FRONTEND.BadParameterException("Invalid Gain")
     gain = round(gain, 1)
     # magnitude on data generators is 100+gain*10
     self.datagenerators[idx].magnitude = 100 + gain * 10
     self.frontend_tuner_status[idx].gain = gain
def validateRequestVsDevice(request, upstream_sri, max_device_frame_rate):

    # check if request can be satisfied using the available upstream data
    if not validateRequestVsSRI(request, upstream_sri):
        raise FRONTEND.BadParameterException(
            "INVALID REQUEST -- falls outside of input data stream")

    # check device constraints

    # check vs. device frame rate capability (ensure 0 <= request <= max device capability)
    if not validateRequest(0, max_device_sample_rate, request.fps):
        raise FRONTEND.BadParameterException(
            "INVALID REQUEST -- device capabilities cannot support fr request")

    return True
 def fe_getTunerDeviceControl(self, alloc_id):
     tuner_id = self.getTunerMapping(alloc_id)
     if tuner_id < 0:
         raise  FRONTEND.FrontendException("ERROR: ID: %s IS NOT ASSOCIATED WITH ANY TUNER!"%(alloc_id))
     if alloc_id == self.tunerChannels[tuner_id].control_allocation_id:
         return True
     return False
 def testBasicBehavior(self):
     #######################################################################
     # Make sure start and stop can be called without throwing exceptions
     _antennainfo = FRONTEND.AntennaInfo('', '', '', '')
     _freqrange = FRONTEND.FreqRange(0, 0, [])
     _feedinfo = FRONTEND.FeedInfo('', '', _freqrange)
     _sensorinfo = FRONTEND.SensorInfo('', '', '', _antennainfo, _feedinfo)
     _rfcapabilities = FRONTEND.RFCapabilities(_freqrange, _freqrange)
     rf_center_freq = 1e7
     rf_bandwidth = 3e5
     if_center_freq = 1e6
     pkt_str = FRONTEND.RFInfoPkt('my_flow', rf_center_freq, rf_bandwidth,
                                  if_center_freq, False, _sensorinfo, [],
                                  _rfcapabilities, [])
     request_cf = 9.95e6
     request_bw = 2e5
     alloc = frontend.createTunerAllocation(allocation_id='foo',
                                            center_frequency=request_cf,
                                            bandwidth=request_bw,
                                            sample_rate=0.0)
     port = self.comp.ports[1]
     port.ref._set_rfinfo_pkt(pkt_str)
     self.comp.max_dev_if_cf = 1e6
     self.assertTrue(self.comp.allocateCapacity(alloc))
     self.comp.deallocateCapacity(alloc)
     pkt_inv = FRONTEND.RFInfoPkt('my_flow', rf_center_freq, rf_bandwidth,
                                  if_center_freq, True, _sensorinfo, [],
                                  _rfcapabilities, [])
     port.ref._set_rfinfo_pkt(pkt_inv)
     self.assertFalse(self.comp.allocateCapacity(alloc))
     self.comp.max_dev_if_cf = 1.15e6
     self.assertTrue(self.comp.allocateCapacity(alloc))
     self.comp.deallocateCapacity(alloc)
def validateRequestVsDevice(request, max_device_frame_rate):

    # check device constraints

    # check vs. device frame rate capability (ensure 0 <= request <= max device capability)
    if not validateRequest(0, max_device_frame_rate, request.fps):
        raise FRONTEND.BadParameterException(
            "INVALID REQUEST -- device capabilities cannot support fr request")

    return True
    def setTunerBandwidth(self, allocation_id, bw):
        idx = self.getTunerMapping(allocation_id)
        if idx < 0: raise FRONTEND.FrontendException("Invalid allocation id")
        if allocation_id != self.getControlAllocationId(idx):
            raise FRONTEND.FrontendException(
                ("ID " + str(allocation_id) +
                 " does not have authorization to modify the tuner"))
        if bw < 0: raise FRONTEND.BadParameterException("Invalid BW")

        newbw, newsr, decimation = self.findBestBWSR(bw, 0)
        if not newbw:
            self._log.debug("Can't Satisfy BW and SR request")
            raise FRONTEND.BadParameterException(
                "Can't Satisfy BW and SR request")

        # set hardware to new value. Raise an exception if it's not possible
        self.datagenerators[idx].keyword_dict['FRONTEND::BANDWIDTH'] = newbw
        self.datagenerators[idx].updateandPushSRI()
        self.frontend_tuner_status[idx].bandwidth = newsr
        self.frontend_tuner_status[idx].bandwidth = newbw
        self.frontend_tuner_status[idx].decimation = decimation
 def fe_setTunerOutputSampleRate(self, alloc_id, sr):
     tuner_id = self.getTunerMapping(alloc_id)
     if tuner_id < 0:
         raise  FRONTEND.FrontendException("ERROR: ID: %s IS NOT ASSOCIATED WITH ANY TUNER!"%(alloc_id))
     if  alloc_id != self.tunerChannels[tuner_id].control_allocation_id:
         raise  FRONTEND.FrontendException("ERROR: ID: %s DOES NOT HAVE AUTHORIZATION TO MODIFY TUNER!"%(alloc_id))
 
     try:
         self.tunerChannels[tuner_id].lock.acquire()
         try:
             if not self._valid_sample_rate(sr,tuner_id):
                 # TODO: add log message
                 raise  FRONTEND.BadParameterException("INVALID SAMPLE RATE")
             try:
                 self._dev_set_sample_rate(sr,tuner_id)
             except:
                 #TODO: add back log messages
                 raise  FRONTEND.FrontendException("WARNING: failed when configuring device hardware")
             try:
                 self.tunerChannels[tuner_id].frontend_status.sample_rate = self._dev_get_sample_rate(tuner_id)
             except:
                 #TODO: add back log messages
                 raise  FRONTEND.FrontendException("WARNING: failed when querying device hardware")
         finally:
             self.tunerChannels[tuner_id].lock.release()
     except Exception, e:
         raise  FRONTEND.FrontendException("WARNING: %s"%(e))
 def fe_setTunerCenterFrequency(self, alloc_id, freq):
     tuner_id = self.getTunerMapping(alloc_id)
     if tuner_id < 0:
         raise  FRONTEND.FrontendException("ERROR: ID: %s IS NOT ASSOCIATED WITH ANY TUNER!"%(alloc_id))
     if alloc_id != self.tunerChannels[tuner_id].control_allocation_id:
         raise  FRONTEND.FrontendException("ERROR: ID: %s DOES NOT HAVE AUTHORIZATION TO MODIFY TUNER!"%(alloc_id))
 
     try:
         # If the freq has changed (change in stream) or the tuner is disabled, then set it as disabled
         isTunerEnabled = self.tunerChannels[tuner_id].frontend_status.enabled
         if not isTunerEnabled or self.tunerChannels[tuner_id].frontend_status.center_frequency != freq:
             self.enableTuner(tuner_id, False) # TODO: is this a generic thing we can assume is desired when changing any tuner device?
         
         self.tunerChannels[tuner_id].lock.acquire()
         try:
             if not self._valid_center_frequency(freq,tuner_id):
                 # TODO: add log message
                 raise  FRONTEND.BadParameterException("INVALID FREQUENCY")
             try:
                 self._dev_set_center_frequency(freq,tuner_id)
             except:
                 #TODO: add back log messages
                 raise  FRONTEND.FrontendException("WARNING: failed when configuring device hardware")
             try:
                 self.tunerChannels[tuner_id].frontend_status.center_frequency = self._dev_get_center_frequency(tuner_id)
             except:
                 #TODO: add back log messages
                 raise  FRONTEND.FrontendException("WARNING: failed when querying device hardware")
         finally:
             self.tunerChannels[tuner_id].lock.release()
             
         if isTunerEnabled:
             self.enableTuner(tuner_id, True)
     except Exception, e:
         raise  FRONTEND.FrontendException("WARNING: %s"%(e))
    def testNavSetter(self):
        input_parent = self.nav_port_sample()
        input_parent_2 = self.nav_port_sample()
        input_port_1 = InNavDataPort("input_1", input_parent)
        output_port = OutNavDataPort("output")

        self.assertEquals(input_parent.get_source_id(), "original")

        _time = BULKIO.PrecisionUTCTime(1, 1, 1.0, 1.0, 1.0)
        _positioninfo = FRONTEND.PositionInfo(False, 'DATUM_WGS84', 0.0, 0.0,
                                              0.0)
        _cartesianpos = FRONTEND.CartesianPositionInfo(False, 'DATUM_WGS84',
                                                       0.0, 0.0, 0.0)
        _velocityinfo = FRONTEND.VelocityInfo(False, 'DATUM_WGS84', '', 0.0,
                                              0.0, 0.0)
        _accelerationinfo = FRONTEND.AccelerationInfo(False, 'DATUM_WGS84', '',
                                                      0.0, 0.0, 0.0)
        _attitudeinfo = FRONTEND.AttitudeInfo(False, 0.0, 0.0, 0.0)
        navpacket = FRONTEND.NavigationPacket('', '', _positioninfo,
                                              _cartesianpos, _velocityinfo,
                                              _accelerationinfo, _attitudeinfo,
                                              _time, [])
        navpacket.source_id = "newvalue"

        output_port._set_nav_packet(navpacket)
        self.assertEquals(input_parent.get_source_id(), "original")
        self.assertRaises(PortCallError, output_port._set_nav_packet,
                          navpacket, "hello")

        output_port.connectPort(input_port_1._this(), "hello")

        output_port._set_nav_packet(navpacket)
        self.assertEquals(input_parent.get_source_id(), "newvalue")

        navpacket.source_id = "newvalue_2"
        output_port._set_nav_packet(navpacket, "hello")
        self.assertEquals(input_parent.get_source_id(), "newvalue_2")

        self.assertRaises(PortCallError, output_port._set_nav_packet,
                          navpacket, "foo")

        navpacket.source_id = "newvalue_3"
        input_port_2 = InNavDataPort("input_2", input_parent_2)
        output_port.connectPort(input_port_2._this(), "foo")

        output_port._set_nav_packet(navpacket)
        self.assertEquals(input_parent.get_source_id(), "newvalue_3")
        self.assertEquals(input_parent_2.get_source_id(), "newvalue_3")

        navpacket.source_id = "newvalue_4"
        output_port._set_nav_packet(navpacket, "hello")
        self.assertEquals(input_parent.get_source_id(), "newvalue_4")
        self.assertEquals(input_parent_2.get_source_id(), "newvalue_3")

        self.assertRaises(PortCallError, output_port._set_nav_packet,
                          navpacket, "something")

        output_port.disconnectPort("hello")
    def setTunerOutputSampleRate(self, allocation_id, sr):
        idx = self.getTunerMapping(allocation_id)
        if idx < 0: raise FRONTEND.FrontendException("Invalid allocation id")
        if allocation_id != self.getControlAllocationId(idx):
            raise FRONTEND.FrontendException(
                ("ID " + str(allocation_id) +
                 " does not have authorization to modify the tuner"))
        if sr < 0: raise FRONTEND.BadParameterException("Invalid SR")

        newbw, newsr, decimation = self.findBestBWSR(0, sr)
        if not newbw:
            self._log.debug("Can't Satisfy BW and SR request")
            raise FRONTEND.BadParameterException(
                "Can't Satisfy BW and SR request")

        self._log.debug("Setting BW and Sample Rate %s, %s " % (newbw, newsr))
        #set new SR
        self.datagenerators[idx].sr = sr
        self.datagenerators[idx].keyword_dict['FRONTEND::BANDWIDTH'] = newbw
        self.datagenerators[idx].updateandPushSRI()
        self.frontend_tuner_status[idx].sample_rate = newsr
        self.frontend_tuner_status[idx].bandwidth = newbw
        self.frontend_tuner_status[idx].decimation = decimation
 def _createEmptyRFInfo(self):
     _antennainfo = FRONTEND.AntennaInfo('', '', '', '')
     _freqrange = FRONTEND.FreqRange(0, 0, [])
     _feedinfo = FRONTEND.FeedInfo('', '', _freqrange)
     _sensorinfo = FRONTEND.SensorInfo('', '', '', _antennainfo, _feedinfo)
     _rfcapabilities = FRONTEND.RFCapabilities(_freqrange, _freqrange)
     _rfinfopkt = FRONTEND.RFInfoPkt('', 0.0, 0.0, 0.0, False, _sensorinfo,
                                     [], _rfcapabilities, [])
     return _rfinfopkt
Beispiel #16
0
 def get_current_rf_input(self, port_name):
     _antennainfo = FRONTEND.AntennaInfo('', '', '', '')
     _freqrange = FRONTEND.FreqRange(0, 0, [])
     _feedinfo = FRONTEND.FeedInfo('', '', _freqrange)
     _sensorinfo = FRONTEND.SensorInfo('', '', '', _antennainfo, _feedinfo)
     _rfcapabilities = FRONTEND.RFCapabilities(_freqrange, _freqrange)
     _rfinfopkt = FRONTEND.RFInfoPkt('', 0.0, 0.0, 0.0, False, _sensorinfo,
                                     [], _rfcapabilities, [])
     return _rfinfopkt
def validateRequestVsSRI(request, upstream_sri):

    # check if the upstream sample rate falls within the requested tolerable frame rate
    upstream_sr = 1 / upstream_sri.xdelta
    upstream_frame_rate = upstream_sr / (
        request.frame_height * request.frame_width * request.channels)
    min_requested_sample_rate = request.sample_rate
    max_requested_sample_rate = request.sample_rate + request.sample_rate * request.sample_rate_tolerance / 100.0

    if not validateRequest(min_requested_sample_rate,
                           max_requested_sample_rate, upstream_frame_rate):
        raise FRONTEND.BadParameterException(
            "INVALID REQUEST -- input data stream cannot support fr request")

    return True
 def _generateRFInfoPkt(self,rf_freq=1e9,rf_bw=1e9,if_freq=0,spec_inverted=False,rf_flow_id="testflowID"):
     antenna_info = FRONTEND.AntennaInfo("antenna_name","antenna_type","antenna.size","description")
     freqRange= FRONTEND.FreqRange(0,1e12,[] )
     feed_info = FRONTEND.FeedInfo("feed_name", "polarization",freqRange)
     sensor_info = FRONTEND.SensorInfo("msn_name", "collector_name", "receiver_name",antenna_info,feed_info)
     delays = [];
     cap = FRONTEND.RFCapabilities(freqRange,freqRange);
     add_props = [];
     rf_info_pkt = FRONTEND.RFInfoPkt(rf_flow_id,rf_freq, rf_bw, if_freq, spec_inverted, sensor_info, delays, cap, add_props)         
     
     return rf_info_pkt
    def testRFSourceSetter(self):
        input_parent = self.rfsource_port_sample()
        input_parent_2 = self.rfsource_port_sample()
        input_port_1 = InRFSourcePort("input_1", input_parent)
        output_port = OutRFSourcePort("output")

        self.assertEquals(input_parent.get_rf_flow_id(), "original")

        _antennainfo = FRONTEND.AntennaInfo('', '', '', '')
        _freqrange = FRONTEND.FreqRange(0, 0, [])
        _feedinfo = FRONTEND.FeedInfo('', '', _freqrange)
        _sensorinfo = FRONTEND.SensorInfo('', '', '', _antennainfo, _feedinfo)
        _rfcapabilities = FRONTEND.RFCapabilities(_freqrange, _freqrange)
        rfsource = FRONTEND.RFInfoPkt('', 0.0, 0.0, 0.0, False, _sensorinfo,
                                      [], _rfcapabilities, [])
        rfsource.rf_flow_id = "newvalue"

        output_port._set_current_rf_input(rfsource)
        self.assertEquals(input_parent.get_rf_flow_id(), "original")
        self.assertRaises(PortCallError, output_port._set_current_rf_input,
                          rfsource, "hello")

        output_port.connectPort(input_port_1._this(), "hello")

        output_port._set_current_rf_input(rfsource)
        self.assertEquals(input_parent.get_rf_flow_id(), "newvalue")

        rfsource.rf_flow_id = "newvalue_2"
        output_port._set_current_rf_input(rfsource, "hello")
        self.assertEquals(input_parent.get_rf_flow_id(), "newvalue_2")

        self.assertRaises(PortCallError, output_port._set_current_rf_input,
                          rfsource, "foo")

        rfsource.rf_flow_id = "newvalue_3"
        input_port_2 = InRFSourcePort("input_2", input_parent_2)
        output_port.connectPort(input_port_2._this(), "foo")

        output_port._set_current_rf_input(rfsource)
        self.assertEquals(input_parent.get_rf_flow_id(), "newvalue_3")
        self.assertEquals(input_parent_2.get_rf_flow_id(), "newvalue_3")

        rfsource.rf_flow_id = "newvalue_4"
        output_port._set_current_rf_input(rfsource, "hello")
        self.assertEquals(input_parent.get_rf_flow_id(), "newvalue_4")
        self.assertEquals(input_parent_2.get_rf_flow_id(), "newvalue_3")

        self.assertRaises(PortCallError, output_port._set_current_rf_input,
                          rfsource, "something")

        output_port.disconnectPort("hello")
Beispiel #20
0
 def get_nav_packet(self, port_name):
     _time = BULKIO.PrecisionUTCTime(1, 1, 1.0, 1.0, 1.0)
     _positioninfo = FRONTEND.PositionInfo(False, 'DATUM_WGS84', 0.0, 0.0,
                                           0.0)
     _cartesianpos = FRONTEND.CartesianPositionInfo(False, 'DATUM_WGS84',
                                                    0.0, 0.0, 0.0)
     _velocityinfo = FRONTEND.VelocityInfo(False, 'DATUM_WGS84', '', 0.0,
                                           0.0, 0.0)
     _accelerationinfo = FRONTEND.AccelerationInfo(False, 'DATUM_WGS84', '',
                                                   0.0, 0.0, 0.0)
     _attitudeinfo = FRONTEND.AttitudeInfo(False, 0.0, 0.0, 0.0)
     _navpacket = FRONTEND.NavigationPacket('', '', _positioninfo,
                                            _cartesianpos, _velocityinfo,
                                            _accelerationinfo,
                                            _attitudeinfo, _time, [])
     return _navpacket
Beispiel #21
0
 def getTunerEnable(self, id):
     raise FRONTEND.NotSupportedException("getTunerEnable not supported")
Beispiel #22
0
 def setTunerEnable(self, id, enable):
     raise FRONTEND.NotSupportedException("setTunerEnable not supported")
Beispiel #23
0
 def getTunerReferenceSource(self, id):
     raise FRONTEND.NotSupportedException(
         "getTunerReferenceSource not supported")
Beispiel #24
0
 def getTunerGain(self, id):
     raise FRONTEND.NotSupportedException("getTunerGain not supported")
Beispiel #25
0
 def setTunerGain(self, id, gain):
     raise FRONTEND.NotSupportedException("setTunerGain not supported")
Beispiel #26
0
 def getTunerBandwidth(self, id):
     raise FRONTEND.NotSupportedException("getTunerBandwidth not supported")
Beispiel #27
0
 def getTunerCenterFrequency(self, id):
     raise FRONTEND.NotSupportedException(
         "getTunerCenterFrequency not supported")
Beispiel #28
0
 def getTunerOutputSampleRate(self, id):
     raise FRONTEND.NotSupportedException(
         "getTunerOutputSampleRate not supported")
    def testBasicBehavior(self):
        self.assertEquals(self.got_logmsg, False)
        #######################################################################
        # Make sure start and stop can be called without throwing exceptions
        exc_src = sb.launch('./build/fei_exception_through/tests/fei_exc_src/fei_exc_src.spd.xml')
        self.comp.connect(exc_src,usesPortName='DigitalTuner_out')
        self.comp.connect(exc_src,usesPortName='RFInfo_out')
        self.comp.connect(exc_src,usesPortName='GPS_out')
        self.comp.connect(exc_src,usesPortName='NavData_out')
        self.comp.connect(exc_src,usesPortName='RFSource_out')
        for port in self.comp.ports:
            if port.name == 'DigitalTuner_in':
                DigitalTuner_in = port
            if port.name == 'RFInfo_in':
                RFInfo_in = port
            if port.name == 'GPS_in':
                GPS_in = port
            if port.name == 'NavData_in':
                NavData_in = port
            if port.name == 'RFSource_in':
                RFSource_in = port
                
        _time = BULKIO.PrecisionUTCTime(1,1,1.0,1.0,1.0)
        _gpsinfo = FRONTEND.GPSInfo('','','',1L,1L,1L,1.0,1.0,1.0,1.0,1,1.0,'',_time,[])
        _positioninfo = FRONTEND.PositionInfo(False,'DATUM_WGS84',0.0,0.0,0.0)
        _gpstimepos = FRONTEND.GpsTimePos(_positioninfo,_time)
        _cartesianpos=FRONTEND.CartesianPositionInfo(False,'DATUM_WGS84',0.0,0.0,0.0)
        _velocityinfo=FRONTEND.VelocityInfo(False,'DATUM_WGS84','',0.0,0.0,0.0)
        _accelerationinfo=FRONTEND.AccelerationInfo(False,'DATUM_WGS84','',0.0,0.0,0.0)
        _attitudeinfo=FRONTEND.AttitudeInfo(False,0.0,0.0,0.0)
        _navpacket=FRONTEND.NavigationPacket('','',_positioninfo,_cartesianpos,_velocityinfo,_accelerationinfo,_attitudeinfo,_time,[])
        _antennainfo=FRONTEND.AntennaInfo('','','','')
        _freqrange=FRONTEND.FreqRange(0,0,[])
        _feedinfo=FRONTEND.FeedInfo('','',_freqrange)
        _sensorinfo=FRONTEND.SensorInfo('','','',_antennainfo,_feedinfo)
        _rfcapabilities=FRONTEND.RFCapabilities(_freqrange,_freqrange)
        _rfinfopkt=FRONTEND.RFInfoPkt('',0.0,0.0,0.0,False,_sensorinfo,[],_rfcapabilities,[])
        _strat = FRONTEND.ScanningTuner.ScanStrategy(FRONTEND.ScanningTuner.DISCRETE_SCAN, FRONTEND.ScanningTuner.ScanModeDefinition(discrete_freq_list=[]), FRONTEND.ScanningTuner.TIME_BASED, 0.1)

        DigitalTuner_in.ref.getScanStatus('hello')
        DigitalTuner_in.ref.setScanStartTime('hello', _time)
        DigitalTuner_in.ref.setScanStrategy('hello', _strat)
        DigitalTuner_in.ref.getTunerType('hello')
        DigitalTuner_in.ref.getTunerDeviceControl('hello')
        DigitalTuner_in.ref.getTunerGroupId('hello')
        DigitalTuner_in.ref.getTunerRfFlowId('hello')
        DigitalTuner_in.ref.setTunerCenterFrequency('hello', 1.0)
        DigitalTuner_in.ref.getTunerCenterFrequency('hello')
        DigitalTuner_in.ref.setTunerBandwidth('hello', 1.0)
        DigitalTuner_in.ref.getTunerBandwidth('hello')
        DigitalTuner_in.ref.setTunerAgcEnable('hello', True)
        DigitalTuner_in.ref.getTunerAgcEnable('hello')
        DigitalTuner_in.ref.setTunerGain('hello', 1.0)
        DigitalTuner_in.ref.getTunerGain('hello')
        DigitalTuner_in.ref.setTunerReferenceSource('hello', 1L)
        DigitalTuner_in.ref.getTunerReferenceSource('hello')
        DigitalTuner_in.ref.setTunerEnable('hello', True)
        DigitalTuner_in.ref.getTunerEnable('hello')
        DigitalTuner_in.ref.setTunerOutputSampleRate('hello', 1.0)
        DigitalTuner_in.ref.getTunerOutputSampleRate('hello')
        GPS_in.ref._get_gps_info()
        GPS_in.ref._set_gps_info(_gpsinfo)
        GPS_in.ref._get_gps_time_pos()
        GPS_in.ref._set_gps_time_pos(_gpstimepos)
        NavData_in.ref._get_nav_packet()
        NavData_in.ref._set_nav_packet(_navpacket)
        RFInfo_in.ref._get_rf_flow_id()
        RFInfo_in.ref._set_rf_flow_id('rf_flow')
        RFInfo_in.ref._get_rfinfo_pkt()
        RFInfo_in.ref._set_rfinfo_pkt(_rfinfopkt)
        
        os.killpg(exc_src._pid, 9)
        
        while True:
            try:
                os.kill(exc_src._pid, 0)
                time.sleep(0.1)
            except:
                break
        
        exception = (CORBA.COMM_FAILURE, CORBA.TRANSIENT)

        self.assertRaises(exception, DigitalTuner_in.ref.getScanStatus, 'hello')
        self.assertRaises(exception, DigitalTuner_in.ref.setScanStartTime, 'hello', _time)
        self.assertRaises(exception, DigitalTuner_in.ref.setScanStrategy, 'hello', _strat)
        self.assertRaises(exception, DigitalTuner_in.ref.getTunerType, 'hello')
        self.assertRaises(exception, DigitalTuner_in.ref.getTunerDeviceControl, 'hello')
        self.assertRaises(exception, DigitalTuner_in.ref.getTunerGroupId, 'hello')
        self.assertRaises(exception, DigitalTuner_in.ref.getTunerRfFlowId, 'hello')
        self.assertRaises(exception, DigitalTuner_in.ref.setTunerCenterFrequency, 'hello', 1.0)
        self.assertRaises(exception, DigitalTuner_in.ref.getTunerCenterFrequency, 'hello')
        self.assertRaises(exception, DigitalTuner_in.ref.setTunerBandwidth, 'hello', 1.0)
        self.assertRaises(exception, DigitalTuner_in.ref.getTunerBandwidth, 'hello')
        self.assertRaises(exception, DigitalTuner_in.ref.setTunerAgcEnable, 'hello', True)
        self.assertRaises(exception, DigitalTuner_in.ref.getTunerAgcEnable, 'hello')
        self.assertRaises(exception, DigitalTuner_in.ref.setTunerGain, 'hello', 1.0)
        self.assertRaises(exception, DigitalTuner_in.ref.getTunerGain, 'hello')
        self.assertRaises(exception, DigitalTuner_in.ref.setTunerReferenceSource, 'hello', 1L)
        self.assertRaises(exception, DigitalTuner_in.ref.getTunerReferenceSource, 'hello')
        self.assertRaises(exception, DigitalTuner_in.ref.setTunerEnable, 'hello', True)
        self.assertRaises(exception, DigitalTuner_in.ref.getTunerEnable, 'hello')
        self.assertRaises(exception, DigitalTuner_in.ref.setTunerOutputSampleRate, 'hello', 1.0)
        self.assertRaises(exception, DigitalTuner_in.ref.getTunerOutputSampleRate, 'hello')
        self.assertRaises(exception, GPS_in.ref._get_gps_info)
        self.assertRaises(exception, GPS_in.ref._set_gps_info, _gpsinfo)
        self.assertRaises(exception, GPS_in.ref._get_gps_time_pos)
        self.assertRaises(exception, GPS_in.ref._set_gps_time_pos, _gpstimepos)
        self.assertRaises(exception, NavData_in.ref._get_nav_packet)
        self.assertRaises(exception, NavData_in.ref._set_nav_packet, _navpacket)
        self.assertRaises(exception, RFInfo_in.ref._get_rf_flow_id)
        self.assertRaises(exception, RFInfo_in.ref._set_rf_flow_id, 'rf_flow')
        self.assertRaises(exception, RFInfo_in.ref._get_rfinfo_pkt)
        self.assertRaises(exception, RFInfo_in.ref._set_rfinfo_pkt, _rfinfopkt)
Beispiel #30
0
 def setTunerBandwidth(self, bw):
     raise FRONTEND.NotSupportedException("setTunerBandwidth not supported")