Changeset 1141:83f0b56057bf for src


Ignore:
Timestamp:
04/21/24 14:01:13 (7 months ago)
Author:
István Váradi <ivaradi@…>
Branch:
python3
Phase:
public
Message:

Function on BookedFlight to get the adult passenger weight (re #386)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/rpc.py

    r1134 r1141  
    371371
    372372    @property
     373    def passengerWeight(self):
     374        """Get the passenger (adult) weight for the flight."""
     375        return const.getPassengerWeight(self.flightType)
     376
     377    @property
    373378    def payload(self):
    374379        """Get the default payload of the flight."""
    375380        payload= (self.numCabinCrew - self.dowNumCabinCrew) *  \
    376381            const.WEIGHT_CABIN_CREW
    377         payload += self.numPassengers * \
    378             (const.WEIGHT_PASSENGER_CHARTER
    379              if self.flightType==const.FLIGHTTYPE_CHARTER
    380              else const.WEIGHT_PASSENGER)
     382        payload += self.numPassengers * self.passengerWeight
    381383        payload += self.numChildren * const.WEIGHT_CHILD
    382384        payload += self.numInfants * const.WEIGHT_INFANT
Note: See TracChangeset for help on using the changeset viewer.