From d0040a9f782bc05c7745dea70a12d3a7a5f8fc7f Mon Sep 17 00:00:00 2001 From: Steve Towner Date: Thu, 4 Jun 2026 09:19:28 -0500 Subject: [PATCH] Added Supercruise Assist module and status detection (for future use). --- EDAP_data.py | 2 +- EDJournal.py | 37 +++++++++++++++++++++++++++++++++++++ ED_AP.py | 2 ++ StatusParser.py | 6 +++++- 4 files changed, 45 insertions(+), 2 deletions(-) diff --git a/EDAP_data.py b/EDAP_data.py index 721f85f..723613b 100644 --- a/EDAP_data.py +++ b/EDAP_data.py @@ -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 diff --git a/EDJournal.py b/EDJournal.py index 439ec6f..907bf98 100644 --- a/EDJournal.py +++ b/EDJournal.py @@ -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'). @@ -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, @@ -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': @@ -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': diff --git a/ED_AP.py b/ED_AP.py index 324befd..4116546 100644 --- a/ED_AP.py +++ b/ED_AP.py @@ -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 diff --git a/StatusParser.py b/StatusParser.py index 51f1c5d..43bbe06 100644 --- a/StatusParser.py +++ b/StatusParser.py @@ -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 @@ -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()