V0.34.1.250624_alpha:移除项目中的XNModels目录

This commit is contained in:
jinchao 2025-06-24 16:12:01 +08:00
parent a78e1bb85f
commit ac6c62730e
36 changed files with 0 additions and 2425 deletions

Binary file not shown.

View File

@ -1,8 +0,0 @@
cmake_minimum_required(VERSION 3.16)
project(XNModels)
add_subdirectory(XNATA04DataProcessor)
add_subdirectory(XNAerodynamics)
add_subdirectory(XNGroundHandling)
add_subdirectory(XNWeightBalance)

View File

@ -1,9 +0,0 @@
{
"configurations": [
{
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"configurationProvider": "ms-vscode.cmake-tools"
}
],
"version": 4
}

View File

@ -1,78 +0,0 @@
{
"files.associations": {
"*.cpp": "cpp",
"functional": "cpp",
"qhash": "cpp",
"qstringlist": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"*.tcc": "cpp",
"bitset": "cpp",
"chrono": "cpp",
"codecvt": "cpp",
"compare": "cpp",
"complex": "cpp",
"concepts": "cpp",
"condition_variable": "cpp",
"cstdint": "cpp",
"deque": "cpp",
"list": "cpp",
"map": "cpp",
"set": "cpp",
"unordered_map": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"random": "cpp",
"ratio": "cpp",
"regex": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"mutex": "cpp",
"new": "cpp",
"ostream": "cpp",
"ranges": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"stop_token": "cpp",
"streambuf": "cpp",
"thread": "cpp",
"cinttypes": "cpp",
"typeindex": "cpp",
"typeinfo": "cpp",
"variant": "cpp",
"csignal": "cpp",
"any": "cpp",
"unordered_set": "cpp",
"fstream": "cpp",
"future": "cpp",
"span": "cpp"
}
}

View File

@ -1,61 +0,0 @@
cmake_minimum_required(VERSION 3.16)
project(XNATA04DataProcessor LANGUAGES CXX)
set(MODEL_VERSION "1.0.0.0")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#
if(DEFINED ENV{XNCore})
set(XNCore_PATH $ENV{XNCore})
else()
message(FATAL_ERROR "Environment variable XNCore is not set.")
endif()
# XNCore_PATH include
include_directories(${XNCore_PATH}/include)
include_directories(${XNCore_PATH}/IDL)
add_library(XNATA04DataProcessor SHARED
XNATA04DataProcessor_global.h
XNATA04DataProcessor.cpp
XNATA04DataProcessor.h
XNATA04DataProcessor_p.h
)
set_target_properties(XNATA04DataProcessor PROPERTIES
LIBRARY_OUTPUT_NAME "libXNATA04DataProcessor.so.${MODEL_VERSION}"
PREFIX ""
SUFFIX ""
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH TRUE
)
target_link_libraries(XNATA04DataProcessor PRIVATE
${XNCore_PATH}/lib/libXNCore.so
${XNCore_PATH}/lib/libC909_V1_Interface.so
)
target_compile_definitions(XNATA04DataProcessor PRIVATE XNATA04DATAPROCESSOR_LIBRARY)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${XNCore_PATH}/Models" CACHE PATH "Install path prefix" FORCE)
endif()
include(GNUInstallDirs)
install(TARGETS XNATA04DataProcessor
BUNDLE DESTINATION .
LIBRARY DESTINATION .
RUNTIME DESTINATION .
)
#
file(GLOB CONFIG_FILE "*.mcfg")
# 使 install
install(FILES ${CONFIG_FILE}
DESTINATION ${CMAKE_INSTALL_PREFIX}
RENAME "XNATA04DataProcessor_V${MODEL_VERSION}.mcfg"
)

View File

@ -1,424 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 14.0.1, 2025-01-26T10:40:40. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{5b958118-2d32-49ab-8eab-9018ac74c7d6}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="qlonglong">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
<value type="QString" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
</valuemap>
</valuemap>
<value type="qlonglong" key="EditorConfiguration.CodeStyle.Count">2</value>
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="int" key="EditorConfiguration.PreferAfterWhitespaceComments">0</value>
<value type="bool" key="EditorConfiguration.PreferSingleLineComments">false</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">2</value>
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value>
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
<value type="bool" key="EditorConfiguration.UseIndenter">false</value>
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
<value type="QString" key="EditorConfiguration.ignoreFileTypes">*.md, *.MD, Makefile</value>
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
<value type="bool" key="EditorConfiguration.skipTrailingWhitespace">true</value>
<value type="bool" key="EditorConfiguration.tintMarginArea">true</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap">
<valuemap type="QVariantMap" key="AutoTest.ActiveFrameworks">
<value type="bool" key="AutoTest.Framework.Boost">true</value>
<value type="bool" key="AutoTest.Framework.CTest">false</value>
<value type="bool" key="AutoTest.Framework.Catch">true</value>
<value type="bool" key="AutoTest.Framework.GTest">true</value>
<value type="bool" key="AutoTest.Framework.QtQuickTest">true</value>
<value type="bool" key="AutoTest.Framework.QtTest">true</value>
</valuemap>
<value type="bool" key="AutoTest.ApplyFilter">false</value>
<valuemap type="QVariantMap" key="AutoTest.CheckStates"/>
<valuelist type="QVariantList" key="AutoTest.PathFilters"/>
<value type="int" key="AutoTest.RunAfterBuild">0</value>
<value type="bool" key="AutoTest.UseGlobal">true</value>
<valuemap type="QVariantMap" key="ClangTools">
<value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value>
<value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
<value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
<value type="int" key="ClangTools.ParallelJobs">5</value>
<value type="bool" key="ClangTools.PreferConfigFile">true</value>
<valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
<valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
<valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
<value type="bool" key="ClangTools.UseGlobalSettings">true</value>
</valuemap>
<valuemap type="QVariantMap" key="ClangdSettings">
<value type="bool" key="blockIndexing">true</value>
<value type="bool" key="useGlobalSettings">true</value>
</valuemap>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="DeviceType">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 6.7.2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 6.7.2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt6.672.linux_gcc_64_kit</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="QString" key="CMake.Build.Type">Debug</value>
<value type="int" key="CMake.Configure.BaseEnvironment">2</value>
<value type="bool" key="CMake.Configure.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMake.Configure.UserEnvironmentChanges"/>
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_GENERATOR:STRING=Unix Makefiles
-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
-DCMAKE_BUILD_TYPE:STRING=Debug</value>
<value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/media/jin/E/MyCode/xnsim/XNModels/XNAerodynamics/build/Desktop_Qt_6_7_2-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清除</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">清除</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="CMake.Build.Type">Release</value>
<value type="int" key="CMake.Configure.BaseEnvironment">2</value>
<value type="bool" key="CMake.Configure.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMake.Configure.UserEnvironmentChanges"/>
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_GENERATOR:STRING=Unix Makefiles
-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
-DCMAKE_BUILD_TYPE:STRING=Release</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/media/jin/E/MyCode/xnsim/XNModels/XNAerodynamics/build/Desktop_Qt_6_7_2-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清除</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">清除</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<value type="QString" key="CMake.Build.Type">RelWithDebInfo</value>
<value type="int" key="CMake.Configure.BaseEnvironment">2</value>
<value type="bool" key="CMake.Configure.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMake.Configure.UserEnvironmentChanges"/>
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_GENERATOR:STRING=Unix Makefiles
-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/media/jin/E/MyCode/xnsim/XNModels/XNAerodynamics/build/Desktop_Qt_6_7_2-RelWithDebInfo</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清除</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">清除</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release with Debug Information</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.3">
<value type="QString" key="CMake.Build.Type">RelWithDebInfo</value>
<value type="int" key="CMake.Configure.BaseEnvironment">2</value>
<value type="bool" key="CMake.Configure.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMake.Configure.UserEnvironmentChanges"/>
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_GENERATOR:STRING=Unix Makefiles
-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo</value>
<value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/media/jin/E/MyCode/xnsim/XNModels/XNAerodynamics/build/Desktop_Qt_6_7_2-Profile</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清除</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">清除</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.4">
<value type="QString" key="CMake.Build.Type">MinSizeRel</value>
<value type="int" key="CMake.Configure.BaseEnvironment">2</value>
<value type="bool" key="CMake.Configure.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMake.Configure.UserEnvironmentChanges"/>
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_GENERATOR:STRING=Unix Makefiles
-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
-DCMAKE_BUILD_TYPE:STRING=MinSizeRel</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/media/jin/E/MyCode/xnsim/XNModels/XNAerodynamics/build/Desktop_Qt_6_7_2-MinSizeRel</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">all</value>
</valuelist>
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="QString" key="CMakeProjectManager.MakeStep.BuildPreset"></value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.BuildTargets">
<value type="QString">clean</value>
</valuelist>
<value type="bool" key="CMakeProjectManager.MakeStep.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMakeProjectManager.MakeStep.UserEnvironmentChanges"/>
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清除</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">清除</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Minimum Size Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">CMakeProjectManager.CMakeBuildConfiguration</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.Target.BuildConfigurationCount">5</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">部署</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">部署</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/>
<value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<value type="int" key="Analyzer.Valgrind.Callgrind.CostFormat">0</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="CustomOutputParsers"/>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph dwarf,4096 -F 250</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value>
<value type="bool" key="ProjectExplorer.RunConfiguration.Customized">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="qlonglong">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">22</value>
</data>
<data>
<variable>Version</variable>
<value type="int">22</value>
</data>
</qtcreator>

View File

