Fix TOT-offset issues

This commit is contained in:
Raffson
2024-01-28 17:35:12 +01:00
parent 8d56e2d3bb
commit dad5e7c146
12 changed files with 32 additions and 20 deletions

View File

@@ -48,7 +48,7 @@ class CustomFlightPlan(FlightPlan[CustomLayout]):
def tot_for_waypoint(self, waypoint: FlightWaypoint) -> datetime | None:
if waypoint == self.tot_waypoint:
return self.package.time_over_target + self.tot_offset
return self.tot
return None
def depart_time_for_waypoint(self, waypoint: FlightWaypoint) -> datetime | None:

View File

@@ -249,11 +249,15 @@ class FlightPlan(ABC, Generic[LayoutT]):
self._travel_time_to_waypoint(self.tot_waypoint)
+ self.estimate_startup()
+ self.estimate_ground_ops()
+ self.estimate_takeoff_time()
)
def startup_time(self) -> datetime:
return (
self.takeoff_time() - self.estimate_startup() - self.estimate_ground_ops()
self.takeoff_time()
- self.estimate_startup()
- self.estimate_ground_ops()
- self.estimate_takeoff_time()
)
def estimate_startup(self) -> timedelta:
@@ -273,6 +277,10 @@ class FlightPlan(ABC, Generic[LayoutT]):
else:
return timedelta(minutes=8)
@staticmethod
def estimate_takeoff_time() -> timedelta:
return timedelta(seconds=30)
@property
def is_airassault(self) -> bool:
return False

View File

@@ -85,9 +85,9 @@ class FormationFlightPlan(LoiterFlightPlan, ABC):
def tot_for_waypoint(self, waypoint: FlightWaypoint) -> datetime | None:
if waypoint == self.layout.join:
return self.join_time + self.tot_offset
return self.join_time
elif waypoint == self.layout.split:
return self.split_time + self.tot_offset
return self.split_time
return None
@property

View File

@@ -31,7 +31,7 @@ class LoiterFlightPlan(StandardFlightPlan[Any], ABC):
def depart_time_for_waypoint(self, waypoint: FlightWaypoint) -> datetime | None:
if waypoint == self.layout.hold:
return self.push_time + self.tot_offset
return self.push_time
return None
def total_time_between_waypoints(

View File

@@ -66,14 +66,14 @@ class SweepFlightPlan(LoiterFlightPlan):
def tot_for_waypoint(self, waypoint: FlightWaypoint) -> datetime | None:
if waypoint == self.layout.sweep_start:
return self.sweep_start_time + self.tot_offset
return self.sweep_start_time
if waypoint == self.layout.sweep_end:
return self.sweep_end_time + self.tot_offset
return self.sweep_end_time
return None
def depart_time_for_waypoint(self, waypoint: FlightWaypoint) -> datetime | None:
if waypoint == self.layout.hold:
return self.push_time + self.tot_offset
return self.push_time
return None
@property