Changeset 635:717c097e0b12
- Timestamp:
- 05/10/15 06:57:21 (10 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/mlx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/acft.py
r634 r635 242 242 def speedInKnots(self): 243 243 """Indicate if the speed is in knots. 244 245 This default implementation returns True.""" 246 return True 247 248 @property 249 def aglInFeet(self): 250 """Indicate if AGL altitudes are to be logged in feet. 244 251 245 252 This default implementation returns True.""" … … 990 997 return False 991 998 999 @property 1000 def aglInFeet(self): 1001 """Indicate if AGL altituedes are in feet.""" 1002 return False 1003 992 1004 def _appendLightsLoggers(self): 993 1005 """Append the loggers needed for the lights.""" … … 1034 1046 1035 1047 @property 1048 def aglInFeet(self): 1049 """Indicate if AGL altituedes are in feet.""" 1050 return False 1051 1052 @property 1036 1053 def derateType(self): 1037 1054 """Get the derate type for this type.""" … … 1074 1091 def speedInKnots(self): 1075 1092 """Indicate if the speed is in knots.""" 1093 return False 1094 1095 @property 1096 def aglInFeet(self): 1097 """Indicate if AGL altituedes are in feet.""" 1076 1098 return False 1077 1099 -
src/mlx/checks.py
r631 r635 185 185 flight.stage in [const.STAGE_TAKEOFF, const.STAGE_CLIMB]: 186 186 logger.message(state.timestamp, 187 "Initial climb speed: %.0f %s - %.0f ftAGL" % \187 "Initial climb speed: %.0f %s - %.0f %s AGL" % \ 188 188 (flight.speedFromKnots(state.ias), 189 189 flight.getEnglishSpeedUnit(), 190 state.radioAltitude)) 190 flight.aglFromFeet(state.radioAltitude), 191 flight.getEnglishAGLUnit())) 191 192 self._logged = True 192 193 … … 697 698 speed = logState.groundSpeed if logState.groundSpeed<80.0 \ 698 699 else logState.ias 699 message = "Flaps %.0f - %.0f %s, %.0f ftAGL, %.0f ft AMSL" % \700 message = "Flaps %.0f - %.0f %s, %.0f %s AGL, %.0f ft AMSL" % \ 700 701 (logState.flapsSet, flight.speedFromKnots(speed), 701 flight.getEnglishSpeedUnit(), logState.radioAltitude, 702 flight.getEnglishSpeedUnit(), 703 flight.aglFromFeet(logState.radioAltitude), 704 flight.getEnglishAGLUnit(), 702 705 logState.altitude) 703 706 … … 715 718 def _getMessage(self, flight, state, forced): 716 719 """Get the message to log on a change.""" 717 return "Gears SET to %s at %.0f %s, %.0f ft, %.0f ftAGL" % \720 return "Gears SET to %s at %.0f %s, %.0f ft, %.0f %s AGL" % \ 718 721 ("DOWN" if state.gearControlDown else "UP", 719 722 flight.speedFromKnots(state.ias), 720 723 flight.getEnglishSpeedUnit(), 721 state.altitude, state.radioAltitude) 724 state.altitude, 725 flight.aglFromFeet(state.radioAltitude), 726 flight.getEnglishAGLUnit()) 722 727 723 728 #--------------------------------------------------------------------------------------- -
src/mlx/flight.py
r609 r635 321 321 knots.""" 322 322 return self.aircraft.speedInKnots if self.aircraft is not None \ 323 else True 324 325 @property 326 def aglInFeet(self): 327 """Determine if the AGL altutides for the flight are to be expressed in 328 feet.""" 329 return self.aircraft.aglInFeet if self.aircraft is not None \ 323 330 else True 324 331 … … 506 513 return knots if self.speedInKnots else knots * const.KNOTSTOKMPH 507 514 515 def aglFromFeet(self, feet): 516 """Convert the given AGL altitude value expressed in feet into the 517 flight's AGL altitude unit.""" 518 return feet if self.aglInFeet else feet * const.FEETTOMETRES 519 508 520 def speedToKnots(self, speed): 509 521 """Convert the given speed expressed in the flight's speed unit into … … 514 526 """Get the English name of the speed unit used by the flight.""" 515 527 return "knots" if self.speedInKnots else "km/h" 528 529 def getEnglishAGLUnit(self): 530 """Get the English name of the AGL unit used by the flight.""" 531 return "ft" if self.aglInFeet else "m" 516 532 517 533 def getI18NSpeedUnit(self):
Note:
See TracChangeset
for help on using the changeset viewer.