@ -1,584 +0,0 @@
#include "XNATA04DataProcessor.h"
#include "XNATA04DataProcessor_p.h"
#include <XNCore/XNModelManager.h>
#include <XNCore/XNDDSManager.h>
#include <iostream>
XN_MODEL_INITIALIZE(XNATA04DataProcessor)
XNATA04DataProcessor::XNATA04DataProcessor() : XNModelObject(new XNATA04DataProcessorPrivate())
{
}
XNATA04DataProcessor::~XNATA04DataProcessor()
{
}
XNATA04DataProcessor::XNATA04DataProcessor(PrivateType *p) : XNModelObject(p)
{
}
void XNATA04DataProcessor::Initialize()
{
T_D();
XNModelObject::Initialize();
}
void XNATA04DataProcessor::PrepareForExecute()
{
T_D();
XNModelObject::PrepareForExecute();
RegisterRTEventHandler("C909::ATA04::AeroInput", std::bind(&XNATA04DataProcessor::OnAeroInput,
this, std::placeholders::_1));
RegisterRTEventHandler("C909::ATA04::WbInput", std::bind(&XNATA04DataProcessor::OnWbInput, this,
std::placeholders::_1));
RegisterRTEventHandler("C909::ATA04::GhInput", std::bind(&XNATA04DataProcessor::OnGhInput, this,
std::placeholders::_1));
d->_aeroInputInterface.Initialize(GetFramework(), GetUniqueId(), 2);
d->_aeroOutputInterface.Initialize(GetFramework(), GetUniqueId(), 1);
d->_aeroHeartbeatInterface.Initialize(GetFramework(), GetUniqueId(), 1);
d->_wbInputInterface.Initialize(GetFramework(), GetUniqueId(), 2);
d->_wbOutputInterface.Initialize(GetFramework(), GetUniqueId(), 1);
d->_wbHeartbeatInterface.Initialize(GetFramework(), GetUniqueId(), 1);
d->_ghInputInterface.Initialize(GetFramework(), GetUniqueId(), 2);
d->_ghOutputInterface.Initialize(GetFramework(), GetUniqueId(), 1);
d->_ghHeartbeatInterface.Initialize(GetFramework(), GetUniqueId(), 1);
}
void XNATA04DataProcessor::StepUpdate()
{
T_D();
XNModelObject::StepUpdate();
SendUdpData();
//SendUdpTestData();
}
void XNATA04DataProcessor::SendUdpData()
{
T_D();
SendAeroOutput();
SendWbOutput();
SendGhOutput();
SendAeroHeartbeat();
SendWbHeartbeat();
SendGhHeartbeat();
}
void XNATA04DataProcessor::SendAeroOutput()
{
T_D();
XNByteArray outputData = d->_aeroOutputInterface.getUDPPackage();
//填写数据头
outputData[0] = 0xa6; //XNSim
outputData[1] = 0xc0; //C909
outputData[2] = 0x04; //ATA04
outputData[3] = 0x00; //Aerodynamics
outputData[4] = 0x01; //Output
outputData[5] = 0x01; //向外部发送
int dataSize = (int)outputData[6] << 8 | (int)outputData[7];
if (dataSize != outputData.size()) {
LOG_WARNING("气动输出数据包大小错误不向UDP发送dataSize:%1 outputData.size():%2",
dataSize, outputData.size());
return;
}
TriggerRTEvent("SendUDPData", std::any(outputData));
}
void XNATA04DataProcessor::SendGhOutput()
{
T_D();
XNByteArray outputData = d->_ghOutputInterface.getUDPPackage();
//填写数据头
outputData[0] = 0xa6; //XNSim
outputData[1] = 0xc0; //C909
outputData[2] = 0x04; //ATA04
outputData[3] = 0x01; //GroundHandling
outputData[4] = 0x01; //Output
outputData[5] = 0x01; //向外部发送
int dataSize = (long)outputData[6] << 8 | (long)outputData[7];
if (dataSize != outputData.size()) {
LOG_WARNING("地操输出数据包大小错误不向UDP发送dataSize:%1 outputData.size():%2",
dataSize, outputData.size());
return;
}
TriggerRTEvent("SendUDPData", std::any(outputData));
}
void XNATA04DataProcessor::SendWbOutput()
{
T_D();
XNByteArray outputData = d->_wbOutputInterface.getUDPPackage();
//填写数据头
outputData[0] = 0xa6; //XNSim
outputData[1] = 0xc0; //C909
outputData[2] = 0x04; //ATA04
outputData[3] = 0x02; //WeightBalance
outputData[4] = 0x01; //Output
outputData[5] = 0x01; //向外部发送
int dataSize = (long)outputData[6] << 8 | (long)outputData[7];
if (dataSize != outputData.size()) {
LOG_WARNING("质量输出数据包大小错误不向UDP发送dataSize:%1 outputData.size():%2",
dataSize, outputData.size());
return;
}
TriggerRTEvent("SendUDPData", std::any(outputData));
}
void XNATA04DataProcessor::SendAeroHeartbeat()
{
T_D();
XNByteArray outputData = d->_aeroHeartbeatInterface.getUDPPackage();
//填写数据头
outputData[0] = 0xa6; //XNSim
outputData[1] = 0xc0; //C909
outputData[2] = 0x04; //ATA04
outputData[3] = 0x00; //Aerodynamics
outputData[4] = 0x02; //Heartbeat
outputData[5] = 0x01; //向外部发送
int dataSize = (long)outputData[6] << 8 | (long)outputData[7];
if (dataSize != outputData.size()) {
LOG_WARNING("气动心跳数据包大小错误不向UDP发送dataSize:%1 outputData.size():%2",
dataSize, outputData.size());
return;
}
TriggerRTEvent("SendUDPData", std::any(outputData));
}
void XNATA04DataProcessor::SendGhHeartbeat()
{
T_D();
XNByteArray outputData = d->_ghHeartbeatInterface.getUDPPackage();
//填写数据头
outputData[0] = 0xa6; //XNSim
outputData[1] = 0xc0; //C909
outputData[2] = 0x04; //ATA04
outputData[3] = 0x01; //GroundHandling
outputData[4] = 0x02; //Heartbeat
outputData[5] = 0x01; //向外部发送
int dataSize = (long)outputData[6] << 8 | (long)outputData[7];
if (dataSize != outputData.size()) {
LOG_WARNING("地操心跳数据包大小错误不向UDP发送dataSize:%1 outputData.size():%2",
dataSize, outputData.size());
return;
}
TriggerRTEvent("SendUDPData", std::any(outputData));
}
void XNATA04DataProcessor::SendWbHeartbeat()
{
T_D();
XNByteArray outputData = d->_wbHeartbeatInterface.getUDPPackage();
//填写数据头
outputData[0] = 0xa6; //XNSim
outputData[1] = 0xc0; //C909
outputData[2] = 0x04; //ATA04
outputData[3] = 0x02; //WeightBalance
outputData[4] = 0x02; //Heartbeat
outputData[5] = 0x01; //向外部发送
int dataSize = (long)outputData[6] << 8 | (long)outputData[7];
if (dataSize != outputData.size()) {
LOG_WARNING("质量心跳数据包大小错误不向UDP发送dataSize:%1 outputData.size():%2",
dataSize, outputData.size());
return;
}
TriggerRTEvent("SendUDPData", std::any(outputData));
}
void XNATA04DataProcessor::OnGhInput(const std::any &data)
{
T_D();
XNByteArray inputData = std::any_cast<XNByteArray>(data);
// 检查数据包头
if (inputData[0] != 0xa6) {
LOG_WARNING("接收到不是XNSim的数据包");
return;
}
if (inputData[1] != 0xc0) {
LOG_WARNING("接收到不是C909的数据包");
return;
}
if (inputData[2] != 0x04) {
LOG_WARNING("接收到不是ATA04的数据包");
return;
}
if (inputData[3] != 0x01) {
LOG_WARNING("接收到不是GroundHandling的数据包");
return;
}
if (inputData[4] != 0x00) {
LOG_WARNING("接收到不是输入结构体的数据包!");
return;
}
if (inputData[5] != 0x00) {
LOG_WARNING("接收到不是输入数据包!");
return;
}
size_t size = inputData[6];
size = size << 8 | inputData[7];
if (size != inputData.size()) {
LOG_WARNING("接收到的数据包大小不正确!");
return;
}
d->_ghInputInterface.setDataByUDPPackage(inputData);
}
void XNATA04DataProcessor::OnAeroInput(const std::any &data)
{
T_D();
XNByteArray inputData = std::any_cast<XNByteArray>(data);
// 检查数据包头
if (inputData[0] != 0xa6) {
LOG_WARNING("接收到不是XNSim的数据包");
return;
}
if (inputData[1] != 0xc0) {
LOG_WARNING("接收到不是C909的数据包");
return;
}
if (inputData[2] != 0x04) {
LOG_WARNING("接收到不是ATA04的数据包");
return;
}
if (inputData[3] != 0x00) {
LOG_WARNING("接收到不是Aerodynamics的数据包");
return;
}
if (inputData[4] != 0x00) {
LOG_WARNING("接收到不是输入结构体的数据包!");
return;
}
if (inputData[5] != 0x00) {
LOG_WARNING("接收到不是输入数据包!");
return;
}
size_t size = inputData[6];
size = size << 8 | inputData[7];
if (size != inputData.size()) {
LOG_WARNING("接收到的数据包大小不正确!");
return;
}
d->_aeroInputInterface.setDataByUDPPackage(inputData);
}
void XNATA04DataProcessor::OnWbInput(const std::any &data)
{
T_D();
XNByteArray inputData = std::any_cast<XNByteArray>(data);
// 检查数据包头
if (inputData[0] != 0xa6) {
LOG_WARNING("接收到不是XNSim的数据包");
return;
}
if (inputData[1] != 0xc0) {
LOG_WARNING("接收到不是C909的数据包");
return;
}
if (inputData[2] != 0x04) {
LOG_WARNING("接收到不是ATA04的数据包");
return;
}
if (inputData[3] != 0x02) {
LOG_WARNING("接收到不是WeightBalance的数据包");
return;
}
if (inputData[4] != 0x00) {
LOG_WARNING("接收到不是输入结构体的数据包!");
return;
}
if (inputData[5] != 0x00) {
LOG_WARNING("接收到不是输入数据包!");
return;
}
size_t size = inputData[6];
size = size << 8 | inputData[7];
if (size != inputData.size()) {
LOG_WARNING("接收到的数据包大小不正确!");
return;
}
d->_wbInputInterface.setDataByUDPPackage(inputData);
}
// void XNATA04DataProcessor::SendUdpTestData()
// {
// Q_D(XNATA04DataProcessor);
// // 创建气动输入(AeroInput)数据包
// QByteArray aeroData;
// QDataStream aeroStream(&aeroData, QIODevice::WriteOnly);
// aeroStream.setByteOrder(QDataStream::LittleEndian);
// aeroStream.setVersion(QDataStream::Qt_6_0);
// // 气动输入数据包头 (0x0b=从外部输入, 0x04=ATA04, 0x00=气动模型, 0x00=输入数据)
// quint8 aeroHeader[6] = {0x0b, 0x04, 0x00, 0x00, 0x00, 0x00}; // 最后两个字节用于大小
// aeroStream << aeroHeader[0] << aeroHeader[1] << aeroHeader[2] << aeroHeader[3] << aeroHeader[4]
// << aeroHeader[5];
// // 气动数据字段
// aeroStream << (double)-2.0; // alpha
// aeroStream << (double)0.0; // alpdot
// aeroStream << (double)0.0; // beta
// aeroStream << (double)10000.0; // press_alt
// aeroStream << (double)360.0; // tas
// aeroStream << (double)0.3; // mach
// aeroStream << (double)0.0; // nx
// aeroStream << (double)0.0; // ny
// aeroStream << (double)1.0; // nz
// aeroStream << (double)0.0; // p
// aeroStream << (double)0.0; // q
// aeroStream << (double)0.0; // r
// aeroStream << (double)110.0; // qbar
// aeroStream << (double)0.0; // blcg
// aeroStream << (double)650.0; // bscg
// aeroStream << (double)7.0; // wlcg
// aeroStream << (double)-2.0; // stab
// // ail_f8 数组需要10个double
// for (int i = 0; i < 10; i++) {
// aeroStream << (double)0.0;
// }
// // elv_f8 数组需要4个double
// for (int i = 0; i < 4; i++) {
// aeroStream << (double)0.0;
// }
// // rud_f8 数组需要2个double
// for (int i = 0; i < 2; i++) {
// aeroStream << (double)0.0;
// }
// // gear_f8 数组需要7个double
// for (int i = 0; i < 7; i++) {
// aeroStream << (double)1.0;
// }
// // flap_f8 数组需要10个double
// for (int i = 0; i < 10; i++) {
// aeroStream << (double)41.5;
// }
// // slat_f8 数组需要20个double
// for (int i = 0; i < 20; i++) {
// aeroStream << (double)20.855;
// }
// // spl_f8 数组需要20个double
// for (int i = 0; i < 20; i++) {
// aeroStream << (double)0.0;
// }
// // tnet_f8 数组需要4个double
// for (int i = 0; i < 4; i++) {
// aeroStream << (double)8000.0;
// }
// // kice_f8 数组需要20个double
// for (int i = 0; i < 20; i++) {
// aeroStream << (double)0.0;
// }
// // alt_agl
// aeroStream << (double)2500.0;
// // 更新数据包大小(使用两个字节)
// quint16 size = aeroData.size();
// aeroData[4] = (size >> 8) & 0xFF; // 高字节
// aeroData[5] = size & 0xFF; // 低字节
// // 创建地面操作输入(GhInput)数据包
// QByteArray ghData;
// QDataStream ghStream(&ghData, QIODevice::WriteOnly);
// ghStream.setByteOrder(QDataStream::LittleEndian);
// ghStream.setVersion(QDataStream::Qt_6_0);
// // 地面操作输入数据包头 (0x0b=从外部输入, 0x04=ATA04, 0x01=地面操作模型, 0x00=输入数据)
// quint8 ghHeader[6] = {0x0b, 0x04, 0x01, 0x00, 0x00, 0x00}; // 最后两个字节用于大小
// ghStream << ghHeader[0] << ghHeader[1] << ghHeader[2] << ghHeader[3] << ghHeader[4]
// << ghHeader[5];
// // 地面操作数据字段
// ghStream << (quint8)0; // frz_l1
// ghStream << (quint8)0; // chocks_l1
// ghStream << (double)8.0; // alt_agl_f8
// ghStream << (quint8)0; // frzflt_l1
// ghStream << (double)0.0; // p_f8
// ghStream << (double)0.0; // q_f8
// ghStream << (double)0.0; // r_f8
// ghStream << (double)50.0; // ug_f8
// ghStream << (double)0.0; // vg_f8
// ghStream << (double)0.0; // wg_f8
// ghStream << (double)0.0; // blcg_f8
// ghStream << (double)649.3; // bscg_f8
// ghStream << (double)10.0; // wlcg_f8
// ghStream << (quint8)0; // pb_active_l1
// ghStream << (double)0.0; // pb_towforce_f8
// // brake_torq_f8 数组 3x2
// for (int i = 0; i < 3; i++) {
// for (int j = 0; j < 2; j++) {
// ghStream << (double)0.0;
// }
// }
// // gear_f8 数组需要3个double
// for (int i = 0; i < 3; i++) {
// ghStream << (double)1.0;
// }
// // gsteer_f8 数组需要10个double
// for (int i = 0; i < 10; i++) {
// ghStream << (double)0.0;
// }
// // tire_pres_f8 数组 3x2
// for (int i = 0; i < 3; i++) {
// for (int j = 0; j < 2; j++) {
// if (i == 0) {
// ghStream << (double)98.0; // 98 kpa的胎压
// } else {
// ghStream << (double)140.0; // 140 kpa的胎压
// }
// }
// }
// // 4个double数组
// for (int i = 0; i < 4; i++) {
// ghStream << (double)0.0;
// }
// ghStream << (quint8)0; // onjax_l1
// // contdep_f8 数组需要7个double
// ghStream << (double)1.0;
// for (int i = 1; i < 7; i++) {
// ghStream << (double)0.0;
// }
// ghStream << (double)0.0; // thetag_f8
// ghStream << (double)0.0; // phig_f8
// ghStream << (qint32)0; // rwyrgh_i2
// ghStream << (double)0.0; // rwyhdg_f8
// ghStream << (quint8)0; // reset_braketemp_l1
// ghStream << (quint8)0; // reset_tirepress_l1
// ghStream << (double)16.0; // temp_c_f8
// // brake_temp_f8 数组 3x2
// for (int i = 0; i < 3; i++) {
// for (int j = 0; j < 2; j++) {
// ghStream << (double)16.0; // 16度的刹车温度
// }
// }
// // tire_tburst_l1 数组 3x2
// for (int i = 0; i < 3; i++) {
// for (int j = 0; j < 2; j++) {
// ghStream << (char)0;
// }
// }
// // tire_tflat_l1 数组 3x2
// for (int i = 0; i < 3; i++) {
// for (int j = 0; j < 2; j++) {
// ghStream << (char)0;
// }
// }
// ghStream << (quint8)0; // brk_reset_tpres_l1
// // rcon_ci_f8 数组需要14个double
// ghStream << (double)1.0;
// for (int i = 1; i < 14; i++) {
// ghStream << (double)0.0;
// }
// ghStream << (qint32)2; // gsteer_state_i4
// ghStream << (quint8)1; // trim_active_l1
// ghStream << (double)0.0; // phi_deg_f8
// ghStream << (double)0.0; // theta_deg_f8
// ghStream << (double)0.0; // psi_deg_f8
// ghStream << (quint8)1; // resetint_l1
// // 更新数据包大小(使用两个字节)
// size = ghData.size();
// ghData[4] = (size >> 8) & 0xFF; // 高字节
// ghData[5] = size & 0xFF; // 低字节
// // 创建重量平衡输入(WbInput)数据包
// QByteArray wbData;
// QDataStream wbStream(&wbData, QIODevice::WriteOnly);
// wbStream.setByteOrder(QDataStream::LittleEndian);
// wbStream.setVersion(QDataStream::Qt_6_0);
// // 重量平衡输入数据包头 (0x0b=从外部输入, 0x04=ATA04, 0x02=重量平衡模型, 0x00=输入数据)
// quint8 wbHeader[6] = {0x0b, 0x04, 0x02, 0x00, 0x00, 0x00}; // 最后两个字节用于大小
// wbStream << wbHeader[0] << wbHeader[1] << wbHeader[2] << wbHeader[3] << wbHeader[4]
// << wbHeader[5];
// // 重量平衡数据字段
// wbStream << (double)0.0; // theta_deg_f8
// wbStream << (double)0.0; // phi_deg_f8
// wbStream << (double)0.0; // psi_deg_f8
// wbStream << (quint8)0; // gear_mode_l1
// wbStream << (double)82574.0; // acset_gw_f8 (60000kg飞机重量)
// wbStream << (double)0.1215; // acset_cg_f8 (25%MAC重心位置)
// // acset_tankfuel_f4 数组需要20个float
// for (int i = 0; i < 20; i++) {
// wbStream << (double)(i < 2 ? 4541.0 : 0.0); // 前2个油箱各4541kg
// }
// wbStream << (double)9082.0; // acset_totfuel_f8 (总油量9082kg)
// wbStream << (double)73492.0; // acset_zfw_f8 (零油重73492kg)
// wbStream << (double)0.12; // acset_zfwcg_f8 (零油重重心24%MAC)
// // eng_efsep_l1 数组需要4个char
// for (int i = 0; i < 4; i++) {
// wbStream << (char)0;
// }
// // fuel_f8 数组需要20个double
// for (int i = 0; i < 20; i++) {
// wbStream << (double)(i < 2 ? 4541.0 : 0.0); // 前2个油箱各4541kg
// }
// wbStream << (double)1.0; // gear_avg_f8
// // kice_f8 数组需要20个double
// for (int i = 0; i < 20; i++) {
// wbStream << (double)0.0;
// }
// wbStream << (quint8)1; // bycglim_l1
// wbStream << (quint8)1; // bygwlim_l1
// wbStream << (quint8)0; // frz_l1
// wbStream << (quint8)0; // zcgfrz_l1
// wbStream << (quint8)0; // zcgfrz_grfx_l1
// wbStream << (quint8)0; // ycgfrz_l1
// wbStream << (quint8)0; // inertfrz_l1
// wbStream << (double)80000.0; // potreq_gw_f8
// wbStream << (double)0.2; // potreq_gwcg_f8
// // 更新数据包大小(使用两个字节)
// size = wbData.size();
// wbData[4] = (size >> 8) & 0xFF; // 高字节
// wbData[5] = size & 0xFF; // 低字节
// // 发送测试数据包
// TriggerRTEvent("SendTestUDPData", QVariant::fromValue(aeroData));
// TriggerRTEvent("SendTestUDPData", QVariant::fromValue(ghData));
// TriggerRTEvent("SendTestUDPData", QVariant::fromValue(wbData));
// }

