地操模型更新完成

This commit is contained in:
jinchao 2025-05-22 08:53:29 +08:00
parent cfbe71d49d
commit 1cb2ae1419
24 changed files with 1724 additions and 1677 deletions

View File

@ -1,4 +1,6 @@
module XNSim module XNSim
{
module C909
{ {
module ATA04 module ATA04
{ {
@ -84,7 +86,8 @@ module XNSim
}; };
struct GroundHandling_heartbeat struct GroundHandling_heartbeat
{ {
long groundhandling_model_heartbeat; @optional long groundhandling_model_heartbeat;
};
}; };
}; };
}; };

View File

@ -1,6 +1,7 @@
#pragma once #pragma once
#include "XNObject.h" #include "XNFramework.h"
#include "XNDDSManager.h"
#include "XNByteArray.h" #include "XNByteArray.h"
#include "XNTypeTraits.h" #include "XNTypeTraits.h"
#include <stdexcept> #include <stdexcept>
@ -19,7 +20,7 @@ public:
* @brief * @brief
* @param framework: * @param framework:
*/ */
virtual void Initialize(XNFrameworkPtr framework) = 0; virtual void Initialize(XNFrameworkPtr framework, uint32_t modelID) = 0;
/** /**
* @brief UDP包 * @brief UDP包
@ -28,13 +29,17 @@ public:
XNByteArray getUDPPackage(); XNByteArray getUDPPackage();
/** /**
* @brief JSON前端获取指定变量的数据 * @brief
* @param varName: * @param varNames:
* @param nameSize: * @return:
* @param varData:
* @param dataSize:
*/ */
void getData(const char *varName, const size_t nameSize, char *varData, size_t dataSize); std::unordered_map<std::string, std::string> getStringData(std::vector<std::string> varNames);
/**
* @brief
* @param data:
*/
void setDataByString(std::unordered_map<std::string, std::string> data);
protected: protected:
/** /**
@ -153,7 +158,7 @@ protected:
} else { } else {
return std::to_string(0); return std::to_string(0);
} }
} else if constexpr (std::is_same_v<T, std::string>) { } else if constexpr (is_std_array_v<T>) {
if (data) { if (data) {
return getStringFromStdArray(data.value()); return getStringFromStdArray(data.value());
} else { } else {
@ -164,6 +169,34 @@ protected:
return std::string(); return std::string();
} }
/**
* @brief JSON前端
* @param data:
* @param value:
*/
template <typename T>
void setDataFromString(eprosima::fastcdr::optional<T> &data, const std::string &value)
{
if constexpr (std::is_arithmetic_v<T>) {
if constexpr (std::is_same_v<T, float> || std::is_same_v<T, double>) {
data = std::stod(value);
} else {
data = std::stoll(value);
}
} else if constexpr (is_std_array_v<T>) {
// 解析输入字符串
std::stringstream ss(value);
std::string item;
std::vector<std::string> items;
while (std::getline(ss, item, ',')) {
items.push_back(item);
}
T temp;
setStdArrayFromString(temp, items, 0);
data = temp;
}
}
/** /**
* @brief JSON前端 * @brief JSON前端
* @param data: * @param data:
@ -185,13 +218,69 @@ protected:
return ss.str(); return ss.str();
} }
private:
/** /**
* @brief * @brief JSON前端
* @param varName: * @param data:
* @return: * @param value: "数字,数字,..."
* @param start_pos:
* @return
* @throw std::runtime_error:
*/ */
std::string getData(const std::string &varName); template <typename T, std::size_t N>
size_t setStdArrayFromString(std::array<T, N> &data, const std::vector<std::string> &value,
size_t start_pos = 0)
{
// 递归处理每个元素
for (std::size_t i = 0; i < N; ++i) {
try {
if constexpr (std::is_arithmetic_v<T>) {
// 对于基本类型,直接转换
if constexpr (std::is_same_v<T, float> || std::is_same_v<T, double>) {
data[i] = static_cast<T>(std::stod(value[start_pos + i]));
} else {
data[i] = static_cast<T>(std::stoll(value[start_pos + i]));
}
} else if constexpr (is_std_array_v<T>) {
// 对于嵌套数组,递归处理
start_pos = setStdArrayFromString(data[i], value, start_pos + i);
} else {
static_assert(std::is_arithmetic_v<T> || is_std_array_v<T>,
"Type must be arithmetic or std::array");
}
} catch (const std::exception &e) {
throw std::runtime_error("Error parsing element " + std::to_string(i) + ": "
+ e.what());
}
}
return start_pos + N;
}
template <typename T1, typename T2>
void assign_value_get(eprosima::fastcdr::optional<T1> &data, T2 &model_data)
{
if (data) {
auto temp = data.value();
if constexpr (std::is_arithmetic_v<T1>) {
model_data = temp;
} else if constexpr (is_std_array_v<T1>) {
size_t arraySize = array_size_v<T1>;
for (size_t i = 0; i < arraySize; ++i) {
auto temp2 = temp[i];
if constexpr (std::is_arithmetic_v<T2>) {
model_data[i] = temp2;
} else if constexpr (is_std_array_v<T2>) {
size_t arraySize2 = array_size_v<T2>;
for (size_t j = 0; j < arraySize2; ++j) {
model_data[i][j] = temp2[j];
}
}
}
}
}
}
virtual void clearOutData() {}
virtual void sendOutData() {}
protected: protected:
struct ByteArrayFunc { struct ByteArrayFunc {
@ -200,15 +289,20 @@ protected:
}; };
std::unordered_map<std::string, std::function<std::string()>> getDataFunction; std::unordered_map<std::string, std::function<std::string()>> getDataFunction;
std::unordered_map<std::string, std::function<void(std::string)>> setDataFunction;
std::vector<ByteArrayFunc> getByteArrayFunction; std::vector<ByteArrayFunc> getByteArrayFunction;
std::unordered_map<std::string, std::function<void(XNByteArray)>> setByteArrayFunction; std::unordered_map<std::string, std::function<void(XNByteArray)>> setByteArrayFunction;
std::mutex mutex; std::mutex mutex;
uint8_t header[5]{}; // 固定大小的头部 uint8_t header[5]{}; // 固定大小的头部
size_t headerSize = 0; size_t headerSize = 5;
FAST_DDS_MACRO::DataWriter *dataWriter;
}; };
#define MAP_DATA_FUNC(NAME) \ #define MAP_DATA_FUNC(NAME) \
getDataFunction[#NAME] = [this]() { return getString(data.NAME()); }; \ getDataFunction[#NAME] = [this]() { return getString(data.NAME()); }; \
setDataFunction[#NAME] = [this](std::string value) { \
setDataFromString(out_data.NAME(), value); \
}; \
getByteArrayFunction.push_back( \ getByteArrayFunction.push_back( \
{[this]() { return getByteArray(data.NAME()); }, getTypeSize<decltype(data.NAME())>()}); \ {[this]() { return getByteArray(data.NAME()); }, getTypeSize<decltype(data.NAME())>()}); \
setByteArrayFunction[#NAME] = [this](XNByteArray byteArray) { \ setByteArrayFunction[#NAME] = [this](XNByteArray byteArray) { \
@ -220,13 +314,13 @@ protected:
auto temp = data.NAME().value(); \ auto temp = data.NAME().value(); \
if constexpr (std::is_arithmetic_v<decltype(temp)>) { \ if constexpr (std::is_arithmetic_v<decltype(temp)>) { \
model_data->NAME = temp; \ model_data->NAME = temp; \
} else if constexpr (std::is_std_array_v<decltype(temp)>) { \ } else if constexpr (is_std_array_v<decltype(temp)>) { \
size_t arraySize = std::tuple_size<decltype(temp)>::value; \ size_t arraySize = array_size_v<decltype(temp)>; \
for (size_t i = 0; i < arraySize; ++i) { \ for (size_t i = 0; i < arraySize; ++i) { \
if constexpr (std::is_arithmetic_v<decltype(temp[i])>) { \ if constexpr (std::is_arithmetic_v<decltype(temp[i])>) { \
model_data->NAME[i] = temp[i]; \ model_data->NAME[i] = temp[i]; \
} else if constexpr (std::is_std_array_v<decltype(temp[i])>) { \ } else if constexpr (is_std_array_v<decltype(temp[i])>) { \
size_t arraySize2 = std::tuple_size<decltype(temp[i])>::value; \ size_t arraySize2 = array_size_v<decltype(temp[i])>; \
for (size_t j = 0; j < arraySize2; ++j) { \ for (size_t j = 0; j < arraySize2; ++j) { \
model_data->NAME[i][j] = temp[i][j]; \ model_data->NAME[i][j] = temp[i][j]; \
} \ } \
@ -236,19 +330,19 @@ protected:
} }
#define ASSIGN_VALUE_SET(NAME) \ #define ASSIGN_VALUE_SET(NAME) \
if constexpr (std::is_arithmetic_v<decltype(data.NAME())::type>) { \ if constexpr (std::is_arithmetic_v<decltype(out_data.NAME())::type>) { \
data.NAME(model_data->NAME); \ out_data.NAME(model_data->NAME); \
} else if constexpr (std::is_std_array_v<decltype(data.NAME())::type>) { \ } else if constexpr (is_std_array_v<decltype(out_data.NAME())::type>) { \
using thisType = typename decltype(data.NAME())::type; \ using thisType = typename decltype(out_data.NAME())::type; \
thisType temp; \ thisType temp; \
size_t arraySize1 = std::tuple_size<thisType>::value; \ size_t arraySize1 = array_size_v<thisType>; \
using subType = thisType::value_type; \ using subType = thisType::value_type; \
if constexpr (std::is_arithmetic_v<subType>) { \ if constexpr (std::is_arithmetic_v<subType>) { \
for (size_t i = 0; i < arraySize1; ++i) { \ for (size_t i = 0; i < arraySize1; ++i) { \
temp[i] = model_data->NAME[i]; \ temp[i] = model_data->NAME[i]; \
} \ } \
} else if constexpr (std::is_std_array_v<subType>) { \ } else if constexpr (is_std_array_v<subType>) { \
size_t arraySize2 = std::tuple_size<subType>::value; \ size_t arraySize2 = array_size_v<subType>; \
std::array<subType, arraySize1> temp; \ std::array<subType, arraySize1> temp; \
for (size_t i = 0; i < arraySize1; ++i) { \ for (size_t i = 0; i < arraySize1; ++i) { \
for (size_t j = 0; j < arraySize2; ++j) { \ for (size_t j = 0; j < arraySize2; ++j) { \
@ -256,5 +350,5 @@ protected:
} \ } \
} \ } \
} \ } \
data.NAME(temp); \ out_data.NAME(temp); \
} }

View File

@ -15,13 +15,30 @@ struct is_std_array<std::array<T, N>> : std::true_type {
template <typename T> template <typename T>
inline constexpr bool is_std_array_v = is_std_array<T>::value; inline constexpr bool is_std_array_v = is_std_array<T>::value;
/**
* @brief
* @tparam T
* @return std::array1
*/
template <typename T>
struct array_size : std::integral_constant<std::size_t, 1> {
};
template <typename T, std::size_t N>
struct array_size<std::array<T, N>> : std::integral_constant<std::size_t, N> {
};
// 变量模板简化使用
template <typename T>
inline constexpr std::size_t array_size_v = array_size<T>::value;
// 获取类型大小的辅助函数 // 获取类型大小的辅助函数
template <typename T> template <typename T>
constexpr size_t getTypeSize() constexpr size_t getTypeSize()
{ {
if constexpr (is_std_array_v<T>) { if constexpr (is_std_array_v<T>) {
// 对于std::array计算所有元素的总大小 // 对于std::array计算所有元素的总大小
return getTypeSize<typename T::value_type>() * std::tuple_size<T>::value; return getTypeSize<typename T::value_type>() * array_size_v<T>;
} else { } else {
return sizeof(T); return sizeof(T);
} }

View File

@ -4,23 +4,22 @@
using json = nlohmann::json; using json = nlohmann::json;
void XNDDSInterface::getUDPPackage(uint8_t *buffer, size_t bufferSize) XNByteArray XNDDSInterface::getUDPPackage()
{ {
if (bufferSize < MAX_UDP_PACKET_SIZE) XNByteArray result;
return;
size_t currentPos = 0; size_t currentPos = 0;
// 复制头部 // 复制头部
if (headerSize >= 5) { if (headerSize >= 5) {
std::memcpy(buffer, header, 5); result.append(header, 5);
currentPos = 5; currentPos = 5;
} }
// 复制数据 // 复制数据
for (auto func : getByteArrayFunction) { for (auto func : getByteArrayFunction) {
if (currentPos + func.size <= MAX_UDP_PACKET_SIZE) { if (currentPos + func.size <= MAX_UDP_PACKET_SIZE) {
func.func(buffer + currentPos, func.size); result.append(func.func());
currentPos += func.size; currentPos += func.size;
} else { } else {
break; // 超出最大包大小 break; // 超出最大包大小
@ -29,79 +28,38 @@ void XNDDSInterface::getUDPPackage(uint8_t *buffer, size_t bufferSize)
// 更新包大小 // 更新包大小
if (currentPos >= 5) { if (currentPos >= 5) {
buffer[4] = static_cast<uint8_t>(currentPos); result[4] = static_cast<uint8_t>(currentPos);
}
} }
std::string XNDDSInterface::getData(const std::string &varName)
{
int index1 = -1;
int index2 = -1;
std::string trueVarName = varName;
size_t startPos = varName.find('[');
if (startPos != std::string::npos) {
size_t midPos = varName.find("][", startPos);
size_t endPos = varName.find_last_of(']');
if (midPos != std::string::npos) {
try {
index1 = std::stoi(varName.substr(startPos + 1, midPos - startPos - 1));
index2 = std::stoi(varName.substr(midPos + 2, endPos - midPos - 2));
} catch (...) {
std::cerr << "无法解析数组索引: " << varName << std::endl;
index1 = 0;
index2 = 0;
}
} else if (endPos != std::string::npos) {
try {
index1 = std::stoi(varName.substr(startPos + 1, endPos - startPos - 1));
} catch (...) {
std::cerr << "无法解析数组索引: " << varName << std::endl;
index1 = 0;
}
}
trueVarName = varName.substr(0, startPos);
}
auto it = getDataFunction.find(trueVarName);
if (it == getDataFunction.end()) {
return std::string();
}
std::lock_guard<std::mutex> lock(mutex);
std::string result = it->second();
if (index1 < 0) {
return result; return result;
} }
std::vector<std::string> list; std::unordered_map<std::string, std::string>
std::stringstream ss(result); XNDDSInterface::getStringData(std::vector<std::string> varNames)
std::string item; {
while (std::getline(ss, item, ',')) { std::unordered_map<std::string, std::string> result;
list.push_back(item);
std::lock_guard<std::mutex> lock(mutex);
for (const auto &varName : varNames) {
auto it = getDataFunction.find(varName);
if (it == getDataFunction.end()) {
continue;
}
result[varName] = it->second();
} }
if (index1 >= static_cast<int>(list.size())) { return result;
std::cerr << "数组索引超出范围: " << varName << std::endl;
return std::string();
} }
if (index2 < 0) { void XNDDSInterface::setDataByString(std::unordered_map<std::string, std::string> data)
return list[index1]; {
clearOutData();
for (const auto &[varName, value] : data) {
auto it = setDataFunction.find(varName);
if (it == setDataFunction.end()) {
continue;
} }
it->second(value);
std::vector<std::string> list2;
std::stringstream ss2(list[index1]);
while (std::getline(ss2, item, ' ')) {
list2.push_back(item);
} }
sendOutData();
if (index2 >= static_cast<int>(list2.size())) {
std::cerr << "数组索引超出范围: " << varName << std::endl;
return std::string();
}
return list2[index2];
} }

View File

@ -1,6 +1,7 @@
#pragma once #pragma once
#include "XNObject.h" #include "XNFramework.h"
#include "XNDDSManager.h"
#include "XNByteArray.h" #include "XNByteArray.h"
#include "XNTypeTraits.h" #include "XNTypeTraits.h"
#include <stdexcept> #include <stdexcept>
@ -19,7 +20,7 @@ public:
* @brief * @brief
* @param framework: * @param framework:
*/ */
virtual void Initialize(XNFrameworkPtr framework) = 0; virtual void Initialize(XNFrameworkPtr framework, uint32_t modelID) = 0;
/** /**
* @brief UDP包 * @brief UDP包
@ -28,13 +29,17 @@ public:
XNByteArray getUDPPackage(); XNByteArray getUDPPackage();
/** /**
* @brief JSON前端获取指定变量的数据 * @brief
* @param varName: * @param varNames:
* @param nameSize: * @return:
* @param varData:
* @param dataSize:
*/ */
void getData(const char *varName, const size_t nameSize, char *varData, size_t dataSize); std::unordered_map<std::string, std::string> getStringData(std::vector<std::string> varNames);
/**
* @brief
* @param data:
*/
void setDataByString(std::unordered_map<std::string, std::string> data);
protected: protected:
/** /**
@ -153,7 +158,7 @@ protected:
} else { } else {
return std::to_string(0); return std::to_string(0);
} }
} else if constexpr (std::is_same_v<T, std::string>) { } else if constexpr (is_std_array_v<T>) {
if (data) { if (data) {
return getStringFromStdArray(data.value()); return getStringFromStdArray(data.value());
} else { } else {
@ -164,6 +169,34 @@ protected:
return std::string(); return std::string();
} }
/**
* @brief JSON前端
* @param data:
* @param value:
*/
template <typename T>
void setDataFromString(eprosima::fastcdr::optional<T> &data, const std::string &value)
{
if constexpr (std::is_arithmetic_v<T>) {
if constexpr (std::is_same_v<T, float> || std::is_same_v<T, double>) {
data = std::stod(value);
} else {
data = std::stoll(value);
}
} else if constexpr (is_std_array_v<T>) {
// 解析输入字符串
std::stringstream ss(value);
std::string item;
std::vector<std::string> items;
while (std::getline(ss, item, ',')) {
items.push_back(item);
}
T temp;
setStdArrayFromString(temp, items, 0);
data = temp;
}
}
/** /**
* @brief JSON前端 * @brief JSON前端
* @param data: * @param data:
@ -185,13 +218,69 @@ protected:
return ss.str(); return ss.str();
} }
private:
/** /**
* @brief * @brief JSON前端
* @param varName: * @param data:
* @return: * @param value: "数字,数字,..."
* @param start_pos:
* @return
* @throw std::runtime_error:
*/ */
std::string getData(const std::string &varName); template <typename T, std::size_t N>
size_t setStdArrayFromString(std::array<T, N> &data, const std::vector<std::string> &value,
size_t start_pos = 0)
{
// 递归处理每个元素
for (std::size_t i = 0; i < N; ++i) {
try {
if constexpr (std::is_arithmetic_v<T>) {
// 对于基本类型,直接转换
if constexpr (std::is_same_v<T, float> || std::is_same_v<T, double>) {
data[i] = static_cast<T>(std::stod(value[start_pos + i]));
} else {
data[i] = static_cast<T>(std::stoll(value[start_pos + i]));
}
} else if constexpr (is_std_array_v<T>) {
// 对于嵌套数组,递归处理
start_pos = setStdArrayFromString(data[i], value, start_pos + i);
} else {
static_assert(std::is_arithmetic_v<T> || is_std_array_v<T>,
"Type must be arithmetic or std::array");
}
} catch (const std::exception &e) {
throw std::runtime_error("Error parsing element " + std::to_string(i) + ": "
+ e.what());
}
}
return start_pos + N;
}
template <typename T1, typename T2>
void assign_value_get(eprosima::fastcdr::optional<T1> &data, T2 &model_data)
{
if (data) {
auto temp = data.value();
if constexpr (std::is_arithmetic_v<T1>) {
model_data = temp;
} else if constexpr (is_std_array_v<T1>) {
size_t arraySize = array_size_v<T1>;
for (size_t i = 0; i < arraySize; ++i) {
auto temp2 = temp[i];
if constexpr (std::is_arithmetic_v<T2>) {
model_data[i] = temp2;
} else if constexpr (is_std_array_v<T2>) {
size_t arraySize2 = array_size_v<T2>;
for (size_t j = 0; j < arraySize2; ++j) {
model_data[i][j] = temp2[j];
}
}
}
}
}
}
virtual void clearOutData() {}
virtual void sendOutData() {}
protected: protected:
struct ByteArrayFunc { struct ByteArrayFunc {
@ -200,15 +289,20 @@ protected:
}; };
std::unordered_map<std::string, std::function<std::string()>> getDataFunction; std::unordered_map<std::string, std::function<std::string()>> getDataFunction;
std::unordered_map<std::string, std::function<void(std::string)>> setDataFunction;
std::vector<ByteArrayFunc> getByteArrayFunction; std::vector<ByteArrayFunc> getByteArrayFunction;
std::unordered_map<std::string, std::function<void(XNByteArray)>> setByteArrayFunction; std::unordered_map<std::string, std::function<void(XNByteArray)>> setByteArrayFunction;
std::mutex mutex; std::mutex mutex;
uint8_t header[5]{}; // 固定大小的头部 uint8_t header[5]{}; // 固定大小的头部
size_t headerSize = 5; size_t headerSize = 5;
FAST_DDS_MACRO::DataWriter *dataWriter;
}; };
#define MAP_DATA_FUNC(NAME) \ #define MAP_DATA_FUNC(NAME) \
getDataFunction[#NAME] = [this]() { return getString(data.NAME()); }; \ getDataFunction[#NAME] = [this]() { return getString(data.NAME()); }; \
setDataFunction[#NAME] = [this](std::string value) { \
setDataFromString(out_data.NAME(), value); \
}; \
getByteArrayFunction.push_back( \ getByteArrayFunction.push_back( \
{[this]() { return getByteArray(data.NAME()); }, getTypeSize<decltype(data.NAME())>()}); \ {[this]() { return getByteArray(data.NAME()); }, getTypeSize<decltype(data.NAME())>()}); \
setByteArrayFunction[#NAME] = [this](XNByteArray byteArray) { \ setByteArrayFunction[#NAME] = [this](XNByteArray byteArray) { \
@ -220,13 +314,13 @@ protected:
auto temp = data.NAME().value(); \ auto temp = data.NAME().value(); \
if constexpr (std::is_arithmetic_v<decltype(temp)>) { \ if constexpr (std::is_arithmetic_v<decltype(temp)>) { \
model_data->NAME = temp; \ model_data->NAME = temp; \
} else if constexpr (std::is_std_array_v<decltype(temp)>) { \ } else if constexpr (is_std_array_v<decltype(temp)>) { \
size_t arraySize = std::tuple_size<decltype(temp)>::value; \ size_t arraySize = array_size_v<decltype(temp)>; \
for (size_t i = 0; i < arraySize; ++i) { \ for (size_t i = 0; i < arraySize; ++i) { \
if constexpr (std::is_arithmetic_v<decltype(temp[i])>) { \ if constexpr (std::is_arithmetic_v<decltype(temp[i])>) { \
model_data->NAME[i] = temp[i]; \ model_data->NAME[i] = temp[i]; \
} else if constexpr (std::is_std_array_v<decltype(temp[i])>) { \ } else if constexpr (is_std_array_v<decltype(temp[i])>) { \
size_t arraySize2 = std::tuple_size<decltype(temp[i])>::value; \ size_t arraySize2 = array_size_v<decltype(temp[i])>; \
for (size_t j = 0; j < arraySize2; ++j) { \ for (size_t j = 0; j < arraySize2; ++j) { \
model_data->NAME[i][j] = temp[i][j]; \ model_data->NAME[i][j] = temp[i][j]; \
} \ } \
@ -236,19 +330,19 @@ protected:
} }
#define ASSIGN_VALUE_SET(NAME) \ #define ASSIGN_VALUE_SET(NAME) \
if constexpr (std::is_arithmetic_v<decltype(data.NAME())::type>) { \ if constexpr (std::is_arithmetic_v<decltype(out_data.NAME())::type>) { \
data.NAME(model_data->NAME); \ out_data.NAME(model_data->NAME); \
} else if constexpr (std::is_std_array_v<decltype(data.NAME())::type>) { \ } else if constexpr (is_std_array_v<decltype(out_data.NAME())::type>) { \
using thisType = typename decltype(data.NAME())::type; \ using thisType = typename decltype(out_data.NAME())::type; \
thisType temp; \ thisType temp; \
size_t arraySize1 = std::tuple_size<thisType>::value; \ size_t arraySize1 = array_size_v<thisType>; \
using subType = thisType::value_type; \ using subType = thisType::value_type; \
if constexpr (std::is_arithmetic_v<subType>) { \ if constexpr (std::is_arithmetic_v<subType>) { \
for (size_t i = 0; i < arraySize1; ++i) { \ for (size_t i = 0; i < arraySize1; ++i) { \
temp[i] = model_data->NAME[i]; \ temp[i] = model_data->NAME[i]; \
} \ } \
} else if constexpr (std::is_std_array_v<subType>) { \ } else if constexpr (is_std_array_v<subType>) { \
size_t arraySize2 = std::tuple_size<subType>::value; \ size_t arraySize2 = array_size_v<subType>; \
std::array<subType, arraySize1> temp; \ std::array<subType, arraySize1> temp; \
for (size_t i = 0; i < arraySize1; ++i) { \ for (size_t i = 0; i < arraySize1; ++i) { \
for (size_t j = 0; j < arraySize2; ++j) { \ for (size_t j = 0; j < arraySize2; ++j) { \
@ -256,5 +350,5 @@ protected:
} \ } \
} \ } \
} \ } \
data.NAME(temp); \ out_data.NAME(temp); \
} }

View File

@ -15,13 +15,30 @@ struct is_std_array<std::array<T, N>> : std::true_type {
template <typename T> template <typename T>
inline constexpr bool is_std_array_v = is_std_array<T>::value; inline constexpr bool is_std_array_v = is_std_array<T>::value;
/**
* @brief
* @tparam T
* @return std::array1
*/
template <typename T>
struct array_size : std::integral_constant<std::size_t, 1> {
};
template <typename T, std::size_t N>
struct array_size<std::array<T, N>> : std::integral_constant<std::size_t, N> {
};
// 变量模板简化使用
template <typename T>
inline constexpr std::size_t array_size_v = array_size<T>::value;
// 获取类型大小的辅助函数 // 获取类型大小的辅助函数
template <typename T> template <typename T>
constexpr size_t getTypeSize() constexpr size_t getTypeSize()
{ {
if constexpr (is_std_array_v<T>) { if constexpr (is_std_array_v<T>) {
// 对于std::array计算所有元素的总大小 // 对于std::array计算所有元素的总大小
return getTypeSize<typename T::value_type>() * std::tuple_size<T>::value; return getTypeSize<typename T::value_type>() * array_size_v<T>;
} else { } else {
return sizeof(T); return sizeof(T);
} }

View File

@ -71,6 +71,7 @@
"cinttypes": "cpp", "cinttypes": "cpp",
"typeindex": "cpp", "typeindex": "cpp",
"typeinfo": "cpp", "typeinfo": "cpp",
"variant": "cpp" "variant": "cpp",
"fstream": "cpp"
} }
} }

View File

@ -2,9 +2,6 @@ cmake_minimum_required(VERSION 3.16)
project(XNGroundHandling LANGUAGES CXX) project(XNGroundHandling LANGUAGES CXX)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
@ -18,8 +15,5 @@ endif()
# XNCore_PATH include # XNCore_PATH include
include_directories(${XNCore_PATH}/include) include_directories(${XNCore_PATH}/include)
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core)
add_subdirectory(XNGroundHandlingInterface) add_subdirectory(XNGroundHandlingInterface)
add_subdirectory(XNGroundHandling) add_subdirectory(XNGroundHandling)

View File

@ -7,7 +7,6 @@ add_library(XNGroundHandling SHARED
) )
target_link_libraries(XNGroundHandling PRIVATE target_link_libraries(XNGroundHandling PRIVATE
Qt${QT_VERSION_MAJOR}::Core
${XNCore_PATH}/lib/libXNCore.so ${XNCore_PATH}/lib/libXNCore.so
XNGroundHandlingInterface) XNGroundHandlingInterface)

View File

@ -2,18 +2,10 @@
#include "XNGroundHandling_p.h" #include "XNGroundHandling_p.h"
#include <XNCore/XNModelManager.h> #include <XNCore/XNModelManager.h>
#include <XNCore/XNDDSManager.h> #include <XNCore/XNDDSManager.h>
#include <QMutexLocker>
XN_DLL_INITIALIZE(XNGroundHandling) XN_MODEL_INITIALIZE(XNGroundHandling)
XN_REGISTER_PARTICIPANT_BEGIN(XNGroundHandling) XNGroundHandling::XNGroundHandling() : XNModelObject(new XNGroundHandlingPrivate())
XN_PUBLISHTOPIC(XNSim::ATA04::GroundHandling_output)
XN_PUBLISHTOPIC(XNSim::ATA04::GroundHandling_heartbeat)
XN_SUBSCRIBETOPIC(XNSim::ATA04::GroundHandling_input, &XNGroundHandling::OnInput)
XN_REGISTER_PARTICIPANT_END(XNGroundHandling)
XNGroundHandling::XNGroundHandling(QObject *parent)
: XNModelObject(*new XNGroundHandlingPrivate(this), parent)
{ {
} }
@ -21,30 +13,27 @@ XNGroundHandling::~XNGroundHandling()
{ {
} }
XNGroundHandling::XNGroundHandling(XNGroundHandlingPrivate &dd, QObject *parent) XNGroundHandling::XNGroundHandling(PrivateType *p) : XNModelObject(p)
: XNModelObject(dd, parent)
{ {
} }
void XNGroundHandling::OnInitialize() void XNGroundHandling::Initialize()
{ {
Q_D(XNGroundHandling); T_D();
XNModelObject::OnInitialize(); XNModelObject::Initialize();
if (d->_dynamicLib) { if (d->_dynamicLib) {
d->_fun = reinterpret_cast<FunctionType>( d->_fun = (FunctionType)dlsym(d->_dynamicLib, d->_entryPointName.c_str());
d->_dynamicLib->resolve("_Z29SACSCGroundHandlingEntryPointP20ComacDataStructure_S"));
if (!d->_fun) { if (!d->_fun) {
LOG_WARNING("Failed to resolve SACSCGroundHandlingEntry:%1", LOG_WARNING("Failed to resolve SACSCGroundHandlingEntry");
d->_dynamicLib->errorString());
} }
} }
//add other initial code here //add other initial code here
} }
void XNGroundHandling::OnPrepareForExecute() void XNGroundHandling::PrepareForExecute()
{ {
Q_D(XNGroundHandling); T_D();
XNModelObject::OnPrepareForExecute(); XNModelObject::PrepareForExecute();
//add your initial data code here //add your initial data code here
d->_data.input_ground = new input_ground_S(); d->_data.input_ground = new input_ground_S();
d->_data.input_ground->l_04_i_gdcomac_brake_torq_f8 = new double *[3]; d->_data.input_ground->l_04_i_gdcomac_brake_torq_f8 = new double *[3];
@ -122,355 +111,21 @@ void XNGroundHandling::OnPrepareForExecute()
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
d->_data.output_ground->l_04_o_gdcomac_vczt_f8[i] = new double[2]; d->_data.output_ground->l_04_o_gdcomac_vczt_f8[i] = new double[2];
} }
d->_inputInterface.Initialize(GetFramework(), GetUniqueId());
d->_outputInterface.Initialize(GetFramework(), GetUniqueId());
d->_heartbeatInterface.Initialize(GetFramework(), GetUniqueId());
} }
void XNGroundHandling::StepUpdate() void XNGroundHandling::StepUpdate()
{ {
Q_D(XNGroundHandling); T_D();
XNModelObject::StepUpdate(); XNModelObject::StepUpdate();
if (d->_fun) { if (d->_fun) {
//add your input code here //add your input code here
QMutexLocker locker(&d->_mutex); d->_inputInterface.getData(d->_data.input_ground);
d->_fun(&d->_data); d->_fun(&d->_data);
d->_outputInterface.setData(d->_data.output_ground);
d->_heartbeatInterface.setData(&d->_data);
//add your output code here //add your output code here
} }
OnOutput();
}
// template <class T1, class T2>
// void CopyInputData(T1 *model_input, const T2 &dds_input)
// {
// Q_D(XNGroundHandling);
// QMutexLocker locker(&d->_mutex);
// if (dds_input.l_04_i_gdcomac_frz_l1()) {
// model_input->l_04_i_gdcomac_frz_l1 = dds_input.l_04_i_gdcomac_frz_l1().value();
// }
// }
void XNGroundHandling::OnInput(const XNSim::ATA04::GroundHandling_input &input)
{
Q_D(XNGroundHandling);
QMutexLocker locker(&d->_mutex);
if (input.l_04_i_gdcomac_frz_l1()) {
d->_data.input_ground->l_04_i_gdcomac_frz_l1 = input.l_04_i_gdcomac_frz_l1().value();
}
if (input.l_04_i_gdcomac_chocks_l1()) {
d->_data.input_ground->l_04_i_gdcomac_chocks_l1 = input.l_04_i_gdcomac_chocks_l1().value();
}
if (input.l_04_i_gdcomac_alt_agl_f8()) {
d->_data.input_ground->l_04_i_gdcomac_alt_agl_f8 =
input.l_04_i_gdcomac_alt_agl_f8().value();
}
if (input.l_04_i_gdcomac_frzflt_l1()) {
d->_data.input_ground->l_04_i_gdcomac_frzflt_l1 = input.l_04_i_gdcomac_frzflt_l1().value();
}
if (input.l_04_i_gdcomac_p_f8()) {
d->_data.input_ground->l_04_i_gdcomac_p_f8 = input.l_04_i_gdcomac_p_f8().value();
}
if (input.l_04_i_gdcomac_q_f8()) {
d->_data.input_ground->l_04_i_gdcomac_q_f8 = input.l_04_i_gdcomac_q_f8().value();
}
if (input.l_04_i_gdcomac_r_f8()) {
d->_data.input_ground->l_04_i_gdcomac_r_f8 = input.l_04_i_gdcomac_r_f8().value();
}
if (input.l_04_i_gdcomac_ug_f8()) {
d->_data.input_ground->l_04_i_gdcomac_ug_f8 = input.l_04_i_gdcomac_ug_f8().value();
}
if (input.l_04_i_gdcomac_vg_f8()) {
d->_data.input_ground->l_04_i_gdcomac_vg_f8 = input.l_04_i_gdcomac_vg_f8().value();
}
if (input.l_04_i_gdcomac_wg_f8()) {
d->_data.input_ground->l_04_i_gdcomac_wg_f8 = input.l_04_i_gdcomac_wg_f8().value();
}
if (input.l_04_i_gdcomac_blcg_f8()) {
d->_data.input_ground->l_04_i_gdcomac_blcg_f8 = input.l_04_i_gdcomac_blcg_f8().value();
}
if (input.l_04_i_gdcomac_bscg_f8()) {
d->_data.input_ground->l_04_i_gdcomac_bscg_f8 = input.l_04_i_gdcomac_bscg_f8().value();
}
if (input.l_04_i_gdcomac_wlcg_f8()) {
d->_data.input_ground->l_04_i_gdcomac_wlcg_f8 = input.l_04_i_gdcomac_wlcg_f8().value();
}
if (input.l_04_i_gdcomac_pb_active_l1()) {
d->_data.input_ground->l_04_i_gdcomac_pb_active_l1 =
input.l_04_i_gdcomac_pb_active_l1().value();
}
if (input.l_04_i_gdcomac_brake_torq_f8()) {
auto l_04_i_gdcomac_brake_torq_f8 = input.l_04_i_gdcomac_brake_torq_f8().value();
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 2; j++) {
d->_data.input_ground->l_04_i_gdcomac_brake_torq_f8[i][j] =
l_04_i_gdcomac_brake_torq_f8[i][j];
}
}
}
if (input.l_04_i_gdcomac_gear_f8()) {
auto l_04_i_gdcomac_gear_f8 = input.l_04_i_gdcomac_gear_f8().value();
for (int i = 0; i < 3; i++) {
d->_data.input_ground->l_04_i_gdcomac_gear_f8[i] = l_04_i_gdcomac_gear_f8[i];
}
}
if (input.l_04_i_gdcomac_gsteer_f8()) {
auto l_04_i_gdcomac_gsteer_f8 = input.l_04_i_gdcomac_gsteer_f8().value();
for (int i = 0; i < 3; i++) {
d->_data.input_ground->l_04_i_gdcomac_gsteer_f8[i] = l_04_i_gdcomac_gsteer_f8[i];
}
}
if (input.l_04_i_gdcomac_tire_pres_f8()) {
auto l_04_i_gdcomac_tire_pres_f8 = input.l_04_i_gdcomac_tire_pres_f8().value();
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 2; j++) {
d->_data.input_ground->l_04_i_gdcomac_tire_pres_f8[i][j] =
l_04_i_gdcomac_tire_pres_f8[i][j];
}
}
}
if (input.l_04_i_gdcomac_onjax_l1()) {
d->_data.input_ground->l_04_i_gdcomac_onjax_l1 = input.l_04_i_gdcomac_onjax_l1().value();
}
if (input.l_04_i_gdcomac_contdep_f8()) {
auto l_04_i_gdcomac_contdep_f8 = input.l_04_i_gdcomac_contdep_f8().value();
for (int i = 0; i < 3; i++) {
d->_data.input_ground->l_04_i_gdcomac_contdep_f8[i] = l_04_i_gdcomac_contdep_f8[i];
}
}
if (input.l_04_i_gdcomac_thetag_f8()) {
d->_data.input_ground->l_04_i_gdcomac_thetag_f8 = input.l_04_i_gdcomac_thetag_f8().value();
}
if (input.l_04_i_gdcomac_phig_f8()) {
d->_data.input_ground->l_04_i_gdcomac_phig_f8 = input.l_04_i_gdcomac_phig_f8().value();
}
if (input.l_04_i_gdcomac_rwyrgh_i2()) {
d->_data.input_ground->l_04_i_gdcomac_rwyrgh_i2 = input.l_04_i_gdcomac_rwyrgh_i2().value();
}
if (input.l_04_i_gdcomac_rwyhdg_f8()) {
d->_data.input_ground->l_04_i_gdcomac_rwyhdg_f8 = input.l_04_i_gdcomac_rwyhdg_f8().value();
}
if (input.l_04_i_gdcomac_reset_braketemp_l1()) {
d->_data.input_ground->l_04_i_gdcomac_reset_braketemp_l1 =
input.l_04_i_gdcomac_reset_braketemp_l1().value();
}
if (input.l_04_i_gdcomac_reset_tirepress_l1()) {
d->_data.input_ground->l_04_i_gdcomac_reset_tirepress_l1 =
input.l_04_i_gdcomac_reset_tirepress_l1().value();
}
if (input.l_04_i_gdcomac_temp_c_f8()) {
d->_data.input_ground->l_04_i_gdcomac_temp_c_f8 = input.l_04_i_gdcomac_temp_c_f8().value();
}
if (input.l_04_i_gdcomac_brake_temp_f8()) {
auto l_04_i_gdcomac_brake_temp_f8 = input.l_04_i_gdcomac_brake_temp_f8().value();
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 2; j++) {
d->_data.input_ground->l_04_i_gdcomac_brake_temp_f8[i][j] =
l_04_i_gdcomac_brake_temp_f8[i][j];
}
}
}
if (input.l_04_i_gdcomac_tire_tburst_l1()) {
auto l_04_i_gdcomac_tire_tburst_l1 = input.l_04_i_gdcomac_tire_tburst_l1().value();
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 2; j++) {
d->_data.input_ground->l_04_i_gdcomac_tire_tburst_l1[i][j] =
l_04_i_gdcomac_tire_tburst_l1[i][j];
}
}
}
if (input.l_04_i_gdcomac_tire_tflat_l1()) {
auto l_04_i_gdcomac_tire_tflat_l1 = input.l_04_i_gdcomac_tire_tflat_l1().value();
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 2; j++) {
d->_data.input_ground->l_04_i_gdcomac_tire_tflat_l1[i][j] =
l_04_i_gdcomac_tire_tflat_l1[i][j];
}
}
}
if (input.l_04_i_gdcomac_brk_reset_tpres_l1()) {
d->_data.input_ground->l_04_i_gdcomac_brk_reset_tpres_l1 =
input.l_04_i_gdcomac_brk_reset_tpres_l1().value();
}
if (input.l_04_i_gdcomac_rcon_ci_f8()) {
auto l_04_i_gdcomac_rcon_ci_f8 = input.l_04_i_gdcomac_rcon_ci_f8().value();
for (int i = 0; i < 3; i++) {
d->_data.input_ground->l_04_i_gdcomac_rcon_ci_f8[i] = l_04_i_gdcomac_rcon_ci_f8[i];
}
}
if (input.l_04_i_gdcomac_pb_towforce_f8()) {
d->_data.input_ground->l_04_i_gdcomac_pb_towforce_f8 =
input.l_04_i_gdcomac_pb_towforce_f8().value();
}
if (input.l_04_i_gdcomac_gsteer_state_i4()) {
d->_data.input_ground->l_04_i_gdcomac_gsteer_state_i4 =
input.l_04_i_gdcomac_gsteer_state_i4().value();
}
if (input.l_04_i_gdcomac_trim_active_l1()) {
d->_data.input_ground->l_04_i_gdcomac_trim_active_l1 =
input.l_04_i_gdcomac_trim_active_l1().value();
}
if (input.l_04_i_gdcomac_phi_deg_f8()) {
d->_data.input_ground->l_04_i_gdcomac_phi_deg_f8 =
input.l_04_i_gdcomac_phi_deg_f8().value();
}
if (input.l_04_i_gdcomac_theta_deg_f8()) {
d->_data.input_ground->l_04_i_gdcomac_theta_deg_f8 =
input.l_04_i_gdcomac_theta_deg_f8().value();
}
if (input.l_04_i_gdcomac_psi_deg_f8()) {
d->_data.input_ground->l_04_i_gdcomac_psi_deg_f8 =
input.l_04_i_gdcomac_psi_deg_f8().value();
}
if (input.l_04_i_gdcomac_resetint_l1()) {
d->_data.input_ground->l_04_i_gdcomac_resetint_l1 =
input.l_04_i_gdcomac_resetint_l1().value();
}
}
void XNGroundHandling::OnOutput()
{
Q_D(XNGroundHandling);
QMutexLocker locker(&d->_mutex);
XNSim::ATA04::GroundHandling_heartbeat heartbeat;
heartbeat.groundhandling_model_heartbeat(d->_data.groundhandling_model_heartbeat);
d->_dataWriters["XNSim::ATA04::GroundHandling_heartbeat"]->write(&heartbeat);
//DDS数据发布
XNSim::ATA04::GroundHandling_output output;
output.l_04_o_gdcomac_frz_l1(d->_data.output_ground->l_04_o_gdcomac_frz_l1);
output.l_04_o_gdcomac_ac_on_ground_l1(d->_data.output_ground->l_04_o_gdcomac_ac_on_ground_l1);
output.l_04_o_gdcomac_ac_stationary_f8(d->_data.output_ground->l_04_o_gdcomac_ac_stationary_f8);
output.l_04_o_gdcomac_alt_tire_f8(d->_data.output_ground->l_04_o_gdcomac_alt_tire_f8);
output.l_04_o_gdcomac_zcg_to_tire_f8(d->_data.output_ground->l_04_o_gdcomac_zcg_to_tire_f8);
output.l_04_o_gdcomac_fxb_f8(d->_data.output_ground->l_04_o_gdcomac_fxb_f8);
output.l_04_o_gdcomac_fyb_f8(d->_data.output_ground->l_04_o_gdcomac_fyb_f8);
output.l_04_o_gdcomac_fzb_f8(d->_data.output_ground->l_04_o_gdcomac_fzb_f8);
output.l_04_o_gdcomac_mxb_f8(d->_data.output_ground->l_04_o_gdcomac_mxb_f8);
output.l_04_o_gdcomac_myb_f8(d->_data.output_ground->l_04_o_gdcomac_myb_f8);
output.l_04_o_gdcomac_mzb_f8(d->_data.output_ground->l_04_o_gdcomac_mzb_f8);
std::array<double, 3> l_04_o_gdcomac_fygs_f8;
for (int i = 0; i < 3; i++) {
l_04_o_gdcomac_fygs_f8[i] = d->_data.output_ground->l_04_o_gdcomac_fygs_f8[i];
}
output.l_04_o_gdcomac_fygs_f8(l_04_o_gdcomac_fygs_f8);
std::array<double, 3> l_04_o_gdcomac_mzgs_f8;
for (int i = 0; i < 3; i++) {
l_04_o_gdcomac_mzgs_f8[i] = d->_data.output_ground->l_04_o_gdcomac_mzgs_f8[i];
}
output.l_04_o_gdcomac_mzgs_f8(l_04_o_gdcomac_mzgs_f8);
std::array<double, 3> l_04_o_gdcomac_mu_f8;
for (int i = 0; i < 3; i++) {
l_04_o_gdcomac_mu_f8[i] = d->_data.output_ground->l_04_o_gdcomac_mu_f8[i];
}
output.l_04_o_gdcomac_mu_f8(l_04_o_gdcomac_mu_f8);
std::array<double, 3> l_04_o_gdcomac_dstroke_f8;
for (int i = 0; i < 3; i++) {
l_04_o_gdcomac_dstroke_f8[i] = d->_data.output_ground->l_04_o_gdcomac_dstroke_f8[i];
}
output.l_04_o_gdcomac_dstroke_f8(l_04_o_gdcomac_dstroke_f8);
std::array<std::array<double, 2>, 3> l_04_o_gdcomac_sr_f8;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 2; j++) {
l_04_o_gdcomac_sr_f8[i][j] = d->_data.output_ground->l_04_o_gdcomac_sr_f8[i][j];
}
}
output.l_04_o_gdcomac_sr_f8(l_04_o_gdcomac_sr_f8);
std::array<std::array<double, 2>, 3> l_04_o_gdcomac_sy_f8;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 2; j++) {
l_04_o_gdcomac_sy_f8[i][j] = d->_data.output_ground->l_04_o_gdcomac_sy_f8[i][j];
}
}
output.l_04_o_gdcomac_sy_f8(l_04_o_gdcomac_sy_f8);
std::array<std::array<double, 2>, 3> l_04_o_gdcomac_sx_f8;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 2; j++) {
l_04_o_gdcomac_sx_f8[i][j] = d->_data.output_ground->l_04_o_gdcomac_sx_f8[i][j];
}
}
output.l_04_o_gdcomac_sx_f8(l_04_o_gdcomac_sx_f8);
std::array<double, 3> l_04_o_gdcomac_xft_f8;
for (int i = 0; i < 3; i++) {
l_04_o_gdcomac_xft_f8[i] = d->_data.output_ground->l_04_o_gdcomac_xft_f8[i];
}
output.l_04_o_gdcomac_xft_f8(l_04_o_gdcomac_xft_f8);
std::array<double, 3> l_04_o_gdcomac_yft_f8;
for (int i = 0; i < 3; i++) {
l_04_o_gdcomac_yft_f8[i] = d->_data.output_ground->l_04_o_gdcomac_yft_f8[i];
}
output.l_04_o_gdcomac_yft_f8(l_04_o_gdcomac_yft_f8);
std::array<double, 3> l_04_o_gdcomac_zft_f8;
for (int i = 0; i < 3; i++) {
l_04_o_gdcomac_zft_f8[i] = d->_data.output_ground->l_04_o_gdcomac_zft_f8[i];
}
output.l_04_o_gdcomac_zft_f8(l_04_o_gdcomac_zft_f8);
output.l_04_o_gdcomac_distngrxcg_f8(d->_data.output_ground->l_04_o_gdcomac_distngrxcg_f8);
output.l_04_o_gdcomac_distmgrxcg_f8(d->_data.output_ground->l_04_o_gdcomac_distmgrxcg_f8);
output.l_04_o_gdcomac_distmgrzcg_f8(d->_data.output_ground->l_04_o_gdcomac_distmgrzcg_f8);
std::array<std::array<double, 2>, 3> l_04_o_gdcomac_tire_vel_f8;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 2; j++) {
l_04_o_gdcomac_tire_vel_f8[i][j] =
d->_data.output_ground->l_04_o_gdcomac_tire_vel_f8[i][j];
}
}
output.l_04_o_gdcomac_tire_vel_f8(l_04_o_gdcomac_tire_vel_f8);
std::array<std::array<double, 2>, 3> l_04_o_gdcomac_tire_temp_f8;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 2; j++) {
l_04_o_gdcomac_tire_temp_f8[i][j] =
d->_data.output_ground->l_04_o_gdcomac_tire_temp_f8[i][j];
}
}
output.l_04_o_gdcomac_tire_temp_f8(l_04_o_gdcomac_tire_temp_f8);
std::array<std::array<char, 2>, 3> l_04_o_gdcomac_tire_burst_l1;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 2; j++) {
l_04_o_gdcomac_tire_burst_l1[i][j] =
d->_data.output_ground->l_04_o_gdcomac_tire_burst_l1[i][j];
}
}
output.l_04_o_gdcomac_tire_burst_l1(l_04_o_gdcomac_tire_burst_l1);
output.l_04_o_gdcomac_wow_l1(d->_data.output_ground->l_04_o_gdcomac_wow_l1);
std::array<std::array<double, 2>, 3> l_04_o_gdcomac_utirew_f8;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 2; j++) {
l_04_o_gdcomac_utirew_f8[i][j] = d->_data.output_ground->l_04_o_gdcomac_utirew_f8[i][j];
}
}
output.l_04_o_gdcomac_utirew_f8(l_04_o_gdcomac_utirew_f8);
std::array<std::array<double, 2>, 3> l_04_o_gdcomac_vtirew_f8;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 2; j++) {
l_04_o_gdcomac_vtirew_f8[i][j] = d->_data.output_ground->l_04_o_gdcomac_vtirew_f8[i][j];
}
}
output.l_04_o_gdcomac_vtirew_f8(l_04_o_gdcomac_vtirew_f8);
std::array<std::array<double, 2>, 3> l_04_o_gdcomac_whl_omega_f8;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 2; j++) {
l_04_o_gdcomac_whl_omega_f8[i][j] =
d->_data.output_ground->l_04_o_gdcomac_whl_omega_f8[i][j];
}
}
output.l_04_o_gdcomac_whl_omega_f8(l_04_o_gdcomac_whl_omega_f8);
std::array<double, 6> l_04_o_gdcomac_dstruc_f8;
for (int i = 0; i < 6; i++) {
l_04_o_gdcomac_dstruc_f8[i] = d->_data.output_ground->l_04_o_gdcomac_dstruc_f8[i];
}
output.l_04_o_gdcomac_dstruc_f8(l_04_o_gdcomac_dstruc_f8);
std::array<double, 3> l_04_o_gdcomac_nd_f8;
for (int i = 0; i < 3; i++) {
l_04_o_gdcomac_nd_f8[i] = d->_data.output_ground->l_04_o_gdcomac_nd_f8[i];
}
output.l_04_o_gdcomac_nd_f8(l_04_o_gdcomac_nd_f8);
std::array<double, 3> l_04_o_gdcomac_wor_par_f8;
for (int i = 0; i < 3; i++) {
l_04_o_gdcomac_wor_par_f8[i] = d->_data.output_ground->l_04_o_gdcomac_wor_par_f8[i];
}
output.l_04_o_gdcomac_wor_par_f8(l_04_o_gdcomac_wor_par_f8);
std::array<std::array<double, 2>, 3> l_04_o_gdcomac_vczt_f8;
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 2; j++) {
l_04_o_gdcomac_vczt_f8[i][j] = d->_data.output_ground->l_04_o_gdcomac_vczt_f8[i][j];
}
}
output.l_04_o_gdcomac_vczt_f8(l_04_o_gdcomac_vczt_f8);
d->_dataWriters["XNSim::ATA04::GroundHandling_output"]->write(&output);
} }

