Beispiel #1
0
    def add_runway_waypoint(
        self,
        airport: Airport,
        runway: Optional[Runway] = None,
        distance=random.randrange(6000, 8000, 100)
    ) -> MovingPoint:
        """Adds a waypoint parallel to the given runway heading, for start or approach.

        :param airport: start airport object
        :param runway: runway for heading direction, if None first(default) airport runway will be used.
        :param distance: distance of the waypoint from the airport
        :return: MovePoint object describing the waypoint
        """
        runway = runway if runway else airport.runways[0]

        mp = MovingPoint()
        mp.type = "Turning Point"
        mp.action = PointAction.TurningPoint
        mp.alt_type = "RADIO"
        mp.position = airport.position.point_from_heading(
            runway.heading, distance)
        mp.alt = 300
        mp.speed = 200 / 3.6
        mp.ETA_locked = False
        mp.properties = PointProperties()

        self.add_point(mp)
        return mp
Beispiel #2
0
 def set_waypoint_tot(self, waypoint: MovingPoint, tot: timedelta) -> None:
     self.waypoint.tot = tot
     if not self._viggen_client_tot():
         waypoint.ETA = int(
             (tot - self.elapsed_mission_time).total_seconds())
         waypoint.ETA_locked = True
         waypoint.speed_locked = False
Beispiel #3
0
    def add_waypoint(self, position: mapping.Point, speed=20) -> MovingPoint:
        mp = MovingPoint(position)
        mp.type = "Turning Point"
        mp.action = PointAction.TurningPoint
        mp.speed = speed / 3.6
        mp.ETA_locked = False

        self.add_point(mp)
        return mp
Beispiel #4
0
    def add_waypoint(self, position: mapping.Point,
                     move_formation: PointAction=PointAction.OffRoad, speed=32) -> MovingPoint:
        mp = MovingPoint()
        mp.type = "Turning Point"
        mp.action = move_formation
        mp.position = copy.copy(position)
        mp.speed = speed / 3.6
        mp.ETA_locked = False

        self.add_point(mp)
        return mp
Beispiel #5
0
    def land_at(self, airport: Airport) -> MovingPoint:
        mp = MovingPoint(airport.position)
        mp.type = "Land"
        mp.action = PointAction.Landing
        mp.airdrome_id = airport.id
        mp.alt = 0
        mp.speed = 0
        mp.ETA_locked = False
        mp.properties = PointProperties()

        self.add_point(mp)
        return mp
Beispiel #6
0
    def add_waypoint(self, pos: mapping.Point, altitude, speed=600, name: String=None) -> MovingPoint:
        mp = MovingPoint()
        mp.type = "Turning Point"
        mp.action = PointAction.TurningPoint
        mp.name = name if name else String()
        mp.position = mapping.Point(pos.x, pos.y)
        mp.alt = altitude
        mp.speed = speed / 3.6
        mp.ETA_locked = False
        mp.properties = PointProperties()

        self.add_point(mp)
        return mp