View File

@ -1,49 +0,0 @@
#pragma once
#include "XNATA04DataProcessor_global.h"
#include <XNCore/XNModelObject.h>
struct XNATA04DataProcessorPrivate;
class XNATA04DATAPROCESSOR_EXPORT XNATA04DataProcessor : public XNModelObject
{
XN_METATYPE(XNATA04DataProcessor, XNModelObject)
XN_DECLARE_PRIVATE(XNATA04DataProcessor)
public:
XNATA04DataProcessor();
virtual ~XNATA04DataProcessor();
protected:
XNATA04DataProcessor(PrivateType *p);
public:
virtual void Initialize() override;
virtual void PrepareForExecute() override;
public:
virtual void StepUpdate() override;
private:
void OnAeroInput(const std::any &data);
void OnWbInput(const std::any &data);
void OnGhInput(const std::any &data);
void SendUdpData();
void SendAeroOutput();
void SendWbOutput();
void SendGhOutput();
void SendAeroHeartbeat();
void SendWbHeartbeat();
void SendGhHeartbeat();
//void SendUdpTestData();
};
XNCLASS_PTR_DECLARE(XNATA04DataProcessor)

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Model>
<Name>XNATA04DataProcessor</Name>
<Description>ATA04数据处理器</Description>
<Author>Jin</Author>
<Version>1.0.0</Version>
<CreateTime>2025-03-10 10:00:00</CreateTime>
<ChangeTime>2025-03-10 10:00:00</ChangeTime>
<Node>0-0</Node>
<Priority>98</Priority>
<MathLib/>
<CommandList/>
</Model>