View File

@ -1,7 +1,6 @@
#pragma once #pragma once
#include "XNGroundHandling_global.h" #include "XNGroundHandling_global.h"
#include <XNCore/XNModelObject.h> #include <XNCore/XNModelObject.h>
#include "../XNGroundHandlingInterface/XNGroundHandlingInterface.hpp"
struct XNGroundHandlingPrivate; struct XNGroundHandlingPrivate;
@ -9,22 +8,17 @@ class XNGROUNDHANDLING_EXPORT XNGroundHandling : public XNModelObject
{ {
XN_METATYPE(XNGroundHandling, XNModelObject) XN_METATYPE(XNGroundHandling, XNModelObject)
XN_DECLARE_PRIVATE(XNGroundHandling) XN_DECLARE_PRIVATE(XNGroundHandling)
XN_DECLARE_DDS()
public: public:
explicit XNGroundHandling(QObject *parent = nullptr); XNGroundHandling();
virtual ~XNGroundHandling(); virtual ~XNGroundHandling();
protected: protected:
XNGroundHandling(XNGroundHandlingPrivate &dd, QObject *parent = nullptr); XNGroundHandling(PrivateType *p);
public: public:
virtual void Initialize() override; virtual void Initialize() override;
virtual void PrepareForExecute() override; virtual void PrepareForExecute() override;
public:
virtual void StepUpdate() override; virtual void StepUpdate() override;
private:
void OnInput(const XNSim::ATA04::GroundHandling_input &input);
void OnOutput();
}; };
XNCLASS_PTR_DECLARE(XNGroundHandling)

