XNSim/Release/IDL/C909_V1/ATA04/WeightBalance_input.cxx

66 lines
2.6 KiB
C++

#include "WeightBalance_input.hpp"
namespace XNSim::C909::ATA04
{
WeightBalance_input_Interface::WeightBalance_input_Interface()
{
MAP_DATA_FUNC(l_04_i_wbcomac_theta_deg_f8);
MAP_DATA_FUNC(l_04_i_wbcomac_gear_mode_l1);
MAP_DATA_FUNC(l_04_i_wbcomac_acset_gw_f8);
MAP_DATA_FUNC(l_04_i_wbcomac_acset_cg_f8);
MAP_DATA_FUNC(l_04_i_wbcomac_acset_tankfuel_f4);
MAP_DATA_FUNC(l_04_i_wbcomac_acset_totfuel_f8);
MAP_DATA_FUNC(l_04_i_wbcomac_acset_zfw_f8);
MAP_DATA_FUNC(l_04_i_wbcomac_acset_zfwcg_f8);
MAP_DATA_FUNC(l_04_i_wbcomac_eng_efsep_l1);
MAP_DATA_FUNC(l_04_i_wbcomac_fuel_f8);
MAP_DATA_FUNC(l_04_i_wbcomac_gear_avg_f8);
MAP_DATA_FUNC(l_04_i_wbcomac_kice_f8);
MAP_DATA_FUNC(l_04_i_wbcomac_bycglim_l1);
MAP_DATA_FUNC(l_04_i_wbcomac_bygwlim_l1);
MAP_DATA_FUNC(l_04_i_wbcomac_frz_l1);
MAP_DATA_FUNC(l_04_i_wbcomac_zcgfrz_l1);
MAP_DATA_FUNC(l_04_i_wbcomac_zcgfrz_grfx_l1);
MAP_DATA_FUNC(l_04_i_wbcomac_ycgfrz_l1);
MAP_DATA_FUNC(l_04_i_wbcomac_inertfrz_l1);
MAP_DATA_FUNC(l_04_i_wbcomac_potreq_gw_f8);
MAP_DATA_FUNC(l_04_i_wbcomac_potreq_gwcg_f8);
MAP_DATA_FUNC(l_04_i_wbcomac_phi_deg_f8);
MAP_DATA_FUNC(l_04_i_wbcomac_psi_deg_f8);
}
WeightBalance_input_Interface::~WeightBalance_input_Interface()
{
}
void WeightBalance_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::WeightBalance_inputPubSubType>("XNSim::C909::ATA04::WeightBalance_input", modelId);
ddsManager->RegisterSubscriber<XNSim::C909::ATA04::WeightBalance_inputPubSubType>("XNSim::C909::ATA04::WeightBalance_input", modelId, std::bind(&WeightBalance_input_Interface::inputDataListener, this, std::placeholders::_1));
}
else if (DDS_type == 1) {
ddsManager->RegisterSubscriber<XNSim::C909::ATA04::WeightBalance_inputPubSubType>("XNSim::C909::ATA04::WeightBalance_input", modelId, std::bind(&WeightBalance_input_Interface::inputDataListener, this, std::placeholders::_1));
}
else if (DDS_type == 2) {
dataWriter = ddsManager->RegisterPublisher<XNSim::C909::ATA04::WeightBalance_inputPubSubType>("XNSim::C909::ATA04::WeightBalance_input", modelId);
}
}
void WeightBalance_input_Interface::clearOutData()
{
this->out_data = XNSim::C909::ATA04::WeightBalance_input();
}
void WeightBalance_input_Interface::sendOutData()
{
if (dataWriter) {
dataWriter->write(&this->out_data);
}
}
void WeightBalance_input_Interface::inputDataListener(const XNSim::C909::ATA04::WeightBalance_input &input)
{
this->data = input;
}
}