[298] | 1 |
|
---|
| 2 | import const
|
---|
| 3 | import checks
|
---|
| 4 | import fs
|
---|
| 5 | import util
|
---|
| 6 |
|
---|
| 7 | import sys
|
---|
| 8 | import time
|
---|
| 9 | import traceback
|
---|
| 10 |
|
---|
| 11 | from collections import deque
|
---|
| 12 |
|
---|
| 13 | #---------------------------------------------------------------------------------------
|
---|
| 14 |
|
---|
[297] | 15 | ## @package mlx.acft
|
---|
| 16 | #
|
---|
| 17 | # The simulator-independent aircraft classes.
|
---|
| 18 | #
|
---|
| 19 | # This module contains the aircraft classes that contain some general data
|
---|
| 20 | # about each aircraft type in the MAVA Fleet. The base class, \ref Aircraft
|
---|
| 21 | # also implements some parts of the logging and traces some data. The classes
|
---|
| 22 | # are also responsible for creating the \ref mlx.checks "checkers". Most of
|
---|
| 23 | # them are created by the \ref Aircraft class' constructor, but there can be
|
---|
| 24 | # type-specific differences. For example the lights are different for different
|
---|
| 25 | # types, so there is a \ref Aircraft._appendLightsLoggers "function" which can
|
---|
| 26 | # be reimplemented in child classes, if needed. This class maintains also the
|
---|
| 27 | # \ref SmoothedValue "smoothed values" of the IAS and the VS and set these
|
---|
| 28 | # values in the \ref mlx.fs.AircraftState "aircraft state" when it is received
|
---|
| 29 | # from the simulator.
|
---|
[4] | 30 |
|
---|
| 31 | #---------------------------------------------------------------------------------------
|
---|
| 32 |
|
---|
[197] | 33 | class SmoothedValue(object):
|
---|
| 34 | """A smoothed value."""
|
---|
| 35 | def __init__(self):
|
---|
| 36 | """Construct the value."""
|
---|
| 37 | self._deque = deque()
|
---|
| 38 | self._sum = 0
|
---|
| 39 |
|
---|
| 40 | def add(self, length, value):
|
---|
| 41 | """Add the given value and smooth with the given length."""
|
---|
| 42 | dequeLength = len(self._deque)
|
---|
| 43 | while dequeLength>=length:
|
---|
| 44 | self._sum -= self._deque.popleft()
|
---|
| 45 | dequeLength -= 1
|
---|
| 46 |
|
---|
| 47 | self._sum += value
|
---|
| 48 | self._deque.append(value)
|
---|
| 49 |
|
---|
| 50 | def get(self):
|
---|
| 51 | """Get the average."""
|
---|
| 52 | return self._sum / len(self._deque)
|
---|
[331] | 53 |
|
---|
[4] | 54 | #---------------------------------------------------------------------------------------
|
---|
| 55 |
|
---|
| 56 | class Aircraft(object):
|
---|
| 57 | """Base class for aircraft."""
|
---|
[8] | 58 | @staticmethod
|
---|
| 59 | def create(flight):
|
---|
| 60 | """Create an aircraft instance for the type in the given flight."""
|
---|
| 61 | return _classes[flight.aircraftType](flight)
|
---|
| 62 |
|
---|
| 63 | def __init__(self, flight):
|
---|
[4] | 64 | """Construct the aircraft for the given type."""
|
---|
[8] | 65 | self._flight = flight
|
---|
[4] | 66 | self._aircraftState = None
|
---|
[331] | 67 |
|
---|
[9] | 68 | self._maxVS = -10000.0
|
---|
| 69 | self._minVS = 10000.0
|
---|
[4] | 70 |
|
---|
[101] | 71 | self._v1r2LineIndex = None
|
---|
[96] | 72 | self._vrefLineIndex = None
|
---|
| 73 |
|
---|
[117] | 74 | self.humanWeight = 82.0
|
---|
| 75 |
|
---|
[8] | 76 | self._checkers = []
|
---|
| 77 |
|
---|
[197] | 78 | config = flight.config
|
---|
[11] | 79 | # Loggers
|
---|
| 80 |
|
---|
[8] | 81 | self._checkers.append(checks.StageChecker())
|
---|
[9] | 82 | self._checkers.append(checks.TakeOffLogger())
|
---|
[8] | 83 |
|
---|
| 84 | self._checkers.append(checks.AltimeterLogger())
|
---|
[321] | 85 |
|
---|
| 86 | self._nav1Logger = checks.NAV1Logger()
|
---|
| 87 | self._checkers.append(self._nav1Logger)
|
---|
| 88 | self._nav2Logger = checks.NAV2Logger()
|
---|
| 89 | self._checkers.append(self._nav2Logger)
|
---|
| 90 |
|
---|
| 91 | self._adf1Logger = checks.ADF1Logger()
|
---|
| 92 | self._checkers.append(self._adf1Logger)
|
---|
| 93 | self._adf2Logger = checks.ADF2Logger()
|
---|
| 94 | self._checkers.append(self._adf2Logger)
|
---|
[331] | 95 |
|
---|
[8] | 96 | self._checkers.append(checks.SquawkLogger())
|
---|
| 97 |
|
---|
[211] | 98 | self._appendLightsLoggers()
|
---|
[8] | 99 |
|
---|
| 100 | self._checkers.append(checks.FlapsLogger())
|
---|
| 101 |
|
---|
| 102 | self._checkers.append(checks.GearsLogger())
|
---|
[9] | 103 | self._checkers.append(checks.CruiseSpeedLogger())
|
---|
[10] | 104 | self._checkers.append(checks.SpoilerLogger())
|
---|
[338] | 105 | self._checkers.append(checks.APLogger())
|
---|
[9] | 106 |
|
---|
[197] | 107 | if config.isMessageTypeFS(const.MESSAGETYPE_VISIBILITY):
|
---|
[134] | 108 | self._checkers.append(checks.VisibilityChecker())
|
---|
| 109 |
|
---|
[139] | 110 | # FIXME: we should have a central data model object, and not collect
|
---|
| 111 | # the data from the GUI. However, some pieces of data (e.g. V-speeds,
|
---|
| 112 | # etc. that is entered into the GUI) *should* be a part of the GUI and
|
---|
| 113 | # queried from it, so the model should have a reference to the GUI as
|
---|
| 114 | # well and access such data via the GUI!
|
---|
[215] | 115 | if config.onlineACARS and flight.loggedIn and not flight.entranceExam:
|
---|
[139] | 116 | self._checkers.append(checks.ACARSSender(flight._gui))
|
---|
| 117 |
|
---|
[11] | 118 | # Fault checkers
|
---|
[211] | 119 |
|
---|
| 120 | self._appendLightsCheckers()
|
---|
[11] | 121 |
|
---|
[335] | 122 | self._checkers.append(checks.TransponderChecker())
|
---|
| 123 |
|
---|
[11] | 124 | self._checkers.append(checks.BankChecker())
|
---|
| 125 |
|
---|
| 126 | self._checkers.append(checks.FlapsRetractChecker())
|
---|
| 127 | self._checkers.append(checks.FlapsSpeedLimitChecker())
|
---|
| 128 |
|
---|
| 129 | self._checkers.append(checks.GearsDownChecker())
|
---|
| 130 | self._checkers.append(checks.GearSpeedLimitChecker())
|
---|
| 131 |
|
---|
| 132 | self._checkers.append(checks.GLoadChecker())
|
---|
| 133 |
|
---|
| 134 | self._checkers.append(checks.MLWChecker())
|
---|
| 135 | self._checkers.append(checks.MTOWChecker())
|
---|
| 136 | self._checkers.append(checks.MZFWChecker())
|
---|
| 137 | self._checkers.append(checks.PayloadChecker())
|
---|
| 138 |
|
---|
[349] | 139 | #self._checkers.append(checks.SpeedChecker())
|
---|
| 140 | self._checkers.append(checks.NoStrobeSpeedChecker())
|
---|
[11] | 141 | self._checkers.append(checks.VSChecker())
|
---|
[197] | 142 |
|
---|
| 143 | timeout = 5.0 + config.realIASSmoothingLength - 1
|
---|
| 144 | self._checkers.append(checks.OverspeedChecker(timeout = timeout))
|
---|
[331] | 145 |
|
---|
[11] | 146 | self._checkers.append(checks.StallChecker())
|
---|
| 147 |
|
---|
| 148 | self._checkers.append(checks.PitotChecker())
|
---|
[331] | 149 |
|
---|
[11] | 150 | self._checkers.append(checks.ReverserChecker())
|
---|
| 151 |
|
---|
[273] | 152 | if flight.aircraftType is not None and config.enableApproachCallouts:
|
---|
| 153 | approachCallouts = flight.config.getApproachCallouts(flight.aircraftType)
|
---|
| 154 | if approachCallouts:
|
---|
| 155 | self._checkers.append(checks.ApproachCalloutsPlayer(approachCallouts))
|
---|
| 156 |
|
---|
[197] | 157 | self._smoothedIAS = SmoothedValue()
|
---|
| 158 | self._smoothedVS = SmoothedValue()
|
---|
| 159 |
|
---|
[4] | 160 | @property
|
---|
| 161 | def type(self):
|
---|
| 162 | """Get the type of the aircraft."""
|
---|
[8] | 163 | return self._flight.aircraftType
|
---|
| 164 |
|
---|
| 165 | @property
|
---|
| 166 | def flight(self):
|
---|
| 167 | """Get the flight the aircraft belongs to."""
|
---|
| 168 | return self._flight
|
---|
[4] | 169 |
|
---|
[8] | 170 | @property
|
---|
| 171 | def logger(self):
|
---|
| 172 | """Get the logger to use for the aircraft."""
|
---|
| 173 | return self._flight.logger
|
---|
| 174 |
|
---|
[139] | 175 | @property
|
---|
| 176 | def state(self):
|
---|
| 177 | """Get the current aircraft state."""
|
---|
| 178 | return self._aircraftState
|
---|
[241] | 179 |
|
---|
| 180 | @property
|
---|
| 181 | def speedInKnots(self):
|
---|
| 182 | """Indicate if the speed is in knots.
|
---|
| 183 |
|
---|
| 184 | This default implementation returns True."""
|
---|
| 185 | return True
|
---|
[304] | 186 |
|
---|
| 187 | @property
|
---|
| 188 | def timestamp(self):
|
---|
| 189 | """Get the timestamp of the current state."""
|
---|
| 190 | return None if self._aircraftState is None \
|
---|
| 191 | else self._aircraftState.timestamp
|
---|
[331] | 192 |
|
---|
[11] | 193 | def getFlapsSpeedLimit(self, flaps):
|
---|
| 194 | """Get the speed limit for the given flaps setting."""
|
---|
| 195 | return self.flapSpeedLimits[flaps] if flaps in self.flapSpeedLimits \
|
---|
| 196 | else None
|
---|
| 197 |
|
---|
[8] | 198 | def modelChanged(self, timestamp, aircraftName, modelName):
|
---|
[4] | 199 | """Called when the simulator's aircraft changes."""
|
---|
[8] | 200 | self._flight.logger.message(timestamp,
|
---|
| 201 | "Aircraft: name='%s', model='%s'" % \
|
---|
| 202 | (aircraftName, modelName))
|
---|
[4] | 203 |
|
---|
| 204 | def handleState(self, aircraftState):
|
---|
[197] | 205 | """Called when the state of the aircraft changes.
|
---|
| 206 |
|
---|
| 207 | This is the function that the simulator calls directly with the new
|
---|
| 208 | state."""
|
---|
[274] | 209 | try:
|
---|
| 210 | config = self._flight.config
|
---|
[197] | 211 |
|
---|
[274] | 212 | self._smoothedIAS.add(config.realIASSmoothingLength, aircraftState.ias)
|
---|
| 213 | aircraftState.smoothedIAS = self._smoothedIAS.get()
|
---|
| 214 |
|
---|
| 215 | self._smoothedVS.add(config.realVSSmoothingLength, aircraftState.vs)
|
---|
| 216 | aircraftState.smoothedVS = self._smoothedVS.get()
|
---|
[197] | 217 |
|
---|
[274] | 218 | for checker in self._checkers:
|
---|
| 219 | try:
|
---|
| 220 | checker.check(self._flight, self, self._flight.logger,
|
---|
| 221 | self._aircraftState, aircraftState)
|
---|
| 222 | except:
|
---|
| 223 | print >> sys.stderr, "Checker", checker, "failed"
|
---|
| 224 | traceback.print_exc()
|
---|
[7] | 225 |
|
---|
[274] | 226 | self._flight.handleState(self._aircraftState, aircraftState)
|
---|
[89] | 227 |
|
---|
[274] | 228 | self._maxVS = max(self._maxVS, aircraftState.vs)
|
---|
| 229 | self._minVS = min(self._minVS, aircraftState.vs)
|
---|
| 230 | except:
|
---|
| 231 | print >> sys.stderr, "Failed to handle the state"
|
---|
| 232 | traceback.print_exc()
|
---|
| 233 | finally:
|
---|
| 234 | self._aircraftState = aircraftState
|
---|
[331] | 235 |
|
---|
[8] | 236 | def setStage(self, aircraftState, newStage):
|
---|
| 237 | """Set the given stage as the new one and do whatever should be
|
---|
| 238 | done."""
|
---|
[9] | 239 | if self._flight.setStage(aircraftState.timestamp, newStage):
|
---|
| 240 | if newStage==const.STAGE_PUSHANDTAXI:
|
---|
| 241 | self.logger.message(aircraftState.timestamp, "Block time start")
|
---|
[274] | 242 | self._flight.logFuel(aircraftState)
|
---|
[331] | 243 | self.logger.message(aircraftState.timestamp,
|
---|
[313] | 244 | "ZFW: %.2f kg" % (aircraftState.zfw))
|
---|
[134] | 245 | flight = self._flight
|
---|
| 246 | if flight.v1 is None or flight.vr is None or flight.v2 is None:
|
---|
| 247 | fs.sendMessage(const.MESSAGETYPE_HELP,
|
---|
| 248 | "Don't forget to set the takeoff V-speeds!",
|
---|
| 249 | 5)
|
---|
[9] | 250 | elif newStage==const.STAGE_TAKEOFF:
|
---|
[241] | 251 | self.logger.message(aircraftState.timestamp,
|
---|
| 252 | "Flight time start")
|
---|
[331] | 253 | self.logger.message(aircraftState.timestamp,
|
---|
[9] | 254 | "Takeoff weight: %.0f kg, MTOW: %.0f kg" % \
|
---|
| 255 | (aircraftState.grossWeight, self.mtow))
|
---|
| 256 | self.logger.message(aircraftState.timestamp,
|
---|
[333] | 257 | "Wind %03.0f/%.0f" % \
|
---|
[331] | 258 | (aircraftState.windDirection,
|
---|
[9] | 259 | aircraftState.windSpeed))
|
---|
[321] | 260 | self._logRadios(aircraftState)
|
---|
[345] | 261 | self._logV1R2(aircraftState)
|
---|
[321] | 262 | elif newStage==const.STAGE_DESCENT or newStage==const.STAGE_LANDING:
|
---|
| 263 | self._logRadios(aircraftState)
|
---|
[9] | 264 | elif newStage==const.STAGE_TAXIAFTERLAND:
|
---|
[184] | 265 | flight = self._flight
|
---|
| 266 | bookedFlight = flight.bookedFlight
|
---|
| 267 | config = flight.config
|
---|
[136] | 268 | if config.onlineGateSystem and \
|
---|
[215] | 269 | flight.loggedIn and \
|
---|
[184] | 270 | not flight.entranceExam and \
|
---|
[136] | 271 | bookedFlight.arrivalICAO=="LHBP" and \
|
---|
| 272 | config.isMessageTypeFS(const.MESSAGETYPE_GATE_SYSTEM):
|
---|
[134] | 273 | self._flight.getFleet(callback = self._fleetRetrieved,
|
---|
| 274 | force = True)
|
---|
[9] | 275 | self.logger.message(aircraftState.timestamp, "Flight time end")
|
---|
[274] | 276 | self._flight.logFuel(aircraftState)
|
---|
[9] | 277 | self.logger.message(aircraftState.timestamp,
|
---|
| 278 | "Landing weight: %.0f kg, MLW: %.0f" % \
|
---|
| 279 | (aircraftState.grossWeight, self.mlw))
|
---|
| 280 | self.logger.message(aircraftState.timestamp,
|
---|
| 281 | "Vertical speed range: %.0f..%.0f feet/min" % \
|
---|
[12] | 282 | (self._minVS, self._maxVS))
|
---|
[9] | 283 | elif newStage==const.STAGE_PARKING:
|
---|
| 284 | self.logger.message(aircraftState.timestamp, "Block time end")
|
---|
[89] | 285 | elif newStage==const.STAGE_END:
|
---|
| 286 | flightLength = self._flight.flightTimeEnd - self._flight.flightTimeStart
|
---|
| 287 | self.logger.message(aircraftState.timestamp,
|
---|
| 288 | "Flight time: " +
|
---|
| 289 | util.getTimeIntervalString(flightLength))
|
---|
| 290 | self.logger.message(aircraftState.timestamp,
|
---|
| 291 | "Flown distance: %.2f NM" % \
|
---|
[331] | 292 | (self._flight.flownDistance,))
|
---|
[89] | 293 | blockLength = self._flight.blockTimeEnd - self._flight.blockTimeStart
|
---|
| 294 | self.logger.message(aircraftState.timestamp,
|
---|
| 295 | "Block time: " +
|
---|
| 296 | util.getTimeIntervalString(blockLength))
|
---|
[8] | 297 |
|
---|
[9] | 298 | def prepareFlare(self):
|
---|
| 299 | """Called when it is detected that we will soon flare.
|
---|
[8] | 300 |
|
---|
| 301 | On the first call, it should start monitoring some parameters more
|
---|
| 302 | closely to determine flare time."""
|
---|
[9] | 303 | self.flight.simulator.startFlare()
|
---|
| 304 |
|
---|
[331] | 305 | def flareStarted(self, windSpeed, windDirection, visibility,
|
---|
[9] | 306 | flareStart, flareStartFS):
|
---|
| 307 | """Called when the flare has started."""
|
---|
| 308 | self.logger.message(self._aircraftState.timestamp, "The flare has begun")
|
---|
| 309 | self.logger.message(self._aircraftState.timestamp,
|
---|
[333] | 310 | "Wind %03.0f/%.0f" % \
|
---|
[9] | 311 | (windDirection, windSpeed))
|
---|
| 312 | self.logger.message(self._aircraftState.timestamp,
|
---|
| 313 | "Visibility: %.0f metres" % (visibility,))
|
---|
| 314 | self.logger.message(self._aircraftState.timestamp,
|
---|
| 315 | "Altimeter setting: %.0f hPa" % \
|
---|
| 316 | (self._aircraftState.altimeter,))
|
---|
[101] | 317 | self._logVRef()
|
---|
[9] | 318 | self.flight.flareStarted(flareStart, flareStartFS)
|
---|
[134] | 319 | fs.sendMessage(const.MESSAGETYPE_INFORMATION, "Flare-time", 3)
|
---|
[331] | 320 |
|
---|
[9] | 321 | def flareFinished(self, flareEnd, flareEndFS, tdRate, tdRateCalculatedByFS,
|
---|
| 322 | ias, pitch, bank, heading):
|
---|
| 323 | """Called when the flare has finished."""
|
---|
| 324 | (flareTimeFromFS, flareTime) = self.flight.flareFinished(flareEnd,
|
---|
[170] | 325 | flareEndFS,
|
---|
| 326 | tdRate)
|
---|
[9] | 327 | self.logger.message(self._aircraftState.timestamp,
|
---|
[153] | 328 | "Flaretime: %.3f (from %s)" % \
|
---|
[331] | 329 | (flareTime,
|
---|
[9] | 330 | "the simulator" if flareTimeFromFS else "real time",))
|
---|
| 331 | self.logger.message(self._aircraftState.timestamp,
|
---|
| 332 | "Touchdown rate: %.0f feet/min" % (tdRate,))
|
---|
| 333 | self.logger.message(self._aircraftState.timestamp,
|
---|
| 334 | "Touchdown rate was calculated by the %s" % \
|
---|
| 335 | ("simulator" if tdRateCalculatedByFS else "logger",))
|
---|
[241] | 336 | flight = self._flight
|
---|
[9] | 337 | self.logger.message(self._aircraftState.timestamp,
|
---|
[241] | 338 | "Touchdown speed: %.0f %s" % \
|
---|
| 339 | (flight.speedFromKnots(ias),
|
---|
| 340 | flight.getEnglishSpeedUnit()))
|
---|
[9] | 341 | self.logger.message(self._aircraftState.timestamp,
|
---|
| 342 | "Touchdown pitch: %.1f degrees" % (pitch,))
|
---|
| 343 | self.logger.message(self._aircraftState.timestamp,
|
---|
| 344 | "Touchdown bank: %.1f degrees" % (bank,))
|
---|
| 345 | self.logger.message(self._aircraftState.timestamp,
|
---|
| 346 | "Touchdown heading: %03.0f degrees" % (heading,))
|
---|
[331] | 347 | self.logger.message(self._aircraftState.timestamp,
|
---|
[340] | 348 | "CG: %.1f%%" % \
|
---|
[271] | 349 | (self._aircraftState.cog*100.0,))
|
---|
[8] | 350 |
|
---|
| 351 | def cancelFlare(self):
|
---|
| 352 | """Cancel flare, if it has started."""
|
---|
[9] | 353 | self.flight.simulator.cancelFlare()
|
---|
[8] | 354 |
|
---|
| 355 | def checkFlightEnd(self, aircraftState):
|
---|
| 356 | """Check if the end of the flight has arrived.
|
---|
| 357 |
|
---|
| 358 | This default implementation checks the N1 values, but for
|
---|
| 359 | piston-powered aircraft you need to check the RPMs."""
|
---|
| 360 | for n1 in aircraftState.n1:
|
---|
| 361 | if n1>=0.5: return False
|
---|
| 362 | return True
|
---|
| 363 |
|
---|
[101] | 364 | def updateV1R2(self):
|
---|
| 365 | """Update the V1, Vr and V2 values from the flight, if the these values
|
---|
| 366 | have already been logged."""
|
---|
| 367 | if self._v1r2LineIndex is not None:
|
---|
| 368 | self._logV1R2()
|
---|
| 369 |
|
---|
[211] | 370 | def _appendLightsLoggers(self):
|
---|
| 371 | """Append the loggers needed for the lights.
|
---|
| 372 |
|
---|
| 373 | This default implementation adds the loggers for the anti-collision
|
---|
| 374 | lights, the landing lights, the strobe lights and the NAV lights."""
|
---|
| 375 | self._checkers.append(checks.AnticollisionLightsLogger())
|
---|
| 376 | self._checkers.append(checks.LandingLightsLogger())
|
---|
| 377 | self._checkers.append(checks.StrobeLightsLogger())
|
---|
| 378 | self._checkers.append(checks.NavLightsLogger())
|
---|
| 379 |
|
---|
| 380 | def _appendLightsCheckers(self):
|
---|
| 381 | """Append the checkers needed for the lights.
|
---|
| 382 |
|
---|
| 383 | This default implementation adds the checkers for the anti-collision
|
---|
| 384 | lights, the landing lights, the strobe lights and the NAV lights."""
|
---|
| 385 | self._checkers.append(checks.AntiCollisionLightsChecker())
|
---|
| 386 | self._checkers.append(checks.LandingLightsChecker())
|
---|
| 387 | self._checkers.append(checks.NavLightsChecker())
|
---|
| 388 | self._checkers.append(checks.StrobeLightsChecker())
|
---|
| 389 |
|
---|
[241] | 390 | def _speedToLog(self, speed):
|
---|
| 391 | """Convert the given speed (being either None or expressed in the
|
---|
| 392 | flight's speed unit into a string."""
|
---|
| 393 | if speed is None:
|
---|
| 394 | return "-"
|
---|
| 395 | else:
|
---|
| 396 | return str(speed) + " " + self._flight.getEnglishSpeedUnit()
|
---|
| 397 |
|
---|
[345] | 398 | def _logV1R2(self, state = None):
|
---|
[101] | 399 | """Log the V1, Vr and V2 value either newly, or by updating the
|
---|
| 400 | corresponding line."""
|
---|
| 401 | message = "Speeds calculated by the pilot: V1: %s, VR: %s, V2: %s" % \
|
---|
[241] | 402 | (self._speedToLog(self._flight.v1),
|
---|
| 403 | self._speedToLog(self._flight.vr),
|
---|
| 404 | self._speedToLog(self._flight.v2))
|
---|
[101] | 405 |
|
---|
| 406 | if self._v1r2LineIndex is None:
|
---|
[345] | 407 | if state is None:
|
---|
| 408 | state = self._aircraftState
|
---|
[101] | 409 | self._v1r2LineIndex = \
|
---|
[345] | 410 | self.logger.message(state.timestamp, message)
|
---|
[101] | 411 | else:
|
---|
| 412 | self.logger.updateLine(self._v1r2LineIndex, message)
|
---|
| 413 |
|
---|
[96] | 414 | def updateVRef(self):
|
---|
| 415 | """Update the Vref value from the flight, if the Vref value has already
|
---|
| 416 | been logged."""
|
---|
| 417 | if self._vrefLineIndex is not None:
|
---|
| 418 | self._logVRef()
|
---|
| 419 |
|
---|
| 420 | def _logVRef(self):
|
---|
| 421 | """Log the Vref value either newly, or by updating the corresponding
|
---|
| 422 | line."""
|
---|
| 423 | message = "VRef speed calculated by the pilot: %s" % \
|
---|
[241] | 424 | (self._speedToLog(self._flight.vref),)
|
---|
[96] | 425 | if self._vrefLineIndex is None:
|
---|
| 426 | self._vrefLineIndex = \
|
---|
| 427 | self.logger.message(self._aircraftState.timestamp, message)
|
---|
| 428 | else:
|
---|
| 429 | self.logger.updateLine(self._vrefLineIndex, message)
|
---|
| 430 |
|
---|
[134] | 431 | def _fleetRetrieved(self, fleet):
|
---|
| 432 | """Callback for the fleet retrieval result."""
|
---|
| 433 | if fleet is not None:
|
---|
| 434 | gateList = ""
|
---|
| 435 | occupiedGateNumbers = fleet.getOccupiedGateNumbers()
|
---|
| 436 | for gateNumber in const.lhbpGateNumbers:
|
---|
| 437 | if gateNumber not in occupiedGateNumbers:
|
---|
| 438 | if gateList: gateList += ", "
|
---|
| 439 | gateList += gateNumber
|
---|
| 440 | fs.sendMessage(const.MESSAGETYPE_GATE_SYSTEM,
|
---|
| 441 | "Free gates: " + gateList, 20)
|
---|
[331] | 442 |
|
---|
[134] | 443 |
|
---|
[321] | 444 | def _logRadios(self, aircraftState):
|
---|
| 445 | """Log the radios from the given aircraft state."""
|
---|
| 446 | flight = self._flight
|
---|
| 447 | logger = flight.logger
|
---|
| 448 |
|
---|
| 449 | self._nav1Logger.forceLog(flight, logger, aircraftState)
|
---|
| 450 | self._nav2Logger.forceLog(flight, logger, aircraftState)
|
---|
[329] | 451 | self._adf1Logger.forceLog(flight, logger, aircraftState)
|
---|
| 452 | self._adf2Logger.forceLog(flight, logger, aircraftState)
|
---|
[321] | 453 |
|
---|
[4] | 454 | #---------------------------------------------------------------------------------------
|
---|
[7] | 455 |
|
---|
| 456 | class Boeing737(Aircraft):
|
---|
| 457 | """Base class for the various aircraft in the Boeing 737 family.
|
---|
| 458 |
|
---|
| 459 | The aircraft type-specific values in the aircraft state have the following
|
---|
| 460 | structure:
|
---|
[140] | 461 | - fuel: left, centre, right
|
---|
[7] | 462 | - n1: left, right
|
---|
[331] | 463 | - reverser: left, right"""
|
---|
[9] | 464 | def __init__(self, flight):
|
---|
| 465 | super(Boeing737, self).__init__(flight)
|
---|
[95] | 466 | self._checkers.append(checks.ThrustChecker())
|
---|
| 467 |
|
---|
[9] | 468 | self.gearSpeedLimit = 270
|
---|
| 469 | self.flapSpeedLimits = { 1 : 260,
|
---|
| 470 | 2 : 260,
|
---|
| 471 | 5 : 250,
|
---|
| 472 | 10 : 210,
|
---|
| 473 | 15 : 200,
|
---|
| 474 | 25 : 190,
|
---|
| 475 | 30 : 175,
|
---|
| 476 | 40 : 162 }
|
---|
[7] | 477 |
|
---|
| 478 | #---------------------------------------------------------------------------------------
|
---|
| 479 |
|
---|
| 480 | class B736(Boeing737):
|
---|
| 481 | """Boeing 737-600 aircraft."""
|
---|
[8] | 482 | def __init__(self, flight):
|
---|
| 483 | super(B736, self).__init__(flight)
|
---|
[9] | 484 | self.dow = 38307
|
---|
| 485 | self.mtow = 58328
|
---|
| 486 | self.mlw = 54657
|
---|
| 487 | self.mzfw = 51482
|
---|
[7] | 488 |
|
---|
| 489 | #---------------------------------------------------------------------------------------
|
---|
| 490 |
|
---|
| 491 | class B737(Boeing737):
|
---|
| 492 | """Boeing 737-700 aircraft."""
|
---|
[8] | 493 | def __init__(self, flight):
|
---|
| 494 | super(B737, self).__init__(flight)
|
---|
[9] | 495 | self.dow = 39250
|
---|
| 496 | self.mtow = 61410
|
---|
| 497 | self.mlw = 58059
|
---|
| 498 | self.mzfw = 54657
|
---|
[7] | 499 |
|
---|
| 500 | #---------------------------------------------------------------------------------------
|
---|
| 501 |
|
---|
| 502 | class B738(Boeing737):
|
---|
| 503 | """Boeing 737-800 aircraft."""
|
---|
[8] | 504 | def __init__(self, flight):
|
---|
| 505 | super(B738, self).__init__(flight)
|
---|
[9] | 506 | self.dow = 42690
|
---|
| 507 | self.mtow = 71709
|
---|
| 508 | self.mlw = 65317
|
---|
| 509 | self.mzfw = 61688
|
---|
| 510 |
|
---|
| 511 | #---------------------------------------------------------------------------------------
|
---|
| 512 |
|
---|
| 513 | class B738Charter(B738):
|
---|
| 514 | """Boeing 737-800 aircraft used for charters."""
|
---|
| 515 | def __init__(self, flight):
|
---|
| 516 | super(B738Charter, self).__init__(flight)
|
---|
| 517 | self.mtow = 77791
|
---|
[7] | 518 |
|
---|
| 519 | #---------------------------------------------------------------------------------------
|
---|
| 520 |
|
---|
| 521 | class B733(Boeing737):
|
---|
| 522 | """Boeing 737-300 aircraft."""
|
---|
[8] | 523 | def __init__(self, flight):
|
---|
| 524 | super(B733, self).__init__(flight)
|
---|
[9] | 525 | self.dow = 32700
|
---|
| 526 | self.mtow = 62820
|
---|
| 527 | self.mlw = 51700
|
---|
| 528 | self.mzfw = 48410
|
---|
[7] | 529 |
|
---|
| 530 | #---------------------------------------------------------------------------------------
|
---|
| 531 |
|
---|
| 532 | class B734(Boeing737):
|
---|
| 533 | """Boeing 737-400 aircraft."""
|
---|
[8] | 534 | def __init__(self, flight):
|
---|
| 535 | super(B734, self).__init__(flight)
|
---|
[9] | 536 | self.dow = 33200
|
---|
| 537 | self.mtow = 68050
|
---|
| 538 | self.mlw = 56200
|
---|
| 539 | self.mzfw = 53100
|
---|
[7] | 540 |
|
---|
| 541 | #---------------------------------------------------------------------------------------
|
---|
| 542 |
|
---|
| 543 | class B735(Boeing737):
|
---|
| 544 | """Boeing 737-500 aircraft."""
|
---|
[8] | 545 | def __init__(self, flight):
|
---|
| 546 | super(B735, self).__init__(flight)
|
---|
[9] | 547 | self.dow = 31300
|
---|
| 548 | self.mtow = 60550
|
---|
| 549 | self.mlw = 50000
|
---|
| 550 | self.mzfw = 46700
|
---|
[7] | 551 |
|
---|
| 552 | #---------------------------------------------------------------------------------------
|
---|
| 553 |
|
---|
| 554 | class DH8D(Aircraft):
|
---|
| 555 | """Bombardier Dash-8 Q400 aircraft.
|
---|
| 556 |
|
---|
| 557 | The aircraft type-specific values in the aircraft state have the following
|
---|
| 558 | structure:
|
---|
[140] | 559 | - fuel: left, right
|
---|
[7] | 560 | - n1: left, right
|
---|
| 561 | - reverser: left, right."""
|
---|
[140] | 562 |
|
---|
[8] | 563 | def __init__(self, flight):
|
---|
| 564 | super(DH8D, self).__init__(flight)
|
---|
[9] | 565 | self.dow = 17185
|
---|
| 566 | self.mtow = 29257
|
---|
| 567 | self.mlw = 28009
|
---|
| 568 | self.mzfw = 25855
|
---|
| 569 | self.gearSpeedLimit = 215
|
---|
| 570 | self.flapSpeedLimits = { 5 : 200,
|
---|
| 571 | 10 : 181,
|
---|
| 572 | 15 : 172,
|
---|
| 573 | 35 : 158 }
|
---|
| 574 |
|
---|
[7] | 575 | #---------------------------------------------------------------------------------------
|
---|
| 576 |
|
---|
| 577 | class Boeing767(Aircraft):
|
---|
| 578 | """Base class for the various aircraft in the Boeing 767 family.
|
---|
| 579 |
|
---|
| 580 | The aircraft type-specific values in the aircraft state have the following
|
---|
| 581 | structure:
|
---|
[140] | 582 | - fuel: left, centre, right
|
---|
[7] | 583 | - n1: left, right
|
---|
| 584 | - reverser: left, right"""
|
---|
[140] | 585 |
|
---|
[9] | 586 | def __init__(self, flight):
|
---|
| 587 | super(Boeing767, self).__init__(flight)
|
---|
[95] | 588 | self._checkers.append(checks.ThrustChecker())
|
---|
[9] | 589 | self.gearSpeedLimit = 270
|
---|
| 590 | self.flapSpeedLimits = { 1 : 255,
|
---|
| 591 | 5 : 235,
|
---|
| 592 | 10 : 215,
|
---|
| 593 | 20 : 215,
|
---|
| 594 | 25 : 185,
|
---|
| 595 | 30 : 175 }
|
---|
[7] | 596 |
|
---|
| 597 | #---------------------------------------------------------------------------------------
|
---|
| 598 |
|
---|
| 599 | class B762(Boeing767):
|
---|
| 600 | """Boeing 767-200 aircraft."""
|
---|
[8] | 601 | def __init__(self, flight):
|
---|
| 602 | super(B762, self).__init__(flight)
|
---|
[9] | 603 | self.dow = 84507
|
---|
| 604 | self.mtow = 175540
|
---|
| 605 | self.mlw = 126098
|
---|
| 606 | self.mzfw = 114758
|
---|
[7] | 607 |
|
---|
| 608 | #---------------------------------------------------------------------------------------
|
---|
| 609 |
|
---|
| 610 | class B763(Boeing767):
|
---|
| 611 | """Boeing 767-300 aircraft."""
|
---|
[8] | 612 | def __init__(self, flight):
|
---|
[331] | 613 | super(B763, self).__init__(flight)
|
---|
[9] | 614 | self.dow = 91311
|
---|
| 615 | self.mtow = 181436
|
---|
| 616 | self.mlw = 137892
|
---|
| 617 | self.mzfw = 130635
|
---|
[7] | 618 |
|
---|
| 619 | #---------------------------------------------------------------------------------------
|
---|
| 620 |
|
---|
| 621 | class CRJ2(Aircraft):
|
---|
| 622 | """Bombardier CRJ-200 aircraft.
|
---|
| 623 |
|
---|
| 624 | The aircraft type-specific values in the aircraft state have the following
|
---|
| 625 | structure:
|
---|
[140] | 626 | - fuel: left, centre, right
|
---|
[7] | 627 | - n1: left, right
|
---|
| 628 | - reverser: left, right."""
|
---|
[8] | 629 | def __init__(self, flight):
|
---|
| 630 | super(CRJ2, self).__init__(flight)
|
---|
[95] | 631 | self._checkers.append(checks.ThrustChecker())
|
---|
[9] | 632 | self.dow = 14549
|
---|
| 633 | self.mtow = 22995
|
---|
| 634 | self.mlw = 21319
|
---|
| 635 | self.mzfw = 19958
|
---|
| 636 | self.gearSpeedLimit = 240
|
---|
| 637 | self.flapSpeedLimits = { 8 : 260,
|
---|
| 638 | 20 : 220,
|
---|
| 639 | 30 : 190,
|
---|
| 640 | 45 : 175 }
|
---|
[7] | 641 |
|
---|
| 642 | #---------------------------------------------------------------------------------------
|
---|
| 643 |
|
---|
| 644 | class F70(Aircraft):
|
---|
| 645 | """Fokker 70 aircraft.
|
---|
| 646 |
|
---|
| 647 | The aircraft type-specific values in the aircraft state have the following
|
---|
| 648 | structure:
|
---|
[140] | 649 | - fuel: left, centre, right
|
---|
[7] | 650 | - n1: left, right
|
---|
| 651 | - reverser: left, right."""
|
---|
[8] | 652 | def __init__(self, flight):
|
---|
| 653 | super(F70, self).__init__(flight)
|
---|
[95] | 654 | self._checkers.append(checks.ThrustChecker())
|
---|
[9] | 655 | self.dow = 24283
|
---|
| 656 | self.mtow = 38100 # FIXME: differentiate by registration number,
|
---|
| 657 | # MTOW of HA-LMF: 41955
|
---|
| 658 | self.mlw = 36740
|
---|
| 659 | self.mzfw = 32655
|
---|
| 660 | self.gearSpeedLimit = 200
|
---|
| 661 | self.flapSpeedLimits = { 8 : 250,
|
---|
| 662 | 15 : 220,
|
---|
| 663 | 25 : 220,
|
---|
| 664 | 42 : 180 }
|
---|
[7] | 665 |
|
---|
| 666 | #---------------------------------------------------------------------------------------
|
---|
| 667 |
|
---|
| 668 | class DC3(Aircraft):
|
---|
| 669 | """Lisunov Li-2 (DC-3) aircraft.
|
---|
| 670 |
|
---|
| 671 | The aircraft type-specific values in the aircraft state have the following
|
---|
| 672 | structure:
|
---|
[140] | 673 | - fuel: left aux, left, right, right aux
|
---|
[7] | 674 | - rpm: left, right
|
---|
| 675 | - reverser: left, right."""
|
---|
[8] | 676 | def __init__(self, flight):
|
---|
| 677 | super(DC3, self).__init__(flight)
|
---|
[9] | 678 | self.dow = 8627
|
---|
| 679 | self.mtow = 11884
|
---|
| 680 | self.mlw = 11793
|
---|
| 681 | self.mzfw = 11780
|
---|
| 682 | self.gearSpeedLimit = 148
|
---|
| 683 | self.flapSpeedLimits = { 15 : 135,
|
---|
| 684 | 30 : 99,
|
---|
| 685 | 45 : 97 }
|
---|
[8] | 686 |
|
---|
| 687 | def _checkFlightEnd(self, aircraftState):
|
---|
| 688 | """Check if the end of the flight has arrived.
|
---|
| 689 |
|
---|
| 690 | This implementation checks the RPM values to be 0."""
|
---|
| 691 | for rpm in aircraftState.rpm:
|
---|
[29] | 692 | if rpm>0: return False
|
---|
| 693 | return True
|
---|
[7] | 694 |
|
---|
| 695 | #---------------------------------------------------------------------------------------
|
---|
| 696 |
|
---|
| 697 | class T134(Aircraft):
|
---|
| 698 | """Tupolev Tu-134 aircraft.
|
---|
| 699 |
|
---|
| 700 | The aircraft type-specific values in the aircraft state have the following
|
---|
| 701 | structure:
|
---|
[140] | 702 | - fuel: left tip, left aux, centre, right aux, right tip, external 1,
|
---|
[7] | 703 | external 2
|
---|
| 704 | - n1: left, right
|
---|
| 705 | - reverser: left, right."""
|
---|
[8] | 706 | def __init__(self, flight):
|
---|
| 707 | super(T134, self).__init__(flight)
|
---|
[95] | 708 | self._checkers.append(checks.ThrustChecker())
|
---|
[210] | 709 | self.dow = 29500
|
---|
| 710 | self.mtow = 49000
|
---|
[9] | 711 | self.mlw = 43000
|
---|
| 712 | self.mzfw = 38500
|
---|
| 713 | self.gearSpeedLimit = 216
|
---|
[210] | 714 | self.flapSpeedLimits = { 10 : 450,
|
---|
| 715 | 20 : 400,
|
---|
| 716 | 30 : 300 }
|
---|
[7] | 717 |
|
---|
[241] | 718 | @property
|
---|
| 719 | def speedInKnots(self):
|
---|
| 720 | """Indicate if the speed is in knots."""
|
---|
| 721 | return False
|
---|
[331] | 722 |
|
---|
[211] | 723 | def _appendLightsLoggers(self):
|
---|
| 724 | """Append the loggers needed for the lights."""
|
---|
| 725 | self._checkers.append(checks.AnticollisionLightsLogger())
|
---|
| 726 | self._checkers.append(checks.LandingLightsLogger())
|
---|
| 727 | self._checkers.append(checks.NavLightsLogger())
|
---|
| 728 |
|
---|
| 729 | def _appendLightsCheckers(self):
|
---|
| 730 | """Append the checkers needed for the lights."""
|
---|
| 731 | self._checkers.append(checks.TupolevAntiCollisionLightsChecker())
|
---|
| 732 | self._checkers.append(checks.LandingLightsChecker())
|
---|
| 733 | self._checkers.append(checks.NavLightsChecker())
|
---|
| 734 |
|
---|
[7] | 735 | #---------------------------------------------------------------------------------------
|
---|
| 736 |
|
---|
| 737 | class T154(Aircraft):
|
---|
| 738 | """Tupolev Tu-154 aircraft.
|
---|
| 739 |
|
---|
| 740 | The aircraft type-specific values in the aircraft state have the following
|
---|
| 741 | structure:
|
---|
[140] | 742 | - fuel: left aux, left, centre, centre 2, right, right aux
|
---|
[7] | 743 | - n1: left, centre, right
|
---|
| 744 | - reverser: left, right"""
|
---|
[8] | 745 | def __init__(self, flight):
|
---|
| 746 | super(T154, self).__init__(flight)
|
---|
[9] | 747 | self.dow = 53259
|
---|
| 748 | self.mtow = 98000
|
---|
| 749 | self.mlw = 78000
|
---|
| 750 | self.mzfw = 72000
|
---|
| 751 | self.gearSpeedLimit = 216
|
---|
| 752 | self.flapSpeedLimits = { 15 : 227,
|
---|
| 753 | 28 : 194,
|
---|
| 754 | 45 : 162 }
|
---|
| 755 |
|
---|
[241] | 756 | @property
|
---|
| 757 | def speedInKnots(self):
|
---|
| 758 | """Indicate if the speed is in knots."""
|
---|
| 759 | return False
|
---|
[331] | 760 |
|
---|
[211] | 761 | def _appendLightsLoggers(self):
|
---|
| 762 | """Append the loggers needed for the lights."""
|
---|
| 763 | self._checkers.append(checks.AnticollisionLightsLogger())
|
---|
| 764 | self._checkers.append(checks.LandingLightsLogger())
|
---|
| 765 | self._checkers.append(checks.NavLightsLogger())
|
---|
| 766 |
|
---|
| 767 | def _appendLightsCheckers(self):
|
---|
| 768 | """Append the checkers needed for the lights."""
|
---|
[311] | 769 | self._checkers.append(checks.AntiCollisionLightsChecker())
|
---|
[211] | 770 | self._checkers.append(checks.LandingLightsChecker())
|
---|
| 771 | self._checkers.append(checks.NavLightsChecker())
|
---|
| 772 |
|
---|
[7] | 773 | #---------------------------------------------------------------------------------------
|
---|
| 774 |
|
---|
[9] | 775 |
|
---|
[7] | 776 | class YK40(Aircraft):
|
---|
| 777 | """Yakovlev Yak-40 aircraft.
|
---|
| 778 |
|
---|
| 779 | The aircraft type-specific values in the aircraft state have the following
|
---|
| 780 | structure:
|
---|
| 781 | - fuel: left, right
|
---|
| 782 | - n1: left, right
|
---|
| 783 | - reverser: left, right"""
|
---|
[8] | 784 | def __init__(self, flight):
|
---|
| 785 | super(YK40, self).__init__(flight)
|
---|
[95] | 786 | self._checkers.append(checks.ThrustChecker())
|
---|
[9] | 787 | self.dow = 9400
|
---|
| 788 | self.mtow = 17200
|
---|
| 789 | self.mlw = 16800
|
---|
| 790 | self.mzfw = 12100
|
---|
| 791 | self.gearSpeedLimit = 165
|
---|
| 792 | self.flapSpeedLimits = { 20 : 165,
|
---|
| 793 | 35 : 135 }
|
---|
| 794 |
|
---|
[241] | 795 | @property
|
---|
| 796 | def speedInKnots(self):
|
---|
| 797 | """Indicate if the speed is in knots."""
|
---|
| 798 | return False
|
---|
[331] | 799 |
|
---|
[211] | 800 | def _appendLightsLoggers(self):
|
---|
| 801 | """Append the loggers needed for the lights."""
|
---|
| 802 | self._checkers.append(checks.AnticollisionLightsLogger())
|
---|
| 803 | self._checkers.append(checks.LandingLightsLogger())
|
---|
| 804 | self._checkers.append(checks.NavLightsLogger())
|
---|
| 805 |
|
---|
| 806 | def _appendLightsCheckers(self):
|
---|
| 807 | """Append the checkers needed for the lights."""
|
---|
| 808 | self._checkers.append(checks.AntiCollisionLightsChecker())
|
---|
| 809 | self._checkers.append(checks.LandingLightsChecker())
|
---|
| 810 | self._checkers.append(checks.NavLightsChecker())
|
---|
| 811 |
|
---|
[7] | 812 | #---------------------------------------------------------------------------------------
|
---|
| 813 |
|
---|
[274] | 814 | mostFuelTanks = [const.FUELTANK_LEFT_TIP, const.FUELTANK_EXTERNAL1,
|
---|
| 815 | const.FUELTANK_LEFT_AUX,
|
---|
| 816 | const.FUELTANK_CENTRE,
|
---|
| 817 | const.FUELTANK_RIGHT_AUX,
|
---|
| 818 | const.FUELTANK_EXTERNAL2, const.FUELTANK_RIGHT_TIP]
|
---|
[141] | 819 |
|
---|
| 820 | #---------------------------------------------------------------------------------------
|
---|
| 821 |
|
---|
[191] | 822 | _classes = { const.AIRCRAFT_B736 : B736,
|
---|
| 823 | const.AIRCRAFT_B737 : B737,
|
---|
| 824 | const.AIRCRAFT_B738 : B738,
|
---|
| 825 | const.AIRCRAFT_B738C : B738Charter,
|
---|
| 826 | const.AIRCRAFT_B733 : B733,
|
---|
| 827 | const.AIRCRAFT_B734 : B734,
|
---|
| 828 | const.AIRCRAFT_B735 : B735,
|
---|
| 829 | const.AIRCRAFT_DH8D : DH8D,
|
---|
| 830 | const.AIRCRAFT_B762 : B762,
|
---|
| 831 | const.AIRCRAFT_B763 : B763,
|
---|
| 832 | const.AIRCRAFT_CRJ2 : CRJ2,
|
---|
| 833 | const.AIRCRAFT_F70 : F70,
|
---|
| 834 | const.AIRCRAFT_DC3 : DC3,
|
---|
| 835 | const.AIRCRAFT_T134 : T134,
|
---|
| 836 | const.AIRCRAFT_T154 : T154,
|
---|
| 837 | const.AIRCRAFT_YK40 : YK40 }
|
---|
[8] | 838 |
|
---|
| 839 | #---------------------------------------------------------------------------------------
|
---|
[197] | 840 |
|
---|
| 841 | if __name__ == "__main__":
|
---|
| 842 | value = SmoothedValue()
|
---|
| 843 |
|
---|
| 844 | print "Adding 1, 12.0"
|
---|
| 845 | value.add(1, 12.0)
|
---|
| 846 | print value.get()
|
---|
| 847 |
|
---|
| 848 | print "Adding 1, 15.0"
|
---|
| 849 | value.add(1, 15.0)
|
---|
| 850 | print value.get()
|
---|
| 851 |
|
---|
| 852 | print "Adding 2, 18.0"
|
---|
| 853 | value.add(2, 18.0)
|
---|
| 854 | print value.get()
|
---|
| 855 |
|
---|
| 856 | print "Adding 2, 20.0"
|
---|
| 857 | value.add(2, 20.0)
|
---|
| 858 | print value.get()
|
---|
| 859 |
|
---|
| 860 | print "Adding 5, 22.0"
|
---|
| 861 | value.add(5, 22.0)
|
---|
| 862 | print value.get()
|
---|
| 863 |
|
---|
| 864 | print "Adding 5, 25.0"
|
---|
| 865 | value.add(5, 25.0)
|
---|
| 866 | print value.get()
|
---|
| 867 |
|
---|
| 868 | print "Adding 5, 29.0"
|
---|
| 869 | value.add(5, 29.0)
|
---|
| 870 | print value.get()
|
---|
| 871 |
|
---|
| 872 | print "Adding 5, 21.0"
|
---|
| 873 | value.add(5, 21.0)
|
---|
| 874 | print value.get()
|
---|
| 875 |
|
---|
| 876 | print "Adding 5, 26.0"
|
---|
| 877 | value.add(5, 26.0)
|
---|
| 878 | print value.get()
|
---|
| 879 |
|
---|
| 880 | print "Adding 2, 30.0"
|
---|
| 881 | value.add(2, 30.0)
|
---|
| 882 | print value.get()
|
---|
| 883 |
|
---|
| 884 | print "Adding 2, 55.0"
|
---|
| 885 | value.add(2, 55.0)
|
---|
| 886 | print value.get()
|
---|
| 887 |
|
---|
| 888 | #---------------------------------------------------------------------------------------
|
---|