View File

@ -1,12 +1,10 @@
#ifndef XNGROUNDHANDLING_GLOBAL_H #ifndef XNGROUNDHANDLING_GLOBAL_H
#define XNGROUNDHANDLING_GLOBAL_H #define XNGROUNDHANDLING_GLOBAL_H
#include <QtCore/qglobal.h>
#if defined(XNGROUNDHANDLING_LIBRARY) #if defined(XNGROUNDHANDLING_LIBRARY)
#define XNGROUNDHANDLING_EXPORT Q_DECL_EXPORT # define XNGROUNDHANDLING_EXPORT __attribute__((visibility("default")))
#else #else
#define XNGROUNDHANDLING_EXPORT Q_DECL_IMPORT # define XNGROUNDHANDLING_EXPORT __attribute__((visibility("hidden")))
#endif #endif
#endif // XNGROUNDHANDLING_GLOBAL_H #endif // XNGROUNDHANDLING_GLOBAL_H

View File

@ -1,6 +1,7 @@
#pragma once #pragma once
#include <XNCore/XNModelObject_p.h> #include <XNCore/XNModelObject_p.h>
#include <DataModels/libSACSCGroundHandling_V2.0.27.1H/std_04_dll.h> #include <DataModels/libSACSCGroundHandling_V2.0.27.1H/std_04_dll.h>
#include "../XNGroundHandlingInterface/XNGroundHandlingInterface.hpp"
typedef void (*FunctionType)(ComacDataStructure_S *); typedef void (*FunctionType)(ComacDataStructure_S *);
@ -12,4 +13,8 @@ struct XNGroundHandlingPrivate : public XNModelObjectPrivate {
std::string _entryPointName = "_Z29SACSCGroundHandlingEntryPointP20ComacDataStructure_S"; std::string _entryPointName = "_Z29SACSCGroundHandlingEntryPointP20ComacDataStructure_S";
std::mutex _mutex; std::mutex _mutex;
XNSim::C909::ATA04::GroundHandling_input_Interface _inputInterface;
XNSim::C909::ATA04::GroundHandling_output_Interface _outputInterface;
XNSim::C909::ATA04::GroundHandling_heartbeat_Interface _heartbeatInterface;
}; };

