Changeset 263:7ee78a903649
- Timestamp:
- 06/28/12 17:24:45 (12 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/mlx
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/acft.py
r243 r263 669 669 - rpm: left, right 670 670 - reverser: left, right.""" 671 fuelTanks = [const.FUELTANK_LEFT_AUX, const.FUELTANK_LEFT, 672 const.FUELTANK_RIGHT, const.FUELTANK_RIGHT_AUX] 671 fuelTanks = [const.FUELTANK_LEFT, const.FUELTANK_CENTRE, const.FUELTANK_RIGHT] 672 # fuelTanks = [const.FUELTANK_LEFT_AUX, const.FUELTANK_LEFT, 673 # const.FUELTANK_RIGHT, const.FUELTANK_RIGHT_AUX] 673 674 674 675 def __init__(self, flight): -
src/mlx/checks.py
r243 r263 572 572 """Determine if the engines are in such a state that the lights should 573 573 be on.""" 574 return max(state.n1)>5 574 if state.n1 is not None: 575 return max(state.n1)>5 576 elif state.rpm is not None: 577 return max(state.rpm)>0 578 else: 579 return False 575 580 576 581 #--------------------------------------------------------------------------------------- … … 582 587 """Determine if the engines are in such a state that the lights should 583 588 be on.""" 584 return max(state.n1[1:])>5 585 589 return max(state.n1[1:])>5 586 590 587 591 #--------------------------------------------------------------------------------------- 588 592 589 593 class BankChecker(SimpleFaultChecker): 590 """Check for the anti-collision light being off at high N1 values."""594 """Check for the bank is within limits.""" 591 595 def isCondition(self, flight, aircraft, oldState, state): 592 596 """Check if the fault condition holds.""" … … 973 977 def isCondition(self, flight, aircraft, oldState, state): 974 978 """Check if the fault condition holds.""" 975 return flight.stage==const.STAGE_TAKEOFF and max(state.n1)>97 979 return flight.stage==const.STAGE_TAKEOFF and \ 980 state.n1 is not None and max(state.n1)>97 976 981 977 982 def logFault(self, flight, aircraft, logger, oldState, state): 978 983 """Log the fault.""" 979 print state.n1980 984 flight.handleFault(ThrustChecker, state.timestamp, 981 985 FaultChecker._appendDuring(flight, -
src/mlx/fs.py
r243 r263 188 188 - n1[]: the N1 values of the turbine engines (array of floats 189 189 of as many items as the number of engines, present only for aircraft with 190 turbines )190 turbines, for other aircraft it is None) 191 191 - rpm[]: the RPM values of the piston engines (array of floats 192 192 of as many items as the number of engines, present only for aircraft with 193 pistons )193 pistons, for other aircraft it is None) 194 194 - reverser[]: an array of booleans indicating if the thrust reversers are 195 195 activated on any of the engines. The number of items equals to the number -
src/mlx/fsuipc.py
r243 r263 1388 1388 self._addOffsetWithIndexMember(data, offset+4, "u") # tank capacity 1389 1389 1390 if self._isN1: 1391 self._engineStartIndex = len(data) 1392 for i in range(0, self._numEngines): 1390 self._engineStartIndex = len(data) 1391 for i in range(0, self._numEngines): 1392 self._addOffsetWithIndexMember(data, 0x088c + i * 0x98, "h") # throttle lever 1393 if self._isN1: 1393 1394 self._addOffsetWithIndexMember(data, 0x2000 + i * 0x100, "f") # N1 1394 self._addOffsetWithIndexMember(data, 0x088c + i * 0x98, "h") # throttle lever 1395 else: 1396 self._addOffsetWithIndexMember(data, 0x0898 + i * 0x98, "H") # RPM 1397 self._addOffsetWithIndexMember(data, 0x08c8 + i * 0x98, "H") # RPM scaler 1395 1398 1396 1399 def getAircraftState(self, aircraft, timestamp, data): … … 1410 1413 state.fuel.append(fuel) 1411 1414 1412 state.n1 = [] 1415 1416 state.n1 = [] if self._isN1 else None 1417 state.rpm = None if self._isN1 else [] 1418 itemsPerEngine = 2 if self._isN1 else 3 1419 1413 1420 state.reverser = [] 1414 1421 for i in range(self._engineStartIndex, 1415 self._engineStartIndex + 2*self._numEngines, 2): 1416 state.n1.append(data[i]) 1417 state.reverser.append(data[i+1]<0) 1422 self._engineStartIndex + 1423 itemsPerEngine*self._numEngines, 1424 itemsPerEngine): 1425 state.reverser.append(data[i]<0) 1426 if self._isN1: 1427 state.n1.append(data[i+1]) 1428 else: 1429 state.rpm.append(data[i+1] * data[i+2]/65536.0) 1418 1430 1419 1431 return state … … 1605 1617 __init__(flapsNotches = [0, 15, 30, 45], 1606 1618 fuelTanks = acft.DC3.fuelTanks, 1607 numEngines = 2 )1619 numEngines = 2, isN1 = False) 1608 1620 1609 1621 @property 1610 1622 def name(self): 1611 1623 """Get the name for this aircraft model.""" 1612 return "FSUIPC/Generic Lisunov Li-2 "1624 return "FSUIPC/Generic Lisunov Li-2 (DC-3)" 1613 1625 1614 1626 #------------------------------------------------------------------------------ -
src/mlx/gui/monitor.py
r228 r263 286 286 self._fuel.set_text(fuelStr) 287 287 288 if hasattr(aircraftState, "n1"):288 if aircraftState.n1 is not None: 289 289 n1Str = "" 290 290 for n1 in aircraftState.n1: 291 291 if n1Str: n1Str += ", " 292 292 n1Str += "%.0f" % (n1,) 293 elif hasattr(aircraftState, "rpm"):293 elif aircraftState.rpm is not None: 294 294 n1Str = "" 295 295 for rpm in aircraftState.rpm:
Note:
See TracChangeset
for help on using the changeset viewer.