Changeset 1119:3d940600be4d


Ignore:
Timestamp:
10/31/23 16:09:41 (14 months ago)
Author:
István Váradi <ivaradi@…>
Branch:
python3
Phase:
public
Message:

The alternate airport need not be specified when using SimBrief (re #377).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/gui/flight.py

    r1118 r1119  
    30193019        return self._alternate.get_text()
    30203020
     3021    @alternate.setter
     3022    def alternate(self, a):
     3023        """Set the ICAO code of the alternate airport."""
     3024        self._alternate.set_text(a)
     3025
    30213026    def activate(self):
    30223027        """Setup the route from the booked flight."""
     
    30433048        alternate = self._alternate.get_text()
    30443049        if useSimBrief:
    3045             self._button.set_sensitive(len(alternate)==4 or self._wizard.entranceExam)
     3050            self._button.set_sensitive(len(alternate)==0 or len(alternate)==4
     3051                                       or self._wizard.entranceExam)
    30463052        else:
    30473053            cruiseLevelText = self._cruiseLevel.get_text()
     
    37273733        if filedCruiseAltitude>0:
    37283734            plan["fl"] = filedCruiseAltitude
    3729         plan["altn"] = wizard.alternate
     3735
     3736        alternate = wizard.alternate
     3737        if alternate:
     3738            plan["altn"] = wizard.alternate
    37303739
    37313740        plan["addedfuel"] = str(self._extraFuel.get_int() / 1000.0)
     
    38403849                        if destinationElement.tag == "plan_rwy":
    38413850                            flightInfo["arr_rwy"] = destinationElement.text
     3851                elif element.tag == "alternate":
     3852                    alternateElementList = list(element)
     3853                    for alternateElement in alternateElementList:
     3854                        if alternateElement.tag == "icao_code":
     3855                            flightInfo["altn_icao"] = alternateElement.text
    38423856                elif element.tag == "fuel":
    38433857                    fuelElementList = list(element)
     
    39393953            self._wizard.departureSID = sid
    39403954            self._wizard.arrivalSTAR = star
     3955
     3956            self._wizard.alternate = flightInfo["altn_icao"]
    39413957
    39423958            takeoffRunway = flightInfo["dep_rwy"]
     
    65066522        """Get the ICAO code of the alternate airport."""
    65076523        return self._routePage.alternate
     6524
     6525    @alternate.setter
     6526    def alternate(self, a):
     6527        """Set the ICAO code of the alternate airport."""
     6528        self._routePage.alternate = a
    65086529
    65096530    @property
Note: See TracChangeset for help on using the changeset viewer.