Ignore:
Timestamp:
02/05/12 13:42:53 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Flare calculations are handled and added some other printouts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/flight.py

    r8 r9  
    1919        self.logger = logger
    2020        self.cruiseAltitude = None
     21        self.flareTimeFromFS = False
    2122        self.aircraftType = None
    2223        self.aircraft = None
     
    2425
    2526        self._endCondition = threading.Condition()
     27
     28        self._flareStart = None
     29        self._flareStartFS = None
    2630
    2731    @property
     
    3135
    3236    def setStage(self, timestamp, stage):
    33         """Set the flight stage."""
     37        """Set the flight stage.
     38
     39        Returns if the stage has really changed."""
    3440        if stage!=self._stage:
    3541            self._stage = stage
     
    3844                with self._endCondition:
    3945                    self._endCondition.notify()
     46            return True
     47        else:
     48            return False
     49
     50    def flareStarted(self, flareStart, flareStartFS):
     51        """Called when the flare time has started."""
     52        self._flareStart = flareStart
     53        self._flareStartFS = flareStartFS
     54
     55    def flareFinished(self, flareEnd, flareEndFS):
     56        """Called when the flare time has ended.
     57       
     58        Return a tuple of the following items:
     59        - a boolean indicating if FS time is used
     60        - the flare time
     61        """
     62        if self.flareTimeFromFS:
     63            return (True, flareEndFS - self._flareStartFS)
     64        else:
     65            return (False, flareEnd - self._flareStart)
    4066
    4167    def wait(self):
Note: See TracChangeset for help on using the changeset viewer.