diff --git a/src/fbw/src/AdditionalData.h b/src/fbw/src/AdditionalData.h index ae651d7f1e0..e541d16d4cf 100644 --- a/src/fbw/src/AdditionalData.h +++ b/src/fbw/src/AdditionalData.h @@ -26,4 +26,7 @@ struct AdditionalData { double throttle_lever_2_pos; double corrected_engine_N1_1_percent; double corrected_engine_N1_2_percent; + unsigned long long assistanceTakeoffEnabled; + unsigned long long assistanceLandingEnabled; + unsigned long long aiAutoTrimActive; }; diff --git a/src/fbw/src/FlightDataRecorder.h b/src/fbw/src/FlightDataRecorder.h index 02121174ff8..c9a79012d5f 100644 --- a/src/fbw/src/FlightDataRecorder.h +++ b/src/fbw/src/FlightDataRecorder.h @@ -13,7 +13,7 @@ class FlightDataRecorder { public: // IMPORTANT: this constant needs to increased with every interface change - const uint64_t INTERFACE_VERSION = 19; + const uint64_t INTERFACE_VERSION = 20; void initialize(); diff --git a/src/fbw/src/FlyByWireInterface.cpp b/src/fbw/src/FlyByWireInterface.cpp index f265e587f8e..b9485228c7b 100644 --- a/src/fbw/src/FlyByWireInterface.cpp +++ b/src/fbw/src/FlyByWireInterface.cpp @@ -741,6 +741,9 @@ bool FlyByWireInterface::updateAdditionalData(double sampleTime) { additionalData.throttle_lever_2_pos = simData.throttle_lever_2_pos; additionalData.corrected_engine_N1_1_percent = simData.corrected_engine_N1_1_percent; additionalData.corrected_engine_N1_2_percent = simData.corrected_engine_N1_2_percent; + additionalData.assistanceTakeoffEnabled = simData.assistanceTakeoffEnabled; + additionalData.assistanceLandingEnabled = simData.assistanceLandingEnabled; + additionalData.aiAutoTrimActive = simData.aiAutoTrimActive; return true; } diff --git a/src/fbw/src/interface/SimConnectData.h b/src/fbw/src/interface/SimConnectData.h index 809e0f13e4f..632d3edb6bb 100644 --- a/src/fbw/src/interface/SimConnectData.h +++ b/src/fbw/src/interface/SimConnectData.h @@ -125,6 +125,9 @@ struct SimData { double brakeRightPosition; double flapsHandleIndex; double gearHandlePosition; + unsigned long long assistanceTakeoffEnabled; + unsigned long long assistanceLandingEnabled; + unsigned long long aiAutoTrimActive; }; struct SimInput { diff --git a/src/fbw/src/interface/SimConnectInterface.cpp b/src/fbw/src/interface/SimConnectInterface.cpp index cc06924c43b..f28f4e544e5 100644 --- a/src/fbw/src/interface/SimConnectInterface.cpp +++ b/src/fbw/src/interface/SimConnectInterface.cpp @@ -241,6 +241,9 @@ bool SimConnectInterface::prepareSimDataSimConnectDataDefinitions() { result &= addDataDefinition(hSimConnect, 0, SIMCONNECT_DATATYPE_FLOAT64, "BRAKE RIGHT POSITION", "POSITION"); result &= addDataDefinition(hSimConnect, 0, SIMCONNECT_DATATYPE_FLOAT64, "FLAPS HANDLE INDEX", "NUMBER"); result &= addDataDefinition(hSimConnect, 0, SIMCONNECT_DATATYPE_FLOAT64, "GEAR HANDLE POSITION", "POSITION"); + result &= addDataDefinition(hSimConnect, 0, SIMCONNECT_DATATYPE_INT64, "ASSISTANCE TAKEOFF ENABLED", "BOOL"); + result &= addDataDefinition(hSimConnect, 0, SIMCONNECT_DATATYPE_INT64, "ASSISTANCE LANDING ENABLED", "BOOL"); + result &= addDataDefinition(hSimConnect, 0, SIMCONNECT_DATATYPE_INT64, "AI AUTOTRIM ACTIVE", "BOOL"); return result; } diff --git a/src/fdr2csv/src/FlightDataRecorderConverter.cpp b/src/fdr2csv/src/FlightDataRecorderConverter.cpp index 434c4404b8b..e4d98f9a222 100644 --- a/src/fdr2csv/src/FlightDataRecorderConverter.cpp +++ b/src/fdr2csv/src/FlightDataRecorderConverter.cpp @@ -5,10 +5,7 @@ using namespace std; -void FlightDataRecorderConverter::writeHeader( - ofstream &out, - const string &delimiter -) { +void FlightDataRecorderConverter::writeHeader(ofstream& out, const string& delimiter) { fmt::print(out, "ap_sm.time.dt{}", delimiter); fmt::print(out, "ap_sm.time.simulation_time{}", delimiter); fmt::print(out, "ap_sm.data.aircraft_position.lat{}", delimiter); @@ -571,19 +568,20 @@ void FlightDataRecorderConverter::writeHeader( fmt::print(out, "data.throttle_lever_2_pos{}", delimiter); fmt::print(out, "data.corrected_engine_N1_1_percent{}", delimiter); fmt::print(out, "data.corrected_engine_N1_2_percent{}", delimiter); + fmt::print(out, "data.assistanceTakeoffEnabled{}", delimiter); + fmt::print(out, "data.assistanceLandingEnabled{}", delimiter); + fmt::print(out, "data.aiAutoTrimActive{}", delimiter); fmt::print(out, "\n"); } -void FlightDataRecorderConverter::writeStruct( - ofstream &out, - const string &delimiter, - const ap_sm_output &ap_sm, - const ap_raw_output &ap_law, - const athr_out &athr, - const fbw_output &fbw, - const EngineData &engine, - const AdditionalData &data -) { +void FlightDataRecorderConverter::writeStruct(ofstream& out, + const string& delimiter, + const ap_sm_output& ap_sm, + const ap_raw_output& ap_law, + const athr_out& athr, + const fbw_output& fbw, + const EngineData& engine, + const AdditionalData& data) { fmt::print(out, "{}{}", ap_sm.time.dt, delimiter); fmt::print(out, "{}{}", ap_sm.time.simulation_time, delimiter); fmt::print(out, "{}{}", ap_sm.data.aircraft_position.lat, delimiter); @@ -803,16 +801,10 @@ void FlightDataRecorderConverter::writeStruct( fmt::print(out, "{}{}", static_cast(ap_sm.vertical_previous.output.EXPED_mode_active), delimiter); fmt::print(out, "{}{}", static_cast(ap_sm.vertical_previous.output.FD_disconnect), delimiter); fmt::print(out, "{}{}", static_cast(ap_sm.vertical_previous.output.TCAS_sub_mode), delimiter); - fmt::print(out, - "{}{}", - static_cast(ap_sm.vertical_previous.output.TCAS_sub_mode_compatible), - delimiter); + fmt::print(out, "{}{}", static_cast(ap_sm.vertical_previous.output.TCAS_sub_mode_compatible), delimiter); fmt::print(out, "{}{}", static_cast(ap_sm.vertical_previous.output.TCAS_message_disarm), delimiter); fmt::print(out, "{}{}", static_cast(ap_sm.vertical_previous.output.TCAS_message_RA_inhibit), delimiter); - fmt::print(out, - "{}{}", - static_cast(ap_sm.vertical_previous.output.TCAS_message_TRK_FPA_deselection), - delimiter); + fmt::print(out, "{}{}", static_cast(ap_sm.vertical_previous.output.TCAS_message_TRK_FPA_deselection), delimiter); fmt::print(out, "{}{}", ap_sm.output.enabled_AP1, delimiter); fmt::print(out, "{}{}", ap_sm.output.enabled_AP2, delimiter); fmt::print(out, "{}{}", ap_sm.output.lateral_law, delimiter); @@ -1152,5 +1144,8 @@ void FlightDataRecorderConverter::writeStruct( fmt::print(out, "{}{}", data.throttle_lever_2_pos, delimiter); fmt::print(out, "{}{}", data.corrected_engine_N1_1_percent, delimiter); fmt::print(out, "{}{}", data.corrected_engine_N1_2_percent, delimiter); + fmt::print(out, "{}{}", static_cast(data.assistanceTakeoffEnabled), delimiter); + fmt::print(out, "{}{}", static_cast(data.assistanceLandingEnabled), delimiter); + fmt::print(out, "{}{}", static_cast(data.aiAutoTrimActive), delimiter); fmt::print(out, "\n"); } diff --git a/src/fdr2csv/src/main.cpp b/src/fdr2csv/src/main.cpp index 87f83e8579b..6e148c5904a 100644 --- a/src/fdr2csv/src/main.cpp +++ b/src/fdr2csv/src/main.cpp @@ -15,7 +15,7 @@ using namespace std; // IMPORTANT: this constant needs to increased with every interface change -const uint64_t INTERFACE_VERSION = 19; +const uint64_t INTERFACE_VERSION = 20; int main(int argc, char *argv[]) { // variables for command line parameters