1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-13 15:57:14 +03:00

eddn/tracking: Add BodyType to tracking UI

This helps demonstrate that a 'spurious' Station BodyName/ID is actually OK,
because BodyType makes it clear.
This commit is contained in:
Athanasius 2023-01-16 19:32:44 +00:00
parent 2f2ee885c8
commit dbb471f2c2
No known key found for this signature in database
GPG Key ID: 772697E181BB2767

View File

@ -87,6 +87,7 @@ class This:
self.coordinates: Optional[Tuple] = None
self.body_name: Optional[str] = None
self.body_id: Optional[int] = None
self.body_type: Optional[int] = None
self.station_name: str | None = None
self.station_type: str | None = None
self.station_marketid: str | None = None
@ -125,6 +126,7 @@ class This:
self.ui_system_address: tk.Label
self.ui_j_body_name: tk.Label
self.ui_j_body_id: tk.Label
self.ui_j_body_type: tk.Label
self.ui_s_body_name: tk.Label
self.ui_station_name: tk.Label
self.ui_station_type: tk.Label
@ -1978,13 +1980,13 @@ def plugin_app(parent: tk.Tk) -> Optional[tk.Frame]:
# System
#######################################################################
# SystemName
system_name_label = tk.Label(this.ui, text="S:Name:")
system_name_label = tk.Label(this.ui, text="J:SystemName:")
system_name_label.grid(row=row, column=0, sticky=tk.W)
this.ui_system_name = tk.Label(this.ui, name='eddn_track_system_name', anchor=tk.W)
this.ui_system_name.grid(row=row, column=1, sticky=tk.E)
row += 1
# SystemAddress
system_address_label = tk.Label(this.ui, text="S:Address:")
system_address_label = tk.Label(this.ui, text="J:SystemAddress:")
system_address_label.grid(row=row, column=0, sticky=tk.W)
this.ui_system_address = tk.Label(this.ui, name='eddn_track_system_address', anchor=tk.W)
this.ui_system_address.grid(row=row, column=1, sticky=tk.E)
@ -2006,6 +2008,12 @@ def plugin_app(parent: tk.Tk) -> Optional[tk.Frame]:
this.ui_j_body_id = tk.Label(this.ui, name='eddn_track_j_body_id', anchor=tk.W)
this.ui_j_body_id.grid(row=row, column=1, sticky=tk.E)
row += 1
# Body Type from Journal
journal_body_type_label = tk.Label(this.ui, text="J:BodyType:")
journal_body_type_label.grid(row=row, column=0, sticky=tk.W)
this.ui_j_body_type = tk.Label(this.ui, name='eddn_track_j_body_type', anchor=tk.W)
this.ui_j_body_type.grid(row=row, column=1, sticky=tk.E)
row += 1
# Body Name from Status.json
status_body_name_label = tk.Label(this.ui, text="S:BodyName:")
status_body_name_label.grid(row=row, column=0, sticky=tk.W)
@ -2063,6 +2071,10 @@ def tracking_ui_update() -> None:
if this.body_id is not None:
this.ui_j_body_id['text'] = str(this.body_id)
this.ui_j_body_type['text'] = '≪None≫'
if this.body_type is not None:
this.ui_j_body_type['text'] = str(this.body_type)
this.ui_s_body_name['text'] = '≪None≫'
if this.status_body_name is not None:
this.ui_s_body_name['text'] = this.status_body_name
@ -2288,6 +2300,7 @@ def journal_entry( # noqa: C901, CCR001
# outside of this function.
this.body_name = state['Body']
this.body_id = state['BodyID']
this.body_type = state['BodyType']
this.coordinates = state['StarPos']
this.system_address = state['SystemAddress']
this.system_name = state['SystemName']