Changeset 85:42b688827d63 for src/mlx
- Timestamp:
- 04/15/12 13:06:17 (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/pyuipc_sim.py
r83 r85 205 205 self.ias = 0.0 206 206 self.vs = 0.0 207 self.tdRate = 0.0 207 208 208 209 self.radioAltitude = None … … 235 236 self.windSpeed = 8.0 236 237 self.windDirection = 300.0 238 self.visibility = 10000 237 239 238 240 self.n1 = [0.0, 0.0, 0.0] … … 273 275 elif offset==0x02c8: # VS 274 276 return int(self.vs * const.FEETTOMETRES * 256.0 / 60.0) 277 elif offset==0x030c: # TD rate 278 return int(self.tdRate * const.FEETTOMETRES * 256.0 / 60.0) 275 279 elif offset==0x0330: # Altimeter 276 280 return int(self.altimeter * 16.0) … … 367 371 if self.strobeLightsOn: lights |= 0x10 368 372 return lights 373 elif offset==0x0e8a: # Visibility 374 return int(self.visibility * 100.0 / 1609.344) 369 375 elif offset==0x0e90: # Wind speed 370 376 return int(self.windSpeed) … … 447 453 elif offset==0x02c8: # VS 448 454 self.vs = value * 60.0 / const.FEETTOMETRES / 256.0 455 if not self.onTheGround: 456 self.tdRate = self.vs 449 457 elif offset==0x0330: # Altimeter 450 458 self.altimeter = value / 16.0 … … 455 463 elif offset==0x0354: # Squawk 456 464 self.squawk = Values._writeBCD(value) 457 elif offset==0x0366: # Stalled465 elif offset==0x0366: # On the groud 458 466 self.onTheGround = value!=0 467 if not self.onTheGround: 468 self.tdRate = self.vs 459 469 elif offset==0x036c: # Stalled 460 470 self.stalled = value!=0 … … 536 546 self.landingLightsOn = (value&0x04)!=0 537 547 self.strobeLightsOn = (value&0x10)!=0 548 elif offset==0x0e8a: # Visibility 549 self.visibility = value * 1609.344 / 100.0 538 550 elif offset==0x0e90: # Wind speed 539 551 self.windSpeed = value … … 935 947 const.FEETTOMETRES * 936 948 256.0 / 60.0)) 949 self._valueHandlers["tdRate"] = (0x030c, "d", 950 lambda value: value * 60 / 951 const.FEETTOMETRES / 256.0, 952 lambda word: int(float(word) * 953 const.FEETTOMETRES * 954 256.0 / 60.0)) 937 955 self._valueHandlers["radioAltitude"] = (0x31e4, "d", 938 956 lambda value: value / … … 1067 1085 CLI.throttle2pyuipc) 1068 1086 1087 self._valueHandlers["visibility"] = (0x0e8a, "H", 1088 lambda value: value*1609.344/100.0, 1089 lambda word: int(float(word)* 1090 100.0/1609.344)) 1091 1069 1092 def default(self, line): 1070 1093 """Handle unhandle commands."""
Note:
See TracChangeset
for help on using the changeset viewer.