parse the WebUI configuration
This commit is contained in:
		| @@ -294,6 +294,15 @@ class Airport: | ||||
|                 sys.exit(-1) | ||||
|             self.MaxDelayMay = timedelta(minutes=int(planning['maxdelaymay'])) | ||||
|  | ||||
|     def parseWebUI(self, webui): | ||||
|         self.IafColorization = {} | ||||
|  | ||||
|         for key in webui: | ||||
|             if 'iafcolorization' == key: | ||||
|                 elements = list(filter(None, webui[key].split(':'))) | ||||
|                 for i in range(0, len(elements), 4): | ||||
|                     self.IafColorization[elements[i]] = [ int(elements[i + 1]), int(elements[i + 2]), int(elements[i + 3]) ] | ||||
|  | ||||
|     def __init__(self, filepath : str, icao : str): | ||||
|         config = configparser.ConfigParser() | ||||
|         config.read(filepath) | ||||
| @@ -301,6 +310,7 @@ class Airport: | ||||
|         dataConfig = None | ||||
|         planningConfig = None | ||||
|         rhcConfig = None | ||||
|         webUiConfig = None | ||||
|  | ||||
|         # search the required sections | ||||
|         for key in config: | ||||
| @@ -310,6 +320,8 @@ class Airport: | ||||
|                 planningConfig = config['PLANNING'] | ||||
|             elif 'RHC' == key: | ||||
|                 rhcConfig = config['RHC'] | ||||
|             elif 'WEBUI' == key: | ||||
|                 webUiConfig = config['WEBUI'] | ||||
|  | ||||
|         # find the GNG-file data | ||||
|         sctFile, eseFile = Airport.findGngData(dataConfig, os.path.dirname(filepath)) | ||||
| @@ -332,6 +344,11 @@ class Airport: | ||||
|             sys.exit(-1) | ||||
|         self.RecedingHorizonControl = RHC(rhcConfig) | ||||
|  | ||||
|         # check if thw WebUI information is available | ||||
|         if None == webUiConfig: | ||||
|             sys.stderr.write('No WEBUI configuration found') | ||||
|             sys.exit(-1) | ||||
|  | ||||
|         # parse the GNG data | ||||
|         print('Used GNG-Data: ' + eseFile) | ||||
|         self.GngData = SctEseFormat(sctFile, eseFile, icao, requiredArrivalRoutes) | ||||
| @@ -346,6 +363,7 @@ class Airport: | ||||
|         self.parseDefaultSequencingConfiguration(icao, planningConfig) | ||||
|         self.parseConstraints(planningConfig) | ||||
|         self.parseRunwayAssignment(icao, planningConfig) | ||||
|         self.parseWebUI(webUiConfig) | ||||
|         self.assignmentUpdate(self.DefaultSequencing) | ||||
|  | ||||
|     def assignmentUpdate(self, sequenceConfig : AirportSequencing): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user