mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Previously we were trying to make every potential flight plan look just like a strike mission's flight plan. This led to a lot of special case behavior in several places that was causing us to misplan TOTs. I've reorganized this such that there's now an explicit `FlightPlan` class, and any specialized behavior is handled by the subclasses. I've also taken the opportunity to alter the behavior of CAS and front-line CAP missions. These no longer involve the usual formation waypoints. Instead the CAP will aim to be on station at the time that the CAS mission reaches its ingress point, and leave at its egress time. Both flights fly directly to the point with a start time configured for a rendezvous. It might be worth adding hold points back to every flight plan just to ensure that non-formation flights don't end up with a very low speed enroute to the target if they perform ground ops quicker than expected.
34 lines
977 B
Python
34 lines
977 B
Python
import datetime
|
|
|
|
from PySide2.QtWidgets import QLabel, QHBoxLayout, QGroupBox, QVBoxLayout
|
|
|
|
from gen.ato import Package
|
|
from gen.flights.flight import Flight
|
|
from gen.flights.traveltime import TotEstimator
|
|
|
|
|
|
# TODO: Remove?
|
|
class QFlightDepartureDisplay(QGroupBox):
|
|
|
|
def __init__(self, package: Package, flight: Flight):
|
|
super().__init__("Departure")
|
|
|
|
layout = QVBoxLayout()
|
|
|
|
departure_row = QHBoxLayout()
|
|
layout.addLayout(departure_row)
|
|
|
|
estimator = TotEstimator(package)
|
|
delay = datetime.timedelta(
|
|
seconds=int(estimator.mission_start_time(flight).total_seconds()))
|
|
|
|
departure_row.addWidget(QLabel(
|
|
f"Departing from <b>{flight.from_cp.name}</b>"
|
|
))
|
|
departure_row.addWidget(QLabel(f"At T+{delay}"))
|
|
|
|
layout.addWidget(QLabel("Determined based on the package TOT. Edit the "
|
|
"package to adjust the TOT."))
|
|
|
|
self.setLayout(layout)
|