瀏覽代碼

use the new protocol

Sven Czarnian 3 年之前
父節點
當前提交
92b7e9e429
共有 1 個文件被更改,包括 3 次插入5 次删除
  1. 3 5
      aman/com/Euroscope.py

+ 3 - 5
aman/com/Euroscope.py

@@ -28,16 +28,14 @@ class ComThread(Thread):
                 report.ParseFromString(msg)
 
                 # try to associate the received aircrafts to airports
-                icao = None
                 for inbound in report.reports:
                     self.AMAN.updateAircraftReport(inbound)
-                    icao = inbound.destination
 
                 # get the sequence of the airport
-                if None != icao:
-                    airport = self.AMAN.findAirport(icao)
+                if None != report.airport:
+                    airport = self.AMAN.findAirport(report.airport)
                     if None != airport:
-                        self.Com.sendSequence(icao, airport.inboundSequence(), airport.WeatherModel)
+                        self.Com.sendSequence(report.airport, airport.inboundSequence(), airport.WeatherModel)
 
             except zmq.ZMQError as error:
                 if zmq.EAGAIN == error.errno: