Changeset 71:2dba0ba6cd1b for src/mlx/gui
- Timestamp:
- 04/10/12 18:07:36 (13 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/mlx/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/flight.py
r70 r71 1166 1166 self.finalize() 1167 1167 self._finalized = True 1168 else: 1169 self._wizard.nextPage() 1168 1169 self._wizard.nextPage() 1170 1171 #----------------------------------------------------------------------------- 1172 1173 class TakeoffPage(Page): 1174 """Page for entering the takeoff data.""" 1175 def __init__(self, wizard): 1176 """Construct the takeoff page.""" 1177 help = "Enter the runway and SID used, as well as the speeds." 1178 1179 super(TakeoffPage, self).__init__(wizard, "Takeoff", help) 1180 1181 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5, 1182 xscale = 0.0, yscale = 0.0) 1183 1184 table = gtk.Table(5, 3) 1185 table.set_row_spacings(4) 1186 table.set_col_spacings(16) 1187 table.set_homogeneous(False) 1188 alignment.add(table) 1189 self.setMainWidget(alignment) 1190 1191 label = gtk.Label("Run_way:") 1192 label.set_use_underline(True) 1193 label.set_alignment(0.0, 0.5) 1194 table.attach(label, 0, 1, 0, 1) 1195 1196 self._runway = gtk.Entry() 1197 self._runway.set_width_chars(10) 1198 self._runway.set_tooltip_text("The runway the takeoff is performed from.") 1199 table.attach(self._runway, 1, 2, 0, 1) 1200 label.set_mnemonic_widget(self._runway) 1201 1202 label = gtk.Label("_SID:") 1203 label.set_use_underline(True) 1204 label.set_alignment(0.0, 0.5) 1205 table.attach(label, 0, 1, 1, 2) 1206 1207 self._sid = gtk.Entry() 1208 self._sid.set_width_chars(10) 1209 self._sid.set_tooltip_text("The Standard Instrument Deparature procedure followed.") 1210 table.attach(self._sid, 1, 2, 1, 2) 1211 label.set_mnemonic_widget(self._sid) 1212 1213 label = gtk.Label("V<sub>_1</sub>:") 1214 label.set_use_markup(True) 1215 label.set_use_underline(True) 1216 label.set_alignment(0.0, 0.5) 1217 table.attach(label, 0, 1, 2, 3) 1218 1219 self._v1 = gtk.SpinButton() 1220 self._v1.set_increments(step = 1, page = 10) 1221 self._v1.set_range(min = 50, max = 300) 1222 self._v1.set_value(100) 1223 self._v1.set_numeric(True) 1224 self._v1.set_tooltip_markup("The takeoff decision speed in knots.") 1225 table.attach(self._v1, 1, 2, 2, 3) 1226 label.set_mnemonic_widget(self._v1) 1227 1228 table.attach(gtk.Label("knots"), 2, 3, 2, 3) 1229 1230 label = gtk.Label("V<sub>_r</sub>:") 1231 label.set_use_markup(True) 1232 label.set_use_underline(True) 1233 label.set_alignment(0.0, 0.5) 1234 table.attach(label, 0, 1, 3, 4) 1235 1236 self._vr = gtk.SpinButton() 1237 self._vr.set_increments(step = 1, page = 10) 1238 self._vr.set_range(min = 50, max = 300) 1239 self._vr.set_value(110) 1240 self._vr.set_numeric(True) 1241 self._vr.set_tooltip_markup("The takeoff rotation speed in knots.") 1242 table.attach(self._vr, 1, 2, 3, 4) 1243 label.set_mnemonic_widget(self._vr) 1244 1245 table.attach(gtk.Label("knots"), 2, 3, 3, 4) 1246 1247 label = gtk.Label("V<sub>_2</sub>:") 1248 label.set_use_markup(True) 1249 label.set_use_underline(True) 1250 label.set_alignment(0.0, 0.5) 1251 table.attach(label, 0, 1, 4, 5) 1252 1253 self._v2 = gtk.SpinButton() 1254 self._v2.set_increments(step = 1, page = 10) 1255 self._v2.set_range(min = 50, max = 300) 1256 self._v2.set_value(120) 1257 self._v2.set_numeric(True) 1258 self._v2.set_tooltip_markup("The takeoff safety speed in knots.") 1259 table.attach(self._v2, 1, 2, 4, 5) 1260 label.set_mnemonic_widget(self._v2) 1261 1262 table.attach(gtk.Label("knots"), 2, 3, 4, 5) 1263 1264 button = self.addButton(gtk.STOCK_GO_BACK) 1265 button.set_use_stock(True) 1266 button.connect("clicked", self._backClicked) 1267 1268 self._button = self.addButton(gtk.STOCK_GO_FORWARD, default = True) 1269 self._button.set_use_stock(True) 1270 self._button.connect("clicked", self._forwardClicked) 1271 1272 def activate(self): 1273 """Activate the page.""" 1274 self._runway.set_sensitive(True) 1275 self._sid.set_sensitive(True) 1276 self._v1.set_sensitive(True) 1277 self._vr.set_sensitive(True) 1278 self._v2.set_sensitive(True) 1279 1280 def finalize(self): 1281 """Finalize the page.""" 1282 self._runway.set_sensitive(False) 1283 self._sid.set_sensitive(False) 1284 self._v1.set_sensitive(False) 1285 self._vr.set_sensitive(False) 1286 self._v2.set_sensitive(False) 1287 1288 flight = self._wizard.gui.flight 1289 flight.v1 = self._v1.get_value_as_int() 1290 flight.vr = self._vr.get_value_as_int() 1291 flight.v2 = self._v2.get_value_as_int() 1292 1293 def _backClicked(self, button): 1294 """Called when the Back button is pressed.""" 1295 self.goBack() 1296 1297 def _forwardClicked(self, button): 1298 """Called when the forward button is clicked.""" 1299 #self._wizard.nextPage() 1170 1300 1171 1301 #----------------------------------------------------------------------------- … … 1191 1321 self._pages.append(BriefingPage(self, True)) 1192 1322 self._pages.append(BriefingPage(self, False)) 1323 self._pages.append(TakeoffPage(self)) 1193 1324 1194 1325 maxWidth = 0 -
src/mlx/gui/gui.py
r70 r71 81 81 notebook.append_page(self._wizard, label) 82 82 83 84 83 dataVBox = gtk.VBox() 85 84 label = gtk.Label("_Data") … … 133 132 """Get the simulator used by us.""" 134 133 return self._simulator 134 135 @property 136 def flight(self): 137 """Get the flight being performed.""" 138 return self._flight 135 139 136 140 def run(self):
Note:
See TracChangeset
for help on using the changeset viewer.