add the WebUI to the system
This commit is contained in:
		| @@ -5,6 +5,7 @@ import sys | ||||
| import time | ||||
|  | ||||
| from aman.com import Weather | ||||
| from aman.com.WebUI import WebUI | ||||
| from aman.config.Airport import Airport | ||||
| from aman.sys.aco.Colony import Colony | ||||
| from aman.sys.aco.Configuration import Configuration | ||||
| @@ -24,11 +25,12 @@ class Worker(Thread): | ||||
|         self.ReportQueue = {} | ||||
|         self.WeatherModel = None | ||||
|         self.RecedingHorizonControl = None | ||||
|         self.WebUi = None | ||||
|  | ||||
|     def __del__(self): | ||||
|         self.release() | ||||
|  | ||||
|     def acquire(self, icao : str, configuration : Airport, weather : Weather, performance : PerformanceData): | ||||
|     def acquire(self, icao : str, configuration : Airport, weather : Weather, performance : PerformanceData, webui : WebUI): | ||||
|         self.StopThread = None | ||||
|         self.Icao = icao | ||||
|         self.Configuration = configuration | ||||
| @@ -38,6 +40,7 @@ class Worker(Thread): | ||||
|         self.ReportQueue = {} | ||||
|         self.WeatherModel = WeatherModel(configuration.GaforId, weather) | ||||
|         self.RecedingHorizonControl = RecedingHorizonControl(configuration.RecedingHorizonControl) | ||||
|         self.WebUi = webui | ||||
|  | ||||
|         # merge the constraint information with the GNG information | ||||
|         for runway in self.Configuration.GngData.ArrivalRoutes: | ||||
| @@ -81,7 +84,7 @@ class Worker(Thread): | ||||
|         while None == self.StopThread: | ||||
|             time.sleep(1) | ||||
|             counter += 1 | ||||
|             if 0 != (counter % 60): | ||||
|             if 0 != (counter % 10): | ||||
|                 continue | ||||
|  | ||||
|             self.acquireLock() | ||||
| @@ -135,4 +138,9 @@ class Worker(Thread): | ||||
|             else: | ||||
|                 print('No relevant inbounds found for the optimization in ' + self.Icao) | ||||
|  | ||||
|             # send the sequence to the GUI | ||||
|             self.WebUi.sendSequence(self.Icao, self.RecedingHorizonControl.sequence()) | ||||
|  | ||||
|             # TODO send the sequence to EuroScope | ||||
|  | ||||
|             self.releaseLock() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user