View File

@ -1,10 +0,0 @@
#ifndef XNATA04DATAPROCESSOR_GLOBAL_H
#define XNATA04DATAPROCESSOR_GLOBAL_H
#if defined(XNATA04DATAPROCESSOR_LIBRARY)
# define XNATA04DATAPROCESSOR_EXPORT __attribute__((visibility("default")))
#else
# define XNATA04DATAPROCESSOR_EXPORT __attribute__((visibility("default")))
#endif
#endif // XNATA04DATAPROCESSOR_GLOBAL_H

View File

@ -1,33 +0,0 @@
#pragma once
#include <XNCore/XNModelObject_p.h>
#include <C909_V1/ATA04/Aerodynamics_heartbeat.hpp>
#include <C909_V1/ATA04/Aerodynamics_input.hpp>
#include <C909_V1/ATA04/Aerodynamics_output.hpp>
#include <C909_V1/ATA04/WeightBalance_input.hpp>
#include <C909_V1/ATA04/WeightBalance_output.hpp>
#include <C909_V1/ATA04/WeightBalance_heartbeat.hpp>
#include <C909_V1/ATA04/GroundHandling_input.hpp>
#include <C909_V1/ATA04/GroundHandling_output.hpp>
#include <C909_V1/ATA04/GroundHandling_heartbeat.hpp>
struct XNATA04DataProcessorPrivate : public XNModelObjectPrivate {
XNSim::C909::ATA04::Aerodynamics_input _aeroInput;
XNSim::C909::ATA04::Aerodynamics_output _aeroOutput;
XNSim::C909::ATA04::WeightBalance_input _wbInput;
XNSim::C909::ATA04::WeightBalance_output _wbOutput;
XNSim::C909::ATA04::GroundHandling_input _ghInput;
XNSim::C909::ATA04::GroundHandling_output _ghOutput;
XNSim::C909::ATA04::Aerodynamics_heartbeat _aeroHeartbeat;
XNSim::C909::ATA04::WeightBalance_heartbeat _wbHeartbeat;
XNSim::C909::ATA04::GroundHandling_heartbeat _ghHeartbeat;
XNSim::C909::ATA04::Aerodynamics_input_Interface _aeroInputInterface;
XNSim::C909::ATA04::Aerodynamics_output_Interface _aeroOutputInterface;
XNSim::C909::ATA04::WeightBalance_input_Interface _wbInputInterface;
XNSim::C909::ATA04::WeightBalance_output_Interface _wbOutputInterface;
XNSim::C909::ATA04::GroundHandling_input_Interface _ghInputInterface;
XNSim::C909::ATA04::GroundHandling_output_Interface _ghOutputInterface;
XNSim::C909::ATA04::Aerodynamics_heartbeat_Interface _aeroHeartbeatInterface;
XNSim::C909::ATA04::WeightBalance_heartbeat_Interface _wbHeartbeatInterface;
XNSim::C909::ATA04::GroundHandling_heartbeat_Interface _ghHeartbeatInterface;
};

View File

@ -1,9 +0,0 @@
{
"configurations": [
{
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"configurationProvider": "ms-vscode.cmake-tools"
}
],
"version": 4
}

View File

@ -1,79 +0,0 @@
{
"files.associations": {
"*.cpp": "cpp",
"functional": "cpp",
"qhash": "cpp",
"qstringlist": "cpp",
"*.ipp": "cpp",
"*.tcc": "cpp",
"optional": "cpp",
"type_traits": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"any": "cpp",
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"bitset": "cpp",
"chrono": "cpp",
"codecvt": "cpp",
"compare": "cpp",
"complex": "cpp",
"concepts": "cpp",
"condition_variable": "cpp",
"cstdint": "cpp",
"deque": "cpp",
"list": "cpp",
"map": "cpp",
"set": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"random": "cpp",
"ratio": "cpp",
"regex": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"utility": "cpp",
"fstream": "cpp",
"future": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"mutex": "cpp",
"new": "cpp",
"ostream": "cpp",
"ranges": "cpp",
"span": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"stop_token": "cpp",
"streambuf": "cpp",
"thread": "cpp",
"cinttypes": "cpp",
"typeindex": "cpp",
"typeinfo": "cpp",
"variant": "cpp"
}
}

View File

@ -1,63 +0,0 @@
cmake_minimum_required(VERSION 3.16)
project(XNAerodynamics LANGUAGES CXX)
set(MODEL_VERSION "1.0.0.0")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
#
if(DEFINED ENV{XNCore})
set(XNCore_PATH $ENV{XNCore})
else()
message(FATAL_ERROR "Environment variable XNCore is not set.")
endif()
# XNCore_PATH include
include_directories(${XNCore_PATH}/include)
include_directories(${XNCore_PATH}/IDL)
add_library(XNAerodynamics SHARED
XNAerodynamics_global.h
XNAerodynamics.cpp
XNAerodynamics.h
XNAerodynamics_p.h
)
set_target_properties(XNAerodynamics PROPERTIES
LIBRARY_OUTPUT_NAME "libXNAerodynamics.so.${MODEL_VERSION}"
PREFIX ""
SUFFIX ""
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH TRUE
)
target_link_libraries(XNAerodynamics PRIVATE
${XNCore_PATH}/lib/libXNCore.so
${XNCore_PATH}/lib/libC909_V1_Interface.so
dl
)
target_compile_definitions(XNAerodynamics PRIVATE XNAERODYNAMICS_LIBRARY)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${XNCore_PATH}/Models" CACHE PATH "Install path prefix" FORCE)
endif()
include(GNUInstallDirs)
install(TARGETS XNAerodynamics
BUNDLE DESTINATION .
LIBRARY DESTINATION .
RUNTIME DESTINATION .
)
#
file(GLOB CONFIG_FILE "*.mcfg")
# 使 install
install(FILES ${CONFIG_FILE}
DESTINATION ${CMAKE_INSTALL_PREFIX}
RENAME "XNAerodynamics_V${MODEL_VERSION}.mcfg"
)

View File

