Changeset 289:ab76473b8f85 for src/mlx
- Timestamp:
- 07/07/12 15:26:46 (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/fsuipc.py
r274 r289 1665 1665 class DC3Model(GenericAircraftModel): 1666 1666 """Generic model for the Lisunov Li-2 (DC-3) aircraft.""" 1667 fuelTanks = [const.FUELTANK_LEFT, const.FUELTANK_CENTRE, const.FUELTANK_RIGHT] 1667 fuelTanks = [const.FUELTANK_LEFT, const.FUELTANK_CENTRE, 1668 const.FUELTANK_RIGHT] 1668 1669 # fuelTanks = [const.FUELTANK_LEFT_AUX, const.FUELTANK_LEFT, 1669 1670 # const.FUELTANK_RIGHT, const.FUELTANK_RIGHT_AUX] … … 1675 1676 fuelTanks = DC3Model.fuelTanks, 1676 1677 numEngines = 2, isN1 = False) 1678 self._leftLevel = 0.0 1679 self._rightLevel = 0.0 1677 1680 1678 1681 @property … … 1696 1699 if addCapacities: 1697 1700 centreCapacity = rawFuelData[1][2] 1701 self._leftLevel = self._rightLevel = \ 1702 centreAmount / centreCapacity / 2.0 1698 1703 fuelData = [(const.FUELTANK_LEFT_AUX, 1699 1704 rawFuelData[0][1], rawFuelData[0][2]), … … 1718 1723 implementation assumes to get the four-tank representation, 1719 1724 as returned by getFuel().""" 1720 leftLevel = 0.01721 centreLevel = 0.01722 rightLevel = 0.01725 leftLevel = None 1726 centreLevel = None 1727 rightLevel = None 1723 1728 1724 1729 for (tank, level) in levels: 1725 if tank==const.FUELTANK_LEFT_AUX: leftLevel += level 1726 elif tank==const.FUELTANK_LEFT or tank==const.FUELTANK_RIGHT: 1727 centreLevel += level 1728 elif tank==const.FUELTANK_RIGHT_AUX: rightLevel += level 1729 1730 super(DC3Model, self).setFuelLevel([(const.FUELTANK_LEFT, leftLevel), 1731 (const.FUELTANK_CENTRE, 1732 centreLevel), 1733 (const.FUELTANK_RIGHT, rightLevel)]) 1730 if tank==const.FUELTANK_LEFT_AUX: 1731 leftLevel = level if leftLevel is None else (leftLevel + level) 1732 elif tank==const.FUELTANK_LEFT: 1733 level /= 2.0 1734 centreLevel = (self._rightLevel + level) \ 1735 if centreLevel is None else (centreLevel + level) 1736 self._leftLevel = level 1737 elif tank==const.FUELTANK_RIGHT: 1738 level /= 2.0 1739 centreLevel = (self._leftLevel + level) \ 1740 if centreLevel is None else (centreLevel + level) 1741 self._rightLevel = level 1742 elif tank==const.FUELTANK_RIGHT_AUX: 1743 rightLevel = level if rightLevel is None \ 1744 else (rightLevel + level) 1745 1746 levels = [] 1747 if leftLevel is not None: levels.append((const.FUELTANK_LEFT, 1748 leftLevel)) 1749 if centreLevel is not None: levels.append((const.FUELTANK_CENTRE, 1750 centreLevel)) 1751 if rightLevel is not None: levels.append((const.FUELTANK_RIGHT, 1752 rightLevel)) 1753 1754 super(DC3Model, self).setFuelLevel(handler, levels) 1734 1755 1735 1756 #------------------------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.