source: src/mlx/acft.py@ 1179:7cbf103d3785

python3
Last change on this file since 1179:7cbf103d3785 was 1166:dd65d82078e3, checked in by István Váradi <ivaradi@…>, 5 months ago

The cruise speed of a Tu-154 aircraft is logged in Mach above 32000 feet (re #389)

File size: 51.4 KB
Line 
1
2from . import const
3from . import gates
4from . import checks
5from . import fs
6from .i18n import xstr
7from . import util
8
9import sys
10import time
11import traceback
12
13from collections import deque
14
15#---------------------------------------------------------------------------------------
16
17## @package mlx.acft
18#
19# The simulator-independent aircraft classes.
20#
21# This module contains the aircraft classes that contain some general data
22# about each aircraft type in the MAVA Fleet. The base class, \ref Aircraft
23# also implements some parts of the logging and traces some data. The classes
24# are also responsible for creating the \ref mlx.checks "checkers". Most of
25# them are created by the \ref Aircraft class' constructor, but there can be
26# type-specific differences. For example the lights are different for different
27# types, so there is a \ref Aircraft._appendLightsLoggers "function" which can
28# be reimplemented in child classes, if needed. This class maintains also the
29# \ref SmoothedValue "smoothed values" of the IAS and the VS and set these
30# values in the \ref mlx.fs.AircraftState "aircraft state" when it is received
31# from the simulator.
32
33#---------------------------------------------------------------------------------------
34
35# Derate type: no derate possible
36DERATE_NONE = 0
37
38# Derate type: Boeing, i.e. a percentage value.
39# For logging, the percentage value is expected as a string (i.e. whatever the
40# pilot enters into the text field).
41DERATE_BOEING = 1
42
43# Derate type: EPR, i.e. an EPR value.
44# For logging, the EPR value is expected as a string (i.e. whatever the pilot
45# enters into the text field).
46DERATE_EPR = 2
47
48# Derate type: Tupolev, i.e. nominal or takeoff
49# For logging, one of the DERATE_TUPOLEV_xxx values are expected.
50DERATE_TUPOLEV = 3
51
52# Tupolev derate value: nominal
53DERATE_TUPOLEV_NOMINAL = 1
54
55# Tupolev derate value: takeoff
56DERATE_TUPOLEV_TAKEOFF = 2
57
58# Derate type: BAe-146, i.e. enabled or not
59# For logging, a boolean is expected.
60DERATE_B462 = 4
61
62#---------------------------------------------------------------------------------------
63
64class SmoothedValue(object):
65 """A smoothed value."""
66 def __init__(self):
67 """Construct the value."""
68 self._deque = deque()
69 self._sum = 0
70
71 def add(self, length, value):
72 """Add the given value and smooth with the given length."""
73 dequeLength = len(self._deque)
74 while dequeLength>=length:
75 self._sum -= self._deque.popleft()
76 dequeLength -= 1
77
78 self._sum += value
79 self._deque.append(value)
80
81 def get(self):
82 """Get the average."""
83 return self._sum / len(self._deque)
84
85#---------------------------------------------------------------------------------------
86
87class SimBriefData(object):
88 """Data to be used when creating SimBrief briefings."""
89 def __init__(self, climbProfiles, cruiseProfiles, descentProfiles,
90 cruiseParameters = {}):
91 """Construct the SimBrief data with the given profiles.
92
93 cruiseParameters is a dictionary keyed by the cruise profile index. It
94 contains a tuple of:
95 - a boolean indicating if the parameter is mandatory,
96 - the name of the parameter for the SimBrief API
97 """
98 self.climbProfiles = climbProfiles
99 self.cruiseProfiles = cruiseProfiles
100 self.descentProfiles = descentProfiles
101 self.cruiseParameters = cruiseParameters
102
103#---------------------------------------------------------------------------------------
104
105class Aircraft(object):
106 """Base class for aircraft."""
107 @staticmethod
108 def create(flight, bookedFlight):
109 """Create an aircraft instance for the type in the given flight."""
110 acft = _classes[flight.aircraftType](flight)
111 acft.setBookedFlight(bookedFlight)
112 return acft
113
114 def __init__(self, flight, minLandingFuel = None,
115 recommendedLandingFuel = None):
116 """Construct the aircraft for the given type."""
117 self._flight = flight
118 self._minLandingFuel = minLandingFuel
119 self._recommendedLandingFuel = recommendedLandingFuel
120
121 self._name = None
122 self._modelName = None
123
124 self._aircraftState = None
125
126 self._maxVS = -10000.0
127 self._minVS = 10000.0
128
129 self._v1r2LineIndex = None
130 self._derateLineID = None
131 self._takeoffAntiIceLineID = None
132 self._vrefLineIndex = None
133 self._landingAntiIceLineID = None
134
135 self.humanWeight = 82.0
136
137 self.initialClimbSpeedAltitude = 1500
138 self.reverseMinSpeed = 50
139
140 self.hasStrobeLight = True
141
142 self.maxTakeOffPitch = 15.0
143 self.maxTouchDownPitch = 15.0
144 self.brakeCoolTime = 10.0
145
146 self.simBriefData = None
147
148 self._checkers = []
149
150 config = flight.config
151 # Loggers
152
153 self._checkers.append(checks.StageChecker())
154 self._checkers.append(checks.TakeOffLogger())
155
156 self._checkers.append(checks.AltimeterLogger())
157
158 self._ilsLogger = checks.ILSLogger()
159 self._checkers.append(self._ilsLogger)
160 self._nav1Logger = checks.NAV1Logger()
161 self._checkers.append(self._nav1Logger)
162 self._nav2Logger = checks.NAV2Logger()
163 self._checkers.append(self._nav2Logger)
164
165 self._adf1Logger = checks.ADF1Logger()
166 self._checkers.append(self._adf1Logger)
167 self._adf2Logger = checks.ADF2Logger()
168 self._checkers.append(self._adf2Logger)
169
170 self._checkers.append(checks.SquawkLogger())
171
172 self._appendLightsLoggers()
173
174 self._checkers.append(checks.FlapsLogger())
175
176 self._checkers.append(checks.GearsLogger())
177 self._checkers.append(checks.InitialClimbSpeedLogger())
178 self._checkers.append(checks.CruiseSpeedLogger())
179 self._checkers.append(checks.SpoilerLogger())
180 self._checkers.append(checks.APLogger())
181
182 if config.isMessageTypeFS(const.MESSAGETYPE_VISIBILITY):
183 self._checkers.append(checks.VisibilityChecker())
184
185 # FIXME: we should have a central data model object, and not collect
186 # the data from the GUI. However, some pieces of data (e.g. V-speeds,
187 # etc. that is entered into the GUI) *should* be a part of the GUI and
188 # queried from it, so the model should have a reference to the GUI as
189 # well and access such data via the GUI!
190 if config.onlineACARS and flight.loggedIn and not flight.entranceExam:
191 self._checkers.append(checks.ACARSSender(flight._gui))
192
193 # Fault checkers
194
195 self._appendLightsCheckers()
196
197 self._checkers.append(checks.TransponderChecker())
198
199 self._checkers.append(checks.BankChecker())
200
201 self._checkers.append(checks.FlapsRetractChecker())
202 self._checkers.append(checks.FlapsSpeedLimitChecker())
203
204 self._checkers.append(checks.GearsDownChecker())
205 self._checkers.append(checks.GearSpeedLimitChecker())
206
207 self._checkers.append(checks.GLoadChecker())
208
209 self._checkers.append(checks.MLWChecker())
210 self._checkers.append(checks.MTOWChecker())
211 self._checkers.append(checks.MZFWChecker())
212 self._checkers.append(checks.PayloadChecker())
213
214 self._checkers.append(checks.SpeedChecker())
215 self._checkers.append(checks.VSChecker())
216
217 timeout = 30.0 + config.realIASSmoothingLength - 1
218 self._checkers.append(checks.OverspeedChecker(faultTimeout = timeout))
219
220 self._checkers.append(checks.StallChecker())
221
222 self._checkers.append(checks.PitotChecker())
223
224 self._checkers.append(checks.ReverserLogger())
225 self._checkers.append(checks.ReverserChecker())
226
227 if flight.aircraftType is not None and config.enableApproachCallouts:
228 approachCallouts = flight.config.getApproachCallouts(flight.aircraftType)
229 if approachCallouts:
230 self._checkers.append(checks.ApproachCalloutsPlayer(approachCallouts))
231
232 self._smoothedIAS = SmoothedValue()
233 self._smoothedVS = SmoothedValue()
234
235 @property
236 def type(self):
237 """Get the type of the aircraft."""
238 return self._flight.aircraftType
239
240 @property
241 def flight(self):
242 """Get the flight the aircraft belongs to."""
243 return self._flight
244
245 @property
246 def minLandingFuel(self):
247 """Get the minimum acceptable amount of the landing fuel."""
248 return self._minLandingFuel
249
250 @property
251 def recommendedLandingFuel(self):
252 """Get the recommended amount of the landing fuel."""
253 return self._recommendedLandingFuel
254
255 @property
256 def logger(self):
257 """Get the logger to use for the aircraft."""
258 return self._flight.logger
259
260 @property
261 def state(self):
262 """Get the current aircraft state."""
263 return self._aircraftState
264
265 @property
266 def speedInKnots(self):
267 """Indicate if the speed is in knots.
268
269 This default implementation returns True."""
270 return True
271
272 @property
273 def aglInFeet(self):
274 """Indicate if AGL altitudes are to be logged in feet.
275
276 This default implementation returns True."""
277 return True
278
279 @property
280 def timestamp(self):
281 """Get the timestamp of the current state."""
282 return None if self._aircraftState is None \
283 else self._aircraftState.timestamp
284
285 @property
286 def derateType(self):
287 """Get the derate type for this aircraft.
288
289 This default implementation returns DERATE_NONE."""
290 return DERATE_NONE
291
292 @property
293 def machSpeedAbove(self):
294 """Get the altitude above which the cruise speed should be reported
295 in Machs."""
296 return 24500
297
298 def setBookedFlight(self, bookedFlight):
299 """Update the aircraft based on the booked flight data (e.g. tail number).
300
301 This default implementation does nothing."""
302
303 def getDerateLine(self, value):
304 """Get the log line for the given derate value.
305
306 It uses the the derate type and produces the standard message for
307 each. This children need not override it, although they can."""
308 dt = self.derateType
309
310 if dt==DERATE_BOEING:
311 return "Derate calculated by the pilot: %s %%" % \
312 ("-" if value is None else value,)
313 elif dt==DERATE_EPR:
314 return "EPR calculated by the pilot: %s" % \
315 ("-" if value is None else value,)
316 elif dt==DERATE_TUPOLEV:
317 return "Thrust setting calculated by the pilot: %s" % \
318 ("-" if value is None else
319 "nominal" if value==DERATE_TUPOLEV_NOMINAL else "takeoff",)
320 elif dt==DERATE_B462:
321 return "Derate setting: %s" % \
322 ("-" if value is None else "enabled" if value else "disabled",)
323 elif dt!=DERATE_NONE:
324 print("mlx.acft.getDerateLine: invalid derate type: " + dt)
325
326 return None
327
328 def getFlapsSpeedLimit(self, flaps):
329 """Get the speed limit for the given flaps setting."""
330 return self.flapSpeedLimits[flaps] if flaps in self.flapSpeedLimits \
331 else None
332
333 def modelChanged(self, timestamp, aircraftName, modelName):
334 """Called when the simulator's aircraft changes."""
335 self._name = aircraftName
336 self._modelName = modelName
337 if self._flight.stage is not None:
338 self._logNameAndModel(timestamp)
339
340 def handleState(self, aircraftState):
341 """Called when the state of the aircraft changes.
342
343 This is the function that the simulator calls directly with the new
344 state."""
345 try:
346 config = self._flight.config
347
348 self._smoothedIAS.add(config.realIASSmoothingLength, aircraftState.ias)
349 aircraftState.smoothedIAS = self._smoothedIAS.get()
350
351 self._smoothedVS.add(config.realVSSmoothingLength, aircraftState.vs)
352 aircraftState.smoothedVS = self._smoothedVS.get()
353
354 for checker in self._checkers:
355 try:
356 checker.check(self._flight, self, self._flight.logger,
357 self._aircraftState, aircraftState)
358 except:
359 print("Checker", checker, "failed", file=sys.stderr)
360 traceback.print_exc()
361
362 self._flight.handleState(self._aircraftState, aircraftState)
363
364 self._maxVS = max(self._maxVS, aircraftState.vs)
365 self._minVS = min(self._minVS, aircraftState.vs)
366 except:
367 print("Failed to handle the state", file=sys.stderr)
368 traceback.print_exc()
369 finally:
370 self._aircraftState = aircraftState
371
372 def setStage(self, aircraftState, newStage):
373 """Set the given stage as the new one and do whatever should be
374 done."""
375 if newStage==const.STAGE_BOARDING:
376 self._logNameAndModel(aircraftState.timestamp)
377
378 oldStage = self._flight.stage
379
380 if self._flight.setStage(aircraftState.timestamp, newStage):
381 if newStage==const.STAGE_PUSHANDTAXI:
382 self.logger.message(aircraftState.timestamp, "Block time start")
383 self._flight.logFuel(aircraftState)
384 self.logger.message(aircraftState.timestamp,
385 "ZFW: %.2f kg" % (aircraftState.zfw))
386 flight = self._flight
387 if flight.v1 is None or flight.vr is None or flight.v2 is None:
388 fs.sendMessage(const.MESSAGETYPE_HELP,
389 "Don't forget to set the takeoff V-speeds!",
390 5)
391 elif newStage==const.STAGE_TAKEOFF:
392 if oldStage == const.STAGE_RTO and self._flight.hasRTO:
393 rtoState = self._flight.rtoState
394 if (aircraftState.timestamp - rtoState.timestamp) < \
395 (self.brakeCoolTime * 60.0):
396 self.logger.fault("brakeCoolTime",
397 aircraftState.timestamp,
398 "Did not cool the brakes for at least %.f minutes after the RTO" % (self.brakeCoolTime,),
399 15.0)
400 self.logger.message(aircraftState.timestamp,
401 "Flight time start")
402 self.logger.message(aircraftState.timestamp,
403 "Takeoff weight: %.0f kg, MTOW: %.0f kg" % \
404 (aircraftState.grossWeight, self.mtow))
405 self._logQNH(aircraftState)
406 self.logger.message(aircraftState.timestamp,
407 "Wind %03.0f/%.0f" % \
408 (aircraftState.windDirection,
409 aircraftState.windSpeed))
410 self._logRadios(aircraftState)
411 self._logV1R2(aircraftState)
412 self._logDerate(aircraftState)
413 self._logTakeoffAntiIce(aircraftState)
414 elif newStage==const.STAGE_DESCENT or newStage==const.STAGE_LANDING:
415 self._logRadios(aircraftState)
416 if newStage==const.STAGE_LANDING:
417 self._logQNH(aircraftState)
418 elif newStage==const.STAGE_GOAROUND:
419 from .logger import Logger
420 self._flight.handleFault("goaround",
421 aircraftState.timestamp,
422 "Go-around detected, please, explain!",
423 Logger.NO_SCORE)
424 elif newStage==const.STAGE_TAXIAFTERLAND:
425 flight = self._flight
426 bookedFlight = flight.bookedFlight
427 config = flight.config
428 if config.onlineGateSystem and \
429 flight.loggedIn and \
430 not flight.entranceExam and \
431 bookedFlight.arrivalICAO=="LHBP" and \
432 config.isMessageTypeFS(const.MESSAGETYPE_GATE_SYSTEM):
433 self._flight.getFleet(callback = self._fleetRetrieved,
434 force = True)
435 self.logger.message(aircraftState.timestamp, "Flight time end")
436 self._flight.logFuel(aircraftState)
437 if self._minLandingFuel is not None and \
438 aircraftState.totalFuel<self._minLandingFuel:
439 self._flight.handleFault(self.__class__,
440 aircraftState.timestamp,
441 "The amount of the landing fuel is less than the minimum for this type: %ukgs (possible NO GO!)" %
442 (self._minLandingFuel,), 0)
443 self.logger.message(aircraftState.timestamp,
444 "Landing weight: %.0f kg, MLW: %.0f" % \
445 (aircraftState.grossWeight, self.mlw))
446 self.logger.message(aircraftState.timestamp,
447 "Vertical speed range: %.0f..%.0f feet/min" % \
448 (self._minVS, self._maxVS))
449 # elif newStage==const.STAGE_PARKING:
450 # self.logger.message(aircraftState.timestamp, "Block time end")
451 elif newStage==const.STAGE_END:
452 flightLength = self._flight.flightTimeEnd - self._flight.flightTimeStart
453 self.logger.message(aircraftState.timestamp, "Block time end")
454 self.logger.message(aircraftState.timestamp,
455 "Flight time: " +
456 util.getTimeIntervalString(flightLength))
457 self.logger.message(aircraftState.timestamp,
458 "Flown distance: %.2f NM" % \
459 (self._flight.flownDistance,))
460 blockLength = self._flight.blockTimeEnd - self._flight.blockTimeStart
461 self.logger.message(aircraftState.timestamp,
462 "Block time: " +
463 util.getTimeIntervalString(blockLength))
464
465 def prepareFlare(self):
466 """Called when it is detected that we will soon flare.
467
468 On the first call, it should start monitoring some parameters more
469 closely to determine flare time."""
470 self.flight.simulator.startFlare()
471
472 def flareStarted(self, windSpeed, windDirection, visibility,
473 flareStart, flareStartFS):
474 """Called when the flare has started."""
475 self.logger.message(self._aircraftState.timestamp, "The flare has begun")
476 self.logger.message(self._aircraftState.timestamp,
477 "Wind %03.0f/%.0f" % \
478 (windDirection, windSpeed))
479 self.logger.message(self._aircraftState.timestamp,
480 "Visibility: %.0f metres" % (visibility,))
481 self._logQNH(self._aircraftState)
482 self._logVRef()
483 self._logLandingAntiIce(self._aircraftState)
484 self.flight.flareStarted(flareStart, flareStartFS)
485 fs.sendMessage(const.MESSAGETYPE_INFORMATION, "Flare-time", 3)
486
487 def flareFinished(self, flareEnd, flareEndFS, tdRate, tdRateCalculatedByFS,
488 ias, pitch, bank, heading, gLoad):
489 """Called when the flare has finished."""
490 (flareTimeFromFS, flareTime) = self.flight.flareFinished(flareEnd,
491 flareEndFS,
492 tdRate)
493 self.logger.message(self._aircraftState.timestamp,
494 "Flaretime: %.3f (from %s)" % \
495 (flareTime,
496 "the simulator" if flareTimeFromFS else "real time",))
497 self.logger.message(self._aircraftState.timestamp,
498 "Touchdown rate: %.0f feet/min" % (tdRate,))
499 self.logger.message(self._aircraftState.timestamp,
500 "Touchdown rate was calculated by the %s" % \
501 ("simulator" if tdRateCalculatedByFS else "logger",))
502 self.logger.message(self._aircraftState.timestamp,
503 "Touchdown G-load: %.2f" % (gLoad,))
504 flight = self._flight
505 self.logger.message(self._aircraftState.timestamp,
506 "Touchdown speed: %.0f %s" % \
507 (flight.speedFromKnots(ias),
508 flight.getEnglishSpeedUnit()))
509 self.logger.message(self._aircraftState.timestamp,
510 "Touchdown pitch: %.1f degrees" % (pitch,))
511 self.logger.message(self._aircraftState.timestamp,
512 "Touchdown bank: %.1f degrees" % (bank,))
513 self.logger.message(self._aircraftState.timestamp,
514 "Touchdown heading: %03.0f degrees" % (heading,))
515 self.logger.message(self._aircraftState.timestamp,
516 "CG: %.1f%%" % \
517 (self._aircraftState.cog*100.0,))
518
519 if abs(pitch)>self.maxTouchDownPitch:
520 self._flight.handleNoGo("TDPitch", self._aircraftState.timestamp,
521 "Touchdown pitch higher than aircraft maximum (%.2f)" % \
522 (self.maxTouchDownPitch,),
523 "TD TAILSTRIKE NO GO")
524
525 def cancelFlare(self):
526 """Cancel flare, if it has started."""
527 self.flight.simulator.cancelFlare()
528
529 def checkFlightEnd(self, aircraftState):
530 """Check if the end of the flight has arrived.
531
532 This default implementation checks the N1 values, but for
533 piston-powered aircraft you need to check the RPMs."""
534 if aircraftState.n1 is not None:
535 for n1 in aircraftState.n1:
536 if n1 is not None and n1>=0.5: return False
537 return True
538
539 def updateV1R2(self):
540 """Update the V1, Vr and V2 values from the flight, if the these values
541 have already been logged."""
542 if self._v1r2LineIndex is not None:
543 self._logV1R2()
544
545 def updateDerate(self):
546 """Update the derate value from the flight, if the these values
547 have already been logged."""
548 if self._derateLineID is not None:
549 self._logDerate()
550
551 def updateTakeoffAntiIce(self):
552 """Update the take-off anti-ice setting."""
553 if self._takeoffAntiIceLineID is not None:
554 self._logTakeoffAntiIce()
555
556 def _appendLightsLoggers(self):
557 """Append the loggers needed for the lights.
558
559 This default implementation adds the loggers for the anti-collision
560 lights, the landing lights, the strobe lights and the NAV lights."""
561 self._checkers.append(checks.AnticollisionLightsLogger())
562 self._checkers.append(checks.LandingLightsLogger())
563 self._checkers.append(checks.StrobeLightsLogger())
564 self._checkers.append(checks.NavLightsLogger())
565
566 def _appendLightsCheckers(self):
567 """Append the checkers needed for the lights.
568
569 This default implementation adds the checkers for the anti-collision
570 lights, the landing lights, the strobe lights and the NAV lights."""
571 self._checkers.append(checks.AntiCollisionLightsChecker())
572 self._checkers.append(checks.LandingLightsChecker())
573 self._checkers.append(checks.NavLightsChecker())
574 self._checkers.append(checks.StrobeLightsChecker())
575
576 def _speedToLog(self, speed):
577 """Convert the given speed (being either None or expressed in the
578 flight's speed unit into a string."""
579 if speed is None:
580 return "-"
581 else:
582 return str(speed) + " " + self._flight.getEnglishSpeedUnit()
583
584 def _logV1R2(self, state = None):
585 """Log the V1, Vr and V2 value either newly, or by updating the
586 corresponding line."""
587 message = "Calc. TO speeds: V1: %s, VR: %s, V2: %s" % \
588 (self._speedToLog(self._flight.v1),
589 self._speedToLog(self._flight.vr),
590 self._speedToLog(self._flight.v2))
591
592 if self._v1r2LineIndex is None:
593 if state is None:
594 state = self._aircraftState
595 self._v1r2LineIndex = \
596 self.logger.message(state.timestamp, message)
597 else:
598 self.logger.updateLine(self._v1r2LineIndex, message)
599
600 def _logDerate(self, state = None):
601 """Log the derate values either newly or by updating the corresponding
602 line."""
603 dt = self.derateType
604 if dt==DERATE_NONE:
605 return
606
607 message = self.getDerateLine(self._flight.derate)
608 if message is not None:
609 if self._derateLineID is None:
610 if state is None:
611 state = self._aircraftState
612 self._derateLineID = \
613 self.logger.message(state.timestamp, message)
614 else:
615 self.logger.updateLine(self._derateLineID, message)
616
617 def _logTakeoffAntiIce(self, state = None):
618 """Log the take-off anti-ice setting either newly or by updating the
619 corresponding line."""
620 antiIceOn = self._flight.takeoffAntiIceOn
621 if state is not None:
622 antiIceOn = antiIceOn or state.antiIceOn is True
623 self._flight.takeoffAntiIceOn = antiIceOn
624
625 message = "Anti-ice was turned %s" % \
626 ("ON" if antiIceOn else "OFF")
627
628 if self._takeoffAntiIceLineID is None:
629 if state is None:
630 state = self._aircraftState
631 self._takeoffAntiIceLineID = \
632 self.logger.message(state.timestamp, message)
633 else:
634 self.logger.updateLine(self._takeoffAntiIceLineID, message)
635
636 def updateVRef(self):
637 """Update the Vref value from the flight, if the Vref value has already
638 been logged."""
639 if self._vrefLineIndex is not None:
640 self._logVRef()
641
642 def _logVRef(self):
643 """Log the Vref value either newly, or by updating the corresponding
644 line."""
645 message = "VRef speed calculated by the pilot: %s" % \
646 (self._speedToLog(self._flight.vref),)
647 if self._vrefLineIndex is None:
648 self._vrefLineIndex = \
649 self.logger.message(self._aircraftState.timestamp, message)
650 else:
651 self.logger.updateLine(self._vrefLineIndex, message)
652
653 def updateLandingAntiIce(self):
654 """Update the landing anti-ice setting."""
655 if self._landingAntiIceLineID is not None:
656 self._logLandingAntiIce()
657
658 def _logLandingAntiIce(self, state = None):
659 """Log the landing anti-ice setting either newly or by updating the
660 corresponding line."""
661 antiIceOn = self._flight.landingAntiIceOn
662 if state is not None:
663 antiIceOn = antiIceOn or state.antiIceOn is True
664 self._flight.landingAntiIceOn = antiIceOn
665
666 message = "Anti-ice was turned %s" % \
667 ("ON" if antiIceOn else "OFF")
668
669 if self._landingAntiIceLineID is None:
670 if state is None:
671 state = self._aircraftState
672 self._landingAntiIceLineID = \
673 self.logger.message(state.timestamp, message)
674 else:
675 self.logger.updateLine(self._landingAntiIceLineID, message)
676
677 def _fleetRetrieved(self, fleet):
678 """Callback for the fleet retrieval result."""
679 if fleet is not None:
680 gateList = ""
681 for gate in fleet.iterAvailableLHBPGates(self.flight.bookedFlight.tailNumber):
682 if gateList: gateList += ", "
683 gateList += gate.number
684 fs.sendMessage(const.MESSAGETYPE_GATE_SYSTEM,
685 "Free gates: " + gateList, 20)
686
687
688 def _logRadios(self, aircraftState):
689 """Log the radios from the given aircraft state."""
690 flight = self._flight
691 logger = flight.logger
692
693 self._ilsLogger.forceLog(flight, logger, aircraftState)
694 self._nav1Logger.forceLog(flight, logger, aircraftState)
695 self._nav2Logger.forceLog(flight, logger, aircraftState)
696 self._adf1Logger.forceLog(flight, logger, aircraftState)
697 self._adf2Logger.forceLog(flight, logger, aircraftState)
698
699 def _logQNH(self, aircraftState):
700 """Log the current QNH along with the altimeter setting."""
701 self.logger.message(aircraftState.timestamp,
702 "QNH: %.2f hPa, altimeter: %.2f hPa" % \
703 (aircraftState.qnh, aircraftState.altimeter))
704
705 def _logNameAndModel(self, timestamp):
706 """Log the aircraft's name and model with taking the timestamp from the
707 given state."""
708 self._flight.logger.message(timestamp,
709 "Aircraft: name='%s', model='%s'" % \
710 (self._name, self._modelName))
711
712#---------------------------------------------------------------------------------------
713
714class Boeing737(Aircraft):
715 """Base class for the various aircraft in the Boeing 737 family.
716
717 The aircraft type-specific values in the aircraft state have the following
718 structure:
719 - fuel: left, centre, right
720 - n1: left, right
721 - reverser: left, right"""
722 def __init__(self, flight, minLandingFuel = 2500,
723 recommendedLandingFuel = 3500):
724 super(Boeing737, self).__init__(flight,
725 minLandingFuel = minLandingFuel,
726 recommendedLandingFuel =
727 recommendedLandingFuel)
728
729 self.gearSpeedLimit = 270
730 self.flapSpeedLimits = { 1 : 260,
731 2 : 260,
732 5 : 250,
733 10 : 210,
734 15 : 200,
735 25 : 190,
736 30 : 175,
737 40 : 162 }
738
739 @property
740 def derateType(self):
741 """Get the derate type for this type."""
742 return DERATE_BOEING
743
744#---------------------------------------------------------------------------------------
745
746class B736(Boeing737):
747 """Boeing 737-600 aircraft."""
748 dow = 38307
749
750 def __init__(self, flight):
751 super(B736, self).__init__(flight)
752 self.mtow = 58328
753 self.mlw = 54657
754 self.mzfw = 51482
755 self.maxTakeOffPitch = 16.2
756 self.maxTouchDownPitch = 14.7
757 self.simBriefData = SimBriefData(["250/280/78"],
758 ["CI", "M75", "M78", "M79", "M80", "LRC"],
759 ["78/280/250"],
760 cruiseParameters = {0: (False, "civalue")})
761
762#---------------------------------------------------------------------------------------
763
764class B737(Boeing737):
765 """Boeing 737-700 aircraft."""
766 dow = 39250
767
768 def __init__(self, flight):
769 super(B737, self).__init__(flight)
770 self.mtow = 61410
771 self.mlw = 58059
772 self.mzfw = 54657
773 self.maxTakeOffPitch = 14.7
774 self.maxTouchDownPitch = 13.2
775 self.simBriefData = SimBriefData(["250/280/78"],
776 ["CI", "M75", "M78", "M79", "M80", "LRC"],
777 ["78/280/250", "78/250/250"],
778 cruiseParameters = {0: (False, "civalue")})
779
780#---------------------------------------------------------------------------------------
781
782class B738(Boeing737):
783 """Boeing 737-800 aircraft."""
784 dow = 42690
785
786 def __init__(self, flight):
787 super(B738, self).__init__(flight)
788 self.mtow = 71791
789 self.mlw = 65317
790 self.mzfw = 61688
791 self.maxTakeOffPitch = 11
792 self.maxTouchDownPitch = 9.5
793 self.simBriefData = SimBriefData(["250/280/78"],
794 ["CI", "M76", "M78", "M79", "M80", "LRC"],
795 ["78/280/250", "78/250/250"],
796 cruiseParameters = {0: (False, "civalue")})
797
798#---------------------------------------------------------------------------------------
799
800class B738Charter(B738):
801 """Boeing 737-800 aircraft used for charters."""
802 def __init__(self, flight):
803 super(B738Charter, self).__init__(flight)
804 self.mtow = 77791
805 self.simBriefData = SimBriefData(["AUTO"],
806 ["280/M74"],
807 ["AUTO"])
808
809#---------------------------------------------------------------------------------------
810
811class Boeing737CL(Boeing737):
812 """Base class for the various aircraft in the Boeing 737 Classic family."""
813 def __init__(self, flight):
814 super(Boeing737CL, self).__init__(flight, minLandingFuel = 3500,
815 recommendedLandingFuel = None)
816
817#---------------------------------------------------------------------------------------
818
819class B732(Boeing737CL):
820 """Boeing 737-200 aircraft."""
821 dow = 27646
822
823 def __init__(self, flight):
824 super(B732, self).__init__(flight)
825 self.mtow = 52390
826 self.mlw = 46720
827 self.mzfw = 43091
828 self.maxTakeOffPitch = 15.5
829 self.maxTouchDownPitch = 15.5
830 self.simBriefData = SimBriefData(["250/280/70"],
831 ["LRC", "M72", "M73", "M74"],
832 ["74/320/250"])
833
834#---------------------------------------------------------------------------------------
835
836class B733(Boeing737CL):
837 """Boeing 737-300 aircraft."""
838 dow = 32900
839
840 def __init__(self, flight):
841 super(B733, self).__init__(flight)
842 self.mtow = 56472
843 self.mlw = 51710
844 self.mzfw = 47625
845 self.maxTakeOffPitch = 13.4
846 self.maxTouchDownPitch = 12.0
847 self.simBriefData = SimBriefData(["250/280/74"],
848 ["CI", "M74", "M76", "M78", "LRC"],
849 ["74/280/250"],
850 cruiseParameters = {0: (False, "civalue")})
851
852#---------------------------------------------------------------------------------------
853
854class B734(Boeing737CL):
855 """Boeing 737-400 aircraft."""
856 def __init__(self, flight):
857 super(B734, self).__init__(flight)
858 self.dow = 35100
859 self.mtow = 62822
860 self.mlw = 54885
861 self.mzfw = 51256
862 self.maxTakeOffPitch = 11.4
863 self.maxTouchDownPitch = 10
864 self.simBriefData = SimBriefData(["250/280/74"],
865 ["CI", "M74", "M76", "M78", "LRC"],
866 ["74/280/250"],
867 cruiseParameters = {0: (False, "civalue")})
868
869#---------------------------------------------------------------------------------------
870
871class B735(Boeing737CL):
872 """Boeing 737-500 aircraft."""
873 dow = 31900
874
875 def __init__(self, flight):
876 super(B735, self).__init__(flight)
877 self.mtow = 62823
878 self.mlw = 49895
879 self.mzfw = 46720
880 self.maxTakeOffPitch = 14.7
881 self.maxTouchDownPitch = 13.2
882 self.simBriefData = SimBriefData(["250/280/74"],
883 ["CI", "M74", "M76", "M78", "LRC"],
884 ["74/280/250"],
885 cruiseParameters = {0: (False, "civalue")})
886
887#---------------------------------------------------------------------------------------
888
889class DH8D(Aircraft):
890 """Bombardier Dash-8 Q400 aircraft.
891
892 The aircraft type-specific values in the aircraft state have the following
893 structure:
894 - fuel: left, right
895 - n1: left, right
896 - reverser: left, right."""
897 dow = 18508
898
899 def __init__(self, flight):
900 super(DH8D, self).__init__(flight, minLandingFuel = 2000)
901 self.mtow = 29574
902 self.mlw = 28123
903 self.mzfw = 26308
904 self.gearSpeedLimit = 215
905 self.flapSpeedLimits = { 5 : 200,
906 10 : 181,
907 15 : 172,
908 35 : 158 }
909 self.maxTakeOffPitch = 8.0
910 self.maxTouchDownPitch = 7.0
911 self.simBriefData = SimBriefData(["I-900", "II-900", "III-900",
912 "I-850", "II-850", "III-850"],
913 ["MCR", "ISC", "LRC", "HSC"],
914 ["I-850", "II-850", "III-850"])
915
916#---------------------------------------------------------------------------------------
917
918class Boeing767(Aircraft):
919 """Base class for the various aircraft in the Boeing 767 family.
920
921 The aircraft type-specific values in the aircraft state have the following
922 structure:
923 - fuel: left, centre, right
924 - n1: left, right
925 - reverser: left, right"""
926
927 def __init__(self, flight, minLandingFuel = 7000):
928 super(Boeing767, self).__init__(flight, minLandingFuel = minLandingFuel)
929 self.gearSpeedLimit = 270
930 self.flapSpeedLimits = { 1 : 255,
931 5 : 235,
932 10 : 215,
933 20 : 215,
934 25 : 185,
935 30 : 175 }
936
937 @property
938 def derateType(self):
939 """Get the derate type for this type."""
940 return DERATE_BOEING
941
942#---------------------------------------------------------------------------------------
943
944class B762(Boeing767):
945 """Boeing 767-200 aircraft."""
946 dow = 84507
947
948 def __init__(self, flight):
949 super(B762, self).__init__(flight)
950 self.mtow = 159210
951 self.mlw = 126098
952 self.mzfw = 114758
953 self.maxTakeOffPitch = 13.1
954 self.maxTouchDownPitch = 11.6
955 self.simBriefData = SimBriefData(["250/290/78"],
956 ["CI", "M76", "M78", "M80", "M82",
957 "M84", "M85", "LRC"],
958 ["78/290/250"],
959 cruiseParameters = {0: (False, "civalue")})
960
961#---------------------------------------------------------------------------------------
962
963class B763(Boeing767):
964 """Boeing 767-300 aircraft."""
965 dow = 91311
966
967 def __init__(self, flight):
968 super(B763, self).__init__(flight)
969 self.mtow = 181436
970 self.mlw = 137892
971 self.mzfw = 114758
972 self.maxTakeOffPitch = 9.6
973 self.maxTouchDownPitch = 8.1
974 self.simBriefData = SimBriefData(["250/290/78"],
975 ["CI", "M76", "M78", "M80", "M82", "M84", "LRC"],
976 ["78/290/250"],
977 cruiseParameters = {0: (False, "civalue")})
978
979 def setBookedFlight(self, bookedFlight):
980 """Update the aircraft based on the booked flight data (e.g. tail number)."""
981 if bookedFlight.tailNumber=="HA-LHD":
982 self.mtow = 159210
983 self.mlw = 126098
984
985#---------------------------------------------------------------------------------------
986
987class CRJ2(Aircraft):
988 """Bombardier CRJ-200 aircraft.
989
990 The aircraft type-specific values in the aircraft state have the following
991 structure:
992 - fuel: left, centre, right
993 - n1: left, right
994 - reverser: left, right."""
995 dow = 14549
996
997 def __init__(self, flight):
998 super(CRJ2, self).__init__(flight, minLandingFuel = 1000)
999 self.mtow = 22995
1000 self.mlw = 21319
1001 self.mzfw = 19958
1002 self.gearSpeedLimit = 240
1003 self.flapSpeedLimits = { 8 : 260,
1004 20 : 220,
1005 30 : 190,
1006 45 : 175 }
1007 self.maxTakeOffPitch = 18.0
1008 self.maxTouchDownPitch = 18.0
1009 self.simBriefData = SimBriefData(["250/70", "290/74"],
1010 ["CI", "LRC", "M70", "M72", "M74", "M77", "M80"],
1011 ["74/290/250", "77/320/250"],
1012 cruiseParameters = {0: (False, "civalue")})
1013
1014#---------------------------------------------------------------------------------------
1015
1016class F70(Aircraft):
1017 """Fokker 70 aircraft.
1018
1019 The aircraft type-specific values in the aircraft state have the following
1020 structure:
1021 - fuel: left, centre, right
1022 - n1: left, right
1023 - reverser: left, right."""
1024 dow = 24283
1025
1026 def __init__(self, flight):
1027 super(F70, self).__init__(flight, minLandingFuel = 1900)
1028 self.mtow = 38100 # FIXME: differentiate by registration number,
1029 # MTOW of HA-LMF: 41955
1030 self.mlw = 36740
1031 self.mzfw = 32655
1032 self.gearSpeedLimit = 200
1033 self.flapSpeedLimits = { 8 : 250,
1034 15 : 220,
1035 25 : 220,
1036 42 : 180 }
1037 self.reverseMinSpeed = 50
1038 self.maxTakeOffPitch = 16.0
1039 self.maxTouchDownPitch = 16.0
1040 self.simBriefData = SimBriefData(["250/280/70"],
1041 ["M70", "LRC"],
1042 ["70/280/250"])
1043
1044 @property
1045 def derateType(self):
1046 """Get the derate type for this type."""
1047 return DERATE_EPR
1048
1049#---------------------------------------------------------------------------------------
1050
1051class DC3(Aircraft):
1052 """Lisunov Li-2 (DC-3) aircraft.
1053
1054 The aircraft type-specific values in the aircraft state have the following
1055 structure:
1056 - fuel: left aux, left, right, right aux
1057 - rpm: left, right
1058 - reverser: left, right."""
1059 dow = 8627
1060
1061 def __init__(self, flight):
1062 super(DC3, self).__init__(flight)
1063 self.mtow = 11884
1064 self.mlw = 11793
1065 self.mzfw = 11780
1066 self.gearSpeedLimit = 148
1067 self.flapSpeedLimits = { 15 : 135,
1068 30 : 99,
1069 45 : 97 }
1070
1071 def _checkFlightEnd(self, aircraftState):
1072 """Check if the end of the flight has arrived.
1073
1074 This implementation checks the RPM values to be 0."""
1075 for rpm in aircraftState.rpm:
1076 if rpm>0: return False
1077 return True
1078
1079#---------------------------------------------------------------------------------------
1080
1081class T134(Aircraft):
1082 """Tupolev Tu-134 aircraft.
1083
1084 The aircraft type-specific values in the aircraft state have the following
1085 structure:
1086 - fuel: left tip, left aux, centre, right aux, right tip, external 1,
1087 external 2
1088 - n1: left, right
1089 - reverser: left, right."""
1090 dow = 29500
1091
1092 def __init__(self, flight):
1093 super(T134, self).__init__(flight, minLandingFuel = 3000)
1094 self.mtow = 49000
1095 self.mlw = 43000
1096 self.mzfw = 38500
1097 self.gearSpeedLimit = 216
1098 self.flapSpeedLimits = { 10 : 450,
1099 20 : 400,
1100 30 : 300 }
1101 self.reverseMinSpeed = 50
1102
1103 self.hasStrobeLight = False
1104
1105 self.maxTakeOffPitch = 16.0
1106 self.maxTouchDownPitch = 16.0
1107
1108 @property
1109 def derateType(self):
1110 """Get the derate type for this type."""
1111 return DERATE_TUPOLEV
1112
1113 @property
1114 def speedInKnots(self):
1115 """Indicate if the speed is in knots."""
1116 return False
1117
1118 @property
1119 def aglInFeet(self):
1120 """Indicate if AGL altituedes are in feet."""
1121 return False
1122
1123 def _appendLightsLoggers(self):
1124 """Append the loggers needed for the lights."""
1125 self._checkers.append(checks.AnticollisionLightsLogger())
1126 self._checkers.append(checks.LandingLightsLogger())
1127 self._checkers.append(checks.NavLightsLogger())
1128
1129 def _appendLightsCheckers(self):
1130 """Append the checkers needed for the lights."""
1131 self._checkers.append(checks.TupolevAntiCollisionLightsChecker())
1132 self._checkers.append(checks.TupolevLandingLightsChecker())
1133 self._checkers.append(checks.LandingLightsChecker())
1134 self._checkers.append(checks.NavLightsChecker())
1135
1136#---------------------------------------------------------------------------------------
1137
1138class T154(Aircraft):
1139 """Tupolev Tu-154 aircraft.
1140
1141 The aircraft type-specific values in the aircraft state have the following
1142 structure:
1143 - fuel: left aux, left, centre, centre 2, right, right aux
1144 - n1: left, centre, right
1145 - reverser: left, right"""
1146 dow = 53259
1147
1148 def __init__(self, flight):
1149 super(T154, self).__init__(flight, minLandingFuel = 5000)
1150 self.mtow = 98000
1151 self.mlw = 78000
1152 self.mzfw = 72000
1153 self.gearSpeedLimit = 216
1154 self.flapSpeedLimits = { 15 : 227,
1155 28 : 194,
1156 45 : 162 }
1157 self.reverseMinSpeed = 50
1158
1159 self.hasStrobeLight = False
1160
1161 self.maxTakeOffPitch = 16.0
1162 self.maxTouchDownPitch = 16.0
1163 self.simBriefData = SimBriefData(["AUTO"],
1164 ["AUTO"],
1165 ["AUTO"])
1166
1167 @property
1168 def speedInKnots(self):
1169 """Indicate if the speed is in knots."""
1170 return False
1171
1172 @property
1173 def aglInFeet(self):
1174 """Indicate if AGL altituedes are in feet."""
1175 return False
1176
1177 @property
1178 def derateType(self):
1179 """Get the derate type for this type."""
1180 return DERATE_TUPOLEV
1181
1182 @property
1183 def machSpeedAbove(self):
1184 """Get the altitude above which the cruise speed should be reported
1185 in Machs."""
1186 return 32000
1187
1188 def setBookedFlight(self, bookedFlight):
1189 """Update the aircraft based on the booked flight data (e.g. tail number)."""
1190 if bookedFlight.tailNumber in ["HA-LCM", "HA-LCN", "HA-LCO", "HA-LCP",
1191 "HA-LCR", "HA-LCU", "HA-LCV"]:
1192 self.mtow = 100000
1193 self.mlw = 80000
1194 elif bookedFlight.tailNumber=="HA-LCX":
1195 self.mtow = 100000
1196 self.mlw = 80000
1197 self.mzfw = 74000
1198
1199 self.flapSpeedLimits = { 15 : 227,
1200 28 : 194,
1201 36 : 178,
1202 45 : 162 }
1203
1204 def _appendLightsLoggers(self):
1205 """Append the loggers needed for the lights."""
1206 self._checkers.append(checks.AnticollisionLightsLogger())
1207 self._checkers.append(checks.LandingLightsLogger())
1208 self._checkers.append(checks.NavLightsLogger())
1209
1210 def _appendLightsCheckers(self):
1211 """Append the checkers needed for the lights."""
1212 self._checkers.append(checks.AntiCollisionLightsChecker())
1213 self._checkers.append(checks.TupolevLandingLightsChecker())
1214 self._checkers.append(checks.LandingLightsChecker())
1215 self._checkers.append(checks.NavLightsChecker())
1216
1217#---------------------------------------------------------------------------------------
1218
1219class YK40(Aircraft):
1220 """Yakovlev Yak-40 aircraft.
1221
1222 The aircraft type-specific values in the aircraft state have the following
1223 structure:
1224 - fuel: left, right
1225 - n1: left, right
1226 - reverser: left, right"""
1227 dow = 9400
1228
1229 def __init__(self, flight):
1230 super(YK40, self).__init__(flight)
1231 self.mtow = 17200
1232 self.mlw = 16800
1233 self.mzfw = 12100
1234 self.gearSpeedLimit = 165
1235 self.flapSpeedLimits = { 20 : 165,
1236 35 : 135 }
1237
1238 self.hasStrobeLight = False
1239
1240 @property
1241 def speedInKnots(self):
1242 """Indicate if the speed is in knots."""
1243 return False
1244
1245 @property
1246 def aglInFeet(self):
1247 """Indicate if AGL altituedes are in feet."""
1248 return False
1249
1250 @property
1251 def derateType(self):
1252 """Get the derate type for this type."""
1253 return DERATE_TUPOLEV
1254
1255 def _appendLightsLoggers(self):
1256 """Append the loggers needed for the lights."""
1257 self._checkers.append(checks.AnticollisionLightsLogger())
1258 self._checkers.append(checks.LandingLightsLogger())
1259 self._checkers.append(checks.NavLightsLogger())
1260
1261 def _appendLightsCheckers(self):
1262 """Append the checkers needed for the lights."""
1263 self._checkers.append(checks.AntiCollisionLightsChecker())
1264 self._checkers.append(checks.LandingLightsChecker())
1265 self._checkers.append(checks.NavLightsChecker())
1266
1267#---------------------------------------------------------------------------------------
1268
1269class B462(Aircraft):
1270 """British Aerospace BAe-146 aircraft.
1271
1272 The aircraft type-specific values in the aircraft state have the following
1273 structure:
1274 - fuel: left, centre, right
1275 - n1: left outer, left inner, right inner, right outer
1276 - reverser: empty (the plane has no reversers)"""
1277 dow = 25706
1278
1279 def __init__(self, flight):
1280 super(B462, self).__init__(flight)
1281 self.mtow = 43998
1282 self.mlw = 38599
1283 self.mzfw = 33792
1284 self.gearSpeedLimit = 210
1285 self.flapSpeedLimits = { 18 : 217,
1286 24 : 180,
1287 30 : 170,
1288 33 : 150 }
1289 self.simBriefData = SimBriefData(["HighSpeed", "LongRange"],
1290 ["M70", "MCR", "LRC"],
1291 ["HighSpeed", "LongRange"])
1292 @property
1293 def derateType(self):
1294 """Get the derate type for this type."""
1295 return DERATE_B462
1296
1297#---------------------------------------------------------------------------------------
1298
1299mostFuelTanks = [const.FUELTANK_LEFT_TIP, const.FUELTANK_EXTERNAL1,
1300 const.FUELTANK_LEFT_AUX,
1301 const.FUELTANK_CENTRE,
1302 const.FUELTANK_RIGHT_AUX,
1303 const.FUELTANK_EXTERNAL2, const.FUELTANK_RIGHT_TIP]
1304
1305#---------------------------------------------------------------------------------------
1306
1307_classes = { const.AIRCRAFT_B736 : B736,
1308 const.AIRCRAFT_B737 : B737,
1309 const.AIRCRAFT_B738 : B738,
1310 const.AIRCRAFT_B738C : B738Charter,
1311 const.AIRCRAFT_B732 : B732,
1312 const.AIRCRAFT_B733 : B733,
1313 const.AIRCRAFT_B734 : B734,
1314 const.AIRCRAFT_B735 : B735,
1315 const.AIRCRAFT_DH8D : DH8D,
1316 const.AIRCRAFT_B762 : B762,
1317 const.AIRCRAFT_B763 : B763,
1318 const.AIRCRAFT_CRJ2 : CRJ2,
1319 const.AIRCRAFT_F70 : F70,
1320 const.AIRCRAFT_DC3 : DC3,
1321 const.AIRCRAFT_T134 : T134,
1322 const.AIRCRAFT_T154 : T154,
1323 const.AIRCRAFT_YK40 : YK40,
1324 const.AIRCRAFT_B462 : B462 }
1325
1326#---------------------------------------------------------------------------------------
1327
1328def getClass(aircraftType):
1329 """Get the class representing the given aircraft types"""
1330 return _classes[aircraftType]
1331
1332#---------------------------------------------------------------------------------------
1333
1334if __name__ == "__main__":
1335 value = SmoothedValue()
1336
1337 print("Adding 1, 12.0")
1338 value.add(1, 12.0)
1339 print(value.get())
1340
1341 print("Adding 1, 15.0")
1342 value.add(1, 15.0)
1343 print(value.get())
1344
1345 print("Adding 2, 18.0")
1346 value.add(2, 18.0)
1347 print(value.get())
1348
1349 print("Adding 2, 20.0")
1350 value.add(2, 20.0)
1351 print(value.get())
1352
1353 print("Adding 5, 22.0")
1354 value.add(5, 22.0)
1355 print(value.get())
1356
1357 print("Adding 5, 25.0")
1358 value.add(5, 25.0)
1359 print(value.get())
1360
1361 print("Adding 5, 29.0")
1362 value.add(5, 29.0)
1363 print(value.get())
1364
1365 print("Adding 5, 21.0")
1366 value.add(5, 21.0)
1367 print(value.get())
1368
1369 print("Adding 5, 26.0")
1370 value.add(5, 26.0)
1371 print(value.get())
1372
1373 print("Adding 2, 30.0")
1374 value.add(2, 30.0)
1375 print(value.get())
1376
1377 print("Adding 2, 55.0")
1378 value.add(2, 55.0)
1379 print(value.get())
1380
1381#---------------------------------------------------------------------------------------
Note: See TracBrowser for help on using the repository browser.