redefine the constructor to be more flexible with constraints, etc.
This commit is contained in:
@@ -31,15 +31,15 @@ class SctEseFormat:
|
||||
if len(split) <= longitudeIdx:
|
||||
sys.stderr.write('Invalid waypoint format: ' + waypoint)
|
||||
sys.exit(-1)
|
||||
return Waypoint(split[nameIdx], Waypoint.dms2dd(split[latitudeIdx]), Waypoint.dms2dd(split[longitudeIdx]))
|
||||
return Waypoint(name = split[nameIdx], latitude = split[latitudeIdx], longitude = split[longitudeIdx])
|
||||
|
||||
def parseRunway(runway : str):
|
||||
split = list(filter(None, runway.split(' ')))
|
||||
if 9 != len(split) or '' == split[8]:
|
||||
return None, None, None
|
||||
|
||||
waypoint0 = Waypoint(split[0], Waypoint.dms2dd(split[4]), Waypoint.dms2dd(split[5]))
|
||||
waypoint1 = Waypoint(split[1], Waypoint.dms2dd(split[6]), Waypoint.dms2dd(split[7]))
|
||||
waypoint0 = Waypoint(name = split[0], latitude = split[4], longitude = split[5])
|
||||
waypoint1 = Waypoint(name = split[1], latitude = split[6], longitude = split[7])
|
||||
|
||||
return split[8], Runway(waypoint0, waypoint1), Runway(waypoint1, waypoint0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user