Changeset 209:3172e5cab96e


Ignore:
Timestamp:
05/31/12 15:20:55 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

The position of the gear control lever is logged

Location:
src/mlx
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/checks.py

    r197 r209  
    455455        """Construct the logger."""
    456456        StateChangeLogger.__init__(self, logInitial = True)
    457         SingleValueMixin.__init__(self, "gearsDown")
     457        SingleValueMixin.__init__(self, "gearControlDown")
    458458
    459459    def _getMessage(self, state):
    460460        """Get the message to log on a change."""
    461         return "Gears %s at %.0f knots, %.0f feet" % \
    462             ("DOWN" if state.gearsDown else "UP", state.ias, state.altitude)
     461        return "Gears SET to %s at %.0f knots, %.0f feet" % \
     462            ("DOWN" if state.gearControlDown else "UP",
     463             state.ias, state.altitude)
    463464
    464465#---------------------------------------------------------------------------------------
  • src/mlx/fs.py

    r197 r209  
    201201    - pitotHeatOn: a boolean indicating if the pitot heat is on
    202202    - parking: a boolean indicating if the parking brake is set
     203    - gearControlDown: a boolean indicating if the gear control is set to down
    203204    - gearsDown: a boolean indicating if the gears are down
    204205    - spoilersArmed: a boolean indicating if the spoilers have been armed for
  • src/mlx/fsuipc.py

    r191 r209  
    11451145                      ("pitot", 0x029c, "b"),
    11461146                      ("parking", 0x0bc8, "H"),
     1147                      ("gearControl", 0x0be8, "d"),
    11471148                      ("noseGear", 0x0bec, "d"),
    11481149                      ("spoilersArmed", 0x0bcc, "d"),
     
    13081309        state.parking = data[self._monidx_parking]!=0
    13091310
     1311        state.gearControlDown = data[self._monidx_gearControl]==16383
    13101312        state.gearsDown = data[self._monidx_noseGear]==16383
    13111313
  • src/mlx/gui/monitor.py

    r202 r209  
    141141
    142142        self._antiCollisionLightsOn = gtk.Label("ANTICOLLISION")
    143         table.attach(self._antiCollisionLightsOn, 1, 3, 5, 6)
     143        table.attach(self._antiCollisionLightsOn, 1, 2, 5, 6)
    144144
    145145        self._strobeLightsOn = gtk.Label("STROBE")
    146         table.attach(self._strobeLightsOn, 3, 4, 5, 6)
     146        table.attach(self._strobeLightsOn, 2, 3, 5, 6)
    147147
    148148        self._landingLightsOn = gtk.Label("LANDING")
    149         table.attach(self._landingLightsOn, 4, 5, 5, 6)
     149        table.attach(self._landingLightsOn, 3, 4, 5, 6)
    150150
    151151        self._pitotHeatOn = gtk.Label("PITOT HEAT")
    152         table.attach(self._pitotHeatOn, 5, 7, 5, 6)
     152        table.attach(self._pitotHeatOn, 4, 5, 5, 6)
    153153
    154154        self._parking = gtk.Label("PARKING")
    155         table.attach(self._parking, 7, 8, 5, 6)
     155        table.attach(self._parking, 5, 6, 5, 6)
     156
     157        self._gearControlDown = gtk.Label("GEAR LEVER DOWN")
     158        table.attach(self._gearControlDown, 6, 8, 5, 6)
    156159
    157160        self._gearsDown = gtk.Label("GEARS DOWN")
     
    241244            self._pitotHeatOn.set_sensitive(False)
    242245            self._parking.set_sensitive(False)
     246            self._gearControlDown.set_sensitive(False)
    243247            self._gearsDown.set_sensitive(False)
    244248            self._spoilersArmed.set_sensitive(False)
     
    308312            self._pitotHeatOn.set_sensitive(aircraftState.pitotHeatOn)
    309313            self._parking.set_sensitive(aircraftState.parking)
     314            self._gearControlDown.set_sensitive(aircraftState.gearControlDown)
    310315            self._gearsDown.set_sensitive(aircraftState.gearsDown)
    311316            self._spoilersArmed.set_sensitive(aircraftState.spoilersArmed)
  • src/mlx/pyuipc_sim.py

    r177 r209  
    229229        self.parking = True
    230230
     231        self.gearControl = 1.0
    231232        self.noseGear = 1.0
    232233
     
    385386        elif offset==0x0be0 or offset==0x0be4:    # Flaps left and  right
    386387            return self.flaps * 16383.0 / self.flapsNotches[-1]       
     388        elif offset==0x0be8:       # Gear control
     389            return int(self.gearControl * 16383.0)
    387390        elif offset==0x0bec:       # Nose gear
    388391            return int(self.noseGear * 16383.0)
     
    602605        elif offset==0x0be0 or offset==0x0be4:    # Flaps left and  right
    603606            self.flaps = value * self.flapsNotches[-1] / 16383.0
     607        elif offset==0x0be8:       # Gear control
     608            self.gearControl = value / 16383.0
    604609        elif offset==0x0bec:       # Nose gear
    605610            self.noseGear = value / 16383.0
     
    10921097        self._valueHandlers["pitot"] = (0x029c, "b", CLI.bool2str, CLI.str2bool)
    10931098        self._valueHandlers["parking"] = (0x0bc8, "H", CLI.bool2str, CLI.str2bool)
     1099        self._valueHandlers["gearControl"] = (0x0be8, "d",
     1100                                              lambda value: value * 100.0 / 16383.0,
     1101                                              lambda word: int(float(word) *
     1102                                                               16383.0 / 100.0))
    10941103        self._valueHandlers["noseGear"] = (0x0bec, "d",
    10951104                                           lambda value: value * 100.0 / 16383.0,
Note: See TracChangeset for help on using the changeset viewer.