Changeset 262:16f4855e111a for src


Ignore:
Timestamp:
06/27/12 17:31:51 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

The PIREP constructor gets the flight object instead of the GUI

Location:
src/mlx
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/flight.py

    r241 r262  
    8383
    8484    @property
     85    def cargoWeight(self):
     86        """Get the cargo weight for the flight."""
     87        return self._gui.cargoWeight
     88
     89    @property
    8590    def zfw(self):
    8691        """Get the Zero-Fuel Weight of the flight."""
     
    8893
    8994    @property
     95    def filedCruiseAltitude(self):
     96        """Get the filed cruise altitude."""
     97        return self._gui.filedCruiseAltitude
     98
     99    @property
    90100    def cruiseAltitude(self):
    91101        """Get the cruise altitude of the flight."""
     
    93103
    94104    @property
     105    def route(self):
     106        """Get the route of the flight."""
     107        return self._gui.route
     108
     109    @property
     110    def departureMETAR(self):
     111        """Get the departure METAR of the flight."""
     112        return self._gui.departureMETAR
     113
     114    @property
     115    def arrivalMETAR(self):
     116        """Get the arrival METAR of the flight."""
     117        return self._gui.arrivalMETAR
     118
     119    @property
     120    def departureRunway(self):
     121        """Get the departure runway."""
     122        return self._gui.departureRunway
     123
     124    @property
     125    def sid(self):
     126        """Get the SID followed."""
     127        return self._gui.sid
     128
     129    @property
    95130    def v1(self):
    96131        """Get the V1 speed of the flight."""
     
    108143
    109144    @property
     145    def star(self):
     146        """Get the STAR planned."""
     147        return self._gui.star
     148
     149    @property
     150    def transition(self):
     151        """Get the transition planned."""
     152        return self._gui.transition
     153
     154    @property
     155    def approachType(self):
     156        """Get the approach type."""
     157        return self._gui.approachType
     158
     159    @property
     160    def arrivalRunway(self):
     161        """Get the arrival runway."""
     162        return self._gui.arrivalRunway
     163
     164    @property
    110165    def vref(self):
    111166        """Get the VRef speed of the flight."""
     
    116171        """Get the touchdown rate if known, None otherwise."""
    117172        return self._tdRate
     173
     174    @property
     175    def flightType(self):
     176        """Get the type of the flight."""
     177        return self._gui.flightType
     178
     179    @property
     180    def online(self):
     181        """Get whether the flight was an online flight."""
     182        return self._gui.online
     183
     184    @property
     185    def comments(self):
     186        """Get the comments made by the pilot."""
     187        return self._gui.comments
     188
     189    @property
     190    def flightDefects(self):
     191        """Get the flight defects reported by the pilot."""
     192        return self._gui.flightDefects
     193
     194    @property
     195    def delayCodes(self):
     196        """Get the delay codes."""
     197        return self._gui.delayCodes
    118198
    119199    @property
  • src/mlx/gui/flight.py

    r242 r262  
    25462546
    25472547        if result==RESPONSETYPE_OK:
    2548             pirep = PIREP(gui)
     2548            pirep = PIREP(gui.flight)
    25492549
    25502550            self._lastSavePath = text2unicode(dialog.get_filename())
     
    26032603    def _sendClicked(self, button):
    26042604        """Called when the Send button is clicked."""
    2605         pirep = PIREP(self._wizard.gui)
     2605        pirep = PIREP(self._wizard.gui.flight)
    26062606        self._wizard.gui.sendPIREP(pirep,
    26072607                                   callback = self._handlePIREPSent)
  • src/mlx/pirep.py

    r220 r262  
    3939            return None
    4040       
    41     def __init__(self, gui):
    42         """Initialize the PIREP from the given GUI."""
    43         self.bookedFlight = gui.bookedFlight
    44         self.cargoWeight = gui.cargoWeight
     41    def __init__(self, flight):
     42        """Initialize the PIREP from the given flight."""
     43        self.bookedFlight = flight.bookedFlight
     44        self.cargoWeight = flight.cargoWeight
    4545       
    46         self.filedCruiseAltitude = gui.filedCruiseAltitude
    47         self.cruiseAltitude = gui.cruiseAltitude
    48         self.route = gui.route
     46        self.filedCruiseAltitude = flight.filedCruiseAltitude
     47        self.cruiseAltitude = flight.cruiseAltitude
     48        self.route = flight.route
    4949
    50         self.departureMETAR = gui.departureMETAR.upper()
    51         self.arrivalMETAR = gui.arrivalMETAR.upper()
     50        self.departureMETAR = flight.departureMETAR.upper()
     51        self.arrivalMETAR = flight.arrivalMETAR.upper()
    5252
    53         self.departureRunway = gui.departureRunway.upper()
    54         self.sid = gui.sid.upper()
     53        self.departureRunway = flight.departureRunway.upper()
     54        self.sid = flight.sid.upper()
    5555
    56         self.star = gui.star
    57         self.transition = gui.transition
    58         self.approachType = gui.approachType.upper()
    59         self.arrivalRunway = gui.arrivalRunway.upper()
     56        self.star = flight.star
     57        self.transition = flight.transition
     58        self.approachType = flight.approachType.upper()
     59        self.arrivalRunway = flight.arrivalRunway.upper()
    6060
    61         self.flightType = gui.flightType
    62         self.online = gui.online
     61        self.flightType = flight.flightType
     62        self.online = flight.online
    6363
    64         self.comments = gui.comments
    65         self.flightDefects = gui.flightDefects
    66         self.delayCodes = gui.delayCodes
     64        self.comments = flight.comments
     65        self.flightDefects = flight.flightDefects
     66        self.delayCodes = flight.delayCodes
    6767       
    68         flight = gui.flight
    6968        self.blockTimeStart = flight.blockTimeStart
    7069        self.flightTimeStart = flight.flightTimeStart
     
    7473        self.fuelUsed = flight.startFuel - flight.endFuel
    7574
    76         logger = gui.logger
     75        logger = flight.logger
    7776        self.rating = logger.getRating()
    7877        self.logLines = logger.lines
Note: See TracChangeset for help on using the changeset viewer.