Browse Source

use the weather system in the central AMAN class

Sven Czarnian 3 years ago
parent
commit
b69c584fb4
1 changed files with 7 additions and 0 deletions
  1. 7 0
      aman/AMAN.py

+ 7 - 0
aman/AMAN.py

@@ -6,6 +6,7 @@ import sys
 
 from aman.com import AircraftReport_pb2
 from aman.com.Euroscope import Euroscope
+from aman.com.Weather import Weather
 from aman.config.AircraftPerformance import AircraftPerformance
 from aman.config.Airport import Airport
 from aman.config.System import System
@@ -29,6 +30,7 @@ class AMAN:
         self.systemConfig = None
         self.aircraftPerformance = None
         self.receiver = None
+        self.weather = None
         self.workers = []
         self.inbounds = {}
 
@@ -46,6 +48,8 @@ class AMAN:
         else:
             print('Parsed PerformanceData.ini. Extracted ' + str(len(self.aircraftPerformance.aircrafts)) + ' aircrafts')
 
+        self.weather = Weather(self.systemConfig.Weather)
+
         # find the airport configurations and create the workers
         airportsPath = os.path.join(os.path.join(configPath, 'airports'), '*.ini')
         for file in glob.glob(airportsPath):
@@ -67,6 +71,9 @@ class AMAN:
         if None != self.receiver:
             del self.receiver
         self.receiver = None
+        if None != self.weather:
+            del self.weather
+        self.weather = None
 
         for worker in self.workers:
             worker.stop()