Changeset 314:09f49b9eef64 for src/mlx
- Timestamp:
- 09/30/12 06:53:14 (12 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/mlx
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/checks.py
r307 r314 301 301 def _changed(self, oldState, state): 302 302 """Determine if the value has changed.""" 303 return self._getValue(oldState)!=self._getValue(state) 303 currentValue = self._getValue(state) 304 return currentValue is not None and self._getValue(oldState)!=currentValue 304 305 305 306 #--------------------------------------------------------------------------------------- … … 759 760 def isCondition(self, flight, aircraft, oldState, state): 760 761 """Check if the fault condition holds.""" 761 return (flight.stage==const.STAGE_BOARDING and \ 762 state.landingLightsOn and state.onTheGround) or \ 763 (flight.stage==const.STAGE_TAKEOFF and \ 764 not state.landingLightsOn and not state.onTheGround) or \ 765 (flight.stage in [const.STAGE_CLIMB, const.STAGE_CRUISE, 766 const.STAGE_DESCENT] and \ 767 state.landingLightsOn and state.altitude>12500) or \ 768 (flight.stage==const.STAGE_LANDING and \ 769 not state.landingLightsOn and state.onTheGround) or \ 770 (flight.stage==const.STAGE_PARKING and \ 771 state.landingLightsOn and state.onTheGround) 762 return state.landingLightsOn is not None and \ 763 ((flight.stage==const.STAGE_BOARDING and \ 764 state.landingLightsOn and state.onTheGround) or \ 765 (flight.stage==const.STAGE_TAKEOFF and \ 766 not state.landingLightsOn and not state.onTheGround) or \ 767 (flight.stage in [const.STAGE_CLIMB, const.STAGE_CRUISE, 768 const.STAGE_DESCENT] and \ 769 state.landingLightsOn and state.altitude>12500) or \ 770 (flight.stage==const.STAGE_LANDING and \ 771 not state.landingLightsOn and state.onTheGround) or \ 772 (flight.stage==const.STAGE_PARKING and \ 773 state.landingLightsOn and state.onTheGround)) 772 774 773 775 def logFault(self, flight, aircraft, logger, oldState, state): -
src/mlx/fs.py
r298 r314 215 215 - antiCollisionLightsOn: a boolean indicating if the anti-collision lights are on 216 216 - strobeLightsOn: a boolean indicating if the strobe lights are on 217 - landingLightsOn: a boolean indicating if the landing lights are on 217 - landingLightsOn: a boolean indicating if the landing lights are on. If 218 the detection of the state of the landing lights is unreliable, and should 219 not be considered, this is set to None. 218 220 - pitotHeatOn: a boolean indicating if the pitot heat is on 219 221 - parking: a boolean indicating if the parking brake is set … … 225 227 (float) 226 228 - altimeter: the altimeter setting in hPa (float) 227 - nav1: the frequency of the NAV1 radio in MHz (string) 228 - nav2: the frequency of the NAV1 radio in MHz (string) 229 - nav1: the frequency of the NAV1 radio in MHz (string). Can be None, if 230 the frequency is unreliable or meaningless. 231 - nav2: the frequency of the NAV1 radio in MHz (string). Can be None, if 232 the frequency is unreliable or meaningless. 229 233 - squawk: the transponder code (string) 230 234 - windSpeed: the speed of the wind at the aircraft in knots (float) -
src/mlx/fsuipc.py
r298 r314 896 896 return False 897 897 898 print "fsuipc.Simulator: new aircraft name and air file path: %s, %s" % \ 899 (name, airPath) 900 898 901 self._aircraftName = aircraftName 899 902 needNew = self._aircraftModel is None … … 1661 1664 1662 1665 return state 1666 1663 1667 #------------------------------------------------------------------------------ 1664 1668 … … 1696 1700 """Get the name for this aircraft model.""" 1697 1701 return "FSUIPC/Generic Fokker 70" 1702 1703 #------------------------------------------------------------------------------ 1704 1705 class DAF70Model(F70Model): 1706 """Model for the Digital Aviation F70 implementation on FS9.""" 1707 @staticmethod 1708 def doesHandle(aircraft, (name, airPath)): 1709 """Determine if this model handler handles the aircraft with the given 1710 name.""" 1711 return aircraft.type == const.AIRCRAFT_F70 and \ 1712 (airPath.endswith("fokker70_2k4_v4.1.air") or 1713 airPath.endswith("fokker70_2k4_v4.3.air")) 1714 1715 @property 1716 def name(self): 1717 """Get the name for this aircraft model.""" 1718 return "FSUIPC/Digital Aviation Fokker 70" 1719 1720 def getAircraftState(self, aircraft, timestamp, data): 1721 """Get the aircraft state. 1722 1723 Get it from the parent, and then invert the pitot heat state.""" 1724 state = super(DAF70Model, self).getAircraftState(aircraft, 1725 timestamp, 1726 data) 1727 state.landingLightsOn = None 1728 state.nav2 = None 1729 1730 return state 1698 1731 1699 1732 #------------------------------------------------------------------------------ … … 1881 1914 AircraftModel.registerSpecial(PMDGBoeing737NGModel) 1882 1915 AircraftModel.registerSpecial(DreamwingsDH8DModel) 1883 1884 #------------------------------------------------------------------------------ 1916 AircraftModel.registerSpecial(DAF70Model) 1917 1918 #------------------------------------------------------------------------------ -
src/mlx/gui/monitor.py
r300 r314 191 191 192 192 self.add(alignment) 193 194 self._previousState = None 193 195 194 196 self.setData() … … 249 251 self._antiCollisionLightsOn.set_sensitive(False) 250 252 self._strobeLightsOn.set_sensitive(False) 253 self._landingLightsOn.set_text("LANDING") 251 254 self._landingLightsOn.set_sensitive(False) 252 255 self._pitotHeatOn.set_sensitive(False) … … 285 288 self._altimeter.set_text("%.0f" % (aircraftState.altimeter,)) 286 289 self._squawk.set_text(aircraftState.squawk) 287 self._nav1.set_text( aircraftState.nav1)288 self._nav2.set_text( aircraftState.nav2)290 self._nav1.set_text("-" if aircraftState.nav1 is None else aircraftState.nav1) 291 self._nav2.set_text("-" if aircraftState.nav2 is None else aircraftState.nav2) 289 292 290 293 fuelStr = "" … … 317 320 self._antiCollisionLightsOn.set_sensitive(aircraftState.antiCollisionLightsOn) 318 321 self._strobeLightsOn.set_sensitive(aircraftState.strobeLightsOn) 319 self._landingLightsOn.set_sensitive(aircraftState.landingLightsOn) 322 323 if self._previousState is None or \ 324 ((self._previousState.landingLightsOn is None)!= 325 (aircraftState.landingLightsOn is None)): 326 if aircraftState.landingLightsOn is None: 327 self._landingLightsOn.set_markup('<span strikethrough="true">LANDING</span>') 328 else: 329 self._landingLightsOn.set_text("LANDING") 330 self._landingLightsOn.set_sensitive(aircraftState.landingLightsOn is True) 331 320 332 self._pitotHeatOn.set_sensitive(aircraftState.pitotHeatOn) 321 333 self._parking.set_sensitive(aircraftState.parking) -
src/mlx/pyuipc_sim.py
r298 r314 1330 1330 def do_set(self, args): 1331 1331 """Handle the set command.""" 1332 arguments = args.split() 1332 arguments = [] 1333 inWord = False 1334 inQuote = False 1335 word = "" 1336 for c in args: 1337 if c.isspace() and not inQuote: 1338 if inWord: 1339 arguments.append(word) 1340 word = "" 1341 inWord = False 1342 elif c=='"': 1343 inQuote = not inQuote 1344 else: 1345 inWord = True 1346 word += c 1347 1348 if inWord: 1349 arguments.append(word) 1350 1333 1351 names = [] 1334 1352 data = []
Note:
See TracChangeset
for help on using the changeset viewer.