Przeglądaj źródła

fix issues in the data transmission

Sven Czarnian 3 lat temu
rodzic
commit
22e9018807
1 zmienionych plików z 6 dodań i 6 usunięć
  1. 6 6
      aman/com/Euroscope.py

+ 6 - 6
aman/com/Euroscope.py

@@ -134,9 +134,9 @@ class Euroscope:
         if None != weather.Altitudes:
             for i in range(0, len(weather.Altitudes)):
                 entry = sequence.windData.add()
-                entry.altitude = weather.Altitudes[i]
-                entry.direction = weather.Directions[i]
-                entry.speed = weather.Windspeeds[i]
+                entry.altitude = int(weather.Altitudes[i])
+                entry.direction = int(weather.Directions[i])
+                entry.speed = int(weather.Windspeeds[i])
 
         # convert the inbound sequence
         for inbound in inbounds:
@@ -149,9 +149,9 @@ class Euroscope:
             for waypoint in inbound.PlannedArrivalRoute:
                 wp = entry.waypoints.add()
                 wp.name = waypoint.Waypoint.Name
-                wp.altitude = waypoint.Altitude
-                wp.indicatedAirspeed = waypoint.IndicatedAirspeed
-                wp.groundspeed = waypoint.GroundSpeed
+                wp.altitude = int(round(waypoint.Altitude))
+                wp.indicatedAirspeed = int(round(waypoint.IndicatedAirspeed))
+                wp.groundSpeed = int(round(waypoint.GroundSpeed))
 
                 pta = str(waypoint.PTA)
                 delimiter = pta.find('.')