publish the used wind data as well

This commit is contained in:
Sven Czarnian
2021-11-13 09:57:23 +01:00
parent 46e04fca23
commit 39dcd03458

View File

@@ -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('.')