完成模型、服务的重构,目前运行正常,考虑合并分支
This commit is contained in:
parent
14d7a4b500
commit
88d2ffb032
43
Release/IDL/C909_V1/ATA04/Aerodynamics_heartbeat.cxx
Normal file
43
Release/IDL/C909_V1/ATA04/Aerodynamics_heartbeat.cxx
Normal file
@ -0,0 +1,43 @@
|
||||
#include "Aerodynamics_heartbeat.hpp"
|
||||
namespace XNSim::C909::ATA04
|
||||
{
|
||||
Aerodynamics_heartbeat_Interface::Aerodynamics_heartbeat_Interface()
|
||||
{
|
||||
MAP_DATA_FUNC(aero_model_heartbeat);
|
||||
}
|
||||
Aerodynamics_heartbeat_Interface::~Aerodynamics_heartbeat_Interface()
|
||||
{
|
||||
}
|
||||
void Aerodynamics_heartbeat_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_heartbeatPubSubType>("XNSim::C909::ATA04::Aerodynamics_heartbeat", modelId);
|
||||
ddsManager->RegisterSubscriber<XNSim::C909::ATA04::Aerodynamics_heartbeatPubSubType>("XNSim::C909::ATA04::Aerodynamics_heartbeat", modelId, std::bind(&Aerodynamics_heartbeat_Interface::inputDataListener, this, std::placeholders::_1));
|
||||
}
|
||||
else if (DDS_type == 1) {
|
||||
ddsManager->RegisterSubscriber<XNSim::C909::ATA04::Aerodynamics_heartbeatPubSubType>("XNSim::C909::ATA04::Aerodynamics_heartbeat", modelId, std::bind(&Aerodynamics_heartbeat_Interface::inputDataListener, this, std::placeholders::_1));
|
||||
}
|
||||
else if (DDS_type == 2) {
|
||||
dataWriter = ddsManager->RegisterPublisher<XNSim::C909::ATA04::Aerodynamics_heartbeatPubSubType>("XNSim::C909::ATA04::Aerodynamics_heartbeat", modelId);
|
||||
}
|
||||
}
|
||||
void Aerodynamics_heartbeat_Interface::clearOutData()
|
||||
{
|
||||
this->out_data = XNSim::C909::ATA04::Aerodynamics_heartbeat();
|
||||
}
|
||||
void Aerodynamics_heartbeat_Interface::sendOutData()
|
||||
{
|
||||
if (dataWriter) {
|
||||
dataWriter->write(&this->out_data);
|
||||
}
|
||||
}
|
||||
void Aerodynamics_heartbeat_Interface::inputDataListener(const XNSim::C909::ATA04::Aerodynamics_heartbeat &input)
|
||||
{
|
||||
this->data = input;
|
||||
}
|
||||
}
|
36
Release/IDL/C909_V1/ATA04/Aerodynamics_heartbeat.hpp
Normal file
36
Release/IDL/C909_V1/ATA04/Aerodynamics_heartbeat.hpp
Normal file
@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
#include "../C909_V1PubSubTypes.hpp"
|
||||
#include "XNCore/XNDDSInterface.h"
|
||||
namespace XNSim::C909::ATA04
|
||||
{
|
||||
class Aerodynamics_heartbeat_Interface final : public XNDDSInterface
|
||||
{
|
||||
public:
|
||||
Aerodynamics_heartbeat_Interface();
|
||||
virtual ~Aerodynamics_heartbeat_Interface();
|
||||
virtual void Initialize(XNFrameworkPtr framework, uint32_t modelId, uint32_t DDS_type) override;
|
||||
virtual void clearOutData() override;
|
||||
virtual void sendOutData() override;
|
||||
void inputDataListener(const XNSim::C909::ATA04::Aerodynamics_heartbeat &input);
|
||||
template <typename T>
|
||||
void getData(T *model_data)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(dataMutex);
|
||||
if(model_data == nullptr)
|
||||
return;
|
||||
assign_value_get(data.aero_model_heartbeat(), model_data->aero_model_heartbeat);
|
||||
}
|
||||
template <typename T>
|
||||
void setData(T *model_data)
|
||||
{
|
||||
if(model_data == nullptr)
|
||||
return;
|
||||
std::lock_guard<std::mutex> lock(outDataMutex);
|
||||
clearOutData();
|
||||
assign_value_set(data.aero_model_heartbeat(), model_data->aero_model_heartbeat);
|
||||
}
|
||||
private:
|
||||
XNSim::C909::ATA04::Aerodynamics_heartbeat data;
|
||||
XNSim::C909::ATA04::Aerodynamics_heartbeat out_data;
|
||||
};
|
||||
}
|
@ -30,14 +30,6 @@ Aerodynamics_input_Interface::Aerodynamics_input_Interface()
|
||||
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);
|
||||
this->header[0] = 0xa6; // XNSim头,0xa6
|
||||
this->header[1] = 0xc0; // 机型头,0xc0表示C909
|
||||
this->header[2] = 0x04; // 章节头,0x04表示ATA04
|
||||
this->header[3] = 0x01; // 模型头,0x01表示GroundHandling
|
||||
this->header[4] = 0x00; // 结构体头,0x00表示输入结构体
|
||||
this->header[5] = 0x00; // 数据方向,0x00表示外部输入
|
||||
this->header[6] = 0x00; // 数据大小
|
||||
this->header[7] = 0x00; // 数据大小
|
||||
}
|
||||
Aerodynamics_input_Interface::~Aerodynamics_input_Interface()
|
||||
{
|
||||
|
@ -15,6 +15,7 @@ public:
|
||||
template <typename T>
|
||||
void getData(T *model_data)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(dataMutex);
|
||||
if(model_data == nullptr)
|
||||
return;
|
||||
assign_value_get(data.l_04_i_aerocomac_alpha_f8(), model_data->l_04_i_aerocomac_alpha_f8);
|
||||
@ -50,34 +51,35 @@ public:
|
||||
{
|
||||
if(model_data == nullptr)
|
||||
return;
|
||||
std::lock_guard<std::mutex> lock(outDataMutex);
|
||||
clearOutData();
|
||||
assign_value_set(data.l_04_i_aerocomac_alpha_f8(), model_data->Aerodynamics_input);
|
||||
assign_value_set(data.l_04_i_aerocomac_alpdot_f8(), model_data->Aerodynamics_input);
|
||||
assign_value_set(data.l_04_i_aerocomac_beta_f8(), model_data->Aerodynamics_input);
|
||||
assign_value_set(data.l_04_i_aerocomac_press_alt_f8(), model_data->Aerodynamics_input);
|
||||
assign_value_set(data.l_04_i_aerocomac_tas_f8(), model_data->Aerodynamics_input);
|
||||
assign_value_set(data.l_04_i_aerocomac_mach_f8(), model_data->Aerodynamics_input);
|
||||
assign_value_set(data.l_04_i_aerocomac_nx_f8(), model_data->Aerodynamics_input);
|
||||
assign_value_set(data.l_04_i_aerocomac_ny_f8(), model_data->Aerodynamics_input);
|
||||
assign_value_set(data.l_04_i_aerocomac_nz_f8(), model_data->Aerodynamics_input);
|
||||
assign_value_set(data.l_04_i_aerocomac_p_f8(), model_data->Aerodynamics_input);
|
||||
assign_value_set(data.l_04_i_aerocomac_q_f8(), model_data->Aerodynamics_input);
|
||||
assign_value_set(data.l_04_i_aerocomac_r_f8(), model_data->Aerodynamics_input);
|
||||
assign_value_set(data.l_04_i_aerocomac_qbar_f8(), model_data->Aerodynamics_input);
|
||||
assign_value_set(data.l_04_i_aerocomac_blcg_f8(), model_data->Aerodynamics_input);
|
||||
assign_value_set(data.l_04_i_aerocomac_bscg_f8(), model_data->Aerodynamics_input);
|
||||
assign_value_set(data.l_04_i_aerocomac_wlcg_f8(), model_data->Aerodynamics_input);
|
||||
assign_value_set(data.l_04_i_aerocomac_ail_f8(), model_data->Aerodynamics_input);
|
||||
assign_value_set(data.l_04_i_aerocomac_elv_f8(), model_data->Aerodynamics_input);
|
||||
assign_value_set(data.l_04_i_aerocomac_rud_f8(), model_data->Aerodynamics_input);
|
||||
assign_value_set(data.l_04_i_aerocomac_stab_f8(), model_data->Aerodynamics_input);
|
||||
assign_value_set(data.l_04_i_aerocomac_gear_f8(), model_data->Aerodynamics_input);
|
||||
assign_value_set(data.l_04_i_aerocomac_flap_f8(), model_data->Aerodynamics_input);
|
||||
assign_value_set(data.l_04_i_aerocomac_slat_f8(), model_data->Aerodynamics_input);
|
||||
assign_value_set(data.l_04_i_aerocomac_spl_f8(), model_data->Aerodynamics_input);
|
||||
assign_value_set(data.l_04_i_aerocomac_tnet_f8(), model_data->Aerodynamics_input);
|
||||
assign_value_set(data.l_04_i_aerocomac_kice_f8(), model_data->Aerodynamics_input);
|
||||
assign_value_set(data.l_04_i_aerocomac_alt_agl_f8(), model_data->Aerodynamics_input);
|
||||
assign_value_set(data.l_04_i_aerocomac_alpha_f8(), model_data->l_04_i_aerocomac_alpha_f8);
|
||||
assign_value_set(data.l_04_i_aerocomac_alpdot_f8(), model_data->l_04_i_aerocomac_alpdot_f8);
|
||||
assign_value_set(data.l_04_i_aerocomac_beta_f8(), model_data->l_04_i_aerocomac_beta_f8);
|
||||
assign_value_set(data.l_04_i_aerocomac_press_alt_f8(), model_data->l_04_i_aerocomac_press_alt_f8);
|
||||
assign_value_set(data.l_04_i_aerocomac_tas_f8(), model_data->l_04_i_aerocomac_tas_f8);
|
||||
assign_value_set(data.l_04_i_aerocomac_mach_f8(), model_data->l_04_i_aerocomac_mach_f8);
|
||||
assign_value_set(data.l_04_i_aerocomac_nx_f8(), model_data->l_04_i_aerocomac_nx_f8);
|
||||
assign_value_set(data.l_04_i_aerocomac_ny_f8(), model_data->l_04_i_aerocomac_ny_f8);
|
||||
assign_value_set(data.l_04_i_aerocomac_nz_f8(), model_data->l_04_i_aerocomac_nz_f8);
|
||||
assign_value_set(data.l_04_i_aerocomac_p_f8(), model_data->l_04_i_aerocomac_p_f8);
|
||||
assign_value_set(data.l_04_i_aerocomac_q_f8(), model_data->l_04_i_aerocomac_q_f8);
|
||||
assign_value_set(data.l_04_i_aerocomac_r_f8(), model_data->l_04_i_aerocomac_r_f8);
|
||||
assign_value_set(data.l_04_i_aerocomac_qbar_f8(), model_data->l_04_i_aerocomac_qbar_f8);
|
||||
assign_value_set(data.l_04_i_aerocomac_blcg_f8(), model_data->l_04_i_aerocomac_blcg_f8);
|
||||
assign_value_set(data.l_04_i_aerocomac_bscg_f8(), model_data->l_04_i_aerocomac_bscg_f8);
|
||||
assign_value_set(data.l_04_i_aerocomac_wlcg_f8(), model_data->l_04_i_aerocomac_wlcg_f8);
|
||||
assign_value_set(data.l_04_i_aerocomac_ail_f8(), model_data->l_04_i_aerocomac_ail_f8);
|
||||
assign_value_set(data.l_04_i_aerocomac_elv_f8(), model_data->l_04_i_aerocomac_elv_f8);
|
||||
assign_value_set(data.l_04_i_aerocomac_rud_f8(), model_data->l_04_i_aerocomac_rud_f8);
|
||||
assign_value_set(data.l_04_i_aerocomac_stab_f8(), model_data->l_04_i_aerocomac_stab_f8);
|
||||
assign_value_set(data.l_04_i_aerocomac_gear_f8(), model_data->l_04_i_aerocomac_gear_f8);
|
||||
assign_value_set(data.l_04_i_aerocomac_flap_f8(), model_data->l_04_i_aerocomac_flap_f8);
|
||||
assign_value_set(data.l_04_i_aerocomac_slat_f8(), model_data->l_04_i_aerocomac_slat_f8);
|
||||
assign_value_set(data.l_04_i_aerocomac_spl_f8(), model_data->l_04_i_aerocomac_spl_f8);
|
||||
assign_value_set(data.l_04_i_aerocomac_tnet_f8(), model_data->l_04_i_aerocomac_tnet_f8);
|
||||
assign_value_set(data.l_04_i_aerocomac_kice_f8(), model_data->l_04_i_aerocomac_kice_f8);
|
||||
assign_value_set(data.l_04_i_aerocomac_alt_agl_f8(), model_data->l_04_i_aerocomac_alt_agl_f8);
|
||||
}
|
||||
private:
|
||||
XNSim::C909::ATA04::Aerodynamics_input data;
|
||||
|
@ -16,14 +16,6 @@ Aerodynamics_output_Interface::Aerodynamics_output_Interface()
|
||||
MAP_DATA_FUNC(l_04_o_aerocomac_cr_f8);
|
||||
MAP_DATA_FUNC(l_04_o_aerocomac_cy_f8);
|
||||
MAP_DATA_FUNC(l_04_o_aerocomac_cn_f8);
|
||||
this->header[0] = 0xa6; // XNSim头,0xa6
|
||||
this->header[1] = 0xc0; // 机型头,0xc0表示C909
|
||||
this->header[2] = 0x04; // 章节头,0x04表示ATA04
|
||||
this->header[3] = 0x01; // 模型头,0x01表示GroundHandling
|
||||
this->header[4] = 0x00; // 结构体头,0x00表示输入结构体
|
||||
this->header[5] = 0x00; // 数据方向,0x00表示外部输入
|
||||
this->header[6] = 0x00; // 数据大小
|
||||
this->header[7] = 0x00; // 数据大小
|
||||
}
|
||||
Aerodynamics_output_Interface::~Aerodynamics_output_Interface()
|
||||
{
|
||||
|
@ -15,6 +15,7 @@ public:
|
||||
template <typename T>
|
||||
void getData(T *model_data)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(dataMutex);
|
||||
if(model_data == nullptr)
|
||||
return;
|
||||
assign_value_get(data.l_04_o_aerocomac_fxb_f8(), model_data->l_04_o_aerocomac_fxb_f8);
|
||||
@ -36,20 +37,21 @@ public:
|
||||
{
|
||||
if(model_data == nullptr)
|
||||
return;
|
||||
std::lock_guard<std::mutex> lock(outDataMutex);
|
||||
clearOutData();
|
||||
assign_value_set(data.l_04_o_aerocomac_fxb_f8(), model_data->Aerodynamics_output);
|
||||
assign_value_set(data.l_04_o_aerocomac_fyb_f8(), model_data->Aerodynamics_output);
|
||||
assign_value_set(data.l_04_o_aerocomac_fzb_f8(), model_data->Aerodynamics_output);
|
||||
assign_value_set(data.l_04_o_aerocomac_mxb_f8(), model_data->Aerodynamics_output);
|
||||
assign_value_set(data.l_04_o_aerocomac_myb_f8(), model_data->Aerodynamics_output);
|
||||
assign_value_set(data.l_04_o_aerocomac_mzb_f8(), model_data->Aerodynamics_output);
|
||||
assign_value_set(data.l_04_o_aerocomac_cls_f8(), model_data->Aerodynamics_output);
|
||||
assign_value_set(data.l_04_o_aerocomac_cl_f8(), model_data->Aerodynamics_output);
|
||||
assign_value_set(data.l_04_o_aerocomac_cd_f8(), model_data->Aerodynamics_output);
|
||||
assign_value_set(data.l_04_o_aerocomac_cm_f8(), model_data->Aerodynamics_output);
|
||||
assign_value_set(data.l_04_o_aerocomac_cr_f8(), model_data->Aerodynamics_output);
|
||||
assign_value_set(data.l_04_o_aerocomac_cy_f8(), model_data->Aerodynamics_output);
|
||||
assign_value_set(data.l_04_o_aerocomac_cn_f8(), model_data->Aerodynamics_output);
|
||||
assign_value_set(data.l_04_o_aerocomac_fxb_f8(), model_data->l_04_o_aerocomac_fxb_f8);
|
||||
assign_value_set(data.l_04_o_aerocomac_fyb_f8(), model_data->l_04_o_aerocomac_fyb_f8);
|
||||
assign_value_set(data.l_04_o_aerocomac_fzb_f8(), model_data->l_04_o_aerocomac_fzb_f8);
|
||||
assign_value_set(data.l_04_o_aerocomac_mxb_f8(), model_data->l_04_o_aerocomac_mxb_f8);
|
||||
assign_value_set(data.l_04_o_aerocomac_myb_f8(), model_data->l_04_o_aerocomac_myb_f8);
|
||||
assign_value_set(data.l_04_o_aerocomac_mzb_f8(), model_data->l_04_o_aerocomac_mzb_f8);
|
||||
assign_value_set(data.l_04_o_aerocomac_cls_f8(), model_data->l_04_o_aerocomac_cls_f8);
|
||||
assign_value_set(data.l_04_o_aerocomac_cl_f8(), model_data->l_04_o_aerocomac_cl_f8);
|
||||
assign_value_set(data.l_04_o_aerocomac_cd_f8(), model_data->l_04_o_aerocomac_cd_f8);
|
||||
assign_value_set(data.l_04_o_aerocomac_cm_f8(), model_data->l_04_o_aerocomac_cm_f8);
|
||||
assign_value_set(data.l_04_o_aerocomac_cr_f8(), model_data->l_04_o_aerocomac_cr_f8);
|
||||
assign_value_set(data.l_04_o_aerocomac_cy_f8(), model_data->l_04_o_aerocomac_cy_f8);
|
||||
assign_value_set(data.l_04_o_aerocomac_cn_f8(), model_data->l_04_o_aerocomac_cn_f8);
|
||||
}
|
||||
private:
|
||||
XNSim::C909::ATA04::Aerodynamics_output data;
|
||||
|
43
Release/IDL/C909_V1/ATA04/GroundHandling_heartbeat.cxx
Normal file
43
Release/IDL/C909_V1/ATA04/GroundHandling_heartbeat.cxx
Normal file
@ -0,0 +1,43 @@
|
||||
#include "GroundHandling_heartbeat.hpp"
|
||||
namespace XNSim::C909::ATA04
|
||||
{
|
||||
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,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_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::inputDataListener, this, std::placeholders::_1));
|
||||
}
|
||||
else if (DDS_type == 1) {
|
||||
ddsManager->RegisterSubscriber<XNSim::C909::ATA04::GroundHandling_heartbeatPubSubType>("XNSim::C909::ATA04::GroundHandling_heartbeat", modelId, std::bind(&GroundHandling_heartbeat_Interface::inputDataListener, this, std::placeholders::_1));
|
||||
}
|
||||
else if (DDS_type == 2) {
|
||||
dataWriter = ddsManager->RegisterPublisher<XNSim::C909::ATA04::GroundHandling_heartbeatPubSubType>("XNSim::C909::ATA04::GroundHandling_heartbeat", modelId);
|
||||
}
|
||||
}
|
||||
void GroundHandling_heartbeat_Interface::clearOutData()
|
||||
{
|
||||
this->out_data = XNSim::C909::ATA04::GroundHandling_heartbeat();
|
||||
}
|
||||
void GroundHandling_heartbeat_Interface::sendOutData()
|
||||
{
|
||||
if (dataWriter) {
|
||||
dataWriter->write(&this->out_data);
|
||||
}
|
||||
}
|
||||
void GroundHandling_heartbeat_Interface::inputDataListener(const XNSim::C909::ATA04::GroundHandling_heartbeat &input)
|
||||
{
|
||||
this->data = input;
|
||||
}
|
||||
}
|
36
Release/IDL/C909_V1/ATA04/GroundHandling_heartbeat.hpp
Normal file
36
Release/IDL/C909_V1/ATA04/GroundHandling_heartbeat.hpp
Normal file
@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
#include "../C909_V1PubSubTypes.hpp"
|
||||
#include "XNCore/XNDDSInterface.h"
|
||||
namespace XNSim::C909::ATA04
|
||||
{
|
||||
class GroundHandling_heartbeat_Interface final : public XNDDSInterface
|
||||
{
|
||||
public:
|
||||
GroundHandling_heartbeat_Interface();
|
||||
virtual ~GroundHandling_heartbeat_Interface();
|
||||
virtual void Initialize(XNFrameworkPtr framework, uint32_t modelId, uint32_t DDS_type) override;
|
||||
virtual void clearOutData() override;
|
||||
virtual void sendOutData() override;
|
||||
void inputDataListener(const XNSim::C909::ATA04::GroundHandling_heartbeat &input);
|
||||
template <typename T>
|
||||
void getData(T *model_data)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(dataMutex);
|
||||
if(model_data == nullptr)
|
||||
return;
|
||||
assign_value_get(data.groundhandling_model_heartbeat(), model_data->groundhandling_model_heartbeat);
|
||||
}
|
||||
template <typename T>
|
||||
void setData(T *model_data)
|
||||
{
|
||||
if(model_data == nullptr)
|
||||
return;
|
||||
std::lock_guard<std::mutex> lock(outDataMutex);
|
||||
clearOutData();
|
||||
assign_value_set(data.groundhandling_model_heartbeat(), model_data->groundhandling_model_heartbeat);
|
||||
}
|
||||
private:
|
||||
XNSim::C909::ATA04::GroundHandling_heartbeat data;
|
||||
XNSim::C909::ATA04::GroundHandling_heartbeat out_data;
|
||||
};
|
||||
}
|
@ -42,14 +42,6 @@ GroundHandling_input_Interface::GroundHandling_input_Interface()
|
||||
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);
|
||||
this->header[0] = 0xa6; // XNSim头,0xa6
|
||||
this->header[1] = 0xc0; // 机型头,0xc0表示C909
|
||||
this->header[2] = 0x04; // 章节头,0x04表示ATA04
|
||||
this->header[3] = 0x01; // 模型头,0x01表示GroundHandling
|
||||
this->header[4] = 0x00; // 结构体头,0x00表示输入结构体
|
||||
this->header[5] = 0x00; // 数据方向,0x00表示外部输入
|
||||
this->header[6] = 0x00; // 数据大小
|
||||
this->header[7] = 0x00; // 数据大小
|
||||
}
|
||||
GroundHandling_input_Interface::~GroundHandling_input_Interface()
|
||||
{
|
||||
|
@ -15,6 +15,7 @@ public:
|
||||
template <typename T>
|
||||
void getData(T *model_data)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(dataMutex);
|
||||
if(model_data == nullptr)
|
||||
return;
|
||||
assign_value_get(data.l_04_i_gdcomac_frz_l1(), model_data->l_04_i_gdcomac_frz_l1);
|
||||
@ -62,46 +63,47 @@ public:
|
||||
{
|
||||
if(model_data == nullptr)
|
||||
return;
|
||||
std::lock_guard<std::mutex> lock(outDataMutex);
|
||||
clearOutData();
|
||||
assign_value_set(data.l_04_i_gdcomac_frz_l1(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_chocks_l1(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_alt_agl_f8(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_frzflt_l1(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_p_f8(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_q_f8(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_r_f8(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_ug_f8(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_vg_f8(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_wg_f8(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_blcg_f8(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_bscg_f8(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_wlcg_f8(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_pb_active_l1(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_brake_torq_f8(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_gear_f8(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_gsteer_f8(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_tire_pres_f8(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_onjax_l1(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_contdep_f8(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_thetag_f8(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_phig_f8(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_rwyrgh_i2(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_rwyhdg_f8(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_reset_braketemp_l1(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_reset_tirepress_l1(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_temp_c_f8(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_brake_temp_f8(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_tire_tburst_l1(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_tire_tflat_l1(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_brk_reset_tpres_l1(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_rcon_ci_f8(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_pb_towforce_f8(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_gsteer_state_i4(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_trim_active_l1(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_phi_deg_f8(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_theta_deg_f8(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_psi_deg_f8(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_resetint_l1(), model_data->GroundHandling_input);
|
||||
assign_value_set(data.l_04_i_gdcomac_frz_l1(), model_data->l_04_i_gdcomac_frz_l1);
|
||||
assign_value_set(data.l_04_i_gdcomac_chocks_l1(), model_data->l_04_i_gdcomac_chocks_l1);
|
||||
assign_value_set(data.l_04_i_gdcomac_alt_agl_f8(), model_data->l_04_i_gdcomac_alt_agl_f8);
|
||||
assign_value_set(data.l_04_i_gdcomac_frzflt_l1(), model_data->l_04_i_gdcomac_frzflt_l1);
|
||||
assign_value_set(data.l_04_i_gdcomac_p_f8(), model_data->l_04_i_gdcomac_p_f8);
|
||||
assign_value_set(data.l_04_i_gdcomac_q_f8(), model_data->l_04_i_gdcomac_q_f8);
|
||||
assign_value_set(data.l_04_i_gdcomac_r_f8(), model_data->l_04_i_gdcomac_r_f8);
|
||||
assign_value_set(data.l_04_i_gdcomac_ug_f8(), model_data->l_04_i_gdcomac_ug_f8);
|
||||
assign_value_set(data.l_04_i_gdcomac_vg_f8(), model_data->l_04_i_gdcomac_vg_f8);
|
||||
assign_value_set(data.l_04_i_gdcomac_wg_f8(), model_data->l_04_i_gdcomac_wg_f8);
|
||||
assign_value_set(data.l_04_i_gdcomac_blcg_f8(), model_data->l_04_i_gdcomac_blcg_f8);
|
||||
assign_value_set(data.l_04_i_gdcomac_bscg_f8(), model_data->l_04_i_gdcomac_bscg_f8);
|
||||
assign_value_set(data.l_04_i_gdcomac_wlcg_f8(), model_data->l_04_i_gdcomac_wlcg_f8);
|
||||
assign_value_set(data.l_04_i_gdcomac_pb_active_l1(), model_data->l_04_i_gdcomac_pb_active_l1);
|
||||
assign_value_set(data.l_04_i_gdcomac_brake_torq_f8(), model_data->l_04_i_gdcomac_brake_torq_f8);
|
||||
assign_value_set(data.l_04_i_gdcomac_gear_f8(), model_data->l_04_i_gdcomac_gear_f8);
|
||||
assign_value_set(data.l_04_i_gdcomac_gsteer_f8(), model_data->l_04_i_gdcomac_gsteer_f8);
|
||||
assign_value_set(data.l_04_i_gdcomac_tire_pres_f8(), model_data->l_04_i_gdcomac_tire_pres_f8);
|
||||
assign_value_set(data.l_04_i_gdcomac_onjax_l1(), model_data->l_04_i_gdcomac_onjax_l1);
|
||||
assign_value_set(data.l_04_i_gdcomac_contdep_f8(), model_data->l_04_i_gdcomac_contdep_f8);
|
||||
assign_value_set(data.l_04_i_gdcomac_thetag_f8(), model_data->l_04_i_gdcomac_thetag_f8);
|
||||
assign_value_set(data.l_04_i_gdcomac_phig_f8(), model_data->l_04_i_gdcomac_phig_f8);
|
||||
assign_value_set(data.l_04_i_gdcomac_rwyrgh_i2(), model_data->l_04_i_gdcomac_rwyrgh_i2);
|
||||
assign_value_set(data.l_04_i_gdcomac_rwyhdg_f8(), model_data->l_04_i_gdcomac_rwyhdg_f8);
|
||||
assign_value_set(data.l_04_i_gdcomac_reset_braketemp_l1(), model_data->l_04_i_gdcomac_reset_braketemp_l1);
|
||||
assign_value_set(data.l_04_i_gdcomac_reset_tirepress_l1(), model_data->l_04_i_gdcomac_reset_tirepress_l1);
|
||||
assign_value_set(data.l_04_i_gdcomac_temp_c_f8(), model_data->l_04_i_gdcomac_temp_c_f8);
|
||||
assign_value_set(data.l_04_i_gdcomac_brake_temp_f8(), model_data->l_04_i_gdcomac_brake_temp_f8);
|
||||
assign_value_set(data.l_04_i_gdcomac_tire_tburst_l1(), model_data->l_04_i_gdcomac_tire_tburst_l1);
|
||||
assign_value_set(data.l_04_i_gdcomac_tire_tflat_l1(), model_data->l_04_i_gdcomac_tire_tflat_l1);
|
||||
assign_value_set(data.l_04_i_gdcomac_brk_reset_tpres_l1(), model_data->l_04_i_gdcomac_brk_reset_tpres_l1);
|
||||
assign_value_set(data.l_04_i_gdcomac_rcon_ci_f8(), model_data->l_04_i_gdcomac_rcon_ci_f8);
|
||||
assign_value_set(data.l_04_i_gdcomac_pb_towforce_f8(), model_data->l_04_i_gdcomac_pb_towforce_f8);
|
||||
assign_value_set(data.l_04_i_gdcomac_gsteer_state_i4(), model_data->l_04_i_gdcomac_gsteer_state_i4);
|
||||
assign_value_set(data.l_04_i_gdcomac_trim_active_l1(), model_data->l_04_i_gdcomac_trim_active_l1);
|
||||
assign_value_set(data.l_04_i_gdcomac_phi_deg_f8(), model_data->l_04_i_gdcomac_phi_deg_f8);
|
||||
assign_value_set(data.l_04_i_gdcomac_theta_deg_f8(), model_data->l_04_i_gdcomac_theta_deg_f8);
|
||||
assign_value_set(data.l_04_i_gdcomac_psi_deg_f8(), model_data->l_04_i_gdcomac_psi_deg_f8);
|
||||
assign_value_set(data.l_04_i_gdcomac_resetint_l1(), model_data->l_04_i_gdcomac_resetint_l1);
|
||||
}
|
||||
private:
|
||||
XNSim::C909::ATA04::GroundHandling_input data;
|
||||
|
@ -37,14 +37,6 @@ GroundHandling_output_Interface::GroundHandling_output_Interface()
|
||||
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);
|
||||
this->header[0] = 0xa6; // XNSim头,0xa6
|
||||
this->header[1] = 0xc0; // 机型头,0xc0表示C909
|
||||
this->header[2] = 0x04; // 章节头,0x04表示ATA04
|
||||
this->header[3] = 0x01; // 模型头,0x01表示GroundHandling
|
||||
this->header[4] = 0x00; // 结构体头,0x00表示输入结构体
|
||||
this->header[5] = 0x00; // 数据方向,0x00表示外部输入
|
||||
this->header[6] = 0x00; // 数据大小
|
||||
this->header[7] = 0x00; // 数据大小
|
||||
}
|
||||
GroundHandling_output_Interface::~GroundHandling_output_Interface()
|
||||
{
|
||||
|
@ -15,6 +15,7 @@ public:
|
||||
template <typename T>
|
||||
void getData(T *model_data)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(dataMutex);
|
||||
if(model_data == nullptr)
|
||||
return;
|
||||
assign_value_get(data.l_04_o_gdcomac_frz_l1(), model_data->l_04_o_gdcomac_frz_l1);
|
||||
@ -57,41 +58,42 @@ public:
|
||||
{
|
||||
if(model_data == nullptr)
|
||||
return;
|
||||
std::lock_guard<std::mutex> lock(outDataMutex);
|
||||
clearOutData();
|
||||
assign_value_set(data.l_04_o_gdcomac_frz_l1(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_ac_on_ground_l1(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_ac_stationary_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_alt_tire_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_zcg_to_tire_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_fxb_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_fyb_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_fzb_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_mxb_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_myb_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_mzb_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_fygs_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_mzgs_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_mu_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_dstroke_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_sr_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_sy_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_sx_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_xft_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_yft_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_zft_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_distngrxcg_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_distmgrxcg_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_distmgrzcg_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_tire_vel_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_tire_burst_l1(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_tire_temp_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_wow_l1(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_utirew_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_vtirew_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_whl_omega_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_dstruc_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_wor_par_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_nd_f8(), model_data->GroundHandling_output);
|
||||
assign_value_set(data.l_04_o_gdcomac_frz_l1(), model_data->l_04_o_gdcomac_frz_l1);
|
||||
assign_value_set(data.l_04_o_gdcomac_ac_on_ground_l1(), model_data->l_04_o_gdcomac_ac_on_ground_l1);
|
||||
assign_value_set(data.l_04_o_gdcomac_ac_stationary_f8(), model_data->l_04_o_gdcomac_ac_stationary_f8);
|
||||
assign_value_set(data.l_04_o_gdcomac_alt_tire_f8(), model_data->l_04_o_gdcomac_alt_tire_f8);
|
||||
assign_value_set(data.l_04_o_gdcomac_zcg_to_tire_f8(), model_data->l_04_o_gdcomac_zcg_to_tire_f8);
|
||||
assign_value_set(data.l_04_o_gdcomac_fxb_f8(), model_data->l_04_o_gdcomac_fxb_f8);
|
||||
assign_value_set(data.l_04_o_gdcomac_fyb_f8(), model_data->l_04_o_gdcomac_fyb_f8);
|
||||
assign_value_set(data.l_04_o_gdcomac_fzb_f8(), model_data->l_04_o_gdcomac_fzb_f8);
|
||||
assign_value_set(data.l_04_o_gdcomac_mxb_f8(), model_data->l_04_o_gdcomac_mxb_f8);
|
||||
assign_value_set(data.l_04_o_gdcomac_myb_f8(), model_data->l_04_o_gdcomac_myb_f8);
|
||||
assign_value_set(data.l_04_o_gdcomac_mzb_f8(), model_data->l_04_o_gdcomac_mzb_f8);
|
||||
assign_value_set(data.l_04_o_gdcomac_fygs_f8(), model_data->l_04_o_gdcomac_fygs_f8);
|
||||
assign_value_set(data.l_04_o_gdcomac_mzgs_f8(), model_data->l_04_o_gdcomac_mzgs_f8);
|
||||
assign_value_set(data.l_04_o_gdcomac_mu_f8(), model_data->l_04_o_gdcomac_mu_f8);
|
||||
assign_value_set(data.l_04_o_gdcomac_dstroke_f8(), model_data->l_04_o_gdcomac_dstroke_f8);
|
||||
assign_value_set(data.l_04_o_gdcomac_sr_f8(), model_data->l_04_o_gdcomac_sr_f8);
|
||||
assign_value_set(data.l_04_o_gdcomac_sy_f8(), model_data->l_04_o_gdcomac_sy_f8);
|
||||
assign_value_set(data.l_04_o_gdcomac_sx_f8(), model_data->l_04_o_gdcomac_sx_f8);
|
||||
assign_value_set(data.l_04_o_gdcomac_xft_f8(), model_data->l_04_o_gdcomac_xft_f8);
|
||||
assign_value_set(data.l_04_o_gdcomac_yft_f8(), model_data->l_04_o_gdcomac_yft_f8);
|
||||
assign_value_set(data.l_04_o_gdcomac_zft_f8(), model_data->l_04_o_gdcomac_zft_f8);
|
||||
assign_value_set(data.l_04_o_gdcomac_distngrxcg_f8(), model_data->l_04_o_gdcomac_distngrxcg_f8);
|
||||
assign_value_set(data.l_04_o_gdcomac_distmgrxcg_f8(), model_data->l_04_o_gdcomac_distmgrxcg_f8);
|
||||
assign_value_set(data.l_04_o_gdcomac_distmgrzcg_f8(), model_data->l_04_o_gdcomac_distmgrzcg_f8);
|
||||
assign_value_set(data.l_04_o_gdcomac_tire_vel_f8(), model_data->l_04_o_gdcomac_tire_vel_f8);
|
||||
assign_value_set(data.l_04_o_gdcomac_tire_burst_l1(), model_data->l_04_o_gdcomac_tire_burst_l1);
|
||||
assign_value_set(data.l_04_o_gdcomac_tire_temp_f8(), model_data->l_04_o_gdcomac_tire_temp_f8);
|
||||
assign_value_set(data.l_04_o_gdcomac_wow_l1(), model_data->l_04_o_gdcomac_wow_l1);
|
||||
assign_value_set(data.l_04_o_gdcomac_utirew_f8(), model_data->l_04_o_gdcomac_utirew_f8);
|
||||
assign_value_set(data.l_04_o_gdcomac_vtirew_f8(), model_data->l_04_o_gdcomac_vtirew_f8);
|
||||
assign_value_set(data.l_04_o_gdcomac_whl_omega_f8(), model_data->l_04_o_gdcomac_whl_omega_f8);
|
||||
assign_value_set(data.l_04_o_gdcomac_dstruc_f8(), model_data->l_04_o_gdcomac_dstruc_f8);
|
||||
assign_value_set(data.l_04_o_gdcomac_wor_par_f8(), model_data->l_04_o_gdcomac_wor_par_f8);
|
||||
assign_value_set(data.l_04_o_gdcomac_nd_f8(), model_data->l_04_o_gdcomac_nd_f8);
|
||||
}
|
||||
private:
|
||||
XNSim::C909::ATA04::GroundHandling_output data;
|
||||
|
43
Release/IDL/C909_V1/ATA04/WeightBalance_heartbeat.cxx
Normal file
43
Release/IDL/C909_V1/ATA04/WeightBalance_heartbeat.cxx
Normal file
@ -0,0 +1,43 @@
|
||||
#include "WeightBalance_heartbeat.hpp"
|
||||
namespace XNSim::C909::ATA04
|
||||
{
|
||||
WeightBalance_heartbeat_Interface::WeightBalance_heartbeat_Interface()
|
||||
{
|
||||
MAP_DATA_FUNC(weightbody_model_heartbeat);
|
||||
}
|
||||
WeightBalance_heartbeat_Interface::~WeightBalance_heartbeat_Interface()
|
||||
{
|
||||
}
|
||||
void WeightBalance_heartbeat_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_heartbeatPubSubType>("XNSim::C909::ATA04::WeightBalance_heartbeat", modelId);
|
||||
ddsManager->RegisterSubscriber<XNSim::C909::ATA04::WeightBalance_heartbeatPubSubType>("XNSim::C909::ATA04::WeightBalance_heartbeat", modelId, std::bind(&WeightBalance_heartbeat_Interface::inputDataListener, this, std::placeholders::_1));
|
||||
}
|
||||
else if (DDS_type == 1) {
|
||||
ddsManager->RegisterSubscriber<XNSim::C909::ATA04::WeightBalance_heartbeatPubSubType>("XNSim::C909::ATA04::WeightBalance_heartbeat", modelId, std::bind(&WeightBalance_heartbeat_Interface::inputDataListener, this, std::placeholders::_1));
|
||||
}
|
||||
else if (DDS_type == 2) {
|
||||
dataWriter = ddsManager->RegisterPublisher<XNSim::C909::ATA04::WeightBalance_heartbeatPubSubType>("XNSim::C909::ATA04::WeightBalance_heartbeat", modelId);
|
||||
}
|
||||
}
|
||||
void WeightBalance_heartbeat_Interface::clearOutData()
|
||||
{
|
||||
this->out_data = XNSim::C909::ATA04::WeightBalance_heartbeat();
|
||||
}
|
||||
void WeightBalance_heartbeat_Interface::sendOutData()
|
||||
{
|
||||
if (dataWriter) {
|
||||
dataWriter->write(&this->out_data);
|
||||
}
|
||||
}
|
||||
void WeightBalance_heartbeat_Interface::inputDataListener(const XNSim::C909::ATA04::WeightBalance_heartbeat &input)
|
||||
{
|
||||
this->data = input;
|
||||
}
|
||||
}
|
36
Release/IDL/C909_V1/ATA04/WeightBalance_heartbeat.hpp
Normal file
36
Release/IDL/C909_V1/ATA04/WeightBalance_heartbeat.hpp
Normal file
@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
#include "../C909_V1PubSubTypes.hpp"
|
||||
#include "XNCore/XNDDSInterface.h"
|
||||
namespace XNSim::C909::ATA04
|
||||
{
|
||||
class WeightBalance_heartbeat_Interface final : public XNDDSInterface
|
||||
{
|
||||
public:
|
||||
WeightBalance_heartbeat_Interface();
|
||||
virtual ~WeightBalance_heartbeat_Interface();
|
||||
virtual void Initialize(XNFrameworkPtr framework, uint32_t modelId, uint32_t DDS_type) override;
|
||||
virtual void clearOutData() override;
|
||||
virtual void sendOutData() override;
|
||||
void inputDataListener(const XNSim::C909::ATA04::WeightBalance_heartbeat &input);
|
||||
template <typename T>
|
||||
void getData(T *model_data)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(dataMutex);
|
||||
if(model_data == nullptr)
|
||||
return;
|
||||
assign_value_get(data.weightbody_model_heartbeat(), model_data->weightbody_model_heartbeat);
|
||||
}
|
||||
template <typename T>
|
||||
void setData(T *model_data)
|
||||
{
|
||||
if(model_data == nullptr)
|
||||
return;
|
||||
std::lock_guard<std::mutex> lock(outDataMutex);
|
||||
clearOutData();
|
||||
assign_value_set(data.weightbody_model_heartbeat(), model_data->weightbody_model_heartbeat);
|
||||
}
|
||||
private:
|
||||
XNSim::C909::ATA04::WeightBalance_heartbeat data;
|
||||
XNSim::C909::ATA04::WeightBalance_heartbeat out_data;
|
||||
};
|
||||
}
|
@ -26,14 +26,6 @@ WeightBalance_input_Interface::WeightBalance_input_Interface()
|
||||
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);
|
||||
this->header[0] = 0xa6; // XNSim头,0xa6
|
||||
this->header[1] = 0xc0; // 机型头,0xc0表示C909
|
||||
this->header[2] = 0x04; // 章节头,0x04表示ATA04
|
||||
this->header[3] = 0x01; // 模型头,0x01表示GroundHandling
|
||||
this->header[4] = 0x00; // 结构体头,0x00表示输入结构体
|
||||
this->header[5] = 0x00; // 数据方向,0x00表示外部输入
|
||||
this->header[6] = 0x00; // 数据大小
|
||||
this->header[7] = 0x00; // 数据大小
|
||||
}
|
||||
WeightBalance_input_Interface::~WeightBalance_input_Interface()
|
||||
{
|
||||
|
@ -15,6 +15,7 @@ public:
|
||||
template <typename T>
|
||||
void getData(T *model_data)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(dataMutex);
|
||||
if(model_data == nullptr)
|
||||
return;
|
||||
assign_value_get(data.l_04_i_wbcomac_theta_deg_f8(), model_data->l_04_i_wbcomac_theta_deg_f8);
|
||||
@ -46,30 +47,31 @@ public:
|
||||
{
|
||||
if(model_data == nullptr)
|
||||
return;
|
||||
std::lock_guard<std::mutex> lock(outDataMutex);
|
||||
clearOutData();
|
||||
assign_value_set(data.l_04_i_wbcomac_theta_deg_f8(), model_data->WeightBalance_input);
|
||||
assign_value_set(data.l_04_i_wbcomac_gear_mode_l1(), model_data->WeightBalance_input);
|
||||
assign_value_set(data.l_04_i_wbcomac_acset_gw_f8(), model_data->WeightBalance_input);
|
||||
assign_value_set(data.l_04_i_wbcomac_acset_cg_f8(), model_data->WeightBalance_input);
|
||||
assign_value_set(data.l_04_i_wbcomac_acset_tankfuel_f4(), model_data->WeightBalance_input);
|
||||
assign_value_set(data.l_04_i_wbcomac_acset_totfuel_f8(), model_data->WeightBalance_input);
|
||||
assign_value_set(data.l_04_i_wbcomac_acset_zfw_f8(), model_data->WeightBalance_input);
|
||||
assign_value_set(data.l_04_i_wbcomac_acset_zfwcg_f8(), model_data->WeightBalance_input);
|
||||
assign_value_set(data.l_04_i_wbcomac_eng_efsep_l1(), model_data->WeightBalance_input);
|
||||
assign_value_set(data.l_04_i_wbcomac_fuel_f8(), model_data->WeightBalance_input);
|
||||
assign_value_set(data.l_04_i_wbcomac_gear_avg_f8(), model_data->WeightBalance_input);
|
||||
assign_value_set(data.l_04_i_wbcomac_kice_f8(), model_data->WeightBalance_input);
|
||||
assign_value_set(data.l_04_i_wbcomac_bycglim_l1(), model_data->WeightBalance_input);
|
||||
assign_value_set(data.l_04_i_wbcomac_bygwlim_l1(), model_data->WeightBalance_input);
|
||||
assign_value_set(data.l_04_i_wbcomac_frz_l1(), model_data->WeightBalance_input);
|
||||
assign_value_set(data.l_04_i_wbcomac_zcgfrz_l1(), model_data->WeightBalance_input);
|
||||
assign_value_set(data.l_04_i_wbcomac_zcgfrz_grfx_l1(), model_data->WeightBalance_input);
|
||||
assign_value_set(data.l_04_i_wbcomac_ycgfrz_l1(), model_data->WeightBalance_input);
|
||||
assign_value_set(data.l_04_i_wbcomac_inertfrz_l1(), model_data->WeightBalance_input);
|
||||
assign_value_set(data.l_04_i_wbcomac_potreq_gw_f8(), model_data->WeightBalance_input);
|
||||
assign_value_set(data.l_04_i_wbcomac_potreq_gwcg_f8(), model_data->WeightBalance_input);
|
||||
assign_value_set(data.l_04_i_wbcomac_phi_deg_f8(), model_data->WeightBalance_input);
|
||||
assign_value_set(data.l_04_i_wbcomac_psi_deg_f8(), model_data->WeightBalance_input);
|
||||
assign_value_set(data.l_04_i_wbcomac_theta_deg_f8(), model_data->l_04_i_wbcomac_theta_deg_f8);
|
||||
assign_value_set(data.l_04_i_wbcomac_gear_mode_l1(), model_data->l_04_i_wbcomac_gear_mode_l1);
|
||||
assign_value_set(data.l_04_i_wbcomac_acset_gw_f8(), model_data->l_04_i_wbcomac_acset_gw_f8);
|
||||
assign_value_set(data.l_04_i_wbcomac_acset_cg_f8(), model_data->l_04_i_wbcomac_acset_cg_f8);
|
||||
assign_value_set(data.l_04_i_wbcomac_acset_tankfuel_f4(), model_data->l_04_i_wbcomac_acset_tankfuel_f4);
|
||||
assign_value_set(data.l_04_i_wbcomac_acset_totfuel_f8(), model_data->l_04_i_wbcomac_acset_totfuel_f8);
|
||||
assign_value_set(data.l_04_i_wbcomac_acset_zfw_f8(), model_data->l_04_i_wbcomac_acset_zfw_f8);
|
||||
assign_value_set(data.l_04_i_wbcomac_acset_zfwcg_f8(), model_data->l_04_i_wbcomac_acset_zfwcg_f8);
|
||||
assign_value_set(data.l_04_i_wbcomac_eng_efsep_l1(), model_data->l_04_i_wbcomac_eng_efsep_l1);
|
||||
assign_value_set(data.l_04_i_wbcomac_fuel_f8(), model_data->l_04_i_wbcomac_fuel_f8);
|
||||
assign_value_set(data.l_04_i_wbcomac_gear_avg_f8(), model_data->l_04_i_wbcomac_gear_avg_f8);
|
||||
assign_value_set(data.l_04_i_wbcomac_kice_f8(), model_data->l_04_i_wbcomac_kice_f8);
|
||||
assign_value_set(data.l_04_i_wbcomac_bycglim_l1(), model_data->l_04_i_wbcomac_bycglim_l1);
|
||||
assign_value_set(data.l_04_i_wbcomac_bygwlim_l1(), model_data->l_04_i_wbcomac_bygwlim_l1);
|
||||
assign_value_set(data.l_04_i_wbcomac_frz_l1(), model_data->l_04_i_wbcomac_frz_l1);
|
||||
assign_value_set(data.l_04_i_wbcomac_zcgfrz_l1(), model_data->l_04_i_wbcomac_zcgfrz_l1);
|
||||
assign_value_set(data.l_04_i_wbcomac_zcgfrz_grfx_l1(), model_data->l_04_i_wbcomac_zcgfrz_grfx_l1);
|
||||
assign_value_set(data.l_04_i_wbcomac_ycgfrz_l1(), model_data->l_04_i_wbcomac_ycgfrz_l1);
|
||||
assign_value_set(data.l_04_i_wbcomac_inertfrz_l1(), model_data->l_04_i_wbcomac_inertfrz_l1);
|
||||
assign_value_set(data.l_04_i_wbcomac_potreq_gw_f8(), model_data->l_04_i_wbcomac_potreq_gw_f8);
|
||||
assign_value_set(data.l_04_i_wbcomac_potreq_gwcg_f8(), model_data->l_04_i_wbcomac_potreq_gwcg_f8);
|
||||
assign_value_set(data.l_04_i_wbcomac_phi_deg_f8(), model_data->l_04_i_wbcomac_phi_deg_f8);
|
||||
assign_value_set(data.l_04_i_wbcomac_psi_deg_f8(), model_data->l_04_i_wbcomac_psi_deg_f8);
|
||||
}
|
||||
private:
|
||||
XNSim::C909::ATA04::WeightBalance_input data;
|
||||
|
@ -59,14 +59,6 @@ WeightBalance_output_Interface::WeightBalance_output_Interface()
|
||||
MAP_DATA_FUNC(l_04_o_wbcomac_max_gw_f4);
|
||||
MAP_DATA_FUNC(l_04_o_wbcomac_max_zfw_f4);
|
||||
MAP_DATA_FUNC(l_04_o_wbcomac_max_zfwcg_f4);
|
||||
this->header[0] = 0xa6; // XNSim头,0xa6
|
||||
this->header[1] = 0xc0; // 机型头,0xc0表示C909
|
||||
this->header[2] = 0x04; // 章节头,0x04表示ATA04
|
||||
this->header[3] = 0x01; // 模型头,0x01表示GroundHandling
|
||||
this->header[4] = 0x00; // 结构体头,0x00表示输入结构体
|
||||
this->header[5] = 0x00; // 数据方向,0x00表示外部输入
|
||||
this->header[6] = 0x00; // 数据大小
|
||||
this->header[7] = 0x00; // 数据大小
|
||||
}
|
||||
WeightBalance_output_Interface::~WeightBalance_output_Interface()
|
||||
{
|
||||
|
@ -15,6 +15,7 @@ public:
|
||||
template <typename T>
|
||||
void getData(T *model_data)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(dataMutex);
|
||||
if(model_data == nullptr)
|
||||
return;
|
||||
assign_value_get(data.l_04_o_wbcomac_frz_l1(), model_data->l_04_o_wbcomac_frz_l1);
|
||||
@ -79,63 +80,64 @@ public:
|
||||
{
|
||||
if(model_data == nullptr)
|
||||
return;
|
||||
std::lock_guard<std::mutex> lock(outDataMutex);
|
||||
clearOutData();
|
||||
assign_value_set(data.l_04_o_wbcomac_frz_l1(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_zcgfrz_l1(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_zcgfrz_grfx_l1(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_ycgfrz_l1(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_inertfrz_l1(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_gw_f4(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_cg_f4(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_blcg_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_bscg_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_wlcg_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_xcg_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_ixx_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_ixy_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_ixz_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_iyy_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_iyz_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_izz_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_zfw_f4(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_zfwcg_f4(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_zfw_blcg_f4(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_zfw_wlcg_f4(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_fuel_cmd_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_fuel_mode_i4(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_fuel_ixx_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_fuel_ixy_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_fuel_ixz_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_fuel_iyy_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_fuel_iyz_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_fuel_izz_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_l_wt_fuel_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_ice_airframe_total_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_ice_eng_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_ice_eng_total_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_ice_fuselage_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_ice_stab_left_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_ice_stab_right_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_ice_stab_total_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_ice_total_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_ice_total_frac_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_ice_vert_tail_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_ice_wing_left_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_ice_wing_right_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_ice_wing_total_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_init_l1(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_potmin_gw_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_potmax_gw_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_potmin_gwcg_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_potmax_gwcg_f8(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_min_cg_f4(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_min_gw_f4(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_min_zfw_f4(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_min_zfwcg_f4(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_max_cg_f4(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_max_gw_f4(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_max_zfw_f4(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_max_zfwcg_f4(), model_data->WeightBalance_output);
|
||||
assign_value_set(data.l_04_o_wbcomac_frz_l1(), model_data->l_04_o_wbcomac_frz_l1);
|
||||
assign_value_set(data.l_04_o_wbcomac_zcgfrz_l1(), model_data->l_04_o_wbcomac_zcgfrz_l1);
|
||||
assign_value_set(data.l_04_o_wbcomac_zcgfrz_grfx_l1(), model_data->l_04_o_wbcomac_zcgfrz_grfx_l1);
|
||||
assign_value_set(data.l_04_o_wbcomac_ycgfrz_l1(), model_data->l_04_o_wbcomac_ycgfrz_l1);
|
||||
assign_value_set(data.l_04_o_wbcomac_inertfrz_l1(), model_data->l_04_o_wbcomac_inertfrz_l1);
|
||||
assign_value_set(data.l_04_o_wbcomac_gw_f4(), model_data->l_04_o_wbcomac_gw_f4);
|
||||
assign_value_set(data.l_04_o_wbcomac_cg_f4(), model_data->l_04_o_wbcomac_cg_f4);
|
||||
assign_value_set(data.l_04_o_wbcomac_blcg_f8(), model_data->l_04_o_wbcomac_blcg_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_bscg_f8(), model_data->l_04_o_wbcomac_bscg_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_wlcg_f8(), model_data->l_04_o_wbcomac_wlcg_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_xcg_f8(), model_data->l_04_o_wbcomac_xcg_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_ixx_f8(), model_data->l_04_o_wbcomac_ixx_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_ixy_f8(), model_data->l_04_o_wbcomac_ixy_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_ixz_f8(), model_data->l_04_o_wbcomac_ixz_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_iyy_f8(), model_data->l_04_o_wbcomac_iyy_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_iyz_f8(), model_data->l_04_o_wbcomac_iyz_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_izz_f8(), model_data->l_04_o_wbcomac_izz_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_zfw_f4(), model_data->l_04_o_wbcomac_zfw_f4);
|
||||
assign_value_set(data.l_04_o_wbcomac_zfwcg_f4(), model_data->l_04_o_wbcomac_zfwcg_f4);
|
||||
assign_value_set(data.l_04_o_wbcomac_zfw_blcg_f4(), model_data->l_04_o_wbcomac_zfw_blcg_f4);
|
||||
assign_value_set(data.l_04_o_wbcomac_zfw_wlcg_f4(), model_data->l_04_o_wbcomac_zfw_wlcg_f4);
|
||||
assign_value_set(data.l_04_o_wbcomac_fuel_cmd_f8(), model_data->l_04_o_wbcomac_fuel_cmd_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_fuel_mode_i4(), model_data->l_04_o_wbcomac_fuel_mode_i4);
|
||||
assign_value_set(data.l_04_o_wbcomac_fuel_ixx_f8(), model_data->l_04_o_wbcomac_fuel_ixx_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_fuel_ixy_f8(), model_data->l_04_o_wbcomac_fuel_ixy_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_fuel_ixz_f8(), model_data->l_04_o_wbcomac_fuel_ixz_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_fuel_iyy_f8(), model_data->l_04_o_wbcomac_fuel_iyy_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_fuel_iyz_f8(), model_data->l_04_o_wbcomac_fuel_iyz_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_fuel_izz_f8(), model_data->l_04_o_wbcomac_fuel_izz_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_l_wt_fuel_f8(), model_data->l_04_o_wbcomac_l_wt_fuel_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_ice_airframe_total_f8(), model_data->l_04_o_wbcomac_ice_airframe_total_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_ice_eng_f8(), model_data->l_04_o_wbcomac_ice_eng_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_ice_eng_total_f8(), model_data->l_04_o_wbcomac_ice_eng_total_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_ice_fuselage_f8(), model_data->l_04_o_wbcomac_ice_fuselage_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_ice_stab_left_f8(), model_data->l_04_o_wbcomac_ice_stab_left_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_ice_stab_right_f8(), model_data->l_04_o_wbcomac_ice_stab_right_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_ice_stab_total_f8(), model_data->l_04_o_wbcomac_ice_stab_total_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_ice_total_f8(), model_data->l_04_o_wbcomac_ice_total_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_ice_total_frac_f8(), model_data->l_04_o_wbcomac_ice_total_frac_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_ice_vert_tail_f8(), model_data->l_04_o_wbcomac_ice_vert_tail_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_ice_wing_left_f8(), model_data->l_04_o_wbcomac_ice_wing_left_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_ice_wing_right_f8(), model_data->l_04_o_wbcomac_ice_wing_right_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_ice_wing_total_f8(), model_data->l_04_o_wbcomac_ice_wing_total_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_init_l1(), model_data->l_04_o_wbcomac_init_l1);
|
||||
assign_value_set(data.l_04_o_wbcomac_potmin_gw_f8(), model_data->l_04_o_wbcomac_potmin_gw_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_potmax_gw_f8(), model_data->l_04_o_wbcomac_potmax_gw_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_potmin_gwcg_f8(), model_data->l_04_o_wbcomac_potmin_gwcg_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_potmax_gwcg_f8(), model_data->l_04_o_wbcomac_potmax_gwcg_f8);
|
||||
assign_value_set(data.l_04_o_wbcomac_min_cg_f4(), model_data->l_04_o_wbcomac_min_cg_f4);
|
||||
assign_value_set(data.l_04_o_wbcomac_min_gw_f4(), model_data->l_04_o_wbcomac_min_gw_f4);
|
||||
assign_value_set(data.l_04_o_wbcomac_min_zfw_f4(), model_data->l_04_o_wbcomac_min_zfw_f4);
|
||||
assign_value_set(data.l_04_o_wbcomac_min_zfwcg_f4(), model_data->l_04_o_wbcomac_min_zfwcg_f4);
|
||||
assign_value_set(data.l_04_o_wbcomac_max_cg_f4(), model_data->l_04_o_wbcomac_max_cg_f4);
|
||||
assign_value_set(data.l_04_o_wbcomac_max_gw_f4(), model_data->l_04_o_wbcomac_max_gw_f4);
|
||||
assign_value_set(data.l_04_o_wbcomac_max_zfw_f4(), model_data->l_04_o_wbcomac_max_zfw_f4);
|
||||
assign_value_set(data.l_04_o_wbcomac_max_zfwcg_f4(), model_data->l_04_o_wbcomac_max_zfwcg_f4);
|
||||
}
|
||||
private:
|
||||
XNSim::C909::ATA04::WeightBalance_output data;
|
||||
|
@ -1544,7 +1544,7 @@ public:
|
||||
m_l_04_i_gdcomac_pb_active_l1 = x.m_l_04_i_gdcomac_pb_active_l1;
|
||||
m_l_04_i_gdcomac_brake_torq_f8 = std::move(x.m_l_04_i_gdcomac_brake_torq_f8);
|
||||
m_l_04_i_gdcomac_gear_f8 = std::move(x.m_l_04_i_gdcomac_gear_f8);
|
||||
m_l_04_i_gdcomac_gsteer_f8 = x.m_l_04_i_gdcomac_gsteer_f8;
|
||||
m_l_04_i_gdcomac_gsteer_f8 = std::move(x.m_l_04_i_gdcomac_gsteer_f8);
|
||||
m_l_04_i_gdcomac_tire_pres_f8 = std::move(x.m_l_04_i_gdcomac_tire_pres_f8);
|
||||
m_l_04_i_gdcomac_onjax_l1 = x.m_l_04_i_gdcomac_onjax_l1;
|
||||
m_l_04_i_gdcomac_contdep_f8 = std::move(x.m_l_04_i_gdcomac_contdep_f8);
|
||||
@ -1682,7 +1682,7 @@ public:
|
||||
m_l_04_i_gdcomac_pb_active_l1 = x.m_l_04_i_gdcomac_pb_active_l1;
|
||||
m_l_04_i_gdcomac_brake_torq_f8 = std::move(x.m_l_04_i_gdcomac_brake_torq_f8);
|
||||
m_l_04_i_gdcomac_gear_f8 = std::move(x.m_l_04_i_gdcomac_gear_f8);
|
||||
m_l_04_i_gdcomac_gsteer_f8 = x.m_l_04_i_gdcomac_gsteer_f8;
|
||||
m_l_04_i_gdcomac_gsteer_f8 = std::move(x.m_l_04_i_gdcomac_gsteer_f8);
|
||||
m_l_04_i_gdcomac_tire_pres_f8 = std::move(x.m_l_04_i_gdcomac_tire_pres_f8);
|
||||
m_l_04_i_gdcomac_onjax_l1 = x.m_l_04_i_gdcomac_onjax_l1;
|
||||
m_l_04_i_gdcomac_contdep_f8 = std::move(x.m_l_04_i_gdcomac_contdep_f8);
|
||||
@ -2395,7 +2395,7 @@ public:
|
||||
* @param _l_04_i_gdcomac_gsteer_f8 New value to be copied in member l_04_i_gdcomac_gsteer_f8
|
||||
*/
|
||||
eProsima_user_DllExport void l_04_i_gdcomac_gsteer_f8(
|
||||
const eprosima::fastcdr::optional<double>& _l_04_i_gdcomac_gsteer_f8)
|
||||
const eprosima::fastcdr::optional<std::array<double, 3>>& _l_04_i_gdcomac_gsteer_f8)
|
||||
{
|
||||
m_l_04_i_gdcomac_gsteer_f8 = _l_04_i_gdcomac_gsteer_f8;
|
||||
}
|
||||
@ -2405,7 +2405,7 @@ public:
|
||||
* @param _l_04_i_gdcomac_gsteer_f8 New value to be moved in member l_04_i_gdcomac_gsteer_f8
|
||||
*/
|
||||
eProsima_user_DllExport void l_04_i_gdcomac_gsteer_f8(
|
||||
eprosima::fastcdr::optional<double>&& _l_04_i_gdcomac_gsteer_f8)
|
||||
eprosima::fastcdr::optional<std::array<double, 3>>&& _l_04_i_gdcomac_gsteer_f8)
|
||||
{
|
||||
m_l_04_i_gdcomac_gsteer_f8 = std::move(_l_04_i_gdcomac_gsteer_f8);
|
||||
}
|
||||
@ -2414,7 +2414,7 @@ public:
|
||||
* @brief This function returns a constant reference to member l_04_i_gdcomac_gsteer_f8
|
||||
* @return Constant reference to member l_04_i_gdcomac_gsteer_f8
|
||||
*/
|
||||
eProsima_user_DllExport const eprosima::fastcdr::optional<double>& l_04_i_gdcomac_gsteer_f8() const
|
||||
eProsima_user_DllExport const eprosima::fastcdr::optional<std::array<double, 3>>& l_04_i_gdcomac_gsteer_f8() const
|
||||
{
|
||||
return m_l_04_i_gdcomac_gsteer_f8;
|
||||
}
|
||||
@ -2423,7 +2423,7 @@ public:
|
||||
* @brief This function returns a reference to member l_04_i_gdcomac_gsteer_f8
|
||||
* @return Reference to member l_04_i_gdcomac_gsteer_f8
|
||||
*/
|
||||
eProsima_user_DllExport eprosima::fastcdr::optional<double>& l_04_i_gdcomac_gsteer_f8()
|
||||
eProsima_user_DllExport eprosima::fastcdr::optional<std::array<double, 3>>& l_04_i_gdcomac_gsteer_f8()
|
||||
{
|
||||
return m_l_04_i_gdcomac_gsteer_f8;
|
||||
}
|
||||
@ -3306,7 +3306,7 @@ private:
|
||||
eprosima::fastcdr::optional<char> m_l_04_i_gdcomac_pb_active_l1;
|
||||
eprosima::fastcdr::optional<std::array<std::array<double, 2>, 3>> m_l_04_i_gdcomac_brake_torq_f8;
|
||||
eprosima::fastcdr::optional<std::array<double, 3>> m_l_04_i_gdcomac_gear_f8;
|
||||
eprosima::fastcdr::optional<double> m_l_04_i_gdcomac_gsteer_f8;
|
||||
eprosima::fastcdr::optional<std::array<double, 3>> m_l_04_i_gdcomac_gsteer_f8;
|
||||
eprosima::fastcdr::optional<std::array<std::array<double, 2>, 3>> m_l_04_i_gdcomac_tire_pres_f8;
|
||||
eprosima::fastcdr::optional<char> m_l_04_i_gdcomac_onjax_l1;
|
||||
eprosima::fastcdr::optional<std::array<double, 7>> m_l_04_i_gdcomac_contdep_f8;
|
||||
@ -9596,6 +9596,405 @@ private:
|
||||
eprosima::fastcdr::optional<float> m_l_04_o_wbcomac_max_zfw_f4;
|
||||
eprosima::fastcdr::optional<float> m_l_04_o_wbcomac_max_zfwcg_f4;
|
||||
|
||||
};
|
||||
/*!
|
||||
* @brief This class represents the structure GroundHandling_heartbeat defined by the user in the IDL file.
|
||||
* @ingroup C909_V1
|
||||
*/
|
||||
class GroundHandling_heartbeat
|
||||
{
|
||||
public:
|
||||
|
||||
/*!
|
||||
* @brief Default constructor.
|
||||
*/
|
||||
eProsima_user_DllExport GroundHandling_heartbeat()
|
||||
{
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Default destructor.
|
||||
*/
|
||||
eProsima_user_DllExport ~GroundHandling_heartbeat()
|
||||
{
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Copy constructor.
|
||||
* @param x Reference to the object GroundHandling_heartbeat that will be copied.
|
||||
*/
|
||||
eProsima_user_DllExport GroundHandling_heartbeat(
|
||||
const GroundHandling_heartbeat& x)
|
||||
{
|
||||
m_groundhandling_model_heartbeat = x.m_groundhandling_model_heartbeat;
|
||||
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Move constructor.
|
||||
* @param x Reference to the object GroundHandling_heartbeat that will be copied.
|
||||
*/
|
||||
eProsima_user_DllExport GroundHandling_heartbeat(
|
||||
GroundHandling_heartbeat&& x) noexcept
|
||||
{
|
||||
m_groundhandling_model_heartbeat = x.m_groundhandling_model_heartbeat;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Copy assignment.
|
||||
* @param x Reference to the object GroundHandling_heartbeat that will be copied.
|
||||
*/
|
||||
eProsima_user_DllExport GroundHandling_heartbeat& operator =(
|
||||
const GroundHandling_heartbeat& x)
|
||||
{
|
||||
|
||||
m_groundhandling_model_heartbeat = x.m_groundhandling_model_heartbeat;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Move assignment.
|
||||
* @param x Reference to the object GroundHandling_heartbeat that will be copied.
|
||||
*/
|
||||
eProsima_user_DllExport GroundHandling_heartbeat& operator =(
|
||||
GroundHandling_heartbeat&& x) noexcept
|
||||
{
|
||||
|
||||
m_groundhandling_model_heartbeat = x.m_groundhandling_model_heartbeat;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Comparison operator.
|
||||
* @param x GroundHandling_heartbeat object to compare.
|
||||
*/
|
||||
eProsima_user_DllExport bool operator ==(
|
||||
const GroundHandling_heartbeat& x) const
|
||||
{
|
||||
return (m_groundhandling_model_heartbeat == x.m_groundhandling_model_heartbeat);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Comparison operator.
|
||||
* @param x GroundHandling_heartbeat object to compare.
|
||||
*/
|
||||
eProsima_user_DllExport bool operator !=(
|
||||
const GroundHandling_heartbeat& x) const
|
||||
{
|
||||
return !(*this == x);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief This function copies the value in member groundhandling_model_heartbeat
|
||||
* @param _groundhandling_model_heartbeat New value to be copied in member groundhandling_model_heartbeat
|
||||
*/
|
||||
eProsima_user_DllExport void groundhandling_model_heartbeat(
|
||||
const eprosima::fastcdr::optional<int32_t>& _groundhandling_model_heartbeat)
|
||||
{
|
||||
m_groundhandling_model_heartbeat = _groundhandling_model_heartbeat;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief This function moves the value in member groundhandling_model_heartbeat
|
||||
* @param _groundhandling_model_heartbeat New value to be moved in member groundhandling_model_heartbeat
|
||||
*/
|
||||
eProsima_user_DllExport void groundhandling_model_heartbeat(
|
||||
eprosima::fastcdr::optional<int32_t>&& _groundhandling_model_heartbeat)
|
||||
{
|
||||
m_groundhandling_model_heartbeat = std::move(_groundhandling_model_heartbeat);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief This function returns a constant reference to member groundhandling_model_heartbeat
|
||||
* @return Constant reference to member groundhandling_model_heartbeat
|
||||
*/
|
||||
eProsima_user_DllExport const eprosima::fastcdr::optional<int32_t>& groundhandling_model_heartbeat() const
|
||||
{
|
||||
return m_groundhandling_model_heartbeat;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief This function returns a reference to member groundhandling_model_heartbeat
|
||||
* @return Reference to member groundhandling_model_heartbeat
|
||||
*/
|
||||
eProsima_user_DllExport eprosima::fastcdr::optional<int32_t>& groundhandling_model_heartbeat()
|
||||
{
|
||||
return m_groundhandling_model_heartbeat;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
eprosima::fastcdr::optional<int32_t> m_groundhandling_model_heartbeat;
|
||||
|
||||
};
|
||||
/*!
|
||||
* @brief This class represents the structure WeightBalance_heartbeat defined by the user in the IDL file.
|
||||
* @ingroup C909_V1
|
||||
*/
|
||||
class WeightBalance_heartbeat
|
||||
{
|
||||
public:
|
||||
|
||||
/*!
|
||||
* @brief Default constructor.
|
||||
*/
|
||||
eProsima_user_DllExport WeightBalance_heartbeat()
|
||||
{
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Default destructor.
|
||||
*/
|
||||
eProsima_user_DllExport ~WeightBalance_heartbeat()
|
||||
{
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Copy constructor.
|
||||
* @param x Reference to the object WeightBalance_heartbeat that will be copied.
|
||||
*/
|
||||
eProsima_user_DllExport WeightBalance_heartbeat(
|
||||
const WeightBalance_heartbeat& x)
|
||||
{
|
||||
m_weightbody_model_heartbeat = x.m_weightbody_model_heartbeat;
|
||||
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Move constructor.
|
||||
* @param x Reference to the object WeightBalance_heartbeat that will be copied.
|
||||
*/
|
||||
eProsima_user_DllExport WeightBalance_heartbeat(
|
||||
WeightBalance_heartbeat&& x) noexcept
|
||||
{
|
||||
m_weightbody_model_heartbeat = x.m_weightbody_model_heartbeat;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Copy assignment.
|
||||
* @param x Reference to the object WeightBalance_heartbeat that will be copied.
|
||||
*/
|
||||
eProsima_user_DllExport WeightBalance_heartbeat& operator =(
|
||||
const WeightBalance_heartbeat& x)
|
||||
{
|
||||
|
||||
m_weightbody_model_heartbeat = x.m_weightbody_model_heartbeat;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Move assignment.
|
||||
* @param x Reference to the object WeightBalance_heartbeat that will be copied.
|
||||
*/
|
||||
eProsima_user_DllExport WeightBalance_heartbeat& operator =(
|
||||
WeightBalance_heartbeat&& x) noexcept
|
||||
{
|
||||
|
||||
m_weightbody_model_heartbeat = x.m_weightbody_model_heartbeat;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Comparison operator.
|
||||
* @param x WeightBalance_heartbeat object to compare.
|
||||
*/
|
||||
eProsima_user_DllExport bool operator ==(
|
||||
const WeightBalance_heartbeat& x) const
|
||||
{
|
||||
return (m_weightbody_model_heartbeat == x.m_weightbody_model_heartbeat);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Comparison operator.
|
||||
* @param x WeightBalance_heartbeat object to compare.
|
||||
*/
|
||||
eProsima_user_DllExport bool operator !=(
|
||||
const WeightBalance_heartbeat& x) const
|
||||
{
|
||||
return !(*this == x);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief This function copies the value in member weightbody_model_heartbeat
|
||||
* @param _weightbody_model_heartbeat New value to be copied in member weightbody_model_heartbeat
|
||||
*/
|
||||
eProsima_user_DllExport void weightbody_model_heartbeat(
|
||||
const eprosima::fastcdr::optional<int32_t>& _weightbody_model_heartbeat)
|
||||
{
|
||||
m_weightbody_model_heartbeat = _weightbody_model_heartbeat;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief This function moves the value in member weightbody_model_heartbeat
|
||||
* @param _weightbody_model_heartbeat New value to be moved in member weightbody_model_heartbeat
|
||||
*/
|
||||
eProsima_user_DllExport void weightbody_model_heartbeat(
|
||||
eprosima::fastcdr::optional<int32_t>&& _weightbody_model_heartbeat)
|
||||
{
|
||||
m_weightbody_model_heartbeat = std::move(_weightbody_model_heartbeat);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief This function returns a constant reference to member weightbody_model_heartbeat
|
||||
* @return Constant reference to member weightbody_model_heartbeat
|
||||
*/
|
||||
eProsima_user_DllExport const eprosima::fastcdr::optional<int32_t>& weightbody_model_heartbeat() const
|
||||
{
|
||||
return m_weightbody_model_heartbeat;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief This function returns a reference to member weightbody_model_heartbeat
|
||||
* @return Reference to member weightbody_model_heartbeat
|
||||
*/
|
||||
eProsima_user_DllExport eprosima::fastcdr::optional<int32_t>& weightbody_model_heartbeat()
|
||||
{
|
||||
return m_weightbody_model_heartbeat;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
eprosima::fastcdr::optional<int32_t> m_weightbody_model_heartbeat;
|
||||
|
||||
};
|
||||
/*!
|
||||
* @brief This class represents the structure Aerodynamics_heartbeat defined by the user in the IDL file.
|
||||
* @ingroup C909_V1
|
||||
*/
|
||||
class Aerodynamics_heartbeat
|
||||
{
|
||||
public:
|
||||
|
||||
/*!
|
||||
* @brief Default constructor.
|
||||
*/
|
||||
eProsima_user_DllExport Aerodynamics_heartbeat()
|
||||
{
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Default destructor.
|
||||
*/
|
||||
eProsima_user_DllExport ~Aerodynamics_heartbeat()
|
||||
{
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Copy constructor.
|
||||
* @param x Reference to the object Aerodynamics_heartbeat that will be copied.
|
||||
*/
|
||||
eProsima_user_DllExport Aerodynamics_heartbeat(
|
||||
const Aerodynamics_heartbeat& x)
|
||||
{
|
||||
m_aero_model_heartbeat = x.m_aero_model_heartbeat;
|
||||
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Move constructor.
|
||||
* @param x Reference to the object Aerodynamics_heartbeat that will be copied.
|
||||
*/
|
||||
eProsima_user_DllExport Aerodynamics_heartbeat(
|
||||
Aerodynamics_heartbeat&& x) noexcept
|
||||
{
|
||||
m_aero_model_heartbeat = x.m_aero_model_heartbeat;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Copy assignment.
|
||||
* @param x Reference to the object Aerodynamics_heartbeat that will be copied.
|
||||
*/
|
||||
eProsima_user_DllExport Aerodynamics_heartbeat& operator =(
|
||||
const Aerodynamics_heartbeat& x)
|
||||
{
|
||||
|
||||
m_aero_model_heartbeat = x.m_aero_model_heartbeat;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Move assignment.
|
||||
* @param x Reference to the object Aerodynamics_heartbeat that will be copied.
|
||||
*/
|
||||
eProsima_user_DllExport Aerodynamics_heartbeat& operator =(
|
||||
Aerodynamics_heartbeat&& x) noexcept
|
||||
{
|
||||
|
||||
m_aero_model_heartbeat = x.m_aero_model_heartbeat;
|
||||
return *this;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Comparison operator.
|
||||
* @param x Aerodynamics_heartbeat object to compare.
|
||||
*/
|
||||
eProsima_user_DllExport bool operator ==(
|
||||
const Aerodynamics_heartbeat& x) const
|
||||
{
|
||||
return (m_aero_model_heartbeat == x.m_aero_model_heartbeat);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Comparison operator.
|
||||
* @param x Aerodynamics_heartbeat object to compare.
|
||||
*/
|
||||
eProsima_user_DllExport bool operator !=(
|
||||
const Aerodynamics_heartbeat& x) const
|
||||
{
|
||||
return !(*this == x);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief This function copies the value in member aero_model_heartbeat
|
||||
* @param _aero_model_heartbeat New value to be copied in member aero_model_heartbeat
|
||||
*/
|
||||
eProsima_user_DllExport void aero_model_heartbeat(
|
||||
const eprosima::fastcdr::optional<int32_t>& _aero_model_heartbeat)
|
||||
{
|
||||
m_aero_model_heartbeat = _aero_model_heartbeat;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief This function moves the value in member aero_model_heartbeat
|
||||
* @param _aero_model_heartbeat New value to be moved in member aero_model_heartbeat
|
||||
*/
|
||||
eProsima_user_DllExport void aero_model_heartbeat(
|
||||
eprosima::fastcdr::optional<int32_t>&& _aero_model_heartbeat)
|
||||
{
|
||||
m_aero_model_heartbeat = std::move(_aero_model_heartbeat);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief This function returns a constant reference to member aero_model_heartbeat
|
||||
* @return Constant reference to member aero_model_heartbeat
|
||||
*/
|
||||
eProsima_user_DllExport const eprosima::fastcdr::optional<int32_t>& aero_model_heartbeat() const
|
||||
{
|
||||
return m_aero_model_heartbeat;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief This function returns a reference to member aero_model_heartbeat
|
||||
* @return Reference to member aero_model_heartbeat
|
||||
*/
|
||||
eProsima_user_DllExport eprosima::fastcdr::optional<int32_t>& aero_model_heartbeat()
|
||||
{
|
||||
return m_aero_model_heartbeat;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
eprosima::fastcdr::optional<int32_t> m_aero_model_heartbeat;
|
||||
|
||||
};
|
||||
|
||||
} // namespace ATA04
|
||||
|
@ -52,7 +52,7 @@ module XNSim
|
||||
@optional char l_04_i_gdcomac_pb_active_l1;
|
||||
@optional double l_04_i_gdcomac_brake_torq_f8[3][2];
|
||||
@optional double l_04_i_gdcomac_gear_f8[3];
|
||||
@optional double l_04_i_gdcomac_gsteer_f8;
|
||||
@optional double l_04_i_gdcomac_gsteer_f8[3];
|
||||
@optional double l_04_i_gdcomac_tire_pres_f8[3][2];
|
||||
@optional char l_04_i_gdcomac_onjax_l1;
|
||||
@optional double l_04_i_gdcomac_contdep_f8[7];
|
||||
@ -214,6 +214,18 @@ module XNSim
|
||||
@optional float l_04_o_wbcomac_max_zfw_f4;
|
||||
@optional float l_04_o_wbcomac_max_zfwcg_f4;
|
||||
};
|
||||
struct GroundHandling_heartbeat
|
||||
{
|
||||
@optional long groundhandling_model_heartbeat;
|
||||
};
|
||||
struct WeightBalance_heartbeat
|
||||
{
|
||||
@optional long weightbody_model_heartbeat;
|
||||
};
|
||||
struct Aerodynamics_heartbeat
|
||||
{
|
||||
@optional long aero_model_heartbeat;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -24,15 +24,21 @@
|
||||
|
||||
#include "C909_V1.hpp"
|
||||
|
||||
constexpr uint32_t XNSim_C909_ATA04_GroundHandling_input_max_cdr_typesize {1021UL};
|
||||
constexpr uint32_t XNSim_C909_ATA04_GroundHandling_input_max_cdr_typesize {1037UL};
|
||||
constexpr uint32_t XNSim_C909_ATA04_GroundHandling_input_max_key_cdr_typesize {0UL};
|
||||
|
||||
constexpr uint32_t XNSim_C909_ATA04_GroundHandling_heartbeat_max_cdr_typesize {12UL};
|
||||
constexpr uint32_t XNSim_C909_ATA04_GroundHandling_heartbeat_max_key_cdr_typesize {0UL};
|
||||
|
||||
constexpr uint32_t XNSim_C909_ATA04_Aerodynamics_output_max_cdr_typesize {312UL};
|
||||
constexpr uint32_t XNSim_C909_ATA04_Aerodynamics_output_max_key_cdr_typesize {0UL};
|
||||
|
||||
constexpr uint32_t XNSim_C909_ATA04_WeightBalance_output_max_cdr_typesize {1184UL};
|
||||
constexpr uint32_t XNSim_C909_ATA04_WeightBalance_output_max_key_cdr_typesize {0UL};
|
||||
|
||||
constexpr uint32_t XNSim_C909_ATA04_WeightBalance_heartbeat_max_cdr_typesize {12UL};
|
||||
constexpr uint32_t XNSim_C909_ATA04_WeightBalance_heartbeat_max_key_cdr_typesize {0UL};
|
||||
|
||||
constexpr uint32_t XNSim_C909_ATA04_GroundHandling_output_max_cdr_typesize {1264UL};
|
||||
constexpr uint32_t XNSim_C909_ATA04_GroundHandling_output_max_key_cdr_typesize {0UL};
|
||||
|
||||
@ -42,6 +48,9 @@ constexpr uint32_t XNSim_C909_ATA04_WeightBalance_input_max_key_cdr_typesize {0U
|
||||
constexpr uint32_t XNSim_C909_ATA04_Aerodynamics_input_max_cdr_typesize {1352UL};
|
||||
constexpr uint32_t XNSim_C909_ATA04_Aerodynamics_input_max_key_cdr_typesize {0UL};
|
||||
|
||||
constexpr uint32_t XNSim_C909_ATA04_Aerodynamics_heartbeat_max_cdr_typesize {12UL};
|
||||
constexpr uint32_t XNSim_C909_ATA04_Aerodynamics_heartbeat_max_key_cdr_typesize {0UL};
|
||||
|
||||
|
||||
namespace eprosima {
|
||||
namespace fastcdr {
|
||||
@ -73,6 +82,18 @@ eProsima_user_DllExport void serialize_key(
|
||||
eprosima::fastcdr::Cdr& scdr,
|
||||
const XNSim::C909::ATA04::WeightBalance_output& data);
|
||||
|
||||
eProsima_user_DllExport void serialize_key(
|
||||
eprosima::fastcdr::Cdr& scdr,
|
||||
const XNSim::C909::ATA04::GroundHandling_heartbeat& data);
|
||||
|
||||
eProsima_user_DllExport void serialize_key(
|
||||
eprosima::fastcdr::Cdr& scdr,
|
||||
const XNSim::C909::ATA04::WeightBalance_heartbeat& data);
|
||||
|
||||
eProsima_user_DllExport void serialize_key(
|
||||
eprosima::fastcdr::Cdr& scdr,
|
||||
const XNSim::C909::ATA04::Aerodynamics_heartbeat& data);
|
||||
|
||||
|
||||
} // namespace fastcdr
|
||||
} // namespace eprosima
|
||||
|
@ -2986,6 +2986,273 @@ void serialize_key(
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
eProsima_user_DllExport size_t calculate_serialized_size(
|
||||
eprosima::fastcdr::CdrSizeCalculator& calculator,
|
||||
const XNSim::C909::ATA04::GroundHandling_heartbeat& data,
|
||||
size_t& current_alignment)
|
||||
{
|
||||
using namespace XNSim::C909::ATA04;
|
||||
|
||||
static_cast<void>(data);
|
||||
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding();
|
||||
size_t calculated_size {calculator.begin_calculate_type_serialized_size(
|
||||
eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ?
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR,
|
||||
current_alignment)};
|
||||
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0),
|
||||
data.groundhandling_model_heartbeat(), current_alignment);
|
||||
|
||||
|
||||
calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment);
|
||||
|
||||
return calculated_size;
|
||||
}
|
||||
|
||||
template<>
|
||||
eProsima_user_DllExport void serialize(
|
||||
eprosima::fastcdr::Cdr& scdr,
|
||||
const XNSim::C909::ATA04::GroundHandling_heartbeat& data)
|
||||
{
|
||||
using namespace XNSim::C909::ATA04;
|
||||
|
||||
eprosima::fastcdr::Cdr::state current_state(scdr);
|
||||
scdr.begin_serialize_type(current_state,
|
||||
eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ?
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR);
|
||||
|
||||
scdr
|
||||
<< eprosima::fastcdr::MemberId(0) << data.groundhandling_model_heartbeat()
|
||||
;
|
||||
scdr.end_serialize_type(current_state);
|
||||
}
|
||||
|
||||
template<>
|
||||
eProsima_user_DllExport void deserialize(
|
||||
eprosima::fastcdr::Cdr& cdr,
|
||||
XNSim::C909::ATA04::GroundHandling_heartbeat& data)
|
||||
{
|
||||
using namespace XNSim::C909::ATA04;
|
||||
|
||||
cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ?
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR,
|
||||
[&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool
|
||||
{
|
||||
bool ret_value = true;
|
||||
switch (mid.id)
|
||||
{
|
||||
case 0:
|
||||
dcdr >> data.groundhandling_model_heartbeat();
|
||||
break;
|
||||
|
||||
default:
|
||||
ret_value = false;
|
||||
break;
|
||||
}
|
||||
return ret_value;
|
||||
});
|
||||
}
|
||||
|
||||
void serialize_key(
|
||||
eprosima::fastcdr::Cdr& scdr,
|
||||
const XNSim::C909::ATA04::GroundHandling_heartbeat& data)
|
||||
{
|
||||
using namespace XNSim::C909::ATA04;
|
||||
|
||||
static_cast<void>(scdr);
|
||||
static_cast<void>(data);
|
||||
if (data.groundhandling_model_heartbeat().has_value())
|
||||
{
|
||||
scdr << data.groundhandling_model_heartbeat().value();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
eProsima_user_DllExport size_t calculate_serialized_size(
|
||||
eprosima::fastcdr::CdrSizeCalculator& calculator,
|
||||
const XNSim::C909::ATA04::WeightBalance_heartbeat& data,
|
||||
size_t& current_alignment)
|
||||
{
|
||||
using namespace XNSim::C909::ATA04;
|
||||
|
||||
static_cast<void>(data);
|
||||
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding();
|
||||
size_t calculated_size {calculator.begin_calculate_type_serialized_size(
|
||||
eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ?
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR,
|
||||
current_alignment)};
|
||||
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0),
|
||||
data.weightbody_model_heartbeat(), current_alignment);
|
||||
|
||||
|
||||
calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment);
|
||||
|
||||
return calculated_size;
|
||||
}
|
||||
|
||||
template<>
|
||||
eProsima_user_DllExport void serialize(
|
||||
eprosima::fastcdr::Cdr& scdr,
|
||||
const XNSim::C909::ATA04::WeightBalance_heartbeat& data)
|
||||
{
|
||||
using namespace XNSim::C909::ATA04;
|
||||
|
||||
eprosima::fastcdr::Cdr::state current_state(scdr);
|
||||
scdr.begin_serialize_type(current_state,
|
||||
eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ?
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR);
|
||||
|
||||
scdr
|
||||
<< eprosima::fastcdr::MemberId(0) << data.weightbody_model_heartbeat()
|
||||
;
|
||||
scdr.end_serialize_type(current_state);
|
||||
}
|
||||
|
||||
template<>
|
||||
eProsima_user_DllExport void deserialize(
|
||||
eprosima::fastcdr::Cdr& cdr,
|
||||
XNSim::C909::ATA04::WeightBalance_heartbeat& data)
|
||||
{
|
||||
using namespace XNSim::C909::ATA04;
|
||||
|
||||
cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ?
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR,
|
||||
[&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool
|
||||
{
|
||||
bool ret_value = true;
|
||||
switch (mid.id)
|
||||
{
|
||||
case 0:
|
||||
dcdr >> data.weightbody_model_heartbeat();
|
||||
break;
|
||||
|
||||
default:
|
||||
ret_value = false;
|
||||
break;
|
||||
}
|
||||
return ret_value;
|
||||
});
|
||||
}
|
||||
|
||||
void serialize_key(
|
||||
eprosima::fastcdr::Cdr& scdr,
|
||||
const XNSim::C909::ATA04::WeightBalance_heartbeat& data)
|
||||
{
|
||||
using namespace XNSim::C909::ATA04;
|
||||
|
||||
static_cast<void>(scdr);
|
||||
static_cast<void>(data);
|
||||
if (data.weightbody_model_heartbeat().has_value())
|
||||
{
|
||||
scdr << data.weightbody_model_heartbeat().value();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
eProsima_user_DllExport size_t calculate_serialized_size(
|
||||
eprosima::fastcdr::CdrSizeCalculator& calculator,
|
||||
const XNSim::C909::ATA04::Aerodynamics_heartbeat& data,
|
||||
size_t& current_alignment)
|
||||
{
|
||||
using namespace XNSim::C909::ATA04;
|
||||
|
||||
static_cast<void>(data);
|
||||
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding();
|
||||
size_t calculated_size {calculator.begin_calculate_type_serialized_size(
|
||||
eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ?
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR,
|
||||
current_alignment)};
|
||||
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0),
|
||||
data.aero_model_heartbeat(), current_alignment);
|
||||
|
||||
|
||||
calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment);
|
||||
|
||||
return calculated_size;
|
||||
}
|
||||
|
||||
template<>
|
||||
eProsima_user_DllExport void serialize(
|
||||
eprosima::fastcdr::Cdr& scdr,
|
||||
const XNSim::C909::ATA04::Aerodynamics_heartbeat& data)
|
||||
{
|
||||
using namespace XNSim::C909::ATA04;
|
||||
|
||||
eprosima::fastcdr::Cdr::state current_state(scdr);
|
||||
scdr.begin_serialize_type(current_state,
|
||||
eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ?
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR);
|
||||
|
||||
scdr
|
||||
<< eprosima::fastcdr::MemberId(0) << data.aero_model_heartbeat()
|
||||
;
|
||||
scdr.end_serialize_type(current_state);
|
||||
}
|
||||
|
||||
template<>
|
||||
eProsima_user_DllExport void deserialize(
|
||||
eprosima::fastcdr::Cdr& cdr,
|
||||
XNSim::C909::ATA04::Aerodynamics_heartbeat& data)
|
||||
{
|
||||
using namespace XNSim::C909::ATA04;
|
||||
|
||||
cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ?
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR,
|
||||
[&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool
|
||||
{
|
||||
bool ret_value = true;
|
||||
switch (mid.id)
|
||||
{
|
||||
case 0:
|
||||
dcdr >> data.aero_model_heartbeat();
|
||||
break;
|
||||
|
||||
default:
|
||||
ret_value = false;
|
||||
break;
|
||||
}
|
||||
return ret_value;
|
||||
});
|
||||
}
|
||||
|
||||
void serialize_key(
|
||||
eprosima::fastcdr::Cdr& scdr,
|
||||
const XNSim::C909::ATA04::Aerodynamics_heartbeat& data)
|
||||
{
|
||||
using namespace XNSim::C909::ATA04;
|
||||
|
||||
static_cast<void>(scdr);
|
||||
static_cast<void>(data);
|
||||
if (data.aero_model_heartbeat().has_value())
|
||||
{
|
||||
scdr << data.aero_model_heartbeat().value();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace fastcdr
|
||||
} // namespace eprosima
|
||||
|
@ -1126,6 +1126,552 @@ namespace XNSim {
|
||||
register_WeightBalance_output_type_identifier(type_identifiers_);
|
||||
}
|
||||
|
||||
GroundHandling_heartbeatPubSubType::GroundHandling_heartbeatPubSubType()
|
||||
{
|
||||
set_name("XNSim::C909::ATA04::GroundHandling_heartbeat");
|
||||
uint32_t type_size = XNSim_C909_ATA04_GroundHandling_heartbeat_max_cdr_typesize;
|
||||
type_size += static_cast<uint32_t>(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */
|
||||
max_serialized_type_size = type_size + 4; /*encapsulation*/
|
||||
is_compute_key_provided = false;
|
||||
uint32_t key_length = XNSim_C909_ATA04_GroundHandling_heartbeat_max_key_cdr_typesize > 16 ? XNSim_C909_ATA04_GroundHandling_heartbeat_max_key_cdr_typesize : 16;
|
||||
key_buffer_ = reinterpret_cast<unsigned char*>(malloc(key_length));
|
||||
memset(key_buffer_, 0, key_length);
|
||||
}
|
||||
|
||||
GroundHandling_heartbeatPubSubType::~GroundHandling_heartbeatPubSubType()
|
||||
{
|
||||
if (key_buffer_ != nullptr)
|
||||
{
|
||||
free(key_buffer_);
|
||||
}
|
||||
}
|
||||
|
||||
bool GroundHandling_heartbeatPubSubType::serialize(
|
||||
const void* const data,
|
||||
SerializedPayload_t& payload,
|
||||
DataRepresentationId_t data_representation)
|
||||
{
|
||||
const GroundHandling_heartbeat* p_type = static_cast<const GroundHandling_heartbeat*>(data);
|
||||
|
||||
// Object that manages the raw buffer.
|
||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(payload.data), payload.max_size);
|
||||
// Object that serializes the data.
|
||||
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN,
|
||||
data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ?
|
||||
eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2);
|
||||
payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE;
|
||||
ser.set_encoding_flag(
|
||||
data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ?
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR :
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2);
|
||||
|
||||
try
|
||||
{
|
||||
// Serialize encapsulation
|
||||
ser.serialize_encapsulation();
|
||||
// Serialize the object.
|
||||
ser << *p_type;
|
||||
ser.set_dds_cdr_options({0,0});
|
||||
}
|
||||
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get the serialized length
|
||||
payload.length = static_cast<uint32_t>(ser.get_serialized_data_length());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GroundHandling_heartbeatPubSubType::deserialize(
|
||||
SerializedPayload_t& payload,
|
||||
void* data)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Convert DATA to pointer of your type
|
||||
GroundHandling_heartbeat* p_type = static_cast<GroundHandling_heartbeat*>(data);
|
||||
|
||||
// Object that manages the raw buffer.
|
||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(payload.data), payload.length);
|
||||
|
||||
// Object that deserializes the data.
|
||||
eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN);
|
||||
|
||||
// Deserialize encapsulation.
|
||||
deser.read_encapsulation();
|
||||
payload.encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE;
|
||||
|
||||
// Deserialize the object.
|
||||
deser >> *p_type;
|
||||
}
|
||||
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t GroundHandling_heartbeatPubSubType::calculate_serialized_size(
|
||||
const void* const data,
|
||||
DataRepresentationId_t data_representation)
|
||||
{
|
||||
try
|
||||
{
|
||||
eprosima::fastcdr::CdrSizeCalculator calculator(
|
||||
data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ?
|
||||
eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2);
|
||||
size_t current_alignment {0};
|
||||
return static_cast<uint32_t>(calculator.calculate_serialized_size(
|
||||
*static_cast<const GroundHandling_heartbeat*>(data), current_alignment)) +
|
||||
4u /*encapsulation*/;
|
||||
}
|
||||
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void* GroundHandling_heartbeatPubSubType::create_data()
|
||||
{
|
||||
return reinterpret_cast<void*>(new GroundHandling_heartbeat());
|
||||
}
|
||||
|
||||
void GroundHandling_heartbeatPubSubType::delete_data(
|
||||
void* data)
|
||||
{
|
||||
delete(reinterpret_cast<GroundHandling_heartbeat*>(data));
|
||||
}
|
||||
|
||||
bool GroundHandling_heartbeatPubSubType::compute_key(
|
||||
SerializedPayload_t& payload,
|
||||
InstanceHandle_t& handle,
|
||||
bool force_md5)
|
||||
{
|
||||
if (!is_compute_key_provided)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
GroundHandling_heartbeat data;
|
||||
if (deserialize(payload, static_cast<void*>(&data)))
|
||||
{
|
||||
return compute_key(static_cast<void*>(&data), handle, force_md5);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool GroundHandling_heartbeatPubSubType::compute_key(
|
||||
const void* const data,
|
||||
InstanceHandle_t& handle,
|
||||
bool force_md5)
|
||||
{
|
||||
if (!is_compute_key_provided)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const GroundHandling_heartbeat* p_type = static_cast<const GroundHandling_heartbeat*>(data);
|
||||
|
||||
// Object that manages the raw buffer.
|
||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(key_buffer_),
|
||||
XNSim_C909_ATA04_GroundHandling_heartbeat_max_key_cdr_typesize);
|
||||
|
||||
// Object that serializes the data.
|
||||
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2);
|
||||
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2);
|
||||
eprosima::fastcdr::serialize_key(ser, *p_type);
|
||||
if (force_md5 || XNSim_C909_ATA04_GroundHandling_heartbeat_max_key_cdr_typesize > 16)
|
||||
{
|
||||
md5_.init();
|
||||
md5_.update(key_buffer_, static_cast<unsigned int>(ser.get_serialized_data_length()));
|
||||
md5_.finalize();
|
||||
for (uint8_t i = 0; i < 16; ++i)
|
||||
{
|
||||
handle.value[i] = md5_.digest[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (uint8_t i = 0; i < 16; ++i)
|
||||
{
|
||||
handle.value[i] = key_buffer_[i];
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void GroundHandling_heartbeatPubSubType::register_type_object_representation()
|
||||
{
|
||||
register_GroundHandling_heartbeat_type_identifier(type_identifiers_);
|
||||
}
|
||||
|
||||
WeightBalance_heartbeatPubSubType::WeightBalance_heartbeatPubSubType()
|
||||
{
|
||||
set_name("XNSim::C909::ATA04::WeightBalance_heartbeat");
|
||||
uint32_t type_size = XNSim_C909_ATA04_WeightBalance_heartbeat_max_cdr_typesize;
|
||||
type_size += static_cast<uint32_t>(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */
|
||||
max_serialized_type_size = type_size + 4; /*encapsulation*/
|
||||
is_compute_key_provided = false;
|
||||
uint32_t key_length = XNSim_C909_ATA04_WeightBalance_heartbeat_max_key_cdr_typesize > 16 ? XNSim_C909_ATA04_WeightBalance_heartbeat_max_key_cdr_typesize : 16;
|
||||
key_buffer_ = reinterpret_cast<unsigned char*>(malloc(key_length));
|
||||
memset(key_buffer_, 0, key_length);
|
||||
}
|
||||
|
||||
WeightBalance_heartbeatPubSubType::~WeightBalance_heartbeatPubSubType()
|
||||
{
|
||||
if (key_buffer_ != nullptr)
|
||||
{
|
||||
free(key_buffer_);
|
||||
}
|
||||
}
|
||||
|
||||
bool WeightBalance_heartbeatPubSubType::serialize(
|
||||
const void* const data,
|
||||
SerializedPayload_t& payload,
|
||||
DataRepresentationId_t data_representation)
|
||||
{
|
||||
const WeightBalance_heartbeat* p_type = static_cast<const WeightBalance_heartbeat*>(data);
|
||||
|
||||
// Object that manages the raw buffer.
|
||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(payload.data), payload.max_size);
|
||||
// Object that serializes the data.
|
||||
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN,
|
||||
data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ?
|
||||
eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2);
|
||||
payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE;
|
||||
ser.set_encoding_flag(
|
||||
data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ?
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR :
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2);
|
||||
|
||||
try
|
||||
{
|
||||
// Serialize encapsulation
|
||||
ser.serialize_encapsulation();
|
||||
// Serialize the object.
|
||||
ser << *p_type;
|
||||
ser.set_dds_cdr_options({0,0});
|
||||
}
|
||||
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get the serialized length
|
||||
payload.length = static_cast<uint32_t>(ser.get_serialized_data_length());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WeightBalance_heartbeatPubSubType::deserialize(
|
||||
SerializedPayload_t& payload,
|
||||
void* data)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Convert DATA to pointer of your type
|
||||
WeightBalance_heartbeat* p_type = static_cast<WeightBalance_heartbeat*>(data);
|
||||
|
||||
// Object that manages the raw buffer.
|
||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(payload.data), payload.length);
|
||||
|
||||
// Object that deserializes the data.
|
||||
eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN);
|
||||
|
||||
// Deserialize encapsulation.
|
||||
deser.read_encapsulation();
|
||||
payload.encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE;
|
||||
|
||||
// Deserialize the object.
|
||||
deser >> *p_type;
|
||||
}
|
||||
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t WeightBalance_heartbeatPubSubType::calculate_serialized_size(
|
||||
const void* const data,
|
||||
DataRepresentationId_t data_representation)
|
||||
{
|
||||
try
|
||||
{
|
||||
eprosima::fastcdr::CdrSizeCalculator calculator(
|
||||
data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ?
|
||||
eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2);
|
||||
size_t current_alignment {0};
|
||||
return static_cast<uint32_t>(calculator.calculate_serialized_size(
|
||||
*static_cast<const WeightBalance_heartbeat*>(data), current_alignment)) +
|
||||
4u /*encapsulation*/;
|
||||
}
|
||||
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void* WeightBalance_heartbeatPubSubType::create_data()
|
||||
{
|
||||
return reinterpret_cast<void*>(new WeightBalance_heartbeat());
|
||||
}
|
||||
|
||||
void WeightBalance_heartbeatPubSubType::delete_data(
|
||||
void* data)
|
||||
{
|
||||
delete(reinterpret_cast<WeightBalance_heartbeat*>(data));
|
||||
}
|
||||
|
||||
bool WeightBalance_heartbeatPubSubType::compute_key(
|
||||
SerializedPayload_t& payload,
|
||||
InstanceHandle_t& handle,
|
||||
bool force_md5)
|
||||
{
|
||||
if (!is_compute_key_provided)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
WeightBalance_heartbeat data;
|
||||
if (deserialize(payload, static_cast<void*>(&data)))
|
||||
{
|
||||
return compute_key(static_cast<void*>(&data), handle, force_md5);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool WeightBalance_heartbeatPubSubType::compute_key(
|
||||
const void* const data,
|
||||
InstanceHandle_t& handle,
|
||||
bool force_md5)
|
||||
{
|
||||
if (!is_compute_key_provided)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const WeightBalance_heartbeat* p_type = static_cast<const WeightBalance_heartbeat*>(data);
|
||||
|
||||
// Object that manages the raw buffer.
|
||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(key_buffer_),
|
||||
XNSim_C909_ATA04_WeightBalance_heartbeat_max_key_cdr_typesize);
|
||||
|
||||
// Object that serializes the data.
|
||||
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2);
|
||||
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2);
|
||||
eprosima::fastcdr::serialize_key(ser, *p_type);
|
||||
if (force_md5 || XNSim_C909_ATA04_WeightBalance_heartbeat_max_key_cdr_typesize > 16)
|
||||
{
|
||||
md5_.init();
|
||||
md5_.update(key_buffer_, static_cast<unsigned int>(ser.get_serialized_data_length()));
|
||||
md5_.finalize();
|
||||
for (uint8_t i = 0; i < 16; ++i)
|
||||
{
|
||||
handle.value[i] = md5_.digest[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (uint8_t i = 0; i < 16; ++i)
|
||||
{
|
||||
handle.value[i] = key_buffer_[i];
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void WeightBalance_heartbeatPubSubType::register_type_object_representation()
|
||||
{
|
||||
register_WeightBalance_heartbeat_type_identifier(type_identifiers_);
|
||||
}
|
||||
|
||||
Aerodynamics_heartbeatPubSubType::Aerodynamics_heartbeatPubSubType()
|
||||
{
|
||||
set_name("XNSim::C909::ATA04::Aerodynamics_heartbeat");
|
||||
uint32_t type_size = XNSim_C909_ATA04_Aerodynamics_heartbeat_max_cdr_typesize;
|
||||
type_size += static_cast<uint32_t>(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */
|
||||
max_serialized_type_size = type_size + 4; /*encapsulation*/
|
||||
is_compute_key_provided = false;
|
||||
uint32_t key_length = XNSim_C909_ATA04_Aerodynamics_heartbeat_max_key_cdr_typesize > 16 ? XNSim_C909_ATA04_Aerodynamics_heartbeat_max_key_cdr_typesize : 16;
|
||||
key_buffer_ = reinterpret_cast<unsigned char*>(malloc(key_length));
|
||||
memset(key_buffer_, 0, key_length);
|
||||
}
|
||||
|
||||
Aerodynamics_heartbeatPubSubType::~Aerodynamics_heartbeatPubSubType()
|
||||
{
|
||||
if (key_buffer_ != nullptr)
|
||||
{
|
||||
free(key_buffer_);
|
||||
}
|
||||
}
|
||||
|
||||
bool Aerodynamics_heartbeatPubSubType::serialize(
|
||||
const void* const data,
|
||||
SerializedPayload_t& payload,
|
||||
DataRepresentationId_t data_representation)
|
||||
{
|
||||
const Aerodynamics_heartbeat* p_type = static_cast<const Aerodynamics_heartbeat*>(data);
|
||||
|
||||
// Object that manages the raw buffer.
|
||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(payload.data), payload.max_size);
|
||||
// Object that serializes the data.
|
||||
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN,
|
||||
data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ?
|
||||
eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2);
|
||||
payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE;
|
||||
ser.set_encoding_flag(
|
||||
data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ?
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR :
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2);
|
||||
|
||||
try
|
||||
{
|
||||
// Serialize encapsulation
|
||||
ser.serialize_encapsulation();
|
||||
// Serialize the object.
|
||||
ser << *p_type;
|
||||
ser.set_dds_cdr_options({0,0});
|
||||
}
|
||||
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get the serialized length
|
||||
payload.length = static_cast<uint32_t>(ser.get_serialized_data_length());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Aerodynamics_heartbeatPubSubType::deserialize(
|
||||
SerializedPayload_t& payload,
|
||||
void* data)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Convert DATA to pointer of your type
|
||||
Aerodynamics_heartbeat* p_type = static_cast<Aerodynamics_heartbeat*>(data);
|
||||
|
||||
// Object that manages the raw buffer.
|
||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(payload.data), payload.length);
|
||||
|
||||
// Object that deserializes the data.
|
||||
eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN);
|
||||
|
||||
// Deserialize encapsulation.
|
||||
deser.read_encapsulation();
|
||||
payload.encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE;
|
||||
|
||||
// Deserialize the object.
|
||||
deser >> *p_type;
|
||||
}
|
||||
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t Aerodynamics_heartbeatPubSubType::calculate_serialized_size(
|
||||
const void* const data,
|
||||
DataRepresentationId_t data_representation)
|
||||
{
|
||||
try
|
||||
{
|
||||
eprosima::fastcdr::CdrSizeCalculator calculator(
|
||||
data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ?
|
||||
eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2);
|
||||
size_t current_alignment {0};
|
||||
return static_cast<uint32_t>(calculator.calculate_serialized_size(
|
||||
*static_cast<const Aerodynamics_heartbeat*>(data), current_alignment)) +
|
||||
4u /*encapsulation*/;
|
||||
}
|
||||
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void* Aerodynamics_heartbeatPubSubType::create_data()
|
||||
{
|
||||
return reinterpret_cast<void*>(new Aerodynamics_heartbeat());
|
||||
}
|
||||
|
||||
void Aerodynamics_heartbeatPubSubType::delete_data(
|
||||
void* data)
|
||||
{
|
||||
delete(reinterpret_cast<Aerodynamics_heartbeat*>(data));
|
||||
}
|
||||
|
||||
bool Aerodynamics_heartbeatPubSubType::compute_key(
|
||||
SerializedPayload_t& payload,
|
||||
InstanceHandle_t& handle,
|
||||
bool force_md5)
|
||||
{
|
||||
if (!is_compute_key_provided)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Aerodynamics_heartbeat data;
|
||||
if (deserialize(payload, static_cast<void*>(&data)))
|
||||
{
|
||||
return compute_key(static_cast<void*>(&data), handle, force_md5);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Aerodynamics_heartbeatPubSubType::compute_key(
|
||||
const void* const data,
|
||||
InstanceHandle_t& handle,
|
||||
bool force_md5)
|
||||
{
|
||||
if (!is_compute_key_provided)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const Aerodynamics_heartbeat* p_type = static_cast<const Aerodynamics_heartbeat*>(data);
|
||||
|
||||
// Object that manages the raw buffer.
|
||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(key_buffer_),
|
||||
XNSim_C909_ATA04_Aerodynamics_heartbeat_max_key_cdr_typesize);
|
||||
|
||||
// Object that serializes the data.
|
||||
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2);
|
||||
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2);
|
||||
eprosima::fastcdr::serialize_key(ser, *p_type);
|
||||
if (force_md5 || XNSim_C909_ATA04_Aerodynamics_heartbeat_max_key_cdr_typesize > 16)
|
||||
{
|
||||
md5_.init();
|
||||
md5_.update(key_buffer_, static_cast<unsigned int>(ser.get_serialized_data_length()));
|
||||
md5_.finalize();
|
||||
for (uint8_t i = 0; i < 16; ++i)
|
||||
{
|
||||
handle.value[i] = md5_.digest[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (uint8_t i = 0; i < 16; ++i)
|
||||
{
|
||||
handle.value[i] = key_buffer_[i];
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void Aerodynamics_heartbeatPubSubType::register_type_object_representation()
|
||||
{
|
||||
register_Aerodynamics_heartbeat_type_identifier(type_identifiers_);
|
||||
}
|
||||
|
||||
} // namespace ATA04
|
||||
|
||||
} // namespace C909
|
||||
|
@ -529,6 +529,249 @@ namespace XNSim
|
||||
unsigned char* key_buffer_;
|
||||
|
||||
};
|
||||
|
||||
/*!
|
||||
* @brief This class represents the TopicDataType of the type GroundHandling_heartbeat defined by the user in the IDL file.
|
||||
* @ingroup C909_V1
|
||||
*/
|
||||
class GroundHandling_heartbeatPubSubType : public eprosima::fastdds::dds::TopicDataType
|
||||
{
|
||||
public:
|
||||
|
||||
typedef GroundHandling_heartbeat type;
|
||||
|
||||
eProsima_user_DllExport GroundHandling_heartbeatPubSubType();
|
||||
|
||||
eProsima_user_DllExport ~GroundHandling_heartbeatPubSubType() override;
|
||||
|
||||
eProsima_user_DllExport bool serialize(
|
||||
const void* const data,
|
||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) override;
|
||||
|
||||
eProsima_user_DllExport bool deserialize(
|
||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
||||
void* data) override;
|
||||
|
||||
eProsima_user_DllExport uint32_t calculate_serialized_size(
|
||||
const void* const data,
|
||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) override;
|
||||
|
||||
eProsima_user_DllExport bool compute_key(
|
||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
||||
eprosima::fastdds::rtps::InstanceHandle_t& ihandle,
|
||||
bool force_md5 = false) override;
|
||||
|
||||
eProsima_user_DllExport bool compute_key(
|
||||
const void* const data,
|
||||
eprosima::fastdds::rtps::InstanceHandle_t& ihandle,
|
||||
bool force_md5 = false) override;
|
||||
|
||||
eProsima_user_DllExport void* create_data() override;
|
||||
|
||||
eProsima_user_DllExport void delete_data(
|
||||
void* data) override;
|
||||
|
||||
//Register TypeObject representation in Fast DDS TypeObjectRegistry
|
||||
eProsima_user_DllExport void register_type_object_representation() override;
|
||||
|
||||
#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
|
||||
eProsima_user_DllExport inline bool is_bounded() const override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
|
||||
|
||||
#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
|
||||
|
||||
eProsima_user_DllExport inline bool is_plain(
|
||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override
|
||||
{
|
||||
static_cast<void>(data_representation);
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
|
||||
|
||||
#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
|
||||
eProsima_user_DllExport inline bool construct_sample(
|
||||
void* memory) const override
|
||||
{
|
||||
static_cast<void>(memory);
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
|
||||
|
||||
private:
|
||||
|
||||
eprosima::fastdds::MD5 md5_;
|
||||
unsigned char* key_buffer_;
|
||||
|
||||
};
|
||||
|
||||
/*!
|
||||
* @brief This class represents the TopicDataType of the type WeightBalance_heartbeat defined by the user in the IDL file.
|
||||
* @ingroup C909_V1
|
||||
*/
|
||||
class WeightBalance_heartbeatPubSubType : public eprosima::fastdds::dds::TopicDataType
|
||||
{
|
||||
public:
|
||||
|
||||
typedef WeightBalance_heartbeat type;
|
||||
|
||||
eProsima_user_DllExport WeightBalance_heartbeatPubSubType();
|
||||
|
||||
eProsima_user_DllExport ~WeightBalance_heartbeatPubSubType() override;
|
||||
|
||||
eProsima_user_DllExport bool serialize(
|
||||
const void* const data,
|
||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) override;
|
||||
|
||||
eProsima_user_DllExport bool deserialize(
|
||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
||||
void* data) override;
|
||||
|
||||
eProsima_user_DllExport uint32_t calculate_serialized_size(
|
||||
const void* const data,
|
||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) override;
|
||||
|
||||
eProsima_user_DllExport bool compute_key(
|
||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
||||
eprosima::fastdds::rtps::InstanceHandle_t& ihandle,
|
||||
bool force_md5 = false) override;
|
||||
|
||||
eProsima_user_DllExport bool compute_key(
|
||||
const void* const data,
|
||||
eprosima::fastdds::rtps::InstanceHandle_t& ihandle,
|
||||
bool force_md5 = false) override;
|
||||
|
||||
eProsima_user_DllExport void* create_data() override;
|
||||
|
||||
eProsima_user_DllExport void delete_data(
|
||||
void* data) override;
|
||||
|
||||
//Register TypeObject representation in Fast DDS TypeObjectRegistry
|
||||
eProsima_user_DllExport void register_type_object_representation() override;
|
||||
|
||||
#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
|
||||
eProsima_user_DllExport inline bool is_bounded() const override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
|
||||
|
||||
#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
|
||||
|
||||
eProsima_user_DllExport inline bool is_plain(
|
||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override
|
||||
{
|
||||
static_cast<void>(data_representation);
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
|
||||
|
||||
#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
|
||||
eProsima_user_DllExport inline bool construct_sample(
|
||||
void* memory) const override
|
||||
{
|
||||
static_cast<void>(memory);
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
|
||||
|
||||
private:
|
||||
|
||||
eprosima::fastdds::MD5 md5_;
|
||||
unsigned char* key_buffer_;
|
||||
|
||||
};
|
||||
|
||||
/*!
|
||||
* @brief This class represents the TopicDataType of the type Aerodynamics_heartbeat defined by the user in the IDL file.
|
||||
* @ingroup C909_V1
|
||||
*/
|
||||
class Aerodynamics_heartbeatPubSubType : public eprosima::fastdds::dds::TopicDataType
|
||||
{
|
||||
public:
|
||||
|
||||
typedef Aerodynamics_heartbeat type;
|
||||
|
||||
eProsima_user_DllExport Aerodynamics_heartbeatPubSubType();
|
||||
|
||||
eProsima_user_DllExport ~Aerodynamics_heartbeatPubSubType() override;
|
||||
|
||||
eProsima_user_DllExport bool serialize(
|
||||
const void* const data,
|
||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) override;
|
||||
|
||||
eProsima_user_DllExport bool deserialize(
|
||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
||||
void* data) override;
|
||||
|
||||
eProsima_user_DllExport uint32_t calculate_serialized_size(
|
||||
const void* const data,
|
||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) override;
|
||||
|
||||
eProsima_user_DllExport bool compute_key(
|
||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
||||
eprosima::fastdds::rtps::InstanceHandle_t& ihandle,
|
||||
bool force_md5 = false) override;
|
||||
|
||||
eProsima_user_DllExport bool compute_key(
|
||||
const void* const data,
|
||||
eprosima::fastdds::rtps::InstanceHandle_t& ihandle,
|
||||
bool force_md5 = false) override;
|
||||
|
||||
eProsima_user_DllExport void* create_data() override;
|
||||
|
||||
eProsima_user_DllExport void delete_data(
|
||||
void* data) override;
|
||||
|
||||
//Register TypeObject representation in Fast DDS TypeObjectRegistry
|
||||
eProsima_user_DllExport void register_type_object_representation() override;
|
||||
|
||||
#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
|
||||
eProsima_user_DllExport inline bool is_bounded() const override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
|
||||
|
||||
#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
|
||||
|
||||
eProsima_user_DllExport inline bool is_plain(
|
||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override
|
||||
{
|
||||
static_cast<void>(data_representation);
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
|
||||
|
||||
#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
|
||||
eProsima_user_DllExport inline bool construct_sample(
|
||||
void* memory) const override
|
||||
{
|
||||
static_cast<void>(memory);
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
|
||||
|
||||
private:
|
||||
|
||||
eprosima::fastdds::MD5 md5_;
|
||||
unsigned char* key_buffer_;
|
||||
|
||||
};
|
||||
} // namespace ATA04
|
||||
} // namespace C909
|
||||
} // namespace XNSim
|
||||
|
@ -2320,13 +2320,47 @@ void register_GroundHandling_input_type_identifier(
|
||||
ReturnCode_t return_code_l_04_i_gdcomac_gsteer_f8 {eprosima::fastdds::dds::RETCODE_OK};
|
||||
return_code_l_04_i_gdcomac_gsteer_f8 =
|
||||
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
|
||||
"_double", type_ids_l_04_i_gdcomac_gsteer_f8);
|
||||
"anonymous_array_double_3", type_ids_l_04_i_gdcomac_gsteer_f8);
|
||||
|
||||
if (eprosima::fastdds::dds::RETCODE_OK != return_code_l_04_i_gdcomac_gsteer_f8)
|
||||
{
|
||||
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
|
||||
"l_04_i_gdcomac_gsteer_f8 Structure member TypeIdentifier unknown to TypeObjectRegistry.");
|
||||
return;
|
||||
return_code_l_04_i_gdcomac_gsteer_f8 =
|
||||
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
|
||||
"_double", type_ids_l_04_i_gdcomac_gsteer_f8);
|
||||
|
||||
if (eprosima::fastdds::dds::RETCODE_OK != return_code_l_04_i_gdcomac_gsteer_f8)
|
||||
{
|
||||
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
|
||||
"Array element TypeIdentifier unknown to TypeObjectRegistry.");
|
||||
return;
|
||||
}
|
||||
bool element_identifier_anonymous_array_double_3_ec {false};
|
||||
TypeIdentifier* element_identifier_anonymous_array_double_3 {new TypeIdentifier(TypeObjectUtils::retrieve_complete_type_identifier(type_ids_l_04_i_gdcomac_gsteer_f8, element_identifier_anonymous_array_double_3_ec))};
|
||||
if (!element_identifier_anonymous_array_double_3_ec)
|
||||
{
|
||||
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Array element TypeIdentifier inconsistent.");
|
||||
return;
|
||||
}
|
||||
EquivalenceKind equiv_kind_anonymous_array_double_3 = EK_COMPLETE;
|
||||
if (TK_NONE == type_ids_l_04_i_gdcomac_gsteer_f8.type_identifier2()._d())
|
||||
{
|
||||
equiv_kind_anonymous_array_double_3 = EK_BOTH;
|
||||
}
|
||||
CollectionElementFlag element_flags_anonymous_array_double_3 = 0;
|
||||
PlainCollectionHeader header_anonymous_array_double_3 = TypeObjectUtils::build_plain_collection_header(equiv_kind_anonymous_array_double_3, element_flags_anonymous_array_double_3);
|
||||
{
|
||||
SBoundSeq array_bound_seq;
|
||||
TypeObjectUtils::add_array_dimension(array_bound_seq, static_cast<SBound>(3));
|
||||
|
||||
PlainArraySElemDefn array_sdefn = TypeObjectUtils::build_plain_array_s_elem_defn(header_anonymous_array_double_3, array_bound_seq,
|
||||
eprosima::fastcdr::external<TypeIdentifier>(element_identifier_anonymous_array_double_3));
|
||||
if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER ==
|
||||
TypeObjectUtils::build_and_register_s_array_type_identifier(array_sdefn, "anonymous_array_double_3", type_ids_l_04_i_gdcomac_gsteer_f8))
|
||||
{
|
||||
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
|
||||
"anonymous_array_double_3 already registered in TypeObjectRegistry for a different type.");
|
||||
}
|
||||
}
|
||||
}
|
||||
StructMemberFlag member_flags_l_04_i_gdcomac_gsteer_f8 = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD,
|
||||
true, false, false, false);
|
||||
@ -9927,6 +9961,222 @@ void register_WeightBalance_output_type_identifier(
|
||||
}
|
||||
}
|
||||
}
|
||||
// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method
|
||||
void register_GroundHandling_heartbeat_type_identifier(
|
||||
TypeIdentifierPair& type_ids_GroundHandling_heartbeat)
|
||||
{
|
||||
|
||||
ReturnCode_t return_code_GroundHandling_heartbeat {eprosima::fastdds::dds::RETCODE_OK};
|
||||
return_code_GroundHandling_heartbeat =
|
||||
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
|
||||
"XNSim::C909::ATA04::GroundHandling_heartbeat", type_ids_GroundHandling_heartbeat);
|
||||
if (eprosima::fastdds::dds::RETCODE_OK != return_code_GroundHandling_heartbeat)
|
||||
{
|
||||
StructTypeFlag struct_flags_GroundHandling_heartbeat = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE,
|
||||
false, false);
|
||||
QualifiedTypeName type_name_GroundHandling_heartbeat = "XNSim::C909::ATA04::GroundHandling_heartbeat";
|
||||
eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_GroundHandling_heartbeat;
|
||||
eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_GroundHandling_heartbeat;
|
||||
CompleteTypeDetail detail_GroundHandling_heartbeat = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GroundHandling_heartbeat, ann_custom_GroundHandling_heartbeat, type_name_GroundHandling_heartbeat.to_string());
|
||||
CompleteStructHeader header_GroundHandling_heartbeat;
|
||||
header_GroundHandling_heartbeat = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_GroundHandling_heartbeat);
|
||||
CompleteStructMemberSeq member_seq_GroundHandling_heartbeat;
|
||||
{
|
||||
TypeIdentifierPair type_ids_groundhandling_model_heartbeat;
|
||||
ReturnCode_t return_code_groundhandling_model_heartbeat {eprosima::fastdds::dds::RETCODE_OK};
|
||||
return_code_groundhandling_model_heartbeat =
|
||||
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
|
||||
"_int32_t", type_ids_groundhandling_model_heartbeat);
|
||||
|
||||
if (eprosima::fastdds::dds::RETCODE_OK != return_code_groundhandling_model_heartbeat)
|
||||
{
|
||||
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
|
||||
"groundhandling_model_heartbeat Structure member TypeIdentifier unknown to TypeObjectRegistry.");
|
||||
return;
|
||||
}
|
||||
StructMemberFlag member_flags_groundhandling_model_heartbeat = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD,
|
||||
true, false, false, false);
|
||||
MemberId member_id_groundhandling_model_heartbeat = 0x00000000;
|
||||
bool common_groundhandling_model_heartbeat_ec {false};
|
||||
CommonStructMember common_groundhandling_model_heartbeat {TypeObjectUtils::build_common_struct_member(member_id_groundhandling_model_heartbeat, member_flags_groundhandling_model_heartbeat, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_groundhandling_model_heartbeat, common_groundhandling_model_heartbeat_ec))};
|
||||
if (!common_groundhandling_model_heartbeat_ec)
|
||||
{
|
||||
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure groundhandling_model_heartbeat member TypeIdentifier inconsistent.");
|
||||
return;
|
||||
}
|
||||
MemberName name_groundhandling_model_heartbeat = "groundhandling_model_heartbeat";
|
||||
eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_groundhandling_model_heartbeat;
|
||||
ann_custom_GroundHandling_heartbeat.reset();
|
||||
AppliedAnnotationSeq tmp_ann_custom_groundhandling_model_heartbeat;
|
||||
eprosima::fastcdr::optional<std::string> unit_groundhandling_model_heartbeat;
|
||||
eprosima::fastcdr::optional<AnnotationParameterValue> min_groundhandling_model_heartbeat;
|
||||
eprosima::fastcdr::optional<AnnotationParameterValue> max_groundhandling_model_heartbeat;
|
||||
eprosima::fastcdr::optional<std::string> hash_id_groundhandling_model_heartbeat;
|
||||
if (unit_groundhandling_model_heartbeat.has_value() || min_groundhandling_model_heartbeat.has_value() || max_groundhandling_model_heartbeat.has_value() || hash_id_groundhandling_model_heartbeat.has_value())
|
||||
{
|
||||
member_ann_builtin_groundhandling_model_heartbeat = TypeObjectUtils::build_applied_builtin_member_annotations(unit_groundhandling_model_heartbeat, min_groundhandling_model_heartbeat, max_groundhandling_model_heartbeat, hash_id_groundhandling_model_heartbeat);
|
||||
}
|
||||
if (!tmp_ann_custom_groundhandling_model_heartbeat.empty())
|
||||
{
|
||||
ann_custom_GroundHandling_heartbeat = tmp_ann_custom_groundhandling_model_heartbeat;
|
||||
}
|
||||
CompleteMemberDetail detail_groundhandling_model_heartbeat = TypeObjectUtils::build_complete_member_detail(name_groundhandling_model_heartbeat, member_ann_builtin_groundhandling_model_heartbeat, ann_custom_GroundHandling_heartbeat);
|
||||
CompleteStructMember member_groundhandling_model_heartbeat = TypeObjectUtils::build_complete_struct_member(common_groundhandling_model_heartbeat, detail_groundhandling_model_heartbeat);
|
||||
TypeObjectUtils::add_complete_struct_member(member_seq_GroundHandling_heartbeat, member_groundhandling_model_heartbeat);
|
||||
}
|
||||
CompleteStructType struct_type_GroundHandling_heartbeat = TypeObjectUtils::build_complete_struct_type(struct_flags_GroundHandling_heartbeat, header_GroundHandling_heartbeat, member_seq_GroundHandling_heartbeat);
|
||||
if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER ==
|
||||
TypeObjectUtils::build_and_register_struct_type_object(struct_type_GroundHandling_heartbeat, type_name_GroundHandling_heartbeat.to_string(), type_ids_GroundHandling_heartbeat))
|
||||
{
|
||||
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
|
||||
"XNSim::C909::ATA04::GroundHandling_heartbeat already registered in TypeObjectRegistry for a different type.");
|
||||
}
|
||||
}
|
||||
}
|
||||
// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method
|
||||
void register_WeightBalance_heartbeat_type_identifier(
|
||||
TypeIdentifierPair& type_ids_WeightBalance_heartbeat)
|
||||
{
|
||||
|
||||
ReturnCode_t return_code_WeightBalance_heartbeat {eprosima::fastdds::dds::RETCODE_OK};
|
||||
return_code_WeightBalance_heartbeat =
|
||||
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
|
||||
"XNSim::C909::ATA04::WeightBalance_heartbeat", type_ids_WeightBalance_heartbeat);
|
||||
if (eprosima::fastdds::dds::RETCODE_OK != return_code_WeightBalance_heartbeat)
|
||||
{
|
||||
StructTypeFlag struct_flags_WeightBalance_heartbeat = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE,
|
||||
false, false);
|
||||
QualifiedTypeName type_name_WeightBalance_heartbeat = "XNSim::C909::ATA04::WeightBalance_heartbeat";
|
||||
eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_WeightBalance_heartbeat;
|
||||
eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_WeightBalance_heartbeat;
|
||||
CompleteTypeDetail detail_WeightBalance_heartbeat = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_WeightBalance_heartbeat, ann_custom_WeightBalance_heartbeat, type_name_WeightBalance_heartbeat.to_string());
|
||||
CompleteStructHeader header_WeightBalance_heartbeat;
|
||||
header_WeightBalance_heartbeat = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_WeightBalance_heartbeat);
|
||||
CompleteStructMemberSeq member_seq_WeightBalance_heartbeat;
|
||||
{
|
||||
TypeIdentifierPair type_ids_weightbody_model_heartbeat;
|
||||
ReturnCode_t return_code_weightbody_model_heartbeat {eprosima::fastdds::dds::RETCODE_OK};
|
||||
return_code_weightbody_model_heartbeat =
|
||||
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
|
||||
"_int32_t", type_ids_weightbody_model_heartbeat);
|
||||
|
||||
if (eprosima::fastdds::dds::RETCODE_OK != return_code_weightbody_model_heartbeat)
|
||||
{
|
||||
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
|
||||
"weightbody_model_heartbeat Structure member TypeIdentifier unknown to TypeObjectRegistry.");
|
||||
return;
|
||||
}
|
||||
StructMemberFlag member_flags_weightbody_model_heartbeat = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD,
|
||||
true, false, false, false);
|
||||
MemberId member_id_weightbody_model_heartbeat = 0x00000000;
|
||||
bool common_weightbody_model_heartbeat_ec {false};
|
||||
CommonStructMember common_weightbody_model_heartbeat {TypeObjectUtils::build_common_struct_member(member_id_weightbody_model_heartbeat, member_flags_weightbody_model_heartbeat, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_weightbody_model_heartbeat, common_weightbody_model_heartbeat_ec))};
|
||||
if (!common_weightbody_model_heartbeat_ec)
|
||||
{
|
||||
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure weightbody_model_heartbeat member TypeIdentifier inconsistent.");
|
||||
return;
|
||||
}
|
||||
MemberName name_weightbody_model_heartbeat = "weightbody_model_heartbeat";
|
||||
eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_weightbody_model_heartbeat;
|
||||
ann_custom_WeightBalance_heartbeat.reset();
|
||||
AppliedAnnotationSeq tmp_ann_custom_weightbody_model_heartbeat;
|
||||
eprosima::fastcdr::optional<std::string> unit_weightbody_model_heartbeat;
|
||||
eprosima::fastcdr::optional<AnnotationParameterValue> min_weightbody_model_heartbeat;
|
||||
eprosima::fastcdr::optional<AnnotationParameterValue> max_weightbody_model_heartbeat;
|
||||
eprosima::fastcdr::optional<std::string> hash_id_weightbody_model_heartbeat;
|
||||
if (unit_weightbody_model_heartbeat.has_value() || min_weightbody_model_heartbeat.has_value() || max_weightbody_model_heartbeat.has_value() || hash_id_weightbody_model_heartbeat.has_value())
|
||||
{
|
||||
member_ann_builtin_weightbody_model_heartbeat = TypeObjectUtils::build_applied_builtin_member_annotations(unit_weightbody_model_heartbeat, min_weightbody_model_heartbeat, max_weightbody_model_heartbeat, hash_id_weightbody_model_heartbeat);
|
||||
}
|
||||
if (!tmp_ann_custom_weightbody_model_heartbeat.empty())
|
||||
{
|
||||
ann_custom_WeightBalance_heartbeat = tmp_ann_custom_weightbody_model_heartbeat;
|
||||
}
|
||||
CompleteMemberDetail detail_weightbody_model_heartbeat = TypeObjectUtils::build_complete_member_detail(name_weightbody_model_heartbeat, member_ann_builtin_weightbody_model_heartbeat, ann_custom_WeightBalance_heartbeat);
|
||||
CompleteStructMember member_weightbody_model_heartbeat = TypeObjectUtils::build_complete_struct_member(common_weightbody_model_heartbeat, detail_weightbody_model_heartbeat);
|
||||
TypeObjectUtils::add_complete_struct_member(member_seq_WeightBalance_heartbeat, member_weightbody_model_heartbeat);
|
||||
}
|
||||
CompleteStructType struct_type_WeightBalance_heartbeat = TypeObjectUtils::build_complete_struct_type(struct_flags_WeightBalance_heartbeat, header_WeightBalance_heartbeat, member_seq_WeightBalance_heartbeat);
|
||||
if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER ==
|
||||
TypeObjectUtils::build_and_register_struct_type_object(struct_type_WeightBalance_heartbeat, type_name_WeightBalance_heartbeat.to_string(), type_ids_WeightBalance_heartbeat))
|
||||
{
|
||||
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
|
||||
"XNSim::C909::ATA04::WeightBalance_heartbeat already registered in TypeObjectRegistry for a different type.");
|
||||
}
|
||||
}
|
||||
}
|
||||
// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method
|
||||
void register_Aerodynamics_heartbeat_type_identifier(
|
||||
TypeIdentifierPair& type_ids_Aerodynamics_heartbeat)
|
||||
{
|
||||
|
||||
ReturnCode_t return_code_Aerodynamics_heartbeat {eprosima::fastdds::dds::RETCODE_OK};
|
||||
return_code_Aerodynamics_heartbeat =
|
||||
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
|
||||
"XNSim::C909::ATA04::Aerodynamics_heartbeat", type_ids_Aerodynamics_heartbeat);
|
||||
if (eprosima::fastdds::dds::RETCODE_OK != return_code_Aerodynamics_heartbeat)
|
||||
{
|
||||
StructTypeFlag struct_flags_Aerodynamics_heartbeat = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE,
|
||||
false, false);
|
||||
QualifiedTypeName type_name_Aerodynamics_heartbeat = "XNSim::C909::ATA04::Aerodynamics_heartbeat";
|
||||
eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_Aerodynamics_heartbeat;
|
||||
eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_Aerodynamics_heartbeat;
|
||||
CompleteTypeDetail detail_Aerodynamics_heartbeat = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_Aerodynamics_heartbeat, ann_custom_Aerodynamics_heartbeat, type_name_Aerodynamics_heartbeat.to_string());
|
||||
CompleteStructHeader header_Aerodynamics_heartbeat;
|
||||
header_Aerodynamics_heartbeat = TypeObjectUtils::build_complete_struct_header(TypeIdentifier(), detail_Aerodynamics_heartbeat);
|
||||
CompleteStructMemberSeq member_seq_Aerodynamics_heartbeat;
|
||||
{
|
||||
TypeIdentifierPair type_ids_aero_model_heartbeat;
|
||||
ReturnCode_t return_code_aero_model_heartbeat {eprosima::fastdds::dds::RETCODE_OK};
|
||||
return_code_aero_model_heartbeat =
|
||||
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
|
||||
"_int32_t", type_ids_aero_model_heartbeat);
|
||||
|
||||
if (eprosima::fastdds::dds::RETCODE_OK != return_code_aero_model_heartbeat)
|
||||
{
|
||||
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
|
||||
"aero_model_heartbeat Structure member TypeIdentifier unknown to TypeObjectRegistry.");
|
||||
return;
|
||||
}
|
||||
StructMemberFlag member_flags_aero_model_heartbeat = TypeObjectUtils::build_struct_member_flag(eprosima::fastdds::dds::xtypes::TryConstructFailAction::DISCARD,
|
||||
true, false, false, false);
|
||||
MemberId member_id_aero_model_heartbeat = 0x00000000;
|
||||
bool common_aero_model_heartbeat_ec {false};
|
||||
CommonStructMember common_aero_model_heartbeat {TypeObjectUtils::build_common_struct_member(member_id_aero_model_heartbeat, member_flags_aero_model_heartbeat, TypeObjectUtils::retrieve_complete_type_identifier(type_ids_aero_model_heartbeat, common_aero_model_heartbeat_ec))};
|
||||
if (!common_aero_model_heartbeat_ec)
|
||||
{
|
||||
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, "Structure aero_model_heartbeat member TypeIdentifier inconsistent.");
|
||||
return;
|
||||
}
|
||||
MemberName name_aero_model_heartbeat = "aero_model_heartbeat";
|
||||
eprosima::fastcdr::optional<AppliedBuiltinMemberAnnotations> member_ann_builtin_aero_model_heartbeat;
|
||||
ann_custom_Aerodynamics_heartbeat.reset();
|
||||
AppliedAnnotationSeq tmp_ann_custom_aero_model_heartbeat;
|
||||
eprosima::fastcdr::optional<std::string> unit_aero_model_heartbeat;
|
||||
eprosima::fastcdr::optional<AnnotationParameterValue> min_aero_model_heartbeat;
|
||||
eprosima::fastcdr::optional<AnnotationParameterValue> max_aero_model_heartbeat;
|
||||
eprosima::fastcdr::optional<std::string> hash_id_aero_model_heartbeat;
|
||||
if (unit_aero_model_heartbeat.has_value() || min_aero_model_heartbeat.has_value() || max_aero_model_heartbeat.has_value() || hash_id_aero_model_heartbeat.has_value())
|
||||
{
|
||||
member_ann_builtin_aero_model_heartbeat = TypeObjectUtils::build_applied_builtin_member_annotations(unit_aero_model_heartbeat, min_aero_model_heartbeat, max_aero_model_heartbeat, hash_id_aero_model_heartbeat);
|
||||
}
|
||||
if (!tmp_ann_custom_aero_model_heartbeat.empty())
|
||||
{
|
||||
ann_custom_Aerodynamics_heartbeat = tmp_ann_custom_aero_model_heartbeat;
|
||||
}
|
||||
CompleteMemberDetail detail_aero_model_heartbeat = TypeObjectUtils::build_complete_member_detail(name_aero_model_heartbeat, member_ann_builtin_aero_model_heartbeat, ann_custom_Aerodynamics_heartbeat);
|
||||
CompleteStructMember member_aero_model_heartbeat = TypeObjectUtils::build_complete_struct_member(common_aero_model_heartbeat, detail_aero_model_heartbeat);
|
||||
TypeObjectUtils::add_complete_struct_member(member_seq_Aerodynamics_heartbeat, member_aero_model_heartbeat);
|
||||
}
|
||||
CompleteStructType struct_type_Aerodynamics_heartbeat = TypeObjectUtils::build_complete_struct_type(struct_flags_Aerodynamics_heartbeat, header_Aerodynamics_heartbeat, member_seq_Aerodynamics_heartbeat);
|
||||
if (eprosima::fastdds::dds::RETCODE_BAD_PARAMETER ==
|
||||
TypeObjectUtils::build_and_register_struct_type_object(struct_type_Aerodynamics_heartbeat, type_name_Aerodynamics_heartbeat.to_string(), type_ids_Aerodynamics_heartbeat))
|
||||
{
|
||||
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
|
||||
"XNSim::C909::ATA04::Aerodynamics_heartbeat already registered in TypeObjectRegistry for a different type.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ATA04
|
||||
|
||||
|
@ -118,6 +118,45 @@ eProsima_user_DllExport void register_WeightBalance_input_type_identifier(
|
||||
eProsima_user_DllExport void register_WeightBalance_output_type_identifier(
|
||||
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
|
||||
|
||||
/**
|
||||
* @brief Register GroundHandling_heartbeat related TypeIdentifier.
|
||||
* Fully-descriptive TypeIdentifiers are directly registered.
|
||||
* Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is
|
||||
* indirectly registered as well.
|
||||
*
|
||||
* @param[out] TypeIdentifier of the registered type.
|
||||
* The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers.
|
||||
* Invalid TypeIdentifier is returned in case of error.
|
||||
*/
|
||||
eProsima_user_DllExport void register_GroundHandling_heartbeat_type_identifier(
|
||||
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
|
||||
|
||||
/**
|
||||
* @brief Register WeightBalance_heartbeat related TypeIdentifier.
|
||||
* Fully-descriptive TypeIdentifiers are directly registered.
|
||||
* Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is
|
||||
* indirectly registered as well.
|
||||
*
|
||||
* @param[out] TypeIdentifier of the registered type.
|
||||
* The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers.
|
||||
* Invalid TypeIdentifier is returned in case of error.
|
||||
*/
|
||||
eProsima_user_DllExport void register_WeightBalance_heartbeat_type_identifier(
|
||||
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
|
||||
|
||||
/**
|
||||
* @brief Register Aerodynamics_heartbeat related TypeIdentifier.
|
||||
* Fully-descriptive TypeIdentifiers are directly registered.
|
||||
* Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is
|
||||
* indirectly registered as well.
|
||||
*
|
||||
* @param[out] TypeIdentifier of the registered type.
|
||||
* The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers.
|
||||
* Invalid TypeIdentifier is returned in case of error.
|
||||
*/
|
||||
eProsima_user_DllExport void register_Aerodynamics_heartbeat_type_identifier(
|
||||
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
|
||||
|
||||
} // namespace ATA04
|
||||
|
||||
} // namespace C909
|
||||
|
@ -36,6 +36,12 @@ add_library(C909_V1_Interface SHARED
|
||||
ATA04/WeightBalance_input.cxx
|
||||
ATA04/WeightBalance_output.hpp
|
||||
ATA04/WeightBalance_output.cxx
|
||||
ATA04/GroundHandling_heartbeat.hpp
|
||||
ATA04/GroundHandling_heartbeat.cxx
|
||||
ATA04/WeightBalance_heartbeat.hpp
|
||||
ATA04/WeightBalance_heartbeat.cxx
|
||||
ATA04/Aerodynamics_heartbeat.hpp
|
||||
ATA04/Aerodynamics_heartbeat.cxx
|
||||
)
|
||||
target_link_libraries(C909_V1_Interface PRIVATE
|
||||
fastcdr fastdds OpenSSL::SSL OpenSSL::Crypto
|
||||
|
Binary file not shown.
@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scenario>
|
||||
<Environment OSName="Debian" Version="11" RTXVersion="preempt-rt" CPUAffinity="0,1" BaseFrequency="120" WorkPath="/home/jin/MyCode/XNSim/Release/" ModelsPath="Models/" ServicesPath="Services/" DomainID="10"/>
|
||||
<Environment OSName="Debian" Version="11" RTXVersion="preempt-rt" CPUAffinity="0,1" WorkPath="/home/jin/MyCode/XNSim/Release/" ModelsPath="Models/" ServicesPath="Services/" DomainID="10"/>
|
||||
<ConsoleOutput Debug="1" Info="1" Error="1" Warning="1"/>
|
||||
<Log Debug="0" Info="1" Error="1" Warning="1"/>
|
||||
<ModelGroup Name="本体模型组" FreqGroup="0" Priority="99" CPUAff="0">
|
||||
<ModelGroup Name="本体模型组" Freq="120" Priority="99" CPUAff="0">
|
||||
<Model Name="ATA04气动模型" ClassName="XNAerodynamics"/>
|
||||
<Model Name="ATA04地面操纵模型" ClassName="XNGroundHandling"/>
|
||||
<Model Name="ATA04质量模型" ClassName="XNWeightBalance"/>
|
||||
<!--Model Name="ATA04数据处理模型" ClassName="XNATA04DataProcessor"/-->
|
||||
<Model Name="ATA04数据处理模型" ClassName="XNATA04DataProcessor"/>
|
||||
</ModelGroup>
|
||||
<ServicesList>
|
||||
<Service Name="UDP通信服务" ClassName="XNUDPService"/>
|
||||
|
Binary file not shown.
@ -86,20 +86,26 @@ protected:
|
||||
* @param byteArray: 字节数组
|
||||
*/
|
||||
template <typename T>
|
||||
void setByteArray(eprosima::fastcdr::optional<T> &data, const XNByteArray &byteArray)
|
||||
void setByteArray(eprosima::fastcdr::optional<T> &data, const XNByteArray &byteArray,
|
||||
uint32_t &pos)
|
||||
{
|
||||
if (byteArray.size() < getTypeSize<T>())
|
||||
uint32_t thisSize = getTypeSize<T>();
|
||||
XNByteArray thisArray(thisSize);
|
||||
if (pos + thisSize > byteArray.size()) {
|
||||
return;
|
||||
}
|
||||
std::memcpy(thisArray.data(), byteArray.data() + pos, thisSize);
|
||||
pos += thisSize;
|
||||
|
||||
if constexpr (std::is_arithmetic_v<T>) {
|
||||
T temp;
|
||||
std::memcpy(&temp, byteArray.data(), sizeof(T));
|
||||
std::memcpy(&temp, thisArray.data(), sizeof(T));
|
||||
data = temp;
|
||||
} else if constexpr (is_std_array_v<T>) {
|
||||
if (!data) {
|
||||
data = T{};
|
||||
}
|
||||
setByteArrayFromStdArray(data.value(), byteArray);
|
||||
setByteArrayFromStdArray(data.value(), thisArray);
|
||||
} else {
|
||||
static_assert(std::is_arithmetic_v<T> || is_std_array_v<T>,
|
||||
"Type must be arithmetic or std::array");
|
||||
@ -311,21 +317,12 @@ protected:
|
||||
virtual void sendOutData() {}
|
||||
|
||||
protected:
|
||||
struct GetByteArrayFunc {
|
||||
std::function<XNByteArray(void)> func;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
struct SetByteArrayFunc {
|
||||
std::function<void(XNByteArray)> func;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
std::unordered_map<std::string, std::function<std::string()>> getDataFunction;
|
||||
std::unordered_map<std::string, std::function<void(std::string)>> setDataFunction;
|
||||
std::vector<GetByteArrayFunc> getByteArrayFunction;
|
||||
std::unordered_map<std::string, SetByteArrayFunc> setByteArrayFunction;
|
||||
std::mutex mutex;
|
||||
std::vector<std::function<XNByteArray(void)>> getByteArrayFunction;
|
||||
std::vector<std::function<void(XNByteArray, uint32_t &)>> setByteArrayFunction;
|
||||
std::mutex dataMutex;
|
||||
std::mutex outDataMutex;
|
||||
uint8_t header[8]{0}; // 固定大小的头部
|
||||
size_t headerSize = 8;
|
||||
FAST_DDS_MACRO::DataWriter *dataWriter;
|
||||
@ -336,8 +333,7 @@ protected:
|
||||
setDataFunction[#NAME] = [this](std::string value) { \
|
||||
setDataFromString(out_data.NAME(), value); \
|
||||
}; \
|
||||
getByteArrayFunction.push_back( \
|
||||
{[this]() { return getByteArray(data.NAME()); }, getTypeSize<decltype(data.NAME())>()}); \
|
||||
setByteArrayFunction[#NAME] = { \
|
||||
[this](XNByteArray byteArray) { setByteArray(out_data.NAME(), byteArray); }, \
|
||||
getTypeSize<decltype(out_data.NAME())>()};
|
||||
getByteArrayFunction.push_back([this]() { return getByteArray(data.NAME()); }); \
|
||||
setByteArrayFunction.push_back([this](XNByteArray byteArray, uint32_t &pos) { \
|
||||
setByteArray(out_data.NAME(), byteArray, pos); \
|
||||
});
|
||||
|
@ -15,12 +15,17 @@ XNByteArray XNDDSInterface::getUDPPackage()
|
||||
currentPos = headerSize;
|
||||
|
||||
// 复制数据
|
||||
for (auto func : getByteArrayFunction) {
|
||||
if (currentPos + func.size <= MAX_UDP_PACKET_SIZE) {
|
||||
result.append(func.func());
|
||||
currentPos += func.size;
|
||||
} else {
|
||||
break; // 超出最大包大小
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(dataMutex);
|
||||
for (auto func : getByteArrayFunction) {
|
||||
XNByteArray byteArray = func();
|
||||
size_t byteArraySize = byteArray.size();
|
||||
if (currentPos + byteArraySize <= MAX_UDP_PACKET_SIZE) {
|
||||
result.append(byteArray);
|
||||
currentPos += byteArraySize; // 使用实际返回的字节数组大小
|
||||
} else {
|
||||
break; // 超出最大包大小
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,7 +40,6 @@ XNByteArray XNDDSInterface::getUDPPackage()
|
||||
|
||||
void XNDDSInterface::setDataByUDPPackage(const XNByteArray &package)
|
||||
{
|
||||
clearOutData();
|
||||
if (package.size() < headerSize) {
|
||||
return;
|
||||
}
|
||||
@ -46,19 +50,14 @@ void XNDDSInterface::setDataByUDPPackage(const XNByteArray &package)
|
||||
return;
|
||||
}
|
||||
|
||||
size_t currentPos = 8;
|
||||
uint32_t currentPos = 8;
|
||||
|
||||
// 获取数据
|
||||
for (auto func : setByteArrayFunction) {
|
||||
if (currentPos + func.second.size <= packageSize) {
|
||||
XNByteArray byteArray(func.second.size);
|
||||
for (size_t i = 0; i < func.second.size; i++) {
|
||||
byteArray[i] = package[currentPos + i];
|
||||
}
|
||||
func.second.func(byteArray);
|
||||
currentPos += func.second.size;
|
||||
} else {
|
||||
break;
|
||||
// 设置数据
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(outDataMutex);
|
||||
clearOutData();
|
||||
for (auto &func : setByteArrayFunction) {
|
||||
func(package, currentPos);
|
||||
}
|
||||
}
|
||||
sendOutData();
|
||||
@ -69,13 +68,15 @@ XNDDSInterface::getStringData(std::vector<std::string> varNames)
|
||||
{
|
||||
std::unordered_map<std::string, std::string> result;
|
||||
|
||||
std::lock_guard<std::mutex> lock(mutex);
|
||||
for (const auto &varName : varNames) {
|
||||
auto it = getDataFunction.find(varName);
|
||||
if (it == getDataFunction.end()) {
|
||||
continue;
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(dataMutex);
|
||||
for (const auto &varName : varNames) {
|
||||
auto it = getDataFunction.find(varName);
|
||||
if (it == getDataFunction.end()) {
|
||||
continue;
|
||||
}
|
||||
result[varName] = it->second();
|
||||
}
|
||||
result[varName] = it->second();
|
||||
}
|
||||
|
||||
return result;
|
||||
@ -83,6 +84,7 @@ XNDDSInterface::getStringData(std::vector<std::string> varNames)
|
||||
|
||||
void XNDDSInterface::setDataByString(std::unordered_map<std::string, std::string> data)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(outDataMutex);
|
||||
clearOutData();
|
||||
for (const auto &[varName, value] : data) {
|
||||
auto it = setDataFunction.find(varName);
|
||||
|
@ -86,20 +86,26 @@ protected:
|
||||
* @param byteArray: 字节数组
|
||||
*/
|
||||
template <typename T>
|
||||
void setByteArray(eprosima::fastcdr::optional<T> &data, const XNByteArray &byteArray)
|
||||
void setByteArray(eprosima::fastcdr::optional<T> &data, const XNByteArray &byteArray,
|
||||
uint32_t &pos)
|
||||
{
|
||||
if (byteArray.size() < getTypeSize<T>())
|
||||
uint32_t thisSize = getTypeSize<T>();
|
||||
XNByteArray thisArray(thisSize);
|
||||
if (pos + thisSize > byteArray.size()) {
|
||||
return;
|
||||
}
|
||||
std::memcpy(thisArray.data(), byteArray.data() + pos, thisSize);
|
||||
pos += thisSize;
|
||||
|
||||
if constexpr (std::is_arithmetic_v<T>) {
|
||||
T temp;
|
||||
std::memcpy(&temp, byteArray.data(), sizeof(T));
|
||||
std::memcpy(&temp, thisArray.data(), sizeof(T));
|
||||
data = temp;
|
||||
} else if constexpr (is_std_array_v<T>) {
|
||||
if (!data) {
|
||||
data = T{};
|
||||
}
|
||||
setByteArrayFromStdArray(data.value(), byteArray);
|
||||
setByteArrayFromStdArray(data.value(), thisArray);
|
||||
} else {
|
||||
static_assert(std::is_arithmetic_v<T> || is_std_array_v<T>,
|
||||
"Type must be arithmetic or std::array");
|
||||
@ -311,21 +317,12 @@ protected:
|
||||
virtual void sendOutData() {}
|
||||
|
||||
protected:
|
||||
struct GetByteArrayFunc {
|
||||
std::function<XNByteArray(void)> func;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
struct SetByteArrayFunc {
|
||||
std::function<void(XNByteArray)> func;
|
||||
size_t size;
|
||||
};
|
||||
|
||||
std::unordered_map<std::string, std::function<std::string()>> getDataFunction;
|
||||
std::unordered_map<std::string, std::function<void(std::string)>> setDataFunction;
|
||||
std::vector<GetByteArrayFunc> getByteArrayFunction;
|
||||
std::unordered_map<std::string, SetByteArrayFunc> setByteArrayFunction;
|
||||
std::mutex mutex;
|
||||
std::vector<std::function<XNByteArray(void)>> getByteArrayFunction;
|
||||
std::vector<std::function<void(XNByteArray, uint32_t &)>> setByteArrayFunction;
|
||||
std::mutex dataMutex;
|
||||
std::mutex outDataMutex;
|
||||
uint8_t header[8]{0}; // 固定大小的头部
|
||||
size_t headerSize = 8;
|
||||
FAST_DDS_MACRO::DataWriter *dataWriter;
|
||||
@ -336,8 +333,7 @@ protected:
|
||||
setDataFunction[#NAME] = [this](std::string value) { \
|
||||
setDataFromString(out_data.NAME(), value); \
|
||||
}; \
|
||||
getByteArrayFunction.push_back( \
|
||||
{[this]() { return getByteArray(data.NAME()); }, getTypeSize<decltype(data.NAME())>()}); \
|
||||
setByteArrayFunction[#NAME] = { \
|
||||
[this](XNByteArray byteArray) { setByteArray(out_data.NAME(), byteArray); }, \
|
||||
getTypeSize<decltype(out_data.NAME())>()};
|
||||
getByteArrayFunction.push_back([this]() { return getByteArray(data.NAME()); }); \
|
||||
setByteArrayFunction.push_back([this](XNByteArray byteArray, uint32_t &pos) { \
|
||||
setByteArray(out_data.NAME(), byteArray, pos); \
|
||||
});
|
||||
|
3
XNInterfaceGenServer/.vscode/settings.json
vendored
3
XNInterfaceGenServer/.vscode/settings.json
vendored
@ -52,6 +52,7 @@
|
||||
"stdexcept": "cpp",
|
||||
"streambuf": "cpp",
|
||||
"typeinfo": "cpp",
|
||||
"cstring": "cpp"
|
||||
"cstring": "cpp",
|
||||
"iostream": "cpp"
|
||||
}
|
||||
}
|
||||
|
@ -65,6 +65,7 @@ bool DDSInterfaceGen::generateDDSInterfaceHpp(const std::string &nameSpace,
|
||||
hppFile << "\t" << "template <typename T>" << std::endl;
|
||||
hppFile << "\t" << "void getData(T *model_data)" << std::endl;
|
||||
hppFile << "\t" << "{" << std::endl;
|
||||
hppFile << "\t\t" << "std::lock_guard<std::mutex> lock(dataMutex);" << std::endl;
|
||||
hppFile << "\t\t" << "if(model_data == nullptr)" << std::endl;
|
||||
hppFile << "\t\t\t" << "return;" << std::endl;
|
||||
for (const auto &interface : interfaceData) {
|
||||
@ -78,10 +79,11 @@ bool DDSInterfaceGen::generateDDSInterfaceHpp(const std::string &nameSpace,
|
||||
hppFile << "\t" << "{" << std::endl;
|
||||
hppFile << "\t\t" << "if(model_data == nullptr)" << std::endl;
|
||||
hppFile << "\t\t\t" << "return;" << std::endl;
|
||||
hppFile << "\t\t" << "std::lock_guard<std::mutex> lock(outDataMutex);" << std::endl;
|
||||
hppFile << "\t\t" << "clearOutData();" << std::endl;
|
||||
for (const auto &interface : interfaceData) {
|
||||
hppFile << "\t\t" << "assign_value_set(data." << interface.interfaceName
|
||||
<< "(), model_data->" << structName << ");" << std::endl;
|
||||
<< "(), model_data->" << interface.interfaceName << ");" << std::endl;
|
||||
}
|
||||
hppFile << "\t" << "}" << std::endl;
|
||||
// 11. 写入私有成员变量
|
||||
@ -116,15 +118,6 @@ bool DDSInterfaceGen::generateDDSInterfaceCxx(const std::string &nameSpace,
|
||||
for (const auto &interface : interfaceData) {
|
||||
cxxFile << "\t" << "MAP_DATA_FUNC(" << interface.interfaceName << ");" << std::endl;
|
||||
}
|
||||
//TODO 这里先待定
|
||||
cxxFile << "\t" << "this->header[0] = 0xa6; // XNSim头,0xa6" << std::endl;
|
||||
cxxFile << "\t" << "this->header[1] = 0xc0; // 机型头,0xc0表示C909" << std::endl;
|
||||
cxxFile << "\t" << "this->header[2] = 0x04; // 章节头,0x04表示ATA04" << std::endl;
|
||||
cxxFile << "\t" << "this->header[3] = 0x01; // 模型头,0x01表示GroundHandling" << std::endl;
|
||||
cxxFile << "\t" << "this->header[4] = 0x00; // 结构体头,0x00表示输入结构体" << std::endl;
|
||||
cxxFile << "\t" << "this->header[5] = 0x00; // 数据方向,0x00表示外部输入" << std::endl;
|
||||
cxxFile << "\t" << "this->header[6] = 0x00; // 数据大小" << std::endl;
|
||||
cxxFile << "\t" << "this->header[7] = 0x00; // 数据大小" << std::endl;
|
||||
cxxFile << "}" << std::endl;
|
||||
// 4. 写入类析构函数实现
|
||||
cxxFile << className << "::~" << className << "()" << std::endl;
|
||||
|
@ -67,6 +67,12 @@
|
||||
"cinttypes": "cpp",
|
||||
"typeindex": "cpp",
|
||||
"typeinfo": "cpp",
|
||||
"variant": "cpp"
|
||||
"variant": "cpp",
|
||||
"csignal": "cpp",
|
||||
"any": "cpp",
|
||||
"unordered_set": "cpp",
|
||||
"fstream": "cpp",
|
||||
"future": "cpp",
|
||||
"span": "cpp"
|
||||
}
|
||||
}
|
@ -14,6 +14,7 @@ endif()
|
||||
|
||||
# 添加 XNCore_PATH 下的 include 目录为包含目录
|
||||
include_directories(${XNCore_PATH}/include)
|
||||
include_directories(${XNCore_PATH}/IDL)
|
||||
|
||||
add_library(XNATA04DataProcessor SHARED
|
||||
XNATA04DataProcessor_global.h
|
||||
@ -24,9 +25,7 @@ add_library(XNATA04DataProcessor SHARED
|
||||
|
||||
target_link_libraries(XNATA04DataProcessor PRIVATE
|
||||
${XNCore_PATH}/lib/libXNCore.so
|
||||
${XNCore_PATH}/Models/libXNAerodynamicsInterface.so
|
||||
${XNCore_PATH}/Models/libXNGroundHandlingInterface.so
|
||||
${XNCore_PATH}/Models/libXNWeightBalanceInterface.so
|
||||
${XNCore_PATH}/lib/libC909_V1_Interface.so
|
||||
)
|
||||
|
||||
target_compile_definitions(XNATA04DataProcessor PRIVATE XNATA04DATAPROCESSOR_LIBRARY)
|
||||
|
@ -28,12 +28,18 @@ void XNATA04DataProcessor::PrepareForExecute()
|
||||
{
|
||||
T_D();
|
||||
XNModelObject::PrepareForExecute();
|
||||
// RegisterRTEventHandler("ATA04AeroInput", std::bind(&XNATA04DataProcessor::OnAeroInput, this,
|
||||
// std::placeholders::_1));
|
||||
// RegisterRTEventHandler(
|
||||
// "ATA04WbInput", std::bind(&XNATA04DataProcessor::OnWbInput, this, std::placeholders::_1));
|
||||
RegisterRTEventHandler(
|
||||
"ATA04GhInput", std::bind(&XNATA04DataProcessor::OnGhInput, this, std::placeholders::_1));
|
||||
RegisterRTEventHandler("C909::ATA04::AeroInput", std::bind(&XNATA04DataProcessor::OnAeroInput,
|
||||
this, std::placeholders::_1));
|
||||
RegisterRTEventHandler("C909::ATA04::WbInput", std::bind(&XNATA04DataProcessor::OnWbInput, this,
|
||||
std::placeholders::_1));
|
||||
RegisterRTEventHandler("C909::ATA04::GhInput", std::bind(&XNATA04DataProcessor::OnGhInput, this,
|
||||
std::placeholders::_1));
|
||||
d->_aeroInputInterface.Initialize(GetFramework(), GetUniqueId(), 2);
|
||||
d->_aeroOutputInterface.Initialize(GetFramework(), GetUniqueId(), 1);
|
||||
d->_aeroHeartbeatInterface.Initialize(GetFramework(), GetUniqueId(), 1);
|
||||
d->_wbInputInterface.Initialize(GetFramework(), GetUniqueId(), 2);
|
||||
d->_wbOutputInterface.Initialize(GetFramework(), GetUniqueId(), 1);
|
||||
d->_wbHeartbeatInterface.Initialize(GetFramework(), GetUniqueId(), 1);
|
||||
d->_ghInputInterface.Initialize(GetFramework(), GetUniqueId(), 2);
|
||||
d->_ghOutputInterface.Initialize(GetFramework(), GetUniqueId(), 1);
|
||||
d->_ghHeartbeatInterface.Initialize(GetFramework(), GetUniqueId(), 1);
|
||||
@ -50,548 +56,145 @@ void XNATA04DataProcessor::StepUpdate()
|
||||
void XNATA04DataProcessor::SendUdpData()
|
||||
{
|
||||
T_D();
|
||||
// SendAeroOutput();
|
||||
// SendWbOutput();
|
||||
SendAeroOutput();
|
||||
SendWbOutput();
|
||||
SendGhOutput();
|
||||
// SendAeroHeartbeat();
|
||||
// SendWbHeartbeat();
|
||||
SendAeroHeartbeat();
|
||||
SendWbHeartbeat();
|
||||
SendGhHeartbeat();
|
||||
}
|
||||
|
||||
// void XNATA04DataProcessor::SendAeroOutput()
|
||||
// {
|
||||
// T_D();
|
||||
// QMutexLocker locker(&d->_aeroOutputMutex);
|
||||
// QByteArray outputData;
|
||||
// QDataStream outputStream(&outputData, QIODevice::WriteOnly);
|
||||
// outputStream.setByteOrder(QDataStream::LittleEndian);
|
||||
// quint8 header[6] = {0x0a, 0x04, 0x00, 0x01, 0x00, 0x00}; // 最后两个字节用于大小
|
||||
// outputStream << header[0] << header[1] << header[2] << header[3] << header[4] << header[5];
|
||||
// //outputData.append(getQByteArray(d->_aeroOutput.l_04_o_aerocomac_fxb_f8()));
|
||||
// if (d->_aeroOutput.l_04_o_aerocomac_fxb_f8()) {
|
||||
// outputStream << d->_aeroOutput.l_04_o_aerocomac_fxb_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_aeroOutput.l_04_o_aerocomac_fyb_f8()) {
|
||||
// outputStream << d->_aeroOutput.l_04_o_aerocomac_fyb_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_aeroOutput.l_04_o_aerocomac_fzb_f8()) {
|
||||
// outputStream << d->_aeroOutput.l_04_o_aerocomac_fzb_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_aeroOutput.l_04_o_aerocomac_mxb_f8()) {
|
||||
// outputStream << d->_aeroOutput.l_04_o_aerocomac_mxb_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_aeroOutput.l_04_o_aerocomac_myb_f8()) {
|
||||
// outputStream << d->_aeroOutput.l_04_o_aerocomac_myb_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_aeroOutput.l_04_o_aerocomac_mzb_f8()) {
|
||||
// outputStream << d->_aeroOutput.l_04_o_aerocomac_mzb_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_aeroOutput.l_04_o_aerocomac_cls_f8()) {
|
||||
// outputStream << d->_aeroOutput.l_04_o_aerocomac_cls_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_aeroOutput.l_04_o_aerocomac_cl_f8()) {
|
||||
// outputStream << d->_aeroOutput.l_04_o_aerocomac_cl_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_aeroOutput.l_04_o_aerocomac_cd_f8()) {
|
||||
// outputStream << d->_aeroOutput.l_04_o_aerocomac_cd_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_aeroOutput.l_04_o_aerocomac_cm_f8()) {
|
||||
// outputStream << d->_aeroOutput.l_04_o_aerocomac_cm_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_aeroOutput.l_04_o_aerocomac_cr_f8()) {
|
||||
// outputStream << d->_aeroOutput.l_04_o_aerocomac_cr_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_aeroOutput.l_04_o_aerocomac_cy_f8()) {
|
||||
// outputStream << d->_aeroOutput.l_04_o_aerocomac_cy_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
void XNATA04DataProcessor::SendAeroOutput()
|
||||
{
|
||||
T_D();
|
||||
XNByteArray outputData = d->_aeroOutputInterface.getUDPPackage();
|
||||
//填写数据头
|
||||
outputData[0] = 0xa6; //XNSim
|
||||
outputData[1] = 0xc0; //C909
|
||||
outputData[2] = 0x04; //ATA04
|
||||
outputData[3] = 0x00; //Aerodynamics
|
||||
outputData[4] = 0x01; //Output
|
||||
outputData[5] = 0x01; //向外部发送
|
||||
|
||||
// if (d->_aeroOutput.l_04_o_aerocomac_cn_f8()) {
|
||||
// outputStream << d->_aeroOutput.l_04_o_aerocomac_cn_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// // 更新数据包大小(使用两个字节)
|
||||
// auto size = outputData.size();
|
||||
// outputData[4] = (size >> 8) & 0xFF; // 高字节
|
||||
// outputData[5] = size & 0xFF; // 低字节
|
||||
int dataSize = (int)outputData[6] << 8 | (int)outputData[7];
|
||||
if (dataSize != outputData.size()) {
|
||||
LOG_WARNING("气动输出数据包大小错误,不向UDP发送!dataSize:%1 outputData.size():%2",
|
||||
dataSize, outputData.size());
|
||||
return;
|
||||
}
|
||||
|
||||
// TriggerRTEvent("SendUDPData", QVariant::fromValue(outputData));
|
||||
// }
|
||||
TriggerRTEvent("SendUDPData", std::any(outputData));
|
||||
}
|
||||
|
||||
void XNATA04DataProcessor::SendGhOutput()
|
||||
{
|
||||
T_D();
|
||||
XNByteArray outputData = d->_ghOutputInterface.getUDPPackage();
|
||||
//填写数据方向
|
||||
outputData[5] = 0x01;
|
||||
//填写数据头
|
||||
outputData[0] = 0xa6; //XNSim
|
||||
outputData[1] = 0xc0; //C909
|
||||
outputData[2] = 0x04; //ATA04
|
||||
outputData[3] = 0x01; //GroundHandling
|
||||
outputData[4] = 0x01; //Output
|
||||
outputData[5] = 0x01; //向外部发送
|
||||
|
||||
int dataSize = (long)outputData[6] << 8 | (long)outputData[7];
|
||||
if (dataSize != outputData.size()) {
|
||||
LOG_WARNING("地操输出数据包大小错误,不向UDP发送!dataSize:%1 outputData.size():%2",
|
||||
dataSize, outputData.size());
|
||||
return;
|
||||
}
|
||||
|
||||
TriggerRTEvent("SendUDPData", std::any(outputData));
|
||||
}
|
||||
|
||||
// void XNATA04DataProcessor::SendWbOutput()
|
||||
// {
|
||||
// Q_D(XNATA04DataProcessor);
|
||||
// QMutexLocker locker(&d->_wbOutputMutex);
|
||||
// QByteArray outputData;
|
||||
// QDataStream outputStream(&outputData, QIODevice::WriteOnly);
|
||||
// outputStream.setByteOrder(QDataStream::LittleEndian);
|
||||
// quint8 header[6] = {0x0a, 0x04, 0x02, 0x01, 0x00, 0x00}; // 最后两个字节用于大小
|
||||
// outputStream << header[0] << header[1] << header[2] << header[3] << header[4] << header[5];
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_gw_f4()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_gw_f4().value();
|
||||
// } else {
|
||||
// outputStream << (float)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_cg_f4()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_cg_f4().value();
|
||||
// } else {
|
||||
// outputStream << (float)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_xcg_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_xcg_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_blcg_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_blcg_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_bscg_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_bscg_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_wlcg_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_wlcg_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_ixx_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_ixx_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_iyy_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_iyy_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_izz_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_izz_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_ixy_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_ixy_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_ixz_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_ixz_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_iyz_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_iyz_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_zfw_f4()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_zfw_f4().value();
|
||||
// } else {
|
||||
// outputStream << (float)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_zfwcg_f4()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_zfwcg_f4().value();
|
||||
// } else {
|
||||
// outputStream << (float)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_zfw_blcg_f4()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_zfw_blcg_f4().value();
|
||||
// } else {
|
||||
// outputStream << (float)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_zfw_wlcg_f4()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_zfw_wlcg_f4().value();
|
||||
// } else {
|
||||
// outputStream << (float)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_fuel_cmd_f8()) {
|
||||
// for (int i = 0; i < 3; i++) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_fuel_cmd_f8().value()[i];
|
||||
// }
|
||||
// } else {
|
||||
// outputStream << (double)0 << (double)0 << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_fuel_mode_i4()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_fuel_mode_i4().value();
|
||||
// } else {
|
||||
// outputStream << (int)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_fuel_ixx_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_fuel_ixx_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_fuel_ixy_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_fuel_ixy_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_fuel_ixz_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_fuel_ixz_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_fuel_iyy_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_fuel_iyy_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_fuel_iyz_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_fuel_iyz_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_fuel_izz_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_fuel_izz_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_l_wt_fuel_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_l_wt_fuel_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_ice_airframe_total_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_ice_airframe_total_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_ice_eng_f8()) {
|
||||
// for (int i = 0; i < 2; i++) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_ice_eng_f8().value()[i];
|
||||
// }
|
||||
// } else {
|
||||
// outputStream << (double)0 << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_ice_eng_total_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_ice_eng_total_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_ice_fuselage_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_ice_fuselage_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_ice_stab_left_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_ice_stab_left_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_ice_stab_right_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_ice_stab_right_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_ice_stab_total_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_ice_stab_total_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_ice_total_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_ice_total_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_ice_total_frac_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_ice_total_frac_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_ice_vert_tail_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_ice_vert_tail_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_ice_wing_left_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_ice_wing_left_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_ice_wing_right_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_ice_wing_right_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_ice_wing_total_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_ice_wing_total_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_frz_l1()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_frz_l1().value();
|
||||
// } else {
|
||||
// outputStream << (quint8)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_zcgfrz_l1()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_zcgfrz_l1().value();
|
||||
// } else {
|
||||
// outputStream << (quint8)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_zcgfrz_grfx_l1()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_zcgfrz_grfx_l1().value();
|
||||
// } else {
|
||||
// outputStream << (quint8)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_ycgfrz_l1()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_ycgfrz_l1().value();
|
||||
// } else {
|
||||
// outputStream << (quint8)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_inertfrz_l1()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_inertfrz_l1().value();
|
||||
// } else {
|
||||
// outputStream << (quint8)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_init_l1()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_init_l1().value();
|
||||
// } else {
|
||||
// outputStream << (quint8)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_min_gw_f4()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_min_gw_f4().value();
|
||||
// } else {
|
||||
// outputStream << (float)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_max_gw_f4()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_max_gw_f4().value();
|
||||
// } else {
|
||||
// outputStream << (float)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_min_cg_f4()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_min_cg_f4().value();
|
||||
// } else {
|
||||
// outputStream << (float)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_max_cg_f4()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_max_cg_f4().value();
|
||||
// } else {
|
||||
// outputStream << (float)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_min_zfw_f4()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_min_zfw_f4().value();
|
||||
// } else {
|
||||
// outputStream << (float)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_max_zfw_f4()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_max_zfw_f4().value();
|
||||
// } else {
|
||||
// outputStream << (float)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_min_zfwcg_f4()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_min_zfwcg_f4().value();
|
||||
// } else {
|
||||
// outputStream << (float)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_max_zfwcg_f4()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_max_zfwcg_f4().value();
|
||||
// } else {
|
||||
// outputStream << (float)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_potmin_gw_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_potmin_gw_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_potmax_gw_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_potmax_gw_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_potmin_gwcg_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_potmin_gwcg_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// if (d->_wbOutput.l_04_o_wbcomac_potmax_gwcg_f8()) {
|
||||
// outputStream << d->_wbOutput.l_04_o_wbcomac_potmax_gwcg_f8().value();
|
||||
// } else {
|
||||
// outputStream << (double)0;
|
||||
// }
|
||||
// // 更新数据包大小(使用两个字节)
|
||||
// auto size = outputData.size();
|
||||
// outputData[4] = (size >> 8) & 0xFF; // 高字节
|
||||
// outputData[5] = size & 0xFF; // 低字节
|
||||
void XNATA04DataProcessor::SendWbOutput()
|
||||
{
|
||||
T_D();
|
||||
XNByteArray outputData = d->_wbOutputInterface.getUDPPackage();
|
||||
//填写数据头
|
||||
outputData[0] = 0xa6; //XNSim
|
||||
outputData[1] = 0xc0; //C909
|
||||
outputData[2] = 0x04; //ATA04
|
||||
outputData[3] = 0x02; //WeightBalance
|
||||
outputData[4] = 0x01; //Output
|
||||
outputData[5] = 0x01; //向外部发送
|
||||
|
||||
// TriggerRTEvent("SendUDPData", QVariant::fromValue(outputData));
|
||||
// }
|
||||
int dataSize = (long)outputData[6] << 8 | (long)outputData[7];
|
||||
if (dataSize != outputData.size()) {
|
||||
LOG_WARNING("质量输出数据包大小错误,不向UDP发送!dataSize:%1 outputData.size():%2",
|
||||
dataSize, outputData.size());
|
||||
return;
|
||||
}
|
||||
|
||||
// void XNATA04DataProcessor::SendAeroHeartbeat()
|
||||
// {
|
||||
// Q_D(XNATA04DataProcessor);
|
||||
// QMutexLocker locker(&d->_aeroHeartbeatMutex);
|
||||
// QByteArray heartbeatData;
|
||||
// QDataStream heartbeatStream(&heartbeatData, QIODevice::WriteOnly);
|
||||
// heartbeatStream.setByteOrder(QDataStream::LittleEndian);
|
||||
// quint8 header[6] = {0x0a, 0x04, 0x00, 0x02, 0x00, 0x00}; // 最后两个字节用于大小
|
||||
// heartbeatStream << header[0] << header[1] << header[2] << header[3] << header[4] << header[5];
|
||||
// heartbeatStream << d->_aeroHeartbeat.aero_model_heartbeat();
|
||||
// // 更新数据包大小(使用两个字节)
|
||||
// auto size = heartbeatData.size();
|
||||
// heartbeatData[4] = (size >> 8) & 0xFF; // 高字节
|
||||
// heartbeatData[5] = size & 0xFF; // 低字节
|
||||
TriggerRTEvent("SendUDPData", std::any(outputData));
|
||||
}
|
||||
|
||||
// TriggerRTEvent("SendUDPData", QVariant::fromValue(heartbeatData));
|
||||
// }
|
||||
void XNATA04DataProcessor::SendAeroHeartbeat()
|
||||
{
|
||||
T_D();
|
||||
XNByteArray outputData = d->_aeroHeartbeatInterface.getUDPPackage();
|
||||
//填写数据头
|
||||
outputData[0] = 0xa6; //XNSim
|
||||
outputData[1] = 0xc0; //C909
|
||||
outputData[2] = 0x04; //ATA04
|
||||
outputData[3] = 0x00; //Aerodynamics
|
||||
outputData[4] = 0x02; //Heartbeat
|
||||
outputData[5] = 0x01; //向外部发送
|
||||
|
||||
int dataSize = (long)outputData[6] << 8 | (long)outputData[7];
|
||||
if (dataSize != outputData.size()) {
|
||||
LOG_WARNING("气动心跳数据包大小错误,不向UDP发送!dataSize:%1 outputData.size():%2",
|
||||
dataSize, outputData.size());
|
||||
return;
|
||||
}
|
||||
|
||||
TriggerRTEvent("SendUDPData", std::any(outputData));
|
||||
}
|
||||
|
||||
void XNATA04DataProcessor::SendGhHeartbeat()
|
||||
{
|
||||
T_D();
|
||||
XNByteArray outputData = d->_ghHeartbeatInterface.getUDPPackage();
|
||||
//填写数据方向
|
||||
outputData[5] = 0x01;
|
||||
//填写数据头
|
||||
outputData[0] = 0xa6; //XNSim
|
||||
outputData[1] = 0xc0; //C909
|
||||
outputData[2] = 0x04; //ATA04
|
||||
outputData[3] = 0x01; //GroundHandling
|
||||
outputData[4] = 0x02; //Heartbeat
|
||||
outputData[5] = 0x01; //向外部发送
|
||||
|
||||
int dataSize = (long)outputData[6] << 8 | (long)outputData[7];
|
||||
if (dataSize != outputData.size()) {
|
||||
LOG_WARNING("地操心跳数据包大小错误,不向UDP发送!dataSize:%1 outputData.size():%2",
|
||||
dataSize, outputData.size());
|
||||
return;
|
||||
}
|
||||
|
||||
TriggerRTEvent("SendUDPData", std::any(outputData));
|
||||
}
|
||||
|
||||
// void XNATA04DataProcessor::SendWbHeartbeat()
|
||||
// {
|
||||
// Q_D(XNATA04DataProcessor);
|
||||
// QMutexLocker locker(&d->_wbHeartbeatMutex);
|
||||
// QByteArray heartbeatData;
|
||||
// QDataStream heartbeatStream(&heartbeatData, QIODevice::WriteOnly);
|
||||
// heartbeatStream.setByteOrder(QDataStream::LittleEndian);
|
||||
// quint8 header[6] = {0x0a, 0x04, 0x02, 0x02, 0x00, 0x00}; // 最后两个字节用于大小
|
||||
// heartbeatStream << header[0] << header[1] << header[2] << header[3] << header[4] << header[5];
|
||||
// heartbeatStream << d->_wbHeartbeat.weightbody_model_heartbeat();
|
||||
// // 更新数据包大小(使用两个字节)
|
||||
// auto size = heartbeatData.size();
|
||||
// heartbeatData[4] = (size >> 8) & 0xFF; // 高字节
|
||||
// heartbeatData[5] = size & 0xFF; // 低字节
|
||||
void XNATA04DataProcessor::SendWbHeartbeat()
|
||||
{
|
||||
T_D();
|
||||
XNByteArray outputData = d->_wbHeartbeatInterface.getUDPPackage();
|
||||
//填写数据头
|
||||
outputData[0] = 0xa6; //XNSim
|
||||
outputData[1] = 0xc0; //C909
|
||||
outputData[2] = 0x04; //ATA04
|
||||
outputData[3] = 0x02; //WeightBalance
|
||||
outputData[4] = 0x02; //Heartbeat
|
||||
outputData[5] = 0x01; //向外部发送
|
||||
|
||||
// TriggerRTEvent("SendUDPData", QVariant::fromValue(heartbeatData));
|
||||
// }
|
||||
int dataSize = (long)outputData[6] << 8 | (long)outputData[7];
|
||||
if (dataSize != outputData.size()) {
|
||||
LOG_WARNING("质量心跳数据包大小错误,不向UDP发送!dataSize:%1 outputData.size():%2",
|
||||
dataSize, outputData.size());
|
||||
return;
|
||||
}
|
||||
|
||||
// void XNATA04DataProcessor::OnWbInput(const QVariant &data)
|
||||
// {
|
||||
// Q_D(XNATA04DataProcessor);
|
||||
// QByteArray inputData = data.toByteArray();
|
||||
|
||||
// // 检查数据包头
|
||||
// if (inputData[0] != 0x0b || inputData[1] != 0x04 || inputData[2] != 0x02
|
||||
// || inputData[3] != 0x00) {
|
||||
// LOG_WARNING("ATA04DataProcessor::OnWbInput: invalid input data header");
|
||||
// return;
|
||||
// }
|
||||
|
||||
// // 读取两个字节的大小字段
|
||||
// quint16 size = ((quint16)(quint8)inputData[4] << 8) | (quint16)(quint8)inputData[5];
|
||||
// if (size != inputData.size()) {
|
||||
// LOG_WARNING(
|
||||
// "ATA04DataProcessor::OnWbInput: invalid data size. Expected %d bytes, got %d bytes",
|
||||
// size, inputData.size());
|
||||
// return;
|
||||
// }
|
||||
|
||||
// QDataStream inputStream(&inputData, QIODevice::ReadOnly);
|
||||
// inputStream.setByteOrder(QDataStream::LittleEndian);
|
||||
// inputStream.setVersion(QDataStream::Qt_6_0);
|
||||
|
||||
// // 跳过6字节的头
|
||||
// for (int i = 0; i < 6; i++) {
|
||||
// char tmp;
|
||||
// inputStream >> tmp;
|
||||
// }
|
||||
|
||||
// QMutexLocker locker(&d->_wbInputMutex);
|
||||
// double dTmp;
|
||||
// inputStream >> dTmp;
|
||||
// d->_wbInput.l_04_i_wbcomac_theta_deg_f8(dTmp);
|
||||
// inputStream >> dTmp;
|
||||
// d->_wbInput.l_04_i_wbcomac_phi_deg_f8(dTmp);
|
||||
// inputStream >> dTmp;
|
||||
// d->_wbInput.l_04_i_wbcomac_psi_deg_f8(dTmp);
|
||||
// quint8 ucTmp;
|
||||
// inputStream >> ucTmp;
|
||||
// d->_wbInput.l_04_i_wbcomac_gear_mode_l1(ucTmp);
|
||||
// inputStream >> dTmp;
|
||||
// d->_wbInput.l_04_i_wbcomac_acset_gw_f8(dTmp);
|
||||
// inputStream >> dTmp;
|
||||
// d->_wbInput.l_04_i_wbcomac_acset_cg_f8(dTmp);
|
||||
// std::array<float, 20> farray20;
|
||||
// for (int i = 0; i < 20; i++) {
|
||||
// inputStream >> farray20[i];
|
||||
// }
|
||||
// d->_wbInput.l_04_i_wbcomac_acset_tankfuel_f4(farray20);
|
||||
// inputStream >> dTmp;
|
||||
// d->_wbInput.l_04_i_wbcomac_acset_totfuel_f8(dTmp);
|
||||
// inputStream >> dTmp;
|
||||
// d->_wbInput.l_04_i_wbcomac_acset_zfw_f8(dTmp);
|
||||
// inputStream >> dTmp;
|
||||
// d->_wbInput.l_04_i_wbcomac_acset_zfwcg_f8(dTmp);
|
||||
// std::array<char, 4> ucarray4;
|
||||
// for (int i = 0; i < 4; i++) {
|
||||
// inputStream >> ucarray4[i];
|
||||
// }
|
||||
// d->_wbInput.l_04_i_wbcomac_eng_efsep_l1(ucarray4);
|
||||
// std::array<double, 20> darray20;
|
||||
// for (int i = 0; i < 20; i++) {
|
||||
// inputStream >> darray20[i];
|
||||
// }
|
||||
// d->_wbInput.l_04_i_wbcomac_fuel_f8(darray20);
|
||||
// inputStream >> dTmp;
|
||||
// d->_wbInput.l_04_i_wbcomac_gear_avg_f8(dTmp);
|
||||
// for (int i = 0; i < 20; i++) {
|
||||
// inputStream >> darray20[i];
|
||||
// }
|
||||
// d->_wbInput.l_04_i_wbcomac_kice_f8(darray20);
|
||||
// inputStream >> ucTmp;
|
||||
// d->_wbInput.l_04_i_wbcomac_bycglim_l1(ucTmp);
|
||||
// inputStream >> ucTmp;
|
||||
// d->_wbInput.l_04_i_wbcomac_bygwlim_l1(ucTmp);
|
||||
// inputStream >> ucTmp;
|
||||
// d->_wbInput.l_04_i_wbcomac_frz_l1(ucTmp);
|
||||
// inputStream >> ucTmp;
|
||||
// d->_wbInput.l_04_i_wbcomac_zcgfrz_l1(ucTmp);
|
||||
// inputStream >> ucTmp;
|
||||
// d->_wbInput.l_04_i_wbcomac_zcgfrz_grfx_l1(ucTmp);
|
||||
// inputStream >> ucTmp;
|
||||
// d->_wbInput.l_04_i_wbcomac_ycgfrz_l1(ucTmp);
|
||||
// inputStream >> ucTmp;
|
||||
// d->_wbInput.l_04_i_wbcomac_inertfrz_l1(ucTmp);
|
||||
// inputStream >> dTmp;
|
||||
// d->_wbInput.l_04_i_wbcomac_potreq_gw_f8(dTmp);
|
||||
// inputStream >> dTmp;
|
||||
// d->_wbInput.l_04_i_wbcomac_potreq_gwcg_f8(dTmp);
|
||||
// d->_dataWriters["XNSim::ATA04::WeightBalance_input"]->write(&d->_wbInput);
|
||||
// }
|
||||
TriggerRTEvent("SendUDPData", std::any(outputData));
|
||||
}
|
||||
|
||||
void XNATA04DataProcessor::OnGhInput(const std::any &data)
|
||||
{
|
||||
@ -633,181 +236,81 @@ void XNATA04DataProcessor::OnGhInput(const std::any &data)
|
||||
d->_ghInputInterface.setDataByUDPPackage(inputData);
|
||||
}
|
||||
|
||||
// void XNATA04DataProcessor::OnAeroInput(const QVariant &data)
|
||||
// {
|
||||
// Q_D(XNATA04DataProcessor);
|
||||
// QByteArray inputData = data.toByteArray();
|
||||
void XNATA04DataProcessor::OnAeroInput(const std::any &data)
|
||||
{
|
||||
T_D();
|
||||
XNByteArray inputData = std::any_cast<XNByteArray>(data);
|
||||
// 检查数据包头
|
||||
if (inputData[0] != 0xa6) {
|
||||
LOG_WARNING("接收到不是XNSim的数据包!");
|
||||
return;
|
||||
}
|
||||
if (inputData[1] != 0xc0) {
|
||||
LOG_WARNING("接收到不是C909的数据包!");
|
||||
return;
|
||||
}
|
||||
if (inputData[2] != 0x04) {
|
||||
LOG_WARNING("接收到不是ATA04的数据包!");
|
||||
return;
|
||||
}
|
||||
if (inputData[3] != 0x00) {
|
||||
LOG_WARNING("接收到不是Aerodynamics的数据包!");
|
||||
return;
|
||||
}
|
||||
if (inputData[4] != 0x00) {
|
||||
LOG_WARNING("接收到不是输入结构体的数据包!");
|
||||
return;
|
||||
}
|
||||
if (inputData[5] != 0x00) {
|
||||
LOG_WARNING("接收到不是输入数据包!");
|
||||
return;
|
||||
}
|
||||
size_t size = inputData[6];
|
||||
size = size << 8 | inputData[7];
|
||||
if (size != inputData.size()) {
|
||||
LOG_WARNING("接收到的数据包大小不正确!");
|
||||
return;
|
||||
}
|
||||
d->_aeroInputInterface.setDataByUDPPackage(inputData);
|
||||
}
|
||||
|
||||
// // 现在我们知道数据包确实以0b 04 00开头
|
||||
// if (inputData[0] != 0x0b || inputData[1] != 0x04 || inputData[2] != 0x00
|
||||
// || inputData[3] != 0x00) {
|
||||
// LOG_WARNING("ATA04DataProcessor::OnAeroInput: invalid input data");
|
||||
// return;
|
||||
// }
|
||||
|
||||
// // 读取两个字节的大小字段
|
||||
// quint16 size = ((quint16)(quint8)inputData[4] << 8) | (quint16)(quint8)inputData[5];
|
||||
// if (size != inputData.size()) {
|
||||
// LOG_WARNING(
|
||||
// "ATA04DataProcessor::OnAeroInput: invalid data size. Expected %1 bytes, got %2 bytes",
|
||||
// size, inputData.size());
|
||||
// return;
|
||||
// }
|
||||
|
||||
// // 使用与发送方相同版本的QDataStream读取数据
|
||||
// QDataStream inputStream(&inputData, QIODevice::ReadOnly);
|
||||
// inputStream.setByteOrder(QDataStream::LittleEndian);
|
||||
// inputStream.setVersion(QDataStream::Qt_6_0);
|
||||
|
||||
// // 跳过6字节的头
|
||||
// for (int i = 0; i < 6; i++) {
|
||||
// char tmp;
|
||||
// inputStream >> tmp;
|
||||
// }
|
||||
|
||||
// QMutexLocker locker(&d->_aeroInputMutex);
|
||||
|
||||
// // 尝试读取数据,并添加异常处理
|
||||
// try {
|
||||
// double tmp;
|
||||
// inputStream >> tmp;
|
||||
// d->_aeroInput.l_04_i_aerocomac_alpha_f8(tmp);
|
||||
// inputStream >> tmp;
|
||||
// d->_aeroInput.l_04_i_aerocomac_alpdot_f8(tmp);
|
||||
// inputStream >> tmp;
|
||||
// d->_aeroInput.l_04_i_aerocomac_beta_f8(tmp);
|
||||
// inputStream >> tmp;
|
||||
// d->_aeroInput.l_04_i_aerocomac_press_alt_f8(tmp);
|
||||
// inputStream >> tmp;
|
||||
// d->_aeroInput.l_04_i_aerocomac_tas_f8(tmp);
|
||||
// inputStream >> tmp;
|
||||
// d->_aeroInput.l_04_i_aerocomac_mach_f8(tmp);
|
||||
// inputStream >> tmp;
|
||||
// d->_aeroInput.l_04_i_aerocomac_nx_f8(tmp);
|
||||
// inputStream >> tmp;
|
||||
// d->_aeroInput.l_04_i_aerocomac_ny_f8(tmp);
|
||||
// inputStream >> tmp;
|
||||
// d->_aeroInput.l_04_i_aerocomac_nz_f8(tmp);
|
||||
// inputStream >> tmp;
|
||||
// d->_aeroInput.l_04_i_aerocomac_p_f8(tmp);
|
||||
// inputStream >> tmp;
|
||||
// d->_aeroInput.l_04_i_aerocomac_q_f8(tmp);
|
||||
// inputStream >> tmp;
|
||||
// d->_aeroInput.l_04_i_aerocomac_r_f8(tmp);
|
||||
// inputStream >> tmp;
|
||||
// d->_aeroInput.l_04_i_aerocomac_qbar_f8(tmp);
|
||||
// inputStream >> tmp;
|
||||
// d->_aeroInput.l_04_i_aerocomac_blcg_f8(tmp);
|
||||
// inputStream >> tmp;
|
||||
// d->_aeroInput.l_04_i_aerocomac_bscg_f8(tmp);
|
||||
// inputStream >> tmp;
|
||||
// d->_aeroInput.l_04_i_aerocomac_wlcg_f8(tmp);
|
||||
// inputStream >> tmp;
|
||||
// d->_aeroInput.l_04_i_aerocomac_stab_f8(tmp);
|
||||
|
||||
// // ail_f8 (10个double)
|
||||
// std::array<double, 10> ailArray;
|
||||
// for (int i = 0; i < 10; i++) {
|
||||
// inputStream >> ailArray[i];
|
||||
// }
|
||||
// d->_aeroInput.l_04_i_aerocomac_ail_f8(ailArray);
|
||||
|
||||
// // elv_f8 (4个double)
|
||||
// std::array<double, 4> elvArray;
|
||||
// for (int i = 0; i < 4; i++) {
|
||||
// inputStream >> elvArray[i];
|
||||
// }
|
||||
// d->_aeroInput.l_04_i_aerocomac_elv_f8(elvArray);
|
||||
|
||||
// // rud_f8 (2个double)
|
||||
// std::array<double, 2> rudArray;
|
||||
// for (int i = 0; i < 2; i++) {
|
||||
// inputStream >> rudArray[i];
|
||||
// }
|
||||
// d->_aeroInput.l_04_i_aerocomac_rud_f8(rudArray);
|
||||
|
||||
// // gear_f8 (7个double)
|
||||
// std::array<double, 7> gearArray;
|
||||
// for (int i = 0; i < 7; i++) {
|
||||
// inputStream >> gearArray[i];
|
||||
// }
|
||||
// d->_aeroInput.l_04_i_aerocomac_gear_f8(gearArray);
|
||||
|
||||
// // flap_f8 (10个double)
|
||||
// std::array<double, 10> flapArray;
|
||||
// for (int i = 0; i < 10; i++) {
|
||||
// inputStream >> flapArray[i];
|
||||
// }
|
||||
// d->_aeroInput.l_04_i_aerocomac_flap_f8(flapArray);
|
||||
|
||||
// // slat_f8 (20个double)
|
||||
// std::array<double, 20> slatArray;
|
||||
// for (int i = 0; i < 20; i++) {
|
||||
// inputStream >> slatArray[i];
|
||||
// }
|
||||
// d->_aeroInput.l_04_i_aerocomac_slat_f8(slatArray);
|
||||
|
||||
// // spl_f8 (20个double)
|
||||
// std::array<double, 20> splArray;
|
||||
// for (int i = 0; i < 20; i++) {
|
||||
// inputStream >> splArray[i];
|
||||
// }
|
||||
// d->_aeroInput.l_04_i_aerocomac_spl_f8(splArray);
|
||||
|
||||
// // tnet_f8 (4个double)
|
||||
// std::array<double, 4> tnetArray;
|
||||
// for (int i = 0; i < 4; i++) {
|
||||
// inputStream >> tnetArray[i];
|
||||
// }
|
||||
// d->_aeroInput.l_04_i_aerocomac_tnet_f8(tnetArray);
|
||||
|
||||
// // kice_f8 (20个double)
|
||||
// std::array<double, 20> kiceArray;
|
||||
// for (int i = 0; i < 20; i++) {
|
||||
// inputStream >> kiceArray[i];
|
||||
// }
|
||||
// d->_aeroInput.l_04_i_aerocomac_kice_f8(kiceArray);
|
||||
|
||||
// inputStream >> tmp;
|
||||
// d->_aeroInput.l_04_i_aerocomac_alt_agl_f8(tmp);
|
||||
|
||||
// d->_dataWriters["XNSim::ATA04::Aerodynamics_input"]->write(&d->_aeroInput);
|
||||
// } catch (const std::exception &e) {
|
||||
// LOG_WARNING("ATA04DataProcessor::OnAeroInput: exception during data parsing: %s", e.what());
|
||||
// return;
|
||||
// } catch (...) {
|
||||
// LOG_WARNING("ATA04DataProcessor::OnAeroInput: unknown exception during data parsing");
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
|
||||
// void XNATA04DataProcessor::OnWbOutput(const XNSim::ATA04::WeightBalance_output &input)
|
||||
// {
|
||||
// Q_D(XNATA04DataProcessor);
|
||||
// QMutexLocker locker(&d->_wbOutputMutex);
|
||||
// d->_wbOutput = input;
|
||||
// }
|
||||
|
||||
// void XNATA04DataProcessor::OnAeroOutput(const XNSim::ATA04::Aerodynamics_output &input)
|
||||
// {
|
||||
// Q_D(XNATA04DataProcessor);
|
||||
// QMutexLocker locker(&d->_aeroOutputMutex);
|
||||
// d->_aeroOutput = input;
|
||||
// }
|
||||
|
||||
// void XNATA04DataProcessor::OnAeroHeartbeat(const XNSim::ATA04::Aerodynamics_heartbeat &input)
|
||||
// {
|
||||
// Q_D(XNATA04DataProcessor);
|
||||
// QMutexLocker locker(&d->_aeroHeartbeatMutex);
|
||||
// d->_aeroHeartbeat = input;
|
||||
// }
|
||||
|
||||
// void XNATA04DataProcessor::OnWbHeartbeat(const XNSim::ATA04::WeightBalance_heartbeat &input)
|
||||
// {
|
||||
// Q_D(XNATA04DataProcessor);
|
||||
// QMutexLocker locker(&d->_wbHeartbeatMutex);
|
||||
// d->_wbHeartbeat = input;
|
||||
// }
|
||||
void XNATA04DataProcessor::OnWbInput(const std::any &data)
|
||||
{
|
||||
T_D();
|
||||
XNByteArray inputData = std::any_cast<XNByteArray>(data);
|
||||
// 检查数据包头
|
||||
if (inputData[0] != 0xa6) {
|
||||
LOG_WARNING("接收到不是XNSim的数据包!");
|
||||
return;
|
||||
}
|
||||
if (inputData[1] != 0xc0) {
|
||||
LOG_WARNING("接收到不是C909的数据包!");
|
||||
return;
|
||||
}
|
||||
if (inputData[2] != 0x04) {
|
||||
LOG_WARNING("接收到不是ATA04的数据包!");
|
||||
return;
|
||||
}
|
||||
if (inputData[3] != 0x02) {
|
||||
LOG_WARNING("接收到不是WeightBalance的数据包!");
|
||||
return;
|
||||
}
|
||||
if (inputData[4] != 0x00) {
|
||||
LOG_WARNING("接收到不是输入结构体的数据包!");
|
||||
return;
|
||||
}
|
||||
if (inputData[5] != 0x00) {
|
||||
LOG_WARNING("接收到不是输入数据包!");
|
||||
return;
|
||||
}
|
||||
size_t size = inputData[6];
|
||||
size = size << 8 | inputData[7];
|
||||
if (size != inputData.size()) {
|
||||
LOG_WARNING("接收到的数据包大小不正确!");
|
||||
return;
|
||||
}
|
||||
d->_wbInputInterface.setDataByUDPPackage(inputData);
|
||||
}
|
||||
|
||||
// void XNATA04DataProcessor::SendUdpTestData()
|
||||
// {
|
||||
|
@ -1,9 +1,8 @@
|
||||
#pragma once
|
||||
#include "XNATA04DataProcessor_global.h"
|
||||
#include <XNCore/XNModelObject.h>
|
||||
// #include "../XNAerodynamics/XNAerodynamicsInterface/XNAerodynamicsPubSubTypes.hpp"
|
||||
// #include "../XNWeightBalance/XNWeightBalanceInterface/XNWeightBalancePubSubTypes.hpp"
|
||||
class XNATA04DataProcessorPrivate;
|
||||
|
||||
struct XNATA04DataProcessorPrivate;
|
||||
|
||||
class XNATA04DATAPROCESSOR_EXPORT XNATA04DataProcessor : public XNModelObject
|
||||
{
|
||||
@ -24,23 +23,23 @@ public:
|
||||
virtual void StepUpdate() override;
|
||||
|
||||
private:
|
||||
// void OnAeroInput(const QVariant &data);
|
||||
void OnAeroInput(const std::any &data);
|
||||
|
||||
// void OnWbInput(const QVariant &data);
|
||||
void OnWbInput(const std::any &data);
|
||||
|
||||
void OnGhInput(const std::any &data);
|
||||
|
||||
void SendUdpData();
|
||||
|
||||
// void SendAeroOutput();
|
||||
void SendAeroOutput();
|
||||
|
||||
// void SendWbOutput();
|
||||
void SendWbOutput();
|
||||
|
||||
void SendGhOutput();
|
||||
|
||||
// void SendAeroHeartbeat();
|
||||
void SendAeroHeartbeat();
|
||||
|
||||
// void SendWbHeartbeat();
|
||||
void SendWbHeartbeat();
|
||||
|
||||
void SendGhHeartbeat();
|
||||
|
||||
|
@ -1,22 +1,33 @@
|
||||
#pragma once
|
||||
#include <XNCore/XNModelObject_p.h>
|
||||
#include "../XNGroundHandling/XNGroundHandlingInterface/XNGroundHandlingInterface.hpp"
|
||||
#include <C909_V1/ATA04/Aerodynamics_heartbeat.hpp>
|
||||
#include <C909_V1/ATA04/Aerodynamics_input.hpp>
|
||||
#include <C909_V1/ATA04/Aerodynamics_output.hpp>
|
||||
#include <C909_V1/ATA04/WeightBalance_input.hpp>
|
||||
#include <C909_V1/ATA04/WeightBalance_output.hpp>
|
||||
#include <C909_V1/ATA04/WeightBalance_heartbeat.hpp>
|
||||
#include <C909_V1/ATA04/GroundHandling_input.hpp>
|
||||
#include <C909_V1/ATA04/GroundHandling_output.hpp>
|
||||
#include <C909_V1/ATA04/GroundHandling_heartbeat.hpp>
|
||||
|
||||
struct XNATA04DataProcessorPrivate : public XNModelObjectPrivate {
|
||||
// XNSim::C909::ATA04::Aerodynamics_input _aeroInput;
|
||||
// XNSim::C909::ATA04::Aerodynamics_output _aeroOutput;
|
||||
// XNSim::C909::ATA04::WeightBalance_input _wbInput;
|
||||
// XNSim::C909::ATA04::WeightBalance_output _wbOutput;
|
||||
XNSim::C909::ATA04::Aerodynamics_input _aeroInput;
|
||||
XNSim::C909::ATA04::Aerodynamics_output _aeroOutput;
|
||||
XNSim::C909::ATA04::WeightBalance_input _wbInput;
|
||||
XNSim::C909::ATA04::WeightBalance_output _wbOutput;
|
||||
XNSim::C909::ATA04::GroundHandling_input _ghInput;
|
||||
XNSim::C909::ATA04::GroundHandling_output _ghOutput;
|
||||
// XNSim::C909::ATA04::Aerodynamics_heartbeat _aeroHeartbeat;
|
||||
// XNSim::C909::ATA04::WeightBalance_heartbeat _wbHeartbeat;
|
||||
XNSim::C909::ATA04::Aerodynamics_heartbeat _aeroHeartbeat;
|
||||
XNSim::C909::ATA04::WeightBalance_heartbeat _wbHeartbeat;
|
||||
XNSim::C909::ATA04::GroundHandling_heartbeat _ghHeartbeat;
|
||||
|
||||
XNSim::C909::ATA04::Aerodynamics_input_Interface _aeroInputInterface;
|
||||
XNSim::C909::ATA04::Aerodynamics_output_Interface _aeroOutputInterface;
|
||||
XNSim::C909::ATA04::WeightBalance_input_Interface _wbInputInterface;
|
||||
XNSim::C909::ATA04::WeightBalance_output_Interface _wbOutputInterface;
|
||||
XNSim::C909::ATA04::GroundHandling_input_Interface _ghInputInterface;
|
||||
XNSim::C909::ATA04::GroundHandling_output_Interface _ghOutputInterface;
|
||||
XNSim::C909::ATA04::Aerodynamics_heartbeat_Interface _aeroHeartbeatInterface;
|
||||
XNSim::C909::ATA04::WeightBalance_heartbeat_Interface _wbHeartbeatInterface;
|
||||
XNSim::C909::ATA04::GroundHandling_heartbeat_Interface _ghHeartbeatInterface;
|
||||
std::mutex _ghOutputMutex;
|
||||
std::mutex _ghHeartbeatMutex;
|
||||
std::mutex _ghInputMutex;
|
||||
};
|
||||
|
@ -2,11 +2,9 @@ cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(XNAerodynamics LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
# 获取环境变量
|
||||
if(DEFINED ENV{XNCore})
|
||||
@ -17,9 +15,36 @@ endif()
|
||||
|
||||
# 添加 XNCore_PATH 下的 include 目录为包含目录
|
||||
include_directories(${XNCore_PATH}/include)
|
||||
include_directories(${XNCore_PATH}/IDL)
|
||||
|
||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
|
||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
|
||||
add_library(XNAerodynamics SHARED
|
||||
XNAerodynamics_global.h
|
||||
XNAerodynamics.cpp
|
||||
XNAerodynamics.h
|
||||
XNAerodynamics_p.h
|
||||
)
|
||||
|
||||
add_subdirectory(XNAerodynamicsInterface)
|
||||
add_subdirectory(XNAerodynamics)
|
||||
target_link_libraries(XNAerodynamics PRIVATE
|
||||
${XNCore_PATH}/lib/libXNCore.so
|
||||
${XNCore_PATH}/lib/libC909_V1_Interface.so
|
||||
dl
|
||||
)
|
||||
|
||||
target_compile_definitions(XNAerodynamics PRIVATE XNAERODYNAMICS_LIBRARY)
|
||||
|
||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
set(CMAKE_INSTALL_PREFIX "${XNCore_PATH}/Models" CACHE PATH "Install path prefix" FORCE)
|
||||
endif()
|
||||
|
||||
include(GNUInstallDirs)
|
||||
install(TARGETS XNAerodynamics
|
||||
BUNDLE DESTINATION .
|
||||
LIBRARY DESTINATION .
|
||||
RUNTIME DESTINATION .
|
||||
)
|
||||
|
||||
# 添加自定义命令和目标以拷贝配置文件
|
||||
file(GLOB CONFIG_FILE "*.mcfg")
|
||||
|
||||
# 使用 install 命令在安装时拷贝配置文件
|
||||
install(FILES ${CONFIG_FILE} DESTINATION ${CMAKE_INSTALL_PREFIX})
|
||||
|
107
XNModels/XNAerodynamics/XNAerodynamics.cpp
Executable file
107
XNModels/XNAerodynamics/XNAerodynamics.cpp
Executable file
@ -0,0 +1,107 @@
|
||||
#include "XNAerodynamics.h"
|
||||
#include "XNAerodynamics_p.h"
|
||||
#include <XNCore/XNModelManager.h>
|
||||
|
||||
XN_MODEL_INITIALIZE(XNAerodynamics)
|
||||
|
||||
XNAerodynamics::XNAerodynamics() : XNModelObject(new XNAerodynamicsPrivate())
|
||||
{
|
||||
}
|
||||
|
||||
XNAerodynamics::~XNAerodynamics()
|
||||
{
|
||||
ReleaseData();
|
||||
}
|
||||
|
||||
XNAerodynamics::XNAerodynamics(PrivateType *p) : XNModelObject(p)
|
||||
{
|
||||
}
|
||||
|
||||
void XNAerodynamics::Initialize()
|
||||
{
|
||||
T_D();
|
||||
XNModelObject::Initialize();
|
||||
if (d->_dynamicLib) {
|
||||
d->_fun = (FunctionType)dlsym(d->_dynamicLib, d->_entryPointName.c_str());
|
||||
if (!d->_fun) {
|
||||
LOG_WARNING("Failed to resolve SACSCAerodynamicsEntryPoint");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void XNAerodynamics::PrepareForExecute()
|
||||
{
|
||||
T_D();
|
||||
XNModelObject::PrepareForExecute();
|
||||
InitializeData();
|
||||
d->_inputInterface.Initialize(GetFramework(), GetUniqueId(), 1);
|
||||
d->_outputInterface.Initialize(GetFramework(), GetUniqueId(), 2);
|
||||
d->_heartbeatInterface.Initialize(GetFramework(), GetUniqueId(), 2);
|
||||
}
|
||||
|
||||
void XNAerodynamics::StepUpdate()
|
||||
{
|
||||
T_D();
|
||||
XNModelObject::StepUpdate();
|
||||
if (d->_fun) {
|
||||
d->_inputInterface.getData(d->_data.input_aero);
|
||||
d->_fun(&d->_data);
|
||||
d->_outputInterface.setData(d->_data.output_aero);
|
||||
d->_heartbeatInterface.setData(&d->_data);
|
||||
}
|
||||
}
|
||||
|
||||
void XNAerodynamics::InitializeData()
|
||||
{
|
||||
T_D();
|
||||
d->_data.aero_model_heartbeat = 0;
|
||||
d->_data.input_aero = new input_aero_S;
|
||||
d->_data.input_aero->l_04_i_aerocomac_ail_f8 = new double[10];
|
||||
d->_data.input_aero->l_04_i_aerocomac_elv_f8 = new double[4];
|
||||
d->_data.input_aero->l_04_i_aerocomac_rud_f8 = new double[2];
|
||||
d->_data.input_aero->l_04_i_aerocomac_gear_f8 = new double[7];
|
||||
d->_data.input_aero->l_04_i_aerocomac_flap_f8 = new double[10];
|
||||
d->_data.input_aero->l_04_i_aerocomac_slat_f8 = new double[20];
|
||||
d->_data.input_aero->l_04_i_aerocomac_spl_f8 = new double[20];
|
||||
d->_data.input_aero->l_04_i_aerocomac_tnet_f8 = new double[4];
|
||||
d->_data.input_aero->l_04_i_aerocomac_kice_f8 = new double[20];
|
||||
d->_data.output_aero = new output_aero_S;
|
||||
}
|
||||
|
||||
void XNAerodynamics::ReleaseData()
|
||||
{
|
||||
T_D();
|
||||
if (d->_data.input_aero) {
|
||||
if (d->_data.input_aero->l_04_i_aerocomac_ail_f8) {
|
||||
delete[] d->_data.input_aero->l_04_i_aerocomac_ail_f8;
|
||||
}
|
||||
if (d->_data.input_aero->l_04_i_aerocomac_elv_f8) {
|
||||
delete[] d->_data.input_aero->l_04_i_aerocomac_elv_f8;
|
||||
}
|
||||
if (d->_data.input_aero->l_04_i_aerocomac_rud_f8) {
|
||||
delete[] d->_data.input_aero->l_04_i_aerocomac_rud_f8;
|
||||
}
|
||||
if (d->_data.input_aero->l_04_i_aerocomac_gear_f8) {
|
||||
delete[] d->_data.input_aero->l_04_i_aerocomac_gear_f8;
|
||||
}
|
||||
if (d->_data.input_aero->l_04_i_aerocomac_flap_f8) {
|
||||
delete[] d->_data.input_aero->l_04_i_aerocomac_flap_f8;
|
||||
}
|
||||
if (d->_data.input_aero->l_04_i_aerocomac_slat_f8) {
|
||||
delete[] d->_data.input_aero->l_04_i_aerocomac_slat_f8;
|
||||
}
|
||||
if (d->_data.input_aero->l_04_i_aerocomac_spl_f8) {
|
||||
delete[] d->_data.input_aero->l_04_i_aerocomac_spl_f8;
|
||||
}
|
||||
if (d->_data.input_aero->l_04_i_aerocomac_tnet_f8) {
|
||||
delete[] d->_data.input_aero->l_04_i_aerocomac_tnet_f8;
|
||||
}
|
||||
if (d->_data.input_aero->l_04_i_aerocomac_kice_f8) {
|
||||
delete[] d->_data.input_aero->l_04_i_aerocomac_kice_f8;
|
||||
}
|
||||
delete d->_data.input_aero;
|
||||
}
|
||||
if (d->_data.output_aero) {
|
||||
delete d->_data.output_aero;
|
||||
}
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
#pragma once
|
||||
#include "XNAerodynamics_global.h"
|
||||
#include <XNCore/XNModelObject.h>
|
||||
#include "../XNAerodynamicsInterface/XNAerodynamicsPubSubTypes.hpp"
|
||||
|
||||
class XNAerodynamicsPrivate;
|
||||
|
||||
@ -9,7 +8,6 @@ class XNAERODYNAMICS_EXPORT XNAerodynamics : public XNModelObject
|
||||
{
|
||||
XN_METATYPE(XNAerodynamics, XNModelObject)
|
||||
XN_DECLARE_PRIVATE(XNAerodynamics)
|
||||
XN_DECLARE_DDS()
|
||||
public:
|
||||
XNAerodynamics();
|
||||
virtual ~XNAerodynamics();
|
||||
@ -20,13 +18,11 @@ protected:
|
||||
public:
|
||||
virtual void Initialize() override;
|
||||
virtual void PrepareForExecute() override;
|
||||
|
||||
public:
|
||||
virtual void StepUpdate() override;
|
||||
|
||||
private:
|
||||
void OnOutput();
|
||||
void OnInput(const XNSim::ATA04::Aerodynamics_input &input);
|
||||
protected:
|
||||
void InitializeData();
|
||||
void ReleaseData();
|
||||
};
|
||||
|
||||
XNCLASS_PTR_DECLARE(XNAerodynamics)
|
@ -1,32 +0,0 @@
|
||||
add_library(XNAerodynamics SHARED
|
||||
XNAerodynamics_global.h
|
||||
XNAerodynamics.cpp
|
||||
XNAerodynamics.h
|
||||
XNAerodynamics_p.h
|
||||
${DDS_XNIDL_SOURCES_CXX}
|
||||
)
|
||||
|
||||
target_link_libraries(XNAerodynamics PRIVATE
|
||||
Qt${QT_VERSION_MAJOR}::Core
|
||||
${XNCore_PATH}/lib/libXNCore.so
|
||||
XNAerodynamicsInterface
|
||||
)
|
||||
|
||||
target_compile_definitions(XNAerodynamics PRIVATE XNAERODYNAMICS_LIBRARY)
|
||||
|
||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
set(CMAKE_INSTALL_PREFIX "${XNCore_PATH}/Models" CACHE PATH "Install path prefix" FORCE)
|
||||
endif()
|
||||
|
||||
include(GNUInstallDirs)
|
||||
install(TARGETS XNAerodynamics
|
||||
BUNDLE DESTINATION .
|
||||
LIBRARY DESTINATION .
|
||||
RUNTIME DESTINATION .
|
||||
)
|
||||
|
||||
# 添加自定义命令和目标以拷贝配置文件
|
||||
file(GLOB CONFIG_FILE "*.mcfg")
|
||||
|
||||
# 使用 install 命令在安装时拷贝配置文件
|
||||
install(FILES ${CONFIG_FILE} DESTINATION ${CMAKE_INSTALL_PREFIX})
|
@ -1,424 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 14.0.1, 2025-01-26T10:40:40. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
<value type="QByteArray">{5b958118-2d32-49ab-8eab-9018ac74c7d6}</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||
<value type="qlonglong">0</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.EditorSettings</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
|
||||
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
|
||||
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
|
||||
<value type="QString" key="language">Cpp</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
|
||||
<value type="QString" key="language">QmlJS</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="EditorConfiguration.CodeStyle.Count">2</value>
|
||||
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
|
||||
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.IndentSize">4</value>
|
||||
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
|
||||
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
|
||||
<value type="int" key="EditorConfiguration.PreferAfterWhitespaceComments">0</value>
|
||||
<value type="bool" key="EditorConfiguration.PreferSingleLineComments">false</value>
|
||||
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
|
||||
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
|
||||
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">2</value>
|
||||
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
|
||||
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
|
||||
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
|
||||
<value type="int" key="EditorConfiguration.TabSize">8</value>
|
||||
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
|
||||
<value type="bool" key="EditorConfiguration.UseIndenter">false</value>
|
||||
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
|
||||
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
|
||||
<value type="QString" key="EditorConfiguration.ignoreFileTypes">*.md, *.MD, Makefile</value>
|
||||
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
|
||||
<value type="bool" key="EditorConfiguration.skipTrailingWhitespace">true</value>
|
||||
<value type="bool" key="EditorConfiguration.tintMarginArea">true</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.PluginSettings</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<valuemap type="QVariantMap" key="AutoTest.ActiveFrameworks">
|
||||
<value type="bool" key="AutoTest.Framework.Boost">true</value>
|
||||
<value type="bool" key="AutoTest.Framework.CTest">false</value>
|
||||
<value type="bool" key="AutoTest.Framework.Catch">true</value>
|
||||
<value type="bool" key="AutoTest.Framework.GTest">true</value>
|
||||
<value type="bool" key="AutoTest.Framework.QtQuickTest">true</value>
|
||||
<value type="bool" key="AutoTest.Framework.QtTest">true</value>
|
||||
</valuemap>
|
||||
<value type="bool" key="AutoTest.ApplyFilter">false</value>
|
||||
<valuemap type="QVariantMap" key="AutoTest.CheckStates"/>
|
||||
<valuelist type="QVariantList" key="AutoTest.PathFilters"/>
|
||||
<value type="int" key="AutoTest.RunAfterBuild">0</value>
|
||||
<value type="bool" key="AutoTest.UseGlobal">true</value>
|
||||
<valuemap type="QVariantMap" key="ClangTools">
|
||||
<value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value>
|
||||
<value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
|
||||
<value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
|
||||
<value type="int" key="ClangTools.ParallelJobs">5</value>
|
||||
<value type="bool" key="ClangTools.PreferConfigFile">true</value>
|
||||
<valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
|
||||
<valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
|
||||
<valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
|
||||
<value type="bool" key="ClangTools.UseGlobalSettings">true</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ClangdSettings">
|
||||
<value type="bool" key="blockIndexing">true</value>
|
||||
<value type="bool" key="useGlobalSettings">true</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Target.0</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="QString" key="DeviceType">Desktop</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 6.7.2</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 6.7.2</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt6.672.linux_gcc_64_kit</value>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||
<value type="QString" key="CMake.Build.Type">Debug</value>
|
||||
<value type="int" key="CMake.Configure.BaseEnvironment">2</value>
|
||||
<value type="bool" key="CMake.Configure.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="CMake.Configure.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_GENERATOR:STRING=Unix Makefiles
|
||||
-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
|
||||
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
|
||||
-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}
|
||||
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
|
||||
-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}
|
||||
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
|
||||
-DCMAKE_BUILD_TYPE:STRING=Debug</value>
|
||||
<value type="int" key="EnableQmlDebugging">0</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/media/jin/E/MyCode/xnsim/XNModels/XNAerodynamics/build/Desktop_Qt_6_7_2-Debug</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清除</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">清除</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
|
||||
<value type="QString" key="CMake.Build.Type">Release</value>
|
||||
<value type="int" key="CMake.Configure.BaseEnvironment">2</value>
|
||||
<value type="bool" key="CMake.Configure.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="CMake.Configure.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_GENERATOR:STRING=Unix Makefiles
|
||||
-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
|
||||
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
|
||||
-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}
|
||||
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
|
||||
-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}
|
||||
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
|
||||
-DCMAKE_BUILD_TYPE:STRING=Release</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/media/jin/E/MyCode/xnsim/XNModels/XNAerodynamics/build/Desktop_Qt_6_7_2-Release</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清除</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">清除</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
|
||||
<value type="QString" key="CMake.Build.Type">RelWithDebInfo</value>
|
||||
<value type="int" key="CMake.Configure.BaseEnvironment">2</value>
|
||||
<value type="bool" key="CMake.Configure.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="CMake.Configure.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_GENERATOR:STRING=Unix Makefiles
|
||||
-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
|
||||
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
|
||||
-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}
|
||||
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
|
||||
-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}
|
||||
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
|
||||
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/media/jin/E/MyCode/xnsim/XNModels/XNAerodynamics/build/Desktop_Qt_6_7_2-RelWithDebInfo</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清除</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">清除</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release with Debug Information</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.3">
|
||||
<value type="QString" key="CMake.Build.Type">RelWithDebInfo</value>
|
||||
<value type="int" key="CMake.Configure.BaseEnvironment">2</value>
|
||||
<value type="bool" key="CMake.Configure.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="CMake.Configure.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_GENERATOR:STRING=Unix Makefiles
|
||||
-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
|
||||
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
|
||||
-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}
|
||||
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
|
||||
-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}
|
||||
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
|
||||
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo</value>
|
||||
<value type="int" key="EnableQmlDebugging">0</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/media/jin/E/MyCode/xnsim/XNModels/XNAerodynamics/build/Desktop_Qt_6_7_2-Profile</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清除</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">清除</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.4">
|
||||
<value type="QString" key="CMake.Build.Type">MinSizeRel</value>
|
||||
<value type="int" key="CMake.Configure.BaseEnvironment">2</value>
|
||||
<value type="bool" key="CMake.Configure.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="CMake.Configure.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_GENERATOR:STRING=Unix Makefiles
|
||||
-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
|
||||
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
|
||||
-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}
|
||||
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
|
||||
-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}
|
||||
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
|
||||
-DCMAKE_BUILD_TYPE:STRING=MinSizeRel</value>
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/media/jin/E/MyCode/xnsim/XNModels/XNAerodynamics/build/Desktop_Qt_6_7_2-MinSizeRel</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">all</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
|
||||
<value type="QString">clean</value>
|
||||
</valuelist>
|
||||
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清除</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">清除</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Minimum Size Release</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.BuildConfigurationCount">5</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">部署</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">部署</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/>
|
||||
<value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
|
||||
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
|
||||
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
|
||||
<value type="int" key="Analyzer.Valgrind.Callgrind.CostFormat">0</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
|
||||
<valuelist type="QVariantList" key="CustomOutputParsers"/>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
|
||||
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
|
||||
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value>
|
||||
<value type="bool" key="ProjectExplorer.RunConfiguration.Customized">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
</valuemap>
|
||||
<value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.TargetCount</variable>
|
||||
<value type="qlonglong">1</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
|
||||
<value type="int">22</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>Version</variable>
|
||||
<value type="int">22</value>
|
||||
</data>
|
||||
</qtcreator>
|
@ -1,207 +0,0 @@
|
||||
#include "XNAerodynamics.h"
|
||||
#include "XNAerodynamics_p.h"
|
||||
#include <XNCore/XNModelManager.h>
|
||||
#include <XNCore/XNDDSManager.h>
|
||||
#include <XNCore/XNFramework.h>
|
||||
|
||||
XN_MODEL_INITIALIZE(XNAerodynamics)
|
||||
XN_REGISTER_PARTICIPANT_BEGIN(XNAerodynamics)
|
||||
XN_PUBLISHTOPIC(XNSim::ATA04::Aerodynamics_output)
|
||||
XN_PUBLISHTOPIC(XNSim::ATA04::Aerodynamics_heartbeat)
|
||||
XN_SUBSCRIBETOPIC(XNSim::ATA04::Aerodynamics_input, &XNAerodynamics::OnInput)
|
||||
XN_REGISTER_PARTICIPANT_END(XNAerodynamics)
|
||||
|
||||
XNAerodynamics::XNAerodynamics() : XNModelObject(new XNAerodynamicsPrivate())
|
||||
{
|
||||
}
|
||||
|
||||
XNAerodynamics::~XNAerodynamics()
|
||||
{
|
||||
}
|
||||
|
||||
XNAerodynamics::XNAerodynamics(PrivateType *p) : XNModelObject(p)
|
||||
{
|
||||
}
|
||||
|
||||
void XNAerodynamics::Initialize(uint32_t initialType, uint32_t threadID)
|
||||
{
|
||||
T_D();
|
||||
XNModelObject::Initialize(initialType, threadID);
|
||||
if (d->_dynamicLib) {
|
||||
d->_fun = (FunctionType)dlsym(d->_dynamicLib, d->_entryPointName.c_str());
|
||||
if (!d->_fun) {
|
||||
LOG_WARNING("Failed to resolve SACSCAerodynamicsEntryPoint");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void XNAerodynamics::PrepareForExecute()
|
||||
{
|
||||
T_D();
|
||||
XNModelObject::PrepareForExecute();
|
||||
d->_data.aero_model_heartbeat = 0;
|
||||
d->_data.input_aero = new input_aero_S;
|
||||
d->_data.input_aero->l_04_i_aerocomac_ail_f8 = (double *)calloc(2, sizeof(double));
|
||||
d->_data.input_aero->l_04_i_aerocomac_elv_f8 = (double *)calloc(2, sizeof(double));
|
||||
d->_data.input_aero->l_04_i_aerocomac_rud_f8 = (double *)calloc(1, sizeof(double));
|
||||
d->_data.input_aero->l_04_i_aerocomac_gear_f8 = (double *)calloc(3, sizeof(double));
|
||||
d->_data.input_aero->l_04_i_aerocomac_flap_f8 = (double *)calloc(2, sizeof(double));
|
||||
d->_data.input_aero->l_04_i_aerocomac_slat_f8 = (double *)calloc(2, sizeof(double));
|
||||
d->_data.input_aero->l_04_i_aerocomac_spl_f8 = (double *)calloc(8, sizeof(double));
|
||||
d->_data.input_aero->l_04_i_aerocomac_tnet_f8 = (double *)calloc(2, sizeof(double));
|
||||
d->_data.input_aero->l_04_i_aerocomac_kice_f8 = (double *)calloc(12, sizeof(double));
|
||||
d->_data.output_aero = new output_aero_S;
|
||||
}
|
||||
|
||||
void XNAerodynamics::StepUpdate()
|
||||
{
|
||||
T_D();
|
||||
XNModelObject::StepUpdate();
|
||||
if (d->_fun) {
|
||||
std::lock_guard<std::mutex> locker(d->_mutex);
|
||||
d->_fun(&d->_data);
|
||||
}
|
||||
OnOutput();
|
||||
}
|
||||
|
||||
void XNAerodynamics::OnOutput()
|
||||
{
|
||||
T_D();
|
||||
//DDS心跳发布
|
||||
XNSim::ATA04::Aerodynamics_heartbeat heartbeat;
|
||||
heartbeat.aero_model_heartbeat(d->_data.aero_model_heartbeat);
|
||||
d->_dataWriters["XNSim::ATA04::Aerodynamics_heartbeat"]->write(&heartbeat);
|
||||
//DDS数据发布
|
||||
XNSim::ATA04::Aerodynamics_output output;
|
||||
output.l_04_o_aerocomac_fxb_f8(d->_data.output_aero->l_04_o_aerocomac_fxb_f8);
|
||||
output.l_04_o_aerocomac_fyb_f8(d->_data.output_aero->l_04_o_aerocomac_fyb_f8);
|
||||
output.l_04_o_aerocomac_fzb_f8(d->_data.output_aero->l_04_o_aerocomac_fzb_f8);
|
||||
output.l_04_o_aerocomac_mxb_f8(d->_data.output_aero->l_04_o_aerocomac_mxb_f8);
|
||||
output.l_04_o_aerocomac_myb_f8(d->_data.output_aero->l_04_o_aerocomac_myb_f8);
|
||||
output.l_04_o_aerocomac_mzb_f8(d->_data.output_aero->l_04_o_aerocomac_mzb_f8);
|
||||
output.l_04_o_aerocomac_cls_f8(d->_data.output_aero->l_04_o_aerocomac_cls_f8);
|
||||
output.l_04_o_aerocomac_cl_f8(d->_data.output_aero->l_04_o_aerocomac_cl_f8);
|
||||
output.l_04_o_aerocomac_cd_f8(d->_data.output_aero->l_04_o_aerocomac_cd_f8);
|
||||
output.l_04_o_aerocomac_cm_f8(d->_data.output_aero->l_04_o_aerocomac_cm_f8);
|
||||
output.l_04_o_aerocomac_cr_f8(d->_data.output_aero->l_04_o_aerocomac_cr_f8);
|
||||
output.l_04_o_aerocomac_cy_f8(d->_data.output_aero->l_04_o_aerocomac_cy_f8);
|
||||
output.l_04_o_aerocomac_cn_f8(d->_data.output_aero->l_04_o_aerocomac_cn_f8);
|
||||
d->_dataWriters["XNSim::ATA04::Aerodynamics_output"]->write(&output);
|
||||
}
|
||||
|
||||
void XNAerodynamics::OnInput(const XNSim::ATA04::Aerodynamics_input &input)
|
||||
{
|
||||
T_D();
|
||||
std::lock_guard<std::mutex> locker(d->_mutex);
|
||||
if (input.l_04_i_aerocomac_alpha_f8()) {
|
||||
d->_data.input_aero->l_04_i_aerocomac_alpha_f8 = input.l_04_i_aerocomac_alpha_f8().value();
|
||||
}
|
||||
if (input.l_04_i_aerocomac_alpdot_f8()) {
|
||||
d->_data.input_aero->l_04_i_aerocomac_alpdot_f8 =
|
||||
input.l_04_i_aerocomac_alpdot_f8().value();
|
||||
}
|
||||
if (input.l_04_i_aerocomac_beta_f8()) {
|
||||
d->_data.input_aero->l_04_i_aerocomac_beta_f8 = input.l_04_i_aerocomac_beta_f8().value();
|
||||
}
|
||||
if (input.l_04_i_aerocomac_press_alt_f8()) {
|
||||
d->_data.input_aero->l_04_i_aerocomac_press_alt_f8 =
|
||||
input.l_04_i_aerocomac_press_alt_f8().value();
|
||||
}
|
||||
if (input.l_04_i_aerocomac_tas_f8()) {
|
||||
d->_data.input_aero->l_04_i_aerocomac_tas_f8 = input.l_04_i_aerocomac_tas_f8().value();
|
||||
}
|
||||
if (input.l_04_i_aerocomac_mach_f8()) {
|
||||
d->_data.input_aero->l_04_i_aerocomac_mach_f8 = input.l_04_i_aerocomac_mach_f8().value();
|
||||
}
|
||||
if (input.l_04_i_aerocomac_nx_f8()) {
|
||||
d->_data.input_aero->l_04_i_aerocomac_nx_f8 = input.l_04_i_aerocomac_nx_f8().value();
|
||||
}
|
||||
if (input.l_04_i_aerocomac_ny_f8()) {
|
||||
d->_data.input_aero->l_04_i_aerocomac_ny_f8 = input.l_04_i_aerocomac_ny_f8().value();
|
||||
}
|
||||
if (input.l_04_i_aerocomac_nz_f8()) {
|
||||
d->_data.input_aero->l_04_i_aerocomac_nz_f8 = input.l_04_i_aerocomac_nz_f8().value();
|
||||
}
|
||||
if (input.l_04_i_aerocomac_p_f8()) {
|
||||
d->_data.input_aero->l_04_i_aerocomac_p_f8 = input.l_04_i_aerocomac_p_f8().value();
|
||||
}
|
||||
if (input.l_04_i_aerocomac_q_f8()) {
|
||||
d->_data.input_aero->l_04_i_aerocomac_q_f8 = input.l_04_i_aerocomac_q_f8().value();
|
||||
}
|
||||
if (input.l_04_i_aerocomac_r_f8()) {
|
||||
d->_data.input_aero->l_04_i_aerocomac_r_f8 = input.l_04_i_aerocomac_r_f8().value();
|
||||
}
|
||||
if (input.l_04_i_aerocomac_qbar_f8()) {
|
||||
d->_data.input_aero->l_04_i_aerocomac_qbar_f8 = input.l_04_i_aerocomac_qbar_f8().value();
|
||||
}
|
||||
if (input.l_04_i_aerocomac_blcg_f8()) {
|
||||
d->_data.input_aero->l_04_i_aerocomac_blcg_f8 = input.l_04_i_aerocomac_blcg_f8().value();
|
||||
}
|
||||
if (input.l_04_i_aerocomac_bscg_f8()) {
|
||||
d->_data.input_aero->l_04_i_aerocomac_bscg_f8 = input.l_04_i_aerocomac_bscg_f8().value();
|
||||
}
|
||||
if (input.l_04_i_aerocomac_wlcg_f8()) {
|
||||
d->_data.input_aero->l_04_i_aerocomac_wlcg_f8 = input.l_04_i_aerocomac_wlcg_f8().value();
|
||||
}
|
||||
if (input.l_04_i_aerocomac_stab_f8()) {
|
||||
d->_data.input_aero->l_04_i_aerocomac_stab_f8 = input.l_04_i_aerocomac_stab_f8().value();
|
||||
}
|
||||
if (input.l_04_i_aerocomac_ail_f8()) {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
d->_data.input_aero->l_04_i_aerocomac_ail_f8[i] =
|
||||
input.l_04_i_aerocomac_ail_f8().value()[i];
|
||||
}
|
||||
}
|
||||
if (input.l_04_i_aerocomac_elv_f8()) {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
d->_data.input_aero->l_04_i_aerocomac_elv_f8[i] =
|
||||
input.l_04_i_aerocomac_elv_f8().value()[i];
|
||||
}
|
||||
}
|
||||
if (input.l_04_i_aerocomac_rud_f8()) {
|
||||
for (int i = 0; i < 1; i++) {
|
||||
d->_data.input_aero->l_04_i_aerocomac_rud_f8[i] =
|
||||
input.l_04_i_aerocomac_rud_f8().value()[i];
|
||||
}
|
||||
}
|
||||
if (input.l_04_i_aerocomac_gear_f8()) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
d->_data.input_aero->l_04_i_aerocomac_gear_f8[i] =
|
||||
input.l_04_i_aerocomac_gear_f8().value()[i];
|
||||
}
|
||||
}
|
||||
if (input.l_04_i_aerocomac_flap_f8()) {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
d->_data.input_aero->l_04_i_aerocomac_flap_f8[i] =
|
||||
input.l_04_i_aerocomac_flap_f8().value()[i];
|
||||
}
|
||||
}
|
||||
if (input.l_04_i_aerocomac_slat_f8()) {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
d->_data.input_aero->l_04_i_aerocomac_slat_f8[i] =
|
||||
input.l_04_i_aerocomac_slat_f8().value()[i];
|
||||
}
|
||||
}
|
||||
if (input.l_04_i_aerocomac_spl_f8()) {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
d->_data.input_aero->l_04_i_aerocomac_spl_f8[i] =
|
||||
input.l_04_i_aerocomac_spl_f8().value()[i];
|
||||
}
|
||||
}
|
||||
if (input.l_04_i_aerocomac_tnet_f8()) {
|
||||
for (int i = 0; i < 2; i++) {
|
||||
d->_data.input_aero->l_04_i_aerocomac_tnet_f8[i] =
|
||||
input.l_04_i_aerocomac_tnet_f8().value()[i];
|
||||
}
|
||||
}
|
||||
if (input.l_04_i_aerocomac_kice_f8()) {
|
||||
for (int i = 0; i < 12; i++) {
|
||||
d->_data.input_aero->l_04_i_aerocomac_kice_f8[i] =
|
||||
input.l_04_i_aerocomac_kice_f8().value()[i];
|
||||
}
|
||||
}
|
||||
if (input.l_04_i_aerocomac_alt_agl_f8()) {
|
||||
d->_data.input_aero->l_04_i_aerocomac_alt_agl_f8 =
|
||||
input.l_04_i_aerocomac_alt_agl_f8().value();
|
||||
}
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(XNAerodynamicsInterface LANGUAGES CXX)
|
||||
|
||||
if(NOT fastcdr_FOUND)
|
||||
find_package(fastcdr 2 REQUIRED)
|
||||
endif()
|
||||
|
||||
if(NOT fastdds_FOUND)
|
||||
find_package(fastdds 3 REQUIRED)
|
||||
endif()
|
||||
|
||||
find_package(OpenSSL REQUIRED)
|
||||
|
||||
add_library(XNAerodynamicsInterface SHARED
|
||||
XNAerodynamics.hpp
|
||||
XNAerodynamicsInterface.hpp
|
||||
XNAerodynamicsInterface.cxx
|
||||
XNAerodynamicsCdrAux.hpp
|
||||
XNAerodynamicsCdrAux.ipp
|
||||
XNAerodynamicsPubSubTypes.hpp
|
||||
XNAerodynamicsPubSubTypes.cxx
|
||||
XNAerodynamicsTypeObjectSupport.hpp
|
||||
XNAerodynamicsTypeObjectSupport.cxx
|
||||
)
|
||||
|
||||
target_link_libraries(XNAerodynamicsInterface PRIVATE
|
||||
Qt${QT_VERSION_MAJOR}::Core
|
||||
fastcdr
|
||||
fastdds
|
||||
OpenSSL::SSL
|
||||
OpenSSL::Crypto
|
||||
)
|
||||
|
||||
target_compile_definitions(XNAerodynamicsInterface PRIVATE XNAERODYNAMICSINTERFACE_LIBRARY)
|
||||
|
||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
set(CMAKE_INSTALL_PREFIX "${XNCore_PATH}/Models" CACHE PATH "Install path prefix" FORCE)
|
||||
endif()
|
||||
|
||||
include(GNUInstallDirs)
|
||||
install(TARGETS XNAerodynamicsInterface
|
||||
BUNDLE DESTINATION .
|
||||
LIBRARY DESTINATION .
|
||||
RUNTIME DESTINATION .
|
||||
)
|
||||
|
||||
# 添加自定义命令和目标以拷贝配置文件
|
||||
file(GLOB IDL_FILE "*.idl")
|
||||
|
||||
# 使用 install 命令在安装时拷贝配置文件
|
||||
install(FILES ${IDL_FILE} DESTINATION ${CMAKE_INSTALL_PREFIX})
|
File diff suppressed because it is too large
Load Diff
@ -1,56 +0,0 @@
|
||||
module XNSim
|
||||
{
|
||||
module ATA04
|
||||
{
|
||||
struct Aerodynamics_input
|
||||
{
|
||||
@optional double l_04_i_aerocomac_alpha_f8;
|
||||
@optional double l_04_i_aerocomac_alpdot_f8;
|
||||
@optional double l_04_i_aerocomac_beta_f8;
|
||||
@optional double l_04_i_aerocomac_press_alt_f8;
|
||||
@optional double l_04_i_aerocomac_tas_f8;
|
||||
@optional double l_04_i_aerocomac_mach_f8;
|
||||
@optional double l_04_i_aerocomac_nx_f8;
|
||||
@optional double l_04_i_aerocomac_ny_f8;
|
||||
@optional double l_04_i_aerocomac_nz_f8;
|
||||
@optional double l_04_i_aerocomac_p_f8;
|
||||
@optional double l_04_i_aerocomac_q_f8;
|
||||
@optional double l_04_i_aerocomac_r_f8;
|
||||
@optional double l_04_i_aerocomac_qbar_f8;
|
||||
@optional double l_04_i_aerocomac_blcg_f8;
|
||||
@optional double l_04_i_aerocomac_bscg_f8;
|
||||
@optional double l_04_i_aerocomac_wlcg_f8;
|
||||
@optional double l_04_i_aerocomac_ail_f8[10];
|
||||
@optional double l_04_i_aerocomac_elv_f8[4];
|
||||
@optional double l_04_i_aerocomac_rud_f8[2];
|
||||
@optional double l_04_i_aerocomac_stab_f8;
|
||||
@optional double l_04_i_aerocomac_gear_f8[7];
|
||||
@optional double l_04_i_aerocomac_flap_f8[10];
|
||||
@optional double l_04_i_aerocomac_slat_f8[20];
|
||||
@optional double l_04_i_aerocomac_spl_f8[20];
|
||||
@optional double l_04_i_aerocomac_tnet_f8[4];
|
||||
@optional double l_04_i_aerocomac_kice_f8[20];
|
||||
@optional double l_04_i_aerocomac_alt_agl_f8;
|
||||
};
|
||||
struct Aerodynamics_output
|
||||
{
|
||||
@optional double l_04_o_aerocomac_fxb_f8;
|
||||
@optional double l_04_o_aerocomac_fyb_f8;
|
||||
@optional double l_04_o_aerocomac_fzb_f8;
|
||||
@optional double l_04_o_aerocomac_mxb_f8;
|
||||
@optional double l_04_o_aerocomac_myb_f8;
|
||||
@optional double l_04_o_aerocomac_mzb_f8;
|
||||
@optional double l_04_o_aerocomac_cls_f8;
|
||||
@optional double l_04_o_aerocomac_cl_f8;
|
||||
@optional double l_04_o_aerocomac_cd_f8;
|
||||
@optional double l_04_o_aerocomac_cm_f8;
|
||||
@optional double l_04_o_aerocomac_cr_f8;
|
||||
@optional double l_04_o_aerocomac_cy_f8;
|
||||
@optional double l_04_o_aerocomac_cn_f8;
|
||||
};
|
||||
struct Aerodynamics_heartbeat
|
||||
{
|
||||
long aero_model_heartbeat;
|
||||
};
|
||||
};
|
||||
};
|
@ -1,60 +0,0 @@
|
||||
// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
/*!
|
||||
* @file XNAerodynamicsCdrAux.hpp
|
||||
* This source file contains some definitions of CDR related functions.
|
||||
*
|
||||
* This file was generated by the tool fastddsgen.
|
||||
*/
|
||||
|
||||
#ifndef FAST_DDS_GENERATED__XNSIM_ATA04_XNAERODYNAMICSCDRAUX_HPP
|
||||
#define FAST_DDS_GENERATED__XNSIM_ATA04_XNAERODYNAMICSCDRAUX_HPP
|
||||
|
||||
#include "XNAerodynamics.hpp"
|
||||
|
||||
constexpr uint32_t XNSim_ATA04_Aerodynamics_input_max_cdr_typesize {1352UL};
|
||||
constexpr uint32_t XNSim_ATA04_Aerodynamics_input_max_key_cdr_typesize {0UL};
|
||||
|
||||
constexpr uint32_t XNSim_ATA04_Aerodynamics_output_max_cdr_typesize {312UL};
|
||||
constexpr uint32_t XNSim_ATA04_Aerodynamics_output_max_key_cdr_typesize {0UL};
|
||||
|
||||
constexpr uint32_t XNSim_ATA04_Aerodynamics_heartbeat_max_cdr_typesize {8UL};
|
||||
constexpr uint32_t XNSim_ATA04_Aerodynamics_heartbeat_max_key_cdr_typesize {0UL};
|
||||
|
||||
|
||||
namespace eprosima {
|
||||
namespace fastcdr {
|
||||
|
||||
class Cdr;
|
||||
class CdrSizeCalculator;
|
||||
|
||||
eProsima_user_DllExport void serialize_key(
|
||||
eprosima::fastcdr::Cdr& scdr,
|
||||
const XNSim::ATA04::Aerodynamics_input& data);
|
||||
|
||||
eProsima_user_DllExport void serialize_key(
|
||||
eprosima::fastcdr::Cdr& scdr,
|
||||
const XNSim::ATA04::Aerodynamics_output& data);
|
||||
|
||||
eProsima_user_DllExport void serialize_key(
|
||||
eprosima::fastcdr::Cdr& scdr,
|
||||
const XNSim::ATA04::Aerodynamics_heartbeat& data);
|
||||
|
||||
|
||||
} // namespace fastcdr
|
||||
} // namespace eprosima
|
||||
|
||||
#endif // FAST_DDS_GENERATED__XNSIM_ATA04_XNAERODYNAMICSCDRAUX_HPP
|
||||
|
@ -1,800 +0,0 @@
|
||||
// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
/*!
|
||||
* @file XNAerodynamicsCdrAux.ipp
|
||||
* This source file contains some declarations of CDR related functions.
|
||||
*
|
||||
* This file was generated by the tool fastddsgen.
|
||||
*/
|
||||
|
||||
#ifndef FAST_DDS_GENERATED__XNSIM_ATA04_XNAERODYNAMICSCDRAUX_IPP
|
||||
#define FAST_DDS_GENERATED__XNSIM_ATA04_XNAERODYNAMICSCDRAUX_IPP
|
||||
|
||||
#include "XNAerodynamicsCdrAux.hpp"
|
||||
|
||||
#include <fastcdr/Cdr.h>
|
||||
#include <fastcdr/CdrSizeCalculator.hpp>
|
||||
|
||||
|
||||
#include <fastcdr/exceptions/BadParamException.h>
|
||||
using namespace eprosima::fastcdr::exception;
|
||||
|
||||
namespace eprosima {
|
||||
namespace fastcdr {
|
||||
|
||||
template<>
|
||||
eProsima_user_DllExport size_t calculate_serialized_size(
|
||||
eprosima::fastcdr::CdrSizeCalculator& calculator,
|
||||
const XNSim::ATA04::Aerodynamics_input& data,
|
||||
size_t& current_alignment)
|
||||
{
|
||||
using namespace XNSim::ATA04;
|
||||
|
||||
static_cast<void>(data);
|
||||
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding();
|
||||
size_t calculated_size {calculator.begin_calculate_type_serialized_size(
|
||||
eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ?
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR,
|
||||
current_alignment)};
|
||||
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0),
|
||||
data.l_04_i_aerocomac_alpha_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1),
|
||||
data.l_04_i_aerocomac_alpdot_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2),
|
||||
data.l_04_i_aerocomac_beta_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3),
|
||||
data.l_04_i_aerocomac_press_alt_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4),
|
||||
data.l_04_i_aerocomac_tas_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5),
|
||||
data.l_04_i_aerocomac_mach_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6),
|
||||
data.l_04_i_aerocomac_nx_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7),
|
||||
data.l_04_i_aerocomac_ny_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8),
|
||||
data.l_04_i_aerocomac_nz_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9),
|
||||
data.l_04_i_aerocomac_p_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(10),
|
||||
data.l_04_i_aerocomac_q_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(11),
|
||||
data.l_04_i_aerocomac_r_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(12),
|
||||
data.l_04_i_aerocomac_qbar_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(13),
|
||||
data.l_04_i_aerocomac_blcg_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(14),
|
||||
data.l_04_i_aerocomac_bscg_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(15),
|
||||
data.l_04_i_aerocomac_wlcg_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(16),
|
||||
data.l_04_i_aerocomac_ail_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(17),
|
||||
data.l_04_i_aerocomac_elv_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(18),
|
||||
data.l_04_i_aerocomac_rud_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(19),
|
||||
data.l_04_i_aerocomac_stab_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(20),
|
||||
data.l_04_i_aerocomac_gear_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(21),
|
||||
data.l_04_i_aerocomac_flap_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(22),
|
||||
data.l_04_i_aerocomac_slat_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(23),
|
||||
data.l_04_i_aerocomac_spl_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(24),
|
||||
data.l_04_i_aerocomac_tnet_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(25),
|
||||
data.l_04_i_aerocomac_kice_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(26),
|
||||
data.l_04_i_aerocomac_alt_agl_f8(), current_alignment);
|
||||
|
||||
|
||||
calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment);
|
||||
|
||||
return calculated_size;
|
||||
}
|
||||
|
||||
template<>
|
||||
eProsima_user_DllExport void serialize(
|
||||
eprosima::fastcdr::Cdr& scdr,
|
||||
const XNSim::ATA04::Aerodynamics_input& data)
|
||||
{
|
||||
using namespace XNSim::ATA04;
|
||||
|
||||
eprosima::fastcdr::Cdr::state current_state(scdr);
|
||||
scdr.begin_serialize_type(current_state,
|
||||
eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ?
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR);
|
||||
|
||||
scdr
|
||||
<< eprosima::fastcdr::MemberId(0) << data.l_04_i_aerocomac_alpha_f8()
|
||||
<< eprosima::fastcdr::MemberId(1) << data.l_04_i_aerocomac_alpdot_f8()
|
||||
<< eprosima::fastcdr::MemberId(2) << data.l_04_i_aerocomac_beta_f8()
|
||||
<< eprosima::fastcdr::MemberId(3) << data.l_04_i_aerocomac_press_alt_f8()
|
||||
<< eprosima::fastcdr::MemberId(4) << data.l_04_i_aerocomac_tas_f8()
|
||||
<< eprosima::fastcdr::MemberId(5) << data.l_04_i_aerocomac_mach_f8()
|
||||
<< eprosima::fastcdr::MemberId(6) << data.l_04_i_aerocomac_nx_f8()
|
||||
<< eprosima::fastcdr::MemberId(7) << data.l_04_i_aerocomac_ny_f8()
|
||||
<< eprosima::fastcdr::MemberId(8) << data.l_04_i_aerocomac_nz_f8()
|
||||
<< eprosima::fastcdr::MemberId(9) << data.l_04_i_aerocomac_p_f8()
|
||||
<< eprosima::fastcdr::MemberId(10) << data.l_04_i_aerocomac_q_f8()
|
||||
<< eprosima::fastcdr::MemberId(11) << data.l_04_i_aerocomac_r_f8()
|
||||
<< eprosima::fastcdr::MemberId(12) << data.l_04_i_aerocomac_qbar_f8()
|
||||
<< eprosima::fastcdr::MemberId(13) << data.l_04_i_aerocomac_blcg_f8()
|
||||
<< eprosima::fastcdr::MemberId(14) << data.l_04_i_aerocomac_bscg_f8()
|
||||
<< eprosima::fastcdr::MemberId(15) << data.l_04_i_aerocomac_wlcg_f8()
|
||||
<< eprosima::fastcdr::MemberId(16) << data.l_04_i_aerocomac_ail_f8()
|
||||
<< eprosima::fastcdr::MemberId(17) << data.l_04_i_aerocomac_elv_f8()
|
||||
<< eprosima::fastcdr::MemberId(18) << data.l_04_i_aerocomac_rud_f8()
|
||||
<< eprosima::fastcdr::MemberId(19) << data.l_04_i_aerocomac_stab_f8()
|
||||
<< eprosima::fastcdr::MemberId(20) << data.l_04_i_aerocomac_gear_f8()
|
||||
<< eprosima::fastcdr::MemberId(21) << data.l_04_i_aerocomac_flap_f8()
|
||||
<< eprosima::fastcdr::MemberId(22) << data.l_04_i_aerocomac_slat_f8()
|
||||
<< eprosima::fastcdr::MemberId(23) << data.l_04_i_aerocomac_spl_f8()
|
||||
<< eprosima::fastcdr::MemberId(24) << data.l_04_i_aerocomac_tnet_f8()
|
||||
<< eprosima::fastcdr::MemberId(25) << data.l_04_i_aerocomac_kice_f8()
|
||||
<< eprosima::fastcdr::MemberId(26) << data.l_04_i_aerocomac_alt_agl_f8()
|
||||
;
|
||||
scdr.end_serialize_type(current_state);
|
||||
}
|
||||
|
||||
template<>
|
||||
eProsima_user_DllExport void deserialize(
|
||||
eprosima::fastcdr::Cdr& cdr,
|
||||
XNSim::ATA04::Aerodynamics_input& data)
|
||||
{
|
||||
using namespace XNSim::ATA04;
|
||||
|
||||
cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ?
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR,
|
||||
[&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool
|
||||
{
|
||||
bool ret_value = true;
|
||||
switch (mid.id)
|
||||
{
|
||||
case 0:
|
||||
dcdr >> data.l_04_i_aerocomac_alpha_f8();
|
||||
break;
|
||||
|
||||
case 1:
|
||||
dcdr >> data.l_04_i_aerocomac_alpdot_f8();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
dcdr >> data.l_04_i_aerocomac_beta_f8();
|
||||
break;
|
||||
|
||||
case 3:
|
||||
dcdr >> data.l_04_i_aerocomac_press_alt_f8();
|
||||
break;
|
||||
|
||||
case 4:
|
||||
dcdr >> data.l_04_i_aerocomac_tas_f8();
|
||||
break;
|
||||
|
||||
case 5:
|
||||
dcdr >> data.l_04_i_aerocomac_mach_f8();
|
||||
break;
|
||||
|
||||
case 6:
|
||||
dcdr >> data.l_04_i_aerocomac_nx_f8();
|
||||
break;
|
||||
|
||||
case 7:
|
||||
dcdr >> data.l_04_i_aerocomac_ny_f8();
|
||||
break;
|
||||
|
||||
case 8:
|
||||
dcdr >> data.l_04_i_aerocomac_nz_f8();
|
||||
break;
|
||||
|
||||
case 9:
|
||||
dcdr >> data.l_04_i_aerocomac_p_f8();
|
||||
break;
|
||||
|
||||
case 10:
|
||||
dcdr >> data.l_04_i_aerocomac_q_f8();
|
||||
break;
|
||||
|
||||
case 11:
|
||||
dcdr >> data.l_04_i_aerocomac_r_f8();
|
||||
break;
|
||||
|
||||
case 12:
|
||||
dcdr >> data.l_04_i_aerocomac_qbar_f8();
|
||||
break;
|
||||
|
||||
case 13:
|
||||
dcdr >> data.l_04_i_aerocomac_blcg_f8();
|
||||
break;
|
||||
|
||||
case 14:
|
||||
dcdr >> data.l_04_i_aerocomac_bscg_f8();
|
||||
break;
|
||||
|
||||
case 15:
|
||||
dcdr >> data.l_04_i_aerocomac_wlcg_f8();
|
||||
break;
|
||||
|
||||
case 16:
|
||||
dcdr >> data.l_04_i_aerocomac_ail_f8();
|
||||
break;
|
||||
|
||||
case 17:
|
||||
dcdr >> data.l_04_i_aerocomac_elv_f8();
|
||||
break;
|
||||
|
||||
case 18:
|
||||
dcdr >> data.l_04_i_aerocomac_rud_f8();
|
||||
break;
|
||||
|
||||
case 19:
|
||||
dcdr >> data.l_04_i_aerocomac_stab_f8();
|
||||
break;
|
||||
|
||||
case 20:
|
||||
dcdr >> data.l_04_i_aerocomac_gear_f8();
|
||||
break;
|
||||
|
||||
case 21:
|
||||
dcdr >> data.l_04_i_aerocomac_flap_f8();
|
||||
break;
|
||||
|
||||
case 22:
|
||||
dcdr >> data.l_04_i_aerocomac_slat_f8();
|
||||
break;
|
||||
|
||||
case 23:
|
||||
dcdr >> data.l_04_i_aerocomac_spl_f8();
|
||||
break;
|
||||
|
||||
case 24:
|
||||
dcdr >> data.l_04_i_aerocomac_tnet_f8();
|
||||
break;
|
||||
|
||||
case 25:
|
||||
dcdr >> data.l_04_i_aerocomac_kice_f8();
|
||||
break;
|
||||
|
||||
case 26:
|
||||
dcdr >> data.l_04_i_aerocomac_alt_agl_f8();
|
||||
break;
|
||||
|
||||
default:
|
||||
ret_value = false;
|
||||
break;
|
||||
}
|
||||
return ret_value;
|
||||
});
|
||||
}
|
||||
|
||||
void serialize_key(
|
||||
eprosima::fastcdr::Cdr& scdr,
|
||||
const XNSim::ATA04::Aerodynamics_input& data)
|
||||
{
|
||||
using namespace XNSim::ATA04;
|
||||
|
||||
static_cast<void>(scdr);
|
||||
static_cast<void>(data);
|
||||
if (data.l_04_i_aerocomac_alpha_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_i_aerocomac_alpha_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_i_aerocomac_alpdot_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_i_aerocomac_alpdot_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_i_aerocomac_beta_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_i_aerocomac_beta_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_i_aerocomac_press_alt_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_i_aerocomac_press_alt_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_i_aerocomac_tas_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_i_aerocomac_tas_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_i_aerocomac_mach_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_i_aerocomac_mach_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_i_aerocomac_nx_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_i_aerocomac_nx_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_i_aerocomac_ny_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_i_aerocomac_ny_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_i_aerocomac_nz_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_i_aerocomac_nz_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_i_aerocomac_p_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_i_aerocomac_p_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_i_aerocomac_q_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_i_aerocomac_q_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_i_aerocomac_r_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_i_aerocomac_r_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_i_aerocomac_qbar_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_i_aerocomac_qbar_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_i_aerocomac_blcg_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_i_aerocomac_blcg_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_i_aerocomac_bscg_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_i_aerocomac_bscg_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_i_aerocomac_wlcg_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_i_aerocomac_wlcg_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_i_aerocomac_ail_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_i_aerocomac_ail_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_i_aerocomac_elv_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_i_aerocomac_elv_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_i_aerocomac_rud_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_i_aerocomac_rud_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_i_aerocomac_stab_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_i_aerocomac_stab_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_i_aerocomac_gear_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_i_aerocomac_gear_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_i_aerocomac_flap_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_i_aerocomac_flap_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_i_aerocomac_slat_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_i_aerocomac_slat_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_i_aerocomac_spl_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_i_aerocomac_spl_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_i_aerocomac_tnet_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_i_aerocomac_tnet_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_i_aerocomac_kice_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_i_aerocomac_kice_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_i_aerocomac_alt_agl_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_i_aerocomac_alt_agl_f8().value();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
eProsima_user_DllExport size_t calculate_serialized_size(
|
||||
eprosima::fastcdr::CdrSizeCalculator& calculator,
|
||||
const XNSim::ATA04::Aerodynamics_output& data,
|
||||
size_t& current_alignment)
|
||||
{
|
||||
using namespace XNSim::ATA04;
|
||||
|
||||
static_cast<void>(data);
|
||||
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding();
|
||||
size_t calculated_size {calculator.begin_calculate_type_serialized_size(
|
||||
eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ?
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR,
|
||||
current_alignment)};
|
||||
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0),
|
||||
data.l_04_o_aerocomac_fxb_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(1),
|
||||
data.l_04_o_aerocomac_fyb_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(2),
|
||||
data.l_04_o_aerocomac_fzb_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(3),
|
||||
data.l_04_o_aerocomac_mxb_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(4),
|
||||
data.l_04_o_aerocomac_myb_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(5),
|
||||
data.l_04_o_aerocomac_mzb_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(6),
|
||||
data.l_04_o_aerocomac_cls_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(7),
|
||||
data.l_04_o_aerocomac_cl_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(8),
|
||||
data.l_04_o_aerocomac_cd_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(9),
|
||||
data.l_04_o_aerocomac_cm_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(10),
|
||||
data.l_04_o_aerocomac_cr_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(11),
|
||||
data.l_04_o_aerocomac_cy_f8(), current_alignment);
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(12),
|
||||
data.l_04_o_aerocomac_cn_f8(), current_alignment);
|
||||
|
||||
|
||||
calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment);
|
||||
|
||||
return calculated_size;
|
||||
}
|
||||
|
||||
template<>
|
||||
eProsima_user_DllExport void serialize(
|
||||
eprosima::fastcdr::Cdr& scdr,
|
||||
const XNSim::ATA04::Aerodynamics_output& data)
|
||||
{
|
||||
using namespace XNSim::ATA04;
|
||||
|
||||
eprosima::fastcdr::Cdr::state current_state(scdr);
|
||||
scdr.begin_serialize_type(current_state,
|
||||
eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ?
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR);
|
||||
|
||||
scdr
|
||||
<< eprosima::fastcdr::MemberId(0) << data.l_04_o_aerocomac_fxb_f8()
|
||||
<< eprosima::fastcdr::MemberId(1) << data.l_04_o_aerocomac_fyb_f8()
|
||||
<< eprosima::fastcdr::MemberId(2) << data.l_04_o_aerocomac_fzb_f8()
|
||||
<< eprosima::fastcdr::MemberId(3) << data.l_04_o_aerocomac_mxb_f8()
|
||||
<< eprosima::fastcdr::MemberId(4) << data.l_04_o_aerocomac_myb_f8()
|
||||
<< eprosima::fastcdr::MemberId(5) << data.l_04_o_aerocomac_mzb_f8()
|
||||
<< eprosima::fastcdr::MemberId(6) << data.l_04_o_aerocomac_cls_f8()
|
||||
<< eprosima::fastcdr::MemberId(7) << data.l_04_o_aerocomac_cl_f8()
|
||||
<< eprosima::fastcdr::MemberId(8) << data.l_04_o_aerocomac_cd_f8()
|
||||
<< eprosima::fastcdr::MemberId(9) << data.l_04_o_aerocomac_cm_f8()
|
||||
<< eprosima::fastcdr::MemberId(10) << data.l_04_o_aerocomac_cr_f8()
|
||||
<< eprosima::fastcdr::MemberId(11) << data.l_04_o_aerocomac_cy_f8()
|
||||
<< eprosima::fastcdr::MemberId(12) << data.l_04_o_aerocomac_cn_f8()
|
||||
;
|
||||
scdr.end_serialize_type(current_state);
|
||||
}
|
||||
|
||||
template<>
|
||||
eProsima_user_DllExport void deserialize(
|
||||
eprosima::fastcdr::Cdr& cdr,
|
||||
XNSim::ATA04::Aerodynamics_output& data)
|
||||
{
|
||||
using namespace XNSim::ATA04;
|
||||
|
||||
cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ?
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR,
|
||||
[&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool
|
||||
{
|
||||
bool ret_value = true;
|
||||
switch (mid.id)
|
||||
{
|
||||
case 0:
|
||||
dcdr >> data.l_04_o_aerocomac_fxb_f8();
|
||||
break;
|
||||
|
||||
case 1:
|
||||
dcdr >> data.l_04_o_aerocomac_fyb_f8();
|
||||
break;
|
||||
|
||||
case 2:
|
||||
dcdr >> data.l_04_o_aerocomac_fzb_f8();
|
||||
break;
|
||||
|
||||
case 3:
|
||||
dcdr >> data.l_04_o_aerocomac_mxb_f8();
|
||||
break;
|
||||
|
||||
case 4:
|
||||
dcdr >> data.l_04_o_aerocomac_myb_f8();
|
||||
break;
|
||||
|
||||
case 5:
|
||||
dcdr >> data.l_04_o_aerocomac_mzb_f8();
|
||||
break;
|
||||
|
||||
case 6:
|
||||
dcdr >> data.l_04_o_aerocomac_cls_f8();
|
||||
break;
|
||||
|
||||
case 7:
|
||||
dcdr >> data.l_04_o_aerocomac_cl_f8();
|
||||
break;
|
||||
|
||||
case 8:
|
||||
dcdr >> data.l_04_o_aerocomac_cd_f8();
|
||||
break;
|
||||
|
||||
case 9:
|
||||
dcdr >> data.l_04_o_aerocomac_cm_f8();
|
||||
break;
|
||||
|
||||
case 10:
|
||||
dcdr >> data.l_04_o_aerocomac_cr_f8();
|
||||
break;
|
||||
|
||||
case 11:
|
||||
dcdr >> data.l_04_o_aerocomac_cy_f8();
|
||||
break;
|
||||
|
||||
case 12:
|
||||
dcdr >> data.l_04_o_aerocomac_cn_f8();
|
||||
break;
|
||||
|
||||
default:
|
||||
ret_value = false;
|
||||
break;
|
||||
}
|
||||
return ret_value;
|
||||
});
|
||||
}
|
||||
|
||||
void serialize_key(
|
||||
eprosima::fastcdr::Cdr& scdr,
|
||||
const XNSim::ATA04::Aerodynamics_output& data)
|
||||
{
|
||||
using namespace XNSim::ATA04;
|
||||
|
||||
static_cast<void>(scdr);
|
||||
static_cast<void>(data);
|
||||
if (data.l_04_o_aerocomac_fxb_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_o_aerocomac_fxb_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_o_aerocomac_fyb_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_o_aerocomac_fyb_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_o_aerocomac_fzb_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_o_aerocomac_fzb_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_o_aerocomac_mxb_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_o_aerocomac_mxb_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_o_aerocomac_myb_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_o_aerocomac_myb_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_o_aerocomac_mzb_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_o_aerocomac_mzb_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_o_aerocomac_cls_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_o_aerocomac_cls_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_o_aerocomac_cl_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_o_aerocomac_cl_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_o_aerocomac_cd_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_o_aerocomac_cd_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_o_aerocomac_cm_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_o_aerocomac_cm_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_o_aerocomac_cr_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_o_aerocomac_cr_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_o_aerocomac_cy_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_o_aerocomac_cy_f8().value();
|
||||
}
|
||||
|
||||
if (data.l_04_o_aerocomac_cn_f8().has_value())
|
||||
{
|
||||
scdr << data.l_04_o_aerocomac_cn_f8().value();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
eProsima_user_DllExport size_t calculate_serialized_size(
|
||||
eprosima::fastcdr::CdrSizeCalculator& calculator,
|
||||
const XNSim::ATA04::Aerodynamics_heartbeat& data,
|
||||
size_t& current_alignment)
|
||||
{
|
||||
using namespace XNSim::ATA04;
|
||||
|
||||
static_cast<void>(data);
|
||||
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag previous_encoding = calculator.get_encoding();
|
||||
size_t calculated_size {calculator.begin_calculate_type_serialized_size(
|
||||
eprosima::fastcdr::CdrVersion::XCDRv2 == calculator.get_cdr_version() ?
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR,
|
||||
current_alignment)};
|
||||
|
||||
|
||||
calculated_size += calculator.calculate_member_serialized_size(eprosima::fastcdr::MemberId(0),
|
||||
data.aero_model_heartbeat(), current_alignment);
|
||||
|
||||
|
||||
calculated_size += calculator.end_calculate_type_serialized_size(previous_encoding, current_alignment);
|
||||
|
||||
return calculated_size;
|
||||
}
|
||||
|
||||
template<>
|
||||
eProsima_user_DllExport void serialize(
|
||||
eprosima::fastcdr::Cdr& scdr,
|
||||
const XNSim::ATA04::Aerodynamics_heartbeat& data)
|
||||
{
|
||||
using namespace XNSim::ATA04;
|
||||
|
||||
eprosima::fastcdr::Cdr::state current_state(scdr);
|
||||
scdr.begin_serialize_type(current_state,
|
||||
eprosima::fastcdr::CdrVersion::XCDRv2 == scdr.get_cdr_version() ?
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR);
|
||||
|
||||
scdr
|
||||
<< eprosima::fastcdr::MemberId(0) << data.aero_model_heartbeat()
|
||||
;
|
||||
scdr.end_serialize_type(current_state);
|
||||
}
|
||||
|
||||
template<>
|
||||
eProsima_user_DllExport void deserialize(
|
||||
eprosima::fastcdr::Cdr& cdr,
|
||||
XNSim::ATA04::Aerodynamics_heartbeat& data)
|
||||
{
|
||||
using namespace XNSim::ATA04;
|
||||
|
||||
cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ?
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR,
|
||||
[&data](eprosima::fastcdr::Cdr& dcdr, const eprosima::fastcdr::MemberId& mid) -> bool
|
||||
{
|
||||
bool ret_value = true;
|
||||
switch (mid.id)
|
||||
{
|
||||
case 0:
|
||||
dcdr >> data.aero_model_heartbeat();
|
||||
break;
|
||||
|
||||
default:
|
||||
ret_value = false;
|
||||
break;
|
||||
}
|
||||
return ret_value;
|
||||
});
|
||||
}
|
||||
|
||||
void serialize_key(
|
||||
eprosima::fastcdr::Cdr& scdr,
|
||||
const XNSim::ATA04::Aerodynamics_heartbeat& data)
|
||||
{
|
||||
using namespace XNSim::ATA04;
|
||||
|
||||
static_cast<void>(scdr);
|
||||
static_cast<void>(data);
|
||||
scdr << data.aero_model_heartbeat();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace fastcdr
|
||||
} // namespace eprosima
|
||||
|
||||
#endif // FAST_DDS_GENERATED__XNSIM_ATA04_XNAERODYNAMICSCDRAUX_IPP
|
||||
|
@ -1,545 +0,0 @@
|
||||
#include "XNAerodynamicsInterface.hpp"
|
||||
#include <QDebug>
|
||||
#include <QStringList>
|
||||
|
||||
namespace XNSim
|
||||
{
|
||||
namespace ATA04
|
||||
{
|
||||
Aerodynamics_input_Interface::Aerodynamics_input_Interface()
|
||||
{
|
||||
getDataFunction["l_04_i_aerocomac_alpha_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_aerocomac_alpha_f8()) {
|
||||
return QString::number(input.l_04_i_aerocomac_alpha_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_aerocomac_alpdot_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_aerocomac_alpdot_f8()) {
|
||||
return QString::number(input.l_04_i_aerocomac_alpdot_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_aerocomac_beta_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_aerocomac_beta_f8()) {
|
||||
return QString::number(input.l_04_i_aerocomac_beta_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_aerocomac_press_alt_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_aerocomac_press_alt_f8()) {
|
||||
return QString::number(input.l_04_i_aerocomac_press_alt_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_aerocomac_tas_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_aerocomac_tas_f8()) {
|
||||
return QString::number(input.l_04_i_aerocomac_tas_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_aerocomac_mach_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_aerocomac_mach_f8()) {
|
||||
return QString::number(input.l_04_i_aerocomac_mach_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_aerocomac_nx_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_aerocomac_nx_f8()) {
|
||||
return QString::number(input.l_04_i_aerocomac_nx_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_aerocomac_ny_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_aerocomac_ny_f8()) {
|
||||
return QString::number(input.l_04_i_aerocomac_ny_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_aerocomac_nz_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_aerocomac_nz_f8()) {
|
||||
return QString::number(input.l_04_i_aerocomac_nz_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_aerocomac_p_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_aerocomac_p_f8()) {
|
||||
return QString::number(input.l_04_i_aerocomac_p_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_aerocomac_q_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_aerocomac_q_f8()) {
|
||||
return QString::number(input.l_04_i_aerocomac_q_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_aerocomac_r_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_aerocomac_r_f8()) {
|
||||
return QString::number(input.l_04_i_aerocomac_r_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_aerocomac_qbar_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_aerocomac_qbar_f8()) {
|
||||
return QString::number(input.l_04_i_aerocomac_qbar_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_aerocomac_blcg_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_aerocomac_blcg_f8()) {
|
||||
return QString::number(input.l_04_i_aerocomac_blcg_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_aerocomac_bscg_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_aerocomac_bscg_f8()) {
|
||||
return QString::number(input.l_04_i_aerocomac_bscg_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_aerocomac_wlcg_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_aerocomac_wlcg_f8()) {
|
||||
return QString::number(input.l_04_i_aerocomac_wlcg_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_aerocomac_ail_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_aerocomac_ail_f8()) {
|
||||
QStringList list;
|
||||
for (int i = 0; i < 10; i++) {
|
||||
if (input.l_04_i_aerocomac_ail_f8().value()[i]) {
|
||||
list.append(QString::number(input.l_04_i_aerocomac_ail_f8().value()[i]));
|
||||
}
|
||||
}
|
||||
return list.join(",");
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_aerocomac_elv_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_aerocomac_elv_f8()) {
|
||||
QStringList list;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (input.l_04_i_aerocomac_elv_f8().value()[i]) {
|
||||
list.append(QString::number(input.l_04_i_aerocomac_elv_f8().value()[i]));
|
||||
}
|
||||
}
|
||||
return list.join(",");
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_aerocomac_rud_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_aerocomac_rud_f8()) {
|
||||
QStringList list;
|
||||
for (int i = 0; i < 2; i++) {
|
||||
if (input.l_04_i_aerocomac_rud_f8().value()[i]) {
|
||||
list.append(QString::number(input.l_04_i_aerocomac_rud_f8().value()[i]));
|
||||
}
|
||||
}
|
||||
return list.join(",");
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_aerocomac_stab_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_aerocomac_stab_f8()) {
|
||||
return QString::number(input.l_04_i_aerocomac_stab_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_aerocomac_gear_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_aerocomac_gear_f8()) {
|
||||
QStringList list;
|
||||
for (int i = 0; i < 7; i++) {
|
||||
if (input.l_04_i_aerocomac_gear_f8().value()[i]) {
|
||||
list.append(QString::number(input.l_04_i_aerocomac_gear_f8().value()[i]));
|
||||
}
|
||||
}
|
||||
return list.join(",");
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_aerocomac_flap_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_aerocomac_flap_f8()) {
|
||||
QStringList list;
|
||||
for (int i = 0; i < 10; i++) {
|
||||
if (input.l_04_i_aerocomac_flap_f8().value()[i]) {
|
||||
list.append(QString::number(input.l_04_i_aerocomac_flap_f8().value()[i]));
|
||||
}
|
||||
}
|
||||
return list.join(",");
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_aerocomac_slat_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_aerocomac_slat_f8()) {
|
||||
QStringList list;
|
||||
for (int i = 0; i < 20; i++) {
|
||||
if (input.l_04_i_aerocomac_slat_f8().value()[i]) {
|
||||
list.append(QString::number(input.l_04_i_aerocomac_slat_f8().value()[i]));
|
||||
}
|
||||
}
|
||||
return list.join(",");
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_aerocomac_spl_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_aerocomac_spl_f8()) {
|
||||
QStringList list;
|
||||
for (int i = 0; i < 20; i++) {
|
||||
if (input.l_04_i_aerocomac_spl_f8().value()[i]) {
|
||||
list.append(QString::number(input.l_04_i_aerocomac_spl_f8().value()[i]));
|
||||
}
|
||||
}
|
||||
return list.join(",");
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_aerocomac_tnet_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_aerocomac_tnet_f8()) {
|
||||
QStringList list;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (input.l_04_i_aerocomac_tnet_f8().value()[i]) {
|
||||
list.append(QString::number(input.l_04_i_aerocomac_tnet_f8().value()[i]));
|
||||
}
|
||||
}
|
||||
return list.join(",");
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_aerocomac_kice_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_aerocomac_kice_f8()) {
|
||||
QStringList list;
|
||||
for (int i = 0; i < 20; i++) {
|
||||
if (input.l_04_i_aerocomac_kice_f8().value()[i]) {
|
||||
list.append(QString::number(input.l_04_i_aerocomac_kice_f8().value()[i]));
|
||||
}
|
||||
}
|
||||
return list.join(",");
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_aerocomac_alt_agl_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_aerocomac_alt_agl_f8()) {
|
||||
return QString::number(input.l_04_i_aerocomac_alt_agl_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
}
|
||||
Aerodynamics_input_Interface::~Aerodynamics_input_Interface()
|
||||
{
|
||||
}
|
||||
|
||||
QString Aerodynamics_input_Interface::getData(const QString &varName)
|
||||
{
|
||||
int index1 = -1;
|
||||
int index2 = -1;
|
||||
QString trueVarName = varName;
|
||||
// 检查变量名中是否存在数组标记
|
||||
if (varName.contains('[')) {
|
||||
// 解析数组索引
|
||||
int startPos = varName.indexOf('[');
|
||||
int midPos = varName.indexOf("][");
|
||||
int endPos = varName.lastIndexOf(']');
|
||||
|
||||
// 如果是二维数组 (格式: name[index1][index2])
|
||||
if (midPos != -1) {
|
||||
bool ok1 = false, ok2 = false;
|
||||
index1 = varName.mid(startPos + 1, midPos - startPos - 1).toInt(&ok1);
|
||||
index2 = varName.mid(midPos + 2, endPos - midPos - 2).toInt(&ok2);
|
||||
|
||||
if (!ok1 || !ok2) {
|
||||
qWarning() << "无法解析数组索引:" << varName;
|
||||
index1 = 0;
|
||||
index2 = 0;
|
||||
}
|
||||
}
|
||||
// 如果是一维数组 (格式: name[index1])
|
||||
else if (startPos != -1 && endPos != -1) {
|
||||
bool ok = false;
|
||||
index1 = varName.mid(startPos + 1, endPos - startPos - 1).toInt(&ok);
|
||||
|
||||
if (!ok) {
|
||||
qWarning() << "无法解析数组索引:" << varName;
|
||||
index1 = 0;
|
||||
}
|
||||
}
|
||||
trueVarName = varName.left(startPos);
|
||||
}
|
||||
auto it = getDataFunction.find(trueVarName);
|
||||
if (it == getDataFunction.end()) {
|
||||
return QString(); // 返回空字符串表示未找到
|
||||
}
|
||||
if (index1 < 0) {
|
||||
QMutexLocker locker(&mutex);
|
||||
return it.value()(trueVarName);
|
||||
} else if (index2 < 0) {
|
||||
QMutexLocker locker(&mutex);
|
||||
QStringList list = it.value()(trueVarName).split(",");
|
||||
if (index1 >= list.size()) {
|
||||
qWarning() << "数组索引超出范围:" << varName;
|
||||
return QString();
|
||||
}
|
||||
return list[index1];
|
||||
} else {
|
||||
QMutexLocker locker(&mutex);
|
||||
QStringList list = it.value()(trueVarName).split(",");
|
||||
if (index1 >= list.size()) {
|
||||
qWarning() << "数组索引超出范围:" << varName;
|
||||
return QString();
|
||||
}
|
||||
QStringList list2 = list[index1].split(" ");
|
||||
if (index2 >= list2.size()) {
|
||||
qWarning() << "数组索引超出范围:" << varName;
|
||||
return QString();
|
||||
}
|
||||
return list2[index2];
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Aerodynamics_input_Interface::inputDataListener(const XNSim::ATA04::Aerodynamics_input &input)
|
||||
{
|
||||
QMutexLocker locker(&mutex);
|
||||
this->input = input;
|
||||
}
|
||||
|
||||
Aerodynamics_output_Interface::Aerodynamics_output_Interface()
|
||||
{
|
||||
getDataFunction["l_04_o_aerocomac_fxb_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_aerocomac_fxb_f8()) {
|
||||
return QString::number(output.l_04_o_aerocomac_fxb_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_aerocomac_fyb_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_aerocomac_fyb_f8()) {
|
||||
return QString::number(output.l_04_o_aerocomac_fyb_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_aerocomac_fzb_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_aerocomac_fzb_f8()) {
|
||||
return QString::number(output.l_04_o_aerocomac_fzb_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_aerocomac_mxb_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_aerocomac_mxb_f8()) {
|
||||
return QString::number(output.l_04_o_aerocomac_mxb_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_aerocomac_myb_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_aerocomac_myb_f8()) {
|
||||
return QString::number(output.l_04_o_aerocomac_myb_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_aerocomac_mzb_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_aerocomac_mzb_f8()) {
|
||||
return QString::number(output.l_04_o_aerocomac_mzb_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_aerocomac_cls_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_aerocomac_cls_f8()) {
|
||||
return QString::number(output.l_04_o_aerocomac_cls_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_aerocomac_cl_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_aerocomac_cl_f8()) {
|
||||
return QString::number(output.l_04_o_aerocomac_cl_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_aerocomac_cd_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_aerocomac_cd_f8()) {
|
||||
return QString::number(output.l_04_o_aerocomac_cd_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_aerocomac_cm_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_aerocomac_cm_f8()) {
|
||||
return QString::number(output.l_04_o_aerocomac_cm_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_aerocomac_cr_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_aerocomac_cr_f8()) {
|
||||
return QString::number(output.l_04_o_aerocomac_cr_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_aerocomac_cy_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_aerocomac_cy_f8()) {
|
||||
return QString::number(output.l_04_o_aerocomac_cy_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_aerocomac_cn_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_aerocomac_cn_f8()) {
|
||||
return QString::number(output.l_04_o_aerocomac_cn_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
}
|
||||
Aerodynamics_output_Interface::~Aerodynamics_output_Interface()
|
||||
{
|
||||
}
|
||||
|
||||
QString Aerodynamics_output_Interface::getData(const QString &varName)
|
||||
{
|
||||
int index1 = -1;
|
||||
int index2 = -1;
|
||||
QString trueVarName = varName;
|
||||
// 检查变量名中是否存在数组标记
|
||||
if (varName.contains('[')) {
|
||||
// 解析数组索引
|
||||
int startPos = varName.indexOf('[');
|
||||
int midPos = varName.indexOf("][");
|
||||
int endPos = varName.lastIndexOf(']');
|
||||
|
||||
// 如果是二维数组 (格式: name[index1][index2])
|
||||
if (midPos != -1) {
|
||||
bool ok1 = false, ok2 = false;
|
||||
index1 = varName.mid(startPos + 1, midPos - startPos - 1).toInt(&ok1);
|
||||
index2 = varName.mid(midPos + 2, endPos - midPos - 2).toInt(&ok2);
|
||||
|
||||
if (!ok1 || !ok2) {
|
||||
qWarning() << "无法解析数组索引:" << varName;
|
||||
index1 = 0;
|
||||
index2 = 0;
|
||||
}
|
||||
}
|
||||
// 如果是一维数组 (格式: name[index1])
|
||||
else if (startPos != -1 && endPos != -1) {
|
||||
bool ok = false;
|
||||
index1 = varName.mid(startPos + 1, endPos - startPos - 1).toInt(&ok);
|
||||
|
||||
if (!ok) {
|
||||
qWarning() << "无法解析数组索引:" << varName;
|
||||
index1 = 0;
|
||||
}
|
||||
}
|
||||
trueVarName = varName.left(startPos);
|
||||
}
|
||||
QMutexLocker locker(&mutex);
|
||||
auto it = getDataFunction.find(trueVarName);
|
||||
if (it == getDataFunction.end()) {
|
||||
return QString(); // 返回空字符串表示未找到
|
||||
}
|
||||
if (index1 < 0) {
|
||||
return it.value()(varName);
|
||||
} else if (index2 < 0) {
|
||||
QStringList list = it.value()(trueVarName).split(",");
|
||||
if (index1 >= list.size()) {
|
||||
qWarning() << "数组索引超出范围:" << varName;
|
||||
return QString();
|
||||
}
|
||||
return list[index1];
|
||||
} else {
|
||||
QStringList list = it.value()(trueVarName).split(",");
|
||||
if (index1 >= list.size()) {
|
||||
qWarning() << "数组索引超出范围:" << varName;
|
||||
return QString();
|
||||
}
|
||||
QStringList list2 = list[index1].split(" ");
|
||||
if (index2 >= list2.size()) {
|
||||
qWarning() << "数组索引超出范围:" << varName;
|
||||
return QString();
|
||||
}
|
||||
return list2[index2];
|
||||
}
|
||||
}
|
||||
|
||||
void Aerodynamics_output_Interface::outputDataListener(
|
||||
const XNSim::ATA04::Aerodynamics_output &output)
|
||||
{
|
||||
QMutexLocker locker(&mutex);
|
||||
this->output = output;
|
||||
}
|
||||
|
||||
Aerodynamics_heartbeat_Interface::Aerodynamics_heartbeat_Interface()
|
||||
{
|
||||
getDataFunction["aero_model_heartbeat"] = [this](const QString &varName) {
|
||||
return QString::number(heartbeat.aero_model_heartbeat());
|
||||
};
|
||||
}
|
||||
Aerodynamics_heartbeat_Interface::~Aerodynamics_heartbeat_Interface()
|
||||
{
|
||||
}
|
||||
|
||||
QString Aerodynamics_heartbeat_Interface::getData(const QString &varName)
|
||||
{
|
||||
int index1 = -1;
|
||||
int index2 = -1;
|
||||
QString trueVarName = varName;
|
||||
// 检查变量名中是否存在数组标记
|
||||
if (varName.contains('[')) {
|
||||
// 解析数组索引
|
||||
int startPos = varName.indexOf('[');
|
||||
int midPos = varName.indexOf("][");
|
||||
int endPos = varName.lastIndexOf(']');
|
||||
|
||||
// 如果是二维数组 (格式: name[index1][index2])
|
||||
if (midPos != -1) {
|
||||
bool ok1 = false, ok2 = false;
|
||||
index1 = varName.mid(startPos + 1, midPos - startPos - 1).toInt(&ok1);
|
||||
index2 = varName.mid(midPos + 2, endPos - midPos - 2).toInt(&ok2);
|
||||
|
||||
if (!ok1 || !ok2) {
|
||||
qWarning() << "无法解析数组索引:" << varName;
|
||||
index1 = 0;
|
||||
index2 = 0;
|
||||
}
|
||||
}
|
||||
// 如果是一维数组 (格式: name[index1])
|
||||
else if (startPos != -1 && endPos != -1) {
|
||||
bool ok = false;
|
||||
index1 = varName.mid(startPos + 1, endPos - startPos - 1).toInt(&ok);
|
||||
|
||||
if (!ok) {
|
||||
qWarning() << "无法解析数组索引:" << varName;
|
||||
index1 = 0;
|
||||
}
|
||||
}
|
||||
trueVarName = varName.left(startPos);
|
||||
}
|
||||
QMutexLocker locker(&mutex);
|
||||
auto it = getDataFunction.find(trueVarName);
|
||||
if (it == getDataFunction.end()) {
|
||||
return QString(); // 返回空字符串表示未找到
|
||||
}
|
||||
if (index1 < 0) {
|
||||
return it.value()(varName);
|
||||
} else if (index2 < 0) {
|
||||
QStringList list = it.value()(trueVarName).split(",");
|
||||
if (index1 >= list.size()) {
|
||||
qWarning() << "数组索引超出范围:" << varName;
|
||||
return QString();
|
||||
}
|
||||
return list[index1];
|
||||
} else {
|
||||
QStringList list = it.value()(trueVarName).split(",");
|
||||
if (index1 >= list.size()) {
|
||||
qWarning() << "数组索引超出范围:" << varName;
|
||||
return QString();
|
||||
}
|
||||
QStringList list2 = list[index1].split(" ");
|
||||
if (index2 >= list2.size()) {
|
||||
qWarning() << "数组索引超出范围:" << varName;
|
||||
return QString();
|
||||
}
|
||||
return list2[index2];
|
||||
}
|
||||
}
|
||||
|
||||
void Aerodynamics_heartbeat_Interface::heartbeatListener(
|
||||
const XNSim::ATA04::Aerodynamics_heartbeat &heartbeat)
|
||||
{
|
||||
QMutexLocker locker(&mutex);
|
||||
this->heartbeat = heartbeat;
|
||||
}
|
||||
} // namespace ATA04
|
||||
} // namespace XNSim
|
@ -1,55 +0,0 @@
|
||||
#include "XNAerodynamics.hpp"
|
||||
#include "XNAerodynamicsPubSubTypes.hpp"
|
||||
#include <QString>
|
||||
#include <QMutex>
|
||||
#include <QMutexLocker>
|
||||
#include <QHash>
|
||||
#include <functional>
|
||||
|
||||
namespace XNSim
|
||||
{
|
||||
namespace ATA04
|
||||
{
|
||||
class Aerodynamics_input_Interface
|
||||
{
|
||||
public:
|
||||
Aerodynamics_input_Interface();
|
||||
~Aerodynamics_input_Interface();
|
||||
QString getData(const QString &varName);
|
||||
void inputDataListener(const XNSim::ATA04::Aerodynamics_input &input);
|
||||
|
||||
private:
|
||||
XNSim::ATA04::Aerodynamics_input input;
|
||||
QHash<QString, std::function<QString(const QString &)>> getDataFunction;
|
||||
QMutex mutex;
|
||||
};
|
||||
|
||||
class Aerodynamics_output_Interface
|
||||
{
|
||||
public:
|
||||
Aerodynamics_output_Interface();
|
||||
~Aerodynamics_output_Interface();
|
||||
QString getData(const QString &varName);
|
||||
void outputDataListener(const XNSim::ATA04::Aerodynamics_output &output);
|
||||
|
||||
private:
|
||||
XNSim::ATA04::Aerodynamics_output output;
|
||||
QHash<QString, std::function<QString(const QString &)>> getDataFunction;
|
||||
QMutex mutex;
|
||||
};
|
||||
|
||||
class Aerodynamics_heartbeat_Interface
|
||||
{
|
||||
public:
|
||||
Aerodynamics_heartbeat_Interface();
|
||||
~Aerodynamics_heartbeat_Interface();
|
||||
QString getData(const QString &varName);
|
||||
void heartbeatListener(const XNSim::ATA04::Aerodynamics_heartbeat &heartbeat);
|
||||
|
||||
private:
|
||||
XNSim::ATA04::Aerodynamics_heartbeat heartbeat;
|
||||
QHash<QString, std::function<QString(const QString &)>> getDataFunction;
|
||||
QMutex mutex;
|
||||
};
|
||||
} // namespace ATA04
|
||||
} // namespace XNSim
|
@ -1,588 +0,0 @@
|
||||
// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
/*!
|
||||
* @file XNAerodynamicsPubSubTypes.cpp
|
||||
* This header file contains the implementation of the serialization functions.
|
||||
*
|
||||
* This file was generated by the tool fastddsgen.
|
||||
*/
|
||||
|
||||
#include "XNAerodynamicsPubSubTypes.hpp"
|
||||
|
||||
#include <fastdds/dds/log/Log.hpp>
|
||||
#include <fastdds/rtps/common/CdrSerialization.hpp>
|
||||
|
||||
#include "XNAerodynamicsCdrAux.hpp"
|
||||
#include "XNAerodynamicsTypeObjectSupport.hpp"
|
||||
|
||||
using SerializedPayload_t = eprosima::fastdds::rtps::SerializedPayload_t;
|
||||
using InstanceHandle_t = eprosima::fastdds::rtps::InstanceHandle_t;
|
||||
using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t;
|
||||
|
||||
namespace XNSim {
|
||||
namespace ATA04 {
|
||||
Aerodynamics_inputPubSubType::Aerodynamics_inputPubSubType()
|
||||
{
|
||||
set_name("XNSim::ATA04::Aerodynamics_input");
|
||||
uint32_t type_size = XNSim_ATA04_Aerodynamics_input_max_cdr_typesize;
|
||||
type_size += static_cast<uint32_t>(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */
|
||||
max_serialized_type_size = type_size + 4; /*encapsulation*/
|
||||
is_compute_key_provided = false;
|
||||
uint32_t key_length = XNSim_ATA04_Aerodynamics_input_max_key_cdr_typesize > 16 ? XNSim_ATA04_Aerodynamics_input_max_key_cdr_typesize : 16;
|
||||
key_buffer_ = reinterpret_cast<unsigned char*>(malloc(key_length));
|
||||
memset(key_buffer_, 0, key_length);
|
||||
}
|
||||
|
||||
Aerodynamics_inputPubSubType::~Aerodynamics_inputPubSubType()
|
||||
{
|
||||
if (key_buffer_ != nullptr)
|
||||
{
|
||||
free(key_buffer_);
|
||||
}
|
||||
}
|
||||
|
||||
bool Aerodynamics_inputPubSubType::serialize(
|
||||
const void* const data,
|
||||
SerializedPayload_t& payload,
|
||||
DataRepresentationId_t data_representation)
|
||||
{
|
||||
const Aerodynamics_input* p_type = static_cast<const Aerodynamics_input*>(data);
|
||||
|
||||
// Object that manages the raw buffer.
|
||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(payload.data), payload.max_size);
|
||||
// Object that serializes the data.
|
||||
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN,
|
||||
data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ?
|
||||
eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2);
|
||||
payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE;
|
||||
ser.set_encoding_flag(
|
||||
data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ?
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR :
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2);
|
||||
|
||||
try
|
||||
{
|
||||
// Serialize encapsulation
|
||||
ser.serialize_encapsulation();
|
||||
// Serialize the object.
|
||||
ser << *p_type;
|
||||
ser.set_dds_cdr_options({0,0});
|
||||
}
|
||||
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get the serialized length
|
||||
payload.length = static_cast<uint32_t>(ser.get_serialized_data_length());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Aerodynamics_inputPubSubType::deserialize(
|
||||
SerializedPayload_t& payload,
|
||||
void* data)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Convert DATA to pointer of your type
|
||||
Aerodynamics_input* p_type = static_cast<Aerodynamics_input*>(data);
|
||||
|
||||
// Object that manages the raw buffer.
|
||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(payload.data), payload.length);
|
||||
|
||||
// Object that deserializes the data.
|
||||
eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN);
|
||||
|
||||
// Deserialize encapsulation.
|
||||
deser.read_encapsulation();
|
||||
payload.encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE;
|
||||
|
||||
// Deserialize the object.
|
||||
deser >> *p_type;
|
||||
}
|
||||
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t Aerodynamics_inputPubSubType::calculate_serialized_size(
|
||||
const void* const data,
|
||||
DataRepresentationId_t data_representation)
|
||||
{
|
||||
try
|
||||
{
|
||||
eprosima::fastcdr::CdrSizeCalculator calculator(
|
||||
data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ?
|
||||
eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2);
|
||||
size_t current_alignment {0};
|
||||
return static_cast<uint32_t>(calculator.calculate_serialized_size(
|
||||
*static_cast<const Aerodynamics_input*>(data), current_alignment)) +
|
||||
4u /*encapsulation*/;
|
||||
}
|
||||
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void* Aerodynamics_inputPubSubType::create_data()
|
||||
{
|
||||
return reinterpret_cast<void*>(new Aerodynamics_input());
|
||||
}
|
||||
|
||||
void Aerodynamics_inputPubSubType::delete_data(
|
||||
void* data)
|
||||
{
|
||||
delete(reinterpret_cast<Aerodynamics_input*>(data));
|
||||
}
|
||||
|
||||
bool Aerodynamics_inputPubSubType::compute_key(
|
||||
SerializedPayload_t& payload,
|
||||
InstanceHandle_t& handle,
|
||||
bool force_md5)
|
||||
{
|
||||
if (!is_compute_key_provided)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Aerodynamics_input data;
|
||||
if (deserialize(payload, static_cast<void*>(&data)))
|
||||
{
|
||||
return compute_key(static_cast<void*>(&data), handle, force_md5);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Aerodynamics_inputPubSubType::compute_key(
|
||||
const void* const data,
|
||||
InstanceHandle_t& handle,
|
||||
bool force_md5)
|
||||
{
|
||||
if (!is_compute_key_provided)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const Aerodynamics_input* p_type = static_cast<const Aerodynamics_input*>(data);
|
||||
|
||||
// Object that manages the raw buffer.
|
||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(key_buffer_),
|
||||
XNSim_ATA04_Aerodynamics_input_max_key_cdr_typesize);
|
||||
|
||||
// Object that serializes the data.
|
||||
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2);
|
||||
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2);
|
||||
eprosima::fastcdr::serialize_key(ser, *p_type);
|
||||
if (force_md5 || XNSim_ATA04_Aerodynamics_input_max_key_cdr_typesize > 16)
|
||||
{
|
||||
md5_.init();
|
||||
md5_.update(key_buffer_, static_cast<unsigned int>(ser.get_serialized_data_length()));
|
||||
md5_.finalize();
|
||||
for (uint8_t i = 0; i < 16; ++i)
|
||||
{
|
||||
handle.value[i] = md5_.digest[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (uint8_t i = 0; i < 16; ++i)
|
||||
{
|
||||
handle.value[i] = key_buffer_[i];
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void Aerodynamics_inputPubSubType::register_type_object_representation()
|
||||
{
|
||||
register_Aerodynamics_input_type_identifier(type_identifiers_);
|
||||
}
|
||||
|
||||
Aerodynamics_outputPubSubType::Aerodynamics_outputPubSubType()
|
||||
{
|
||||
set_name("XNSim::ATA04::Aerodynamics_output");
|
||||
uint32_t type_size = XNSim_ATA04_Aerodynamics_output_max_cdr_typesize;
|
||||
type_size += static_cast<uint32_t>(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */
|
||||
max_serialized_type_size = type_size + 4; /*encapsulation*/
|
||||
is_compute_key_provided = false;
|
||||
uint32_t key_length = XNSim_ATA04_Aerodynamics_output_max_key_cdr_typesize > 16 ? XNSim_ATA04_Aerodynamics_output_max_key_cdr_typesize : 16;
|
||||
key_buffer_ = reinterpret_cast<unsigned char*>(malloc(key_length));
|
||||
memset(key_buffer_, 0, key_length);
|
||||
}
|
||||
|
||||
Aerodynamics_outputPubSubType::~Aerodynamics_outputPubSubType()
|
||||
{
|
||||
if (key_buffer_ != nullptr)
|
||||
{
|
||||
free(key_buffer_);
|
||||
}
|
||||
}
|
||||
|
||||
bool Aerodynamics_outputPubSubType::serialize(
|
||||
const void* const data,
|
||||
SerializedPayload_t& payload,
|
||||
DataRepresentationId_t data_representation)
|
||||
{
|
||||
const Aerodynamics_output* p_type = static_cast<const Aerodynamics_output*>(data);
|
||||
|
||||
// Object that manages the raw buffer.
|
||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(payload.data), payload.max_size);
|
||||
// Object that serializes the data.
|
||||
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN,
|
||||
data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ?
|
||||
eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2);
|
||||
payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE;
|
||||
ser.set_encoding_flag(
|
||||
data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ?
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR :
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2);
|
||||
|
||||
try
|
||||
{
|
||||
// Serialize encapsulation
|
||||
ser.serialize_encapsulation();
|
||||
// Serialize the object.
|
||||
ser << *p_type;
|
||||
ser.set_dds_cdr_options({0,0});
|
||||
}
|
||||
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get the serialized length
|
||||
payload.length = static_cast<uint32_t>(ser.get_serialized_data_length());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Aerodynamics_outputPubSubType::deserialize(
|
||||
SerializedPayload_t& payload,
|
||||
void* data)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Convert DATA to pointer of your type
|
||||
Aerodynamics_output* p_type = static_cast<Aerodynamics_output*>(data);
|
||||
|
||||
// Object that manages the raw buffer.
|
||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(payload.data), payload.length);
|
||||
|
||||
// Object that deserializes the data.
|
||||
eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN);
|
||||
|
||||
// Deserialize encapsulation.
|
||||
deser.read_encapsulation();
|
||||
payload.encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE;
|
||||
|
||||
// Deserialize the object.
|
||||
deser >> *p_type;
|
||||
}
|
||||
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t Aerodynamics_outputPubSubType::calculate_serialized_size(
|
||||
const void* const data,
|
||||
DataRepresentationId_t data_representation)
|
||||
{
|
||||
try
|
||||
{
|
||||
eprosima::fastcdr::CdrSizeCalculator calculator(
|
||||
data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ?
|
||||
eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2);
|
||||
size_t current_alignment {0};
|
||||
return static_cast<uint32_t>(calculator.calculate_serialized_size(
|
||||
*static_cast<const Aerodynamics_output*>(data), current_alignment)) +
|
||||
4u /*encapsulation*/;
|
||||
}
|
||||
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void* Aerodynamics_outputPubSubType::create_data()
|
||||
{
|
||||
return reinterpret_cast<void*>(new Aerodynamics_output());
|
||||
}
|
||||
|
||||
void Aerodynamics_outputPubSubType::delete_data(
|
||||
void* data)
|
||||
{
|
||||
delete(reinterpret_cast<Aerodynamics_output*>(data));
|
||||
}
|
||||
|
||||
bool Aerodynamics_outputPubSubType::compute_key(
|
||||
SerializedPayload_t& payload,
|
||||
InstanceHandle_t& handle,
|
||||
bool force_md5)
|
||||
{
|
||||
if (!is_compute_key_provided)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Aerodynamics_output data;
|
||||
if (deserialize(payload, static_cast<void*>(&data)))
|
||||
{
|
||||
return compute_key(static_cast<void*>(&data), handle, force_md5);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Aerodynamics_outputPubSubType::compute_key(
|
||||
const void* const data,
|
||||
InstanceHandle_t& handle,
|
||||
bool force_md5)
|
||||
{
|
||||
if (!is_compute_key_provided)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const Aerodynamics_output* p_type = static_cast<const Aerodynamics_output*>(data);
|
||||
|
||||
// Object that manages the raw buffer.
|
||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(key_buffer_),
|
||||
XNSim_ATA04_Aerodynamics_output_max_key_cdr_typesize);
|
||||
|
||||
// Object that serializes the data.
|
||||
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2);
|
||||
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2);
|
||||
eprosima::fastcdr::serialize_key(ser, *p_type);
|
||||
if (force_md5 || XNSim_ATA04_Aerodynamics_output_max_key_cdr_typesize > 16)
|
||||
{
|
||||
md5_.init();
|
||||
md5_.update(key_buffer_, static_cast<unsigned int>(ser.get_serialized_data_length()));
|
||||
md5_.finalize();
|
||||
for (uint8_t i = 0; i < 16; ++i)
|
||||
{
|
||||
handle.value[i] = md5_.digest[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (uint8_t i = 0; i < 16; ++i)
|
||||
{
|
||||
handle.value[i] = key_buffer_[i];
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void Aerodynamics_outputPubSubType::register_type_object_representation()
|
||||
{
|
||||
register_Aerodynamics_output_type_identifier(type_identifiers_);
|
||||
}
|
||||
|
||||
Aerodynamics_heartbeatPubSubType::Aerodynamics_heartbeatPubSubType()
|
||||
{
|
||||
set_name("XNSim::ATA04::Aerodynamics_heartbeat");
|
||||
uint32_t type_size = XNSim_ATA04_Aerodynamics_heartbeat_max_cdr_typesize;
|
||||
type_size += static_cast<uint32_t>(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */
|
||||
max_serialized_type_size = type_size + 4; /*encapsulation*/
|
||||
is_compute_key_provided = false;
|
||||
uint32_t key_length = XNSim_ATA04_Aerodynamics_heartbeat_max_key_cdr_typesize > 16 ? XNSim_ATA04_Aerodynamics_heartbeat_max_key_cdr_typesize : 16;
|
||||
key_buffer_ = reinterpret_cast<unsigned char*>(malloc(key_length));
|
||||
memset(key_buffer_, 0, key_length);
|
||||
}
|
||||
|
||||
Aerodynamics_heartbeatPubSubType::~Aerodynamics_heartbeatPubSubType()
|
||||
{
|
||||
if (key_buffer_ != nullptr)
|
||||
{
|
||||
free(key_buffer_);
|
||||
}
|
||||
}
|
||||
|
||||
bool Aerodynamics_heartbeatPubSubType::serialize(
|
||||
const void* const data,
|
||||
SerializedPayload_t& payload,
|
||||
DataRepresentationId_t data_representation)
|
||||
{
|
||||
const Aerodynamics_heartbeat* p_type = static_cast<const Aerodynamics_heartbeat*>(data);
|
||||
|
||||
// Object that manages the raw buffer.
|
||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(payload.data), payload.max_size);
|
||||
// Object that serializes the data.
|
||||
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN,
|
||||
data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ?
|
||||
eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2);
|
||||
payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE;
|
||||
ser.set_encoding_flag(
|
||||
data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ?
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR :
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2);
|
||||
|
||||
try
|
||||
{
|
||||
// Serialize encapsulation
|
||||
ser.serialize_encapsulation();
|
||||
// Serialize the object.
|
||||
ser << *p_type;
|
||||
ser.set_dds_cdr_options({0,0});
|
||||
}
|
||||
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get the serialized length
|
||||
payload.length = static_cast<uint32_t>(ser.get_serialized_data_length());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Aerodynamics_heartbeatPubSubType::deserialize(
|
||||
SerializedPayload_t& payload,
|
||||
void* data)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Convert DATA to pointer of your type
|
||||
Aerodynamics_heartbeat* p_type = static_cast<Aerodynamics_heartbeat*>(data);
|
||||
|
||||
// Object that manages the raw buffer.
|
||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(payload.data), payload.length);
|
||||
|
||||
// Object that deserializes the data.
|
||||
eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN);
|
||||
|
||||
// Deserialize encapsulation.
|
||||
deser.read_encapsulation();
|
||||
payload.encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE;
|
||||
|
||||
// Deserialize the object.
|
||||
deser >> *p_type;
|
||||
}
|
||||
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t Aerodynamics_heartbeatPubSubType::calculate_serialized_size(
|
||||
const void* const data,
|
||||
DataRepresentationId_t data_representation)
|
||||
{
|
||||
try
|
||||
{
|
||||
eprosima::fastcdr::CdrSizeCalculator calculator(
|
||||
data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ?
|
||||
eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2);
|
||||
size_t current_alignment {0};
|
||||
return static_cast<uint32_t>(calculator.calculate_serialized_size(
|
||||
*static_cast<const Aerodynamics_heartbeat*>(data), current_alignment)) +
|
||||
4u /*encapsulation*/;
|
||||
}
|
||||
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void* Aerodynamics_heartbeatPubSubType::create_data()
|
||||
{
|
||||
return reinterpret_cast<void*>(new Aerodynamics_heartbeat());
|
||||
}
|
||||
|
||||
void Aerodynamics_heartbeatPubSubType::delete_data(
|
||||
void* data)
|
||||
{
|
||||
delete(reinterpret_cast<Aerodynamics_heartbeat*>(data));
|
||||
}
|
||||
|
||||
bool Aerodynamics_heartbeatPubSubType::compute_key(
|
||||
SerializedPayload_t& payload,
|
||||
InstanceHandle_t& handle,
|
||||
bool force_md5)
|
||||
{
|
||||
if (!is_compute_key_provided)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Aerodynamics_heartbeat data;
|
||||
if (deserialize(payload, static_cast<void*>(&data)))
|
||||
{
|
||||
return compute_key(static_cast<void*>(&data), handle, force_md5);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Aerodynamics_heartbeatPubSubType::compute_key(
|
||||
const void* const data,
|
||||
InstanceHandle_t& handle,
|
||||
bool force_md5)
|
||||
{
|
||||
if (!is_compute_key_provided)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const Aerodynamics_heartbeat* p_type = static_cast<const Aerodynamics_heartbeat*>(data);
|
||||
|
||||
// Object that manages the raw buffer.
|
||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(key_buffer_),
|
||||
XNSim_ATA04_Aerodynamics_heartbeat_max_key_cdr_typesize);
|
||||
|
||||
// Object that serializes the data.
|
||||
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2);
|
||||
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2);
|
||||
eprosima::fastcdr::serialize_key(ser, *p_type);
|
||||
if (force_md5 || XNSim_ATA04_Aerodynamics_heartbeat_max_key_cdr_typesize > 16)
|
||||
{
|
||||
md5_.init();
|
||||
md5_.update(key_buffer_, static_cast<unsigned int>(ser.get_serialized_data_length()));
|
||||
md5_.finalize();
|
||||
for (uint8_t i = 0; i < 16; ++i)
|
||||
{
|
||||
handle.value[i] = md5_.digest[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (uint8_t i = 0; i < 16; ++i)
|
||||
{
|
||||
handle.value[i] = key_buffer_[i];
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void Aerodynamics_heartbeatPubSubType::register_type_object_representation()
|
||||
{
|
||||
register_Aerodynamics_heartbeat_type_identifier(type_identifiers_);
|
||||
}
|
||||
|
||||
} // namespace ATA04
|
||||
|
||||
} // namespace XNSim
|
||||
|
||||
|
||||
// Include auxiliary functions like for serializing/deserializing.
|
||||
#include "XNAerodynamicsCdrAux.ipp"
|
@ -1,291 +0,0 @@
|
||||
// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
/*!
|
||||
* @file XNAerodynamicsPubSubTypes.hpp
|
||||
* This header file contains the declaration of the serialization functions.
|
||||
*
|
||||
* This file was generated by the tool fastddsgen.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef FAST_DDS_GENERATED__XNSIM_ATA04_XNAERODYNAMICS_PUBSUBTYPES_HPP
|
||||
#define FAST_DDS_GENERATED__XNSIM_ATA04_XNAERODYNAMICS_PUBSUBTYPES_HPP
|
||||
|
||||
#include <fastdds/dds/core/policy/QosPolicies.hpp>
|
||||
#include <fastdds/dds/topic/TopicDataType.hpp>
|
||||
#include <fastdds/rtps/common/InstanceHandle.hpp>
|
||||
#include <fastdds/rtps/common/SerializedPayload.hpp>
|
||||
#include <fastdds/utils/md5.hpp>
|
||||
|
||||
#include "XNAerodynamics.hpp"
|
||||
|
||||
|
||||
#if !defined(FASTDDS_GEN_API_VER) || (FASTDDS_GEN_API_VER != 3)
|
||||
#error \
|
||||
Generated XNAerodynamics is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen.
|
||||
#endif // FASTDDS_GEN_API_VER
|
||||
|
||||
namespace XNSim
|
||||
{
|
||||
namespace ATA04
|
||||
{
|
||||
|
||||
/*!
|
||||
* @brief This class represents the TopicDataType of the type Aerodynamics_input defined by the user in the IDL file.
|
||||
* @ingroup XNAerodynamics
|
||||
*/
|
||||
class Aerodynamics_inputPubSubType : public eprosima::fastdds::dds::TopicDataType
|
||||
{
|
||||
public:
|
||||
|
||||
typedef Aerodynamics_input type;
|
||||
|
||||
eProsima_user_DllExport Aerodynamics_inputPubSubType();
|
||||
|
||||
eProsima_user_DllExport ~Aerodynamics_inputPubSubType() override;
|
||||
|
||||
eProsima_user_DllExport bool serialize(
|
||||
const void* const data,
|
||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) override;
|
||||
|
||||
eProsima_user_DllExport bool deserialize(
|
||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
||||
void* data) override;
|
||||
|
||||
eProsima_user_DllExport uint32_t calculate_serialized_size(
|
||||
const void* const data,
|
||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) override;
|
||||
|
||||
eProsima_user_DllExport bool compute_key(
|
||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
||||
eprosima::fastdds::rtps::InstanceHandle_t& ihandle,
|
||||
bool force_md5 = false) override;
|
||||
|
||||
eProsima_user_DllExport bool compute_key(
|
||||
const void* const data,
|
||||
eprosima::fastdds::rtps::InstanceHandle_t& ihandle,
|
||||
bool force_md5 = false) override;
|
||||
|
||||
eProsima_user_DllExport void* create_data() override;
|
||||
|
||||
eProsima_user_DllExport void delete_data(
|
||||
void* data) override;
|
||||
|
||||
//Register TypeObject representation in Fast DDS TypeObjectRegistry
|
||||
eProsima_user_DllExport void register_type_object_representation() override;
|
||||
|
||||
#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
|
||||
eProsima_user_DllExport inline bool is_bounded() const override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
|
||||
|
||||
#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
|
||||
|
||||
eProsima_user_DllExport inline bool is_plain(
|
||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override
|
||||
{
|
||||
static_cast<void>(data_representation);
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
|
||||
|
||||
#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
|
||||
eProsima_user_DllExport inline bool construct_sample(
|
||||
void* memory) const override
|
||||
{
|
||||
static_cast<void>(memory);
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
|
||||
|
||||
private:
|
||||
|
||||
eprosima::fastdds::MD5 md5_;
|
||||
unsigned char* key_buffer_;
|
||||
|
||||
};
|
||||
|
||||
/*!
|
||||
* @brief This class represents the TopicDataType of the type Aerodynamics_output defined by the user in the IDL file.
|
||||
* @ingroup XNAerodynamics
|
||||
*/
|
||||
class Aerodynamics_outputPubSubType : public eprosima::fastdds::dds::TopicDataType
|
||||
{
|
||||
public:
|
||||
|
||||
typedef Aerodynamics_output type;
|
||||
|
||||
eProsima_user_DllExport Aerodynamics_outputPubSubType();
|
||||
|
||||
eProsima_user_DllExport ~Aerodynamics_outputPubSubType() override;
|
||||
|
||||
eProsima_user_DllExport bool serialize(
|
||||
const void* const data,
|
||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) override;
|
||||
|
||||
eProsima_user_DllExport bool deserialize(
|
||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
||||
void* data) override;
|
||||
|
||||
eProsima_user_DllExport uint32_t calculate_serialized_size(
|
||||
const void* const data,
|
||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) override;
|
||||
|
||||
eProsima_user_DllExport bool compute_key(
|
||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
||||
eprosima::fastdds::rtps::InstanceHandle_t& ihandle,
|
||||
bool force_md5 = false) override;
|
||||
|
||||
eProsima_user_DllExport bool compute_key(
|
||||
const void* const data,
|
||||
eprosima::fastdds::rtps::InstanceHandle_t& ihandle,
|
||||
bool force_md5 = false) override;
|
||||
|
||||
eProsima_user_DllExport void* create_data() override;
|
||||
|
||||
eProsima_user_DllExport void delete_data(
|
||||
void* data) override;
|
||||
|
||||
//Register TypeObject representation in Fast DDS TypeObjectRegistry
|
||||
eProsima_user_DllExport void register_type_object_representation() override;
|
||||
|
||||
#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
|
||||
eProsima_user_DllExport inline bool is_bounded() const override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
|
||||
|
||||
#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
|
||||
|
||||
eProsima_user_DllExport inline bool is_plain(
|
||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override
|
||||
{
|
||||
static_cast<void>(data_representation);
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
|
||||
|
||||
#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
|
||||
eProsima_user_DllExport inline bool construct_sample(
|
||||
void* memory) const override
|
||||
{
|
||||
static_cast<void>(memory);
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
|
||||
|
||||
private:
|
||||
|
||||
eprosima::fastdds::MD5 md5_;
|
||||
unsigned char* key_buffer_;
|
||||
|
||||
};
|
||||
|
||||
/*!
|
||||
* @brief This class represents the TopicDataType of the type Aerodynamics_heartbeat defined by the user in the IDL file.
|
||||
* @ingroup XNAerodynamics
|
||||
*/
|
||||
class Aerodynamics_heartbeatPubSubType : public eprosima::fastdds::dds::TopicDataType
|
||||
{
|
||||
public:
|
||||
|
||||
typedef Aerodynamics_heartbeat type;
|
||||
|
||||
eProsima_user_DllExport Aerodynamics_heartbeatPubSubType();
|
||||
|
||||
eProsima_user_DllExport ~Aerodynamics_heartbeatPubSubType() override;
|
||||
|
||||
eProsima_user_DllExport bool serialize(
|
||||
const void* const data,
|
||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) override;
|
||||
|
||||
eProsima_user_DllExport bool deserialize(
|
||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
||||
void* data) override;
|
||||
|
||||
eProsima_user_DllExport uint32_t calculate_serialized_size(
|
||||
const void* const data,
|
||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) override;
|
||||
|
||||
eProsima_user_DllExport bool compute_key(
|
||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
||||
eprosima::fastdds::rtps::InstanceHandle_t& ihandle,
|
||||
bool force_md5 = false) override;
|
||||
|
||||
eProsima_user_DllExport bool compute_key(
|
||||
const void* const data,
|
||||
eprosima::fastdds::rtps::InstanceHandle_t& ihandle,
|
||||
bool force_md5 = false) override;
|
||||
|
||||
eProsima_user_DllExport void* create_data() override;
|
||||
|
||||
eProsima_user_DllExport void delete_data(
|
||||
void* data) override;
|
||||
|
||||
//Register TypeObject representation in Fast DDS TypeObjectRegistry
|
||||
eProsima_user_DllExport void register_type_object_representation() override;
|
||||
|
||||
#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
|
||||
eProsima_user_DllExport inline bool is_bounded() const override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
|
||||
|
||||
#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
|
||||
|
||||
eProsima_user_DllExport inline bool is_plain(
|
||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override
|
||||
{
|
||||
static_cast<void>(data_representation);
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
|
||||
|
||||
#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
|
||||
eProsima_user_DllExport inline bool construct_sample(
|
||||
void* memory) const override
|
||||
{
|
||||
static_cast<void>(memory);
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
|
||||
|
||||
private:
|
||||
|
||||
eprosima::fastdds::MD5 md5_;
|
||||
unsigned char* key_buffer_;
|
||||
|
||||
};
|
||||
} // namespace ATA04
|
||||
} // namespace XNSim
|
||||
|
||||
#endif // FAST_DDS_GENERATED__XNSIM_ATA04_XNAERODYNAMICS_PUBSUBTYPES_HPP
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,88 +0,0 @@
|
||||
// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
/*!
|
||||
* @file XNAerodynamicsTypeObjectSupport.hpp
|
||||
* Header file containing the API required to register the TypeObject representation of the described types in the IDL file
|
||||
*
|
||||
* This file was generated by the tool fastddsgen.
|
||||
*/
|
||||
|
||||
#ifndef FAST_DDS_GENERATED__XNSIM_ATA04_XNAERODYNAMICS_TYPE_OBJECT_SUPPORT_HPP
|
||||
#define FAST_DDS_GENERATED__XNSIM_ATA04_XNAERODYNAMICS_TYPE_OBJECT_SUPPORT_HPP
|
||||
|
||||
#include <fastdds/dds/xtypes/type_representation/TypeObject.hpp>
|
||||
|
||||
|
||||
#if defined(_WIN32)
|
||||
#if defined(EPROSIMA_USER_DLL_EXPORT)
|
||||
#define eProsima_user_DllExport __declspec( dllexport )
|
||||
#else
|
||||
#define eProsima_user_DllExport
|
||||
#endif // EPROSIMA_USER_DLL_EXPORT
|
||||
#else
|
||||
#define eProsima_user_DllExport
|
||||
#endif // _WIN32
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
|
||||
|
||||
namespace XNSim {
|
||||
namespace ATA04 {
|
||||
/**
|
||||
* @brief Register Aerodynamics_input related TypeIdentifier.
|
||||
* Fully-descriptive TypeIdentifiers are directly registered.
|
||||
* Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is
|
||||
* indirectly registered as well.
|
||||
*
|
||||
* @param[out] TypeIdentifier of the registered type.
|
||||
* The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers.
|
||||
* Invalid TypeIdentifier is returned in case of error.
|
||||
*/
|
||||
eProsima_user_DllExport void register_Aerodynamics_input_type_identifier(
|
||||
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
|
||||
|
||||
/**
|
||||
* @brief Register Aerodynamics_output related TypeIdentifier.
|
||||
* Fully-descriptive TypeIdentifiers are directly registered.
|
||||
* Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is
|
||||
* indirectly registered as well.
|
||||
*
|
||||
* @param[out] TypeIdentifier of the registered type.
|
||||
* The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers.
|
||||
* Invalid TypeIdentifier is returned in case of error.
|
||||
*/
|
||||
eProsima_user_DllExport void register_Aerodynamics_output_type_identifier(
|
||||
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
|
||||
|
||||
/**
|
||||
* @brief Register Aerodynamics_heartbeat related TypeIdentifier.
|
||||
* Fully-descriptive TypeIdentifiers are directly registered.
|
||||
* Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is
|
||||
* indirectly registered as well.
|
||||
*
|
||||
* @param[out] TypeIdentifier of the registered type.
|
||||
* The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers.
|
||||
* Invalid TypeIdentifier is returned in case of error.
|
||||
*/
|
||||
eProsima_user_DllExport void register_Aerodynamics_heartbeat_type_identifier(
|
||||
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
|
||||
|
||||
} // namespace ATA04
|
||||
|
||||
} // namespace XNSim
|
||||
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
|
||||
|
||||
#endif // FAST_DDS_GENERATED__XNSIM_ATA04_XNAERODYNAMICS_TYPE_OBJECT_SUPPORT_HPP
|
@ -1,6 +1,9 @@
|
||||
#pragma once
|
||||
#include <XNCore/XNModelObject_p.h>
|
||||
#include <DataModels/libSACSCAerodynamics_V2.0.3.5H/std_04_dll.h>
|
||||
#include <C909_V1/ATA04/Aerodynamics_input.hpp>
|
||||
#include <C909_V1/ATA04/Aerodynamics_output.hpp>
|
||||
#include <C909_V1/ATA04/Aerodynamics_heartbeat.hpp>
|
||||
|
||||
typedef void (*FunctionType)(ComacDataStructure_S *);
|
||||
|
||||
@ -12,4 +15,8 @@ struct XNAerodynamicsPrivate : public XNModelObjectPrivate {
|
||||
std::string _entryPointName = "_Z27SACSCAerodynamicsEntryPointP20ComacDataStructure_S";
|
||||
|
||||
std::mutex _mutex;
|
||||
|
||||
XNSim::C909::ATA04::Aerodynamics_input_Interface _inputInterface;
|
||||
XNSim::C909::ATA04::Aerodynamics_output_Interface _outputInterface;
|
||||
XNSim::C909::ATA04::Aerodynamics_heartbeat_Interface _heartbeatInterface;
|
||||
};
|
@ -22,7 +22,6 @@ add_library(XNGroundHandling SHARED
|
||||
XNGroundHandling.cpp
|
||||
XNGroundHandling.h
|
||||
XNGroundHandling_p.h
|
||||
${DDS_XNIDL_SOURCES_CXX}
|
||||
)
|
||||
|
||||
target_link_libraries(XNGroundHandling PRIVATE
|
||||
|
@ -1,7 +1,6 @@
|
||||
#include "XNGroundHandling.h"
|
||||
#include "XNGroundHandling_p.h"
|
||||
#include <XNCore/XNModelManager.h>
|
||||
#include <XNCore/XNDDSManager.h>
|
||||
|
||||
XN_MODEL_INITIALIZE(XNGroundHandling)
|
||||
|
||||
@ -11,6 +10,7 @@ XNGroundHandling::XNGroundHandling() : XNModelObject(new XNGroundHandlingPrivate
|
||||
|
||||
XNGroundHandling::~XNGroundHandling()
|
||||
{
|
||||
ReleaseData();
|
||||
}
|
||||
|
||||
XNGroundHandling::XNGroundHandling(PrivateType *p) : XNModelObject(p)
|
||||
@ -34,6 +34,29 @@ void XNGroundHandling::PrepareForExecute()
|
||||
{
|
||||
T_D();
|
||||
XNModelObject::PrepareForExecute();
|
||||
InitializeData();
|
||||
d->_inputInterface.Initialize(GetFramework(), GetUniqueId(), 1);
|
||||
d->_outputInterface.Initialize(GetFramework(), GetUniqueId(), 2);
|
||||
d->_heartbeatInterface.Initialize(GetFramework(), GetUniqueId(), 2);
|
||||
}
|
||||
|
||||
void XNGroundHandling::StepUpdate()
|
||||
{
|
||||
T_D();
|
||||
XNModelObject::StepUpdate();
|
||||
if (d->_fun) {
|
||||
//add your input code here
|
||||
d->_inputInterface.getData(d->_data.input_ground);
|
||||
d->_fun(&d->_data);
|
||||
d->_outputInterface.setData(d->_data.output_ground);
|
||||
d->_heartbeatInterface.setData(&d->_data);
|
||||
//add your output code here
|
||||
}
|
||||
}
|
||||
|
||||
void XNGroundHandling::InitializeData()
|
||||
{
|
||||
T_D();
|
||||
//add your initial data code here
|
||||
d->_data.input_ground = new input_ground_S();
|
||||
d->_data.input_ground->l_04_i_gdcomac_brake_torq_f8 = new double *[3];
|
||||
@ -111,21 +134,178 @@ void XNGroundHandling::PrepareForExecute()
|
||||
for (int i = 0; i < 3; i++) {
|
||||
d->_data.output_ground->l_04_o_gdcomac_vczt_f8[i] = new double[2];
|
||||
}
|
||||
d->_inputInterface.Initialize(GetFramework(), GetUniqueId(), 1);
|
||||
d->_outputInterface.Initialize(GetFramework(), GetUniqueId(), 2);
|
||||
d->_heartbeatInterface.Initialize(GetFramework(), GetUniqueId(), 2);
|
||||
}
|
||||
|
||||
void XNGroundHandling::StepUpdate()
|
||||
void XNGroundHandling::ReleaseData()
|
||||
{
|
||||
T_D();
|
||||
XNModelObject::StepUpdate();
|
||||
if (d->_fun) {
|
||||
//add your input code here
|
||||
d->_inputInterface.getData(d->_data.input_ground);
|
||||
d->_fun(&d->_data);
|
||||
d->_outputInterface.setData(d->_data.output_ground);
|
||||
d->_heartbeatInterface.setData(&d->_data);
|
||||
//add your output code here
|
||||
// 释放内存
|
||||
if (d->_data.input_ground) {
|
||||
if (d->_data.input_ground->l_04_i_gdcomac_brake_torq_f8) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (d->_data.input_ground->l_04_i_gdcomac_brake_torq_f8[i]) {
|
||||
delete[] d->_data.input_ground->l_04_i_gdcomac_brake_torq_f8[i];
|
||||
}
|
||||
}
|
||||
delete[] d->_data.input_ground->l_04_i_gdcomac_brake_torq_f8;
|
||||
}
|
||||
if (d->_data.input_ground->l_04_i_gdcomac_gear_f8) {
|
||||
delete[] d->_data.input_ground->l_04_i_gdcomac_gear_f8;
|
||||
}
|
||||
if (d->_data.input_ground->l_04_i_gdcomac_gsteer_f8) {
|
||||
delete[] d->_data.input_ground->l_04_i_gdcomac_gsteer_f8;
|
||||
}
|
||||
if (d->_data.input_ground->l_04_i_gdcomac_tire_pres_f8) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (d->_data.input_ground->l_04_i_gdcomac_tire_pres_f8[i]) {
|
||||
delete[] d->_data.input_ground->l_04_i_gdcomac_tire_pres_f8[i];
|
||||
}
|
||||
}
|
||||
delete[] d->_data.input_ground->l_04_i_gdcomac_tire_pres_f8;
|
||||
}
|
||||
if (d->_data.input_ground->l_04_i_gdcomac_contdep_f8) {
|
||||
delete[] d->_data.input_ground->l_04_i_gdcomac_contdep_f8;
|
||||
}
|
||||
if (d->_data.input_ground->l_04_i_gdcomac_brake_temp_f8) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (d->_data.input_ground->l_04_i_gdcomac_brake_temp_f8[i]) {
|
||||
delete[] d->_data.input_ground->l_04_i_gdcomac_brake_temp_f8[i];
|
||||
}
|
||||
}
|
||||
delete[] d->_data.input_ground->l_04_i_gdcomac_brake_temp_f8;
|
||||
}
|
||||
if (d->_data.input_ground->l_04_i_gdcomac_tire_tburst_l1) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (d->_data.input_ground->l_04_i_gdcomac_tire_tburst_l1[i]) {
|
||||
delete[] d->_data.input_ground->l_04_i_gdcomac_tire_tburst_l1[i];
|
||||
}
|
||||
}
|
||||
delete[] d->_data.input_ground->l_04_i_gdcomac_tire_tburst_l1;
|
||||
}
|
||||
if (d->_data.input_ground->l_04_i_gdcomac_tire_tflat_l1) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (d->_data.input_ground->l_04_i_gdcomac_tire_tflat_l1[i]) {
|
||||
delete[] d->_data.input_ground->l_04_i_gdcomac_tire_tflat_l1[i];
|
||||
}
|
||||
}
|
||||
delete[] d->_data.input_ground->l_04_i_gdcomac_tire_tflat_l1;
|
||||
}
|
||||
if (d->_data.input_ground->l_04_i_gdcomac_rcon_ci_f8) {
|
||||
delete[] d->_data.input_ground->l_04_i_gdcomac_rcon_ci_f8;
|
||||
}
|
||||
delete d->_data.input_ground;
|
||||
}
|
||||
if (d->_data.output_ground) {
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_fygs_f8) {
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_fygs_f8;
|
||||
}
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_mzgs_f8) {
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_mzgs_f8;
|
||||
}
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_mu_f8) {
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_mu_f8;
|
||||
}
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_dstroke_f8) {
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_dstroke_f8;
|
||||
}
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_sr_f8) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_sr_f8[i]) {
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_sr_f8[i];
|
||||
}
|
||||
}
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_sr_f8;
|
||||
}
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_sy_f8) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_sy_f8[i]) {
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_sy_f8[i];
|
||||
}
|
||||
}
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_sy_f8;
|
||||
}
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_sx_f8) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_sx_f8[i]) {
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_sx_f8[i];
|
||||
}
|
||||
}
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_sx_f8;
|
||||
}
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_xft_f8) {
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_xft_f8;
|
||||
}
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_yft_f8) {
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_yft_f8;
|
||||
}
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_zft_f8) {
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_zft_f8;
|
||||
}
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_tire_vel_f8) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_tire_vel_f8[i]) {
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_tire_vel_f8[i];
|
||||
}
|
||||
}
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_tire_vel_f8;
|
||||
}
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_tire_temp_f8) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_tire_temp_f8[i]) {
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_tire_temp_f8[i];
|
||||
}
|
||||
}
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_tire_temp_f8;
|
||||
}
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_tire_burst_l1) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_tire_burst_l1[i]) {
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_tire_burst_l1[i];
|
||||
}
|
||||
}
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_tire_burst_l1;
|
||||
}
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_utirew_f8) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_utirew_f8[i]) {
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_utirew_f8[i];
|
||||
}
|
||||
}
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_utirew_f8;
|
||||
}
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_vtirew_f8) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_vtirew_f8[i]) {
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_vtirew_f8[i];
|
||||
}
|
||||
}
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_vtirew_f8;
|
||||
}
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_whl_omega_f8) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_whl_omega_f8[i]) {
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_whl_omega_f8[i];
|
||||
}
|
||||
}
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_whl_omega_f8;
|
||||
}
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_dstruc_f8) {
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_dstruc_f8;
|
||||
}
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_nd_f8) {
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_nd_f8;
|
||||
}
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_wor_par_f8) {
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_wor_par_f8;
|
||||
}
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_vczt_f8) {
|
||||
for (int i = 0; i < 3; i++) {
|
||||
if (d->_data.output_ground->l_04_o_gdcomac_vczt_f8[i]) {
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_vczt_f8[i];
|
||||
}
|
||||
}
|
||||
delete[] d->_data.output_ground->l_04_o_gdcomac_vczt_f8;
|
||||
}
|
||||
delete d->_data.output_ground;
|
||||
}
|
||||
}
|
@ -19,6 +19,10 @@ public:
|
||||
virtual void Initialize() override;
|
||||
virtual void PrepareForExecute() override;
|
||||
virtual void StepUpdate() override;
|
||||
|
||||
protected:
|
||||
void InitializeData();
|
||||
void ReleaseData();
|
||||
};
|
||||
|
||||
XNCLASS_PTR_DECLARE(XNGroundHandling)
|
@ -2,11 +2,9 @@ cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(XNWeightBalance LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
# 获取环境变量
|
||||
if(DEFINED ENV{XNCore})
|
||||
@ -17,9 +15,36 @@ endif()
|
||||
|
||||
# 添加 XNCore_PATH 下的 include 目录为包含目录
|
||||
include_directories(${XNCore_PATH}/include)
|
||||
include_directories(${XNCore_PATH}/IDL)
|
||||
|
||||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
|
||||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
|
||||
add_library(XNWeightBalance SHARED
|
||||
XNWeightBalance_global.h
|
||||
XNWeightBalance.cpp
|
||||
XNWeightBalance.h
|
||||
XNWeightBalance_p.h
|
||||
)
|
||||
|
||||
add_subdirectory(XNWeightBalanceInterface)
|
||||
add_subdirectory(XNWeightBalance)
|
||||
target_link_libraries(XNWeightBalance PRIVATE
|
||||
${XNCore_PATH}/lib/libXNCore.so
|
||||
${XNCore_PATH}/lib/libC909_V1_Interface.so
|
||||
dl
|
||||
)
|
||||
|
||||
target_compile_definitions(XNWeightBalance PRIVATE XNWEIGHTBALANCE_LIBRARY)
|
||||
|
||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
set(CMAKE_INSTALL_PREFIX "${XNCore_PATH}/Models" CACHE PATH "Install path prefix" FORCE)
|
||||
endif()
|
||||
|
||||
include(GNUInstallDirs)
|
||||
install(TARGETS XNWeightBalance
|
||||
BUNDLE DESTINATION .
|
||||
LIBRARY DESTINATION .
|
||||
RUNTIME DESTINATION .
|
||||
)
|
||||
|
||||
# 添加自定义命令和目标以拷贝配置文件
|
||||
file(GLOB CONFIG_FILE "*.mcfg")
|
||||
|
||||
# 使用 install 命令在安装时拷贝配置文件
|
||||
install(FILES ${CONFIG_FILE} DESTINATION ${CMAKE_INSTALL_PREFIX})
|
107
XNModels/XNWeightBalance/XNWeightBalance.cpp
Executable file
107
XNModels/XNWeightBalance/XNWeightBalance.cpp
Executable file
@ -0,0 +1,107 @@
|
||||
#include "XNWeightBalance.h"
|
||||
#include "XNWeightBalance_p.h"
|
||||
#include <XNCore/XNModelManager.h>
|
||||
|
||||
XN_MODEL_INITIALIZE(XNWeightBalance)
|
||||
|
||||
XNWeightBalance::XNWeightBalance() : XNModelObject(new XNWeightBalancePrivate())
|
||||
{
|
||||
}
|
||||
|
||||
XNWeightBalance::~XNWeightBalance()
|
||||
{
|
||||
T_D();
|
||||
// 释放输入数组内存
|
||||
if (d->_data.input_weight) {
|
||||
delete[] d->_data.input_weight->l_04_i_wbcomac_acset_tankfuel_f4;
|
||||
delete[] d->_data.input_weight->l_04_i_wbcomac_eng_efsep_l1;
|
||||
delete[] d->_data.input_weight->l_04_i_wbcomac_fuel_f8;
|
||||
delete[] d->_data.input_weight->l_04_i_wbcomac_kice_f8;
|
||||
delete d->_data.input_weight;
|
||||
}
|
||||
|
||||
// 释放输出数组内存
|
||||
if (d->_data.output_weight) {
|
||||
delete[] d->_data.output_weight->l_04_o_wbcomac_fuel_cmd_f8;
|
||||
delete[] d->_data.output_weight->l_04_o_wbcomac_ice_eng_f8;
|
||||
delete d->_data.output_weight;
|
||||
}
|
||||
}
|
||||
|
||||
XNWeightBalance::XNWeightBalance(PrivateType *p) : XNModelObject(p)
|
||||
{
|
||||
}
|
||||
|
||||
void XNWeightBalance::Initialize()
|
||||
{
|
||||
T_D();
|
||||
XNModelObject::Initialize();
|
||||
if (d->_dynamicLib) {
|
||||
d->_fun = (FunctionType)dlsym(d->_dynamicLib, d->_entryPointName.c_str());
|
||||
if (!d->_fun) {
|
||||
LOG_WARNING("Failed to resolve SACSCGroundHandlingEntry");
|
||||
}
|
||||
}
|
||||
//add other initial code here
|
||||
}
|
||||
|
||||
void XNWeightBalance::PrepareForExecute()
|
||||
{
|
||||
T_D();
|
||||
XNModelObject::PrepareForExecute();
|
||||
}
|
||||
|
||||
void XNWeightBalance::StepUpdate()
|
||||
{
|
||||
T_D();
|
||||
XNModelObject::StepUpdate();
|
||||
if (d->_fun) {
|
||||
d->_inputInterface.getData(d->_data.input_weight);
|
||||
d->_fun(&d->_data);
|
||||
d->_outputInterface.setData(d->_data.output_weight);
|
||||
d->_heartbeatInterface.setData(&d->_data);
|
||||
}
|
||||
}
|
||||
|
||||
void XNWeightBalance::InitializeData()
|
||||
{
|
||||
T_D();
|
||||
//add your initial data code here
|
||||
d->_data.input_weight = new input_weight_S();
|
||||
d->_data.input_weight->l_04_i_wbcomac_acset_tankfuel_f4 = new float[20];
|
||||
d->_data.input_weight->l_04_i_wbcomac_eng_efsep_l1 = new unsigned char[4];
|
||||
d->_data.input_weight->l_04_i_wbcomac_fuel_f8 = new double[20];
|
||||
d->_data.input_weight->l_04_i_wbcomac_kice_f8 = new double[20];
|
||||
d->_data.output_weight = new output_weight_S();
|
||||
d->_data.output_weight->l_04_o_wbcomac_fuel_cmd_f8 = new double[20];
|
||||
d->_data.output_weight->l_04_o_wbcomac_ice_eng_f8 = new double[4];
|
||||
}
|
||||
|
||||
void XNWeightBalance::ReleaseData()
|
||||
{
|
||||
T_D();
|
||||
//add your release data code here
|
||||
if (d->_data.input_weight) {
|
||||
if (d->_data.input_weight->l_04_i_wbcomac_acset_tankfuel_f4) {
|
||||
delete[] d->_data.input_weight->l_04_i_wbcomac_acset_tankfuel_f4;
|
||||
}
|
||||
if (d->_data.input_weight->l_04_i_wbcomac_eng_efsep_l1) {
|
||||
delete[] d->_data.input_weight->l_04_i_wbcomac_eng_efsep_l1;
|
||||
}
|
||||
if (d->_data.input_weight->l_04_i_wbcomac_fuel_f8) {
|
||||
delete[] d->_data.input_weight->l_04_i_wbcomac_fuel_f8;
|
||||
}
|
||||
if (d->_data.input_weight->l_04_i_wbcomac_kice_f8) {
|
||||
delete[] d->_data.input_weight->l_04_i_wbcomac_kice_f8;
|
||||
}
|
||||
delete d->_data.input_weight;
|
||||
}
|
||||
if (d->_data.output_weight) {
|
||||
if (d->_data.output_weight->l_04_o_wbcomac_fuel_cmd_f8) {
|
||||
delete[] d->_data.output_weight->l_04_o_wbcomac_fuel_cmd_f8;
|
||||
}
|
||||
if (d->_data.output_weight->l_04_o_wbcomac_ice_eng_f8) {
|
||||
delete[] d->_data.output_weight->l_04_o_wbcomac_ice_eng_f8;
|
||||
}
|
||||
}
|
||||
}
|
28
XNModels/XNWeightBalance/XNWeightBalance.h
Executable file
28
XNModels/XNWeightBalance/XNWeightBalance.h
Executable file
@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
#include "XNWeightBalance_global.h"
|
||||
#include <XNCore/XNModelObject.h>
|
||||
|
||||
struct XNWeightBalancePrivate;
|
||||
|
||||
class XNWEIGHTBALANCE_EXPORT XNWeightBalance : public XNModelObject
|
||||
{
|
||||
XN_METATYPE(XNWeightBalance, XNModelObject)
|
||||
XN_DECLARE_PRIVATE(XNWeightBalance)
|
||||
public:
|
||||
XNWeightBalance();
|
||||
virtual ~XNWeightBalance();
|
||||
|
||||
protected:
|
||||
XNWeightBalance(PrivateType *p);
|
||||
|
||||
public:
|
||||
virtual void Initialize() override;
|
||||
virtual void PrepareForExecute() override;
|
||||
virtual void StepUpdate() override;
|
||||
|
||||
protected:
|
||||
void InitializeData();
|
||||
void ReleaseData();
|
||||
};
|
||||
|
||||
XNCLASS_PTR_DECLARE(XNWeightBalance)
|
@ -1,32 +0,0 @@
|
||||
add_library(XNWeightBalance SHARED
|
||||
XNWeightBalance_global.h
|
||||
XNWeightBalance.cpp
|
||||
XNWeightBalance.h
|
||||
XNWeightBalance_p.h
|
||||
${DDS_XNIDL_SOURCES_CXX}
|
||||
)
|
||||
|
||||
target_link_libraries(XNWeightBalance PRIVATE
|
||||
Qt${QT_VERSION_MAJOR}::Core
|
||||
${XNCore_PATH}/lib/libXNCore.so
|
||||
XNWeightBalanceInterface
|
||||
)
|
||||
|
||||
target_compile_definitions(XNWeightBalance PRIVATE XNWEIGHTBALANCE_LIBRARY)
|
||||
|
||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
set(CMAKE_INSTALL_PREFIX "${XNCore_PATH}/Models" CACHE PATH "Install path prefix" FORCE)
|
||||
endif()
|
||||
|
||||
include(GNUInstallDirs)
|
||||
install(TARGETS XNWeightBalance
|
||||
BUNDLE DESTINATION .
|
||||
LIBRARY DESTINATION .
|
||||
RUNTIME DESTINATION .
|
||||
)
|
||||
|
||||
# 添加自定义命令和目标以拷贝配置文件
|
||||
file(GLOB CONFIG_FILE "*.mcfg")
|
||||
|
||||
# 使用 install 命令在安装时拷贝配置文件
|
||||
install(FILES ${CONFIG_FILE} DESTINATION ${CMAKE_INSTALL_PREFIX})
|
@ -1,271 +0,0 @@
|
||||
#include "XNWeightBalance.h"
|
||||
#include "XNWeightBalance_p.h"
|
||||
#include <XNCore/XNModelManager.h>
|
||||
#include <XNCore/XNDDSManager.h>
|
||||
#include <QMutexLocker>
|
||||
|
||||
XN_DLL_INITIALIZE(XNWeightBalance)
|
||||
|
||||
XN_REGISTER_PARTICIPANT_BEGIN(XNWeightBalance)
|
||||
XN_PUBLISHTOPIC(XNSim::ATA04::WeightBalance_output)
|
||||
XN_PUBLISHTOPIC(XNSim::ATA04::WeightBalance_heartbeat)
|
||||
XN_SUBSCRIBETOPIC(XNSim::ATA04::WeightBalance_input, &XNWeightBalance::OnInput)
|
||||
XN_REGISTER_PARTICIPANT_END(XNWeightBalance)
|
||||
|
||||
XNWeightBalance::XNWeightBalance(QObject *parent)
|
||||
: XNModelObject(*new XNWeightBalancePrivate(this), parent)
|
||||
{
|
||||
}
|
||||
|
||||
XNWeightBalance::~XNWeightBalance()
|
||||
{
|
||||
Q_D(XNWeightBalance);
|
||||
|
||||
// 释放输入数组内存
|
||||
if (d->_data.input_weight) {
|
||||
delete[] d->_data.input_weight->l_04_i_wbcomac_acset_tankfuel_f4;
|
||||
delete[] d->_data.input_weight->l_04_i_wbcomac_eng_efsep_l1;
|
||||
delete[] d->_data.input_weight->l_04_i_wbcomac_fuel_f8;
|
||||
delete[] d->_data.input_weight->l_04_i_wbcomac_kice_f8;
|
||||
delete d->_data.input_weight;
|
||||
}
|
||||
|
||||
// 释放输出数组内存
|
||||
if (d->_data.output_weight) {
|
||||
delete[] d->_data.output_weight->l_04_o_wbcomac_fuel_cmd_f8;
|
||||
delete[] d->_data.output_weight->l_04_o_wbcomac_ice_eng_f8;
|
||||
delete d->_data.output_weight;
|
||||
}
|
||||
}
|
||||
|
||||
XNWeightBalance::XNWeightBalance(XNWeightBalancePrivate &dd, QObject *parent)
|
||||
: XNModelObject(dd, parent)
|
||||
{
|
||||
}
|
||||
|
||||
void XNWeightBalance::OnInitialize()
|
||||
{
|
||||
Q_D(XNWeightBalance);
|
||||
XNModelObject::OnInitialize();
|
||||
if (d->_dynamicLib) {
|
||||
d->_fun = reinterpret_cast<FunctionType>(
|
||||
d->_dynamicLib->resolve("_Z28SACSCWeightBalanceEntryPointP20ComacDataStructure_S"));
|
||||
if (!d->_fun) {
|
||||
LOG_WARNING("Failed to resolve function SACSCWeightBalanceEntryPoint");
|
||||
}
|
||||
}
|
||||
//add other initial code here
|
||||
}
|
||||
|
||||
void XNWeightBalance::OnPrepareForExecute()
|
||||
{
|
||||
Q_D(XNWeightBalance);
|
||||
XNModelObject::OnPrepareForExecute();
|
||||
|
||||
//add your initial data code here
|
||||
d->_data.input_weight = new input_weight_S();
|
||||
d->_data.input_weight->l_04_i_wbcomac_acset_tankfuel_f4 = new float[20];
|
||||
d->_data.input_weight->l_04_i_wbcomac_eng_efsep_l1 = new unsigned char[4];
|
||||
d->_data.input_weight->l_04_i_wbcomac_fuel_f8 = new double[20];
|
||||
d->_data.input_weight->l_04_i_wbcomac_kice_f8 = new double[20];
|
||||
d->_data.output_weight = new output_weight_S();
|
||||
d->_data.output_weight->l_04_o_wbcomac_fuel_cmd_f8 = new double[20];
|
||||
d->_data.output_weight->l_04_o_wbcomac_ice_eng_f8 = new double[4];
|
||||
}
|
||||
|
||||
void XNWeightBalance::StepUpdate()
|
||||
{
|
||||
Q_D(XNWeightBalance);
|
||||
XNModelObject::StepUpdate();
|
||||
if (d->_fun) {
|
||||
QMutexLocker locker(&d->_mutex);
|
||||
d->_fun(&d->_data);
|
||||
}
|
||||
OnOutput();
|
||||
}
|
||||
|
||||
void XNWeightBalance::OnInput(const XNSim::ATA04::WeightBalance_input &input)
|
||||
{
|
||||
Q_D(XNWeightBalance);
|
||||
QMutexLocker locker(&d->_mutex);
|
||||
if (input.l_04_i_wbcomac_theta_deg_f8()) {
|
||||
d->_data.input_weight->l_04_i_wbcomac_theta_deg_f8 =
|
||||
input.l_04_i_wbcomac_theta_deg_f8().value();
|
||||
}
|
||||
if (input.l_04_i_wbcomac_gear_mode_l1()) {
|
||||
d->_data.input_weight->l_04_i_wbcomac_gear_mode_l1 =
|
||||
input.l_04_i_wbcomac_gear_mode_l1().value();
|
||||
}
|
||||
if (input.l_04_i_wbcomac_acset_gw_f8()) {
|
||||
d->_data.input_weight->l_04_i_wbcomac_acset_gw_f8 =
|
||||
input.l_04_i_wbcomac_acset_gw_f8().value();
|
||||
}
|
||||
if (input.l_04_i_wbcomac_acset_cg_f8()) {
|
||||
d->_data.input_weight->l_04_i_wbcomac_acset_cg_f8 =
|
||||
input.l_04_i_wbcomac_acset_cg_f8().value();
|
||||
}
|
||||
if (input.l_04_i_wbcomac_acset_tankfuel_f4()) {
|
||||
for (int i = 0; i < 20; i++) {
|
||||
d->_data.input_weight->l_04_i_wbcomac_acset_tankfuel_f4[i] =
|
||||
input.l_04_i_wbcomac_acset_tankfuel_f4().value()[i];
|
||||
}
|
||||
}
|
||||
if (input.l_04_i_wbcomac_acset_totfuel_f8()) {
|
||||
d->_data.input_weight->l_04_i_wbcomac_acset_totfuel_f8 =
|
||||
input.l_04_i_wbcomac_acset_totfuel_f8().value();
|
||||
}
|
||||
if (input.l_04_i_wbcomac_acset_zfw_f8()) {
|
||||
d->_data.input_weight->l_04_i_wbcomac_acset_zfw_f8 =
|
||||
input.l_04_i_wbcomac_acset_zfw_f8().value();
|
||||
}
|
||||
if (input.l_04_i_wbcomac_acset_zfwcg_f8()) {
|
||||
d->_data.input_weight->l_04_i_wbcomac_acset_zfwcg_f8 =
|
||||
input.l_04_i_wbcomac_acset_zfwcg_f8().value();
|
||||
}
|
||||
if (input.l_04_i_wbcomac_eng_efsep_l1()) {
|
||||
for (int i = 0; i < 4; i++) {
|
||||
d->_data.input_weight->l_04_i_wbcomac_eng_efsep_l1[i] =
|
||||
input.l_04_i_wbcomac_eng_efsep_l1().value()[i];
|
||||
}
|
||||
}
|
||||
if (input.l_04_i_wbcomac_fuel_f8()) {
|
||||
for (int i = 0; i < 20; i++) {
|
||||
d->_data.input_weight->l_04_i_wbcomac_fuel_f8[i] =
|
||||
input.l_04_i_wbcomac_fuel_f8().value()[i];
|
||||
}
|
||||
}
|
||||
if (input.l_04_i_wbcomac_gear_avg_f8()) {
|
||||
d->_data.input_weight->l_04_i_wbcomac_gear_avg_f8 =
|
||||
input.l_04_i_wbcomac_gear_avg_f8().value();
|
||||
}
|
||||
if (input.l_04_i_wbcomac_kice_f8()) {
|
||||
for (int i = 0; i < 20; i++) {
|
||||
d->_data.input_weight->l_04_i_wbcomac_kice_f8[i] =
|
||||
input.l_04_i_wbcomac_kice_f8().value()[i];
|
||||
}
|
||||
}
|
||||
if (input.l_04_i_wbcomac_bycglim_l1()) {
|
||||
d->_data.input_weight->l_04_i_wbcomac_bycglim_l1 =
|
||||
input.l_04_i_wbcomac_bycglim_l1().value();
|
||||
}
|
||||
if (input.l_04_i_wbcomac_bygwlim_l1()) {
|
||||
d->_data.input_weight->l_04_i_wbcomac_bygwlim_l1 =
|
||||
input.l_04_i_wbcomac_bygwlim_l1().value();
|
||||
}
|
||||
if (input.l_04_i_wbcomac_frz_l1()) {
|
||||
d->_data.input_weight->l_04_i_wbcomac_frz_l1 = input.l_04_i_wbcomac_frz_l1().value();
|
||||
}
|
||||
if (input.l_04_i_wbcomac_zcgfrz_l1()) {
|
||||
d->_data.input_weight->l_04_i_wbcomac_zcgfrz_l1 = input.l_04_i_wbcomac_zcgfrz_l1().value();
|
||||
}
|
||||
if (input.l_04_i_wbcomac_zcgfrz_grfx_l1()) {
|
||||
d->_data.input_weight->l_04_i_wbcomac_zcgfrz_grfx_l1 =
|
||||
input.l_04_i_wbcomac_zcgfrz_grfx_l1().value();
|
||||
}
|
||||
if (input.l_04_i_wbcomac_ycgfrz_l1()) {
|
||||
d->_data.input_weight->l_04_i_wbcomac_ycgfrz_l1 = input.l_04_i_wbcomac_ycgfrz_l1().value();
|
||||
}
|
||||
if (input.l_04_i_wbcomac_inertfrz_l1()) {
|
||||
d->_data.input_weight->l_04_i_wbcomac_inertfrz_l1 =
|
||||
input.l_04_i_wbcomac_inertfrz_l1().value();
|
||||
}
|
||||
if (input.l_04_i_wbcomac_potreq_gw_f8()) {
|
||||
d->_data.input_weight->l_04_i_wbcomac_potreq_gw_f8 =
|
||||
input.l_04_i_wbcomac_potreq_gw_f8().value();
|
||||
}
|
||||
if (input.l_04_i_wbcomac_potreq_gwcg_f8()) {
|
||||
d->_data.input_weight->l_04_i_wbcomac_potreq_gwcg_f8 =
|
||||
input.l_04_i_wbcomac_potreq_gwcg_f8().value();
|
||||
}
|
||||
if (input.l_04_i_wbcomac_phi_deg_f8()) {
|
||||
d->_data.input_weight->l_04_i_wbcomac_phi_deg_f8 =
|
||||
input.l_04_i_wbcomac_phi_deg_f8().value();
|
||||
}
|
||||
if (input.l_04_i_wbcomac_psi_deg_f8()) {
|
||||
d->_data.input_weight->l_04_i_wbcomac_psi_deg_f8 =
|
||||
input.l_04_i_wbcomac_psi_deg_f8().value();
|
||||
}
|
||||
}
|
||||
|
||||
void XNWeightBalance::OnOutput()
|
||||
{
|
||||
Q_D(XNWeightBalance);
|
||||
QMutexLocker locker(&d->_mutex);
|
||||
//DDS心跳
|
||||
XNSim::ATA04::WeightBalance_heartbeat heartbeat;
|
||||
heartbeat.weightbody_model_heartbeat(d->_data.weightbody_model_heartbeat);
|
||||
d->_dataWriters["XNSim::ATA04::WeightBalance_heartbeat"]->write(&heartbeat);
|
||||
//DDS数据发布
|
||||
XNSim::ATA04::WeightBalance_output output;
|
||||
output.l_04_o_wbcomac_gw_f4(d->_data.output_weight->l_04_o_wbcomac_gw_f4);
|
||||
output.l_04_o_wbcomac_cg_f4(d->_data.output_weight->l_04_o_wbcomac_cg_f4);
|
||||
output.l_04_o_wbcomac_xcg_f8(d->_data.output_weight->l_04_o_wbcomac_xcg_f8);
|
||||
output.l_04_o_wbcomac_blcg_f8(d->_data.output_weight->l_04_o_wbcomac_blcg_f8);
|
||||
output.l_04_o_wbcomac_bscg_f8(d->_data.output_weight->l_04_o_wbcomac_bscg_f8);
|
||||
output.l_04_o_wbcomac_wlcg_f8(d->_data.output_weight->l_04_o_wbcomac_wlcg_f8);
|
||||
output.l_04_o_wbcomac_ixx_f8(d->_data.output_weight->l_04_o_wbcomac_ixx_f8);
|
||||
output.l_04_o_wbcomac_iyy_f8(d->_data.output_weight->l_04_o_wbcomac_iyy_f8);
|
||||
output.l_04_o_wbcomac_izz_f8(d->_data.output_weight->l_04_o_wbcomac_izz_f8);
|
||||
output.l_04_o_wbcomac_ixy_f8(d->_data.output_weight->l_04_o_wbcomac_ixy_f8);
|
||||
output.l_04_o_wbcomac_ixz_f8(d->_data.output_weight->l_04_o_wbcomac_ixz_f8);
|
||||
output.l_04_o_wbcomac_iyz_f8(d->_data.output_weight->l_04_o_wbcomac_iyz_f8);
|
||||
output.l_04_o_wbcomac_zfw_f4(d->_data.output_weight->l_04_o_wbcomac_zfw_f4);
|
||||
output.l_04_o_wbcomac_zfwcg_f4(d->_data.output_weight->l_04_o_wbcomac_zfwcg_f4);
|
||||
output.l_04_o_wbcomac_zfw_blcg_f4(d->_data.output_weight->l_04_o_wbcomac_zfw_blcg_f4);
|
||||
output.l_04_o_wbcomac_zfw_wlcg_f4(d->_data.output_weight->l_04_o_wbcomac_zfw_wlcg_f4);
|
||||
std::array<double, 20> l_04_o_wbcomac_fuel_cmd_f8;
|
||||
for (int i = 0; i < 3; i++) {
|
||||
l_04_o_wbcomac_fuel_cmd_f8[i] = d->_data.output_weight->l_04_o_wbcomac_fuel_cmd_f8[i];
|
||||
}
|
||||
output.l_04_o_wbcomac_fuel_cmd_f8(l_04_o_wbcomac_fuel_cmd_f8);
|
||||
output.l_04_o_wbcomac_fuel_mode_i4(d->_data.output_weight->l_04_o_wbcomac_fuel_mode_i4);
|
||||
output.l_04_o_wbcomac_fuel_ixx_f8(d->_data.output_weight->l_04_o_wbcomac_fuel_ixx_f8);
|
||||
output.l_04_o_wbcomac_fuel_ixy_f8(d->_data.output_weight->l_04_o_wbcomac_fuel_ixy_f8);
|
||||
output.l_04_o_wbcomac_fuel_ixz_f8(d->_data.output_weight->l_04_o_wbcomac_fuel_ixz_f8);
|
||||
output.l_04_o_wbcomac_fuel_iyy_f8(d->_data.output_weight->l_04_o_wbcomac_fuel_iyy_f8);
|
||||
output.l_04_o_wbcomac_fuel_iyz_f8(d->_data.output_weight->l_04_o_wbcomac_fuel_iyz_f8);
|
||||
output.l_04_o_wbcomac_fuel_izz_f8(d->_data.output_weight->l_04_o_wbcomac_fuel_izz_f8);
|
||||
output.l_04_o_wbcomac_l_wt_fuel_f8(d->_data.output_weight->l_04_o_wbcomac_l_wt_fuel_f8);
|
||||
output.l_04_o_wbcomac_ice_airframe_total_f8(
|
||||
d->_data.output_weight->l_04_o_wbcomac_ice_airframe_total_f8);
|
||||
std::array<double, 4> l_04_o_wbcomac_ice_eng_f8;
|
||||
for (int i = 0; i < 2; i++) {
|
||||
l_04_o_wbcomac_ice_eng_f8[i] = d->_data.output_weight->l_04_o_wbcomac_ice_eng_f8[i];
|
||||
}
|
||||
output.l_04_o_wbcomac_ice_eng_f8(l_04_o_wbcomac_ice_eng_f8);
|
||||
output.l_04_o_wbcomac_ice_eng_total_f8(d->_data.output_weight->l_04_o_wbcomac_ice_eng_total_f8);
|
||||
output.l_04_o_wbcomac_ice_fuselage_f8(d->_data.output_weight->l_04_o_wbcomac_ice_fuselage_f8);
|
||||
output.l_04_o_wbcomac_ice_stab_left_f8(d->_data.output_weight->l_04_o_wbcomac_ice_stab_left_f8);
|
||||
output.l_04_o_wbcomac_ice_stab_right_f8(
|
||||
d->_data.output_weight->l_04_o_wbcomac_ice_stab_right_f8);
|
||||
output.l_04_o_wbcomac_ice_stab_total_f8(
|
||||
d->_data.output_weight->l_04_o_wbcomac_ice_stab_total_f8);
|
||||
output.l_04_o_wbcomac_ice_total_f8(d->_data.output_weight->l_04_o_wbcomac_ice_total_f8);
|
||||
output.l_04_o_wbcomac_ice_total_frac_f8(
|
||||
d->_data.output_weight->l_04_o_wbcomac_ice_total_frac_f8);
|
||||
output.l_04_o_wbcomac_ice_vert_tail_f8(d->_data.output_weight->l_04_o_wbcomac_ice_vert_tail_f8);
|
||||
output.l_04_o_wbcomac_ice_wing_left_f8(d->_data.output_weight->l_04_o_wbcomac_ice_wing_left_f8);
|
||||
output.l_04_o_wbcomac_ice_wing_right_f8(
|
||||
d->_data.output_weight->l_04_o_wbcomac_ice_wing_right_f8);
|
||||
output.l_04_o_wbcomac_ice_wing_total_f8(
|
||||
d->_data.output_weight->l_04_o_wbcomac_ice_wing_total_f8);
|
||||
output.l_04_o_wbcomac_frz_l1(d->_data.output_weight->l_04_o_wbcomac_frz_l1);
|
||||
output.l_04_o_wbcomac_zcgfrz_l1(d->_data.output_weight->l_04_o_wbcomac_zcgfrz_l1);
|
||||
output.l_04_o_wbcomac_zcgfrz_grfx_l1(d->_data.output_weight->l_04_o_wbcomac_zcgfrz_grfx_l1);
|
||||
output.l_04_o_wbcomac_ycgfrz_l1(d->_data.output_weight->l_04_o_wbcomac_ycgfrz_l1);
|
||||
output.l_04_o_wbcomac_inertfrz_l1(d->_data.output_weight->l_04_o_wbcomac_inertfrz_l1);
|
||||
output.l_04_o_wbcomac_init_l1(d->_data.output_weight->l_04_o_wbcomac_init_l1);
|
||||
output.l_04_o_wbcomac_min_gw_f4(d->_data.output_weight->l_04_o_wbcomac_min_gw_f4);
|
||||
output.l_04_o_wbcomac_max_gw_f4(d->_data.output_weight->l_04_o_wbcomac_max_gw_f4);
|
||||
output.l_04_o_wbcomac_min_cg_f4(d->_data.output_weight->l_04_o_wbcomac_min_cg_f4);
|
||||
output.l_04_o_wbcomac_max_cg_f4(d->_data.output_weight->l_04_o_wbcomac_max_cg_f4);
|
||||
output.l_04_o_wbcomac_min_zfw_f4(d->_data.output_weight->l_04_o_wbcomac_min_zfw_f4);
|
||||
output.l_04_o_wbcomac_max_zfw_f4(d->_data.output_weight->l_04_o_wbcomac_max_zfw_f4);
|
||||
output.l_04_o_wbcomac_min_zfwcg_f4(d->_data.output_weight->l_04_o_wbcomac_min_zfwcg_f4);
|
||||
output.l_04_o_wbcomac_max_zfwcg_f4(d->_data.output_weight->l_04_o_wbcomac_max_zfwcg_f4);
|
||||
output.l_04_o_wbcomac_potmin_gw_f8(d->_data.output_weight->l_04_o_wbcomac_potmin_gw_f8);
|
||||
output.l_04_o_wbcomac_potmax_gw_f8(d->_data.output_weight->l_04_o_wbcomac_potmax_gw_f8);
|
||||
output.l_04_o_wbcomac_potmin_gwcg_f8(d->_data.output_weight->l_04_o_wbcomac_potmin_gwcg_f8);
|
||||
output.l_04_o_wbcomac_potmax_gwcg_f8(d->_data.output_weight->l_04_o_wbcomac_potmax_gwcg_f8);
|
||||
d->_dataWriters["XNSim::ATA04::WeightBalance_output"]->write(&output);
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
#pragma once
|
||||
#include "XNWeightBalance_global.h"
|
||||
#include <XNCore/XNModelObject.h>
|
||||
#include "../XNWeightBalanceInterface/XNWeightBalancePubSubTypes.hpp"
|
||||
|
||||
class XNWeightBalancePrivate;
|
||||
|
||||
class XNWEIGHTBALANCE_EXPORT XNWeightBalance : public XNModelObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_DISABLE_COPY(XNWeightBalance)
|
||||
Q_DECLARE_PRIVATE(XNWeightBalance)
|
||||
XN_DECLARE_DDS()
|
||||
public:
|
||||
explicit XNWeightBalance(QObject *parent = nullptr);
|
||||
virtual ~XNWeightBalance();
|
||||
|
||||
protected:
|
||||
XNWeightBalance(XNWeightBalancePrivate &dd, QObject *parent = nullptr);
|
||||
|
||||
public slots:
|
||||
virtual void OnInitialize() override;
|
||||
virtual void OnPrepareForExecute() override;
|
||||
|
||||
public:
|
||||
virtual void StepUpdate() override;
|
||||
|
||||
private:
|
||||
void OnInput(const XNSim::ATA04::WeightBalance_input &input);
|
||||
void OnOutput();
|
||||
};
|
@ -1,20 +0,0 @@
|
||||
#pragma once
|
||||
#include <XNCore/XNModelObject_p.h>
|
||||
#include "DataModels/libSACSCWeightBalance_V2.0.14.6H/std_04_dll.h"
|
||||
#include <QMutex>
|
||||
|
||||
typedef void (*FunctionType)(ComacDataStructure_S *);
|
||||
|
||||
class XNWeightBalancePrivate : public XNModelObjectPrivate
|
||||
{
|
||||
public:
|
||||
Q_DECLARE_PUBLIC(XNWeightBalance)
|
||||
|
||||
XNWeightBalancePrivate(XNWeightBalance *q) : XNModelObjectPrivate(q) {}
|
||||
|
||||
FunctionType _fun = nullptr;
|
||||
|
||||
ComacDataStructure_S _data;
|
||||
|
||||
QMutex _mutex;
|
||||
};
|
@ -1,52 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(XNWeightBalanceInterface LANGUAGES CXX)
|
||||
|
||||
if(NOT fastcdr_FOUND)
|
||||
find_package(fastcdr 2 REQUIRED)
|
||||
endif()
|
||||
|
||||
if(NOT fastdds_FOUND)
|
||||
find_package(fastdds 3 REQUIRED)
|
||||
endif()
|
||||
|
||||
find_package(OpenSSL REQUIRED)
|
||||
|
||||
add_library(XNWeightBalanceInterface SHARED
|
||||
XNWeightBalance.hpp
|
||||
XNWeightBalanceCdrAux.hpp
|
||||
XNWeightBalanceCdrAux.ipp
|
||||
XNWeightBalancePubSubTypes.hpp
|
||||
XNWeightBalancePubSubTypes.cxx
|
||||
XNWeightBalanceTypeObjectSupport.hpp
|
||||
XNWeightBalanceTypeObjectSupport.cxx
|
||||
XNWeightBalanceInterface.hpp
|
||||
XNWeightBalanceInterface.cxx
|
||||
)
|
||||
|
||||
target_link_libraries(XNWeightBalanceInterface PRIVATE
|
||||
Qt${QT_VERSION_MAJOR}::Core
|
||||
fastcdr
|
||||
fastdds
|
||||
OpenSSL::SSL
|
||||
OpenSSL::Crypto
|
||||
)
|
||||
|
||||
target_compile_definitions(XNWeightBalanceInterface PRIVATE XNWEIGHTBALANCEINTERFACE_LIBRARY)
|
||||
|
||||
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
|
||||
set(CMAKE_INSTALL_PREFIX "${XNCore_PATH}/Models" CACHE PATH "Install path prefix" FORCE)
|
||||
endif()
|
||||
|
||||
include(GNUInstallDirs)
|
||||
install(TARGETS XNWeightBalanceInterface
|
||||
BUNDLE DESTINATION .
|
||||
LIBRARY DESTINATION .
|
||||
RUNTIME DESTINATION .
|
||||
)
|
||||
|
||||
# 添加自定义命令和目标以拷贝配置文件
|
||||
file(GLOB IDL_FILE "*.idl")
|
||||
|
||||
# 使用 install 命令在安装时拷贝配置文件
|
||||
install(FILES ${IDL_FILE} DESTINATION ${CMAKE_INSTALL_PREFIX})
|
File diff suppressed because it is too large
Load Diff
@ -1,95 +0,0 @@
|
||||
module XNSim
|
||||
{
|
||||
module ATA04
|
||||
{
|
||||
struct WeightBalance_input
|
||||
{
|
||||
@optional double l_04_i_wbcomac_theta_deg_f8;
|
||||
@optional char l_04_i_wbcomac_gear_mode_l1;
|
||||
@optional double l_04_i_wbcomac_acset_gw_f8;
|
||||
@optional double l_04_i_wbcomac_acset_cg_f8;
|
||||
@optional float l_04_i_wbcomac_acset_tankfuel_f4[20];
|
||||
@optional double l_04_i_wbcomac_acset_totfuel_f8;
|
||||
@optional double l_04_i_wbcomac_acset_zfw_f8;
|
||||
@optional double l_04_i_wbcomac_acset_zfwcg_f8;
|
||||
@optional char l_04_i_wbcomac_eng_efsep_l1[4];
|
||||
@optional double l_04_i_wbcomac_fuel_f8[20];
|
||||
@optional double l_04_i_wbcomac_gear_avg_f8;
|
||||
@optional double l_04_i_wbcomac_kice_f8[20];
|
||||
@optional char l_04_i_wbcomac_bycglim_l1;
|
||||
@optional char l_04_i_wbcomac_bygwlim_l1;
|
||||
@optional char l_04_i_wbcomac_frz_l1;
|
||||
@optional char l_04_i_wbcomac_zcgfrz_l1;
|
||||
@optional char l_04_i_wbcomac_zcgfrz_grfx_l1;
|
||||
@optional char l_04_i_wbcomac_ycgfrz_l1;
|
||||
@optional char l_04_i_wbcomac_inertfrz_l1;
|
||||
@optional double l_04_i_wbcomac_potreq_gw_f8;
|
||||
@optional double l_04_i_wbcomac_potreq_gwcg_f8;
|
||||
@optional double l_04_i_wbcomac_phi_deg_f8;
|
||||
@optional double l_04_i_wbcomac_psi_deg_f8;
|
||||
};
|
||||
struct WeightBalance_output
|
||||
{
|
||||
@optional char l_04_o_wbcomac_frz_l1;
|
||||
@optional char l_04_o_wbcomac_zcgfrz_l1;
|
||||
@optional char l_04_o_wbcomac_zcgfrz_grfx_l1;
|
||||
@optional char l_04_o_wbcomac_ycgfrz_l1;
|
||||
@optional char l_04_o_wbcomac_inertfrz_l1;
|
||||
@optional float l_04_o_wbcomac_gw_f4;
|
||||
@optional float l_04_o_wbcomac_cg_f4;
|
||||
@optional double l_04_o_wbcomac_blcg_f8;
|
||||
@optional double l_04_o_wbcomac_bscg_f8;
|
||||
@optional double l_04_o_wbcomac_wlcg_f8;
|
||||
@optional double l_04_o_wbcomac_xcg_f8;
|
||||
@optional double l_04_o_wbcomac_ixx_f8;
|
||||
@optional double l_04_o_wbcomac_ixy_f8;
|
||||
@optional double l_04_o_wbcomac_ixz_f8;
|
||||
@optional double l_04_o_wbcomac_iyy_f8;
|
||||
@optional double l_04_o_wbcomac_iyz_f8;
|
||||
@optional double l_04_o_wbcomac_izz_f8;
|
||||
@optional float l_04_o_wbcomac_zfw_f4;
|
||||
@optional float l_04_o_wbcomac_zfwcg_f4;
|
||||
@optional float l_04_o_wbcomac_zfw_blcg_f4;
|
||||
@optional float l_04_o_wbcomac_zfw_wlcg_f4;
|
||||
@optional double l_04_o_wbcomac_fuel_cmd_f8[20];
|
||||
@optional long l_04_o_wbcomac_fuel_mode_i4;
|
||||
@optional double l_04_o_wbcomac_fuel_ixx_f8;
|
||||
@optional double l_04_o_wbcomac_fuel_ixy_f8;
|
||||
@optional double l_04_o_wbcomac_fuel_ixz_f8;
|
||||
@optional double l_04_o_wbcomac_fuel_iyy_f8;
|
||||
@optional double l_04_o_wbcomac_fuel_iyz_f8;
|
||||
@optional double l_04_o_wbcomac_fuel_izz_f8;
|
||||
@optional double l_04_o_wbcomac_l_wt_fuel_f8;
|
||||
@optional double l_04_o_wbcomac_ice_airframe_total_f8;
|
||||
@optional double l_04_o_wbcomac_ice_eng_f8[4];
|
||||
@optional double l_04_o_wbcomac_ice_eng_total_f8;
|
||||
@optional double l_04_o_wbcomac_ice_fuselage_f8;
|
||||
@optional double l_04_o_wbcomac_ice_stab_left_f8;
|
||||
@optional double l_04_o_wbcomac_ice_stab_right_f8;
|
||||
@optional double l_04_o_wbcomac_ice_stab_total_f8;
|
||||
@optional double l_04_o_wbcomac_ice_total_f8;
|
||||
@optional double l_04_o_wbcomac_ice_total_frac_f8;
|
||||
@optional double l_04_o_wbcomac_ice_vert_tail_f8;
|
||||
@optional double l_04_o_wbcomac_ice_wing_left_f8;
|
||||
@optional double l_04_o_wbcomac_ice_wing_right_f8;
|
||||
@optional double l_04_o_wbcomac_ice_wing_total_f8;
|
||||
@optional char l_04_o_wbcomac_init_l1;
|
||||
@optional double l_04_o_wbcomac_potmin_gw_f8;
|
||||
@optional double l_04_o_wbcomac_potmax_gw_f8;
|
||||
@optional double l_04_o_wbcomac_potmin_gwcg_f8;
|
||||
@optional double l_04_o_wbcomac_potmax_gwcg_f8;
|
||||
@optional float l_04_o_wbcomac_min_cg_f4;
|
||||
@optional float l_04_o_wbcomac_min_gw_f4;
|
||||
@optional float l_04_o_wbcomac_min_zfw_f4;
|
||||
@optional float l_04_o_wbcomac_min_zfwcg_f4;
|
||||
@optional float l_04_o_wbcomac_max_cg_f4;
|
||||
@optional float l_04_o_wbcomac_max_gw_f4;
|
||||
@optional float l_04_o_wbcomac_max_zfw_f4;
|
||||
@optional float l_04_o_wbcomac_max_zfwcg_f4;
|
||||
};
|
||||
struct WeightBalance_heartbeat
|
||||
{
|
||||
long weightbody_model_heartbeat;
|
||||
};
|
||||
};
|
||||
};
|
@ -1,60 +0,0 @@
|
||||
// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
/*!
|
||||
* @file XNWeightBalanceCdrAux.hpp
|
||||
* This source file contains some definitions of CDR related functions.
|
||||
*
|
||||
* This file was generated by the tool fastddsgen.
|
||||
*/
|
||||
|
||||
#ifndef FAST_DDS_GENERATED__XNSIM_ATA04_XNWEIGHTBALANCECDRAUX_HPP
|
||||
#define FAST_DDS_GENERATED__XNSIM_ATA04_XNWEIGHTBALANCECDRAUX_HPP
|
||||
|
||||
#include "XNWeightBalance.hpp"
|
||||
|
||||
constexpr uint32_t XNSim_ATA04_WeightBalance_input_max_cdr_typesize {784UL};
|
||||
constexpr uint32_t XNSim_ATA04_WeightBalance_input_max_key_cdr_typesize {0UL};
|
||||
|
||||
constexpr uint32_t XNSim_ATA04_WeightBalance_output_max_cdr_typesize {1184UL};
|
||||
constexpr uint32_t XNSim_ATA04_WeightBalance_output_max_key_cdr_typesize {0UL};
|
||||
|
||||
constexpr uint32_t XNSim_ATA04_WeightBalance_heartbeat_max_cdr_typesize {8UL};
|
||||
constexpr uint32_t XNSim_ATA04_WeightBalance_heartbeat_max_key_cdr_typesize {0UL};
|
||||
|
||||
|
||||
namespace eprosima {
|
||||
namespace fastcdr {
|
||||
|
||||
class Cdr;
|
||||
class CdrSizeCalculator;
|
||||
|
||||
eProsima_user_DllExport void serialize_key(
|
||||
eprosima::fastcdr::Cdr& scdr,
|
||||
const XNSim::ATA04::WeightBalance_input& data);
|
||||
|
||||
eProsima_user_DllExport void serialize_key(
|
||||
eprosima::fastcdr::Cdr& scdr,
|
||||
const XNSim::ATA04::WeightBalance_output& data);
|
||||
|
||||
eProsima_user_DllExport void serialize_key(
|
||||
eprosima::fastcdr::Cdr& scdr,
|
||||
const XNSim::ATA04::WeightBalance_heartbeat& data);
|
||||
|
||||
|
||||
} // namespace fastcdr
|
||||
} // namespace eprosima
|
||||
|
||||
#endif // FAST_DDS_GENERATED__XNSIM_ATA04_XNWEIGHTBALANCECDRAUX_HPP
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,696 +0,0 @@
|
||||
#include "XNWeightBalanceInterface.hpp"
|
||||
|
||||
namespace XNSim
|
||||
{
|
||||
namespace ATA04
|
||||
{
|
||||
WeightBalance_input_Interface::WeightBalance_input_Interface()
|
||||
{
|
||||
getDataFunction["l_04_i_wbcomac_theta_deg_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_wbcomac_theta_deg_f8()) {
|
||||
return QString::number(input.l_04_i_wbcomac_theta_deg_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_wbcomac_gear_mode_l1"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_wbcomac_gear_mode_l1()) {
|
||||
return QString::number(input.l_04_i_wbcomac_gear_mode_l1().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_wbcomac_acset_gw_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_wbcomac_acset_gw_f8()) {
|
||||
return QString::number(input.l_04_i_wbcomac_acset_gw_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_wbcomac_acset_cg_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_wbcomac_acset_cg_f8()) {
|
||||
return QString::number(input.l_04_i_wbcomac_acset_cg_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_wbcomac_acset_tankfuel_f4"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_wbcomac_acset_tankfuel_f4()) {
|
||||
QStringList list;
|
||||
for (int i = 0; i < 20; i++) {
|
||||
list.append(
|
||||
QString::number(input.l_04_i_wbcomac_acset_tankfuel_f4().value()[i]));
|
||||
}
|
||||
return list.join(",");
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_wbcomac_acset_totfuel_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_wbcomac_acset_totfuel_f8()) {
|
||||
return QString::number(input.l_04_i_wbcomac_acset_totfuel_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_wbcomac_acset_zfw_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_wbcomac_acset_zfw_f8()) {
|
||||
return QString::number(input.l_04_i_wbcomac_acset_zfw_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_wbcomac_acset_zfwcg_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_wbcomac_acset_zfwcg_f8()) {
|
||||
return QString::number(input.l_04_i_wbcomac_acset_zfwcg_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_wbcomac_eng_efsep_l1"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_wbcomac_eng_efsep_l1()) {
|
||||
QStringList list;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
list.append(QString::number(input.l_04_i_wbcomac_eng_efsep_l1().value()[i]));
|
||||
}
|
||||
return list.join(",");
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_wbcomac_fuel_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_wbcomac_fuel_f8()) {
|
||||
QStringList list;
|
||||
for (int i = 0; i < 20; i++) {
|
||||
list.append(QString::number(input.l_04_i_wbcomac_fuel_f8().value()[i]));
|
||||
}
|
||||
return list.join(",");
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_wbcomac_gear_avg_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_wbcomac_gear_avg_f8()) {
|
||||
return QString::number(input.l_04_i_wbcomac_gear_avg_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_wbcomac_kice_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_wbcomac_kice_f8()) {
|
||||
QStringList list;
|
||||
for (int i = 0; i < 20; i++) {
|
||||
list.append(QString::number(input.l_04_i_wbcomac_kice_f8().value()[i]));
|
||||
}
|
||||
return list.join(",");
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_wbcomac_bycglim_l1"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_wbcomac_bycglim_l1()) {
|
||||
return QString::number(input.l_04_i_wbcomac_bycglim_l1().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_wbcomac_bygwlim_l1"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_wbcomac_bygwlim_l1()) {
|
||||
return QString::number(input.l_04_i_wbcomac_bygwlim_l1().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_wbcomac_frz_l1"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_wbcomac_frz_l1()) {
|
||||
return QString::number(input.l_04_i_wbcomac_frz_l1().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_wbcomac_zcgfrz_l1"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_wbcomac_zcgfrz_l1()) {
|
||||
return QString::number(input.l_04_i_wbcomac_zcgfrz_l1().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_wbcomac_zcgfrz_grfx_l1"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_wbcomac_zcgfrz_grfx_l1()) {
|
||||
return QString::number(input.l_04_i_wbcomac_zcgfrz_grfx_l1().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_wbcomac_ycgfrz_l1"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_wbcomac_ycgfrz_l1()) {
|
||||
return QString::number(input.l_04_i_wbcomac_ycgfrz_l1().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_wbcomac_inertfrz_l1"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_wbcomac_inertfrz_l1()) {
|
||||
return QString::number(input.l_04_i_wbcomac_inertfrz_l1().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_wbcomac_potreq_gw_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_wbcomac_potreq_gw_f8()) {
|
||||
return QString::number(input.l_04_i_wbcomac_potreq_gw_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_wbcomac_potreq_gwcg_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_wbcomac_potreq_gwcg_f8()) {
|
||||
return QString::number(input.l_04_i_wbcomac_potreq_gwcg_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_wbcomac_phi_deg_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_wbcomac_phi_deg_f8()) {
|
||||
return QString::number(input.l_04_i_wbcomac_phi_deg_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_i_wbcomac_psi_deg_f8"] = [this](const QString &varName) {
|
||||
if (input.l_04_i_wbcomac_psi_deg_f8()) {
|
||||
return QString::number(input.l_04_i_wbcomac_psi_deg_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
}
|
||||
|
||||
WeightBalance_input_Interface::~WeightBalance_input_Interface()
|
||||
{
|
||||
}
|
||||
|
||||
QString WeightBalance_input_Interface::getData(const QString &varName)
|
||||
{
|
||||
int index1 = -1;
|
||||
int index2 = -1;
|
||||
QString trueVarName = varName;
|
||||
// 检查变量名中是否存在数组标记
|
||||
if (varName.contains('[')) {
|
||||
// 解析数组索引
|
||||
int startPos = varName.indexOf('[');
|
||||
int midPos = varName.indexOf("][");
|
||||
int endPos = varName.lastIndexOf(']');
|
||||
|
||||
// 如果是二维数组 (格式: name[index1][index2])
|
||||
if (midPos != -1) {
|
||||
bool ok1 = false, ok2 = false;
|
||||
index1 = varName.mid(startPos + 1, midPos - startPos - 1).toInt(&ok1);
|
||||
index2 = varName.mid(midPos + 2, endPos - midPos - 2).toInt(&ok2);
|
||||
|
||||
if (!ok1 || !ok2) {
|
||||
qWarning() << "无法解析数组索引:" << varName;
|
||||
index1 = 0;
|
||||
index2 = 0;
|
||||
}
|
||||
}
|
||||
// 如果是一维数组 (格式: name[index1])
|
||||
else if (startPos != -1 && endPos != -1) {
|
||||
bool ok = false;
|
||||
index1 = varName.mid(startPos + 1, endPos - startPos - 1).toInt(&ok);
|
||||
|
||||
if (!ok) {
|
||||
qWarning() << "无法解析数组索引:" << varName;
|
||||
index1 = 0;
|
||||
}
|
||||
}
|
||||
trueVarName = varName.left(startPos);
|
||||
}
|
||||
auto it = getDataFunction.find(trueVarName);
|
||||
if (it == getDataFunction.end()) {
|
||||
return QString(); // 返回空字符串表示未找到
|
||||
}
|
||||
if (index1 < 0) {
|
||||
QMutexLocker locker(&mutex);
|
||||
return it.value()(trueVarName);
|
||||
} else if (index2 < 0) {
|
||||
QMutexLocker locker(&mutex);
|
||||
QStringList list = it.value()(trueVarName).split(",");
|
||||
if (index1 >= list.size()) {
|
||||
qWarning() << "数组索引超出范围:" << varName;
|
||||
return QString();
|
||||
}
|
||||
return list[index1];
|
||||
} else {
|
||||
QMutexLocker locker(&mutex);
|
||||
QStringList list = it.value()(trueVarName).split(",");
|
||||
if (index1 >= list.size()) {
|
||||
qWarning() << "数组索引超出范围:" << varName;
|
||||
return QString();
|
||||
}
|
||||
QStringList list2 = list[index1].split(" ");
|
||||
if (index2 >= list2.size()) {
|
||||
qWarning() << "数组索引超出范围:" << varName;
|
||||
return QString();
|
||||
}
|
||||
return list2[index2];
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
WeightBalance_input_Interface::inputDataListener(const XNSim::ATA04::WeightBalance_input &input)
|
||||
{
|
||||
QMutexLocker locker(&mutex);
|
||||
this->input = input;
|
||||
}
|
||||
|
||||
WeightBalance_output_Interface::WeightBalance_output_Interface()
|
||||
{
|
||||
getDataFunction["l_04_o_wbcomac_frz_l1"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_frz_l1()) {
|
||||
return QString::number(output.l_04_o_wbcomac_frz_l1().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_zcgfrz_l1"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_zcgfrz_l1()) {
|
||||
return QString::number(output.l_04_o_wbcomac_zcgfrz_l1().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_zcgfrz_grfx_l1"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_zcgfrz_grfx_l1()) {
|
||||
return QString::number(output.l_04_o_wbcomac_zcgfrz_grfx_l1().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_ycgfrz_l1"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_ycgfrz_l1()) {
|
||||
return QString::number(output.l_04_o_wbcomac_ycgfrz_l1().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_inertfrz_l1"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_inertfrz_l1()) {
|
||||
return QString::number(output.l_04_o_wbcomac_inertfrz_l1().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_gw_f4"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_gw_f4()) {
|
||||
return QString::number(output.l_04_o_wbcomac_gw_f4().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_cg_f4"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_cg_f4()) {
|
||||
return QString::number(output.l_04_o_wbcomac_cg_f4().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_blcg_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_blcg_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_blcg_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_bscg_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_bscg_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_bscg_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_wlcg_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_wlcg_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_wlcg_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_xcg_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_xcg_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_xcg_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_ixx_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_ixx_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_ixx_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_ixy_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_ixy_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_ixy_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_ixz_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_ixz_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_ixz_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_iyy_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_iyy_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_iyy_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_iyz_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_iyz_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_iyz_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_izz_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_izz_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_izz_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_zfw_f4"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_zfw_f4()) {
|
||||
return QString::number(output.l_04_o_wbcomac_zfw_f4().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_zfwcg_f4"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_zfwcg_f4()) {
|
||||
return QString::number(output.l_04_o_wbcomac_zfwcg_f4().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_zfw_blcg_f4"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_zfw_blcg_f4()) {
|
||||
return QString::number(output.l_04_o_wbcomac_zfw_blcg_f4().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_zfw_wlcg_f4"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_zfw_wlcg_f4()) {
|
||||
return QString::number(output.l_04_o_wbcomac_zfw_wlcg_f4().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_fuel_cmd_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_fuel_cmd_f8()) {
|
||||
QStringList list;
|
||||
for (int i = 0; i < 20; i++) {
|
||||
list.append(QString::number(output.l_04_o_wbcomac_fuel_cmd_f8().value()[i]));
|
||||
}
|
||||
return list.join(",");
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_fuel_mode_i4"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_fuel_mode_i4()) {
|
||||
return QString::number(output.l_04_o_wbcomac_fuel_mode_i4().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_fuel_ixx_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_fuel_ixx_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_fuel_ixx_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_fuel_ixy_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_fuel_ixy_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_fuel_ixy_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_fuel_ixz_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_fuel_ixz_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_fuel_ixz_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_fuel_iyy_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_fuel_iyy_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_fuel_iyy_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_fuel_iyz_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_fuel_iyz_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_fuel_iyz_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_fuel_izz_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_fuel_izz_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_fuel_izz_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_l_wt_fuel_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_l_wt_fuel_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_l_wt_fuel_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_ice_airframe_total_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_ice_airframe_total_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_ice_airframe_total_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_ice_eng_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_ice_eng_f8()) {
|
||||
QStringList list;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
list.append(QString::number(output.l_04_o_wbcomac_ice_eng_f8().value()[i]));
|
||||
}
|
||||
return list.join(",");
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_ice_eng_total_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_ice_eng_total_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_ice_eng_total_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_ice_fuselage_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_ice_fuselage_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_ice_fuselage_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_ice_stab_left_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_ice_stab_left_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_ice_stab_left_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_ice_stab_right_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_ice_stab_right_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_ice_stab_right_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_ice_stab_total_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_ice_stab_total_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_ice_stab_total_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_ice_total_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_ice_total_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_ice_total_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_ice_total_frac_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_ice_total_frac_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_ice_total_frac_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_ice_vert_tail_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_ice_vert_tail_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_ice_vert_tail_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_ice_wing_left_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_ice_wing_left_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_ice_wing_left_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_ice_wing_right_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_ice_wing_right_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_ice_wing_right_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_ice_wing_total_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_ice_wing_total_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_ice_wing_total_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_init_l1"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_init_l1()) {
|
||||
return QString::number(output.l_04_o_wbcomac_init_l1().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_potmin_gw_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_potmin_gw_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_potmin_gw_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_potmax_gw_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_potmax_gw_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_potmax_gw_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_potmin_gwcg_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_potmin_gwcg_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_potmin_gwcg_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_potmax_gwcg_f8"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_potmax_gwcg_f8()) {
|
||||
return QString::number(output.l_04_o_wbcomac_potmax_gwcg_f8().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_min_cg_f4"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_min_cg_f4()) {
|
||||
return QString::number(output.l_04_o_wbcomac_min_cg_f4().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_min_gw_f4"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_min_gw_f4()) {
|
||||
return QString::number(output.l_04_o_wbcomac_min_gw_f4().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_min_zfw_f4"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_min_zfw_f4()) {
|
||||
return QString::number(output.l_04_o_wbcomac_min_zfw_f4().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_min_zfwcg_f4"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_min_zfwcg_f4()) {
|
||||
return QString::number(output.l_04_o_wbcomac_min_zfwcg_f4().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_max_cg_f4"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_max_cg_f4()) {
|
||||
return QString::number(output.l_04_o_wbcomac_max_cg_f4().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_max_gw_f4"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_max_gw_f4()) {
|
||||
return QString::number(output.l_04_o_wbcomac_max_gw_f4().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_max_zfw_f4"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_max_zfw_f4()) {
|
||||
return QString::number(output.l_04_o_wbcomac_max_zfw_f4().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
getDataFunction["l_04_o_wbcomac_max_zfwcg_f4"] = [this](const QString &varName) {
|
||||
if (output.l_04_o_wbcomac_max_zfwcg_f4()) {
|
||||
return QString::number(output.l_04_o_wbcomac_max_zfwcg_f4().value());
|
||||
}
|
||||
return QString();
|
||||
};
|
||||
}
|
||||
|
||||
WeightBalance_output_Interface::~WeightBalance_output_Interface()
|
||||
{
|
||||
}
|
||||
|
||||
QString WeightBalance_output_Interface::getData(const QString &varName)
|
||||
{
|
||||
int index1 = -1;
|
||||
int index2 = -1;
|
||||
QString trueVarName = varName;
|
||||
// 检查变量名中是否存在数组标记
|
||||
if (varName.contains('[')) {
|
||||
// 解析数组索引
|
||||
int startPos = varName.indexOf('[');
|
||||
int midPos = varName.indexOf("][");
|
||||
int endPos = varName.lastIndexOf(']');
|
||||
|
||||
// 如果是二维数组 (格式: name[index1][index2])
|
||||
if (midPos != -1) {
|
||||
bool ok1 = false, ok2 = false;
|
||||
index1 = varName.mid(startPos + 1, midPos - startPos - 1).toInt(&ok1);
|
||||
index2 = varName.mid(midPos + 2, endPos - midPos - 2).toInt(&ok2);
|
||||
|
||||
if (!ok1 || !ok2) {
|
||||
qWarning() << "无法解析数组索引:" << varName;
|
||||
index1 = 0;
|
||||
index2 = 0;
|
||||
}
|
||||
}
|
||||
// 如果是一维数组 (格式: name[index1])
|
||||
else if (startPos != -1 && endPos != -1) {
|
||||
bool ok = false;
|
||||
index1 = varName.mid(startPos + 1, endPos - startPos - 1).toInt(&ok);
|
||||
|
||||
if (!ok) {
|
||||
qWarning() << "无法解析数组索引:" << varName;
|
||||
index1 = 0;
|
||||
}
|
||||
}
|
||||
trueVarName = varName.left(startPos);
|
||||
}
|
||||
QMutexLocker locker(&mutex);
|
||||
auto it = getDataFunction.find(trueVarName);
|
||||
if (it == getDataFunction.end()) {
|
||||
return QString(); // 返回空字符串表示未找到
|
||||
}
|
||||
if (index1 < 0) {
|
||||
return it.value()(varName);
|
||||
} else if (index2 < 0) {
|
||||
QStringList list = it.value()(trueVarName).split(",");
|
||||
if (index1 >= list.size()) {
|
||||
qWarning() << "数组索引超出范围:" << varName;
|
||||
return QString();
|
||||
}
|
||||
return list[index1];
|
||||
} else {
|
||||
QStringList list = it.value()(trueVarName).split(",");
|
||||
if (index1 >= list.size()) {
|
||||
qWarning() << "数组索引超出范围:" << varName;
|
||||
return QString();
|
||||
}
|
||||
QStringList list2 = list[index1].split(" ");
|
||||
if (index2 >= list2.size()) {
|
||||
qWarning() << "数组索引超出范围:" << varName;
|
||||
return QString();
|
||||
}
|
||||
return list2[index2];
|
||||
}
|
||||
}
|
||||
|
||||
void WeightBalance_output_Interface::outputDataListener(
|
||||
const XNSim::ATA04::WeightBalance_output &output)
|
||||
{
|
||||
QMutexLocker locker(&mutex);
|
||||
this->output = output;
|
||||
}
|
||||
|
||||
WeightBalance_heartbeat_Interface::WeightBalance_heartbeat_Interface()
|
||||
{
|
||||
getDataFunction["weightbody_model_heartbeat"] = [this](const QString &varName) {
|
||||
return QString::number(heartbeat.weightbody_model_heartbeat());
|
||||
};
|
||||
}
|
||||
|
||||
WeightBalance_heartbeat_Interface::~WeightBalance_heartbeat_Interface()
|
||||
{
|
||||
}
|
||||
|
||||
QString WeightBalance_heartbeat_Interface::getData(const QString &varName)
|
||||
{
|
||||
QMutexLocker locker(&mutex);
|
||||
auto it = getDataFunction.find(varName);
|
||||
if (it == getDataFunction.end()) {
|
||||
return QString(); // 返回空字符串表示未找到
|
||||
}
|
||||
return it.value()(varName);
|
||||
}
|
||||
|
||||
void WeightBalance_heartbeat_Interface::heartbeatListener(
|
||||
const XNSim::ATA04::WeightBalance_heartbeat &heartbeat)
|
||||
{
|
||||
QMutexLocker locker(&mutex);
|
||||
this->heartbeat = heartbeat;
|
||||
}
|
||||
} // namespace ATA04
|
||||
} // namespace XNSim
|
@ -1,58 +0,0 @@
|
||||
#include "XNWeightBalance.hpp"
|
||||
#include "XNWeightBalancePubSubTypes.hpp"
|
||||
#include <QString>
|
||||
#include <QMutex>
|
||||
#include <QMutexLocker>
|
||||
#include <QHash>
|
||||
#include <functional>
|
||||
#include <QDebug>
|
||||
#include <QStringList>
|
||||
#include <QObject>
|
||||
|
||||
namespace XNSim
|
||||
{
|
||||
namespace ATA04
|
||||
{
|
||||
class WeightBalance_input_Interface
|
||||
{
|
||||
public:
|
||||
explicit WeightBalance_input_Interface();
|
||||
virtual ~WeightBalance_input_Interface();
|
||||
QString getData(const QString &varName);
|
||||
void inputDataListener(const XNSim::ATA04::WeightBalance_input &input);
|
||||
|
||||
private:
|
||||
XNSim::ATA04::WeightBalance_input input;
|
||||
QHash<QString, std::function<QString(const QString &)>> getDataFunction;
|
||||
QMutex mutex;
|
||||
};
|
||||
|
||||
class WeightBalance_output_Interface
|
||||
{
|
||||
public:
|
||||
explicit WeightBalance_output_Interface();
|
||||
virtual ~WeightBalance_output_Interface();
|
||||
QString getData(const QString &varName);
|
||||
void outputDataListener(const XNSim::ATA04::WeightBalance_output &output);
|
||||
|
||||
private:
|
||||
XNSim::ATA04::WeightBalance_output output;
|
||||
QHash<QString, std::function<QString(const QString &)>> getDataFunction;
|
||||
QMutex mutex;
|
||||
};
|
||||
|
||||
class WeightBalance_heartbeat_Interface
|
||||
{
|
||||
public:
|
||||
explicit WeightBalance_heartbeat_Interface();
|
||||
virtual ~WeightBalance_heartbeat_Interface();
|
||||
QString getData(const QString &varName);
|
||||
void heartbeatListener(const XNSim::ATA04::WeightBalance_heartbeat &heartbeat);
|
||||
|
||||
private:
|
||||
XNSim::ATA04::WeightBalance_heartbeat heartbeat;
|
||||
QHash<QString, std::function<QString(const QString &)>> getDataFunction;
|
||||
QMutex mutex;
|
||||
};
|
||||
} // namespace ATA04
|
||||
} // namespace XNSim
|
@ -1,588 +0,0 @@
|
||||
// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
/*!
|
||||
* @file XNWeightBalancePubSubTypes.cpp
|
||||
* This header file contains the implementation of the serialization functions.
|
||||
*
|
||||
* This file was generated by the tool fastddsgen.
|
||||
*/
|
||||
|
||||
#include "XNWeightBalancePubSubTypes.hpp"
|
||||
|
||||
#include <fastdds/dds/log/Log.hpp>
|
||||
#include <fastdds/rtps/common/CdrSerialization.hpp>
|
||||
|
||||
#include "XNWeightBalanceCdrAux.hpp"
|
||||
#include "XNWeightBalanceTypeObjectSupport.hpp"
|
||||
|
||||
using SerializedPayload_t = eprosima::fastdds::rtps::SerializedPayload_t;
|
||||
using InstanceHandle_t = eprosima::fastdds::rtps::InstanceHandle_t;
|
||||
using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t;
|
||||
|
||||
namespace XNSim {
|
||||
namespace ATA04 {
|
||||
WeightBalance_inputPubSubType::WeightBalance_inputPubSubType()
|
||||
{
|
||||
set_name("XNSim::ATA04::WeightBalance_input");
|
||||
uint32_t type_size = XNSim_ATA04_WeightBalance_input_max_cdr_typesize;
|
||||
type_size += static_cast<uint32_t>(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */
|
||||
max_serialized_type_size = type_size + 4; /*encapsulation*/
|
||||
is_compute_key_provided = false;
|
||||
uint32_t key_length = XNSim_ATA04_WeightBalance_input_max_key_cdr_typesize > 16 ? XNSim_ATA04_WeightBalance_input_max_key_cdr_typesize : 16;
|
||||
key_buffer_ = reinterpret_cast<unsigned char*>(malloc(key_length));
|
||||
memset(key_buffer_, 0, key_length);
|
||||
}
|
||||
|
||||
WeightBalance_inputPubSubType::~WeightBalance_inputPubSubType()
|
||||
{
|
||||
if (key_buffer_ != nullptr)
|
||||
{
|
||||
free(key_buffer_);
|
||||
}
|
||||
}
|
||||
|
||||
bool WeightBalance_inputPubSubType::serialize(
|
||||
const void* const data,
|
||||
SerializedPayload_t& payload,
|
||||
DataRepresentationId_t data_representation)
|
||||
{
|
||||
const WeightBalance_input* p_type = static_cast<const WeightBalance_input*>(data);
|
||||
|
||||
// Object that manages the raw buffer.
|
||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(payload.data), payload.max_size);
|
||||
// Object that serializes the data.
|
||||
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN,
|
||||
data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ?
|
||||
eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2);
|
||||
payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE;
|
||||
ser.set_encoding_flag(
|
||||
data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ?
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR :
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2);
|
||||
|
||||
try
|
||||
{
|
||||
// Serialize encapsulation
|
||||
ser.serialize_encapsulation();
|
||||
// Serialize the object.
|
||||
ser << *p_type;
|
||||
ser.set_dds_cdr_options({0,0});
|
||||
}
|
||||
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get the serialized length
|
||||
payload.length = static_cast<uint32_t>(ser.get_serialized_data_length());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WeightBalance_inputPubSubType::deserialize(
|
||||
SerializedPayload_t& payload,
|
||||
void* data)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Convert DATA to pointer of your type
|
||||
WeightBalance_input* p_type = static_cast<WeightBalance_input*>(data);
|
||||
|
||||
// Object that manages the raw buffer.
|
||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(payload.data), payload.length);
|
||||
|
||||
// Object that deserializes the data.
|
||||
eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN);
|
||||
|
||||
// Deserialize encapsulation.
|
||||
deser.read_encapsulation();
|
||||
payload.encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE;
|
||||
|
||||
// Deserialize the object.
|
||||
deser >> *p_type;
|
||||
}
|
||||
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t WeightBalance_inputPubSubType::calculate_serialized_size(
|
||||
const void* const data,
|
||||
DataRepresentationId_t data_representation)
|
||||
{
|
||||
try
|
||||
{
|
||||
eprosima::fastcdr::CdrSizeCalculator calculator(
|
||||
data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ?
|
||||
eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2);
|
||||
size_t current_alignment {0};
|
||||
return static_cast<uint32_t>(calculator.calculate_serialized_size(
|
||||
*static_cast<const WeightBalance_input*>(data), current_alignment)) +
|
||||
4u /*encapsulation*/;
|
||||
}
|
||||
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void* WeightBalance_inputPubSubType::create_data()
|
||||
{
|
||||
return reinterpret_cast<void*>(new WeightBalance_input());
|
||||
}
|
||||
|
||||
void WeightBalance_inputPubSubType::delete_data(
|
||||
void* data)
|
||||
{
|
||||
delete(reinterpret_cast<WeightBalance_input*>(data));
|
||||
}
|
||||
|
||||
bool WeightBalance_inputPubSubType::compute_key(
|
||||
SerializedPayload_t& payload,
|
||||
InstanceHandle_t& handle,
|
||||
bool force_md5)
|
||||
{
|
||||
if (!is_compute_key_provided)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
WeightBalance_input data;
|
||||
if (deserialize(payload, static_cast<void*>(&data)))
|
||||
{
|
||||
return compute_key(static_cast<void*>(&data), handle, force_md5);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool WeightBalance_inputPubSubType::compute_key(
|
||||
const void* const data,
|
||||
InstanceHandle_t& handle,
|
||||
bool force_md5)
|
||||
{
|
||||
if (!is_compute_key_provided)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const WeightBalance_input* p_type = static_cast<const WeightBalance_input*>(data);
|
||||
|
||||
// Object that manages the raw buffer.
|
||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(key_buffer_),
|
||||
XNSim_ATA04_WeightBalance_input_max_key_cdr_typesize);
|
||||
|
||||
// Object that serializes the data.
|
||||
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2);
|
||||
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2);
|
||||
eprosima::fastcdr::serialize_key(ser, *p_type);
|
||||
if (force_md5 || XNSim_ATA04_WeightBalance_input_max_key_cdr_typesize > 16)
|
||||
{
|
||||
md5_.init();
|
||||
md5_.update(key_buffer_, static_cast<unsigned int>(ser.get_serialized_data_length()));
|
||||
md5_.finalize();
|
||||
for (uint8_t i = 0; i < 16; ++i)
|
||||
{
|
||||
handle.value[i] = md5_.digest[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (uint8_t i = 0; i < 16; ++i)
|
||||
{
|
||||
handle.value[i] = key_buffer_[i];
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void WeightBalance_inputPubSubType::register_type_object_representation()
|
||||
{
|
||||
register_WeightBalance_input_type_identifier(type_identifiers_);
|
||||
}
|
||||
|
||||
WeightBalance_outputPubSubType::WeightBalance_outputPubSubType()
|
||||
{
|
||||
set_name("XNSim::ATA04::WeightBalance_output");
|
||||
uint32_t type_size = XNSim_ATA04_WeightBalance_output_max_cdr_typesize;
|
||||
type_size += static_cast<uint32_t>(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */
|
||||
max_serialized_type_size = type_size + 4; /*encapsulation*/
|
||||
is_compute_key_provided = false;
|
||||
uint32_t key_length = XNSim_ATA04_WeightBalance_output_max_key_cdr_typesize > 16 ? XNSim_ATA04_WeightBalance_output_max_key_cdr_typesize : 16;
|
||||
key_buffer_ = reinterpret_cast<unsigned char*>(malloc(key_length));
|
||||
memset(key_buffer_, 0, key_length);
|
||||
}
|
||||
|
||||
WeightBalance_outputPubSubType::~WeightBalance_outputPubSubType()
|
||||
{
|
||||
if (key_buffer_ != nullptr)
|
||||
{
|
||||
free(key_buffer_);
|
||||
}
|
||||
}
|
||||
|
||||
bool WeightBalance_outputPubSubType::serialize(
|
||||
const void* const data,
|
||||
SerializedPayload_t& payload,
|
||||
DataRepresentationId_t data_representation)
|
||||
{
|
||||
const WeightBalance_output* p_type = static_cast<const WeightBalance_output*>(data);
|
||||
|
||||
// Object that manages the raw buffer.
|
||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(payload.data), payload.max_size);
|
||||
// Object that serializes the data.
|
||||
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN,
|
||||
data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ?
|
||||
eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2);
|
||||
payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE;
|
||||
ser.set_encoding_flag(
|
||||
data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ?
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR :
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2);
|
||||
|
||||
try
|
||||
{
|
||||
// Serialize encapsulation
|
||||
ser.serialize_encapsulation();
|
||||
// Serialize the object.
|
||||
ser << *p_type;
|
||||
ser.set_dds_cdr_options({0,0});
|
||||
}
|
||||
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get the serialized length
|
||||
payload.length = static_cast<uint32_t>(ser.get_serialized_data_length());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WeightBalance_outputPubSubType::deserialize(
|
||||
SerializedPayload_t& payload,
|
||||
void* data)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Convert DATA to pointer of your type
|
||||
WeightBalance_output* p_type = static_cast<WeightBalance_output*>(data);
|
||||
|
||||
// Object that manages the raw buffer.
|
||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(payload.data), payload.length);
|
||||
|
||||
// Object that deserializes the data.
|
||||
eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN);
|
||||
|
||||
// Deserialize encapsulation.
|
||||
deser.read_encapsulation();
|
||||
payload.encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE;
|
||||
|
||||
// Deserialize the object.
|
||||
deser >> *p_type;
|
||||
}
|
||||
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t WeightBalance_outputPubSubType::calculate_serialized_size(
|
||||
const void* const data,
|
||||
DataRepresentationId_t data_representation)
|
||||
{
|
||||
try
|
||||
{
|
||||
eprosima::fastcdr::CdrSizeCalculator calculator(
|
||||
data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ?
|
||||
eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2);
|
||||
size_t current_alignment {0};
|
||||
return static_cast<uint32_t>(calculator.calculate_serialized_size(
|
||||
*static_cast<const WeightBalance_output*>(data), current_alignment)) +
|
||||
4u /*encapsulation*/;
|
||||
}
|
||||
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void* WeightBalance_outputPubSubType::create_data()
|
||||
{
|
||||
return reinterpret_cast<void*>(new WeightBalance_output());
|
||||
}
|
||||
|
||||
void WeightBalance_outputPubSubType::delete_data(
|
||||
void* data)
|
||||
{
|
||||
delete(reinterpret_cast<WeightBalance_output*>(data));
|
||||
}
|
||||
|
||||
bool WeightBalance_outputPubSubType::compute_key(
|
||||
SerializedPayload_t& payload,
|
||||
InstanceHandle_t& handle,
|
||||
bool force_md5)
|
||||
{
|
||||
if (!is_compute_key_provided)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
WeightBalance_output data;
|
||||
if (deserialize(payload, static_cast<void*>(&data)))
|
||||
{
|
||||
return compute_key(static_cast<void*>(&data), handle, force_md5);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool WeightBalance_outputPubSubType::compute_key(
|
||||
const void* const data,
|
||||
InstanceHandle_t& handle,
|
||||
bool force_md5)
|
||||
{
|
||||
if (!is_compute_key_provided)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const WeightBalance_output* p_type = static_cast<const WeightBalance_output*>(data);
|
||||
|
||||
// Object that manages the raw buffer.
|
||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(key_buffer_),
|
||||
XNSim_ATA04_WeightBalance_output_max_key_cdr_typesize);
|
||||
|
||||
// Object that serializes the data.
|
||||
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2);
|
||||
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2);
|
||||
eprosima::fastcdr::serialize_key(ser, *p_type);
|
||||
if (force_md5 || XNSim_ATA04_WeightBalance_output_max_key_cdr_typesize > 16)
|
||||
{
|
||||
md5_.init();
|
||||
md5_.update(key_buffer_, static_cast<unsigned int>(ser.get_serialized_data_length()));
|
||||
md5_.finalize();
|
||||
for (uint8_t i = 0; i < 16; ++i)
|
||||
{
|
||||
handle.value[i] = md5_.digest[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (uint8_t i = 0; i < 16; ++i)
|
||||
{
|
||||
handle.value[i] = key_buffer_[i];
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void WeightBalance_outputPubSubType::register_type_object_representation()
|
||||
{
|
||||
register_WeightBalance_output_type_identifier(type_identifiers_);
|
||||
}
|
||||
|
||||
WeightBalance_heartbeatPubSubType::WeightBalance_heartbeatPubSubType()
|
||||
{
|
||||
set_name("XNSim::ATA04::WeightBalance_heartbeat");
|
||||
uint32_t type_size = XNSim_ATA04_WeightBalance_heartbeat_max_cdr_typesize;
|
||||
type_size += static_cast<uint32_t>(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */
|
||||
max_serialized_type_size = type_size + 4; /*encapsulation*/
|
||||
is_compute_key_provided = false;
|
||||
uint32_t key_length = XNSim_ATA04_WeightBalance_heartbeat_max_key_cdr_typesize > 16 ? XNSim_ATA04_WeightBalance_heartbeat_max_key_cdr_typesize : 16;
|
||||
key_buffer_ = reinterpret_cast<unsigned char*>(malloc(key_length));
|
||||
memset(key_buffer_, 0, key_length);
|
||||
}
|
||||
|
||||
WeightBalance_heartbeatPubSubType::~WeightBalance_heartbeatPubSubType()
|
||||
{
|
||||
if (key_buffer_ != nullptr)
|
||||
{
|
||||
free(key_buffer_);
|
||||
}
|
||||
}
|
||||
|
||||
bool WeightBalance_heartbeatPubSubType::serialize(
|
||||
const void* const data,
|
||||
SerializedPayload_t& payload,
|
||||
DataRepresentationId_t data_representation)
|
||||
{
|
||||
const WeightBalance_heartbeat* p_type = static_cast<const WeightBalance_heartbeat*>(data);
|
||||
|
||||
// Object that manages the raw buffer.
|
||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(payload.data), payload.max_size);
|
||||
// Object that serializes the data.
|
||||
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN,
|
||||
data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ?
|
||||
eprosima::fastcdr::CdrVersion::XCDRv1 : eprosima::fastcdr::CdrVersion::XCDRv2);
|
||||
payload.encapsulation = ser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE;
|
||||
ser.set_encoding_flag(
|
||||
data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ?
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR :
|
||||
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2);
|
||||
|
||||
try
|
||||
{
|
||||
// Serialize encapsulation
|
||||
ser.serialize_encapsulation();
|
||||
// Serialize the object.
|
||||
ser << *p_type;
|
||||
ser.set_dds_cdr_options({0,0});
|
||||
}
|
||||
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Get the serialized length
|
||||
payload.length = static_cast<uint32_t>(ser.get_serialized_data_length());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool WeightBalance_heartbeatPubSubType::deserialize(
|
||||
SerializedPayload_t& payload,
|
||||
void* data)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Convert DATA to pointer of your type
|
||||
WeightBalance_heartbeat* p_type = static_cast<WeightBalance_heartbeat*>(data);
|
||||
|
||||
// Object that manages the raw buffer.
|
||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(payload.data), payload.length);
|
||||
|
||||
// Object that deserializes the data.
|
||||
eprosima::fastcdr::Cdr deser(fastbuffer, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN);
|
||||
|
||||
// Deserialize encapsulation.
|
||||
deser.read_encapsulation();
|
||||
payload.encapsulation = deser.endianness() == eprosima::fastcdr::Cdr::BIG_ENDIANNESS ? CDR_BE : CDR_LE;
|
||||
|
||||
// Deserialize the object.
|
||||
deser >> *p_type;
|
||||
}
|
||||
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
uint32_t WeightBalance_heartbeatPubSubType::calculate_serialized_size(
|
||||
const void* const data,
|
||||
DataRepresentationId_t data_representation)
|
||||
{
|
||||
try
|
||||
{
|
||||
eprosima::fastcdr::CdrSizeCalculator calculator(
|
||||
data_representation == DataRepresentationId_t::XCDR_DATA_REPRESENTATION ?
|
||||
eprosima::fastcdr::CdrVersion::XCDRv1 :eprosima::fastcdr::CdrVersion::XCDRv2);
|
||||
size_t current_alignment {0};
|
||||
return static_cast<uint32_t>(calculator.calculate_serialized_size(
|
||||
*static_cast<const WeightBalance_heartbeat*>(data), current_alignment)) +
|
||||
4u /*encapsulation*/;
|
||||
}
|
||||
catch (eprosima::fastcdr::exception::Exception& /*exception*/)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void* WeightBalance_heartbeatPubSubType::create_data()
|
||||
{
|
||||
return reinterpret_cast<void*>(new WeightBalance_heartbeat());
|
||||
}
|
||||
|
||||
void WeightBalance_heartbeatPubSubType::delete_data(
|
||||
void* data)
|
||||
{
|
||||
delete(reinterpret_cast<WeightBalance_heartbeat*>(data));
|
||||
}
|
||||
|
||||
bool WeightBalance_heartbeatPubSubType::compute_key(
|
||||
SerializedPayload_t& payload,
|
||||
InstanceHandle_t& handle,
|
||||
bool force_md5)
|
||||
{
|
||||
if (!is_compute_key_provided)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
WeightBalance_heartbeat data;
|
||||
if (deserialize(payload, static_cast<void*>(&data)))
|
||||
{
|
||||
return compute_key(static_cast<void*>(&data), handle, force_md5);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool WeightBalance_heartbeatPubSubType::compute_key(
|
||||
const void* const data,
|
||||
InstanceHandle_t& handle,
|
||||
bool force_md5)
|
||||
{
|
||||
if (!is_compute_key_provided)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const WeightBalance_heartbeat* p_type = static_cast<const WeightBalance_heartbeat*>(data);
|
||||
|
||||
// Object that manages the raw buffer.
|
||||
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(key_buffer_),
|
||||
XNSim_ATA04_WeightBalance_heartbeat_max_key_cdr_typesize);
|
||||
|
||||
// Object that serializes the data.
|
||||
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2);
|
||||
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2);
|
||||
eprosima::fastcdr::serialize_key(ser, *p_type);
|
||||
if (force_md5 || XNSim_ATA04_WeightBalance_heartbeat_max_key_cdr_typesize > 16)
|
||||
{
|
||||
md5_.init();
|
||||
md5_.update(key_buffer_, static_cast<unsigned int>(ser.get_serialized_data_length()));
|
||||
md5_.finalize();
|
||||
for (uint8_t i = 0; i < 16; ++i)
|
||||
{
|
||||
handle.value[i] = md5_.digest[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (uint8_t i = 0; i < 16; ++i)
|
||||
{
|
||||
handle.value[i] = key_buffer_[i];
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void WeightBalance_heartbeatPubSubType::register_type_object_representation()
|
||||
{
|
||||
register_WeightBalance_heartbeat_type_identifier(type_identifiers_);
|
||||
}
|
||||
|
||||
} // namespace ATA04
|
||||
|
||||
} // namespace XNSim
|
||||
|
||||
|
||||
// Include auxiliary functions like for serializing/deserializing.
|
||||
#include "XNWeightBalanceCdrAux.ipp"
|
@ -1,291 +0,0 @@
|
||||
// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
/*!
|
||||
* @file XNWeightBalancePubSubTypes.hpp
|
||||
* This header file contains the declaration of the serialization functions.
|
||||
*
|
||||
* This file was generated by the tool fastddsgen.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef FAST_DDS_GENERATED__XNSIM_ATA04_XNWEIGHTBALANCE_PUBSUBTYPES_HPP
|
||||
#define FAST_DDS_GENERATED__XNSIM_ATA04_XNWEIGHTBALANCE_PUBSUBTYPES_HPP
|
||||
|
||||
#include <fastdds/dds/core/policy/QosPolicies.hpp>
|
||||
#include <fastdds/dds/topic/TopicDataType.hpp>
|
||||
#include <fastdds/rtps/common/InstanceHandle.hpp>
|
||||
#include <fastdds/rtps/common/SerializedPayload.hpp>
|
||||
#include <fastdds/utils/md5.hpp>
|
||||
|
||||
#include "XNWeightBalance.hpp"
|
||||
|
||||
|
||||
#if !defined(FASTDDS_GEN_API_VER) || (FASTDDS_GEN_API_VER != 3)
|
||||
#error \
|
||||
Generated XNWeightBalance is not compatible with current installed Fast DDS. Please, regenerate it with fastddsgen.
|
||||
#endif // FASTDDS_GEN_API_VER
|
||||
|
||||
namespace XNSim
|
||||
{
|
||||
namespace ATA04
|
||||
{
|
||||
|
||||
/*!
|
||||
* @brief This class represents the TopicDataType of the type WeightBalance_input defined by the user in the IDL file.
|
||||
* @ingroup XNWeightBalance
|
||||
*/
|
||||
class WeightBalance_inputPubSubType : public eprosima::fastdds::dds::TopicDataType
|
||||
{
|
||||
public:
|
||||
|
||||
typedef WeightBalance_input type;
|
||||
|
||||
eProsima_user_DllExport WeightBalance_inputPubSubType();
|
||||
|
||||
eProsima_user_DllExport ~WeightBalance_inputPubSubType() override;
|
||||
|
||||
eProsima_user_DllExport bool serialize(
|
||||
const void* const data,
|
||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) override;
|
||||
|
||||
eProsima_user_DllExport bool deserialize(
|
||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
||||
void* data) override;
|
||||
|
||||
eProsima_user_DllExport uint32_t calculate_serialized_size(
|
||||
const void* const data,
|
||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) override;
|
||||
|
||||
eProsima_user_DllExport bool compute_key(
|
||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
||||
eprosima::fastdds::rtps::InstanceHandle_t& ihandle,
|
||||
bool force_md5 = false) override;
|
||||
|
||||
eProsima_user_DllExport bool compute_key(
|
||||
const void* const data,
|
||||
eprosima::fastdds::rtps::InstanceHandle_t& ihandle,
|
||||
bool force_md5 = false) override;
|
||||
|
||||
eProsima_user_DllExport void* create_data() override;
|
||||
|
||||
eProsima_user_DllExport void delete_data(
|
||||
void* data) override;
|
||||
|
||||
//Register TypeObject representation in Fast DDS TypeObjectRegistry
|
||||
eProsima_user_DllExport void register_type_object_representation() override;
|
||||
|
||||
#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
|
||||
eProsima_user_DllExport inline bool is_bounded() const override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
|
||||
|
||||
#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
|
||||
|
||||
eProsima_user_DllExport inline bool is_plain(
|
||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override
|
||||
{
|
||||
static_cast<void>(data_representation);
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
|
||||
|
||||
#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
|
||||
eProsima_user_DllExport inline bool construct_sample(
|
||||
void* memory) const override
|
||||
{
|
||||
static_cast<void>(memory);
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
|
||||
|
||||
private:
|
||||
|
||||
eprosima::fastdds::MD5 md5_;
|
||||
unsigned char* key_buffer_;
|
||||
|
||||
};
|
||||
|
||||
/*!
|
||||
* @brief This class represents the TopicDataType of the type WeightBalance_output defined by the user in the IDL file.
|
||||
* @ingroup XNWeightBalance
|
||||
*/
|
||||
class WeightBalance_outputPubSubType : public eprosima::fastdds::dds::TopicDataType
|
||||
{
|
||||
public:
|
||||
|
||||
typedef WeightBalance_output type;
|
||||
|
||||
eProsima_user_DllExport WeightBalance_outputPubSubType();
|
||||
|
||||
eProsima_user_DllExport ~WeightBalance_outputPubSubType() override;
|
||||
|
||||
eProsima_user_DllExport bool serialize(
|
||||
const void* const data,
|
||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) override;
|
||||
|
||||
eProsima_user_DllExport bool deserialize(
|
||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
||||
void* data) override;
|
||||
|
||||
eProsima_user_DllExport uint32_t calculate_serialized_size(
|
||||
const void* const data,
|
||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) override;
|
||||
|
||||
eProsima_user_DllExport bool compute_key(
|
||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
||||
eprosima::fastdds::rtps::InstanceHandle_t& ihandle,
|
||||
bool force_md5 = false) override;
|
||||
|
||||
eProsima_user_DllExport bool compute_key(
|
||||
const void* const data,
|
||||
eprosima::fastdds::rtps::InstanceHandle_t& ihandle,
|
||||
bool force_md5 = false) override;
|
||||
|
||||
eProsima_user_DllExport void* create_data() override;
|
||||
|
||||
eProsima_user_DllExport void delete_data(
|
||||
void* data) override;
|
||||
|
||||
//Register TypeObject representation in Fast DDS TypeObjectRegistry
|
||||
eProsima_user_DllExport void register_type_object_representation() override;
|
||||
|
||||
#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
|
||||
eProsima_user_DllExport inline bool is_bounded() const override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
|
||||
|
||||
#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
|
||||
|
||||
eProsima_user_DllExport inline bool is_plain(
|
||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override
|
||||
{
|
||||
static_cast<void>(data_representation);
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
|
||||
|
||||
#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
|
||||
eProsima_user_DllExport inline bool construct_sample(
|
||||
void* memory) const override
|
||||
{
|
||||
static_cast<void>(memory);
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
|
||||
|
||||
private:
|
||||
|
||||
eprosima::fastdds::MD5 md5_;
|
||||
unsigned char* key_buffer_;
|
||||
|
||||
};
|
||||
|
||||
/*!
|
||||
* @brief This class represents the TopicDataType of the type WeightBalance_heartbeat defined by the user in the IDL file.
|
||||
* @ingroup XNWeightBalance
|
||||
*/
|
||||
class WeightBalance_heartbeatPubSubType : public eprosima::fastdds::dds::TopicDataType
|
||||
{
|
||||
public:
|
||||
|
||||
typedef WeightBalance_heartbeat type;
|
||||
|
||||
eProsima_user_DllExport WeightBalance_heartbeatPubSubType();
|
||||
|
||||
eProsima_user_DllExport ~WeightBalance_heartbeatPubSubType() override;
|
||||
|
||||
eProsima_user_DllExport bool serialize(
|
||||
const void* const data,
|
||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) override;
|
||||
|
||||
eProsima_user_DllExport bool deserialize(
|
||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
||||
void* data) override;
|
||||
|
||||
eProsima_user_DllExport uint32_t calculate_serialized_size(
|
||||
const void* const data,
|
||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) override;
|
||||
|
||||
eProsima_user_DllExport bool compute_key(
|
||||
eprosima::fastdds::rtps::SerializedPayload_t& payload,
|
||||
eprosima::fastdds::rtps::InstanceHandle_t& ihandle,
|
||||
bool force_md5 = false) override;
|
||||
|
||||
eProsima_user_DllExport bool compute_key(
|
||||
const void* const data,
|
||||
eprosima::fastdds::rtps::InstanceHandle_t& ihandle,
|
||||
bool force_md5 = false) override;
|
||||
|
||||
eProsima_user_DllExport void* create_data() override;
|
||||
|
||||
eProsima_user_DllExport void delete_data(
|
||||
void* data) override;
|
||||
|
||||
//Register TypeObject representation in Fast DDS TypeObjectRegistry
|
||||
eProsima_user_DllExport void register_type_object_representation() override;
|
||||
|
||||
#ifdef TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
|
||||
eProsima_user_DllExport inline bool is_bounded() const override
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // TOPIC_DATA_TYPE_API_HAS_IS_BOUNDED
|
||||
|
||||
#ifdef TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
|
||||
|
||||
eProsima_user_DllExport inline bool is_plain(
|
||||
eprosima::fastdds::dds::DataRepresentationId_t data_representation) const override
|
||||
{
|
||||
static_cast<void>(data_representation);
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // TOPIC_DATA_TYPE_API_HAS_IS_PLAIN
|
||||
|
||||
#ifdef TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
|
||||
eProsima_user_DllExport inline bool construct_sample(
|
||||
void* memory) const override
|
||||
{
|
||||
static_cast<void>(memory);
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // TOPIC_DATA_TYPE_API_HAS_CONSTRUCT_SAMPLE
|
||||
|
||||
private:
|
||||
|
||||
eprosima::fastdds::MD5 md5_;
|
||||
unsigned char* key_buffer_;
|
||||
|
||||
};
|
||||
} // namespace ATA04
|
||||
} // namespace XNSim
|
||||
|
||||
#endif // FAST_DDS_GENERATED__XNSIM_ATA04_XNWEIGHTBALANCE_PUBSUBTYPES_HPP
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,88 +0,0 @@
|
||||
// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
/*!
|
||||
* @file XNWeightBalanceTypeObjectSupport.hpp
|
||||
* Header file containing the API required to register the TypeObject representation of the described types in the IDL file
|
||||
*
|
||||
* This file was generated by the tool fastddsgen.
|
||||
*/
|
||||
|
||||
#ifndef FAST_DDS_GENERATED__XNSIM_ATA04_XNWEIGHTBALANCE_TYPE_OBJECT_SUPPORT_HPP
|
||||
#define FAST_DDS_GENERATED__XNSIM_ATA04_XNWEIGHTBALANCE_TYPE_OBJECT_SUPPORT_HPP
|
||||
|
||||
#include <fastdds/dds/xtypes/type_representation/TypeObject.hpp>
|
||||
|
||||
|
||||
#if defined(_WIN32)
|
||||
#if defined(EPROSIMA_USER_DLL_EXPORT)
|
||||
#define eProsima_user_DllExport __declspec( dllexport )
|
||||
#else
|
||||
#define eProsima_user_DllExport
|
||||
#endif // EPROSIMA_USER_DLL_EXPORT
|
||||
#else
|
||||
#define eProsima_user_DllExport
|
||||
#endif // _WIN32
|
||||
|
||||
#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
|
||||
|
||||
namespace XNSim {
|
||||
namespace ATA04 {
|
||||
/**
|
||||
* @brief Register WeightBalance_input related TypeIdentifier.
|
||||
* Fully-descriptive TypeIdentifiers are directly registered.
|
||||
* Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is
|
||||
* indirectly registered as well.
|
||||
*
|
||||
* @param[out] TypeIdentifier of the registered type.
|
||||
* The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers.
|
||||
* Invalid TypeIdentifier is returned in case of error.
|
||||
*/
|
||||
eProsima_user_DllExport void register_WeightBalance_input_type_identifier(
|
||||
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
|
||||
|
||||
/**
|
||||
* @brief Register WeightBalance_output related TypeIdentifier.
|
||||
* Fully-descriptive TypeIdentifiers are directly registered.
|
||||
* Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is
|
||||
* indirectly registered as well.
|
||||
*
|
||||
* @param[out] TypeIdentifier of the registered type.
|
||||
* The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers.
|
||||
* Invalid TypeIdentifier is returned in case of error.
|
||||
*/
|
||||
eProsima_user_DllExport void register_WeightBalance_output_type_identifier(
|
||||
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
|
||||
|
||||
/**
|
||||
* @brief Register WeightBalance_heartbeat related TypeIdentifier.
|
||||
* Fully-descriptive TypeIdentifiers are directly registered.
|
||||
* Hash TypeIdentifiers require to fill the TypeObject information and hash it, consequently, the TypeObject is
|
||||
* indirectly registered as well.
|
||||
*
|
||||
* @param[out] TypeIdentifier of the registered type.
|
||||
* The returned TypeIdentifier corresponds to the complete TypeIdentifier in case of hashed TypeIdentifiers.
|
||||
* Invalid TypeIdentifier is returned in case of error.
|
||||
*/
|
||||
eProsima_user_DllExport void register_WeightBalance_heartbeat_type_identifier(
|
||||
eprosima::fastdds::dds::xtypes::TypeIdentifierPair& type_ids);
|
||||
|
||||
} // namespace ATA04
|
||||
|
||||
} // namespace XNSim
|
||||
|
||||
|
||||
#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
|
||||
|
||||
#endif // FAST_DDS_GENERATED__XNSIM_ATA04_XNWEIGHTBALANCE_TYPE_OBJECT_SUPPORT_HPP
|
@ -1,12 +1,10 @@
|
||||
#ifndef XNWEIGHTBALANCE_GLOBAL_H
|
||||
#define XNWEIGHTBALANCE_GLOBAL_H
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#if defined(XNWEIGHTBALANCE_LIBRARY)
|
||||
#define XNWEIGHTBALANCE_EXPORT Q_DECL_EXPORT
|
||||
# define XNWEIGHTBALANCE_EXPORT __attribute__((visibility("default")))
|
||||
#else
|
||||
#define XNWEIGHTBALANCE_EXPORT Q_DECL_IMPORT
|
||||
# define XNWEIGHTBALANCE_EXPORT __attribute__((visibility("default")))
|
||||
#endif
|
||||
|
||||
#endif // XNWEIGHTBALANCE_GLOBAL_H
|
22
XNModels/XNWeightBalance/XNWeightBalance_p.h
Executable file
22
XNModels/XNWeightBalance/XNWeightBalance_p.h
Executable file
@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
#include <XNCore/XNModelObject_p.h>
|
||||
#include "DataModels/libSACSCWeightBalance_V2.0.14.6H/std_04_dll.h"
|
||||
#include <C909_V1/ATA04/WeightBalance_input.hpp>
|
||||
#include <C909_V1/ATA04/WeightBalance_output.hpp>
|
||||
#include <C909_V1/ATA04/WeightBalance_heartbeat.hpp>
|
||||
|
||||
typedef void (*FunctionType)(ComacDataStructure_S *);
|
||||
|
||||
struct XNWeightBalancePrivate : public XNModelObjectPrivate {
|
||||
FunctionType _fun = nullptr;
|
||||
|
||||
ComacDataStructure_S _data;
|
||||
|
||||
std::string _entryPointName = "_Z28SACSCWeightBalanceEntryPointP20ComacDataStructure_S";
|
||||
|
||||
std::mutex _mutex;
|
||||
|
||||
XNSim::C909::ATA04::WeightBalance_input_Interface _inputInterface;
|
||||
XNSim::C909::ATA04::WeightBalance_output_Interface _outputInterface;
|
||||
XNSim::C909::ATA04::WeightBalance_heartbeat_Interface _heartbeatInterface;
|
||||
};
|
@ -39,7 +39,7 @@ void XNUDPService::Initialize()
|
||||
// 读取配置文件
|
||||
std::ifstream file(GetXmlPath());
|
||||
if (!file.is_open()) {
|
||||
LOG_WARNING("Failed to open config file:%s", GetXmlPath().c_str());
|
||||
LOG_WARNING("无法打开配置文件:%s", GetXmlPath().c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -69,7 +69,7 @@ void XNUDPService::Initialize()
|
||||
std::stoi(content.substr(targetPortPos + 12, endPos - targetPortPos - 12));
|
||||
}
|
||||
} else {
|
||||
LOG_WARNING("UDP configuration not found, using default values");
|
||||
LOG_WARNING("未找到UDP配置, 使用默认值");
|
||||
d->localPort = 12345;
|
||||
d->targetHost = "127.0.0.1";
|
||||
d->targetPort = 54321;
|
||||
@ -83,7 +83,7 @@ void XNUDPService::PrepareForExecute()
|
||||
// 初始化UDP socket
|
||||
d->udpSocket = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
if (d->udpSocket < 0) {
|
||||
LOG_WARNING("Failed to create UDP socket");
|
||||
LOG_WARNING("无法创建UDP socket");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ void XNUDPService::PrepareForExecute()
|
||||
localAddr.sin_port = htons(d->localPort);
|
||||
|
||||
if (bind(d->udpSocket, (struct sockaddr *)&localAddr, sizeof(localAddr)) < 0) {
|
||||
LOG_WARNING("UDP socket bind failed on port:%d", d->localPort);
|
||||
LOG_WARNING("UDP socket 绑定失败, 端口:%d", d->localPort);
|
||||
close(d->udpSocket);
|
||||
d->udpSocket = -1;
|
||||
return;
|
||||
@ -127,48 +127,56 @@ void XNUDPService::HandleIncomingData()
|
||||
if (errno == EAGAIN || errno == EWOULDBLOCK) {
|
||||
break; // 没有更多数据
|
||||
}
|
||||
LOG_WARNING("Error reading from UDP socket");
|
||||
LOG_WARNING("读取UDP socket失败");
|
||||
break;
|
||||
}
|
||||
|
||||
if (bytesRead <= 6) {
|
||||
LOG_WARNING("Invalid size of UDP datagram received, size:%zd", bytesRead);
|
||||
if (bytesRead <= 8) {
|
||||
LOG_WARNING("UDP 数据包小于8字节");
|
||||
continue;
|
||||
}
|
||||
|
||||
// 解析数据包头
|
||||
uint8_t header = buffer[0];
|
||||
uint8_t type = buffer[1];
|
||||
uint8_t subType1 = buffer[2];
|
||||
uint8_t subType2 = buffer[3];
|
||||
uint16_t size = (buffer[4] << 8) | buffer[5];
|
||||
|
||||
if (header != 0x0b) {
|
||||
LOG_WARNING("Invalid header of UDP datagram received, header:%d", header);
|
||||
// 将数据转换为XNByteArray
|
||||
XNByteArray datagram;
|
||||
datagram.resize(bytesRead);
|
||||
memcpy(datagram.data(), buffer, bytesRead);
|
||||
if (datagram[0] != 0xa6) {
|
||||
LOG_WARNING("UDP 数据包头无效, 头:%1", datagram[0]);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bytesRead < size) {
|
||||
LOG_WARNING("Invalid size of UDP datagram received, size:%zd, expected:%d", bytesRead,
|
||||
size);
|
||||
if (datagram[5] != 0x00) {
|
||||
LOG_WARNING("UDP 数据包传输方向错误, 方向:%1", datagram[5]);
|
||||
continue;
|
||||
}
|
||||
|
||||
std::vector<uint8_t> datagram(buffer, buffer + bytesRead);
|
||||
uint16_t dataSize = ((uint16_t)datagram[6] << 8) | (uint16_t)datagram[7];
|
||||
if (dataSize != bytesRead) {
|
||||
LOG_WARNING("UDP 数据包大小无效, 大小:%d, 实际大小:%zd", dataSize, bytesRead - 8);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (type == 0x04) {
|
||||
if (subType1 == 0x00 && subType2 == 0x00) {
|
||||
TriggerRTEvent("ATA04AeroInput", datagram);
|
||||
continue;
|
||||
} else if (subType1 == 0x01 && subType2 == 0x00) {
|
||||
TriggerRTEvent("ATA04GhInput", datagram);
|
||||
continue;
|
||||
} else if (subType1 == 0x02 && subType2 == 0x00) {
|
||||
TriggerRTEvent("ATA04WbInput", datagram);
|
||||
continue;
|
||||
uint8_t planeHeader = datagram[1];
|
||||
uint8_t ataHeader = datagram[2];
|
||||
uint8_t modelHeader = datagram[3];
|
||||
uint8_t structHeader = datagram[4];
|
||||
|
||||
if (planeHeader == 0xc0) { //C909数据
|
||||
if (ataHeader == 0x04) { //ATA04章节数据
|
||||
if (modelHeader == 0x00 && structHeader == 0x00) { //气动输入数据
|
||||
TriggerRTEvent("C909::ATA04::AeroInput", datagram);
|
||||
continue;
|
||||
} else if (modelHeader == 0x01 && structHeader == 0x00) { //地操输入数据
|
||||
TriggerRTEvent("C909::ATA04::GhInput", datagram);
|
||||
continue;
|
||||
} else if (modelHeader == 0x02 && structHeader == 0x00) { //质量输入数据
|
||||
TriggerRTEvent("C909::ATA04::WbInput", datagram);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
TriggerRTEvent("ReceiveUDPData", datagram);
|
||||
}
|
||||
TriggerRTEvent("ReceiveUDPData", datagram);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user