define member variables with capital letters

This commit is contained in:
Sven Czarnian
2021-10-13 12:52:29 +02:00
parent 9d69a60396
commit 1e043e2765
15 changed files with 229 additions and 223 deletions

View File

@@ -82,32 +82,32 @@ class SctEseFormat:
# extract all waypoints
for waypoint in config['VOR']:
waypoint = SctEseFormat.parseWaypoint(waypoint, 0, 2, 3)
self.waypoints.setdefault(waypoint.name, []).append(waypoint)
self.Waypoints.setdefault(waypoint.Name, []).append(waypoint)
for waypoint in config['NDB']:
waypoint = SctEseFormat.parseWaypoint(waypoint, 0, 1, 2)
self.waypoints.setdefault(waypoint.name, []).append(waypoint)
self.Waypoints.setdefault(waypoint.Name, []).append(waypoint)
for waypoint in config['FIXES']:
waypoint = SctEseFormat.parseWaypoint(waypoint, 0, 1, 2)
self.waypoints.setdefault(waypoint.name, []).append(waypoint)
self.Waypoints.setdefault(waypoint.Name, []).append(waypoint)
# extract the airports
for airport in config['AIRPORT']:
airport = SctEseFormat.parseWaypoint(airport, 0, 2, 3)
self.airports.setdefault(airport.name, []).append(airport)
self.Airports.setdefault(airport.Name, []).append(airport)
# extract the runways
for runway in config['RUNWAY']:
airport, runway0, runway1 = SctEseFormat.parseRunway(runway)
if None != airport:
if not airport in self.runways:
self.runways.setdefault(airport, [])
self.runways[airport].append(runway0)
self.runways[airport].append(runway1)
if not airport in self.Runways:
self.Runways.setdefault(airport, [])
self.Runways[airport].append(runway0)
self.Runways[airport].append(runway1)
def parseArrivalRoute(self, route : str, airport : Waypoint):
# split the route and validate that it is a STAR for the airport
split = route.split(':')
if 5 != len(split) or 'STAR' != split[0] or split[1] != airport.name:
if 5 != len(split) or 'STAR' != split[0] or split[1] != airport.Name:
return None
# find all waypoints
@@ -115,7 +115,7 @@ class SctEseFormat:
route = list(filter(None, split[4].split(' ')))
for waypoint in route:
# find the waypoint in the route
coordinates = self.waypoints[waypoint]
coordinates = self.Waypoints[waypoint]
# no waypoint with this name defined
if None == coordinates:
sys.stderr.write('Unable to find waypoint ' + waypoint)
@@ -150,10 +150,10 @@ class SctEseFormat:
foundSidsStars = False
# search the airport in the extracted list
if not airport in self.airports:
sys.stderr.write(airport + 'in self.airports', 'Unable to find the requested airport')
if not airport in self.Airports:
sys.stderr.write('Unable to find the requested airport')
sys.exit(-1)
airport = self.airports[airport][0]
airport = self.Airports[airport][0]
for key in config:
if 'SIDSSTARS' == key:
@@ -166,14 +166,14 @@ class SctEseFormat:
# parse all arrival routes
for line in config['SIDSSTARS']:
route = self.parseArrivalRoute(line, airport)
if None != route and route.name in allowedRoutes:
self.arrivalRoutes.setdefault(route.runway, []).append(route)
if None != route and route.Name in allowedRoutes:
self.ArrivalRoutes.setdefault(route.Runway, []).append(route)
def __init__(self, sctFilepath : str, eseFilepath : str, airport : str, allowedRoutes : list):
self.arrivalRoutes = {}
self.waypoints = {}
self.airports = {}
self.runways = {}
self.ArrivalRoutes = {}
self.Waypoints = {}
self.Airports = {}
self.Runways = {}
self.extractSctInformation(sctFilepath)
self.extractArrivalRoutes(eseFilepath, airport, allowedRoutes)