@ -1,107 +0,0 @@
#include "XNAerodynamics.h"
#include "XNAerodynamics_p.h"
#include <XNCore/XNModelManager.h>
XN_MODEL_INITIALIZE(XNAerodynamics)
XNAerodynamics::XNAerodynamics() : XNModelObject(new XNAerodynamicsPrivate())
{
}
XNAerodynamics::~XNAerodynamics()
{
ReleaseData();
}
XNAerodynamics::XNAerodynamics(PrivateType *p) : XNModelObject(p)
{
}
void XNAerodynamics::Initialize()
{
T_D();
SuperType::Initialize();
if (d->_dynamicLib) {
d->_fun = (FunctionType)dlsym(d->_dynamicLib, d->_entryPointName.c_str());
if (!d->_fun) {
LOG_WARNING("Failed to resolve SACSCAerodynamicsEntryPoint");
}
}
}
void XNAerodynamics::PrepareForExecute()
{
T_D();
XNModelObject::PrepareForExecute();
InitializeData();
d->_inputInterface.Initialize(GetFramework(), GetUniqueId(), 1);
d->_outputInterface.Initialize(GetFramework(), GetUniqueId(), 2);
d->_heartbeatInterface.Initialize(GetFramework(), GetUniqueId(), 2);
}
void XNAerodynamics::StepUpdate()
{
T_D();
XNModelObject::StepUpdate();
if (d->_fun) {
d->_inputInterface.getData(d->_data.input_aero);
d->_fun(&d->_data);
d->_outputInterface.setData(d->_data.output_aero);
d->_heartbeatInterface.setData(&d->_data);
}
}
void XNAerodynamics::InitializeData()
{
T_D();
d->_data.aero_model_heartbeat = 0;
d->_data.input_aero = new input_aero_S;
d->_data.input_aero->l_04_i_aerocomac_ail_f8 = new double[10];
d->_data.input_aero->l_04_i_aerocomac_elv_f8 = new double[4];
d->_data.input_aero->l_04_i_aerocomac_rud_f8 = new double[2];
d->_data.input_aero->l_04_i_aerocomac_gear_f8 = new double[7];
d->_data.input_aero->l_04_i_aerocomac_flap_f8 = new double[10];
d->_data.input_aero->l_04_i_aerocomac_slat_f8 = new double[20];
d->_data.input_aero->l_04_i_aerocomac_spl_f8 = new double[20];
d->_data.input_aero->l_04_i_aerocomac_tnet_f8 = new double[4];
d->_data.input_aero->l_04_i_aerocomac_kice_f8 = new double[20];
d->_data.output_aero = new output_aero_S;
}
void XNAerodynamics::ReleaseData()
{
T_D();
if (d->_data.input_aero) {
if (d->_data.input_aero->l_04_i_aerocomac_ail_f8) {
delete[] d->_data.input_aero->l_04_i_aerocomac_ail_f8;
}
if (d->_data.input_aero->l_04_i_aerocomac_elv_f8) {
delete[] d->_data.input_aero->l_04_i_aerocomac_elv_f8;
}
if (d->_data.input_aero->l_04_i_aerocomac_rud_f8) {
delete[] d->_data.input_aero->l_04_i_aerocomac_rud_f8;
}
if (d->_data.input_aero->l_04_i_aerocomac_gear_f8) {
delete[] d->_data.input_aero->l_04_i_aerocomac_gear_f8;
}
if (d->_data.input_aero->l_04_i_aerocomac_flap_f8) {
delete[] d->_data.input_aero->l_04_i_aerocomac_flap_f8;
}
if (d->_data.input_aero->l_04_i_aerocomac_slat_f8) {
delete[] d->_data.input_aero->l_04_i_aerocomac_slat_f8;
}
if (d->_data.input_aero->l_04_i_aerocomac_spl_f8) {
delete[] d->_data.input_aero->l_04_i_aerocomac_spl_f8;
}
if (d->_data.input_aero->l_04_i_aerocomac_tnet_f8) {
delete[] d->_data.input_aero->l_04_i_aerocomac_tnet_f8;
}
if (d->_data.input_aero->l_04_i_aerocomac_kice_f8) {
delete[] d->_data.input_aero->l_04_i_aerocomac_kice_f8;
}
delete d->_data.input_aero;
}
if (d->_data.output_aero) {
delete d->_data.output_aero;
}
}

View File

@ -1,28 +0,0 @@
#pragma once
#include "XNAerodynamics_global.h"
#include <XNCore/XNModelObject.h>
class XNAerodynamicsPrivate;
class XNAERODYNAMICS_EXPORT XNAerodynamics : public XNModelObject
{
XN_METATYPE(XNAerodynamics, XNModelObject)
XN_DECLARE_PRIVATE(XNAerodynamics)
public:
XNAerodynamics();
virtual ~XNAerodynamics();
protected:
XNAerodynamics(PrivateType *p);
public:
virtual void Initialize() override;
virtual void PrepareForExecute() override;
virtual void StepUpdate() override;
protected:
void InitializeData();
void ReleaseData();
};
XNCLASS_PTR_DECLARE(XNAerodynamics)

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Model>
<Name>XNAerodynamics</Name>
<Description>ATA04气动模型</Description>
<Author>Jin</Author>
<Version>1.0.0</Version>
<CreateTime>2025-02-04 10:00:00</CreateTime>
<ChangeTime>2025-02-04 10:00:00</ChangeTime>
<Node>0-0</Node>
<Priority>99</Priority>
<MathLib>ATA04_SACSCAerodynamics_2.0.3.5H_20241106/libSACSCAerodynamics.so</MathLib>
<CommandList/>
</Model>

View File

@ -1,10 +0,0 @@
#ifndef XNAERODYNAMICS_GLOBAL_H
#define XNAERODYNAMICS_GLOBAL_H
#if defined(XNAERODYNAMICS_LIBRARY)
# define XNAERODYNAMICS_EXPORT __attribute__((visibility("default")))
#else
# define XNAERODYNAMICS_EXPORT __attribute__((visibility("default")))
#endif
#endif // XNAERODYNAMICS_GLOBAL_H

View File

@ -1,23 +0,0 @@
#pragma once
#include <XNCore/XNModelObject_p.h>
#include <DataModels/libSACSCAerodynamics_V2.0.3.5H/std_04_dll.h>
#include <C909_V1/ATA04/Aerodynamics_input.hpp>
#include <C909_V1/ATA04/Aerodynamics_output.hpp>
#include <C909_V1/ATA04/Aerodynamics_heartbeat.hpp>
using interfaceType = ComacDataStructure_S;
typedef void (*FunctionType)(interfaceType *);
struct XNAerodynamicsPrivate : public XNModelObjectPrivate {
FunctionType _fun = nullptr;
ComacDataStructure_S _data;
std::string _entryPointName = "_Z27SACSCAerodynamicsEntryPointP20ComacDataStructure_S";
std::mutex _mutex;
XNSim::C909::ATA04::Aerodynamics_input_Interface _inputInterface;
XNSim::C909::ATA04::Aerodynamics_output_Interface _outputInterface;
XNSim::C909::ATA04::Aerodynamics_heartbeat_Interface _heartbeatInterface;
};

View File

@ -1,9 +0,0 @@
{
"configurations": [
{
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"configurationProvider": "ms-vscode.cmake-tools"
}
],
"version": 4
}

View File

@ -1,77 +0,0 @@
{
"files.associations": {
"*.cpp": "cpp",
"qobject": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"any": "cpp",
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"*.tcc": "cpp",
"bitset": "cpp",
"chrono": "cpp",
"codecvt": "cpp",
"compare": "cpp",
"complex": "cpp",
"concepts": "cpp",
"condition_variable": "cpp",
"cstdint": "cpp",
"deque": "cpp",
"list": "cpp",
"map": "cpp",
"set": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"random": "cpp",
"ratio": "cpp",
"regex": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"future": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"mutex": "cpp",
"new": "cpp",
"ostream": "cpp",
"ranges": "cpp",
"span": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"stop_token": "cpp",
"streambuf": "cpp",
"thread": "cpp",
"cinttypes": "cpp",
"typeindex": "cpp",
"typeinfo": "cpp",
"variant": "cpp",
"fstream": "cpp"
}
}

View File

@ -1,62 +0,0 @@
cmake_minimum_required(VERSION 3.16)
project(XNGroundHandling LANGUAGES CXX)
set(MODEL_VERSION "2.0.143.1")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
#
if(DEFINED ENV{XNCore})
set(XNCore_PATH $ENV{XNCore})
else()
message(FATAL_ERROR "Environment variable XNCore is not set.")
endif()
# XNCore_PATH include
include_directories(${XNCore_PATH}/include)
include_directories(${XNCore_PATH}/IDL)
add_library(XNGroundHandling SHARED
XNGroundHandling_global.h
XNGroundHandling.cpp
XNGroundHandling.h
XNGroundHandling_p.h
)
set_target_properties(XNGroundHandling PROPERTIES
LIBRARY_OUTPUT_NAME "libXNGroundHandling.so.${MODEL_VERSION}"
PREFIX ""
SUFFIX ""
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH TRUE
)
target_link_libraries(XNGroundHandling PRIVATE
${XNCore_PATH}/lib/libXNCore.so
${XNCore_PATH}/lib/libC909_V1_Interface.so
dl)
target_compile_definitions(XNGroundHandling PRIVATE XNGROUNDHANDLING_LIBRARY)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${XNCore_PATH}/Models" CACHE PATH "Install path prefix" FORCE)
endif()
include(GNUInstallDirs)
install(TARGETS XNGroundHandling
BUNDLE DESTINATION .
LIBRARY DESTINATION .
RUNTIME DESTINATION .
)
#
file(GLOB CONFIG_FILE "*.mcfg")
# 使 install
install(FILES ${CONFIG_FILE}
DESTINATION ${CMAKE_INSTALL_PREFIX}
RENAME "XNGroundHandling_V${MODEL_VERSION}.mcfg"
)

