Przeglądaj źródła

publish the used wind data as well

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

+ 14 - 1
aman/com/Euroscope.py

@@ -123,22 +123,35 @@ class Euroscope:
 
         self.Context = None
 
-    def sendSequence(self, airport : str, inbounds):
+    def sendSequence(self, airport : str, inbounds, weather):
         if None == self.NotificationSocket:
             return
 
         sequence = Communication_pb2.AircraftSequence()
         sequence.airport = airport
 
+        # convert the wind data
+        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]
+
+        # convert the inbound sequence
         for inbound in inbounds:
             entry = sequence.sequence.add()
             entry.callsign = inbound.Callsign
+            entry.fixed = inbound.FixedSequence
             entry.arrivalRoute = inbound.PlannedStar.Name
             entry.arrivalRunway = inbound.PlannedRunway.Name
 
             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
 
                 pta = str(waypoint.PTA)
                 delimiter = pta.find('.')