mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
This is behaving strangely on some machines. Stop hiding the details in the UI while we debug.
33 lines
915 B
Python
33 lines
915 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 = estimator.mission_start_time(flight)
|
|
|
|
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)
|