- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/flight.py
r908 r872 32 32 # 33 33 # This module implements the main tab of the application, the flight 34 # wizard. The wizard consists of \ref Page "pages", that come one yafter the34 # wizard. The wizard consists of \ref Page "pages", that come one after the 35 35 # other. As some pages might be skipped, the pages dynamically store the index 36 36 # of the previous page so that going back to it is simpler. The \ref … … 2125 2125 xscale = 0.0, yscale = 0.0) 2126 2126 2127 table = gtk.Table( 8, 3)2127 table = gtk.Table(7, 3) 2128 2128 table.set_row_spacings(4) 2129 2129 table.set_col_spacings(16) … … 2132 2132 self.setMainWidget(alignment) 2133 2133 2134 label = gtk.Label(xstr("payload_c ockpit_crew"))2134 label = gtk.Label(xstr("payload_crew")) 2135 2135 label.set_use_underline(True) 2136 2136 label.set_alignment(0.0, 0.5) 2137 2137 table.attach(label, 0, 1, 0, 1) 2138 2138 2139 self._numC ockpitCrew = IntegerEntry(defaultValue = 0)2140 self._numC ockpitCrew.set_width_chars(6)2141 self._numC ockpitCrew.connect("integer-changed", self._weightChanged)2142 self._numC ockpitCrew.set_tooltip_text(xstr("payload_cockpit_crew_tooltip"))2143 table.attach(self._numC ockpitCrew, 1, 2, 0, 1)2144 label.set_mnemonic_widget(self._numC ockpitCrew)2145 2146 label = gtk.Label(xstr("payload_ cabin_crew"))2139 self._numCrew = IntegerEntry(defaultValue = 0) 2140 self._numCrew.set_width_chars(6) 2141 self._numCrew.connect("integer-changed", self._weightChanged) 2142 self._numCrew.set_tooltip_text(xstr("payload_crew_tooltip")) 2143 table.attach(self._numCrew, 1, 2, 0, 1) 2144 label.set_mnemonic_widget(self._numCrew) 2145 2146 label = gtk.Label(xstr("payload_pax")) 2147 2147 label.set_use_underline(True) 2148 2148 label.set_alignment(0.0, 0.5) 2149 2149 table.attach(label, 0, 1, 1, 2) 2150 2151 self._numCabinCrew = IntegerEntry(defaultValue = 0)2152 self._numCabinCrew.set_width_chars(6)2153 self._numCabinCrew.connect("integer-changed", self._weightChanged)2154 self._numCabinCrew.set_tooltip_text(xstr("payload_cabin_crew_tooltip"))2155 table.attach(self._numCabinCrew, 1, 2, 1, 2)2156 label.set_mnemonic_widget(self._numCabinCrew)2157 2158 label = gtk.Label(xstr("payload_pax"))2159 label.set_use_underline(True)2160 label.set_alignment(0.0, 0.5)2161 table.attach(label, 0, 1, 2, 3)2162 2150 2163 2151 self._numPassengers = IntegerEntry(defaultValue = 0) … … 2165 2153 self._numPassengers.connect("integer-changed", self._weightChanged) 2166 2154 self._numPassengers.set_tooltip_text(xstr("payload_pax_tooltip")) 2167 table.attach(self._numPassengers, 1, 2, 2, 3)2155 table.attach(self._numPassengers, 1, 2, 1, 2) 2168 2156 label.set_mnemonic_widget(self._numPassengers) 2169 2157 … … 2171 2159 label.set_use_underline(True) 2172 2160 label.set_alignment(0.0, 0.5) 2173 table.attach(label, 0, 1, 3, 4)2161 table.attach(label, 0, 1, 2, 3) 2174 2162 2175 2163 self._bagWeight = IntegerEntry(defaultValue = 0) … … 2177 2165 self._bagWeight.connect("integer-changed", self._weightChanged) 2178 2166 self._bagWeight.set_tooltip_text(xstr("payload_bag_tooltip")) 2179 table.attach(self._bagWeight, 1, 2, 3, 4)2167 table.attach(self._bagWeight, 1, 2, 2, 3) 2180 2168 label.set_mnemonic_widget(self._bagWeight) 2181 2169 2182 table.attach(gtk.Label("kg"), 2, 3, 3, 4)2170 table.attach(gtk.Label("kg"), 2, 3, 2, 3) 2183 2171 2184 2172 label = gtk.Label(xstr("payload_cargo")) 2185 2173 label.set_use_underline(True) 2186 2174 label.set_alignment(0.0, 0.5) 2187 table.attach(label, 0, 1, 4, 5)2175 table.attach(label, 0, 1, 3, 4) 2188 2176 2189 2177 self._cargoWeight = IntegerEntry(defaultValue = 0) … … 2191 2179 self._cargoWeight.connect("integer-changed", self._weightChanged) 2192 2180 self._cargoWeight.set_tooltip_text(xstr("payload_cargo_tooltip")) 2193 table.attach(self._cargoWeight, 1, 2, 4, 5)2181 table.attach(self._cargoWeight, 1, 2, 3, 4) 2194 2182 label.set_mnemonic_widget(self._cargoWeight) 2195 2183 2196 table.attach(gtk.Label("kg"), 2, 3, 4, 5)2184 table.attach(gtk.Label("kg"), 2, 3, 3, 4) 2197 2185 2198 2186 label = gtk.Label(xstr("payload_mail")) 2199 2187 label.set_use_underline(True) 2200 2188 label.set_alignment(0.0, 0.5) 2201 table.attach(label, 0, 1, 5, 6)2189 table.attach(label, 0, 1, 4, 5) 2202 2190 2203 2191 self._mailWeight = IntegerEntry(defaultValue = 0) … … 2205 2193 self._mailWeight.connect("integer-changed", self._weightChanged) 2206 2194 self._mailWeight.set_tooltip_text(xstr("payload_mail_tooltip")) 2207 table.attach(self._mailWeight, 1, 2, 5, 6)2195 table.attach(self._mailWeight, 1, 2, 4, 5) 2208 2196 label.set_mnemonic_widget(self._mailWeight) 2209 2197 2210 table.attach(gtk.Label("kg"), 2, 3, 5, 6)2198 table.attach(gtk.Label("kg"), 2, 3, 4, 5) 2211 2199 2212 2200 label = gtk.Label("<b>" + xstr("payload_zfw") + "</b>") 2213 2201 label.set_alignment(0.0, 0.5) 2214 2202 label.set_use_markup(True) 2215 table.attach(label, 0, 1, 6, 7)2203 table.attach(label, 0, 1, 5, 6) 2216 2204 2217 2205 self._calculatedZFW = gtk.Label() 2218 2206 self._calculatedZFW.set_width_chars(6) 2219 2207 self._calculatedZFW.set_alignment(1.0, 0.5) 2220 table.attach(self._calculatedZFW, 1, 2, 6, 7)2221 2222 table.attach(gtk.Label("kg"), 2, 3, 6, 7)2208 table.attach(self._calculatedZFW, 1, 2, 5, 6) 2209 2210 table.attach(gtk.Label("kg"), 2, 3, 5, 6) 2223 2211 2224 2212 self._zfwButton = gtk.Button(xstr("payload_fszfw")) … … 2226 2214 self._zfwButton.connect("clicked", self._zfwRequested) 2227 2215 self._zfwButton.set_tooltip_text(xstr("payload_fszfw_tooltip")) 2228 table.attach(self._zfwButton, 0, 1, 7, 8)2216 table.attach(self._zfwButton, 0, 1, 6, 7) 2229 2217 2230 2218 self._simulatorZFW = gtk.Label("-") 2231 2219 self._simulatorZFW.set_width_chars(6) 2232 2220 self._simulatorZFW.set_alignment(1.0, 0.5) 2233 table.attach(self._simulatorZFW, 1, 2, 7, 8)2221 table.attach(self._simulatorZFW, 1, 2, 6, 7) 2234 2222 self._simulatorZFWValue = None 2235 2223 2236 table.attach(gtk.Label("kg"), 2, 3, 7, 8)2224 table.attach(gtk.Label("kg"), 2, 3, 6, 7) 2237 2225 2238 2226 self.addCancelFlightButton() … … 2241 2229 2242 2230 @property 2243 def numCockpitCrew(self): 2244 """The number of the cockpit crew members on the flight.""" 2245 return self._numCockpitCrew.get_int() 2246 2247 @property 2248 def numCabinCrew(self): 2249 """The number of the cabin crew members on the flight.""" 2250 return self._numCabinCrew.get_int() 2231 def numCrew(self): 2232 """The number of the crew members on the flight.""" 2233 return self._numCrew.get_int() 2251 2234 2252 2235 @property … … 2273 2256 """Setup the information.""" 2274 2257 bookedFlight = self._wizard._bookedFlight 2275 aircraft = self._wizard.gui._flight.aircraft 2276 2277 numCockpitCrew = bookedFlight.numCockpitCrew 2278 numCabinCrew = bookedFlight.numCabinCrew 2279 numCrew = numCockpitCrew + numCabinCrew 2280 2281 self._numCockpitCrew.set_int(numCockpitCrew) 2282 self._numCockpitCrew.set_sensitive(True) 2283 self._numCabinCrew.set_int(numCabinCrew) 2284 self._numCabinCrew.set_sensitive(True) 2258 2259 self._numCrew.set_int(bookedFlight.numCrew) 2260 self._numCrew.set_sensitive(True) 2285 2261 self._numPassengers.set_int(bookedFlight.numPassengers) 2286 2262 self._numPassengers.set_sensitive(True) … … 2300 2276 def finalize(self): 2301 2277 """Finalize the payload page.""" 2302 self._numCockpitCrew.set_sensitive(False) 2303 self._numCabinCrew.set_sensitive(False) 2278 self._numCrew.set_sensitive(False) 2304 2279 self._numPassengers.set_sensitive(False) 2305 2280 self._bagWeight.set_sensitive(False) … … 2310 2285 def calculateZFW(self): 2311 2286 """Calculate the ZFW value.""" 2312 aircraft = self._wizard.gui._flight.aircraft2313 2287 zfw = self._wizard.gui._flight.aircraft.dow 2314 zfw += (self.numCockpitCrew - aircraft.dowCockpit) * aircraft.cockpitCrewWeight 2315 zfw += (self.numCabinCrew - aircraft.dowCabin) * aircraft.cabinCrewWeight 2316 zfw += (self._numPassengers.get_int()) * aircraft.humanWeight 2288 zfw += (self._numCrew.get_int() + self._numPassengers.get_int()) * 82 2317 2289 zfw += self._bagWeight.get_int() 2318 2290 zfw += self._cargoWeight.get_int() 2319 2291 zfw += self._mailWeight.get_int() 2320 zfw = int(zfw)2321 2292 return zfw 2322 2293 … … 5570 5541 5571 5542 @property 5572 def numCockpitCrew(self): 5573 """Get the number of cockpit crew members.""" 5574 return self._payloadPage.numCockpitCrew 5575 5576 @property 5577 def numCabinCrew(self): 5578 """Get the number of cabin crew members.""" 5579 return self._payloadPage.numCabinCrew 5543 def numCrew(self): 5544 """Get the number of crew members.""" 5545 return self._payloadPage.numCrew 5580 5546 5581 5547 @property … … 5925 5891 self._loginResult = result 5926 5892 self.gui.loginSuccessful() 5927 acft.setupTypes(result.aircraftTypes)5928 5893 else: 5929 5894 if isReload:
Note:
See TracChangeset
for help on using the changeset viewer.