View File

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Project>
<Name>GroundHandling</Name>
<CodePath>/media/jin/E/MyCode/XNSim/XNModels/XNGroundHandling</CodePath>
<ClassName>XNGroundHandling</ClassName>
<Author>Jin</Author>
<Version>1.0.0</Version>
<Description>ATA04GroundHandling</Description>
<CreateTime>2025-02-19 16:22:17</CreateTime>
<ChangeTime>2025-02-19 16:22:19</ChangeTime>
<Node>0-0</Node>
<Priority>99</Priority>
<MathPath></MathPath>
<MathHeaderPath></MathHeaderPath>
<MathEntryPoint></MathEntryPoint>
<MathEntryParam></MathEntryParam>
<CommandList/>
</Project>

View File

@ -1,311 +0,0 @@
#include "XNGroundHandling.h"
#include "XNGroundHandling_p.h"
#include <XNCore/XNModelManager.h>
XN_MODEL_INITIALIZE(XNGroundHandling)
XNGroundHandling::XNGroundHandling() : XNModelObject(new XNGroundHandlingPrivate())
{
}
XNGroundHandling::~XNGroundHandling()
{
ReleaseData();
}
XNGroundHandling::XNGroundHandling(PrivateType *p) : XNModelObject(p)
{
}
void XNGroundHandling::Initialize()
{
T_D();
XNModelObject::Initialize();
if (d->_dynamicLib) {
d->_fun = (FunctionType)dlsym(d->_dynamicLib, d->_entryPointName.c_str());
if (!d->_fun) {
LOG_WARNING("Failed to resolve SACSCGroundHandlingEntry");
}
}
//add other initial code here
}
void XNGroundHandling::PrepareForExecute()
{
T_D();
XNModelObject::PrepareForExecute();
InitializeData();
d->_inputInterface.Initialize(GetFramework(), GetUniqueId(), 1);
d->_outputInterface.Initialize(GetFramework(), GetUniqueId(), 2);
d->_heartbeatInterface.Initialize(GetFramework(), GetUniqueId(), 2);
}
void XNGroundHandling::StepUpdate()
{
T_D();
XNModelObject::StepUpdate();
if (d->_fun) {
//add your input code here
d->_inputInterface.getData(d->_data.input_ground);
d->_fun(&d->_data);
d->_outputInterface.setData(d->_data.output_ground);
d->_heartbeatInterface.setData(&d->_data);
//add your output code here
}
}
void XNGroundHandling::InitializeData()
{
T_D();
//add your initial data code here
d->_data.input_ground = new input_ground_S();
d->_data.input_ground->l_04_i_gdcomac_brake_torq_f8 = new double *[3];
for (int i = 0; i < 3; i++) {
d->_data.input_ground->l_04_i_gdcomac_brake_torq_f8[i] = new double[2];
}
d->_data.input_ground->l_04_i_gdcomac_gear_f8 = new double[3];
d->_data.input_ground->l_04_i_gdcomac_gsteer_f8 = new double[3];
d->_data.input_ground->l_04_i_gdcomac_tire_pres_f8 = new double *[3];
for (int i = 0; i < 3; i++) {
d->_data.input_ground->l_04_i_gdcomac_tire_pres_f8[i] = new double[2];
}
d->_data.input_ground->l_04_i_gdcomac_contdep_f8 = new double[7];
d->_data.input_ground->l_04_i_gdcomac_brake_temp_f8 = new double *[3];
for (int i = 0; i < 3; i++) {
d->_data.input_ground->l_04_i_gdcomac_brake_temp_f8[i] = new double[2];
}
d->_data.input_ground->l_04_i_gdcomac_tire_tburst_l1 = new unsigned char *[3];
for (int i = 0; i < 3; i++) {
d->_data.input_ground->l_04_i_gdcomac_tire_tburst_l1[i] = new unsigned char[2];
}
d->_data.input_ground->l_04_i_gdcomac_tire_tflat_l1 = new unsigned char *[3];
for (int i = 0; i < 3; i++) {
d->_data.input_ground->l_04_i_gdcomac_tire_tflat_l1[i] = new unsigned char[2];
}
d->_data.input_ground->l_04_i_gdcomac_rcon_ci_f8 = new double[14];
d->_data.output_ground = new output_ground_S();
d->_data.output_ground->l_04_o_gdcomac_fygs_f8 = new double[3];
d->_data.output_ground->l_04_o_gdcomac_mzgs_f8 = new double[3];
d->_data.output_ground->l_04_o_gdcomac_mu_f8 = new double[3];
d->_data.output_ground->l_04_o_gdcomac_dstroke_f8 = new double[3];
d->_data.output_ground->l_04_o_gdcomac_sr_f8 = new double *[3];
for (int i = 0; i < 3; i++) {
d->_data.output_ground->l_04_o_gdcomac_sr_f8[i] = new double[2];
}
d->_data.output_ground->l_04_o_gdcomac_sy_f8 = new double *[3];
for (int i = 0; i < 3; i++) {
d->_data.output_ground->l_04_o_gdcomac_sy_f8[i] = new double[2];
}
d->_data.output_ground->l_04_o_gdcomac_sx_f8 = new double *[3];
for (int i = 0; i < 3; i++) {
d->_data.output_ground->l_04_o_gdcomac_sx_f8[i] = new double[2];
}
d->_data.output_ground->l_04_o_gdcomac_xft_f8 = new double[3];
d->_data.output_ground->l_04_o_gdcomac_yft_f8 = new double[3];
d->_data.output_ground->l_04_o_gdcomac_zft_f8 = new double[3];
d->_data.output_ground->l_04_o_gdcomac_tire_vel_f8 = new double *[3];
for (int i = 0; i < 3; i++) {
d->_data.output_ground->l_04_o_gdcomac_tire_vel_f8[i] = new double[2];
}
d->_data.output_ground->l_04_o_gdcomac_tire_temp_f8 = new double *[3];
for (int i = 0; i < 3; i++) {
d->_data.output_ground->l_04_o_gdcomac_tire_temp_f8[i] = new double[2];
}
d->_data.output_ground->l_04_o_gdcomac_tire_burst_l1 = new unsigned char *[3];
for (int i = 0; i < 3; i++) {
d->_data.output_ground->l_04_o_gdcomac_tire_burst_l1[i] = new unsigned char[2];
}
d->_data.output_ground->l_04_o_gdcomac_utirew_f8 = new double *[3];
for (int i = 0; i < 3; i++) {
d->_data.output_ground->l_04_o_gdcomac_utirew_f8[i] = new double[2];
}
d->_data.output_ground->l_04_o_gdcomac_vtirew_f8 = new double *[3];
for (int i = 0; i < 3; i++) {
d->_data.output_ground->l_04_o_gdcomac_vtirew_f8[i] = new double[2];
}
d->_data.output_ground->l_04_o_gdcomac_whl_omega_f8 = new double *[3];
for (int i = 0; i < 3; i++) {
d->_data.output_ground->l_04_o_gdcomac_whl_omega_f8[i] = new double[2];
}
d->_data.output_ground->l_04_o_gdcomac_dstruc_f8 = new double[6];
d->_data.output_ground->l_04_o_gdcomac_nd_f8 = new double[3];
d->_data.output_ground->l_04_o_gdcomac_wor_par_f8 = new double[3];
d->_data.output_ground->l_04_o_gdcomac_vczt_f8 = new double *[3];
for (int i = 0; i < 3; i++) {
d->_data.output_ground->l_04_o_gdcomac_vczt_f8[i] = new double[2];
}
}
void XNGroundHandling::ReleaseData()
{
T_D();
// 释放内存
if (d->_data.input_ground) {
if (d->_data.input_ground->l_04_i_gdcomac_brake_torq_f8) {
for (int i = 0; i < 3; i++) {
if (d->_data.input_ground->l_04_i_gdcomac_brake_torq_f8[i]) {
delete[] d->_data.input_ground->l_04_i_gdcomac_brake_torq_f8[i];
}
}
delete[] d->_data.input_ground->l_04_i_gdcomac_brake_torq_f8;
}
if (d->_data.input_ground->l_04_i_gdcomac_gear_f8) {
delete[] d->_data.input_ground->l_04_i_gdcomac_gear_f8;
}
if (d->_data.input_ground->l_04_i_gdcomac_gsteer_f8) {
delete[] d->_data.input_ground->l_04_i_gdcomac_gsteer_f8;
}
if (d->_data.input_ground->l_04_i_gdcomac_tire_pres_f8) {
for (int i = 0; i < 3; i++) {
if (d->_data.input_ground->l_04_i_gdcomac_tire_pres_f8[i]) {
delete[] d->_data.input_ground->l_04_i_gdcomac_tire_pres_f8[i];
}
}
delete[] d->_data.input_ground->l_04_i_gdcomac_tire_pres_f8;
}
if (d->_data.input_ground->l_04_i_gdcomac_contdep_f8) {
delete[] d->_data.input_ground->l_04_i_gdcomac_contdep_f8;
}
if (d->_data.input_ground->l_04_i_gdcomac_brake_temp_f8) {
for (int i = 0; i < 3; i++) {
if (d->_data.input_ground->l_04_i_gdcomac_brake_temp_f8[i]) {
delete[] d->_data.input_ground->l_04_i_gdcomac_brake_temp_f8[i];
}
}
delete[] d->_data.input_ground->l_04_i_gdcomac_brake_temp_f8;
}
if (d->_data.input_ground->l_04_i_gdcomac_tire_tburst_l1) {
for (int i = 0; i < 3; i++) {
if (d->_data.input_ground->l_04_i_gdcomac_tire_tburst_l1[i]) {
delete[] d->_data.input_ground->l_04_i_gdcomac_tire_tburst_l1[i];
}
}
delete[] d->_data.input_ground->l_04_i_gdcomac_tire_tburst_l1;
}
if (d->_data.input_ground->l_04_i_gdcomac_tire_tflat_l1) {
for (int i = 0; i < 3; i++) {
if (d->_data.input_ground->l_04_i_gdcomac_tire_tflat_l1[i]) {
delete[] d->_data.input_ground->l_04_i_gdcomac_tire_tflat_l1[i];
}
}
delete[] d->_data.input_ground->l_04_i_gdcomac_tire_tflat_l1;
}
if (d->_data.input_ground->l_04_i_gdcomac_rcon_ci_f8) {
delete[] d->_data.input_ground->l_04_i_gdcomac_rcon_ci_f8;
}
delete d->_data.input_ground;
}
if (d->_data.output_ground) {
if (d->_data.output_ground->l_04_o_gdcomac_fygs_f8) {
delete[] d->_data.output_ground->l_04_o_gdcomac_fygs_f8;
}
if (d->_data.output_ground->l_04_o_gdcomac_mzgs_f8) {
delete[] d->_data.output_ground->l_04_o_gdcomac_mzgs_f8;
}
if (d->_data.output_ground->l_04_o_gdcomac_mu_f8) {
delete[] d->_data.output_ground->l_04_o_gdcomac_mu_f8;
}
if (d->_data.output_ground->l_04_o_gdcomac_dstroke_f8) {
delete[] d->_data.output_ground->l_04_o_gdcomac_dstroke_f8;
}
if (d->_data.output_ground->l_04_o_gdcomac_sr_f8) {
for (int i = 0; i < 3; i++) {
if (d->_data.output_ground->l_04_o_gdcomac_sr_f8[i]) {
delete[] d->_data.output_ground->l_04_o_gdcomac_sr_f8[i];
}
}
delete[] d->_data.output_ground->l_04_o_gdcomac_sr_f8;
}
if (d->_data.output_ground->l_04_o_gdcomac_sy_f8) {
for (int i = 0; i < 3; i++) {
if (d->_data.output_ground->l_04_o_gdcomac_sy_f8[i]) {
delete[] d->_data.output_ground->l_04_o_gdcomac_sy_f8[i];
}
}
delete[] d->_data.output_ground->l_04_o_gdcomac_sy_f8;
}
if (d->_data.output_ground->l_04_o_gdcomac_sx_f8) {
for (int i = 0; i < 3; i++) {
if (d->_data.output_ground->l_04_o_gdcomac_sx_f8[i]) {
delete[] d->_data.output_ground->l_04_o_gdcomac_sx_f8[i];
}
}
delete[] d->_data.output_ground->l_04_o_gdcomac_sx_f8;
}
if (d->_data.output_ground->l_04_o_gdcomac_xft_f8) {
delete[] d->_data.output_ground->l_04_o_gdcomac_xft_f8;
}
if (d->_data.output_ground->l_04_o_gdcomac_yft_f8) {
delete[] d->_data.output_ground->l_04_o_gdcomac_yft_f8;
}
if (d->_data.output_ground->l_04_o_gdcomac_zft_f8) {
delete[] d->_data.output_ground->l_04_o_gdcomac_zft_f8;
}
if (d->_data.output_ground->l_04_o_gdcomac_tire_vel_f8) {
for (int i = 0; i < 3; i++) {
if (d->_data.output_ground->l_04_o_gdcomac_tire_vel_f8[i]) {
delete[] d->_data.output_ground->l_04_o_gdcomac_tire_vel_f8[i];
}
}
delete[] d->_data.output_ground->l_04_o_gdcomac_tire_vel_f8;
}
if (d->_data.output_ground->l_04_o_gdcomac_tire_temp_f8) {
for (int i = 0; i < 3; i++) {
if (d->_data.output_ground->l_04_o_gdcomac_tire_temp_f8[i]) {
delete[] d->_data.output_ground->l_04_o_gdcomac_tire_temp_f8[i];
}
}
delete[] d->_data.output_ground->l_04_o_gdcomac_tire_temp_f8;
}
if (d->_data.output_ground->l_04_o_gdcomac_tire_burst_l1) {
for (int i = 0; i < 3; i++) {
if (d->_data.output_ground->l_04_o_gdcomac_tire_burst_l1[i]) {
delete[] d->_data.output_ground->l_04_o_gdcomac_tire_burst_l1[i];
}
}
delete[] d->_data.output_ground->l_04_o_gdcomac_tire_burst_l1;
}
if (d->_data.output_ground->l_04_o_gdcomac_utirew_f8) {
for (int i = 0; i < 3; i++) {
if (d->_data.output_ground->l_04_o_gdcomac_utirew_f8[i]) {
delete[] d->_data.output_ground->l_04_o_gdcomac_utirew_f8[i];
}
}
delete[] d->_data.output_ground->l_04_o_gdcomac_utirew_f8;
}
if (d->_data.output_ground->l_04_o_gdcomac_vtirew_f8) {
for (int i = 0; i < 3; i++) {
if (d->_data.output_ground->l_04_o_gdcomac_vtirew_f8[i]) {
delete[] d->_data.output_ground->l_04_o_gdcomac_vtirew_f8[i];
}
}
delete[] d->_data.output_ground->l_04_o_gdcomac_vtirew_f8;
}
if (d->_data.output_ground->l_04_o_gdcomac_whl_omega_f8) {
for (int i = 0; i < 3; i++) {
if (d->_data.output_ground->l_04_o_gdcomac_whl_omega_f8[i]) {
delete[] d->_data.output_ground->l_04_o_gdcomac_whl_omega_f8[i];
}
}
delete[] d->_data.output_ground->l_04_o_gdcomac_whl_omega_f8;
}
if (d->_data.output_ground->l_04_o_gdcomac_dstruc_f8) {
delete[] d->_data.output_ground->l_04_o_gdcomac_dstruc_f8;
}
if (d->_data.output_ground->l_04_o_gdcomac_nd_f8) {
delete[] d->_data.output_ground->l_04_o_gdcomac_nd_f8;
}
if (d->_data.output_ground->l_04_o_gdcomac_wor_par_f8) {
delete[] d->_data.output_ground->l_04_o_gdcomac_wor_par_f8;
}
if (d->_data.output_ground->l_04_o_gdcomac_vczt_f8) {
for (int i = 0; i < 3; i++) {
if (d->_data.output_ground->l_04_o_gdcomac_vczt_f8[i]) {
delete[] d->_data.output_ground->l_04_o_gdcomac_vczt_f8[i];
}
}
delete[] d->_data.output_ground->l_04_o_gdcomac_vczt_f8;
}
delete d->_data.output_ground;
}
}

