fix potential crashes
This commit is contained in:
		| @@ -106,28 +106,31 @@ class Euroscope: | |||||||
|             entry = sequence.sequence.add() |             entry = sequence.sequence.add() | ||||||
|             entry.callsign = inbound.Callsign |             entry.callsign = inbound.Callsign | ||||||
|             entry.fixed = inbound.FixedSequence |             entry.fixed = inbound.FixedSequence | ||||||
|             entry.arrivalRoute = inbound.PlannedStar.Name |             if None != inbound.PlannedStar: | ||||||
|             entry.arrivalRunway = inbound.PlannedRunway.Name |                 entry.arrivalRoute = inbound.PlannedStar.Name | ||||||
|  |             if None != inbound.PlannedRunway: | ||||||
|  |                 entry.arrivalRunway = inbound.PlannedRunway.Name | ||||||
|  |  | ||||||
|             #performance = entry.performance.add() |             if None != inbound.PerformanceData: | ||||||
|             entry.performance.iasAboveFL240 = int(round(inbound.PerformanceData.SpeedAboveFL240)) |                 entry.performance.iasAboveFL240 = int(round(inbound.PerformanceData.SpeedAboveFL240)) | ||||||
|             entry.performance.iasAboveFL100 = int(round(inbound.PerformanceData.SpeedAboveFL100)) |                 entry.performance.iasAboveFL100 = int(round(inbound.PerformanceData.SpeedAboveFL100)) | ||||||
|             entry.performance.iasBelowFL100 = int(round(inbound.PerformanceData.SpeedBelowFL100)) |                 entry.performance.iasBelowFL100 = int(round(inbound.PerformanceData.SpeedBelowFL100)) | ||||||
|             entry.performance.iasApproach = int(round(inbound.PerformanceData.SpeedApproach)) |                 entry.performance.iasApproach = int(round(inbound.PerformanceData.SpeedApproach)) | ||||||
|  |  | ||||||
|             for waypoint in inbound.PlannedArrivalRoute: |             if None != inbound.PlannedArrivalRoute: | ||||||
|                 wp = entry.waypoints.add() |                 for waypoint in inbound.PlannedArrivalRoute: | ||||||
|                 wp.name = waypoint.Waypoint.Name |                     wp = entry.waypoints.add() | ||||||
|                 wp.altitude = int(round(waypoint.Altitude)) |                     wp.name = waypoint.Waypoint.Name | ||||||
|                 wp.indicatedAirspeed = int(round(waypoint.IndicatedAirspeed)) |                     wp.altitude = int(round(waypoint.Altitude)) | ||||||
|                 wp.groundSpeed = int(round(waypoint.GroundSpeed)) |                     wp.indicatedAirspeed = int(round(waypoint.IndicatedAirspeed)) | ||||||
|  |                     wp.groundSpeed = int(round(waypoint.GroundSpeed)) | ||||||
|  |  | ||||||
|                 pta = str(waypoint.PTA) |                     pta = str(waypoint.PTA) | ||||||
|                 delimiter = pta.find('.') |                     delimiter = pta.find('.') | ||||||
|                 if -1 == delimiter: |                     if -1 == delimiter: | ||||||
|                     delimiter = pta.find('+') |                         delimiter = pta.find('+') | ||||||
|  |  | ||||||
|                 wp.pta = pta[0:delimiter] |                     wp.pta = pta[0:delimiter] | ||||||
|  |  | ||||||
|         message = sequence.SerializeToString() |         message = sequence.SerializeToString() | ||||||
|         self.Socket.send(message) |         self.Socket.send(message) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user