Skip to content

Commit 84c0708

Browse files
committed
Restore original location resolution logic and deterministic revision fallback
1 parent 250d2e8 commit 84c0708

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

mslib/msui/flighttrack.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,12 @@ class Waypoint:
143143
def __init__(self, lat=0., lon=0., flightlevel=0., location="", comments=""):
144144
self.location = location
145145

146-
# Always trust explicitly provided coordinates first
147-
self.lat = lat
148-
self.lon = lon
149-
150-
# Only resolve location name if coordinates are truly missing
151-
if (lat is None or lon is None) and location:
152-
locations = config_loader(dataset='locations')
153-
if location in locations:
154-
self.lat, self.lon = locations[location]
146+
locations = config_loader(dataset='locations')
147+
if location in locations:
148+
self.lat, self.lon = locations[location]
149+
else:
150+
self.lat = lat
151+
self.lon = lon
155152

156153
self.flightlevel = flightlevel
157154
self.pressure = thermolib.flightlevel2pressure(flightlevel * units.hft).magnitude
@@ -717,7 +714,11 @@ def load_from_xml_data(self, xml_content, name="Flight track"):
717714
revision_name = rev_el.getAttribute("name") or None
718715
self.revision = Revision(revision_id, revision_name)
719716
else:
720-
self.revision = None
717+
# Backward compatibility: create deterministic default revision
718+
self.revision = Revision(
719+
revision_id=0,
720+
name=None
721+
)
721722

722723
# Validate only waypoint structure, revision is optional metadata
723724
_waypoints_list = load_from_xml_data(xml_content, name)

0 commit comments

Comments
 (0)