mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Include steerpoint number in strike page.
https://github.com/dcs-liberation/dcs_liberation/issues/1001
This commit is contained in:
parent
8274e68846
commit
52d96b8518
@ -481,10 +481,10 @@ class StrikeTaskPage(KneeboardPage):
|
|||||||
self.theater = theater
|
self.theater = theater
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def targets(self) -> Iterator[FlightWaypoint]:
|
def targets(self) -> Iterator[NumberedWaypoint]:
|
||||||
for waypoint in self.flight.waypoints:
|
for idx, waypoint in enumerate(self.flight.waypoints):
|
||||||
if waypoint.waypoint_type == FlightWaypointType.TARGET_POINT:
|
if waypoint.waypoint_type == FlightWaypointType.TARGET_POINT:
|
||||||
yield waypoint
|
yield NumberedWaypoint(idx, waypoint)
|
||||||
|
|
||||||
def write(self, path: Path) -> None:
|
def write(self, path: Path) -> None:
|
||||||
writer = KneeboardPageWriter(dark_theme=self.dark_kneeboard)
|
writer = KneeboardPageWriter(dark_theme=self.dark_kneeboard)
|
||||||
@ -492,18 +492,18 @@ class StrikeTaskPage(KneeboardPage):
|
|||||||
custom_name_title = ' ("{}")'.format(self.flight.custom_name)
|
custom_name_title = ' ("{}")'.format(self.flight.custom_name)
|
||||||
else:
|
else:
|
||||||
custom_name_title = ""
|
custom_name_title = ""
|
||||||
writer.title(f"{self.flight.callsign} Target Info{custom_name_title}")
|
writer.title(f"{self.flight.callsign} Strike Task Info{custom_name_title}")
|
||||||
|
|
||||||
writer.table(
|
writer.table(
|
||||||
[self.target_info_row(t) for t in self.targets],
|
[self.target_info_row(t) for t in self.targets],
|
||||||
headers=["Description", "Location"],
|
headers=["Steerpoint", "Description", "Location"],
|
||||||
)
|
)
|
||||||
|
|
||||||
writer.write(path)
|
writer.write(path)
|
||||||
|
|
||||||
def target_info_row(self, target: FlightWaypoint) -> List[str]:
|
def target_info_row(self, target: NumberedWaypoint) -> List[str]:
|
||||||
ll = self.theater.point_to_ll(target.position)
|
ll = self.theater.point_to_ll(target.waypoint.position)
|
||||||
return [target.pretty_name, self.format_ll(ll)]
|
return [str(target.number), target.waypoint.pretty_name, self.format_ll(ll)]
|
||||||
|
|
||||||
|
|
||||||
class KneeboardGenerator(MissionInfoGenerator):
|
class KneeboardGenerator(MissionInfoGenerator):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user