Exemple #1
0
 def test_derive_afr_fallback(self):
     afr_apt = A(name='AFR Landing Airport', value={'id': 25})
     apt = self.node_class()
     apt.set_flight_attr = Mock()
     approach = App()
     approach.create_approach('LANDING', slice(None))
     apt.derive(approach, afr_apt)
     apt.set_flight_attr.assert_called_once_with(afr_apt.value)
     apt.set_flight_attr.reset_mock()
Exemple #2
0
 def test_derive_afr_fallback(self):
     afr_rwy = A(name='AFR Landing Runway', value={'identifier': '27R'})
     approach = App()
     approach.create_approach('LANDING', slice(None))
     rwy = self.node_class()
     rwy.set_flight_attr = Mock()
     # Check that the AFR airport was used and the API wasn't called:
     rwy.derive(None, None)
     rwy.set_flight_attr.assert_called_once_with(None)
     rwy.set_flight_attr.reset_mock()
     rwy.derive(approach, afr_rwy)
     rwy.set_flight_attr.assert_called_once_with(afr_rwy.value)
Exemple #3
0
    def derive(
            self,
            approaches=App('Approach Information'),
            land_afr_rwy=A('AFR Landing Runway'),
    ):
        '''
        '''
        # 1. If we have Approach Information use this as hardwork already done.
        if approaches:
            landing_approach = approaches.get_last(_type='LANDING')
            runway = landing_approach.landing_runway
            if runway:
                self.set_flight_attr(runway)
                return  # We found an airport, so finish here.
            elif landing_approach:
                self.warning('No landing runway found.')
            else:
                self.warning(
                    'No Landing Approach for looking up landing airport.')

        # 2. If we have a runway provided in achieved flight record, use it:
        if land_afr_rwy:
            runway = land_afr_rwy.value
            self.debug('Using landing runway from AFR: %s', runway)
            self.set_flight_attr(runway)
            return  # We found a runway in the AFR, so finish here.

        # 3. After all that, we still couldn't determine a runway...
        self.error('Unable to determine runway at landing!')
        self.set_flight_attr(None)
Exemple #4
0
    def derive(self,
               approaches=KPV('Approach Information'),
               land_afr_apt=App('AFR Landing Airport')):
        '''
        '''
        # 1. If we have Approach Information use this as hardwork already done.
        if approaches:
            landing_approach = approaches.get_last(_type='LANDING')
            airport = landing_approach.airport
            if airport:
                self.set_flight_attr(airport)
                return  # We found an airport, so finish here.
            elif landing_approach:
                self.warning('No landing airport found.')
            else:
                self.warning(
                    'No Landing Approach for looking up landing airport.')

        # 2. If we have an airport provided in achieved flight record, use it:
        if land_afr_apt:
            airport = land_afr_apt.value
            self.debug('Using landing airport from AFR: %s', airport)
            self.set_flight_attr(airport)
            return  # We found an airport in the AFR, so finish here.

        # 3. After all that, we still couldn't determine an airport...
        self.error('Unable to determine airport at landing!')
        self.set_flight_attr(None)
    def derive(self,
               approaches=KPV('Approach Information'),
               land_afr_apt=App('AFR Landing Airport'),
               precise_pos=A('Precise Positioning')):
        '''
        '''
        precise_pos = bool(getattr(precise_pos, 'value', False))

        if not precise_pos and land_afr_apt:
            self.use_afr(land_afr_apt)
            return

        if approaches and approaches.get_last(_type='LANDING'):

            landing_approach = approaches.get_last(_type='LANDING')
            airport = landing_approach.airport
            if airport:
                self.set_flight_attr(airport)
                return
            elif landing_approach:
                self.warning('No landing airport found.')
            else:
                self.warning('No Landing Approach for looking up landing airport.')

        if land_afr_apt:
            self.use_afr(land_afr_apt)
            return

        self.error('Unable to determine airport at landing!')
        self.set_flight_attr(None)
    def derive(self,
               approaches=App('Approach Information'),
               land_afr_rwy=A('AFR Landing Runway'),
               precise_pos=A('Precise Positioning')):
        '''
        '''
        precise_pos = bool(getattr(precise_pos, 'value', False))

        if not precise_pos and land_afr_rwy:
            self.use_afr(land_afr_rwy)
            return

        if approaches and approaches.get_last(_type='LANDING'):
            landing_approach = approaches.get_last(_type='LANDING')
            runway = landing_approach.landing_runway
            if runway:
                self.set_flight_attr(runway)
                return
            elif landing_approach:
                self.warning('No landing runway found.')
            else:
                self.warning('No Landing Approach for looking up landing airport.')

        if land_afr_rwy:
            self.use_afr(land_afr_rwy)
            return

        self.error('Unable to determine runway at landing!')
        self.set_flight_attr(None)
Exemple #7
0
 def derive(self,
            ian_glidepath=P('IAN Glidepath'),
            alt_aal=P('Altitude AAL For Flight Phases'),
            apps=App('Approach Information'),
            app_src_capt=P('Displayed App Source (Capt)'),
            app_src_fo=P('Displayed App Source (FO)')):
     pass
Exemple #8
0
 def derive(self, approaches=App('Approach Information')):
     pass
 def derive(self,
            air_spd=P('Airspeed'),
            alt_agl=P('Altitude AGL For Flight Phases'),
            approaches=App('Approach Information')):
     pass
 def derive(self,
            groundspeed=P('Groundspeed'),
            dtts=KTI('Distance To Touchdown'),
            touchdown=KTI('Offshore Touchdown'),
            approaches=App('Approach Information')):
     pass
 def derive(self,
            heading=P('Heading Continuous'),
            dtts=KTI('Distance To Touchdown'),
            offshore_twn=KTI('Offshore Touchdown'),
            approaches=App('Approach Information')):
     pass
 def derive(
         self,
         approaches=App('Approach Information'),
         land_afr_rwy=A('AFR Landing Runway'),
 ):
     pass
 def derive(self,
            approaches=KPV('Approach Information'),
            land_afr_apt=App('AFR Landing Airport')):
     pass