use the weather system in the central AMAN class

This commit is contained in:
Sven Czarnian
2021-09-24 22:11:15 +02:00
parent af52103ec8
commit b69c584fb4

View File

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