Changeset 26:86eae254f951


Ignore:
Timestamp:
02/19/12 15:01:54 (13 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Modified some checks to work with the Tupolev aircraft

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • .hgignore

    r20 r26  
    44dist/.+
    55build/.+
     6mlx-common.nsh
  • src/checks.py

    r25 r26  
    476476    def isCondition(self, flight, aircraft, oldState, state):
    477477        """Check if the fault condition holds."""
     478        isTupolev = aircraft.type in [const.AIRCRAFT_T134,
     479                                      const.AIRCRAFT_T154]
    478480        return (flight.stage!=const.STAGE_PARKING or \
    479481                not flight.options.fs2Crew) and \
    480482                not state.antiCollisionLightsOn and \
    481                 max(state.n1)>5
     483                ((isTupolev and max(state.n1[1:])>5) or \
     484                 (not isTupolev and max(state.n1)>5))
    482485
    483486    def logFault(self, flight, aircraft, logger, oldState, state):
     
    835838    def isCondition(self, flight, aircraft, oldState, state):
    836839        """Check if the fault condition holds."""
    837         return (flight.stage==const.STAGE_BOARDING and \
    838                 state.strobeLightsOn and state.onTheGround) or \
    839                (flight.stage==const.STAGE_TAKEOFF and \
    840                 not state.strobeLightsOn and not state.gearsDown) or \
    841                (flight.stage in [const.STAGE_CLIMB, const.STAGE_CRUISE,
    842                                  const.STAGE_DESCENT] and \
    843                 not state.strobeLightsOn and not state.onTheGround) or \
    844                (flight.stage==const.STAGE_PARKING and \
    845                 state.strobeLightsOn and state.onTheGround)
     840        if aircraft.type in [const.AIRCRAFT_T134,
     841                             const.AIRCRAFT_T154,
     842                             const.AIRCRAFT_YK40]:
     843            return False
     844        else:
     845            return (flight.stage==const.STAGE_BOARDING and \
     846                    state.strobeLightsOn and state.onTheGround) or \
     847                   (flight.stage==const.STAGE_TAKEOFF and \
     848                    not state.strobeLightsOn and not state.gearsDown) or \
     849                   (flight.stage in [const.STAGE_CLIMB, const.STAGE_CRUISE,
     850                                     const.STAGE_DESCENT] and \
     851                   not state.strobeLightsOn and not state.onTheGround) or \
     852                   (flight.stage==const.STAGE_PARKING and \
     853                    state.strobeLightsOn and state.onTheGround)
    846854               
    847855    def logFault(self, flight, aircraft, logger, oldState, state):
  • src/fsuipc.py

    r23 r26  
    1212import calendar
    1313import sys
     14import codecs
    1415
    1516if os.name == "nt":
     
    474475        self._flareStart = None
    475476        self._flareStartFS = None
    476        
     477   
     478        self._latin1decoder = codecs.getdecoder("iso-8859-1")
     479   
    477480    def connect(self, aircraft):
    478481        """Initiate a connection to the simulator."""
     
    592595        if needNew:
    593596            self._setAircraftModel(AircraftModel.create(self._aircraft, aircraftName))
    594        
    595         self._aircraft.modelChanged(timestamp, name, self._aircraftModel.name)       
     597 
     598       
     599        self._aircraft.modelChanged(timestamp, self._latin1decoder(name),
     600                                    self._aircraftModel.name)       
    596601
    597602        return needNew
  • src/mlx.py

    r24 r26  
    392392        table.attach(self._nav2, 11, 12, 3, 4)
    393393
    394         (label, self._fuel) = self._createLabeledEntry("Fuel:", 20, xalign = 0.0)
     394        (label, self._fuel) = self._createLabeledEntry("Fuel:", 40, xalign = 0.0)
    395395        table.attach(label, 0, 1, 4, 5)
    396396        table.attach(self._fuel, 1, 4, 4, 5)
     
    521521            for fuel in aircraftState.fuel:
    522522                if fuelStr: fuelStr += ", "
    523                 fuelStr += "%.0f" % (fuel,)
     523                fuelStr += "%.0f" % (fuel,)               
    524524            self._fuel.set_text(fuelStr)
    525525
Note: See TracChangeset for help on using the changeset viewer.