View File

@ -1,28 +0,0 @@
#pragma once
#include "XNGroundHandling_global.h"
#include <XNCore/XNModelObject.h>
struct XNGroundHandlingPrivate;
class XNGROUNDHANDLING_EXPORT XNGroundHandling : public XNModelObject
{
XN_METATYPE(XNGroundHandling, XNModelObject)
XN_DECLARE_PRIVATE(XNGroundHandling)
public:
XNGroundHandling();
virtual ~XNGroundHandling();
protected:
XNGroundHandling(PrivateType *p);
public:
virtual void Initialize() override;
virtual void PrepareForExecute() override;
virtual void StepUpdate() override;
protected:
void InitializeData();
void ReleaseData();
};
XNCLASS_PTR_DECLARE(XNGroundHandling)

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Model>
<Name>XNGroundHandling</Name>
<Description>ATA04地面操纵模型</Description>
<Author>Jin</Author>
<Version>1.0.0</Version>
<CreateTime>2025-02-19 16:22:17</CreateTime>
<ChangeTime>2025-02-19 16:22:19</ChangeTime>
<Node>0-0</Node>
<Priority>99</Priority>
<MathLib>ATA04_SACSCGroundHandling_2.0.143.1H_20250506/libSACSCGroundHandling.so.2.0.143.1H</MathLib>
<CommandList/>
</Model>

View File

@ -1,10 +0,0 @@
#ifndef XNGROUNDHANDLING_GLOBAL_H
#define XNGROUNDHANDLING_GLOBAL_H
#if defined(XNGROUNDHANDLING_LIBRARY)
# define XNGROUNDHANDLING_EXPORT __attribute__((visibility("default")))
#else
# define XNGROUNDHANDLING_EXPORT __attribute__((visibility("hidden")))
#endif
#endif // XNGROUNDHANDLING_GLOBAL_H

View File

