mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix TOT-offset issues
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user