Changeset 899:ec5238c77005
- Timestamp:
- 03/16/18 09:00:12 (7 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
locale/en/mlx.po
r895 r899 642 642 "You can also query the ZFW reported by the simulator." 643 643 644 msgid "payload_crew" 645 msgstr "C_rew:" 646 647 msgid "payload_crew_tooltip" 648 msgstr "The number of the crew members on your flight." 644 msgid "payload_cockpit_crew" 645 msgstr "Cockpit c_rew:" 646 647 msgid "payload_cockpit_crew_tooltip" 648 msgstr "The number of the cockpit crew members on your flight." 649 650 msgid "payload_cabin_crew" 651 msgstr "Cabin cr_ew:" 652 653 msgid "payload_cabin_crew_tooltip" 654 msgstr "The number of the cabin crew members on your flight." 649 655 650 656 msgid "payload_pax" … … 1500 1506 "<b><span foreground=\"orange\">yellow</span></b>." 1501 1507 1502 msgid "weighthelp_crew" 1503 msgstr "Crew (%s):" 1508 msgid "weighthelp_cockpit_crew" 1509 msgstr "Cockpit crew (%s):" 1510 1511 msgid "weighthelp_cabin_crew" 1512 msgstr "Cabin crew (%s):" 1504 1513 1505 1514 msgid "weighthelp_pax" -
locale/hu/mlx.po
r895 r899 646 646 "Azt is ellenőrizheted, hogy a szimulátor milyen ZFW-t jelent." 647 647 648 msgid "payload_crew" 649 msgstr "_Legénység:" 650 651 msgid "payload_crew_tooltip" 652 msgstr "A legénység létszáma." 648 msgid "payload_cockpit_crew" 649 msgstr "_Pilóták:" 650 651 msgid "payload_cockpit_crew_tooltip" 652 msgstr "A pilóták létszáma." 653 654 msgid "payload_cabin_crew" 655 msgstr "_Utaskísérők:" 656 657 msgid "payload_cabin_crew_tooltip" 658 msgstr "A légiutaskísérők létszáma." 653 659 654 660 msgid "payload_pax" … … 1503 1509 "<b><span foreground=\"orange\">sárga</span></b> színben olvasható." 1504 1510 1505 msgid "weighthelp_crew" 1506 msgstr "Legénység (%s):" 1511 msgid "weighthelp_cockpit_crew" 1512 msgstr "Pilóták (%s):" 1513 1514 msgid "weighthelp_cabin_crew" 1515 msgstr "Utaskísérők (%s):" 1507 1516 1508 1517 msgid "weighthelp_pax" -
src/mlx/acft.py
r898 r899 128 128 self._landingAntiIceLineID = None 129 129 130 self.humanWeight = 82.0 130 self.cockpitCrewWeight = 85.0 131 self.cabinCrewWeight = 75.0 132 self.humanWeight = 84.0 131 133 132 134 self.initialClimbSpeedAltitude = 1500 -
src/mlx/flight.py
r846 r899 152 152 153 153 @property 154 def numCockpitCrew(self): 155 """Get the number of cockpit crew members on the flight.""" 156 return self._gui.numCockpitCrew 157 158 @property 159 def numCabinCrew(self): 160 """Get the number of cabon crew members on the flight.""" 161 return self._gui.numCabinCrew 162 163 @property 154 164 def numCrew(self): 155 165 """Get the number of crew members on the flight.""" 156 return self. _gui.numCrew166 return self.numCockpitCrew + self.numCabinCrew 157 167 158 168 @property -
src/mlx/gui/flight.py
r872 r899 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 after the34 # wizard. The wizard consists of \ref Page "pages", that come one yafter 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( 7, 3)2127 table = gtk.Table(8, 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 rew"))2134 label = gtk.Label(xstr("payload_cockpit_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._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) 2139 self._numCockpitCrew = IntegerEntry(defaultValue = 0) 2140 self._numCockpitCrew.set_width_chars(6) 2141 self._numCockpitCrew.connect("integer-changed", self._weightChanged) 2142 self._numCockpitCrew.set_tooltip_text(xstr("payload_cockpit_crew_tooltip")) 2143 table.attach(self._numCockpitCrew, 1, 2, 0, 1) 2144 label.set_mnemonic_widget(self._numCockpitCrew) 2145 2146 label = gtk.Label(xstr("payload_cabin_crew")) 2147 label.set_use_underline(True) 2148 label.set_alignment(0.0, 0.5) 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) 2145 2157 2146 2158 label = gtk.Label(xstr("payload_pax")) 2147 2159 label.set_use_underline(True) 2148 2160 label.set_alignment(0.0, 0.5) 2149 table.attach(label, 0, 1, 1, 2)2161 table.attach(label, 0, 1, 2, 3) 2150 2162 2151 2163 self._numPassengers = IntegerEntry(defaultValue = 0) … … 2153 2165 self._numPassengers.connect("integer-changed", self._weightChanged) 2154 2166 self._numPassengers.set_tooltip_text(xstr("payload_pax_tooltip")) 2155 table.attach(self._numPassengers, 1, 2, 1, 2)2167 table.attach(self._numPassengers, 1, 2, 2, 3) 2156 2168 label.set_mnemonic_widget(self._numPassengers) 2157 2169 … … 2159 2171 label.set_use_underline(True) 2160 2172 label.set_alignment(0.0, 0.5) 2161 table.attach(label, 0, 1, 2, 3)2173 table.attach(label, 0, 1, 3, 4) 2162 2174 2163 2175 self._bagWeight = IntegerEntry(defaultValue = 0) … … 2165 2177 self._bagWeight.connect("integer-changed", self._weightChanged) 2166 2178 self._bagWeight.set_tooltip_text(xstr("payload_bag_tooltip")) 2167 table.attach(self._bagWeight, 1, 2, 2, 3)2179 table.attach(self._bagWeight, 1, 2, 3, 4) 2168 2180 label.set_mnemonic_widget(self._bagWeight) 2169 2181 2170 table.attach(gtk.Label("kg"), 2, 3, 2, 3)2182 table.attach(gtk.Label("kg"), 2, 3, 3, 4) 2171 2183 2172 2184 label = gtk.Label(xstr("payload_cargo")) 2173 2185 label.set_use_underline(True) 2174 2186 label.set_alignment(0.0, 0.5) 2175 table.attach(label, 0, 1, 3, 4)2187 table.attach(label, 0, 1, 4, 5) 2176 2188 2177 2189 self._cargoWeight = IntegerEntry(defaultValue = 0) … … 2179 2191 self._cargoWeight.connect("integer-changed", self._weightChanged) 2180 2192 self._cargoWeight.set_tooltip_text(xstr("payload_cargo_tooltip")) 2181 table.attach(self._cargoWeight, 1, 2, 3, 4)2193 table.attach(self._cargoWeight, 1, 2, 4, 5) 2182 2194 label.set_mnemonic_widget(self._cargoWeight) 2183 2195 2184 table.attach(gtk.Label("kg"), 2, 3, 3, 4)2196 table.attach(gtk.Label("kg"), 2, 3, 4, 5) 2185 2197 2186 2198 label = gtk.Label(xstr("payload_mail")) 2187 2199 label.set_use_underline(True) 2188 2200 label.set_alignment(0.0, 0.5) 2189 table.attach(label, 0, 1, 4, 5)2201 table.attach(label, 0, 1, 5, 6) 2190 2202 2191 2203 self._mailWeight = IntegerEntry(defaultValue = 0) … … 2193 2205 self._mailWeight.connect("integer-changed", self._weightChanged) 2194 2206 self._mailWeight.set_tooltip_text(xstr("payload_mail_tooltip")) 2195 table.attach(self._mailWeight, 1, 2, 4, 5)2207 table.attach(self._mailWeight, 1, 2, 5, 6) 2196 2208 label.set_mnemonic_widget(self._mailWeight) 2197 2209 2198 table.attach(gtk.Label("kg"), 2, 3, 4, 5)2210 table.attach(gtk.Label("kg"), 2, 3, 5, 6) 2199 2211 2200 2212 label = gtk.Label("<b>" + xstr("payload_zfw") + "</b>") 2201 2213 label.set_alignment(0.0, 0.5) 2202 2214 label.set_use_markup(True) 2203 table.attach(label, 0, 1, 5, 6)2215 table.attach(label, 0, 1, 6, 7) 2204 2216 2205 2217 self._calculatedZFW = gtk.Label() 2206 2218 self._calculatedZFW.set_width_chars(6) 2207 2219 self._calculatedZFW.set_alignment(1.0, 0.5) 2208 table.attach(self._calculatedZFW, 1, 2, 5, 6)2209 2210 table.attach(gtk.Label("kg"), 2, 3, 5, 6)2220 table.attach(self._calculatedZFW, 1, 2, 6, 7) 2221 2222 table.attach(gtk.Label("kg"), 2, 3, 6, 7) 2211 2223 2212 2224 self._zfwButton = gtk.Button(xstr("payload_fszfw")) … … 2214 2226 self._zfwButton.connect("clicked", self._zfwRequested) 2215 2227 self._zfwButton.set_tooltip_text(xstr("payload_fszfw_tooltip")) 2216 table.attach(self._zfwButton, 0, 1, 6, 7)2228 table.attach(self._zfwButton, 0, 1, 7, 8) 2217 2229 2218 2230 self._simulatorZFW = gtk.Label("-") 2219 2231 self._simulatorZFW.set_width_chars(6) 2220 2232 self._simulatorZFW.set_alignment(1.0, 0.5) 2221 table.attach(self._simulatorZFW, 1, 2, 6, 7)2233 table.attach(self._simulatorZFW, 1, 2, 7, 8) 2222 2234 self._simulatorZFWValue = None 2223 2235 2224 table.attach(gtk.Label("kg"), 2, 3, 6, 7)2236 table.attach(gtk.Label("kg"), 2, 3, 7, 8) 2225 2237 2226 2238 self.addCancelFlightButton() … … 2229 2241 2230 2242 @property 2231 def numCrew(self): 2232 """The number of the crew members on the flight.""" 2233 return self._numCrew.get_int() 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() 2234 2251 2235 2252 @property … … 2256 2273 """Setup the information.""" 2257 2274 bookedFlight = self._wizard._bookedFlight 2258 2259 self._numCrew.set_int(bookedFlight.numCrew) 2260 self._numCrew.set_sensitive(True) 2275 aircraft = self._wizard.gui._flight.aircraft 2276 2277 numCrew = bookedFlight.numCrew 2278 numCockpitCrew = min(numCrew, aircraft.dowCockpit) 2279 numCabinCrew = numCrew - numCockpitCrew 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) 2261 2285 self._numPassengers.set_int(bookedFlight.numPassengers) 2262 2286 self._numPassengers.set_sensitive(True) … … 2276 2300 def finalize(self): 2277 2301 """Finalize the payload page.""" 2278 self._numCrew.set_sensitive(False) 2302 self._numCockpitCrew.set_sensitive(False) 2303 self._numCabinCrew.set_sensitive(False) 2279 2304 self._numPassengers.set_sensitive(False) 2280 2305 self._bagWeight.set_sensitive(False) … … 2285 2310 def calculateZFW(self): 2286 2311 """Calculate the ZFW value.""" 2312 aircraft = self._wizard.gui._flight.aircraft 2287 2313 zfw = self._wizard.gui._flight.aircraft.dow 2288 zfw += (self._numCrew.get_int() + self._numPassengers.get_int()) * 82 2314 zfw += (self.numCockpitCrew - aircraft.dowCockpit) * aircraft.cockpitCrewWeight 2315 zfw += (self.numCabinCrew - aircraft.dowCabin) * aircraft.cabinCrewWeight 2316 zfw += (self._numPassengers.get_int()) * aircraft.humanWeight 2289 2317 zfw += self._bagWeight.get_int() 2290 2318 zfw += self._cargoWeight.get_int() 2291 2319 zfw += self._mailWeight.get_int() 2320 zfw = int(zfw) 2292 2321 return zfw 2293 2322 … … 5541 5570 5542 5571 @property 5543 def numCrew(self): 5544 """Get the number of crew members.""" 5545 return self._payloadPage.numCrew 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 5546 5580 5547 5581 @property … … 5891 5925 self._loginResult = result 5892 5926 self.gui.loginSuccessful() 5927 acft.setupTypes(result.aircraftTypes) 5893 5928 else: 5894 5929 if isReload: -
src/mlx/gui/gui.py
r869 r899 264 264 265 265 @property 266 def numCrew(self): 267 """Get the number of crew members.""" 268 return self._wizard.numCrew 266 def numCockpitCrew(self): 267 """Get the number of cockpit crew members.""" 268 return self._wizard.numCockpitCrew 269 270 @property 271 def numCabinCrew(self): 272 """Get the number of cabin crew members.""" 273 return self._wizard.numCabinCrew 269 274 270 275 @property -
src/mlx/gui/weighthelp.py
r303 r899 56 56 57 57 58 self._weightsTable = table = gtk.Table(1 6, 5)58 self._weightsTable = table = gtk.Table(17, 5) 59 59 table.set_homogeneous(False) 60 60 table.set_row_spacings(4) … … 91 91 92 92 93 self._crewLabel = gtk.Label(xstr("weighthelp_crew") % ("99",)) 94 alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5, 95 xscale = 0.0, yscale = 0.0) 96 alignment.add(self._crewLabel) 93 self._cockpitCrewLabel = \ 94 gtk.Label(xstr("weighthelp_cockpit_crew") % ("99",)) 95 alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5, 96 xscale = 0.0, yscale = 0.0) 97 alignment.add(self._cockpitCrewLabel) 97 98 table.attach(alignment, 0, 1, 1, 2) 98 99 99 self._c rewWeight = gtk.Label("0")100 alignment = gtk.Alignment(xalign = 1.0, yalign = 0.5, 101 xscale = 0.0, yscale = 0.0) 102 alignment.add(self._c rewWeight)100 self._cockpitCrewWeight = gtk.Label("0") 101 alignment = gtk.Alignment(xalign = 1.0, yalign = 0.5, 102 xscale = 0.0, yscale = 0.0) 103 alignment.add(self._cockpitCrewWeight) 103 104 table.attach(alignment, 1, 2, 1, 2) 104 105 105 106 table.attach(gtk.Label("kg"), 2, 3, 1, 2) 107 108 self._cabinCrewLabel = \ 109 gtk.Label(xstr("weighthelp_cabin_crew") % ("99",)) 110 alignment = gtk.Alignment(xalign = 0.0, yalign = 0.5, 111 xscale = 0.0, yscale = 0.0) 112 alignment.add(self._cabinCrewLabel) 113 table.attach(alignment, 0, 1, 2, 3) 114 115 self._cabinCrewWeight = gtk.Label("0") 116 alignment = gtk.Alignment(xalign = 1.0, yalign = 0.5, 117 xscale = 0.0, yscale = 0.0) 118 alignment.add(self._cabinCrewWeight) 119 table.attach(alignment, 1, 2, 2, 3) 120 121 table.attach(gtk.Label("kg"), 2, 3, 2, 3) 106 122 107 123 text = xstr("weighthelp_pax") % ("999",) … … 112 128 xscale = 0.0, yscale = 0.0) 113 129 alignment.add(self._paxLabel) 114 table.attach(alignment, 0, 1, 2, 3)130 table.attach(alignment, 0, 1, 3, 4) 115 131 116 132 self._paxWeight = gtk.Label("20000") … … 118 134 xscale = 0.0, yscale = 0.0) 119 135 alignment.add(self._paxWeight) 120 table.attach(alignment, 1, 2, 2, 3)121 122 table.attach(gtk.Label("kg"), 2, 3, 2, 3)136 table.attach(alignment, 1, 2, 3, 4) 137 138 table.attach(gtk.Label("kg"), 2, 3, 3, 4) 123 139 124 140 label = gtk.Label(xstr("weighthelp_baggage")) … … 126 142 xscale = 0.0, yscale = 0.0) 127 143 alignment.add(label) 128 table.attach(alignment, 0, 1, 3, 4)144 table.attach(alignment, 0, 1, 4, 5) 129 145 130 146 self._bagWeight = gtk.Label("2000") … … 132 148 xscale = 0.0, yscale = 0.0) 133 149 alignment.add(self._bagWeight) 134 table.attach(alignment, 1, 2, 3, 4)135 136 table.attach(gtk.Label("kg"), 2, 3, 3, 4)150 table.attach(alignment, 1, 2, 4, 5) 151 152 table.attach(gtk.Label("kg"), 2, 3, 4, 5) 137 153 138 154 label = gtk.Label(xstr("weighthelp_cargo")) … … 140 156 xscale = 0.0, yscale = 0.0) 141 157 alignment.add(label) 142 table.attach(alignment, 0, 1, 4, 5)158 table.attach(alignment, 0, 1, 5, 6) 143 159 144 160 self._cargoWeight = gtk.Label("2000") … … 146 162 xscale = 0.0, yscale = 0.0) 147 163 alignment.add(self._cargoWeight) 148 table.attach(alignment, 1, 2, 4, 5)149 150 table.attach(gtk.Label("kg"), 2, 3, 4, 5)164 table.attach(alignment, 1, 2, 5, 6) 165 166 table.attach(gtk.Label("kg"), 2, 3, 5, 6) 151 167 152 168 label = gtk.Label(xstr("weighthelp_mail")) … … 154 170 xscale = 0.0, yscale = 0.0) 155 171 alignment.add(label) 156 table.attach(alignment, 0, 1, 5, 6)172 table.attach(alignment, 0, 1, 6, 7) 157 173 158 174 self._mailWeight = gtk.Label("2000") … … 160 176 xscale = 0.0, yscale = 0.0) 161 177 alignment.add(self._mailWeight) 162 table.attach(alignment, 1, 2, 5, 6)163 164 table.attach(gtk.Label("kg"), 2, 3, 5, 6)165 166 table.attach(gtk.HSeparator(), 1, 2, 6, 7)178 table.attach(alignment, 1, 2, 6, 7) 179 180 table.attach(gtk.Label("kg"), 2, 3, 6, 7) 181 182 table.attach(gtk.HSeparator(), 1, 2, 7, 8) 167 183 168 184 label = gtk.Label("<b>" + xstr("weighthelp_payload") + "</b>") … … 171 187 xscale = 0.0, yscale = 0.0) 172 188 alignment.add(label) 173 table.attach(alignment, 0, 1, 7, 8)189 table.attach(alignment, 0, 1, 8, 9) 174 190 175 191 self._payload = gtk.Label("<b>32000</b>") … … 178 194 xscale = 0.0, yscale = 0.0) 179 195 alignment.add(self._payload) 180 table.attach(alignment, 1, 2, 7, 8)181 182 table.attach(gtk.Label("kg"), 2, 3, 7, 8)196 table.attach(alignment, 1, 2, 8, 9) 197 198 table.attach(gtk.Label("kg"), 2, 3, 8, 9) 183 199 184 200 self._fsPayload = gtk.Label("<b>32001</b>") … … 187 203 xscale = 0.0, yscale = 0.0) 188 204 alignment.add(self._fsPayload) 189 table.attach(alignment, 3, 4, 7, 8)190 191 table.attach(gtk.Label("kg"), 4, 5, 7, 8)205 table.attach(alignment, 3, 4, 8, 9) 206 207 table.attach(gtk.Label("kg"), 4, 5, 8, 9) 192 208 193 209 label = gtk.Label(xstr("weighthelp_dow")) … … 196 212 xscale = 0.0, yscale = 0.0) 197 213 alignment.add(label) 198 table.attach(alignment, 0, 1, 8, 9)214 table.attach(alignment, 0, 1, 9, 10) 199 215 200 216 self._dow = gtk.Label("35000") … … 202 218 xscale = 0.0, yscale = 0.0) 203 219 alignment.add(self._dow) 204 table.attach(alignment, 1, 2, 8, 9)205 206 table.attach(gtk.Label("kg"), 2, 3, 8, 9)220 table.attach(alignment, 1, 2, 9, 10) 221 222 table.attach(gtk.Label("kg"), 2, 3, 9, 10) 207 223 208 224 self._fsDOW = gtk.Label("33012") … … 210 226 xscale = 0.0, yscale = 0.0) 211 227 alignment.add(self._fsDOW) 212 table.attach(alignment, 3, 4, 8, 9)213 214 table.attach(gtk.Label("kg"), 4, 5, 8, 9)215 216 table.attach(gtk.HSeparator(), 1, 2, 9, 10)217 218 table.attach(gtk.HSeparator(), 3, 4, 9, 10)228 table.attach(alignment, 3, 4, 9, 10) 229 230 table.attach(gtk.Label("kg"), 4, 5, 9, 10) 231 232 table.attach(gtk.HSeparator(), 1, 2, 10, 11) 233 234 table.attach(gtk.HSeparator(), 3, 4, 10, 11) 219 235 220 236 label = gtk.Label("<b>" + xstr("weighthelp_zfw") + "</b>") … … 223 239 xscale = 0.0, yscale = 0.0) 224 240 alignment.add(label) 225 table.attach(alignment, 0, 1, 1 0, 11)241 table.attach(alignment, 0, 1, 11, 12) 226 242 227 243 self._zfw = gtk.Label("<b>122000</b>") … … 230 246 xscale = 0.0, yscale = 0.0) 231 247 alignment.add(self._zfw) 232 table.attach(alignment, 1, 2, 1 0, 11)233 234 table.attach(gtk.Label("kg"), 2, 3, 1 0, 11)248 table.attach(alignment, 1, 2, 11, 12) 249 250 table.attach(gtk.Label("kg"), 2, 3, 11, 12) 235 251 236 252 self._fsZFW = gtk.Label("<b>124000</b>") … … 239 255 xscale = 0.0, yscale = 0.0) 240 256 alignment.add(self._fsZFW) 241 table.attach(alignment, 3, 4, 1 0, 11)242 243 table.attach(gtk.Label("kg"), 4, 5, 1 0, 11)244 245 table.attach(gtk.HSeparator(), 0, 5, 1 1, 12)257 table.attach(alignment, 3, 4, 11, 12) 258 259 table.attach(gtk.Label("kg"), 4, 5, 11, 12) 260 261 table.attach(gtk.HSeparator(), 0, 5, 12, 13) 246 262 247 263 label = gtk.Label(xstr("weighthelp_gross")) … … 250 266 xscale = 0.0, yscale = 0.0) 251 267 alignment.add(label) 252 table.attach(alignment, 0, 1, 1 2, 13)268 table.attach(alignment, 0, 1, 13, 14) 253 269 254 270 self._fsGross = gtk.Label("124000") … … 256 272 xscale = 0.0, yscale = 0.0) 257 273 alignment.add(self._fsGross) 258 table.attach(alignment, 3, 4, 1 2, 13)259 260 table.attach(gtk.Label("kg"), 4, 5, 1 2, 13)274 table.attach(alignment, 3, 4, 13, 14) 275 276 table.attach(gtk.Label("kg"), 4, 5, 13, 14) 261 277 262 278 label = gtk.Label(xstr("weighthelp_mzfw")) … … 265 281 xscale = 0.0, yscale = 0.0) 266 282 alignment.add(label) 267 table.attach(alignment, 0, 1, 1 3, 14)283 table.attach(alignment, 0, 1, 14, 15) 268 284 269 285 self._mzfw = gtk.Label("35000") … … 271 287 xscale = 0.0, yscale = 0.0) 272 288 alignment.add(self._mzfw) 273 table.attach(alignment, 1, 2, 1 3, 14)274 275 table.attach(gtk.Label("kg"), 2, 3, 1 3, 14)289 table.attach(alignment, 1, 2, 14, 15) 290 291 table.attach(gtk.Label("kg"), 2, 3, 14, 15) 276 292 277 293 label = gtk.Label(xstr("weighthelp_mtow")) … … 280 296 xscale = 0.0, yscale = 0.0) 281 297 alignment.add(label) 282 table.attach(alignment, 0, 1, 1 4, 15)298 table.attach(alignment, 0, 1, 15, 16) 283 299 284 300 self._mtow = gtk.Label("35000") … … 286 302 xscale = 0.0, yscale = 0.0) 287 303 alignment.add(self._mtow) 288 table.attach(alignment, 1, 2, 1 4, 15)289 290 table.attach(gtk.Label("kg"), 2, 3, 1 4, 15)304 table.attach(alignment, 1, 2, 15, 16) 305 306 table.attach(gtk.Label("kg"), 2, 3, 15, 16) 291 307 292 308 label = gtk.Label(xstr("weighthelp_mlw")) … … 295 311 xscale = 0.0, yscale = 0.0) 296 312 alignment.add(label) 297 table.attach(alignment, 0, 1, 1 5, 16)313 table.attach(alignment, 0, 1, 16, 17) 298 314 299 315 self._mlw = gtk.Label("35000") … … 301 317 xscale = 0.0, yscale = 0.0) 302 318 alignment.add(self._mlw) 303 table.attach(alignment, 1, 2, 1 5, 16)304 305 table.attach(gtk.Label("kg"), 2, 3, 1 5, 16)319 table.attach(alignment, 1, 2, 16, 17) 320 321 table.attach(gtk.Label("kg"), 2, 3, 16, 17) 306 322 307 323 self.show_all() … … 322 338 self._weightsTable.set_sensitive(False) 323 339 324 self._crew = -1 340 self._cockpitCrew = -1 341 self._cabinCrew = -1 325 342 self._pax = -1 326 self._humanWeight = 82.0 343 self._dowCockpit = 2 344 self._cockpitCrewMemberWeight = 85.0 345 self._dowCabin = 2 346 self._cabinCrewMemberWeight = 75.0 347 self._humanWeight = 84.0 327 348 self._bag = -1 328 349 self._cargo = -1 … … 343 364 def _setupCalculated(self): 344 365 """Setup the labels for the calculated values.""" 345 if self._crew<0: 346 self._crewLabel.set_text(xstr("weighthelp_crew") % ("-",)) 347 self._crewWeight.set_text("-") 348 else: 349 self._crewLabel.set_text(xstr("weighthelp_crew") % (str(self._crew),)) 350 crewWeight = self._crew * self._humanWeight 351 self._crewWeight.set_text("%.0f" % (crewWeight,)) 366 if self._cockpitCrew<0: 367 self._cockpitCrewLabel.set_text(xstr("weighthelp_cockpit_crew") % ("-",)) 368 self._cockpitCrewWeight.set_text("-") 369 else: 370 self._cockpitCrewLabel.set_text(xstr("weighthelp_cockpit_crew") % 371 (str(self._cockpitCrew),)) 372 crewWeight = (self._cockpitCrew - self._dowCockpit) * self._cockpitCrewMemberWeight 373 self._cockpitCrewWeight.set_text("%.0f" % (crewWeight,)) 374 375 if self._cabinCrew<0: 376 self._cabinCrewLabel.set_text(xstr("weighthelp_cabin_crew") % ("-",)) 377 self._cabinCrewWeight.set_text("-") 378 else: 379 self._cabinCrewLabel.set_text(xstr("weighthelp_cabin_crew") % 380 (str(self._cabinCrew),)) 381 crewWeight = (self._cabinCrew - self._dowCabin) * self._cabinCrewMemberWeight 382 self._cabinCrewWeight.set_text("%.0f" % (crewWeight,)) 352 383 353 384 if self._pax<0: … … 423 454 It returns a tuple with these two items. If any of the items cannot be 424 455 calculated, that is -1.""" 425 if self._c rew<0 or self._pax<0 or \456 if self._cockpitCrew<0 or self._cabinCrew<0 or self._pax<0 or \ 426 457 self._bag<0 or self._cargo<0 or self._mail<0: 427 458 payload = -1 428 459 else: 429 payload = (self._crew + self._pax) * self._humanWeight + \ 430 self._bag + self._cargo + self._mail 460 payload = \ 461 (self._cockpitCrew - self._dowCockpit) * \ 462 self._cockpitCrewMemberWeight + \ 463 (self._cabinCrew - self._dowCabin) * \ 464 self._cabinCrewMemberWeight + \ 465 self._pax * self._humanWeight + \ 466 self._bag + self._cargo + self._mail 431 467 432 468 if payload<0 or self._dowValue<0: … … 444 480 self._gui.logger.untimedMessage("The weight calculation help function was used by the pilot") 445 481 446 self._crew = self._gui.numCrew 482 self._cockpitCrew = self._gui.numCockpitCrew 483 self._cabinCrew = self._gui.numCabinCrew 447 484 self._pax = self._gui.numPassengers 448 485 self._bag = self._gui.bagWeight … … 451 488 452 489 aircraft = self._gui.flight.aircraft 490 self._dowCockpit = aircraft.dowCockpit 491 self._cockpitCrewMemberWeight = aircraft.cockpitCrewWeight 492 self._dowCabin = aircraft.dowCabin 493 self._cabinCrewMemberWeight = aircraft.cabinCrewWeight 453 494 self._humanWeight = aircraft.humanWeight 454 495 self._dowValue = aircraft.dow
Note:
See TracChangeset
for help on using the changeset viewer.