add a json dumper for the server
This commit is contained in:
		| @@ -1,5 +1,6 @@ | ||||
| #!/usr/bin/env python | ||||
|  | ||||
| import json | ||||
| import pytz | ||||
| import sys | ||||
|  | ||||
| @@ -83,6 +84,13 @@ class Inbound: | ||||
|                     self.PlannedRunway = runway | ||||
|                     break | ||||
|  | ||||
|     def toJSON(self): | ||||
|         pta = str(self.PlannedArrivalTime) | ||||
|         delimiter = pta.find('.') | ||||
|         if -1 == delimiter: | ||||
|             delimiter = pta.find('+') | ||||
|         return json.dumps({ 'callsign' : self.Callsign, 'runway' : self.PlannedRunway.Name, 'pta' : pta[0:delimiter] }, ensure_ascii=True) | ||||
|  | ||||
|     def arrivalEstimation(self, runway : Runway, star : ArrivalRoute, weather : WeatherModel): | ||||
|         # calculate remaining trackmiles | ||||
|         trackmiles = self.Report.distanceToIAF | ||||
|   | ||||
		Reference in New Issue
	
	Block a user