77 lines
3.0 KiB
C++
77 lines
3.0 KiB
C++
#include "GroundHandling_output.hpp"
|
|
namespace XNSim::C909::ATA04
|
|
{
|
|
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);
|
|
}
|
|
GroundHandling_output_Interface::~GroundHandling_output_Interface()
|
|
{
|
|
}
|
|
void GroundHandling_output_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::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::inputDataListener, this, std::placeholders::_1));
|
|
}
|
|
else if (DDS_type == 1) {
|
|
ddsManager->RegisterSubscriber<XNSim::C909::ATA04::GroundHandling_outputPubSubType>("XNSim::C909::ATA04::GroundHandling_output", modelId, std::bind(&GroundHandling_output_Interface::inputDataListener, this, std::placeholders::_1));
|
|
}
|
|
else if (DDS_type == 2) {
|
|
dataWriter = ddsManager->RegisterPublisher<XNSim::C909::ATA04::GroundHandling_outputPubSubType>("XNSim::C909::ATA04::GroundHandling_output", modelId);
|
|
}
|
|
}
|
|
void GroundHandling_output_Interface::clearOutData()
|
|
{
|
|
this->out_data = XNSim::C909::ATA04::GroundHandling_output();
|
|
}
|
|
void GroundHandling_output_Interface::sendOutData()
|
|
{
|
|
if (dataWriter) {
|
|
dataWriter->write(&this->out_data);
|
|
}
|
|
}
|
|
void GroundHandling_output_Interface::inputDataListener(const XNSim::C909::ATA04::GroundHandling_output &input)
|
|
{
|
|
this->data = input;
|
|
}
|
|
}
|