#include "Aerodynamics_input.hpp" namespace XNSim::C909::ATA04 { Aerodynamics_input_Interface::Aerodynamics_input_Interface() { MAP_DATA_FUNC(l_04_i_aerocomac_alpha_f8); MAP_DATA_FUNC(l_04_i_aerocomac_alpdot_f8); MAP_DATA_FUNC(l_04_i_aerocomac_beta_f8); MAP_DATA_FUNC(l_04_i_aerocomac_press_alt_f8); MAP_DATA_FUNC(l_04_i_aerocomac_tas_f8); MAP_DATA_FUNC(l_04_i_aerocomac_mach_f8); MAP_DATA_FUNC(l_04_i_aerocomac_nx_f8); MAP_DATA_FUNC(l_04_i_aerocomac_ny_f8); MAP_DATA_FUNC(l_04_i_aerocomac_nz_f8); MAP_DATA_FUNC(l_04_i_aerocomac_p_f8); MAP_DATA_FUNC(l_04_i_aerocomac_q_f8); MAP_DATA_FUNC(l_04_i_aerocomac_r_f8); MAP_DATA_FUNC(l_04_i_aerocomac_qbar_f8); MAP_DATA_FUNC(l_04_i_aerocomac_blcg_f8); MAP_DATA_FUNC(l_04_i_aerocomac_bscg_f8); MAP_DATA_FUNC(l_04_i_aerocomac_wlcg_f8); MAP_DATA_FUNC(l_04_i_aerocomac_ail_f8); MAP_DATA_FUNC(l_04_i_aerocomac_elv_f8); MAP_DATA_FUNC(l_04_i_aerocomac_rud_f8); MAP_DATA_FUNC(l_04_i_aerocomac_stab_f8); MAP_DATA_FUNC(l_04_i_aerocomac_gear_f8); MAP_DATA_FUNC(l_04_i_aerocomac_flap_f8); MAP_DATA_FUNC(l_04_i_aerocomac_slat_f8); MAP_DATA_FUNC(l_04_i_aerocomac_spl_f8); MAP_DATA_FUNC(l_04_i_aerocomac_tnet_f8); MAP_DATA_FUNC(l_04_i_aerocomac_kice_f8); MAP_DATA_FUNC(l_04_i_aerocomac_alt_agl_f8); } Aerodynamics_input_Interface::~Aerodynamics_input_Interface() { } void Aerodynamics_input_Interface::Initialize(XNFrameworkPtr framework, uint32_t modelId,uint32_t DDS_type) { auto ddsManager = framework->GetDDSManager(); if (!ddsManager) { LOG_ERROR("DDSManager is nullptr"); return; } if (DDS_type == 0) { dataWriter = ddsManager->RegisterPublisher("XNSim::C909::ATA04::Aerodynamics_input", modelId); ddsManager->RegisterSubscriber("XNSim::C909::ATA04::Aerodynamics_input", modelId, std::bind(&Aerodynamics_input_Interface::inputDataListener, this, std::placeholders::_1)); } else if (DDS_type == 1) { ddsManager->RegisterSubscriber("XNSim::C909::ATA04::Aerodynamics_input", modelId, std::bind(&Aerodynamics_input_Interface::inputDataListener, this, std::placeholders::_1)); } else if (DDS_type == 2) { dataWriter = ddsManager->RegisterPublisher("XNSim::C909::ATA04::Aerodynamics_input", modelId); } } void Aerodynamics_input_Interface::clearOutData() { this->out_data = XNSim::C909::ATA04::Aerodynamics_input(); } void Aerodynamics_input_Interface::sendOutData() { if (dataWriter) { dataWriter->write(&this->out_data); } } void Aerodynamics_input_Interface::inputDataListener(const XNSim::C909::ATA04::Aerodynamics_input &input) { this->data = input; } }