View File

@ -25,7 +25,6 @@ add_library(XNGroundHandlingInterface SHARED
) )
target_link_libraries(XNGroundHandlingInterface PRIVATE target_link_libraries(XNGroundHandlingInterface PRIVATE
Qt${QT_VERSION_MAJOR}::Core
fastcdr fastcdr
fastdds fastdds
OpenSSL::SSL OpenSSL::SSL

View File

@ -19,8 +19,8 @@
* This file was generated by the tool fastddsgen. * This file was generated by the tool fastddsgen.
*/ */
#ifndef FAST_DDS_GENERATED__XNSIM_ATA04_XNGROUNDHANDLING_HPP #ifndef FAST_DDS_GENERATED__XNSIM_C909_ATA04_XNGROUNDHANDLING_HPP
#define FAST_DDS_GENERATED__XNSIM_ATA04_XNGROUNDHANDLING_HPP #define FAST_DDS_GENERATED__XNSIM_C909_ATA04_XNGROUNDHANDLING_HPP
#include <array> #include <array>
#include <cstdint> #include <cstdint>
@ -53,6 +53,8 @@
namespace XNSim { namespace XNSim {
namespace C909 {
namespace ATA04 { namespace ATA04 {
/*! /*!
@ -3841,8 +3843,10 @@ private:
} // namespace ATA04 } // namespace ATA04
} // namespace C909
} // namespace XNSim } // namespace XNSim
#endif // _FAST_DDS_GENERATED_XNSIM_ATA04_XNGROUNDHANDLING_HPP_ #endif // _FAST_DDS_GENERATED_XNSIM_C909_ATA04_XNGROUNDHANDLING_HPP_

View File

@ -1,4 +1,6 @@
module XNSim module XNSim
{
module C909
{ {
module ATA04 module ATA04
{ {
@ -88,3 +90,4 @@ module XNSim
}; };
}; };
}; };
};

View File

@ -19,19 +19,19 @@
* This file was generated by the tool fastddsgen. * This file was generated by the tool fastddsgen.
*/ */
#ifndef FAST_DDS_GENERATED__XNSIM_ATA04_XNGROUNDHANDLINGCDRAUX_HPP #ifndef FAST_DDS_GENERATED__XNSIM_C909_ATA04_XNGROUNDHANDLINGCDRAUX_HPP
#define FAST_DDS_GENERATED__XNSIM_ATA04_XNGROUNDHANDLINGCDRAUX_HPP #define FAST_DDS_GENERATED__XNSIM_C909_ATA04_XNGROUNDHANDLINGCDRAUX_HPP
#include "XNGroundHandling.hpp" #include "XNGroundHandling.hpp"
constexpr uint32_t XNSim_ATA04_GroundHandling_input_max_cdr_typesize {1093UL}; constexpr uint32_t XNSim_C909_ATA04_GroundHandling_input_max_cdr_typesize {1093UL};
constexpr uint32_t XNSim_ATA04_GroundHandling_input_max_key_cdr_typesize {0UL}; constexpr uint32_t XNSim_C909_ATA04_GroundHandling_input_max_key_cdr_typesize {0UL};
constexpr uint32_t XNSim_ATA04_GroundHandling_output_max_cdr_typesize {1328UL}; constexpr uint32_t XNSim_C909_ATA04_GroundHandling_heartbeat_max_cdr_typesize {12UL};
constexpr uint32_t XNSim_ATA04_GroundHandling_output_max_key_cdr_typesize {0UL}; constexpr uint32_t XNSim_C909_ATA04_GroundHandling_heartbeat_max_key_cdr_typesize {0UL};
constexpr uint32_t XNSim_ATA04_GroundHandling_heartbeat_max_cdr_typesize {12UL}; constexpr uint32_t XNSim_C909_ATA04_GroundHandling_output_max_cdr_typesize {1328UL};
constexpr uint32_t XNSim_ATA04_GroundHandling_heartbeat_max_key_cdr_typesize {0UL}; constexpr uint32_t XNSim_C909_ATA04_GroundHandling_output_max_key_cdr_typesize {0UL};
namespace eprosima { namespace eprosima {
@ -42,19 +42,19 @@ class CdrSizeCalculator;
eProsima_user_DllExport void serialize_key( eProsima_user_DllExport void serialize_key(
eprosima::fastcdr::Cdr& scdr, eprosima::fastcdr::Cdr& scdr,
const XNSim::ATA04::GroundHandling_input& data); const XNSim::C909::ATA04::GroundHandling_input& data);
eProsima_user_DllExport void serialize_key( eProsima_user_DllExport void serialize_key(
eprosima::fastcdr::Cdr& scdr, eprosima::fastcdr::Cdr& scdr,
const XNSim::ATA04::GroundHandling_output& data); const XNSim::C909::ATA04::GroundHandling_output& data);
eProsima_user_DllExport void serialize_key( eProsima_user_DllExport void serialize_key(
eprosima::fastcdr::Cdr& scdr, eprosima::fastcdr::Cdr& scdr,
const XNSim::ATA04::GroundHandling_heartbeat& data); const XNSim::C909::ATA04::GroundHandling_heartbeat& data);
} // namespace fastcdr } // namespace fastcdr
} // namespace eprosima } // namespace eprosima
#endif // FAST_DDS_GENERATED__XNSIM_ATA04_XNGROUNDHANDLINGCDRAUX_HPP #endif // FAST_DDS_GENERATED__XNSIM_C909_ATA04_XNGROUNDHANDLINGCDRAUX_HPP

View File

@ -19,8 +19,8 @@
* This file was generated by the tool fastddsgen. * This file was generated by the tool fastddsgen.
*/ */
#ifndef FAST_DDS_GENERATED__XNSIM_ATA04_XNGROUNDHANDLINGCDRAUX_IPP #ifndef FAST_DDS_GENERATED__XNSIM_C909_ATA04_XNGROUNDHANDLINGCDRAUX_IPP
#define FAST_DDS_GENERATED__XNSIM_ATA04_XNGROUNDHANDLINGCDRAUX_IPP #define FAST_DDS_GENERATED__XNSIM_C909_ATA04_XNGROUNDHANDLINGCDRAUX_IPP
#include "XNGroundHandlingCdrAux.hpp" #include "XNGroundHandlingCdrAux.hpp"
@ -37,10 +37,10 @@ namespace fastcdr {
template<> template<>
eProsima_user_DllExport size_t calculate_serialized_size( eProsima_user_DllExport size_t calculate_serialized_size(
eprosima::fastcdr::CdrSizeCalculator& calculator, eprosima::fastcdr::CdrSizeCalculator& calculator,
const XNSim::ATA04::GroundHandling_input& data, const XNSim::C909::ATA04::GroundHandling_input& data,
size_t& current_alignment) size_t& current_alignment)
{ {
using namespace XNSim::ATA04; using namespace XNSim::C909::ATA04;
static_cast<void>(data); static_cast<void>(data);
@ -178,9 +178,9 @@ eProsima_user_DllExport size_t calculate_serialized_size(
template<> template<>
eProsima_user_DllExport void serialize( eProsima_user_DllExport void serialize(
eprosima::fastcdr::Cdr& scdr, eprosima::fastcdr::Cdr& scdr,
const XNSim::ATA04::GroundHandling_input& data) const XNSim::C909::ATA04::GroundHandling_input& data)
{ {
using namespace XNSim::ATA04; using namespace XNSim::C909::ATA04;
eprosima::fastcdr::Cdr::state current_state(scdr); eprosima::fastcdr::Cdr::state current_state(scdr);
scdr.begin_serialize_type(current_state, scdr.begin_serialize_type(current_state,
@ -235,9 +235,9 @@ eProsima_user_DllExport void serialize(
template<> template<>
eProsima_user_DllExport void deserialize( eProsima_user_DllExport void deserialize(
eprosima::fastcdr::Cdr& cdr, eprosima::fastcdr::Cdr& cdr,
XNSim::ATA04::GroundHandling_input& data) XNSim::C909::ATA04::GroundHandling_input& data)
{ {
using namespace XNSim::ATA04; using namespace XNSim::C909::ATA04;
cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ?
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
@ -413,9 +413,9 @@ eProsima_user_DllExport void deserialize(
void serialize_key( void serialize_key(
eprosima::fastcdr::Cdr& scdr, eprosima::fastcdr::Cdr& scdr,
const XNSim::ATA04::GroundHandling_input& data) const XNSim::C909::ATA04::GroundHandling_input& data)
{ {
using namespace XNSim::ATA04; using namespace XNSim::C909::ATA04;
static_cast<void>(scdr); static_cast<void>(scdr);
static_cast<void>(data); static_cast<void>(data);
@ -620,10 +620,10 @@ void serialize_key(
template<> template<>
eProsima_user_DllExport size_t calculate_serialized_size( eProsima_user_DllExport size_t calculate_serialized_size(
eprosima::fastcdr::CdrSizeCalculator& calculator, eprosima::fastcdr::CdrSizeCalculator& calculator,
const XNSim::ATA04::GroundHandling_output& data, const XNSim::C909::ATA04::GroundHandling_output& data,
size_t& current_alignment) size_t& current_alignment)
{ {
using namespace XNSim::ATA04; using namespace XNSim::C909::ATA04;
static_cast<void>(data); static_cast<void>(data);
@ -749,9 +749,9 @@ eProsima_user_DllExport size_t calculate_serialized_size(
template<> template<>
eProsima_user_DllExport void serialize( eProsima_user_DllExport void serialize(
eprosima::fastcdr::Cdr& scdr, eprosima::fastcdr::Cdr& scdr,
const XNSim::ATA04::GroundHandling_output& data) const XNSim::C909::ATA04::GroundHandling_output& data)
{ {
using namespace XNSim::ATA04; using namespace XNSim::C909::ATA04;
eprosima::fastcdr::Cdr::state current_state(scdr); eprosima::fastcdr::Cdr::state current_state(scdr);
scdr.begin_serialize_type(current_state, scdr.begin_serialize_type(current_state,
@ -802,9 +802,9 @@ eProsima_user_DllExport void serialize(
template<> template<>
eProsima_user_DllExport void deserialize( eProsima_user_DllExport void deserialize(
eprosima::fastcdr::Cdr& cdr, eprosima::fastcdr::Cdr& cdr,
XNSim::ATA04::GroundHandling_output& data) XNSim::C909::ATA04::GroundHandling_output& data)
{ {
using namespace XNSim::ATA04; using namespace XNSim::C909::ATA04;
cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ?
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
@ -964,9 +964,9 @@ eProsima_user_DllExport void deserialize(
void serialize_key( void serialize_key(
eprosima::fastcdr::Cdr& scdr, eprosima::fastcdr::Cdr& scdr,
const XNSim::ATA04::GroundHandling_output& data) const XNSim::C909::ATA04::GroundHandling_output& data)
{ {
using namespace XNSim::ATA04; using namespace XNSim::C909::ATA04;
static_cast<void>(scdr); static_cast<void>(scdr);
static_cast<void>(data); static_cast<void>(data);
@ -1151,10 +1151,10 @@ void serialize_key(
template<> template<>
eProsima_user_DllExport size_t calculate_serialized_size( eProsima_user_DllExport size_t calculate_serialized_size(
eprosima::fastcdr::CdrSizeCalculator& calculator, eprosima::fastcdr::CdrSizeCalculator& calculator,
const XNSim::ATA04::GroundHandling_heartbeat& data, const XNSim::C909::ATA04::GroundHandling_heartbeat& data,
size_t& current_alignment) size_t& current_alignment)
{ {
using namespace XNSim::ATA04; using namespace XNSim::C909::ATA04;
static_cast<void>(data); static_cast<void>(data);
@ -1178,9 +1178,9 @@ eProsima_user_DllExport size_t calculate_serialized_size(
template<> template<>
eProsima_user_DllExport void serialize( eProsima_user_DllExport void serialize(
eprosima::fastcdr::Cdr& scdr, eprosima::fastcdr::Cdr& scdr,
const XNSim::ATA04::GroundHandling_heartbeat& data) const XNSim::C909::ATA04::GroundHandling_heartbeat& data)
{ {
using namespace XNSim::ATA04; using namespace XNSim::C909::ATA04;
eprosima::fastcdr::Cdr::state current_state(scdr); eprosima::fastcdr::Cdr::state current_state(scdr);
scdr.begin_serialize_type(current_state, scdr.begin_serialize_type(current_state,
@ -1197,9 +1197,9 @@ eProsima_user_DllExport void serialize(
template<> template<>
eProsima_user_DllExport void deserialize( eProsima_user_DllExport void deserialize(
eprosima::fastcdr::Cdr& cdr, eprosima::fastcdr::Cdr& cdr,
XNSim::ATA04::GroundHandling_heartbeat& data) XNSim::C909::ATA04::GroundHandling_heartbeat& data)
{ {
using namespace XNSim::ATA04; using namespace XNSim::C909::ATA04;
cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ? cdr.deserialize_type(eprosima::fastcdr::CdrVersion::XCDRv2 == cdr.get_cdr_version() ?
eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 : eprosima::fastcdr::EncodingAlgorithmFlag::DELIMIT_CDR2 :
@ -1223,9 +1223,9 @@ eProsima_user_DllExport void deserialize(
void serialize_key( void serialize_key(
eprosima::fastcdr::Cdr& scdr, eprosima::fastcdr::Cdr& scdr,
const XNSim::ATA04::GroundHandling_heartbeat& data) const XNSim::C909::ATA04::GroundHandling_heartbeat& data)
{ {
using namespace XNSim::ATA04; using namespace XNSim::C909::ATA04;
static_cast<void>(scdr); static_cast<void>(scdr);
static_cast<void>(data); static_cast<void>(data);
@ -1241,5 +1241,5 @@ void serialize_key(
} // namespace fastcdr } // namespace fastcdr
} // namespace eprosima } // namespace eprosima
#endif // FAST_DDS_GENERATED__XNSIM_ATA04_XNGROUNDHANDLINGCDRAUX_IPP #endif // FAST_DDS_GENERATED__XNSIM_C909_ATA04_XNGROUNDHANDLINGCDRAUX_IPP

View File

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

View File

@ -2,132 +2,260 @@
#include "XNGroundHandlingPubSubTypes.hpp" #include "XNGroundHandlingPubSubTypes.hpp"
#include "XNCore/XNDDSInterface.h" #include "XNCore/XNDDSInterface.h"
namespace XNSim namespace XNSim::C909::ATA04
{ {
namespace ATA04 class GroundHandling_input_Interface final : public XNDDSInterface
{
class GroundHandling_input_Interface : public XNDDSInterface
{ {
public: public:
explicit GroundHandling_input_Interface(); GroundHandling_input_Interface();
virtual ~GroundHandling_input_Interface(); virtual ~GroundHandling_input_Interface();
void inputDataListener(const XNSim::ATA04::GroundHandling_input &input);
virtual void Initialize(XNFrameworkPtr framework, uint32_t modelId) override;
virtual void clearOutData() override;
virtual void sendOutData() override;
void inputDataListener(const XNSim::C909::ATA04::GroundHandling_input &input);
template <typename T> template <typename T>
void getData(T *model_data) void getData(T *model_data)
{ {
if (model_data == nullptr) if (model_data == nullptr)
return; return;
ASSIGN_VALUE_GET(l_04_i_gdcomac_frz_l1); assign_value_get(data.l_04_i_gdcomac_frz_l1(), model_data->l_04_i_gdcomac_frz_l1);
ASSIGN_VALUE_GET(l_04_i_gdcomac_chocks_l1); assign_value_get(data.l_04_i_gdcomac_chocks_l1(), model_data->l_04_i_gdcomac_chocks_l1);
ASSIGN_VALUE_GET(l_04_i_gdcomac_alt_agl_f8); assign_value_get(data.l_04_i_gdcomac_alt_agl_f8(), model_data->l_04_i_gdcomac_alt_agl_f8);
ASSIGN_VALUE_GET(l_04_i_gdcomac_frzflt_l1); assign_value_get(data.l_04_i_gdcomac_frzflt_l1(), model_data->l_04_i_gdcomac_frzflt_l1);
ASSIGN_VALUE_GET(l_04_i_gdcomac_p_f8); assign_value_get(data.l_04_i_gdcomac_p_f8(), model_data->l_04_i_gdcomac_p_f8);
ASSIGN_VALUE_GET(l_04_i_gdcomac_q_f8); assign_value_get(data.l_04_i_gdcomac_q_f8(), model_data->l_04_i_gdcomac_q_f8);
ASSIGN_VALUE_GET(l_04_i_gdcomac_r_f8); assign_value_get(data.l_04_i_gdcomac_r_f8(), model_data->l_04_i_gdcomac_r_f8);
ASSIGN_VALUE_GET(l_04_i_gdcomac_ug_f8); assign_value_get(data.l_04_i_gdcomac_ug_f8(), model_data->l_04_i_gdcomac_ug_f8);
ASSIGN_VALUE_GET(l_04_i_gdcomac_vg_f8); assign_value_get(data.l_04_i_gdcomac_vg_f8(), model_data->l_04_i_gdcomac_vg_f8);
ASSIGN_VALUE_GET(l_04_i_gdcomac_wg_f8); assign_value_get(data.l_04_i_gdcomac_wg_f8(), model_data->l_04_i_gdcomac_wg_f8);
ASSIGN_VALUE_GET(l_04_i_gdcomac_blcg_f8); assign_value_get(data.l_04_i_gdcomac_blcg_f8(), model_data->l_04_i_gdcomac_blcg_f8);
ASSIGN_VALUE_GET(l_04_i_gdcomac_bscg_f8); assign_value_get(data.l_04_i_gdcomac_bscg_f8(), model_data->l_04_i_gdcomac_bscg_f8);
ASSIGN_VALUE_GET(l_04_i_gdcomac_wlcg_f8); assign_value_get(data.l_04_i_gdcomac_wlcg_f8(), model_data->l_04_i_gdcomac_wlcg_f8);
ASSIGN_VALUE_GET(l_04_i_gdcomac_pb_active_l1); assign_value_get(data.l_04_i_gdcomac_pb_active_l1(),
ASSIGN_VALUE_GET(l_04_i_gdcomac_brake_torq_f8); model_data->l_04_i_gdcomac_pb_active_l1);
ASSIGN_VALUE_GET(l_04_i_gdcomac_gear_f8); assign_value_get(data.l_04_i_gdcomac_brake_torq_f8(),
ASSIGN_VALUE_GET(l_04_i_gdcomac_gsteer_f8); model_data->l_04_i_gdcomac_brake_torq_f8);
ASSIGN_VALUE_GET(l_04_i_gdcomac_tire_pres_f8); assign_value_get(data.l_04_i_gdcomac_gear_f8(), model_data->l_04_i_gdcomac_gear_f8);
ASSIGN_VALUE_GET(l_04_i_gdcomac_onjax_l1); assign_value_get(data.l_04_i_gdcomac_gsteer_f8(), model_data->l_04_i_gdcomac_gsteer_f8);
ASSIGN_VALUE_GET(l_04_i_gdcomac_contdep_f8); assign_value_get(data.l_04_i_gdcomac_tire_pres_f8(),
ASSIGN_VALUE_GET(l_04_i_gdcomac_thetag_f8); model_data->l_04_i_gdcomac_tire_pres_f8);
ASSIGN_VALUE_GET(l_04_i_gdcomac_phig_f8); assign_value_get(data.l_04_i_gdcomac_onjax_l1(), model_data->l_04_i_gdcomac_onjax_l1);
ASSIGN_VALUE_GET(l_04_i_gdcomac_rwyrgh_i2); assign_value_get(data.l_04_i_gdcomac_contdep_f8(), model_data->l_04_i_gdcomac_contdep_f8);
ASSIGN_VALUE_GET(l_04_i_gdcomac_rwyhdg_f8); assign_value_get(data.l_04_i_gdcomac_thetag_f8(), model_data->l_04_i_gdcomac_thetag_f8);
ASSIGN_VALUE_GET(l_04_i_gdcomac_reset_braketemp_l1); assign_value_get(data.l_04_i_gdcomac_phig_f8(), model_data->l_04_i_gdcomac_phig_f8);
ASSIGN_VALUE_GET(l_04_i_gdcomac_reset_tirepress_l1); assign_value_get(data.l_04_i_gdcomac_rwyrgh_i2(), model_data->l_04_i_gdcomac_rwyrgh_i2);
ASSIGN_VALUE_GET(l_04_i_gdcomac_temp_c_f8); assign_value_get(data.l_04_i_gdcomac_rwyhdg_f8(), model_data->l_04_i_gdcomac_rwyhdg_f8);
ASSIGN_VALUE_GET(l_04_i_gdcomac_brake_temp_f8); assign_value_get(data.l_04_i_gdcomac_reset_braketemp_l1(),
ASSIGN_VALUE_GET(l_04_i_gdcomac_tire_tburst_l1); model_data->l_04_i_gdcomac_reset_braketemp_l1);
ASSIGN_VALUE_GET(l_04_i_gdcomac_tire_tflat_l1); assign_value_get(data.l_04_i_gdcomac_reset_tirepress_l1(),
ASSIGN_VALUE_GET(l_04_i_gdcomac_brk_reset_tpres_l1); model_data->l_04_i_gdcomac_reset_tirepress_l1);
ASSIGN_VALUE_GET(l_04_i_gdcomac_rcon_ci_f8); assign_value_get(data.l_04_i_gdcomac_temp_c_f8(), model_data->l_04_i_gdcomac_temp_c_f8);
ASSIGN_VALUE_GET(l_04_i_gdcomac_pb_towforce_f8); assign_value_get(data.l_04_i_gdcomac_brake_temp_f8(),
ASSIGN_VALUE_GET(l_04_i_gdcomac_gsteer_state_i4); model_data->l_04_i_gdcomac_brake_temp_f8);
ASSIGN_VALUE_GET(l_04_i_gdcomac_trim_active_l1); assign_value_get(data.l_04_i_gdcomac_tire_tburst_l1(),
ASSIGN_VALUE_GET(l_04_i_gdcomac_phi_deg_f8); model_data->l_04_i_gdcomac_tire_tburst_l1);
ASSIGN_VALUE_GET(l_04_i_gdcomac_theta_deg_f8); assign_value_get(data.l_04_i_gdcomac_tire_tflat_l1(),
ASSIGN_VALUE_GET(l_04_i_gdcomac_psi_deg_f8); model_data->l_04_i_gdcomac_tire_tflat_l1);
ASSIGN_VALUE_GET(l_04_i_gdcomac_resetint_l1); assign_value_get(data.l_04_i_gdcomac_brk_reset_tpres_l1(),
model_data->l_04_i_gdcomac_brk_reset_tpres_l1);
assign_value_get(data.l_04_i_gdcomac_rcon_ci_f8(), model_data->l_04_i_gdcomac_rcon_ci_f8);
assign_value_get(data.l_04_i_gdcomac_pb_towforce_f8(),
model_data->l_04_i_gdcomac_pb_towforce_f8);
assign_value_get(data.l_04_i_gdcomac_gsteer_state_i4(),
model_data->l_04_i_gdcomac_gsteer_state_i4);
assign_value_get(data.l_04_i_gdcomac_trim_active_l1(),
model_data->l_04_i_gdcomac_trim_active_l1);
assign_value_get(data.l_04_i_gdcomac_phi_deg_f8(), model_data->l_04_i_gdcomac_phi_deg_f8);
assign_value_get(data.l_04_i_gdcomac_theta_deg_f8(),
model_data->l_04_i_gdcomac_theta_deg_f8);
assign_value_get(data.l_04_i_gdcomac_psi_deg_f8(), model_data->l_04_i_gdcomac_psi_deg_f8);
assign_value_get(data.l_04_i_gdcomac_resetint_l1(), model_data->l_04_i_gdcomac_resetint_l1);
} }
template <typename T> template <typename T>
void setData(T *model_data) void setData(T *model_data)
{ {
if (model_data == nullptr) // if (model_data == nullptr)
return; // return;
ASSIGN_VALUE_SET(l_04_i_gdcomac_frz_l1); // clearOutData();
ASSIGN_VALUE_SET(l_04_i_gdcomac_chocks_l1); // ASSIGN_VALUE_SET(l_04_i_gdcomac_frz_l1);
ASSIGN_VALUE_SET(l_04_i_gdcomac_alt_agl_f8); // ASSIGN_VALUE_SET(l_04_i_gdcomac_chocks_l1);
ASSIGN_VALUE_SET(l_04_i_gdcomac_frzflt_l1); // ASSIGN_VALUE_SET(l_04_i_gdcomac_alt_agl_f8);
ASSIGN_VALUE_SET(l_04_i_gdcomac_p_f8); // ASSIGN_VALUE_SET(l_04_i_gdcomac_frzflt_l1);
ASSIGN_VALUE_SET(l_04_i_gdcomac_q_f8); // ASSIGN_VALUE_SET(l_04_i_gdcomac_p_f8);
ASSIGN_VALUE_SET(l_04_i_gdcomac_r_f8); // ASSIGN_VALUE_SET(l_04_i_gdcomac_q_f8);
ASSIGN_VALUE_SET(l_04_i_gdcomac_ug_f8); // ASSIGN_VALUE_SET(l_04_i_gdcomac_r_f8);
ASSIGN_VALUE_SET(l_04_i_gdcomac_vg_f8); // ASSIGN_VALUE_SET(l_04_i_gdcomac_ug_f8);
ASSIGN_VALUE_SET(l_04_i_gdcomac_wg_f8); // ASSIGN_VALUE_SET(l_04_i_gdcomac_vg_f8);
ASSIGN_VALUE_SET(l_04_i_gdcomac_blcg_f8); // ASSIGN_VALUE_SET(l_04_i_gdcomac_wg_f8);
ASSIGN_VALUE_SET(l_04_i_gdcomac_bscg_f8); // ASSIGN_VALUE_SET(l_04_i_gdcomac_blcg_f8);
ASSIGN_VALUE_SET(l_04_i_gdcomac_wlcg_f8); // ASSIGN_VALUE_SET(l_04_i_gdcomac_bscg_f8);
ASSIGN_VALUE_SET(l_04_i_gdcomac_pb_active_l1); // ASSIGN_VALUE_SET(l_04_i_gdcomac_wlcg_f8);
ASSIGN_VALUE_SET(l_04_i_gdcomac_brake_torq_f8); // ASSIGN_VALUE_SET(l_04_i_gdcomac_pb_active_l1);
ASSIGN_VALUE_SET(l_04_i_gdcomac_gear_f8); // ASSIGN_VALUE_SET(l_04_i_gdcomac_brake_torq_f8);
ASSIGN_VALUE_SET(l_04_i_gdcomac_gsteer_f8); // ASSIGN_VALUE_SET(l_04_i_gdcomac_gear_f8);
ASSIGN_VALUE_SET(l_04_i_gdcomac_tire_pres_f8); // ASSIGN_VALUE_SET(l_04_i_gdcomac_gsteer_f8);
ASSIGN_VALUE_SET(l_04_i_gdcomac_onjax_l1); // ASSIGN_VALUE_SET(l_04_i_gdcomac_tire_pres_f8);
ASSIGN_VALUE_SET(l_04_i_gdcomac_contdep_f8); // ASSIGN_VALUE_SET(l_04_i_gdcomac_onjax_l1);
ASSIGN_VALUE_SET(l_04_i_gdcomac_thetag_f8); // ASSIGN_VALUE_SET(l_04_i_gdcomac_contdep_f8);
ASSIGN_VALUE_SET(l_04_i_gdcomac_phig_f8); // ASSIGN_VALUE_SET(l_04_i_gdcomac_thetag_f8);
ASSIGN_VALUE_SET(l_04_i_gdcomac_rwyrgh_i2); // ASSIGN_VALUE_SET(l_04_i_gdcomac_phig_f8);
ASSIGN_VALUE_SET(l_04_i_gdcomac_rwyhdg_f8); // ASSIGN_VALUE_SET(l_04_i_gdcomac_rwyrgh_i2);
ASSIGN_VALUE_SET(l_04_i_gdcomac_reset_braketemp_l1); // ASSIGN_VALUE_SET(l_04_i_gdcomac_rwyhdg_f8);
ASSIGN_VALUE_SET(l_04_i_gdcomac_reset_tirepress_l1); // ASSIGN_VALUE_SET(l_04_i_gdcomac_reset_braketemp_l1);
ASSIGN_VALUE_SET(l_04_i_gdcomac_temp_c_f8); // ASSIGN_VALUE_SET(l_04_i_gdcomac_reset_tirepress_l1);
ASSIGN_VALUE_SET(l_04_i_gdcomac_brake_temp_f8); // ASSIGN_VALUE_SET(l_04_i_gdcomac_temp_c_f8);
ASSIGN_VALUE_SET(l_04_i_gdcomac_tire_tburst_l1); // ASSIGN_VALUE_SET(l_04_i_gdcomac_brake_temp_f8);
ASSIGN_VALUE_SET(l_04_i_gdcomac_tire_tflat_l1); // ASSIGN_VALUE_SET(l_04_i_gdcomac_tire_tburst_l1);
ASSIGN_VALUE_SET(l_04_i_gdcomac_brk_reset_tpres_l1); // ASSIGN_VALUE_SET(l_04_i_gdcomac_tire_tflat_l1);
ASSIGN_VALUE_SET(l_04_i_gdcomac_rcon_ci_f8); // ASSIGN_VALUE_SET(l_04_i_gdcomac_brk_reset_tpres_l1);
ASSIGN_VALUE_SET(l_04_i_gdcomac_pb_towforce_f8); // ASSIGN_VALUE_SET(l_04_i_gdcomac_rcon_ci_f8);
ASSIGN_VALUE_SET(l_04_i_gdcomac_gsteer_state_i4); // ASSIGN_VALUE_SET(l_04_i_gdcomac_pb_towforce_f8);
ASSIGN_VALUE_SET(l_04_i_gdcomac_trim_active_l1); // ASSIGN_VALUE_SET(l_04_i_gdcomac_gsteer_state_i4);
ASSIGN_VALUE_SET(l_04_i_gdcomac_phi_deg_f8); // ASSIGN_VALUE_SET(l_04_i_gdcomac_trim_active_l1);
ASSIGN_VALUE_SET(l_04_i_gdcomac_theta_deg_f8); // ASSIGN_VALUE_SET(l_04_i_gdcomac_phi_deg_f8);
ASSIGN_VALUE_SET(l_04_i_gdcomac_psi_deg_f8); // ASSIGN_VALUE_SET(l_04_i_gdcomac_theta_deg_f8);
ASSIGN_VALUE_SET(l_04_i_gdcomac_resetint_l1); // ASSIGN_VALUE_SET(l_04_i_gdcomac_psi_deg_f8);
// ASSIGN_VALUE_SET(l_04_i_gdcomac_resetint_l1);
// sendOutData();
} }
private: private:
XNSim::ATA04::GroundHandling_input data; XNSim::C909::ATA04::GroundHandling_input data;
XNSim::C909::ATA04::GroundHandling_input out_data;
}; };
class GroundHandling_output_Interface : public XNDDSInterface class GroundHandling_output_Interface final : public XNDDSInterface
{ {
public: public:
explicit GroundHandling_output_Interface(); GroundHandling_output_Interface();
virtual ~GroundHandling_output_Interface(); virtual ~GroundHandling_output_Interface();
void outputDataListener(const XNSim::ATA04::GroundHandling_output &output); virtual void Initialize(XNFrameworkPtr framework, uint32_t modelId) override;
void outputDataListener(const XNSim::C909::ATA04::GroundHandling_output &output);
virtual void clearOutData() override;
virtual void sendOutData() override;
template <typename T>
void getData(T *model_data)
{
// if (model_data == nullptr)
// return;
// ASSIGN_VALUE_GET(l_04_o_gdcomac_frz_l1);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_ac_on_ground_l1);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_ac_stationary_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_alt_tire_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_zcg_to_tire_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_fxb_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_fyb_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_fzb_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_mxb_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_myb_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_mzb_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_fygs_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_mzgs_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_mu_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_dstroke_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_sr_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_sy_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_sx_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_xft_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_yft_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_zft_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_distngrxcg_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_distmgrxcg_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_distmgrzcg_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_tire_vel_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_tire_burst_l1);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_tire_temp_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_wow_l1);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_utirew_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_vtirew_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_whl_omega_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_dstruc_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_wor_par_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_nd_f8);
// ASSIGN_VALUE_GET(l_04_o_gdcomac_vczt_f8);
}
template <typename T>
void setData(T *model_data)
{
// if (model_data == nullptr)
// return;
// clearOutData();
// ASSIGN_VALUE_SET(l_04_o_gdcomac_frz_l1);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_ac_on_ground_l1);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_ac_stationary_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_alt_tire_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_zcg_to_tire_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_fxb_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_fyb_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_fzb_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_mxb_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_myb_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_mzb_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_fygs_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_mzgs_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_mu_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_dstroke_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_sr_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_sy_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_sx_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_xft_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_yft_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_zft_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_distngrxcg_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_distmgrxcg_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_distmgrzcg_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_tire_vel_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_tire_burst_l1);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_tire_temp_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_wow_l1);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_utirew_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_vtirew_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_whl_omega_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_dstruc_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_wor_par_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_nd_f8);
// ASSIGN_VALUE_SET(l_04_o_gdcomac_vczt_f8);
// sendOutData();
}
private: private:
XNSim::ATA04::GroundHandling_output data; XNSim::C909::ATA04::GroundHandling_output data;
XNSim::C909::ATA04::GroundHandling_output out_data;
}; };
class GroundHandling_heartbeat_Interface : public XNDDSInterface class GroundHandling_heartbeat_Interface final : public XNDDSInterface
{ {
public: public:
explicit GroundHandling_heartbeat_Interface(); GroundHandling_heartbeat_Interface();
virtual ~GroundHandling_heartbeat_Interface(); virtual ~GroundHandling_heartbeat_Interface();
void heartbeatListener(const XNSim::ATA04::GroundHandling_heartbeat &heartbeat); virtual void Initialize(XNFrameworkPtr framework, uint32_t modelId) override;
void heartbeatListener(const XNSim::C909::ATA04::GroundHandling_heartbeat &heartbeat);
virtual void clearOutData() override;
virtual void sendOutData() override;
template <typename T>
void getData(T *model_data)
{
// if (model_data == nullptr)
// return;
// ASSIGN_VALUE_GET(groundhandling_model_heartbeat);
}
template <typename T>
void setData(T *model_data)
{
// if (model_data == nullptr)
// return;
// clearOutData();
// ASSIGN_VALUE_SET(groundhandling_model_heartbeat);
// sendOutData();
}
private: private:
XNSim::ATA04::GroundHandling_heartbeat data; XNSim::C909::ATA04::GroundHandling_heartbeat data;
XNSim::C909::ATA04::GroundHandling_heartbeat out_data;
}; };
} // namespace ATA04 } // namespace XNSim::C909::ATA04
} // namespace XNSim

View File

@ -32,15 +32,16 @@ using InstanceHandle_t = eprosima::fastdds::rtps::InstanceHandle_t;
using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t; using DataRepresentationId_t = eprosima::fastdds::dds::DataRepresentationId_t;
namespace XNSim { namespace XNSim {
namespace C909 {
namespace ATA04 { namespace ATA04 {
GroundHandling_inputPubSubType::GroundHandling_inputPubSubType() GroundHandling_inputPubSubType::GroundHandling_inputPubSubType()
{ {
set_name("XNSim::ATA04::GroundHandling_input"); set_name("XNSim::C909::ATA04::GroundHandling_input");
uint32_t type_size = XNSim_ATA04_GroundHandling_input_max_cdr_typesize; uint32_t type_size = XNSim_C909_ATA04_GroundHandling_input_max_cdr_typesize;
type_size += static_cast<uint32_t>(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ type_size += static_cast<uint32_t>(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */
max_serialized_type_size = type_size + 4; /*encapsulation*/ max_serialized_type_size = type_size + 4; /*encapsulation*/
is_compute_key_provided = false; is_compute_key_provided = false;
uint32_t key_length = XNSim_ATA04_GroundHandling_input_max_key_cdr_typesize > 16 ? XNSim_ATA04_GroundHandling_input_max_key_cdr_typesize : 16; uint32_t key_length = XNSim_C909_ATA04_GroundHandling_input_max_key_cdr_typesize > 16 ? XNSim_C909_ATA04_GroundHandling_input_max_key_cdr_typesize : 16;
key_buffer_ = reinterpret_cast<unsigned char*>(malloc(key_length)); key_buffer_ = reinterpret_cast<unsigned char*>(malloc(key_length));
memset(key_buffer_, 0, key_length); memset(key_buffer_, 0, key_length);
} }
@ -184,13 +185,13 @@ namespace XNSim {
// Object that manages the raw buffer. // Object that manages the raw buffer.
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(key_buffer_), eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(key_buffer_),
XNSim_ATA04_GroundHandling_input_max_key_cdr_typesize); XNSim_C909_ATA04_GroundHandling_input_max_key_cdr_typesize);
// Object that serializes the data. // Object that serializes the data.
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2); eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2);
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2);
eprosima::fastcdr::serialize_key(ser, *p_type); eprosima::fastcdr::serialize_key(ser, *p_type);
if (force_md5 || XNSim_ATA04_GroundHandling_input_max_key_cdr_typesize > 16) if (force_md5 || XNSim_C909_ATA04_GroundHandling_input_max_key_cdr_typesize > 16)
{ {
md5_.init(); md5_.init();
md5_.update(key_buffer_, static_cast<unsigned int>(ser.get_serialized_data_length())); md5_.update(key_buffer_, static_cast<unsigned int>(ser.get_serialized_data_length()));
@ -217,12 +218,12 @@ namespace XNSim {
GroundHandling_outputPubSubType::GroundHandling_outputPubSubType() GroundHandling_outputPubSubType::GroundHandling_outputPubSubType()
{ {
set_name("XNSim::ATA04::GroundHandling_output"); set_name("XNSim::C909::ATA04::GroundHandling_output");
uint32_t type_size = XNSim_ATA04_GroundHandling_output_max_cdr_typesize; uint32_t type_size = XNSim_C909_ATA04_GroundHandling_output_max_cdr_typesize;
type_size += static_cast<uint32_t>(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */ type_size += static_cast<uint32_t>(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */
max_serialized_type_size = type_size + 4; /*encapsulation*/ max_serialized_type_size = type_size + 4; /*encapsulation*/
is_compute_key_provided = false; is_compute_key_provided = false;
uint32_t key_length = XNSim_ATA04_GroundHandling_output_max_key_cdr_typesize > 16 ? XNSim_ATA04_GroundHandling_output_max_key_cdr_typesize : 16; uint32_t key_length = XNSim_C909_ATA04_GroundHandling_output_max_key_cdr_typesize > 16 ? XNSim_C909_ATA04_GroundHandling_output_max_key_cdr_typesize : 16;
key_buffer_ = reinterpret_cast<unsigned char*>(malloc(key_length)); key_buffer_ = reinterpret_cast<unsigned char*>(malloc(key_length));
memset(key_buffer_, 0, key_length); memset(key_buffer_, 0, key_length);
} }
@ -366,13 +367,13 @@ namespace XNSim {
// Object that manages the raw buffer. // Object that manages the raw buffer.
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(key_buffer_), eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(key_buffer_),
XNSim_ATA04_GroundHandling_output_max_key_cdr_typesize); XNSim_C909_ATA04_GroundHandling_output_max_key_cdr_typesize);
// Object that serializes the data. // Object that serializes the data.
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2); eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2);
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2);
eprosima::fastcdr::serialize_key(ser, *p_type); eprosima::fastcdr::serialize_key(ser, *p_type);
if (force_md5 || XNSim_ATA04_GroundHandling_output_max_key_cdr_typesize > 16) if (force_md5 || XNSim_C909_ATA04_GroundHandling_output_max_key_cdr_typesize > 16)
{ {
md5_.init(); md5_.init();
md5_.update(key_buffer_, static_cast<unsigned int>(ser.get_serialized_data_length())); md5_.update(key_buffer_, static_cast<unsigned int>(ser.get_serialized_data_length()));
@ -399,12 +400,12 @@ namespace XNSim {
GroundHandling_heartbeatPubSubType::GroundHandling_heartbeatPubSubType() GroundHandling_heartbeatPubSubType::GroundHandling_heartbeatPubSubType()
{ {
set_name("XNSim::ATA04::GroundHandling_heartbeat"); set_name("XNSim::C909::ATA04::GroundHandling_heartbeat");
uint32_t type_size = XNSim_ATA04_GroundHandling_heartbeat_max_cdr_typesize; 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 */ type_size += static_cast<uint32_t>(eprosima::fastcdr::Cdr::alignment(type_size, 4)); /* possible submessage alignment */
max_serialized_type_size = type_size + 4; /*encapsulation*/ max_serialized_type_size = type_size + 4; /*encapsulation*/
is_compute_key_provided = false; is_compute_key_provided = false;
uint32_t key_length = XNSim_ATA04_GroundHandling_heartbeat_max_key_cdr_typesize > 16 ? XNSim_ATA04_GroundHandling_heartbeat_max_key_cdr_typesize : 16; 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)); key_buffer_ = reinterpret_cast<unsigned char*>(malloc(key_length));
memset(key_buffer_, 0, key_length); memset(key_buffer_, 0, key_length);
} }
@ -548,13 +549,13 @@ namespace XNSim {
// Object that manages the raw buffer. // Object that manages the raw buffer.
eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(key_buffer_), eprosima::fastcdr::FastBuffer fastbuffer(reinterpret_cast<char*>(key_buffer_),
XNSim_ATA04_GroundHandling_heartbeat_max_key_cdr_typesize); XNSim_C909_ATA04_GroundHandling_heartbeat_max_key_cdr_typesize);
// Object that serializes the data. // Object that serializes the data.
eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2); eprosima::fastcdr::Cdr ser(fastbuffer, eprosima::fastcdr::Cdr::BIG_ENDIANNESS, eprosima::fastcdr::CdrVersion::XCDRv2);
ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2); ser.set_encoding_flag(eprosima::fastcdr::EncodingAlgorithmFlag::PLAIN_CDR2);
eprosima::fastcdr::serialize_key(ser, *p_type); eprosima::fastcdr::serialize_key(ser, *p_type);
if (force_md5 || XNSim_ATA04_GroundHandling_heartbeat_max_key_cdr_typesize > 16) if (force_md5 || XNSim_C909_ATA04_GroundHandling_heartbeat_max_key_cdr_typesize > 16)
{ {
md5_.init(); md5_.init();
md5_.update(key_buffer_, static_cast<unsigned int>(ser.get_serialized_data_length())); md5_.update(key_buffer_, static_cast<unsigned int>(ser.get_serialized_data_length()));
@ -581,6 +582,8 @@ namespace XNSim {
} // namespace ATA04 } // namespace ATA04
} // namespace C909
} // namespace XNSim } // namespace XNSim

View File

@ -20,8 +20,8 @@
*/ */
#ifndef FAST_DDS_GENERATED__XNSIM_ATA04_XNGROUNDHANDLING_PUBSUBTYPES_HPP #ifndef FAST_DDS_GENERATED__XNSIM_C909_ATA04_XNGROUNDHANDLING_PUBSUBTYPES_HPP
#define FAST_DDS_GENERATED__XNSIM_ATA04_XNGROUNDHANDLING_PUBSUBTYPES_HPP #define FAST_DDS_GENERATED__XNSIM_C909_ATA04_XNGROUNDHANDLING_PUBSUBTYPES_HPP
#include <fastdds/dds/core/policy/QosPolicies.hpp> #include <fastdds/dds/core/policy/QosPolicies.hpp>
#include <fastdds/dds/topic/TopicDataType.hpp> #include <fastdds/dds/topic/TopicDataType.hpp>
@ -38,6 +38,8 @@
#endif // FASTDDS_GEN_API_VER #endif // FASTDDS_GEN_API_VER
namespace XNSim namespace XNSim
{
namespace C909
{ {
namespace ATA04 namespace ATA04
{ {
@ -285,7 +287,8 @@ namespace XNSim
}; };
} // namespace ATA04 } // namespace ATA04
} // namespace C909
} // namespace XNSim } // namespace XNSim
#endif // FAST_DDS_GENERATED__XNSIM_ATA04_XNGROUNDHANDLING_PUBSUBTYPES_HPP #endif // FAST_DDS_GENERATED__XNSIM_C909_ATA04_XNGROUNDHANDLING_PUBSUBTYPES_HPP

View File

@ -39,6 +39,7 @@
using namespace eprosima::fastdds::dds::xtypes; using namespace eprosima::fastdds::dds::xtypes;
namespace XNSim { namespace XNSim {
namespace C909 {
namespace ATA04 { namespace ATA04 {
// TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method // TypeIdentifier is returned by reference: dependent structures/unions are registered in this same method
void register_GroundHandling_input_type_identifier( void register_GroundHandling_input_type_identifier(
@ -48,12 +49,12 @@ void register_GroundHandling_input_type_identifier(
ReturnCode_t return_code_GroundHandling_input {eprosima::fastdds::dds::RETCODE_OK}; ReturnCode_t return_code_GroundHandling_input {eprosima::fastdds::dds::RETCODE_OK};
return_code_GroundHandling_input = return_code_GroundHandling_input =
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
"XNSim::ATA04::GroundHandling_input", type_ids_GroundHandling_input); "XNSim::C909::ATA04::GroundHandling_input", type_ids_GroundHandling_input);
if (eprosima::fastdds::dds::RETCODE_OK != return_code_GroundHandling_input) if (eprosima::fastdds::dds::RETCODE_OK != return_code_GroundHandling_input)
{ {
StructTypeFlag struct_flags_GroundHandling_input = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, StructTypeFlag struct_flags_GroundHandling_input = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE,
false, false); false, false);
QualifiedTypeName type_name_GroundHandling_input = "XNSim::ATA04::GroundHandling_input"; QualifiedTypeName type_name_GroundHandling_input = "XNSim::C909::ATA04::GroundHandling_input";
eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_GroundHandling_input; eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_GroundHandling_input;
eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_GroundHandling_input; eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_GroundHandling_input;
CompleteTypeDetail detail_GroundHandling_input = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GroundHandling_input, ann_custom_GroundHandling_input, type_name_GroundHandling_input.to_string()); CompleteTypeDetail detail_GroundHandling_input = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GroundHandling_input, ann_custom_GroundHandling_input, type_name_GroundHandling_input.to_string());
@ -2058,7 +2059,7 @@ void register_GroundHandling_input_type_identifier(
TypeObjectUtils::build_and_register_struct_type_object(struct_type_GroundHandling_input, type_name_GroundHandling_input.to_string(), type_ids_GroundHandling_input)) TypeObjectUtils::build_and_register_struct_type_object(struct_type_GroundHandling_input, type_name_GroundHandling_input.to_string(), type_ids_GroundHandling_input))
{ {
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
"XNSim::ATA04::GroundHandling_input already registered in TypeObjectRegistry for a different type."); "XNSim::C909::ATA04::GroundHandling_input already registered in TypeObjectRegistry for a different type.");
} }
} }
} }
@ -2070,12 +2071,12 @@ void register_GroundHandling_output_type_identifier(
ReturnCode_t return_code_GroundHandling_output {eprosima::fastdds::dds::RETCODE_OK}; ReturnCode_t return_code_GroundHandling_output {eprosima::fastdds::dds::RETCODE_OK};
return_code_GroundHandling_output = return_code_GroundHandling_output =
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
"XNSim::ATA04::GroundHandling_output", type_ids_GroundHandling_output); "XNSim::C909::ATA04::GroundHandling_output", type_ids_GroundHandling_output);
if (eprosima::fastdds::dds::RETCODE_OK != return_code_GroundHandling_output) if (eprosima::fastdds::dds::RETCODE_OK != return_code_GroundHandling_output)
{ {
StructTypeFlag struct_flags_GroundHandling_output = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE, StructTypeFlag struct_flags_GroundHandling_output = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE,
false, false); false, false);
QualifiedTypeName type_name_GroundHandling_output = "XNSim::ATA04::GroundHandling_output"; QualifiedTypeName type_name_GroundHandling_output = "XNSim::C909::ATA04::GroundHandling_output";
eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_GroundHandling_output; eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_GroundHandling_output;
eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_GroundHandling_output; eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_GroundHandling_output;
CompleteTypeDetail detail_GroundHandling_output = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GroundHandling_output, ann_custom_GroundHandling_output, type_name_GroundHandling_output.to_string()); CompleteTypeDetail detail_GroundHandling_output = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GroundHandling_output, ann_custom_GroundHandling_output, type_name_GroundHandling_output.to_string());
@ -4292,7 +4293,7 @@ void register_GroundHandling_output_type_identifier(
TypeObjectUtils::build_and_register_struct_type_object(struct_type_GroundHandling_output, type_name_GroundHandling_output.to_string(), type_ids_GroundHandling_output)) TypeObjectUtils::build_and_register_struct_type_object(struct_type_GroundHandling_output, type_name_GroundHandling_output.to_string(), type_ids_GroundHandling_output))
{ {
EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION, EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
"XNSim::ATA04::GroundHandling_output already registered in TypeObjectRegistry for a different type."); "XNSim::C909::ATA04::GroundHandling_output already registered in TypeObjectRegistry for a different type.");
} }
} }
} }
@ -4304,12 +4305,12 @@ void register_GroundHandling_heartbeat_type_identifier(
ReturnCode_t return_code_GroundHandling_heartbeat {eprosima::fastdds::dds::RETCODE_OK}; ReturnCode_t return_code_GroundHandling_heartbeat {eprosima::fastdds::dds::RETCODE_OK};
return_code_GroundHandling_heartbeat = return_code_GroundHandling_heartbeat =
eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers( eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->type_object_registry().get_type_identifiers(
"XNSim::ATA04::GroundHandling_heartbeat", type_ids_GroundHandling_heartbeat); "XNSim::C909::ATA04::GroundHandling_heartbeat", type_ids_GroundHandling_heartbeat);
if (eprosima::fastdds::dds::RETCODE_OK != return_code_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, StructTypeFlag struct_flags_GroundHandling_heartbeat = TypeObjectUtils::build_struct_type_flag(eprosima::fastdds::dds::xtypes::ExtensibilityKind::APPENDABLE,
false, false); false, false);
QualifiedTypeName type_name_GroundHandling_heartbeat = "XNSim::ATA04::GroundHandling_heartbeat"; QualifiedTypeName type_name_GroundHandling_heartbeat = "XNSim::C909::ATA04::GroundHandling_heartbeat";
eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_GroundHandling_heartbeat; eprosima::fastcdr::optional<AppliedBuiltinTypeAnnotations> type_ann_builtin_GroundHandling_heartbeat;
eprosima::fastcdr::optional<AppliedAnnotationSeq> ann_custom_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()); CompleteTypeDetail detail_GroundHandling_heartbeat = TypeObjectUtils::build_complete_type_detail(type_ann_builtin_GroundHandling_heartbeat, ann_custom_GroundHandling_heartbeat, type_name_GroundHandling_heartbeat.to_string());
@ -4364,12 +4365,14 @@ void register_GroundHandling_heartbeat_type_identifier(
TypeObjectUtils::build_and_register_struct_type_object(struct_type_GroundHandling_heartbeat, type_name_GroundHandling_heartbeat.to_string(), type_ids_GroundHandling_heartbeat)) 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, EPROSIMA_LOG_ERROR(XTYPES_TYPE_REPRESENTATION,
"XNSim::ATA04::GroundHandling_heartbeat already registered in TypeObjectRegistry for a different type."); "XNSim::C909::ATA04::GroundHandling_heartbeat already registered in TypeObjectRegistry for a different type.");
} }
} }
} }
} // namespace ATA04 } // namespace ATA04
} // namespace C909
} // namespace XNSim } // namespace XNSim

View File

@ -19,8 +19,8 @@
* This file was generated by the tool fastddsgen. * This file was generated by the tool fastddsgen.
*/ */
#ifndef FAST_DDS_GENERATED__XNSIM_ATA04_XNGROUNDHANDLING_TYPE_OBJECT_SUPPORT_HPP #ifndef FAST_DDS_GENERATED__XNSIM_C909_ATA04_XNGROUNDHANDLING_TYPE_OBJECT_SUPPORT_HPP
#define FAST_DDS_GENERATED__XNSIM_ATA04_XNGROUNDHANDLING_TYPE_OBJECT_SUPPORT_HPP #define FAST_DDS_GENERATED__XNSIM_C909_ATA04_XNGROUNDHANDLING_TYPE_OBJECT_SUPPORT_HPP
#include <fastdds/dds/xtypes/type_representation/TypeObject.hpp> #include <fastdds/dds/xtypes/type_representation/TypeObject.hpp>
@ -38,6 +38,7 @@
#ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC #ifndef DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
namespace XNSim { namespace XNSim {
namespace C909 {
namespace ATA04 { namespace ATA04 {
/** /**
* @brief Register GroundHandling_input related TypeIdentifier. * @brief Register GroundHandling_input related TypeIdentifier.
@ -80,9 +81,11 @@ eProsima_user_DllExport void register_GroundHandling_heartbeat_type_identifier(
} // namespace ATA04 } // namespace ATA04
} // namespace C909
} // namespace XNSim } // namespace XNSim
#endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC #endif // DOXYGEN_SHOULD_SKIP_THIS_PUBLIC
#endif // FAST_DDS_GENERATED__XNSIM_ATA04_XNGROUNDHANDLING_TYPE_OBJECT_SUPPORT_HPP #endif // FAST_DDS_GENERATED__XNSIM_C909_ATA04_XNGROUNDHANDLING_TYPE_OBJECT_SUPPORT_HPP