Changeset 86:285443d1c1e2
- Timestamp:
- 04/15/12 13:06:47 (13 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/mlx
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/acft.py
r71 r86 175 175 "Altimeter setting: %.0f hPa" % \ 176 176 (self._aircraftState.altimeter,)) 177 self.logger.message(self._aircraftState.timestamp, 178 "VRef speed calculated by the pilot: %s" % \ 179 ("-" if self._flight.vref is None 180 else str(self._flight.vref))) 177 181 self.flight.flareStarted(flareStart, flareStartFS) 178 182 -
src/mlx/flight.py
r84 r86 75 75 return self._gui.v2 76 76 77 @property 78 def vref(self): 79 """Get the VRef speed of the flight.""" 80 return self._gui.vref 81 77 82 def setStage(self, timestamp, stage): 78 83 """Set the flight stage. -
src/mlx/gui/common.py
r84 r86 85 85 gtk.Entry.__init__(self) 86 86 87 self.set_alignment(1.0) 88 87 89 self._defaultValue = defaultValue 88 90 self._currentInteger = defaultValue -
src/mlx/gui/flight.py
r84 r86 686 686 self._cargoWeight = IntegerEntry(defaultValue = 0) 687 687 self._cargoWeight.set_width_chars(6) 688 self._cargoWeight.set_alignment(1.0)689 688 self._cargoWeight.connect("integer-changed", self._cargoWeightChanged) 690 689 self._cargoWeight.set_tooltip_text("The weight of the cargo for your flight.") … … 1210 1209 buffer.set_text(metar) 1211 1210 1212 def finalize(self):1213 """Finalize the page."""1214 if not self._departure:1215 self._button.set_use_stock(True)1216 self._button.set_label(gtk.STOCK_GO_FORWARD)1217 1218 1211 def _backClicked(self, button): 1219 1212 """Called when the Back button is pressed.""" … … 1225 1218 if not self._finalized: 1226 1219 self._wizard.gui.startMonitoring() 1220 self._button.set_use_stock(True) 1221 self._button.set_label(gtk.STOCK_GO_FORWARD) 1227 1222 self._finalized = True 1228 1223 … … 1278 1273 1279 1274 self._v1 = IntegerEntry() 1280 self._v1.set_width_chars( 1)1275 self._v1.set_width_chars(4) 1281 1276 self._v1.set_tooltip_markup("The takeoff decision speed in knots.") 1282 1277 table.attach(self._v1, 2, 3, 2, 3) … … 1285 1280 table.attach(gtk.Label("knots"), 3, 4, 2, 3) 1286 1281 1287 label = gtk.Label("V<sub>_ r</sub>:")1282 label = gtk.Label("V<sub>_R</sub>:") 1288 1283 label.set_use_markup(True) 1289 1284 label.set_use_underline(True) … … 1292 1287 1293 1288 self._vr = IntegerEntry() 1294 self._vr.set_width_chars( 1)1289 self._vr.set_width_chars(4) 1295 1290 self._vr.set_tooltip_markup("The takeoff rotation speed in knots.") 1296 1291 table.attach(self._vr, 2, 3, 3, 4) … … 1306 1301 1307 1302 self._v2 = IntegerEntry() 1308 self._v2.set_width_chars( 1)1303 self._v2.set_width_chars(4) 1309 1304 self._v2.set_tooltip_markup("The takeoff safety speed in knots.") 1310 1305 table.attach(self._v2, 2, 3, 4, 5) … … 1344 1339 self._v1.set_int(None) 1345 1340 self._v1.set_sensitive(True) 1341 self._vr.set_int(None) 1346 1342 self._vr.set_sensitive(True) 1343 self._v2.set_int(None) 1347 1344 self._v2.set_sensitive(True) 1348 1345 self._button.set_sensitive(False) … … 1372 1369 """Construct the landing page.""" 1373 1370 help = "Enter the STAR and/or transition, runway,\n" \ 1374 "approach type and V<sub> ref</sub> used."1371 "approach type and V<sub>Ref</sub> used." 1375 1372 1376 1373 super(LandingPage, self).__init__(wizard, "Landing", help) … … 1379 1376 xscale = 0.0, yscale = 0.0) 1380 1377 1381 table = gtk.Table(5, 4)1378 table = gtk.Table(5, 5) 1382 1379 table.set_row_spacings(4) 1383 1380 table.set_col_spacings(16) … … 1400 1397 self._star.connect("changed", self._updateForwardButton) 1401 1398 self._star.set_sensitive(False) 1402 table.attach(self._star, 2, 3, 0, 1)1399 table.attach(self._star, 2, 4, 0, 1) 1403 1400 label.set_mnemonic_widget(self._starButton) 1404 1401 … … 1417 1414 self._transition.connect("changed", self._updateForwardButton) 1418 1415 self._transition.set_sensitive(False) 1419 table.attach(self._transition, 2, 3, 1, 2)1416 table.attach(self._transition, 2, 4, 1, 2) 1420 1417 label.set_mnemonic_widget(self._transitionButton) 1421 1418 … … 1429 1426 self._runway.set_tooltip_text("The runway the landing is performed on.") 1430 1427 self._runway.connect("changed", self._updateForwardButton) 1431 table.attach(self._runway, 2, 3, 2, 3)1428 table.attach(self._runway, 2, 4, 2, 3) 1432 1429 label.set_mnemonic_widget(self._runway) 1433 1430 … … 1441 1438 self._approachType.set_tooltip_text("The type of the approach, e.g. ILS or VISUAL.") 1442 1439 self._approachType.connect("changed", self._updateForwardButton) 1443 table.attach(self._approachType, 2, 3, 3, 4)1440 table.attach(self._approachType, 2, 4, 3, 4) 1444 1441 label.set_mnemonic_widget(self._approachType) 1445 1442 1446 label = gtk.Label("V<sub>_ ref</sub>:")1443 label = gtk.Label("V<sub>_Ref</sub>:") 1447 1444 label.set_use_markup(True) 1448 1445 label.set_use_underline(True) … … 1450 1447 table.attach(label, 1, 2, 5, 6) 1451 1448 1452 self._vref = gtk.SpinButton() 1453 self._vref.set_increments(step = 1, page = 10) 1454 self._vref.set_range(min = 50, max = 300) 1455 self._vref.set_value(140) 1456 self._vref.set_numeric(True) 1449 self._vref = IntegerEntry() 1450 self._vref.set_width_chars(5) 1457 1451 self._vref.set_tooltip_markup("The approach reference speed in knots.") 1458 table.attach(self._vref, 2, 3, 5, 6) 1452 self._vref.connect("integer-changed", self._vrefChanged) 1453 table.attach(self._vref, 3, 4, 5, 6) 1459 1454 label.set_mnemonic_widget(self._vref) 1460 1455 1461 table.attach(gtk.Label("knots"), 3, 4, 5, 6)1456 table.attach(gtk.Label("knots"), 4, 5, 5, 6) 1462 1457 1463 1458 button = self.addButton(gtk.STOCK_GO_BACK) … … 1472 1467 self._starButton.set_active(True) 1473 1468 self._transitionButton.set_active(True) 1469 1470 @property 1471 def vref(self): 1472 """Return the landing reference speed.""" 1473 return self._vref.get_int() 1474 1474 1475 1475 def activate(self): … … 1489 1489 self._approachType.set_sensitive(True) 1490 1490 1491 self._vref.set_ value(140)1491 self._vref.set_int(None) 1492 1492 self._vref.set_sensitive(True) 1493 1493 … … 1522 1522 if active: 1523 1523 self._transition.grab_focus() 1524 self._updateForwardButton() 1524 self._updateForwardButton() 1525 1525 1526 1526 def _updateForwardButton(self, widget = None): … … 1533 1533 not self._transitionButton.get_active()) and \ 1534 1534 self._runway.get_text()!="" and \ 1535 self._approachType.get_text()!="" 1535 self._approachType.get_text()!="" and \ 1536 self.vref is not None 1536 1537 self._button.set_sensitive(sensitive) 1538 1539 def _vrefChanged(self, widget, value): 1540 """Called when the Vref has changed.""" 1541 self._updateForwardButton() 1537 1542 1538 1543 def _backClicked(self, button): … … 1571 1576 self._takeoffPage = TakeoffPage(self) 1572 1577 self._pages.append(self._takeoffPage) 1573 self._pages.append(LandingPage(self)) 1578 self._landingPage = LandingPage(self) 1579 self._pages.append(self._landingPage) 1574 1580 1575 1581 maxWidth = 0 … … 1629 1635 def v1(self): 1630 1636 """Get the V1 speed.""" 1631 return None if self._bookedFlight is None elseself._takeoffPage.v11637 return self._takeoffPage.v1 1632 1638 1633 1639 @property 1634 1640 def vr(self): 1635 1641 """Get the Vr speed.""" 1636 return None if self._bookedFlight is None elseself._takeoffPage.vr1642 return self._takeoffPage.vr 1637 1643 1638 1644 @property 1639 1645 def v2(self): 1640 1646 """Get the V2 speed.""" 1641 return None if self._bookedFlight is None else self._takeoffPage.v2 1647 return self._takeoffPage.v2 1648 1649 @property 1650 def vref(self): 1651 """Get the Vref speed.""" 1652 return self._landingPage.vref 1642 1653 1643 1654 def nextPage(self, finalize = True): -
src/mlx/gui/gui.py
r84 r86 133 133 """Get the V2 speed calculated for the flight.""" 134 134 return self._wizard.v2 135 136 @property 137 def vref(self): 138 """Get the Vref speed calculated for the flight.""" 139 return self._wizard.vref 135 140 136 141 def run(self):
Note:
See TracChangeset
for help on using the changeset viewer.