Changeset 101:35e361b4c306 for src
- Timestamp:
- 04/21/12 17:08:58 (13 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/mlx
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/acft.py
r96 r101 26 26 self._minVS = 10000.0 27 27 28 self._v1r2LineIndex = None 28 29 self._vrefLineIndex = None 29 30 … … 140 141 (aircraftState.windDirection, 141 142 aircraftState.windSpeed)) 142 self.logger.message(aircraftState.timestamp, 143 "Speeds calculated by the pilot: V1: %s, VR: %s, V2: %s" % \ 144 ("-" if self._flight.v1 is None 145 else str(self._flight.v1), 146 "-" if self._flight.vr is None 147 else str(self._flight.vr), 148 "-" if self._flight.v2 is None 149 else str(self._flight.v2))) 143 self._logV1R2() 150 144 elif newStage==const.STAGE_TAXIAFTERLAND: 151 145 self.logger.message(aircraftState.timestamp, "Flight time end") … … 191 185 "Altimeter setting: %.0f hPa" % \ 192 186 (self._aircraftState.altimeter,)) 193 self._vrefLineIndex = \ 194 self.logger.message(self._aircraftState.timestamp, 195 "VRef speed calculated by the pilot: %s" % \ 196 ("-" if self._flight.vref is None 197 else str(self._flight.vref))) 187 self._logVRef() 198 188 self.flight.flareStarted(flareStart, flareStartFS) 199 189 … … 233 223 if n1>=0.5: return False 234 224 return True 225 226 def updateV1R2(self): 227 """Update the V1, Vr and V2 values from the flight, if the these values 228 have already been logged.""" 229 if self._v1r2LineIndex is not None: 230 self._logV1R2() 231 232 def _logV1R2(self): 233 """Log the V1, Vr and V2 value either newly, or by updating the 234 corresponding line.""" 235 message = "Speeds calculated by the pilot: V1: %s, VR: %s, V2: %s" % \ 236 ("-" if self._flight.v1 is None 237 else str(self._flight.v1), 238 "-" if self._flight.vr is None 239 else str(self._flight.vr), 240 "-" if self._flight.v2 is None 241 else str(self._flight.v2)) 242 243 if self._v1r2LineIndex is None: 244 self._v1r2LineIndex = \ 245 self.logger.message(self._aircraftState.timestamp, message) 246 else: 247 self.logger.updateLine(self._v1r2LineIndex, message) 235 248 236 249 def updateVRef(self): -
src/mlx/gui/flight.py
r97 r101 1300 1300 completedHelp = completedHelp) 1301 1301 1302 self._forwardAllowed = False 1303 1302 1304 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5, 1303 1305 xscale = 0.0, yscale = 0.0) … … 1318 1320 self._runway.set_width_chars(10) 1319 1321 self._runway.set_tooltip_text("The runway the takeoff is performed from.") 1322 self._runway.connect("changed", self._valueChanged) 1320 1323 table.attach(self._runway, 1, 3, 0, 1) 1321 1324 label.set_mnemonic_widget(self._runway) … … 1329 1332 self._sid.set_width_chars(10) 1330 1333 self._sid.set_tooltip_text("The name of the Standard Instrument Deparature procedure followed.") 1334 self._sid.connect("changed", self._valueChanged) 1331 1335 table.attach(self._sid, 1, 3, 1, 2) 1332 1336 label.set_mnemonic_widget(self._sid) … … 1341 1345 self._v1.set_width_chars(4) 1342 1346 self._v1.set_tooltip_markup("The takeoff decision speed in knots.") 1347 self._v1.connect("integer-changed", self._valueChanged) 1343 1348 table.attach(self._v1, 2, 3, 2, 3) 1344 1349 label.set_mnemonic_widget(self._v1) … … 1355 1360 self._vr.set_width_chars(4) 1356 1361 self._vr.set_tooltip_markup("The takeoff rotation speed in knots.") 1362 self._vr.connect("integer-changed", self._valueChanged) 1357 1363 table.attach(self._vr, 2, 3, 3, 4) 1358 1364 label.set_mnemonic_widget(self._vr) … … 1369 1375 self._v2.set_width_chars(4) 1370 1376 self._v2.set_tooltip_markup("The takeoff safety speed in knots.") 1377 self._v2.connect("integer-changed", self._valueChanged) 1371 1378 table.attach(self._v2, 2, 3, 4, 5) 1372 1379 label.set_mnemonic_widget(self._v2) … … 1421 1428 self._button.set_sensitive(False) 1422 1429 1423 def f reezeValues(self):1424 """F reeze the values on the page, and enable the forward button."""1430 def finalize(self): 1431 """Finalize the page.""" 1425 1432 self._runway.set_sensitive(False) 1426 1433 self._sid.set_sensitive(False) … … 1428 1435 self._vr.set_sensitive(False) 1429 1436 self._v2.set_sensitive(False) 1430 self._button.set_sensitive(True) 1437 self._wizard.gui.flight.aircraft.updateV1R2() 1438 1439 def allowForward(self): 1440 """Allow going to the next page.""" 1441 self._forwardAllowed = True 1442 self._updateForwardButton() 1443 1444 def _updateForwardButton(self): 1445 """Update the sensitivity of the forward button based on some conditions.""" 1446 sensitive = self._forwardAllowed and \ 1447 self._runway.get_text()!="" and \ 1448 self._sid.get_text()!="" and \ 1449 self.v1 is not None and \ 1450 self.vr is not None and \ 1451 self.v2 is not None and \ 1452 self.v1 <= self.vr and \ 1453 self.vr <= self.v2 1454 self._button.set_sensitive(sensitive) 1455 1456 def _valueChanged(self, widget, arg = None): 1457 """Called when the value of some widget has changed.""" 1458 self._updateForwardButton() 1431 1459 1432 1460 def _backClicked(self, button): … … 2086 2114 """Set the flight stage to the given one.""" 2087 2115 if stage==const.STAGE_TAKEOFF: 2088 self._takeoffPage. freezeValues()2116 self._takeoffPage.allowForward() 2089 2117 elif stage==const.STAGE_END: 2090 2118 self._landingPage.flightEnded()
Note:
See TracChangeset
for help on using the changeset viewer.