Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion EDAP_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
Flags2PhysicalMulticrew = 1 << 18
Flags2FsdHyperdriveCharging = 1 << 19 # While charging and jumping for system jump
Flags2FsdScoActive = 1 << 20
Flags2Future21 = 1 << 21 # Probably Supercruise Assist on. To be confirmed.
Flags2SupercruiseAssistActive = 1 << 21 # While SCA is enabled and active (aligned and throttled to blue zone).
Flags2Future22 = 1 << 22
Flags2Future23 = 1 << 23
Flags2Future24 = 1 << 24
Expand Down
37 changes: 37 additions & 0 deletions EDJournal.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,22 @@ def check_sco_fsd(modules: list[dict[str, any]] | None) -> bool:
return False


def check_supercruise_assist(modules: list[dict[str, any]] | None) -> bool:
""" Gets whether the ship has a Supercruise Assist (SCA) module.
"""
# Default to SCO fitted if modules is None
if modules is None:
return True

# Check all modules. Could just check the internals, but this is easier.
for module in modules:
if "supercruiseassist" in module['Item'].lower():
return True

#print("FrameShiftDrive has no SCO")
return False


def check_station_type(station_type: str, station_name: str, station_services: list[str]) -> StationType:
""" Gets the station type.
@station_type: The station type from the journal (i.e. 'Coriolis').
Expand Down Expand Up @@ -237,6 +253,7 @@ def __init__(self, cb):
'has_adv_dock_comp': None,
'has_std_dock_comp': None,
'has_sco_fsd': None,
'has_supercruise_assist': None,
'StationServices': None,
'ConstructionDepotDetails': dict[str, any],
'MarketID': 0,
Expand Down Expand Up @@ -321,11 +338,30 @@ def parse_line(self, log):
self.ship['no_dock_reason'] = log['Reason']

elif log_event == 'SupercruiseExit':
# {
# "timestamp": "2025-06-14T20:39:18Z",
# "event": "SupercruiseExit",
# "Taxi": false,
# "Multicrew": false,
# "StarSystem": "Ho Hsi",
# "SystemAddress": 3412091472243,
# "Body": "Ho Hsi 2",
# "BodyID": 10,
# "BodyType": "Null" (e.g. the barycentre of a binary star system) | "Star" | "Planet" |
# "PlanetaryRing" | "StellarRing" | "Station" | "AsteroidCluster"
# }
self.ship['status'] = 'in_space'
self.ship['body'] = log['Body']
self.ship['sc_exit_body_type'] = log.get('BodyType', '')

elif log_event == 'SupercruiseDestinationDrop':
# {
# "timestamp": "2025-06-14T20:39:15Z",
# "event": "SupercruiseDestinationDrop",
# "Type": "STAR BLAZE V2V-65W",
# "Threat": 0,
# "MarketID": 3712238848
# }
self.ship['SupercruiseDestinationDrop_type'] = log['Type']

elif log_event == 'DockingCancelled':
Expand Down Expand Up @@ -410,6 +446,7 @@ def parse_line(self, log):
self.ship['has_adv_dock_comp'] = check_adv_docking_computer(log['Modules'])
self.ship['has_std_dock_comp'] = check_std_docking_computer(log['Modules'])
self.ship['has_sco_fsd'] = check_sco_fsd(log['Modules'])
self.ship['has_supercruise_assist'] = check_supercruise_assist(log['Modules'])

# parse fuel
if 'FuelLevel' in log and self.ship['type'] != 'TestBuggy':
Expand Down
2 changes: 2 additions & 0 deletions ED_AP.py
Original file line number Diff line number Diff line change
Expand Up @@ -3179,6 +3179,8 @@ def engine_loop(self):
self.ap_ckb('log+vce', f"Warning, your {ship_fullname} is not fitted with an Advanced Docking Computer.")
if self.jn.ship_state()['has_std_dock_comp']:
self.ap_ckb('log+vce', f"Warning, your {ship_fullname} is fitted with a Standard Docking Computer.")
if self.jn.ship_state()['has_supercruise_assist']:
self.ap_ckb('log+vce', f"Your {ship_fullname} is fitted with a Supercruise Assist module.")

# Store ship for change detection BEFORE loading config and GUI update
self.current_ship_type = ship
Expand Down
6 changes: 5 additions & 1 deletion StatusParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def __init__(self, file_path=None):
self.last_mod_time = None

# Read json file data
self.enable_log_flag_diffs = False
self.current_data = None
self.current_data = self.get_cleaned_data()
self.last_data = self.current_data
Expand Down Expand Up @@ -309,7 +310,10 @@ def get_cleaned_data(self):
# print(json.dumps(data, indent=4))

# Enable the following to print all the changes to the status flags.
# self.log_flag_diffs()
#self.enable_log_flag_diffs = True
if self.enable_log_flag_diffs:
self.log_flag_diffs()

# TODO Enable the following to print all the changes to the destination. See function for details.
# self.log_destination_diffs()

Expand Down