def __init__( self, route, aircraftICAOcode="A320", RequestedFlightLevel=330.0, cruiseMach=0.8, takeOffMassKilograms=62000.0 ): self.className = self.__class__.__name__ FlightPlan.__init__(self, route) """ first bad and incomplete flight length """ """ missing last turn and glide slope """ self.flightLengthMeters = self.computeLengthMeters() self.aircraftICAOcode = aircraftICAOcode self.aircraft = None self.getAircraft() assert isinstance(self.aircraft, BadaAircraft) and not (self.aircraft is None) self.aircraft.setAircraftMassKilograms(takeOffMassKilograms) assert RequestedFlightLevel >= 15.0 and RequestedFlightLevel <= 450.0 self.aircraft.setTargetCruiseFlightLevel( RequestedFlightLevel=RequestedFlightLevel, departureAirportAltitudeMSLmeters=self.getDepartureAirport().getFieldElevationAboveSeaLevelMeters(), ) self.aircraft.setTargetCruiseMach(cruiseMachNumber=cruiseMach) self.arrivalAirport = self.getArrivalAirport() if self.arrivalAirport is None: print self.className + ": there is no arrival airport => flight is outbound !!!" # assert isinstance(self.arrivalAirport, Airport) and not(self.arrivalAirport is None) self.departureAirport = self.getDepartureAirport() assert isinstance(self.departureAirport, Airport) and not (self.departureAirport is None)
def test_main_two(self): print("=========== Flight Plan start =========== ") strRoute = 'ADEP/LFBO-TOU-ALIVA-TOU37-FISTO-LMG-PD01-PD02-AMB-AMB01-AMB02-PD03-PD04-OLW11-OLW83-ADES/LFPO' flightPlan = FlightPlan(strRoute) self.assertTrue(isinstance(flightPlan.getDepartureAirport(), Airport)) self.assertTrue(isinstance(flightPlan.getArrivalAirport(), Airport))
def test_main_seven(self): print("=========== Flight Plan start =========== ") strRoute = 'ADEP/SBGL-ALDEIA-NIKDO-MACAE' flightPlan = FlightPlan(strRoute) print('flight path length= ' + str(flightPlan.computeLengthNauticalMiles()) + ' nautical miles')
def __init__( self, route, aircraftICAOcode='A320', RequestedFlightLevel=330.0, cruiseMach=0.8, takeOffMassKilograms=62000.0, windSpeedMetersPerSecond=None, windDirectionDegrees=None, ): self.className = self.__class__.__name__ ''' init mother class ''' FlightPlan.__init__(self, route) assert len(self.fixList) > 1 ''' first bad and incomplete flight length ''' ''' missing last turn and glide slope ''' self.flightLengthMeters = self.computeLengthMeters() print(self.flightLengthMeters) self.windSpeedMetersPerSecond = windSpeedMetersPerSecond self.windDirectionDegrees = windDirectionDegrees # init aircraft information self.aircraftICAOcode = aircraftICAOcode self.aircraft = None self.getAircraft(aircraftICAOcode) assert isinstance(self.aircraft, BadaAircraft) and not (self.aircraft is None) self.takeOffMassKilograms = takeOffMassKilograms self.RequestedFlightLevel = RequestedFlightLevel self.cruiseMach = cruiseMach self.aircraft.setAircraftMassKilograms(takeOffMassKilograms) self.deltaTimeSeconds = 1 assert 15.0 <= RequestedFlightLevel <= 450.0 departure_alt = 0.0 if self.getDepartureAirport(): departure_alt = self.getDepartureAirport( ).getFieldElevationAboveSeaLevelMeters() # update aircraft parameter self.setAircraftStateAtInitWaypoint() self.aircraft.setTargetCruiseFlightLevel( RequestedFlightLevel=RequestedFlightLevel, departureAirportAltitudeMSLmeters=departure_alt) self.aircraft.setTargetCruiseMach(cruiseMachNumber=cruiseMach) self.arrivalAirport = self.getArrivalAirport() if self.arrivalAirport is None: print(self.className + ': there is no arrival airport => flight is out-bound !!!')
def test_main_eight(self): print("=========== Flight Plan start =========== ") strRoute = 'ADEP/LFBM/27-' strRoute += 'SAU-VELIN-LMG-BEBIX-GUERE-LARON-KUKOR-MOU-' strRoute += 'PIBAT-DJL-RESPO-DANAR-POGOL-OBORN-LUPEN-SUL-' strRoute += 'ESULI-TEDGO-ETAGO-IBAGA-RATIP-PIBAD-SOMKO-' strRoute += 'ADES/EDDP/26R' flightPlan = FlightPlan(strRoute) print('flight path length= ' + str(flightPlan.computeLengthNauticalMiles()) + ' nautical miles')
def test_main_ten(self): print("=========== Test Speed and Level constraints =========== ") ''' M suivi de 3 chiffres pour une vitesse exprimée en nombre de Mach (exemple : M078). ''' strRoute = 'ADEP/LFBO-TOU-ALIVA-FISTO-LMG-M078-PD02-AMB-AMB01-AMB02-PD03-PD04-OLW11-OLW83-ADES/LFPO' flightPlan = FlightPlan(strRoute) print(flightPlan)
def test_main_nine(self): print("=========== Test Speed and Level constraints =========== ") ''' N suivi de 4 chiffres pour la vitesse propre (TAS) en n�uds (exemple : N0450), ''' strRoute = 'ADEP/LFBO-TOU-ALIVA-N0450-FISTO-LMG-PD01-PD02-AMB-AMB01-AMB02-PD03-PD04-OLW11-OLW83-ADES/LFPO' flightPlan = FlightPlan(strRoute) print(flightPlan)
def test_main_thirteen(self): print("=========== Test Speed and Level constraints =========== ") ''' F suivi de 3 chiffres : niveau de vol (exemple : F080) ''' strRoute = 'ADEP/LFBO-TOU-ALIVA-M082A100-FISTO-LMG-MEDAL-OLW11-OLW83-ADES/LFPO' flightPlan = FlightPlan(strRoute) print(flightPlan) ''' A suivi de 3 chiffres : altitude en centaines de pieds (exemple : A100 pour 10 000 ft), '''
def test_main_eleven(self): print("=========== Test Speed and Level constraints =========== ") ''' F suivi de 3 chiffres : niveau de vol (exemple : F080) ''' strRoute = 'ADEP/LFBO-TOU-ALIVA-N0250F080-FISTO-LMG-PD01-PD02-AMB-AMB01-AMB02-PD03-PD04-OLW11-OLW83-ADES/LFPO' flightPlan = FlightPlan(strRoute) print(flightPlan) ''' A suivi de 3 chiffres : altitude en centaines de pieds (exemple : A100 pour 10 000 ft), '''
def test_main_four(self): print("=========== Flight Plan start =========== ") strRoute = 'ADEP/LFBO-TOU-ALIVA-TOU37-FISTO-LMG-PD01-PD02-AMB-AMB01-AMB02-PD03-PD04-OLW11-OLW83' flightPlan = FlightPlan(strRoute) print('is over flight= ' + str(flightPlan.isOverFlight())) print('is domestic= ' + str(flightPlan.isDomestic())) print('is in Bound= ' + str(flightPlan.isInBound())) print('is out Bound= ' + str(flightPlan.isOutBound())) print('all angles < 90.0 degrees= ' + str(flightPlan.allAnglesLessThan90degrees())) print('flight path length= ' + str(flightPlan.computeLengthNauticalMiles()) + ' nautical miles')
def test_main_one(self): print("=========== Flight Plan start =========== ") strRoute = 'ADEP/LFBO-TOU-ALIVA-TOU37-FISTO-LMG-PD01-PD02-AMB-AMB01-AMB02-PD03-PD04-OLW11-OLW83-ADES/LFPO' flightPlan = FlightPlan(strRoute) self.assertFalse(flightPlan.isOverFlight()) self.assertTrue(flightPlan.isDomestic()) self.assertFalse(flightPlan.isInBound()) self.assertFalse(flightPlan.isOutBound()) print('all angles < 90.0 degrees= ' + str(flightPlan.allAnglesLessThan90degrees())) print('flight path length= ' + str(flightPlan.computeLengthNauticalMiles()) + ' nautical miles')
def __init__(self, route, aircraftICAOcode='A320', RequestedFlightLevel=330.0, cruiseMach=0.8, takeOffMassKilograms=62000.0): self.className = self.__class__.__name__ ''' init mother class ''' FlightPlan.__init__(self, route) ''' first bad and incomplete flight length ''' ''' missing last turn and glide slope ''' self.flightLengthMeters = self.computeLengthMeters() self.aircraftICAOcode = aircraftICAOcode self.aircraft = None self.getAircraft() assert isinstance(self.aircraft, BadaAircraft) and not (self.aircraft is None) self.aircraft.setAircraftMassKilograms(takeOffMassKilograms) assert RequestedFlightLevel >= 15.0 and RequestedFlightLevel <= 450.0 self.aircraft.setTargetCruiseFlightLevel( RequestedFlightLevel=RequestedFlightLevel, departureAirportAltitudeMSLmeters=self.getDepartureAirport( ).getFieldElevationAboveSeaLevelMeters()) self.aircraft.setTargetCruiseMach(cruiseMachNumber=cruiseMach) self.arrivalAirport = self.getArrivalAirport() if (self.arrivalAirport is None): print(self.className + ': there is no arrival airport => flight is out-bound !!!') #assert isinstance(self.arrivalAirport, Airport) and not(self.arrivalAirport is None) self.departureAirport = self.getDepartureAirport() assert isinstance(self.departureAirport, Airport) and not (self.departureAirport is None)
def test_main_six(self): print("=========== Flight Plan start =========== ") strRoute = 'ADEP/SBGL-ALDEIA-NIKDO-MACAE-GIKPO-MABSI-VITORIA-GIDOD-' strRoute += 'ISILA-POSGA-SEGURO-BIDEV-NAXOV-IRUMI-ESLIB-MEDIT-RUBEN-KIBEG-' strRoute += 'AMBET-VUKSU-NORONHA-UTRAM-MEDAL-NAMBI-RAKUD-IRAVU-MOGNI-ONOBI-CABRAL-' strRoute += 'IPERA-ISOKA-LIMAL-UDATI-ODEGI-LOMAS-CANARIA-VASTO-SULAM-DIMSA-ATLUX-' strRoute += 'SUNID-AKUDA-OBOLO-PESAS-EKRIS-LUSEM-LULUT-BORDEAUX-COGNAC-ADABI-BOKNO-' strRoute += 'DEVRO-VANAD-KOVAK-ADES/LFPG' flightPlan = FlightPlan(strRoute) print('is over flight= ' + str(flightPlan.isOverFlight())) print('is domestic= ' + str(flightPlan.isDomestic())) print('is in Bound= ' + str(flightPlan.isInBound())) print('is out Bound= ' + str(flightPlan.isOutBound())) print('all angles < 90.0 degrees= ' + str(flightPlan.allAnglesLessThan90degrees())) print('flight path length= ' + str(flightPlan.computeLengthNauticalMiles()) + ' nautical miles')