更新:1、升级编译器版本至MSVC2022,升级C++至C++17;
Signed-off-by: waiwaylee <waiwaylee@foxmail.com>
This commit is contained in:
Vendored
+10
-10
@@ -2,10 +2,10 @@
|
||||
"version": 4,
|
||||
"configurations": [
|
||||
{
|
||||
"compilerPath": "D:\\APP\\VisualStudio2013\\VC\\bin\\cl.exe",
|
||||
"cStandard": "c11",
|
||||
"cppStandard": "c++11",
|
||||
"intelliSenseMode": "windows-msvc-x86",
|
||||
"compilerPath": "D:\\APP\\VisualStudio2022\\VC\\Tools\\MSVC\\14.44.35207\\bin\\Hostx64\\x64\\cl.exe",
|
||||
"cStandard": "c17",
|
||||
"cppStandard": "c++17",
|
||||
"intelliSenseMode": "windows-msvc-x64",
|
||||
"defines": [
|
||||
"WIN32",
|
||||
"_WINDOWS",
|
||||
@@ -20,14 +20,14 @@
|
||||
"${workspaceFolder}/data_process_class_dll/Eigen",
|
||||
"${workspaceFolder}/**"
|
||||
],
|
||||
"name": "X256_PS (MSVC2013 x86)",
|
||||
"name": "X256_PS (MSVC2022 x64)",
|
||||
"compileCommands": "${workspaceFolder}/build/X256_PS/compile_commands.json"
|
||||
},
|
||||
{
|
||||
"compilerPath": "D:\\APP\\VisualStudio2013\\VC\\bin\\cl.exe",
|
||||
"cStandard": "c11",
|
||||
"cppStandard": "c++11",
|
||||
"intelliSenseMode": "windows-msvc-x86",
|
||||
"compilerPath": "D:\\APP\\VisualStudio2022\\VC\\Tools\\MSVC\\14.44.35207\\bin\\Hostx64\\x64\\cl.exe",
|
||||
"cStandard": "c17",
|
||||
"cppStandard": "c++17",
|
||||
"intelliSenseMode": "windows-msvc-x64",
|
||||
"defines": [
|
||||
"WIN32",
|
||||
"_WINDOWS",
|
||||
@@ -42,7 +42,7 @@
|
||||
"${workspaceFolder}/data_process_class_dll/Eigen",
|
||||
"${workspaceFolder}/**"
|
||||
],
|
||||
"name": "X256_MS (MSVC2013 x86)",
|
||||
"name": "X256_MS (MSVC2022 x64)",
|
||||
"compileCommands": "${workspaceFolder}/build/X256_MS/compile_commands.json"
|
||||
}
|
||||
]
|
||||
|
||||
Vendored
+2
-2
@@ -3,11 +3,11 @@ buildType:
|
||||
choices:
|
||||
release:
|
||||
short: Release
|
||||
long: Release (MSVC2013 x86)
|
||||
long: Release (MSVC2022 x64, C++17)
|
||||
buildType: Release
|
||||
debug:
|
||||
short: Debug
|
||||
long: Debug (MSVC2013 x86)
|
||||
long: Debug (MSVC2022 x64, C++17)
|
||||
buildType: Debug
|
||||
|
||||
scanMode:
|
||||
|
||||
Vendored
+12
-1
@@ -1,11 +1,22 @@
|
||||
@echo off
|
||||
rem ===========================================================================
|
||||
rem CMake build script (MSVC 2022 / v143, C++17, x64)
|
||||
rem
|
||||
rem Usage: build.bat <build-dir>
|
||||
rem e.g. build.bat build\X256_PS
|
||||
rem
|
||||
rem Encoding: keep this file ASCII-only (see msvc_env.bat).
|
||||
rem ===========================================================================
|
||||
setlocal
|
||||
set "BUILD_DIR=%~1"
|
||||
if "%BUILD_DIR%"=="" (
|
||||
echo Usage: build.bat ^<build-dir^>
|
||||
exit /b 1
|
||||
)
|
||||
call D:\APP\VisualStudio2013\VC\vcvarsall.bat x86 >nul
|
||||
|
||||
rem Load the MSVC 2022 environment (vcvarsall.bat + cl.exe existence check).
|
||||
call "%~dp0msvc_env.bat"
|
||||
if errorlevel 1 exit /b %errorlevel%
|
||||
|
||||
cmake --build "%BUILD_DIR%"
|
||||
exit /b %errorlevel%
|
||||
|
||||
Vendored
+12
-1
@@ -1,11 +1,22 @@
|
||||
@echo off
|
||||
rem ===========================================================================
|
||||
rem CMake clean script (MSVC 2022 / v143, C++17, x64)
|
||||
rem
|
||||
rem Usage: clean.bat <build-dir>
|
||||
rem e.g. clean.bat build\X256_PS
|
||||
rem
|
||||
rem Encoding: keep this file ASCII-only (see msvc_env.bat).
|
||||
rem ===========================================================================
|
||||
setlocal
|
||||
set "BUILD_DIR=%~1"
|
||||
if "%BUILD_DIR%"=="" (
|
||||
echo Usage: clean.bat ^<build-dir^>
|
||||
exit /b 1
|
||||
)
|
||||
call D:\APP\VisualStudio2013\VC\vcvarsall.bat x86 >nul
|
||||
|
||||
rem Load the MSVC 2022 environment (vcvarsall.bat + cl.exe existence check).
|
||||
call "%~dp0msvc_env.bat"
|
||||
if errorlevel 1 exit /b %errorlevel%
|
||||
|
||||
cmake --build "%BUILD_DIR%" --target clean
|
||||
exit /b %errorlevel%
|
||||
|
||||
Vendored
+45
-3
@@ -1,4 +1,19 @@
|
||||
@echo off
|
||||
rem ===========================================================================
|
||||
rem CMake configure script (MSVC 2022 / v143, C++17, x64)
|
||||
rem
|
||||
rem Usage: configure.bat <build-dir> <PHASE_SCANNING^|MECHANICAL_SCANNING> [Debug^|Release]
|
||||
rem e.g. configure.bat build\X256_PS PHASE_SCANNING Release
|
||||
rem
|
||||
rem The generator stays "NMake Makefiles" (the choice made during the VS Code
|
||||
rem migration); cl.exe is pinned to the MSVC 2022 x64 toolset.
|
||||
rem
|
||||
rem A build directory that was configured by an older compiler (for example the
|
||||
rem MSVC 2013 cache) is removed first: neither its CMake cache nor its object
|
||||
rem files can be reused across a compiler upgrade.
|
||||
rem
|
||||
rem Encoding: keep this file ASCII-only (see msvc_env.bat).
|
||||
rem ===========================================================================
|
||||
setlocal
|
||||
set "BUILD_DIR=%~1"
|
||||
set "SCAN_MODE=%~2"
|
||||
@@ -12,10 +27,37 @@ if "%SCAN_MODE%"=="" (
|
||||
exit /b 1
|
||||
)
|
||||
if "%BUILD_TYPE%"=="" set "BUILD_TYPE=Release"
|
||||
call D:\APP\VisualStudio2013\VC\vcvarsall.bat x86 >nul
|
||||
|
||||
rem Load the MSVC 2022 environment (vcvarsall.bat + cl.exe existence check).
|
||||
call "%~dp0msvc_env.bat"
|
||||
if errorlevel 1 exit /b %errorlevel%
|
||||
|
||||
rem Drop a build tree left behind by another toolset.
|
||||
if not exist "%BUILD_DIR%\CMakeCache.txt" goto :configure
|
||||
set "OLD_TOOLSET="
|
||||
if exist "%BUILD_DIR%\.msvc_toolset" set /p OLD_TOOLSET=<"%BUILD_DIR%\.msvc_toolset"
|
||||
if /i "%OLD_TOOLSET%"=="%MSVC_TOOLSET_VERSION%" goto :configure
|
||||
echo [configure] "%BUILD_DIR%" was configured with MSVC toolset "%OLD_TOOLSET%" - rebuilding from scratch
|
||||
rmdir /s /q "%BUILD_DIR%"
|
||||
if exist "%BUILD_DIR%" (
|
||||
echo [ERROR] cannot remove "%BUILD_DIR%", please delete it manually and retry.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
:configure
|
||||
echo [configure] compiler : %MSVC_CXX_COMPILER%
|
||||
echo [configure] build dir: %BUILD_DIR%
|
||||
echo [configure] mode : %SCAN_MODE% / %BUILD_TYPE%
|
||||
|
||||
pushd "%~dp0..\.."
|
||||
cmake -S . -B "%BUILD_DIR%" -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=%BUILD_TYPE% -DRADAR_SCAN_MODE=%SCAN_MODE%
|
||||
cmake -S . -B "%BUILD_DIR%" -G "NMake Makefiles" ^
|
||||
-DCMAKE_BUILD_TYPE=%BUILD_TYPE% ^
|
||||
-DRADAR_SCAN_MODE=%SCAN_MODE% ^
|
||||
-DCMAKE_CXX_COMPILER="%MSVC_CXX_COMPILER%"
|
||||
set "CMAKE_EXIT=%errorlevel%"
|
||||
popd
|
||||
exit /b %CMAKE_EXIT%
|
||||
if not "%CMAKE_EXIT%"=="0" exit /b %CMAKE_EXIT%
|
||||
|
||||
rem Remember which toolset produced this build tree (checked on the next run).
|
||||
> "%BUILD_DIR%\.msvc_toolset" echo %MSVC_TOOLSET_VERSION%
|
||||
exit /b 0
|
||||
|
||||
Vendored
+50
@@ -0,0 +1,50 @@
|
||||
@echo off
|
||||
rem ===========================================================================
|
||||
rem Shared MSVC 2022 (v143) environment setup.
|
||||
rem
|
||||
rem Called by configure.bat / build.bat / clean.bat. It:
|
||||
rem 1) locates the MSVC 2022 toolset and cl.exe (default Hostx64\x64);
|
||||
rem 2) calls vcvarsall.bat to set PATH / INCLUDE / LIB (nmake comes with it).
|
||||
rem
|
||||
rem NOTE: this script does NOT use setlocal, so the variables it defines stay
|
||||
rem in the caller's environment (all callers run under setlocal).
|
||||
rem
|
||||
rem Override the defaults with these environment variables:
|
||||
rem VS2022_DIR Visual Studio 2022 install root
|
||||
rem MSVC_TOOLSET_VERSION MSVC toolset version
|
||||
rem MSVC_HOST_ARCH compiler host architecture (x64 / x86)
|
||||
rem MSVC_TARGET_ARCH target architecture (x64 / x86)
|
||||
rem
|
||||
rem Exit code: 0 = ok, non-zero = setup failed (caller must abort).
|
||||
rem
|
||||
rem Encoding: keep this file ASCII-only (cmd.exe parses .bat in the OEM code
|
||||
rem page, UTF-8 comments would break parsing on non-UTF-8 consoles).
|
||||
rem ===========================================================================
|
||||
|
||||
if not defined VS2022_DIR set "VS2022_DIR=D:\APP\VisualStudio2022"
|
||||
if not defined MSVC_TOOLSET_VERSION set "MSVC_TOOLSET_VERSION=14.44.35207"
|
||||
if not defined MSVC_HOST_ARCH set "MSVC_HOST_ARCH=x64"
|
||||
if not defined MSVC_TARGET_ARCH set "MSVC_TARGET_ARCH=x64"
|
||||
|
||||
set "MSVC_TOOLSET_DIR=%VS2022_DIR%\VC\Tools\MSVC\%MSVC_TOOLSET_VERSION%"
|
||||
set "MSVC_CXX_COMPILER=%MSVC_TOOLSET_DIR%\bin\Host%MSVC_HOST_ARCH%\%MSVC_TARGET_ARCH%\cl.exe"
|
||||
set "VCVARS_BAT=%VS2022_DIR%\VC\Auxiliary\Build\vcvarsall.bat"
|
||||
|
||||
if not exist "%VCVARS_BAT%" (
|
||||
echo [ERROR] vcvarsall.bat not found: "%VCVARS_BAT%"
|
||||
echo Please set VS2022_DIR to the Visual Studio 2022 install root.
|
||||
exit /b 1
|
||||
)
|
||||
if not exist "%MSVC_CXX_COMPILER%" (
|
||||
echo [ERROR] cl.exe not found: "%MSVC_CXX_COMPILER%"
|
||||
echo Please check MSVC_TOOLSET_VERSION / MSVC_HOST_ARCH / MSVC_TARGET_ARCH.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
call "%VCVARS_BAT%" %MSVC_TARGET_ARCH% >nul
|
||||
if errorlevel 1 (
|
||||
echo [ERROR] "vcvarsall.bat %MSVC_TARGET_ARCH%" failed.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
exit /b 0
|
||||
Vendored
+8
-4
@@ -2,11 +2,15 @@
|
||||
"cmake.configureOnOpen": false,
|
||||
"cmake.generator": "NMake Makefiles",
|
||||
"cmake.buildDirectory": "${workspaceFolder}/build/X256_PS",
|
||||
"cmake.configureArgs": [
|
||||
"-DCMAKE_CXX_COMPILER=D:/APP/VisualStudio2022/VC/Tools/MSVC/14.44.35207/bin/Hostx64/x64/cl.exe"
|
||||
],
|
||||
"cmake.environment": {
|
||||
"PATH": "D:\\APP\\VisualStudio2013\\VC\\BIN;D:\\APP\\VisualStudio2013\\Common7\\IDE;C:\\Program Files (x86)\\Windows Kits\\8.1\\bin\\x86;${env:PATH}",
|
||||
"INCLUDE": "D:\\APP\\VisualStudio2013\\VC\\INCLUDE;D:\\APP\\VisualStudio2013\\VC\\ATLMFC\\INCLUDE;C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\shared;C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\um;C:\\Program Files (x86)\\Windows Kits\\8.1\\include\\winrt;${env:INCLUDE}",
|
||||
"LIB": "D:\\APP\\VisualStudio2013\\VC\\LIB;D:\\APP\\VisualStudio2013\\VC\\ATLMFC\\LIB;C:\\Program Files (x86)\\Windows Kits\\8.1\\lib\\winv6.3\\um\\x86;${env:LIB}"
|
||||
"PATH": "D:\\APP\\VisualStudio2022\\VC\\Tools\\MSVC\\14.44.35207\\bin\\Hostx64\\x64;${env:PATH}",
|
||||
"INCLUDE": "D:\\APP\\VisualStudio2022\\VC\\Tools\\MSVC\\14.44.35207\\include;D:\\APP\\VisualStudio2022\\VC\\Tools\\MSVC\\14.44.35207\\ATLMFC\\include;D:\\APP\\VisualStudio2022\\VC\\Auxiliary\\VS\\include;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.26100.0\\ucrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.26100.0\\um;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.26100.0\\shared;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.26100.0\\winrt;C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.26100.0\\cppwinrt;${env:INCLUDE}",
|
||||
"LIB": "D:\\APP\\VisualStudio2022\\VC\\Tools\\MSVC\\14.44.35207\\ATLMFC\\lib\\x64;D:\\APP\\VisualStudio2022\\VC\\Tools\\MSVC\\14.44.35207\\lib\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.26100.0\\ucrt\\x64;C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.26100.0\\um\\x64;${env:LIB}"
|
||||
},
|
||||
"C_Cpp.default.cppStandard": "c++11",
|
||||
"C_Cpp.default.cppStandard": "c++17",
|
||||
"C_Cpp.default.intelliSenseMode": "windows-msvc-x64",
|
||||
"C_Cpp.default.compileCommands": "${workspaceFolder}/build/X256_PS/compile_commands.json"
|
||||
}
|
||||
|
||||
Vendored
+8
-8
@@ -5,7 +5,7 @@
|
||||
},
|
||||
"tasks": [
|
||||
{
|
||||
"label": "CMake: 配置 X256_PS (Release, MSVC2013 x86)",
|
||||
"label": "CMake: 配置 X256_PS (Release, MSVC2022 x64)",
|
||||
"type": "shell",
|
||||
"command": "${workspaceFolder}\\.vscode\\scripts\\configure.bat",
|
||||
"args": [
|
||||
@@ -16,7 +16,7 @@
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "CMake: 配置 X256_PS (Debug, MSVC2013 x86)",
|
||||
"label": "CMake: 配置 X256_PS (Debug, MSVC2022 x64)",
|
||||
"type": "shell",
|
||||
"command": "${workspaceFolder}\\.vscode\\scripts\\configure.bat",
|
||||
"args": [
|
||||
@@ -60,7 +60,7 @@
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "CMake: 配置 X256_MS (Release, MSVC2013 x86)",
|
||||
"label": "CMake: 配置 X256_MS (Release, MSVC2022 x64)",
|
||||
"type": "shell",
|
||||
"command": "${workspaceFolder}\\.vscode\\scripts\\configure.bat",
|
||||
"args": [
|
||||
@@ -71,7 +71,7 @@
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "CMake: 配置 X256_MS (Debug, MSVC2013 x86)",
|
||||
"label": "CMake: 配置 X256_MS (Debug, MSVC2022 x64)",
|
||||
"type": "shell",
|
||||
"command": "${workspaceFolder}\\.vscode\\scripts\\configure.bat",
|
||||
"args": [
|
||||
@@ -118,7 +118,7 @@
|
||||
"label": "CMake: 配置并构建 X256_PS (Release)",
|
||||
"dependsOrder": "sequence",
|
||||
"dependsOn": [
|
||||
"CMake: 配置 X256_PS (Release, MSVC2013 x86)",
|
||||
"CMake: 配置 X256_PS (Release, MSVC2022 x64)",
|
||||
"CMake: 构建 X256_PS (Release)"
|
||||
],
|
||||
"group": {
|
||||
@@ -131,7 +131,7 @@
|
||||
"label": "CMake: 配置并构建 X256_PS (Debug)",
|
||||
"dependsOrder": "sequence",
|
||||
"dependsOn": [
|
||||
"CMake: 配置 X256_PS (Debug, MSVC2013 x86)",
|
||||
"CMake: 配置 X256_PS (Debug, MSVC2022 x64)",
|
||||
"CMake: 构建 X256_PS (Debug)"
|
||||
],
|
||||
"group": "build",
|
||||
@@ -141,7 +141,7 @@
|
||||
"label": "CMake: 配置并构建 X256_MS (Release)",
|
||||
"dependsOrder": "sequence",
|
||||
"dependsOn": [
|
||||
"CMake: 配置 X256_MS (Release, MSVC2013 x86)",
|
||||
"CMake: 配置 X256_MS (Release, MSVC2022 x64)",
|
||||
"CMake: 构建 X256_MS (Release)"
|
||||
],
|
||||
"group": "build",
|
||||
@@ -151,7 +151,7 @@
|
||||
"label": "CMake: 配置并构建 X256_MS (Debug)",
|
||||
"dependsOrder": "sequence",
|
||||
"dependsOn": [
|
||||
"CMake: 配置 X256_MS (Debug, MSVC2013 x86)",
|
||||
"CMake: 配置 X256_MS (Debug, MSVC2022 x64)",
|
||||
"CMake: 构建 X256_MS (Debug)"
|
||||
],
|
||||
"group": "build",
|
||||
|
||||
@@ -56,6 +56,12 @@
|
||||
- 「靠近/远离」方向标志 `Flag_Direction` 改为按滤波速度矢量判定(fc49707 引入、42b598e 调整,`track_asso.cpp` 与 `track_asso_tas.cpp` 同步):不再使用受多普勒速度模糊影响、符号可能取反的实测径向速度(原 `Flag_Direction = vr_point > 0 ? 1 : 0`),改为用航迹 IMM 融合状态的速度方向角 `Direction_Angle = atan2(X[4], X[1])` 与位置矢量判定:`acos((-x·cos(Direction_Angle) − y·sin(Direction_Angle)) / r) < π/2` 时置 1(靠近),否则 0(远离),其中 `x`/`y` 为经 `Sys_delay` 补偿后的位置、`r` 为其模。该判据等价于「滤波速度矢量的径向分量指向雷达(径向接近)即判为靠近」;中间版本曾按合速度归一化并把门限取为 π/4(45° 锥角),42b598e 去掉归一化并把门限放宽到 π/2(90°)。
|
||||
- 手动操作接口遍历命中目标后立即 `break`(fc49707,`data_process.cpp`):`primary_target_add` / `primary_target_cancel` / `tracking_start` / `tracking_stop` 在写入标志后退出循环,不再继续扫描整张航迹表(批号唯一,结果等价)。
|
||||
- `requirements.md` 由 `archived_docs/` 移回仓库根目录(工作区改动,文件内容未变):README 目录结构(第 3 节)与参考文档表(第 13 节)中的引用路径同步改回 `requirements.md`。
|
||||
- **构建工具链升级:编译器由 Microsoft Visual C++ 2013(Visual Studio 12,`_MSC_VER` 1800,x86)升级为 Microsoft Visual C++ 2022(v143 工具集,`_MSC_VER` 1944,cl 19.44.35228,x64),C++ 标准由 C++11 提升为 C++17**。`CMakeLists.txt` 的 `cmake_minimum_required` 由 3.10 提升到 3.21(VS2022 生成器自 3.21 起支持),新增 `CMAKE_CXX_STANDARD 17`(含 `CMAKE_CXX_STANDARD_REQUIRED ON`)与「必须使用 MSVC 2022(`_MSC_VER >= 1930`)」的配置期强校验(不满足直接 `FATAL_ERROR`),并在配置阶段打印实际编译器路径、`_MSC_VER` 与所选 C++ 标准。
|
||||
- `CMakeLists.txt` 编译选项调整:`/utf-8` 由「MSVC >= 1900 条件追加」改为对 MSVC 无条件启用;新增 `/Zc:__cplusplus`(MSVC 默认把 `__cplusplus` 报为 `199711L`,加该选项后正确报 `201703L`,使依赖该宏判断的第三方库——内置 Eigen 3.3.7——走标准分支);显式追加 `/W3`(CMake 3.15 起策略 CMP0092 不再把 `/W3` 放入 `CMAKE_CXX_FLAGS`,显式恢复以保持原有警告级别);`/Zc:wchar_t`、`/FS` 与 Release 专用的 `/Zc:strictStrings` 保持不变。
|
||||
- **全部构建脚本改为 MSVC 2022**:新增 `.vscode/scripts/msvc_env.bat`(定位 VS2022 工具集与 `cl.exe`、校验路径存在后调用 `vcvarsall.bat x64`,可用 `VS2022_DIR` / `MSVC_TOOLSET_VERSION` / `MSVC_HOST_ARCH` / `MSVC_TARGET_ARCH` 环境变量覆盖默认值),`configure.bat` / `build.bat` / `clean.bat` 统一改为调用该脚本并显式传入 `-DCMAKE_CXX_COMPILER`;四个脚本一律保持**纯 ASCII 编码**(cmd.exe 按 OEM 代码页解析 .bat,中文注释会破坏其解析)。
|
||||
- `configure.bat` 新增「旧工具集构建树自动清理」:构建目录存在 `CMakeCache.txt` 但缺少 `.msvc_toolset` 标记(或标记与当前工具集版本不一致)时,先整体删除该目录再重新配置。原因是 MSVC 2013 的 CMake 缓存与目标文件不能跨编译器复用——nmake 仅按时间戳判断,会把旧目标文件当作最新而跳过重编译,导致新旧工具集目标文件混链。
|
||||
- VS Code 工程配置同步为 MSVC 2022 x64 + C++17:`settings.json` 的 `cmake.environment` 改为 VS2022 v143 x64 与 Windows SDK 10.0.26100.0 的 `PATH`/`INCLUDE`/`LIB`,新增 `cmake.configureArgs` 固定 `cl.exe` 路径,`C_Cpp.default.cppStandard` 改为 `c++17` 并新增 `C_Cpp.default.intelliSenseMode`;`c_cpp_properties.json` 的 `compilerPath` 指向新 `cl.exe`、`intelliSenseMode` 改为 `windows-msvc-x64`、配置名改为「X256_PS/X256_MS (MSVC2022 x64)」;`cmake-variants.yaml` 与 `tasks.json` 的变体/任务描述同步为 MSVC2022 x64。
|
||||
- 产物架构由 x86 变为 **x64(AMD64)**:宿主程序必须为 64 位、并使用同一版本头文件重新编译后才能加载新 DLL(`rdp_playback.exe` 回放工具同样需升级为 x64 版本)。
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -63,6 +69,7 @@
|
||||
- 修复 `TAS_Ctrl::tas_beam_output()` 把航迹向量下标 `earliest_track_idx` 误赋给 `Tracking_beam->TAS_track_index` 的问题(1521592):现输出实际航迹号 `(*trust_track)[earliest_track_idx].Track_Index`,避免跟踪波束批号与目标不符。
|
||||
- 修正 README.md(第 2、5.2、8.1、8.3、9.3、13 节)与 `docs/data_process_flow_report.md`(第 0、1、6.1~6.4 节、附录)中航迹起始的步骤顺序描述(纯文档勘误,无代码改动):两份文档原写作「航迹头(1 点)→ 点-航迹头关联(2 点)→ 点-临时航迹关联(≥3 点)→ 起批」,与 `track_init.cpp`(L49-126)每圈的实际执行顺序相反;现更正为「① 点迹先与 ≥2 点临时航迹关联(延长已有临时航迹)→ ② 再与 1 点航迹头关联(两点卡尔曼初始化出 2 点临时航迹)→ ③ 两个阶段都结束后统一删除被消费(`Use_Flag==1`)的点迹、剩余点迹逐条转为新航迹头 → ④ 长度达标的临时航迹经三点卡尔曼初始化转为可靠航迹」,并同步修正流程图与状态机;另补充两点此前的描述缺失:两个关联阶段互不排斥(航迹头阶段不检查临时航迹阶段留下的 `Use_Flag`,同一点迹可同时延长一条临时航迹并开启一条 2 点临时航迹)、两类关联都不做一对一分配(同一条临时航迹可被同圈多个点延长)。
|
||||
- 修复速度模糊时「向站/背站」判断有误的问题(fc49707、42b598e):`Flag_Direction` 不再由受多普勒模糊影响、符号可能取反的实测径向速度 `vr_point` 决定,改为按航迹滤波速度矢量与雷达视线的几何关系判定(判据见 Changed),TWS、TAS 两通道行为一致。
|
||||
- 修复升级到 MSVC 2022 后在 `/W3` 下新增报出的 **17 处 C4267**(`size_t` → `int` 窄化,可能丢失数据)告警:`track_asso.cpp`(7 处)、`track_init.cpp`(5 处)、`track_init_direct_tracking.cpp`(4 处)、`track_asso_tas.cpp`(1 处)、`tas_ctrl.cpp`(1 处)按项目既有约定改为 `static_cast<int>(...)` 显式转换,不改变任何计算逻辑、对外接口与结构体布局;被编辑的源文件均已恢复「带 BOM 的 UTF-8」编码,与仓库其余文件保持一致。修复后 X256_PS/X256_MS × Release/Debug 四种配置均为 **0 warning、0 error**。
|
||||
|
||||
### Removed
|
||||
|
||||
|
||||
+53
-15
@@ -1,8 +1,13 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
cmake_minimum_required(VERSION 3.21)
|
||||
|
||||
# 雷达数据处理动态链接库
|
||||
# 开发环境已由 Qt/qmake 迁移到 VS Code + CMake。
|
||||
# 编译器保持为 Microsoft Visual C++ Compiler 12.0 (x86)。
|
||||
# 编译器已由 Microsoft Visual C++ Compiler 12.0 (VS2013) 升级为
|
||||
# Microsoft Visual C++ Compiler 2022(v143 工具集,_MSC_VER 19.4x,x64)。
|
||||
# 语言标准同步提升为 C++17。
|
||||
#
|
||||
# 注意:VS2022 生成器("Visual Studio 17 2022")需要 CMake >= 3.21,
|
||||
# 因此本工程的最低 CMake 版本随之提高;NMake/Ninja 生成器同样满足。
|
||||
project(data_process_class_dll LANGUAGES CXX)
|
||||
|
||||
# 扫描模式:
|
||||
@@ -16,6 +21,33 @@ if(NOT RADAR_SCAN_MODE STREQUAL "PHASE_SCANNING" AND NOT RADAR_SCAN_MODE STREQUA
|
||||
message(FATAL_ERROR "RADAR_SCAN_MODE 必须为 PHASE_SCANNING 或 MECHANICAL_SCANNING,当前值:${RADAR_SCAN_MODE}")
|
||||
endif()
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# 语言标准:C++17
|
||||
# ---------------------------------------------------------------------------
|
||||
# CMAKE_CXX_STANDARD 由 CMake 转换为 MSVC 的 /std:c++17(CMake >= 3.10 起支持)。
|
||||
# CMAKE_CXX_EXTENSIONS OFF 在 MSVC 下没有对应开关(只影响 GCC/Clang 的 -std=gnu++xx),
|
||||
# 保留它是为了在换用其它编译器时同样不启用语言扩展。
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# 编译器约束:必须使用 MSVC 2022(v143,_MSC_VER >= 1930)
|
||||
# ---------------------------------------------------------------------------
|
||||
if(NOT MSVC)
|
||||
message(FATAL_ERROR "本工程仅支持 MSVC (cl.exe) 编译器,当前编译器:${CMAKE_CXX_COMPILER_ID}")
|
||||
endif()
|
||||
|
||||
if(MSVC_VERSION LESS 1930)
|
||||
message(FATAL_ERROR
|
||||
"本工程要求 MSVC 2022 (v143) 及以上版本(_MSC_VER >= 1930),"
|
||||
"当前 _MSC_VER=${MSVC_VERSION}(编译器:${CMAKE_CXX_COMPILER})。\n"
|
||||
"请先运行 VS2022 的 vcvarsall.bat x64(见 .vscode/scripts/msvc_env.bat)后再配置。")
|
||||
endif()
|
||||
|
||||
message(STATUS "编译器:${CMAKE_CXX_COMPILER}(MSVC _MSC_VER=${MSVC_VERSION})")
|
||||
message(STATUS "C++ 标准:C++${CMAKE_CXX_STANDARD}")
|
||||
|
||||
# 导出编译命令,便于 VS Code C/C++ 插件 IntelliSense 使用。
|
||||
# Visual Studio 生成器不支持该选项,因此仅对 Makefile/Ninja 生成器开启。
|
||||
if(NOT CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||
@@ -69,25 +101,31 @@ target_include_directories(data_process_class_dll PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/data_process_class_dll
|
||||
)
|
||||
|
||||
# 原工程使用 MSVC 2013(Visual Studio 12)编译器;保持兼容,不强制更高 C++ 标准。
|
||||
# 源码使用 C++11 特性(nullptr、类内成员初始化等),MSVC 2013 默认即可支持。
|
||||
|
||||
if(MSVC)
|
||||
# 与原 qmake 生成的编译选项保持一致。
|
||||
# 注意:MSVC 2013 的 Debug 运行库与 /Zc:strictStrings 同时使用会触发 STL 编译错误,
|
||||
# 原 qmake 工程也仅在 Release 配置中使用该选项。
|
||||
target_compile_options(data_process_class_dll PRIVATE
|
||||
# 显式恢复 /W3 警告级别。
|
||||
# CMake 3.15(策略 CMP0092)起不再把 /W3 放进 CMAKE_CXX_FLAGS,
|
||||
# 而本工程此前(cmake_minimum_required 3.10)一直以 /W3 构建,
|
||||
# README 4.5 记录的全部 C4819/C4018/C4244 告警清理也基于该级别,
|
||||
# 因此这里显式指定,保持警告级别不变。
|
||||
/W3
|
||||
# MSVC 2022 完整支持 /utf-8(VS2015 Update 2 起),
|
||||
# 源码本身为 UTF-8 with BOM,显式指定后中文字符串/注释不再受系统代码页影响(消除 C4819)。
|
||||
/utf-8
|
||||
# 让 __cplusplus 正确报告 201703L(MSVC 默认始终为 199711L)。
|
||||
# C++17 下依赖 __cplusplus 判断的第三方库(Eigen 3.3.7 等)据此走标准分支。
|
||||
/Zc:__cplusplus
|
||||
/Zc:wchar_t
|
||||
# NMake 生成器下并行/增量编译时统一 PDB 写入。
|
||||
/FS
|
||||
$<$<CONFIG:Release>:/Zc:strictStrings>
|
||||
)
|
||||
|
||||
# 修复 C4819(源文件含当前代码页无法表示的字符)。
|
||||
# /utf-8 从 VS2015 Update 2 开始支持;本工程使用 MSVC 2013 时无该选项,
|
||||
# 通过为源码文件添加 UTF-8 BOM 解决 C4819,这里仅对支持 /utf-8 的新版 MSVC 开启。
|
||||
if(MSVC_VERSION GREATER_EQUAL 1900)
|
||||
target_compile_options(data_process_class_dll PRIVATE /utf-8)
|
||||
endif()
|
||||
# 与原 qmake 生成的编译选项保持一致:Release 配置额外开启严格字符串字面量检查。
|
||||
# (原 MSVC 2013 因 Debug 运行库与 /Zc:strictStrings 冲突而仅限 Release,
|
||||
# 升级到 MSVC 2022 后该限制已不存在,此处仍沿用“仅 Release”以保持行为不变。)
|
||||
target_compile_options(data_process_class_dll PRIVATE
|
||||
$<$<CONFIG:Release>:/Zc:strictStrings>
|
||||
)
|
||||
endif()
|
||||
|
||||
# 输出目录:build/bin 下为 DLL/PDB,build/lib 下为导入库。
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# 雷达数据处理 DLL(data_process_class_dll)
|
||||
|
||||
> X256 雷达数据处理动态链接库:将雷达输出的原始点迹(TWS/TAS)处理为稳定可靠的目标航迹,并给出 TAS 跟踪波束控制指令。
|
||||
> 仓库 simianzhen256-v1.5.5-ms-vscode(上游 simianzhen256,v1.5.5;已由 Qt/qmake 工程迁移为 VS Code + CMake 工程)。
|
||||
> 仓库 simianzhen256-v1.5.5-ms-vscode(上游 simianzhen256,v1.5.5;已由 Qt/qmake 工程迁移为 VS Code + CMake 工程,编译器为 MSVC 2022 / v143,C++17,x64 目标)。
|
||||
|
||||
---
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
- 航迹外推、消亡与航迹号管理
|
||||
- TAS 手动转跟踪与跟踪波束调度输出
|
||||
|
||||
**技术栈**:C++(MSVC 2013 兼容,C++11 特性)、Eigen 3(随仓库内置,仅用 Eigen/Dense)、CMake ≥ 3.10。
|
||||
**技术栈**:C++(MSVC 2022 / v143 工具集,C++17)、Eigen 3(随仓库内置,仅用 Eigen/Dense)、CMake ≥ 3.21。
|
||||
|
||||
**处理约定**:
|
||||
|
||||
@@ -82,10 +82,14 @@
|
||||
│ └── track_init_readme.md # 航迹起始(Track Init)详细逻辑说明(阶段流程、条件汇总、输出字段映射、风险点、代码索引)
|
||||
├── design_docs/ # 设计与讨论资料留档(被 .gitignore 忽略、不入库;含设计讨论、产品介绍与 README/流程报告的导出、渲染版本)
|
||||
├── .vscode/ # VS Code 工程配置
|
||||
│ ├── settings.json # cmake.generator=NMake、MSVC2013 x86 环境变量、compile_commands
|
||||
│ ├── settings.json # cmake.generator=NMake、MSVC2022 x64 环境变量、compile_commands
|
||||
│ ├── cmake-variants.yaml # X256_PS / X256_MS × Release / Debug 变体
|
||||
│ ├── tasks.json # 配置/构建/清理任务
|
||||
│ └── scripts/{configure,build,clean}.bat
|
||||
│ ├── tasks.json # 配置/构建/清理任务(MSVC2022 x64)
|
||||
│ └── scripts/ # 构建脚本(纯 ASCII,避免 cmd 代码页问题)
|
||||
│ ├── msvc_env.bat # 共享环境设置:定位 VS2022/cl.exe 并调用 vcvarsall.bat(x64)
|
||||
│ ├── configure.bat # CMake 配置(含旧工具集构建树自动清理)
|
||||
│ ├── build.bat # CMake 构建
|
||||
│ └── clean.bat # CMake 清理
|
||||
├── backup/
|
||||
│ └── data_process_class_dll/
|
||||
│ ├── data_process_class_dll.pro # 迁移前的 Qt/qmake 工程文件(备份)
|
||||
@@ -128,9 +132,10 @@
|
||||
|
||||
| 组件 | 要求 |
|
||||
|---|---|
|
||||
| 操作系统 | Windows(构建脚本按 D:\APP\VisualStudio2013 与 Windows Kits 8.1 路径配置) |
|
||||
| 编译器 | Microsoft Visual C++ 2013(Visual Studio 12)**x86**(与原 Qt 工程保持一致) |
|
||||
| CMake | ≥ 3.10 |
|
||||
| 操作系统 | Windows(构建脚本默认按 D:\APP\VisualStudio2022 与 Windows SDK 10.0.26100.0 配置,可用环境变量覆盖) |
|
||||
| 编译器 | Microsoft Visual C++ 2022(v143 工具集,`_MSC_VER` 19.44)**x64**(`D:\APP\VisualStudio2022\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x64\cl.exe`) |
|
||||
| C++ 标准 | C++17(`/std:c++17`;由 `CMAKE_CXX_STANDARD 17` + `CMAKE_CXX_STANDARD_REQUIRED ON` 强制) |
|
||||
| CMake | ≥ 3.21(VS2022 生成器自 3.21 起支持;本工程实际在 CMake 4.x 上验证) |
|
||||
| 生成器 | NMake Makefiles(VS Code 配置与脚本均使用该生成器) |
|
||||
| 线性代数 | 无需安装——Eigen 头文件已内置在源码目录 |
|
||||
|
||||
@@ -146,12 +151,13 @@
|
||||
### 4.3 命令行构建
|
||||
|
||||
```bat
|
||||
:: 需在 MSVC 2013 x86 环境中执行(先运行 vcvarsall.bat x86)
|
||||
cmake -S . -B build/X256_PS -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DRADAR_SCAN_MODE=PHASE_SCANNING
|
||||
:: 需在 MSVC 2022 x64 环境中执行(先运行 vcvarsall.bat x64)
|
||||
cmake -S . -B build/X256_PS -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DRADAR_SCAN_MODE=PHASE_SCANNING ^
|
||||
-DCMAKE_CXX_COMPILER="D:/APP/VisualStudio2022/VC/Tools/MSVC/14.44.35207/bin/Hostx64/x64/cl.exe"
|
||||
cmake --build build/X256_PS
|
||||
```
|
||||
|
||||
或直接使用仓库提供的脚本(内部已调用 vcvarsall.bat):
|
||||
或直接使用仓库提供的脚本(内部已通过 msvc_env.bat 调用 vcvarsall.bat x64 并校验 cl.exe):
|
||||
|
||||
```bat
|
||||
.vscode\scripts\configure.bat build/X256_PS PHASE_SCANNING Release
|
||||
@@ -159,6 +165,8 @@ cmake --build build/X256_PS
|
||||
.vscode\scripts\clean.bat build/X256_PS
|
||||
```
|
||||
|
||||
configure.bat 会在构建目录中写入 `.msvc_toolset` 标记;若该目录是用其它工具集(例如旧的 MSVC 2013 缓存)配置的,脚本会先整体删除该目录再重新配置,避免新旧目标文件混链。用 `set VS2022_DIR=...`、`set MSVC_TOOLSET_VERSION=...`、`set MSVC_TARGET_ARCH=x86` 可覆盖默认的 VS 安装路径、工具集版本与目标架构。
|
||||
|
||||
在 VS Code 中可直接运行任务(tasks.json):「CMake: 配置并构建 X256_PS (Release)」等,默认任务为 X256_PS Release。
|
||||
|
||||
### 4.4 产物
|
||||
@@ -170,13 +178,34 @@ cmake --build build/X256_PS
|
||||
| 安装(cmake --install) | DLL/导入库 → bin、lib,公开头文件 → include |
|
||||
| compile_commands.json | 构建根目录(供 VS Code IntelliSense 使用) |
|
||||
|
||||
仓库 build/X256_PS/bin/ 内还带有 **rdp_playback.exe**(回放测试工具,依赖 Qt5Core.dll、sqlite3.dll,配置样例 RadarConfigParam.ini,可回放 .db 记录的点迹数据验证 DLL 输出),不在本仓库源码范围内。
|
||||
产物为 **x64(AMD64)** 目标。宿主程序必须是 64 位、且使用与本 DLL 同一版本头文件重新编译——MSVC 2013 → MSVC 2022 同时伴随 x86 → x64 的 ABI 变化,旧的 32 位宿主无法加载该 DLL。
|
||||
|
||||
仓库 build/X256_PS/bin/ 内原附带 **rdp_playback.exe**(回放测试工具,依赖 Qt5Core.dll、sqlite3.dll,配置样例 RadarConfigParam.ini,可回放 .db 记录的点迹数据验证 DLL 输出),该工具不在本仓库源码范围内、当前构建目录中亦不存在,需自行放置;由于 DLL 已改为 x64,配套的 rdp_playback.exe 必须是 **x64 版本**(同时其自带 Qt5Core.dll / sqlite3.dll 也需为 x64),32 位版本无法加载新版 DLL。
|
||||
|
||||
### 4.5 编译警告处理
|
||||
|
||||
- 源码文件统一使用 **带 BOM 的 UTF-8** 编码保存,兼容 MSVC 2013(该版本不支持 `/utf-8`),消除 C4819。
|
||||
- `CMakeLists.txt` 对 MSVC 19.0 及以上版本自动追加 `/utf-8` 编译选项;使用 MSVC 2013 构建时请保持源码为 UTF-8 with BOM。
|
||||
- 修复了 `/W3` 下全部 C4018(signed/unsigned 不匹配)与 C4244(类型转换可能丢失数据)警告:循环变量按需改为 `size_t`,窄化转换改为 `static_cast` 显式转换,不改变原有计算逻辑。
|
||||
- 源码文件统一使用 **带 BOM 的 UTF-8** 编码保存;`CMakeLists.txt` 对 MSVC 统一追加 `/utf-8`,中文字符串与注释不再受系统代码页影响(消除 C4819),BOM 仅作为编辑器/旧工具的兼容保留。
|
||||
- `CMakeLists.txt` 显式指定 `/W3`:CMake 3.15(策略 CMP0092)起不再把 `/W3` 放进 `CMAKE_CXX_FLAGS`,本工程此前一直以 `/W3` 构建,故显式恢复以保持警告级别不变。
|
||||
- 修复了 `/W3` 下全部 C4819(源文件字符集)、C4018(signed/unsigned 不匹配)、C4244(类型转换可能丢失数据)警告:循环变量按需改为 `size_t`,窄化转换改为 `static_cast` 显式转换,不改变原有计算逻辑。
|
||||
- MSVC 2022 在 `/W3` 下新增报出的 C4267(`size_t` → `int` 窄化)共 17 处已按同一约定修复(`track_asso.cpp`、`track_asso_tas.cpp`、`track_init.cpp`、`track_init_direct_tracking.cpp`、`tas_ctrl.cpp` 中改为 `static_cast<int>(...)`),同样不改变计算逻辑。
|
||||
- 当前四种配置(X256_PS / X256_MS × Release / Debug)均以 **0 warning、0 error** 通过编译。
|
||||
- cl.exe 的诊断信息为中文(跟随 VS 安装语言,`VSLANG=1033` 对 VS2022 的 cl.exe 无效),构建日志中偶见 `注意: 包含文件:` 行泄漏,属 CMake 依赖扫描的显示噪声,头文件依赖(`CMakeFiles/*.dir/**/*.obj.d`)记录完整,不影响增量编译。
|
||||
|
||||
### 4.6 编译器升级说明(MSVC 2013 → MSVC 2022)
|
||||
|
||||
| 项目 | 升级前 | 升级后 |
|
||||
|---|---|---|
|
||||
| 编译器 | Microsoft Visual C++ 2013(VS 12.0,`_MSC_VER` 1800) | Microsoft Visual C++ 2022(v143,`_MSC_VER` 1944,cl 19.44.35228) |
|
||||
| 目标架构 | x86(32 位) | x64(AMD64) |
|
||||
| C++ 标准 | C++11(编译器默认) | C++17(`/std:c++17`) |
|
||||
| CMake 最低版本 | 3.10 | 3.21 |
|
||||
| 新增/调整编译选项 | — | `/utf-8`(改为无条件)、`/Zc:__cplusplus`、`/W3`(显式恢复) |
|
||||
|
||||
- **`/Zc:__cplusplus`**:MSVC 默认把 `__cplusplus` 报为 `199711L`,加该选项后正确报 `201703L`,使依赖 `__cplusplus` 判断的第三方库(内置 Eigen 3.3.7)走标准分支。已验证 Eigen 3.3.7 在此组合下编译通过。
|
||||
- **`/Zc:strictStrings` 仍仅在 Release 启用**:原限制(MSVC 2013 Debug 运行库与该选项冲突)已不存在,此处保持与原 qmake 工程一致的行为。
|
||||
- **旧构建目录需清理**:MSVC 2013 的 CMake 缓存与目标文件不能跨编译器复用(nmake 会因目标文件时间戳较新而跳过重编译,导致新旧目标文件混链)。`configure.bat` 已内置自动清理:构建目录中无 `.msvc_toolset` 标记或标记与当前工具集不一致时,先删除整个构建目录再配置。
|
||||
- **源码改动**:仅补齐 17 处 `static_cast<int>(...)` 显式窄化转换以消除 MSVC 2022 新增的 C4267 告警,未改动任何计算逻辑、接口与结构体布局;DLL 导出符号与升级前一致(差异仅为 x86 → x64 的名称修饰,如 `QAE` → `QEAA`、`PAV` → `PEAV`)。
|
||||
- **兼容性风险点已核查**:C++17 移除的 `std::auto_ptr`、`std::random_shuffle`、`std::unary_function`/`binary_function`、`std::binder1st/2nd` 等在本工程源码与内置 Eigen 3.3.7 中均未被使用(Eigen 的相应特化本身带有 `__cplusplus`/`EIGEN_COMP_MSVC` 版本保护)。
|
||||
|
||||
---
|
||||
|
||||
@@ -924,6 +953,7 @@ $$
|
||||
|
||||
| 提交 | 内容 |
|
||||
|---|---|
|
||||
| 工作区(未提交) | 编译器由 MSVC 2013(Visual Studio 12,x86)升级为 **MSVC 2022(v143,x64)**、C++ 标准提升至 **C++17**:`CMakeLists.txt` 重写(`CMAKE_CXX_STANDARD 17`、`_MSC_VER >= 1930` 强校验、`/utf-8` `/Zc:__cplusplus` `/W3`)、`.vscode/scripts/` 全部构建脚本改为 MSVC 2022(新增共享的 `msvc_env.bat`,`configure.bat` 自动清理旧工具集构建树)、VS Code 配置同步(settings / c_cpp_properties / cmake-variants / tasks 改为 MSVC2022 x64 + C++17)、修复 MSVC 2022 新增的 17 处 C4267 窄化告警;X256_PS/X256_MS × Release/Debug 四种配置均 0 warning 0 error 通过,产物为 x64 DLL(导出符号与升级前一致,仅名称修饰随架构变化) |
|
||||
| e8c56f9 | 输入/输出结构适配「归一化幅度」与「速度维 FFT 点数」:`DataRev` 新增 `amp_asv`/`prn_fftn`,`Track` 新增 `amp_asv_point`/`prn_fftn_point`,内部 `PointRecv`/`Trust_Track` 同步新增字段;`track_asso.cpp` 关联实点时写入航迹、TWS 输出时写回输出结构(输入侧未打通,见 11.2) |
|
||||
| 42b598e | 调整「向站/背站」判断条件:判据由 `acos((-x·vx − y·vy)/r/Range_V) < π/4` 改为 `acos((-x·cos(Direction_Angle) − y·sin(Direction_Angle))/r) < π/2`(去掉按合速度归一化,锥角门限由 45° 放宽到 90°),TWS/TAS 同步 |
|
||||
| fc49707 | 「向站/背站」判断改用滤波速度矢量:`Flag_Direction` 不再取 `vr_point > 0`(实测径向速度受多普勒模糊影响、符号可能取反),改按航迹 IMM 速度方向与位置矢量的夹角判定(TWS/TAS 同步);`primary_target_add/cancel`、`tracking_start/stop` 命中目标后 `break`;删除 TWS 输出循环中的注释残留代码块 |
|
||||
|
||||
@@ -291,7 +291,7 @@ void TAS_Ctrl::tas_beam_output(std::vector<Trust_Track> *trust_track
|
||||
H_track = (*trust_track)[track_idx].Height;
|
||||
delta_T = (latest_timestamp - CPI_time) / 1000.0f;
|
||||
|
||||
earliest_track_idx = track_idx;
|
||||
earliest_track_idx = static_cast<int>(track_idx);
|
||||
earliest_tas_queue_idx = tas_idx;
|
||||
|
||||
for(int ii=0;ii<6;ii++){
|
||||
|
||||
@@ -24,7 +24,7 @@ int Track_Asso:: track_asso_process(std::vector<PointRecv> *point_
|
||||
for (size_t i=0;i< point_recv->size();i++)
|
||||
{
|
||||
point_process.push_back((*point_recv)[i]);
|
||||
int n=point_process.size();
|
||||
int n=static_cast<int>(point_process.size());
|
||||
point_process[n-1].point_section_asso = 1;
|
||||
}
|
||||
|
||||
@@ -543,7 +543,7 @@ void Track_Asso:: model_filter(std::vector <Trust_Track> *trust_track,struct Ra
|
||||
}
|
||||
|
||||
//最近邻法关联
|
||||
int associated_num=associated_info.size();
|
||||
int associated_num=static_cast<int>(associated_info.size());
|
||||
for (size_t i=0;i<trust_track->size();i++)
|
||||
{
|
||||
//寻找最小d
|
||||
@@ -682,23 +682,23 @@ void Track_Asso:: model_filter(std::vector <Trust_Track> *trust_track,struct Ra
|
||||
if(associated_info[ii].track_index==track_index)
|
||||
{
|
||||
associated_info.erase(associated_info.begin()+ii);
|
||||
associated_num=associated_info.size();
|
||||
associated_num=static_cast<int>(associated_info.size());
|
||||
}
|
||||
else
|
||||
ii++;
|
||||
}
|
||||
associated_num=associated_info.size();
|
||||
associated_num=static_cast<int>(associated_info.size());
|
||||
for (int ii=0;ii<associated_num;)
|
||||
{
|
||||
if(associated_info[ii].point_index==point_index)
|
||||
{
|
||||
associated_info.erase(associated_info.begin()+ii);
|
||||
associated_num=associated_info.size();
|
||||
associated_num=static_cast<int>(associated_info.size());
|
||||
}
|
||||
else
|
||||
ii++;
|
||||
}
|
||||
associated_num=associated_info.size();
|
||||
associated_num=static_cast<int>(associated_info.size());
|
||||
|
||||
//在接收点迹中 将关联上的点迹的使用标记位置为1 等待删除
|
||||
point_process[point_index-1].Use_Flag = 1;
|
||||
@@ -919,7 +919,7 @@ void Track_Asso:: track_hight_update(int updata_
|
||||
else if((*trust_track)[updata_track_index-1].Hight_smooth.size()>=static_cast<size_t>(height_win_length))
|
||||
{
|
||||
|
||||
int N=(*trust_track)[updata_track_index-1].Hight_smooth.size();
|
||||
int N=static_cast<int>((*trust_track)[updata_track_index-1].Hight_smooth.size());
|
||||
for (int i=0;i<height_win_length;i++)
|
||||
{
|
||||
sum=sum+(*trust_track)[updata_track_index-1].Hight_smooth[N-1-i];
|
||||
|
||||
@@ -766,7 +766,7 @@ void Track_Asso_Tas::track_hight_update(int tas_
|
||||
else if((*trust_track)[i].Hight_smooth.size()>=static_cast<size_t>(height_win_length))
|
||||
{
|
||||
|
||||
int N=(*trust_track)[i].Hight_smooth.size();
|
||||
int N=static_cast<int>((*trust_track)[i].Hight_smooth.size());
|
||||
for (int ii=0;ii<height_win_length;ii++)
|
||||
{
|
||||
sum=sum+(*trust_track)[i].Hight_smooth[N-1-ii];
|
||||
|
||||
@@ -98,7 +98,7 @@ int Track_Init::track_init_process_logic( std::vector <PointRecv>
|
||||
temp_track_tmp.buff_round = 1;
|
||||
// temp_track_tmp.Temp_track_section_idx = floor(point_process[i].beam_index/BEAM_NUM_DOT_SECTION)+1;
|
||||
temp_track->push_back( std::vector <Temp_track> ());
|
||||
int n=temp_track->size();
|
||||
int n=static_cast<int>(temp_track->size());
|
||||
(*temp_track)[n-1].push_back(temp_track_tmp);
|
||||
|
||||
// if(point_process[i].CPI_Time == 30675948 || point_process[i].CPI_Time == 30682320)
|
||||
@@ -159,7 +159,7 @@ void Track_Init::point_temp_track_asso(std::vector <std::vector<Temp_track>>
|
||||
{
|
||||
for ( size_t j=0;j<(*temp_track).size();j++)
|
||||
{
|
||||
int L = (*temp_track)[j].size();
|
||||
int L = static_cast<int>((*temp_track)[j].size());
|
||||
|
||||
if( (*temp_track)[j].size() > 1 && (*temp_track)[j][L-1].buff_round >= 2)
|
||||
{
|
||||
@@ -240,7 +240,7 @@ void Track_Init::point_temp_track_asso(std::vector <std::vector<Temp_track>>
|
||||
(*temp_track).push_back(std::vector <Temp_track> ());
|
||||
|
||||
//前L个点
|
||||
int L = (*temp_track)[asso_info[i].track_idx-1].size();
|
||||
int L = static_cast<int>((*temp_track)[asso_info[i].track_idx-1].size());
|
||||
for (int j=0;j < L;j++ )
|
||||
{
|
||||
(*temp_track)[(*temp_track).size()-1].push_back((*temp_track)[asso_info[i].track_idx-1][j]);
|
||||
@@ -468,7 +468,7 @@ void Track_Init::tmp_track_to_trust_track(std::vector<Trust_Track> *trust_tra
|
||||
std::vector <std::vector<Temp_track>>::iterator Iter;
|
||||
for (Iter=temp_track->begin(); Iter!=temp_track->end();)
|
||||
{
|
||||
int L=(*Iter).size();
|
||||
int L=static_cast<int>((*Iter).size());
|
||||
double range=(*Iter)[L-1].r;
|
||||
double azi=(*Iter)[L-1].azi/PI*180;
|
||||
|
||||
@@ -676,7 +676,7 @@ void Track_Init::tmp_track_die(std::vector <std::vector<Temp_track>> *temp_t
|
||||
std::vector <std::vector<Temp_track>>::iterator Iter;
|
||||
for (Iter=temp_track->begin(); Iter!=temp_track->end();)
|
||||
{
|
||||
int n=(*Iter).size();
|
||||
int n=static_cast<int>((*Iter).size());
|
||||
if (n <= 0)
|
||||
{
|
||||
temp_track->erase(Iter);
|
||||
|
||||
@@ -37,7 +37,7 @@ void Track_Init_Direct_Tracking::point_temp_track_asso(std::vector <std::vector<
|
||||
{
|
||||
for ( size_t j=0;j<(*temp_track).size();j++)
|
||||
{
|
||||
int L = (*temp_track)[j].size();
|
||||
int L = static_cast<int>((*temp_track)[j].size());
|
||||
|
||||
if( (*temp_track)[j].size() > 1 && (*temp_track)[j][L-1].buff_round >= 2)
|
||||
{
|
||||
@@ -102,7 +102,7 @@ void Track_Init_Direct_Tracking::point_temp_track_asso(std::vector <std::vector<
|
||||
(*temp_track).push_back(std::vector <Temp_track> ());
|
||||
|
||||
//前L个点
|
||||
int L = (*temp_track)[asso_info[i].track_idx-1].size();
|
||||
int L = static_cast<int>((*temp_track)[asso_info[i].track_idx-1].size());
|
||||
for (int j=0;j < L;j++ )
|
||||
{
|
||||
(*temp_track)[(*temp_track).size()-1].push_back((*temp_track)[asso_info[i].track_idx-1][j]);
|
||||
@@ -306,7 +306,7 @@ void Track_Init_Direct_Tracking::tmp_track_to_trust_track( std::vector<Trust_Tr
|
||||
std::vector <std::vector<Temp_track>>::iterator Iter;
|
||||
for (Iter=temp_track->begin(); Iter!=temp_track->end();)
|
||||
{
|
||||
int L=(*Iter).size();
|
||||
int L=static_cast<int>((*Iter).size());
|
||||
if (L < 3)
|
||||
{
|
||||
++Iter;
|
||||
@@ -419,7 +419,7 @@ void Track_Init_Direct_Tracking::tmp_track_die(std::vector <std::vector<Temp_tra
|
||||
std::vector <std::vector<Temp_track>>::iterator Iter;
|
||||
for (Iter=temp_track->begin(); Iter!=temp_track->end();)
|
||||
{
|
||||
int n=(*Iter).size();
|
||||
int n=static_cast<int>((*Iter).size());
|
||||
if (n <= 0)
|
||||
{
|
||||
temp_track->erase(Iter);
|
||||
|
||||
Reference in New Issue
Block a user