2025-04-28 12:25:20 +08:00
|
|
|
#include "XNGroundHandlingInterface.hpp"
|
|
|
|
|
2025-05-22 08:53:29 +08:00
|
|
|
namespace XNSim::C909::ATA04
|
|
|
|
{
|
|
|
|
GroundHandling_input_Interface::GroundHandling_input_Interface()
|
|
|
|
{
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_frz_l1);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_chocks_l1);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_alt_agl_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_frzflt_l1);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_p_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_q_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_r_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_ug_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_vg_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_wg_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_blcg_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_bscg_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_wlcg_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_pb_active_l1);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_brake_torq_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_gear_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_gsteer_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_tire_pres_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_onjax_l1);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_contdep_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_thetag_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_phig_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_rwyrgh_i2);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_rwyhdg_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_reset_braketemp_l1);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_reset_tirepress_l1);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_temp_c_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_brake_temp_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_tire_tburst_l1);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_tire_tflat_l1);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_brk_reset_tpres_l1);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_rcon_ci_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_pb_towforce_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_gsteer_state_i4);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_trim_active_l1);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_phi_deg_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_theta_deg_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_psi_deg_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_i_gdcomac_resetint_l1);
|
|
|
|
}
|
2025-04-28 12:25:20 +08:00
|
|
|
|
2025-05-22 08:53:29 +08:00
|
|
|
GroundHandling_input_Interface::~GroundHandling_input_Interface()
|
|
|
|
{
|
|
|
|
}
|
2025-04-28 12:25:20 +08:00
|
|
|
|
2025-05-22 08:53:29 +08:00
|
|
|
void GroundHandling_input_Interface::Initialize(XNFrameworkPtr framework, uint32_t modelId)
|
|
|
|
{
|
|
|
|
auto ddsManager = framework->GetDDSManager();
|
|
|
|
if (!ddsManager) {
|
|
|
|
LOG_ERROR("DDSManager is nullptr");
|
|
|
|
return;
|
2025-04-28 12:25:20 +08:00
|
|
|
}
|
2025-05-22 08:53:29 +08:00
|
|
|
dataWriter = ddsManager->RegisterPublisher<XNSim::C909::ATA04::GroundHandling_inputPubSubType>(
|
|
|
|
"XNSim::C909::ATA04::GroundHandling_input", modelId);
|
|
|
|
ddsManager->RegisterSubscriber<XNSim::C909::ATA04::GroundHandling_inputPubSubType>(
|
|
|
|
"XNSim::C909::ATA04::GroundHandling_input", modelId,
|
|
|
|
std::bind(&GroundHandling_input_Interface::inputDataListener, this, std::placeholders::_1));
|
|
|
|
}
|
2025-04-28 12:25:20 +08:00
|
|
|
|
2025-05-22 08:53:29 +08:00
|
|
|
void GroundHandling_input_Interface::clearOutData()
|
|
|
|
{
|
|
|
|
this->out_data = XNSim::C909::ATA04::GroundHandling_input();
|
|
|
|
}
|
2025-04-28 12:25:20 +08:00
|
|
|
|
2025-05-22 08:53:29 +08:00
|
|
|
void GroundHandling_input_Interface::sendOutData()
|
|
|
|
{
|
|
|
|
dataWriter->write(&this->out_data);
|
|
|
|
}
|
2025-04-28 12:25:20 +08:00
|
|
|
|
2025-05-22 08:53:29 +08:00
|
|
|
void GroundHandling_input_Interface::inputDataListener(
|
|
|
|
const XNSim::C909::ATA04::GroundHandling_input &input)
|
|
|
|
{
|
|
|
|
this->data = input;
|
|
|
|
}
|
2025-04-28 12:25:20 +08:00
|
|
|
|
2025-05-22 08:53:29 +08:00
|
|
|
GroundHandling_output_Interface::GroundHandling_output_Interface()
|
|
|
|
{
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_frz_l1);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_ac_on_ground_l1);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_ac_stationary_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_alt_tire_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_zcg_to_tire_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_fxb_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_fyb_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_fzb_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_mxb_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_myb_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_mzb_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_fygs_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_mzgs_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_mu_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_dstroke_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_sr_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_sy_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_sx_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_xft_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_yft_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_zft_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_distngrxcg_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_distmgrxcg_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_distmgrzcg_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_tire_vel_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_tire_burst_l1);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_tire_temp_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_wow_l1);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_utirew_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_vtirew_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_whl_omega_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_dstruc_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_wor_par_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_nd_f8);
|
|
|
|
MAP_DATA_FUNC(l_04_o_gdcomac_vczt_f8);
|
|
|
|
}
|
|
|
|
|
|
|
|
GroundHandling_output_Interface::~GroundHandling_output_Interface()
|
|
|
|
{
|
|
|
|
}
|
2025-04-28 12:25:20 +08:00
|
|
|
|
2025-05-22 08:53:29 +08:00
|
|
|
void GroundHandling_output_Interface::Initialize(XNFrameworkPtr framework, uint32_t modelId)
|
|
|
|
{
|
|
|
|
auto ddsManager = framework->GetDDSManager();
|
|
|
|
if (!ddsManager) {
|
|
|
|
LOG_ERROR("DDSManager is nullptr");
|
|
|
|
return;
|
2025-04-28 12:25:20 +08:00
|
|
|
}
|
2025-05-22 08:53:29 +08:00
|
|
|
dataWriter = ddsManager->RegisterPublisher<XNSim::C909::ATA04::GroundHandling_outputPubSubType>(
|
|
|
|
"XNSim::C909::ATA04::GroundHandling_output", modelId);
|
|
|
|
ddsManager->RegisterSubscriber<XNSim::C909::ATA04::GroundHandling_outputPubSubType>(
|
|
|
|
"XNSim::C909::ATA04::GroundHandling_output", modelId,
|
|
|
|
std::bind(&GroundHandling_output_Interface::outputDataListener, this,
|
|
|
|
std::placeholders::_1));
|
|
|
|
}
|
2025-04-28 12:25:20 +08:00
|
|
|
|
2025-05-22 08:53:29 +08:00
|
|
|
void GroundHandling_output_Interface::clearOutData()
|
|
|
|
{
|
|
|
|
this->out_data = XNSim::C909::ATA04::GroundHandling_output();
|
|
|
|
}
|
|
|
|
|
|
|
|
void GroundHandling_output_Interface::sendOutData()
|
|
|
|
{
|
|
|
|
dataWriter->write(&this->out_data);
|
|
|
|
}
|
|
|
|
|
|
|
|
void GroundHandling_output_Interface::outputDataListener(
|
|
|
|
const XNSim::C909::ATA04::GroundHandling_output &output)
|
|
|
|
{
|
|
|
|
this->data = output;
|
|
|
|
}
|
|
|
|
|
|
|
|
GroundHandling_heartbeat_Interface::GroundHandling_heartbeat_Interface()
|
|
|
|
{
|
|
|
|
MAP_DATA_FUNC(groundhandling_model_heartbeat);
|
|
|
|
}
|
|
|
|
|
|
|
|
GroundHandling_heartbeat_Interface::~GroundHandling_heartbeat_Interface()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void GroundHandling_heartbeat_Interface::Initialize(XNFrameworkPtr framework, uint32_t modelId)
|
|
|
|
{
|
|
|
|
auto ddsManager = framework->GetDDSManager();
|
|
|
|
if (!ddsManager) {
|
|
|
|
LOG_ERROR("DDSManager is nullptr");
|
|
|
|
return;
|
2025-04-28 12:25:20 +08:00
|
|
|
}
|
2025-05-22 08:53:29 +08:00
|
|
|
dataWriter =
|
|
|
|
ddsManager->RegisterPublisher<XNSim::C909::ATA04::GroundHandling_heartbeatPubSubType>(
|
|
|
|
"XNSim::C909::ATA04::GroundHandling_heartbeat", modelId);
|
|
|
|
ddsManager->RegisterSubscriber<XNSim::C909::ATA04::GroundHandling_heartbeatPubSubType>(
|
|
|
|
"XNSim::C909::ATA04::GroundHandling_heartbeat", modelId,
|
|
|
|
std::bind(&GroundHandling_heartbeat_Interface::heartbeatListener, this,
|
|
|
|
std::placeholders::_1));
|
|
|
|
}
|
|
|
|
|
|
|
|
void GroundHandling_heartbeat_Interface::clearOutData()
|
|
|
|
{
|
|
|
|
this->out_data = XNSim::C909::ATA04::GroundHandling_heartbeat();
|
|
|
|
}
|
|
|
|
|
|
|
|
void GroundHandling_heartbeat_Interface::sendOutData()
|
|
|
|
{
|
|
|
|
dataWriter->write(&this->out_data);
|
|
|
|
}
|
|
|
|
|
|
|
|
void GroundHandling_heartbeat_Interface::heartbeatListener(
|
|
|
|
const XNSim::C909::ATA04::GroundHandling_heartbeat &heartbeat)
|
|
|
|
{
|
|
|
|
this->data = heartbeat;
|
|
|
|
}
|
|
|
|
} // namespace XNSim::C909::ATA04
|