@ -1,22 +0,0 @@
#pragma once
#include <XNCore/XNModelObject_p.h>
#include <DataModels/libSACSCGroundHandling_V2.0.143.1H/std_04_dll.h>
#include <C909_V1/ATA04/GroundHandling_input.hpp>
#include <C909_V1/ATA04/GroundHandling_output.hpp>
#include <C909_V1/ATA04/GroundHandling_heartbeat.hpp>
typedef void (*FunctionType)(ComacDataStructure_S *);
struct XNGroundHandlingPrivate : public XNModelObjectPrivate {
FunctionType _fun = nullptr;
ComacDataStructure_S _data;
std::string _entryPointName = "_Z29SACSCGroundHandlingEntryPointP20ComacDataStructure_S";
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

@ -1,9 +0,0 @@
{
"configurations": [
{
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"configurationProvider": "ms-vscode.cmake-tools"
}
],
"version": 4
}

View File

@ -1,63 +0,0 @@
cmake_minimum_required(VERSION 3.16)
project(XNWeightBalance LANGUAGES CXX)
set(MODEL_VERSION "1.0.0.0")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
#
if(DEFINED ENV{XNCore})
set(XNCore_PATH $ENV{XNCore})
else()
message(FATAL_ERROR "Environment variable XNCore is not set.")
endif()
# XNCore_PATH include
include_directories(${XNCore_PATH}/include)
include_directories(${XNCore_PATH}/IDL)
add_library(XNWeightBalance SHARED
XNWeightBalance_global.h
XNWeightBalance.cpp
XNWeightBalance.h
XNWeightBalance_p.h
)
set_target_properties(XNWeightBalance PROPERTIES
LIBRARY_OUTPUT_NAME "libXNWeightBalance.so.${MODEL_VERSION}"
PREFIX ""
SUFFIX ""
SKIP_BUILD_RPATH TRUE
BUILD_WITH_INSTALL_RPATH TRUE
)
target_link_libraries(XNWeightBalance PRIVATE
${XNCore_PATH}/lib/libXNCore.so
${XNCore_PATH}/lib/libC909_V1_Interface.so
dl
)
target_compile_definitions(XNWeightBalance PRIVATE XNWEIGHTBALANCE_LIBRARY)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${XNCore_PATH}/Models" CACHE PATH "Install path prefix" FORCE)
endif()
include(GNUInstallDirs)
install(TARGETS XNWeightBalance
BUNDLE DESTINATION .
LIBRARY DESTINATION .
RUNTIME DESTINATION .
)
#
file(GLOB CONFIG_FILE "*.mcfg")
# 使 install
install(FILES ${CONFIG_FILE}
DESTINATION ${CMAKE_INSTALL_PREFIX}
RENAME "XNWeightBalance_V${MODEL_VERSION}.mcfg"
)

View File

@ -1,111 +0,0 @@
#include "XNWeightBalance.h"
#include "XNWeightBalance_p.h"
#include <XNCore/XNModelManager.h>
XN_MODEL_INITIALIZE(XNWeightBalance)
XNWeightBalance::XNWeightBalance() : XNModelObject(new XNWeightBalancePrivate())
{
}
XNWeightBalance::~XNWeightBalance()
{
T_D();
// 释放输入数组内存
if (d->_data.input_weight) {
delete[] d->_data.input_weight->l_04_i_wbcomac_acset_tankfuel_f4;
delete[] d->_data.input_weight->l_04_i_wbcomac_eng_efsep_l1;
delete[] d->_data.input_weight->l_04_i_wbcomac_fuel_f8;
delete[] d->_data.input_weight->l_04_i_wbcomac_kice_f8;
delete d->_data.input_weight;
}
// 释放输出数组内存
if (d->_data.output_weight) {
delete[] d->_data.output_weight->l_04_o_wbcomac_fuel_cmd_f8;
delete[] d->_data.output_weight->l_04_o_wbcomac_ice_eng_f8;
delete d->_data.output_weight;
}
}
XNWeightBalance::XNWeightBalance(PrivateType *p) : XNModelObject(p)
{
}
void XNWeightBalance::Initialize()
{
T_D();
XNModelObject::Initialize();
if (d->_dynamicLib) {
d->_fun = (FunctionType)dlsym(d->_dynamicLib, d->_entryPointName.c_str());
if (!d->_fun) {
LOG_WARNING("Failed to resolve SACSCGroundHandlingEntry");
}
}
//add other initial code here
}
void XNWeightBalance::PrepareForExecute()
{
T_D();
XNModelObject::PrepareForExecute();
InitializeData();
d->_inputInterface.Initialize(GetFramework(), GetUniqueId(), 1);
d->_outputInterface.Initialize(GetFramework(), GetUniqueId(), 2);
d->_heartbeatInterface.Initialize(GetFramework(), GetUniqueId(), 2);
}
void XNWeightBalance::StepUpdate()
{
T_D();
XNModelObject::StepUpdate();
if (d->_fun) {
d->_inputInterface.getData(d->_data.input_weight);
d->_fun(&d->_data);
d->_outputInterface.setData(d->_data.output_weight);
d->_heartbeatInterface.setData(&d->_data);
}
}
void XNWeightBalance::InitializeData()
{
T_D();
//add your initial data code here
d->_data.input_weight = new input_weight_S();
d->_data.input_weight->l_04_i_wbcomac_acset_tankfuel_f4 = new float[20];
d->_data.input_weight->l_04_i_wbcomac_eng_efsep_l1 = new unsigned char[4];
d->_data.input_weight->l_04_i_wbcomac_fuel_f8 = new double[20];
d->_data.input_weight->l_04_i_wbcomac_kice_f8 = new double[20];
d->_data.output_weight = new output_weight_S();
d->_data.output_weight->l_04_o_wbcomac_fuel_cmd_f8 = new double[20];
d->_data.output_weight->l_04_o_wbcomac_ice_eng_f8 = new double[4];
}
void XNWeightBalance::ReleaseData()
{
T_D();
//add your release data code here
if (d->_data.input_weight) {
if (d->_data.input_weight->l_04_i_wbcomac_acset_tankfuel_f4) {
delete[] d->_data.input_weight->l_04_i_wbcomac_acset_tankfuel_f4;
}
if (d->_data.input_weight->l_04_i_wbcomac_eng_efsep_l1) {
delete[] d->_data.input_weight->l_04_i_wbcomac_eng_efsep_l1;
}
if (d->_data.input_weight->l_04_i_wbcomac_fuel_f8) {
delete[] d->_data.input_weight->l_04_i_wbcomac_fuel_f8;
}
if (d->_data.input_weight->l_04_i_wbcomac_kice_f8) {
delete[] d->_data.input_weight->l_04_i_wbcomac_kice_f8;
}
delete d->_data.input_weight;
}
if (d->_data.output_weight) {
if (d->_data.output_weight->l_04_o_wbcomac_fuel_cmd_f8) {
delete[] d->_data.output_weight->l_04_o_wbcomac_fuel_cmd_f8;
}
if (d->_data.output_weight->l_04_o_wbcomac_ice_eng_f8) {
delete[] d->_data.output_weight->l_04_o_wbcomac_ice_eng_f8;
}
}
}

View File

@ -1,28 +0,0 @@
#pragma once
#include "XNWeightBalance_global.h"
#include <XNCore/XNModelObject.h>
struct XNWeightBalancePrivate;
class XNWEIGHTBALANCE_EXPORT XNWeightBalance : public XNModelObject
{
XN_METATYPE(XNWeightBalance, XNModelObject)
XN_DECLARE_PRIVATE(XNWeightBalance)
public:
XNWeightBalance();
virtual ~XNWeightBalance();
protected:
XNWeightBalance(PrivateType *p);
public:
virtual void Initialize() override;
virtual void PrepareForExecute() override;
virtual void StepUpdate() override;
protected:
void InitializeData();
void ReleaseData();
};
XNCLASS_PTR_DECLARE(XNWeightBalance)

View File

@ -1,13 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Model>
<Name>XNWeightBalance</Name>
<Description>ATA04质量模型</Description>
<Author>Jin</Author>
<Version>1.0.0</Version>
<CreateTime>2025-02-20 09:29:18</CreateTime>
<ChangeTime>2025-02-20 09:29:20</ChangeTime>
<Node>0-0</Node>
<Priority>99</Priority>
<MathLib>ATA04_WeightBalance_2.0.14.6H_20241106/libSACSCWeightBalance.so</MathLib>
<CommandList/>
</Model>

View File

@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Project>
<Name>XNWeightBalance</Name>
<CodePath>/media/jin/E/MyCode/XNSim/XNModels/XNWeightBalance</CodePath>
<ClassName>XNWeightBalance</ClassName>
<Author>Jin</Author>
<Version>1.0.0</Version>
<Description>ATA04WeightBalance</Description>
<CreateTime>2025-02-20 09:29:18</CreateTime>
<ChangeTime>2025-02-20 09:29:20</ChangeTime>
<Node>0-0</Node>
<Priority>99</Priority>
<MathPath>ATA04_WeightBalance_2.0.14.6H_20241106/libSACSCWeightBalance.so</MathPath>
<MathHeaderPath>DataModels/libSACSCWeightBalance_V2.0.14.6H/std_04_dll.h</MathHeaderPath>
<MathEntryPoint>_Z28SACSCWeightBalanceEntryPointP20ComacDataStructure_S</MathEntryPoint>
<MathEntryParam>ComacDataStructure_S</MathEntryParam>
<CommandList/>
</Project>

View File

@ -1,10 +0,0 @@
#ifndef XNWEIGHTBALANCE_GLOBAL_H
#define XNWEIGHTBALANCE_GLOBAL_H
#if defined(XNWEIGHTBALANCE_LIBRARY)
# define XNWEIGHTBALANCE_EXPORT __attribute__((visibility("default")))
#else
# define XNWEIGHTBALANCE_EXPORT __attribute__((visibility("default")))
#endif
#endif // XNWEIGHTBALANCE_GLOBAL_H

View File

@ -1,22 +0,0 @@
#pragma once
#include <XNCore/XNModelObject_p.h>
#include "DataModels/libSACSCWeightBalance_V2.0.14.6H/std_04_dll.h"
#include <C909_V1/ATA04/WeightBalance_input.hpp>
#include <C909_V1/ATA04/WeightBalance_output.hpp>
#include <C909_V1/ATA04/WeightBalance_heartbeat.hpp>
typedef void (*FunctionType)(ComacDataStructure_S *);
struct XNWeightBalancePrivate : public XNModelObjectPrivate {
FunctionType _fun = nullptr;
ComacDataStructure_S _data;
std::string _entryPointName = "_Z28SACSCWeightBalanceEntryPointP20ComacDataStructure_S";
std::mutex _mutex;
XNSim::C909::ATA04::WeightBalance_input_Interface _inputInterface;
XNSim::C909::ATA04::WeightBalance_output_Interface _outputInterface;
XNSim::C909::ATA04::WeightBalance_heartbeat_Interface _heartbeatInterface;
};