Handle another error case in generate_at_cp_helipad + align helos heading with their slot

This commit is contained in:
Khopa 2021-08-07 00:38:12 +02:00
parent c4937e95e9
commit 5412487178

View File

@ -564,6 +564,7 @@ class AircraftConflictGenerator:
# Note : A bit dirty, need better support in pydcs # Note : A bit dirty, need better support in pydcs
group.points[0].action = PointAction.FromGroundArea group.points[0].action = PointAction.FromGroundArea
group.points[0].type = "TakeOffGround" group.points[0].type = "TakeOffGround"
group.units[0].heading = helipad.heading
if start_type != "Cold": if start_type != "Cold":
group.points[0].action = PointAction.FromGroundAreaHot group.points[0].action = PointAction.FromGroundAreaHot
group.points[0].type = "TakeOffGroundHot" group.points[0].type = "TakeOffGroundHot"
@ -575,11 +576,14 @@ class AircraftConflictGenerator:
if helipad is not None: if helipad is not None:
helipad.occupied = True helipad.occupied = True
group.units[1 + i].position = Point(helipad.x, helipad.y) group.units[1 + i].position = Point(helipad.x, helipad.y)
group.units[1 + i].heading = helipad.heading
else: else:
raise RuntimeError( raise RuntimeError(
f"Control Point {cp.name} does not have enough helipads" f"Control Point {cp.name} does not have enough helipads"
) )
return group return group
else:
raise RuntimeError(f"Control Point {cp.name} does not have enough helipads")
def _add_radio_waypoint( def _add_radio_waypoint(
self, self,