Compare commits

...

4 Commits

Author SHA1 Message Date
CaoYuHui 88e5e560f4 20240719
修改点单跟踪功能优化
11 months ago
CaoYuHui 1ac46198bf 分支合并Merge remote-tracking branch 'origin/NewDCCtrl'
Please enter a commit message to explain why this merge is necessary,
11 months ago
CaoYuHui ea6ffac1a8 20240617
优化13所吊舱控制协议帧
增加天进吊舱控制功能
优化控制指令发送逻辑(装订指令)
增加视频管理计算机指令(开关指令)发送
增加13所吊舱协议、天进吊舱协议、H264裸流视频协议解析选择
增加天进吊舱点击“单点跟踪”按钮后,双击图像区域发送吊舱跟踪坐标点
12 months ago
CaoYuHui 90eaa784fe 优化13所吊舱控制协议帧 12 months ago

177
.gitignore vendored

@ -1,7 +1,10 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
@ -10,48 +13,68 @@
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
[Xx]64/
[Xx]86/
[Bb]uild/
x64/
x86/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015 cache/options directory
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# DNX
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_i.h
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
@ -61,6 +84,7 @@ artifacts/
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
@ -81,6 +105,7 @@ ipch/
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
@ -88,6 +113,9 @@ ipch/
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
@ -108,6 +136,14 @@ _TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
@ -139,22 +175,27 @@ publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Un-comment the next line if you do not want to checkin
# your web deploy settings because they may include unencrypted
# passwords
#*.pubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignoreable files
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
@ -166,28 +207,40 @@ csx/
ecf/
rcf/
# Windows Store app package directory
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
!?*.[Cc]ache/
# Others
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
node_modules/
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
@ -198,15 +251,22 @@ _UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
@ -216,6 +276,7 @@ FakesAssemblies/
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
@ -223,6 +284,9 @@ FakesAssemblies/
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
@ -231,20 +295,71 @@ FakesAssemblies/
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# LightSwitch generated files
GeneratedArtifacts/
ModelManifest.xml
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
#klocwork
.klocwork/
#GIS
GISControlDlg20140626/
.cpptest/
.parasoft
.parasoft.dat/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# The folders defined by Robin to be ignored
Bin/
Lib/
Src/Debug/
Src/Release/
Src/FH98ViewOnPlane_Setup/
Src/ipch/
Src/XtremeToolKitPro/
Src/JoyStick/
Src/QB_ImgProcessFun/
Src/QB_ImgShowBase/

@ -0,0 +1,89 @@
#pragma once
#include <tuple>
#define CALC_EXPORT 0
#if CALC_EXPORT
#define CALC_API __declspec(dllexport)
#else
#define CALC_API __declspec(dllimport)
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*---------------------计算目标点经纬度需求数据------------------------*/
typedef struct calcData
{
float LaserDistance; //激光测距距离(无激光测距值为0)
float PodPitchAngle; //吊舱俯仰角(向上为正 归中为0° -115~+90°)
float PodDirectionAngle; //吊舱方位角(-180~+180°)
float PodRollAngle; //吊舱滚转角
float FlyPitchAngle; //飞机俯仰角(-90~+90°)
float FlyHeadingAngle; //飞机航向角(0~360°)
float FlyRollAngle; //飞机滚转角(-90~+90°)
double FlyCurrentLongitude; //飞机当前经度
double FlyCurrentLatitude; //飞机当前纬度
float FlyCurrentHeight; //飞机当前高度
bool isUseRoll; //是否使用滚转 默认不使用(三轴光电吊舱)
}CALC_DES_DATA, FLY_DATA;
/*------------------------目标点位置信息数据--------------------------*/
typedef struct locationData
{
double DisLongitude; //目标点经度
double Dislatitude; //目标点纬度
float DisHeight; //目标点高度
/*locationData& operator=(const locationData& other)
{
this->DisHeight = other.DisHeight;
this->Dislatitude = other.Dislatitude;
this->DisLongitude = other.DisLongitude;
return *this;
}*/
}DES_LOCATION;
/*----------------根据空投点目标吊舱需要转动的角度-------------------*/
typedef struct podNeedAngle
{
float directionAngle; //吊舱方位角(-180~+180°)
float PitchAngle; //飞机俯仰角(-90~+90°)
}POD_NEED_ANGLE;
/**********************************************
* @func calcDisLocation
* @brief
* @param CALC_DES_DATA
* @return DES_LOCATION
**********************************************/
CALC_API DES_LOCATION __stdcall calcDisLocation(CALC_DES_DATA calcData);
/**********************************************
* @func calcDisLocation
* @brief
* @param CALC_DES_DATA
* @return DES_LOCATION
**********************************************/
CALC_API DES_LOCATION __stdcall calcDisLocation2(CALC_DES_DATA calcData);
/**********************************************
* @func calcPodNeedAngle
* @brief
* @param CALC_DES_DATA
* @return POD_NEED_ANGLE
**********************************************/
CALC_API POD_NEED_ANGLE __stdcall calcPodNeedAngle(CALC_DES_DATA calcData, DES_LOCATION desLocation);
/**********************************************
* @func calcPodNeedAngle2
* @brief
* @param CALC_DES_DATA
* @return POD_NEED_ANGLE
**********************************************/
CALC_API POD_NEED_ANGLE __stdcall calcPodNeedAngle2(CALC_DES_DATA calcData, DES_LOCATION desLocation);
#ifdef __cplusplus
}
#endif

@ -0,0 +1,89 @@
#pragma once
#include <tuple>
#define CALC_EXPORT 1
#ifdef CALC_EXPORT
#define CALC_API __declspec(dllexport)
#else
#define CALC_API __declspec(dllimport)
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*---------------------计算目标点经纬度需求数据------------------------*/
typedef struct calcData
{
float LaserDistance; //激光测距距离(无激光测距值为0)
float PodPitchAngle; //吊舱俯仰角(向上为正 归中为0° -115~+90°)
float PodDirectionAngle; //吊舱方位角(-180~+180°)
float PodRollAngle; //吊舱滚转角
float FlyPitchAngle; //飞机俯仰角(-90~+90°)
float FlyHeadingAngle; //飞机航向角(0~360°)
float FlyRollAngle; //飞机滚转角(-90~+90°)
double FlyCurrentLongitude; //飞机当前经度
double FlyCurrentLatitude; //飞机当前纬度
float FlyCurrentHeight; //飞机当前高度
bool isUseRoll; //是否使用滚转 默认不使用(三轴光电吊舱)
}CALC_DES_DATA, FLY_DATA;
/*------------------------目标点位置信息数据--------------------------*/
typedef struct locationData
{
double DisLongitude; //目标点经度
double Dislatitude; //目标点纬度
float DisHeight; //目标点高度
/*locationData& operator=(const locationData& other)
{
this->DisHeight = other.DisHeight;
this->Dislatitude = other.Dislatitude;
this->DisLongitude = other.DisLongitude;
return *this;
}*/
}DES_LOCATION;
/*----------------根据空投点目标吊舱需要转动的角度-------------------*/
typedef struct podNeedAngle
{
float directionAngle; //吊舱方位角(-180~+180°)
float PitchAngle; //飞机俯仰角(-90~+90°)
}POD_NEED_ANGLE;
/**********************************************
* @func calcDisLocation
* @brief
* @param CALC_DES_DATA
* @return DES_LOCATION
**********************************************/
CALC_API DES_LOCATION __stdcall calcDisLocation(CALC_DES_DATA calcData);
/**********************************************
* @func calcDisLocation
* @brief
* @param CALC_DES_DATA
* @return DES_LOCATION
**********************************************/
CALC_API DES_LOCATION __stdcall calcDisLocation2(CALC_DES_DATA calcData);
/**********************************************
* @func calcPodNeedAngle
* @brief
* @param CALC_DES_DATA
* @return POD_NEED_ANGLE
**********************************************/
CALC_API POD_NEED_ANGLE __stdcall calcPodNeedAngle(CALC_DES_DATA calcData, DES_LOCATION desLocation);
/**********************************************
* @func calcPodNeedAngle2
* @brief
* @param CALC_DES_DATA
* @return POD_NEED_ANGLE
**********************************************/
CALC_API POD_NEED_ANGLE __stdcall calcPodNeedAngle2(CALC_DES_DATA calcData, DES_LOCATION desLocation);
#ifdef __cplusplus
}
#endif

Binary file not shown.

Binary file not shown.

@ -1,6 +1,8 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.9.34728.123
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CH91PayloadSoftware", "CH91PayloadSoftware\CH91PayloadSoftware.vcxproj", "{89E02284-2466-4FFA-B5D4-12173645A4F1}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Decoder_H264_ALL", "Decoder_H264_ALL\Decoder_H264_ALL.vcxproj", "{5756743E-2CA9-41B7-A71D-0A4044E2F1A0}"

@ -0,0 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CH91PayloadSoftware", "CH91PayloadSoftware.vcxproj", "{89E02284-2466-4FFA-B5D4-12173645A4F1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{89E02284-2466-4FFA-B5D4-12173645A4F1}.Debug|Win32.ActiveCfg = Debug|Win32
{89E02284-2466-4FFA-B5D4-12173645A4F1}.Debug|Win32.Build.0 = Debug|Win32
{89E02284-2466-4FFA-B5D4-12173645A4F1}.Release|Win32.ActiveCfg = Release|Win32
{89E02284-2466-4FFA-B5D4-12173645A4F1}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

@ -49,15 +49,15 @@
<LinkIncremental>true</LinkIncremental>
<OutDir>..\..\Bin\</OutDir>
<IntDir>$(Configuration)\</IntDir>
<IncludePath>E:\FH-98机载相机监控软件2023\ProgramFiles\boost_1_56;E:\FH-98机载相机监控软件2023\ProgramFiles\opencv245\include;E:\FH-98机载相机监控软件2023\ProgramFiles\gdal\include;$(IncludePath)</IncludePath>
<LibraryPath>C:\ProgramFiles\boost_1_56\stage\lib;E:\FH-98机载相机监控软件2023\ProgramFiles\boost_1_56\stage\lib;E:\FH-98机载相机监控软件2023\ProgramFiles\gdal\lib;E:\FH-98机载相机监控软件2023\ProgramFiles\opencv245\lib\x86;$(LibraryPath)</LibraryPath>
<IncludePath>C:\1、Htsdfp\2、GCS\3、FH-98机载相机监控软件2023\ProgramFiles\boost_1_56;C:\1、Htsdfp\2、GCS\3、FH-98机载相机监控软件2023\ProgramFiles\opencv245\include;C:\1、Htsdfp\2、GCS\3、FH-98机载相机监控软件2023\ProgramFiles\gdal\include;$(IncludePath)</IncludePath>
<LibraryPath>C:\1、Htsdfp\2、GCS\3、FH-98机载相机监控软件2023\ProgramFiles\boost_1_56\stage\lib;C:\1、Htsdfp\2、GCS\3、FH-98机载相机监控软件2023\ProgramFiles\gdal\lib;C:\1、Htsdfp\2、GCS\3、FH-98机载相机监控软件2023\ProgramFiles\opencv245\lib\x86;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>..\..\Bin\</OutDir>
<IntDir>..\..\Bin\</IntDir>
<IncludePath>C:\ProgramFiles\boost_1_56;E:\FH-98机载相机监控软件2023\ProgramFiles\boost_1_56;E:\FH-98机载相机监控软件2023\ProgramFiles\opencv245\include\opencv;E:\FH-98机载相机监控软件2023\ProgramFiles\opencv245\include\opencv2;E:\FH-98机载相机监控软件2023\ProgramFiles\opencv245\include;E:\FH-98机载相机监控软件2023\ProgramFiles\gdal\include;$(IncludePath)</IncludePath>
<LibraryPath>C:\ProgramFiles\boost_1_56\stage\lib;E:\FH-98机载相机监控软件2023\ProgramFiles\boost_1_56\stage\lib;E:\FH-98机载相机监控软件2023\ProgramFiles\gdal\lib;E:\FH-98机载相机监控软件2023\ProgramFiles\opencv245\lib\x86;$(LibraryPath)</LibraryPath>
<IncludePath>C:\1、Htsdfp\2、GCS\3、FH-98机载相机监控软件2023\ProgramFiles\boost_1_56;C:\1、Htsdfp\2、GCS\3、FH-98机载相机监控软件2023\ProgramFiles\opencv245\include\opencv;C:\1、Htsdfp\2、GCS\3、FH-98机载相机监控软件2023\ProgramFiles\opencv245\include\opencv2;C:\1、Htsdfp\2、GCS\3、FH-98机载相机监控软件2023\ProgramFiles\opencv245\include;C:\1、Htsdfp\2、GCS\3、FH-98机载相机监控软件2023\ProgramFiles\gdal\include;$(IncludePath)</IncludePath>
<LibraryPath>C:\1、Htsdfp\2、GCS\3、FH-98机载相机监控软件2023\ProgramFiles\boost_1_56\stage\lib;C:\1、Htsdfp\2、GCS\3、FH-98机载相机监控软件2023\ProgramFiles\gdal\lib;C:\1、Htsdfp\2、GCS\3、FH-98机载相机监控软件2023\ProgramFiles\opencv245\lib\x86;$(LibraryPath)</LibraryPath>
<TargetName>FH98PayloadOnBoard</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
@ -67,14 +67,14 @@
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ExceptionHandling>Async</ExceptionHandling>
<AdditionalIncludeDirectories>..\..\Include;..\XtremeToolKitPro;C:\ProgramFiles\gdal\include;C:\ProgramFiles\opencv245\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>..\..\Include;..\XtremeToolKitPro;C:\1、Htsdfp\2、GCS\3、FH-98机载相机监控软件2023\ProgramFiles\gdal\include;C:\1、Htsdfp\2、GCS\3、FH-98机载相机监控软件2023\ProgramFiles\opencv245\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>QB_SimpleImgShowD.lib;QB_GoogleMapOperateD.lib;MapPrj.lib;QB_ImgShowBaseD.lib;QB_ImgProcessFunD.lib;QB_AutoMapD.lib;OIS_static_d.lib;Decoder_H264_ALLD.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>C:\ProgramFiles\opencv245\lib\x86;C:\ProgramFiles\gdal\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>C:\1、Htsdfp\2、GCS\3、FH-98机载相机监控软件2023\ProgramFiles\opencv245\lib\x86;C:\1、Htsdfp\2、GCS\3、FH-98机载相机监控软件2023\ProgramFiles\gdal\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<Midl>
<MkTypLibCompatible>false</MkTypLibCompatible>
@ -104,7 +104,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>QB_SimpleImgShow.lib;QB_GoogleMapOperate.lib;MapPrj.lib;QB_ImgShowBase.lib;QB_AutoMap.lib;QB_ImgProcessFun.lib;OIS_static.lib;Decoder_H264_ALLR.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>C:\ProgramFiles\gdal\lib;C:\ProgramFiles\opencv245\lib\x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>C:\1、Htsdfp\2、GCS\3、FH-98机载相机监控软件2023\ProgramFiles\gdal\lib;C:\1、Htsdfp\2、GCS\3、FH-98机载相机监控软件2023\ProgramFiles\opencv245\lib\x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
<Midl>
<MkTypLibCompatible>false</MkTypLibCompatible>
@ -180,9 +180,14 @@
<ClInclude Include="ControlDlgFH96Page1.h" />
<ClInclude Include="cPhysicsInfoUtils.h" />
<ClInclude Include="CTCPSocket.h" />
<ClInclude Include="CYHMudpSend.h" />
<ClInclude Include="DCFrameCkCmd.h" />
<ClInclude Include="DCOverrollDlg.h" />
<ClInclude Include="DecoderFactory.h" />
<ClInclude Include="Dlg13InstituteDCNew.h" />
<ClInclude Include="DlgCameraCtrl.h" />
<ClInclude Include="DlgIMP.h" />
<ClInclude Include="DlgWHTJDCNew.h" />
<ClInclude Include="FrameFKU_Camera.h" />
<ClInclude Include="FrameIMP_DOWN.h" />
<ClInclude Include="FrameRecieve.h" />
@ -233,8 +238,12 @@
<ClCompile Include="ControlDlgFH96Page1.cpp" />
<ClCompile Include="cPhysicsInfoUtils.cpp" />
<ClCompile Include="CTCPSocket.cpp" />
<ClCompile Include="CYHMudpSend.cpp" />
<ClCompile Include="DCOverrollDlg.cpp" />
<ClCompile Include="Dlg13InstituteDCNew.cpp" />
<ClCompile Include="DlgCameraCtrl.cpp" />
<ClCompile Include="DlgIMP.cpp" />
<ClCompile Include="DlgWHTJDCNew.cpp" />
<ClCompile Include="FrameIMP_DOWN.cpp" />
<ClCompile Include="IMPConect.cpp" />
<ClCompile Include="JoyKeybordControl.cpp" />

@ -94,6 +94,9 @@
<Filter Include="IMP\协议">
<UniqueIdentifier>{8eb1f68d-8c2d-485d-b3bd-9859d81467d5}</UniqueIdentifier>
</Filter>
<Filter Include="CYH新增">
<UniqueIdentifier>{be9a2dce-ba4c-44fd-9db6-fefe7b53caa0}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<None Include="ReadMe.txt" />
@ -384,6 +387,21 @@
<ClInclude Include="FrameIMP_DOWN.h">
<Filter>IMP\协议</Filter>
</ClInclude>
<ClInclude Include="Dlg13InstituteDCNew.h">
<Filter>CYH新增</Filter>
</ClInclude>
<ClInclude Include="DCFrameCkCmd.h">
<Filter>CYH新增</Filter>
</ClInclude>
<ClInclude Include="CYHMudpSend.h">
<Filter>CYH新增</Filter>
</ClInclude>
<ClInclude Include="DlgWHTJDCNew.h">
<Filter>CYH新增</Filter>
</ClInclude>
<ClInclude Include="DCOverrollDlg.h">
<Filter>CYH新增</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="CH91PayloadSoftware.cpp">
@ -509,6 +527,18 @@
<ClCompile Include="FrameIMP_DOWN.cpp">
<Filter>IMP\协议</Filter>
</ClCompile>
<ClCompile Include="Dlg13InstituteDCNew.cpp">
<Filter>CYH新增</Filter>
</ClCompile>
<ClCompile Include="CYHMudpSend.cpp">
<Filter>CYH新增</Filter>
</ClCompile>
<ClCompile Include="DlgWHTJDCNew.cpp">
<Filter>CYH新增</Filter>
</ClCompile>
<ClCompile Include="DCOverrollDlg.cpp">
<Filter>CYH新增</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="CH91PayloadSoftware.rc">

@ -10,6 +10,7 @@
#include "GlobalMember.h"
#include "GetElevation.h"
#include <opencv2\opencv.hpp>
using namespace cv;
#ifdef _DEBUG
@ -80,9 +81,9 @@ CCH91PayloadSoftwareDlg::CCH91PayloadSoftwareDlg(CWnd* pParent /*=NULL*/)
g_bMapDirectGuide = FALSE; // 是否是地图直接导引标志
p_DlgCameraCtrl = NULL;
p_DlgCameraCtrl = NULL;//吊舱控制页面
g_DlgIMP = NULL;//IMP对话框初始化指针
p_Dlg13InstituteDCNewCtrl = NULL;//13所吊舱新控制放页面
}
void CCH91PayloadSoftwareDlg::DoDataExchange(CDataExchange* pDX)
@ -377,15 +378,29 @@ void CCH91PayloadSoftwareDlg::OnInitControlDlg()
m_CControlDlgFH96Page1Dlg->MoveWindow(&rc_ControlInstruction);
m_CControlDlgFH96Page1Dlg->ShowWindow(SW_SHOW);*/
/**************原吊舱控制页面***********/
p_DlgCameraCtrl = new CDlgCameraCtrl();
if (p_DlgCameraCtrl != NULL)
{
p_DlgCameraCtrl->Create(IDD_DLG_CAMERA_CTRL, this);
}
p_DlgCameraCtrl->MoveWindow(&rc_ControlInstruction);
p_DlgCameraCtrl->ShowWindow(SW_SHOW);
//p_DlgCameraCtrl->ShowWindow(SW_SHOW);
p_DlgCameraCtrl->ShowWindow(SW_HIDE);
/*************原吊舱控制页面************/
/**********13所吊舱数据装订指令页面**********/
p_Dlg13InstituteDCNewCtrl = new Dlg13InstituteDCNew();
if (p_Dlg13InstituteDCNewCtrl != NULL)
{
p_Dlg13InstituteDCNewCtrl->Create(IDD_DIALOG_DC_13INSTITUTE_NEW, this);
}
p_Dlg13InstituteDCNewCtrl->MoveWindow(&rc_ControlInstruction);
p_Dlg13InstituteDCNewCtrl->ShowWindow(SW_HIDE);
/**********13所吊舱数据装订指令页面**********/
/***********IMP************/
CRect rc_ControlInstructionIMP;
GetDlgItem(IDC_STATIC_CONTROLINSTRUCTION_IMP)->GetWindowRect(rc_ControlInstructionIMP);
@ -397,7 +412,8 @@ void CCH91PayloadSoftwareDlg::OnInitControlDlg()
g_DlgIMP->Create(IDD_DLG_IMP, this);
}
g_DlgIMP->MoveWindow(&rc_ControlInstructionIMP);
g_DlgIMP->ShowWindow(SW_SHOW);
//g_DlgIMP->ShowWindow(SW_SHOW);
g_DlgIMP->ShowWindow(SW_HIDE);
if(g_DlgIMP->IsWindowVisible())
{
IMPDlgWindowVisible=true;
@ -406,6 +422,17 @@ void CCH91PayloadSoftwareDlg::OnInitControlDlg()
{
IMPDlgWindowVisible=false;
}
/***********IMP************/
/**********吊舱数据装订指令页面**********/
p_DlgDCOverroll = new DCOverrollDlg();
if(p_DlgDCOverroll != NULL)
{
p_DlgDCOverroll->Create(IDD_DIALOG_DC,this);
}
p_DlgDCOverroll->MoveWindow(&rc_ControlInstruction);
p_DlgDCOverroll->ShowWindow(SW_SHOW);
/**********吊舱数据装订指令页面**********/
}
// 对解码器进行初始化
@ -450,6 +477,9 @@ void CCH91PayloadSoftwareDlg::OnInitCH96Decoder()
GetDlgItem(IDC_STATIC_EO_REGION)->GetWindowRect(&rect);
ScreenToClient(&rect);
m_wndShowEO_Position_Max_x = rect.right - rect.left; //图像显示区域的坐标最大值x
m_wndShowEO_Position_Max_y = rect.bottom - rect.top; //图像显示区域的坐标最大值y
m_wndShowEO->MoveWnd(rect);
m_wndShowEO->ShowWnd(SW_SHOW);
m_wndShowEO->SetCallBackFun(GetEOImgCenterOffset);
@ -608,11 +638,18 @@ void CCH91PayloadSoftwareDlg::OnDestroy()
// 卸载视频键盘
m_JoyKeybord.OnDestoryJoyKeybord();
//吊舱控制页面
if(p_DlgCameraCtrl)
{
delete p_DlgCameraCtrl;
p_DlgCameraCtrl = NULL;
}
//13所吊舱新控制放页面
if(p_Dlg13InstituteDCNewCtrl)
{
delete p_Dlg13InstituteDCNewCtrl;
p_Dlg13InstituteDCNewCtrl = NULL;
}
// 卸载IMP对话框
if(g_DlgIMP !=NULL)
{
@ -1334,9 +1371,8 @@ BOOL CCH91PayloadSoftwareDlg::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
void CCH91PayloadSoftwareDlg::DlgLanguageSet()
{
// 通过配置文件导入语言类型
CString str_fileLanguageName = "config_Chinese.ini";
CString fileLanguageSet = GetSoftwareCurrentDirectory()+ "\\ini\\" + str_fileLanguageName;
//CString fileLanguageSet = GetSoftwareCurrentDirectory()+ "\\ini\\" + str_fileLanguageName;
CString fileLanguageSet = GetSoftwareCurrentDirectory() + _T( "\\config_Chinese.ini" );
// 通过配置文件导入[TITLE]语言文字
// 视频控制页面标题
GetPrivateProfileString("TITLE", "TITLE_REPLAY", "0", g_char_TitleReplay, 30, fileLanguageSet);

@ -22,6 +22,8 @@
#include "afxcmn.h"
#include "DlgCameraCtrl.h"
#include "DlgIMP.h"
#include "Dlg13InstituteDCNew.h"
#include "DCOverrollDlg.h"
//#include "FrameIMP_DOWN.h"
// CCH91PayloadSoftwareDlg ¶Ô»°¿ò
@ -169,7 +171,9 @@ private:
CUDPSocket m_UdpSend2Payload;
bool m_bCreatUDP;
//CControlDlgFH96Page1* m_CControlDlgFH96Page1Dlg;
CDlgCameraCtrl * p_DlgCameraCtrl;
CDlgCameraCtrl * p_DlgCameraCtrl;//吊舱控制页面
Dlg13InstituteDCNew * p_Dlg13InstituteDCNewCtrl;//13所吊舱新控制放页面
DCOverrollDlg *p_DlgDCOverroll;//吊舱控制总页面
public:
afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);

@ -12,9 +12,10 @@ static char THIS_FILE[] = __FILE__;
CCMDBtn::CCMDBtn(void)
{
Cmd = 0x00;
Cmdpage = 0;
}
BEGIN_MESSAGE_MAP(CCMDBtn, CButton)
BEGIN_MESSAGE_MAP(CCMDBtn, CMFCButton)
//{{AFX_MSG_MAP(CMCBtn)
ON_WM_LBUTTONUP()
ON_WM_LBUTTONDOWN()
@ -36,9 +37,53 @@ void CCMDBtn::OnLButtonUp( UINT nFlags, CPoint point )
void CCMDBtn::OnLButtonDown( UINT nFlags, CPoint point )
{
g_FrameCamera.ckCmd = Cmd;
BYTE byFcCmd;
byFcCmd = GetFcCmdFromPane( Cmdpage, Cmd );
g_FrameCamera.ckCmd = byFcCmd;
g_FrameCamera.SendPrepare();
if(g_IsSending)
g_MUDPCamera.SendToY(g_FrameCamera.Addr(),8);
CButton::OnLButtonDown( nFlags, point );
}
BYTE CCMDBtn::GetFcCmdFromPane( int page, BYTE cmd )
{
BYTE B;
/*视频管理计算机指令-来之吊舱控制页面*/
if( page == 20)
{
switch ( cmd )
{
case 1:
B = 0xC4; break;//2M速率
case 2:
B = 0xC5; break;//4M速率
case 3:
B = 0xC6; break;//吊舱通道1
case 4:
B = 0xC7; break;//吊舱通道2
case 5:
B = 0xC8; break;//0-3拼图
case 6:
B = 0xC9; break;//4-6拼图
case 7:
B = 0xCB; break;//记录
case 8:
B = 0xCC; break;//停止记录
case 9:
B = 0xCD; break;//清空数据
case 10:
B = 0xC0; break;//L链输出/SPI输出
case 11:
B = 0xC1; break;//卫通输出/网络输出
case 12:
B = 0xC2; break;//双路输出/两路输出
default:
B = 0x00; break;
}
}
else if(page==0)
{
}
return B;
}

@ -5,11 +5,12 @@
#pragma once
#endif // _MSC_VER > 1000
class CCMDBtn : public CButton
class CCMDBtn : public CMFCButton
{
public:
CCMDBtn();
BYTE Cmd;
int Cmdpage;
virtual ~CCMDBtn();
protected:
//{{AFX_MSG(CMCBtn)
@ -18,5 +19,7 @@ protected:
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
public:
BYTE GetFcCmdFromPane(int page,BYTE cmd);
};
#endif // !defined(AFX_XPBTN_H__1806C3A3_0278_4B10_A383_905233E78AD1__INCLUDED_)

@ -0,0 +1,34 @@
#include "StdAfx.h"
#include "CYHMudpSend.h"
/*×é²¥·¢ËÍ*/
CYHMudpSend::CYHMudpSend()
{
}
CYHMudpSend::~CYHMudpSend()
{
}
bool CYHMudpSend::initMUDP(const char *IP,u_short Port)
{
WSAStartup(MAKEWORD(2, 2), &wsaData);
sock = socket(AF_INET, SOCK_DGRAM, 0);
n = 0;
setsockopt(sock, IPPROTO_IP, IP_MULTICAST_TTL, (char*)&n, sizeof(n));
addr.sin_addr.S_un.S_addr = inet_addr(IP);
addr.sin_family = AF_INET;
addr.sin_port = htons(Port);
return true;
}
bool CYHMudpSend::SendData(BYTE* const bufs,int length)
{
char* buf = (char*)bufs;
//sendto(sock, buf, strlen(buf) + 1, 0, (sockaddr*)&addr, sizeof(sockaddr));
sendto(sock, buf, length, 0, (sockaddr*)&addr, sizeof(sockaddr));
return true;
}

@ -0,0 +1,19 @@
#pragma once
#include <stdio.h>
#include <winsock2.h>
#include <ws2tcpip.h>
class CYHMudpSend
{
public:
CYHMudpSend();
~CYHMudpSend();
public:
WSADATA wsaData;
SOCKET sock;
int n;
sockaddr_in addr;
public:
bool initMUDP(const char* IP, u_short Port);
bool SendData(BYTE* const,int);
};

@ -0,0 +1,214 @@
#ifndef _CDCFrameCkCmdFrame_
#define _CDCFrameCkCmdFrame_
//数据注入指令从控发送数据协议
#pragma once
//#include "framelib/basetype.h"
//#include "framelib/DataInject.h"
#pragma pack(1)
typedef struct struProtocalDataInject_DC
{
UINT8 DCtype; //吊舱类型
union
{
struct
{
UINT8 SwitchCmd; //开关指令
INT16 param1; //参数1
INT16 param2; //参数2
UINT8 reserve[9]; //保留
}DC_13Ins;//13所吊舱控制指令
struct
{
BYTE param; //参数
BYTE param2; //参数
BYTE param3; //参数
BYTE param4; //参数
BYTE param5; //参数
BYTE param6; //参数
BYTE param7; //参数
BYTE param8; //参数
BYTE param9; //参数
BYTE param10; //参数
BYTE param11; //参数
BYTE param12; //参数
BYTE param13; //参数
BYTE param14; //参数
}DC_WHTJ; //天进吊舱控制指令
BYTE DataIn[14];//14个字节
};
}ProtocalDataInject_DC;
typedef struct struDataInject_DC
{
UINT8 DCtype; //吊舱类型
union
{
struct
{
UINT8 SwitchCmd; //开关指令
double param1; //参数1
double param2; //参数2
UINT8 reserve[9]; //保留
}DC_13Ins;//13所吊舱控制指令
struct
{
BYTE param; //参数
BYTE param2; //参数
BYTE param3; //参数
BYTE param4; //参数
BYTE param5; //参数
BYTE param6; //参数
BYTE param7; //参数
BYTE param8; //参数
BYTE param9; //参数
BYTE param10; //参数
BYTE param11; //参数
BYTE param12; //参数
BYTE param13; //参数
BYTE param14; //参数
}DC_WHTJ;//天进吊舱控制指令
BYTE DC_Data[14];//14个字节
};
}DataInject_DC;
//数据注入指令从控发送数据帧---13所吊舱
typedef struct struDCFrameCkCmd
{
UINT8 FrameHead[2]; //帧头EB 90
UINT8 fcode; //数据注入指令码
ProtocalDataInject_DC protocalDataInject_DC;
UINT16 crc16; //校验位
}DCFrameCkCmd;
#pragma pack()
//数据结构体
typedef struct struDCFrameCkCmdData
{
UINT8 fcode; //数据注入指令码
DataInject_DC dataInject_DC;
UINT16 crc16; //校验位
}DCFrameCkCmdData;
#pragma pack()
class CDCFrameCkCmdFrame : public CFrameAbstract
{
public:
DCFrameCkCmdData Data;
public:
CDCFrameCkCmdFrame()
{
//具体数据长度
_tcscpy(Name, _T("DateInject_CK_DC"));//数据注入 从控 吊舱
FrameLength = 20;
HeadLength = 2;
Head[0] = 0xEB;
Head[1] = 0x90;
memcpy(Addr(), Head, HeadLength);//把Head的第一位到HeadLength位的值赋值给Addr()
CheckLength = 2;
CheckPos = FrameLength - 2;
FrameType = ftFKu;
memset(&Data,0,sizeof(DCFrameCkCmdData));//将Data中的数据全都初始化为0
}
virtual ~CDCFrameCkCmdFrame(){}
virtual void Encode()
{
DCFrameCkCmd *pBuff = (DCFrameCkCmd*) Addr();
pBuff->fcode = Data.fcode;
pBuff->protocalDataInject_DC.DCtype = Data.dataInject_DC.DCtype;
switch(Data.dataInject_DC.DCtype)
{
case 0x01:
pBuff->protocalDataInject_DC.DC_13Ins.SwitchCmd = Data.dataInject_DC.DC_13Ins.SwitchCmd;
pBuff->protocalDataInject_DC.DC_13Ins.param1 = Data.dataInject_DC.DC_13Ins.param1;
pBuff->protocalDataInject_DC.DC_13Ins.param2 = Data.dataInject_DC.DC_13Ins.param2;
memset(&(pBuff->protocalDataInject_DC.DC_13Ins.reserve),0,sizeof(pBuff->protocalDataInject_DC.DC_13Ins.reserve));
break;
case 0x02:
pBuff->protocalDataInject_DC.DC_WHTJ.param = Data.dataInject_DC.DC_WHTJ.param;
pBuff->protocalDataInject_DC.DC_WHTJ.param2 = Data.dataInject_DC.DC_WHTJ.param2;
pBuff->protocalDataInject_DC.DC_WHTJ.param3 = Data.dataInject_DC.DC_WHTJ.param3;
pBuff->protocalDataInject_DC.DC_WHTJ.param4 = Data.dataInject_DC.DC_WHTJ.param4;
pBuff->protocalDataInject_DC.DC_WHTJ.param5 = Data.dataInject_DC.DC_WHTJ.param5;
pBuff->protocalDataInject_DC.DC_WHTJ.param6 = Data.dataInject_DC.DC_WHTJ.param6;
pBuff->protocalDataInject_DC.DC_WHTJ.param7 = Data.dataInject_DC.DC_WHTJ.param7;
pBuff->protocalDataInject_DC.DC_WHTJ.param8 = Data.dataInject_DC.DC_WHTJ.param8;
pBuff->protocalDataInject_DC.DC_WHTJ.param9 = Data.dataInject_DC.DC_WHTJ.param9;
pBuff->protocalDataInject_DC.DC_WHTJ.param10 = Data.dataInject_DC.DC_WHTJ.param10;
pBuff->protocalDataInject_DC.DC_WHTJ.param11 = Data.dataInject_DC.DC_WHTJ.param11;
pBuff->protocalDataInject_DC.DC_WHTJ.param12 = Data.dataInject_DC.DC_WHTJ.param12;
pBuff->protocalDataInject_DC.DC_WHTJ.param13 = Data.dataInject_DC.DC_WHTJ.param13;
pBuff->protocalDataInject_DC.DC_WHTJ.param14 = Data.dataInject_DC.DC_WHTJ.param14;
break;
default:
break;
}
/*
switch(Data.fcode)
{
case 0x70:
if(Data.details.DataZ70.DCtype == 0x01){
EncodeUZ70( &( pBuff->details ),&( Data.details ));
}
if(Data.details.DataZ70_TJDC.DCTpye == 0x02){
EncodeUZ70_TJDC( &( pBuff->details ),&( Data.details ));
}
break;
default:
break;
}
*/
}
virtual void Decode()
{
DCFrameCkCmd *pBuff = (DCFrameCkCmd*) Addr();
Data.fcode = pBuff->fcode;
Data.dataInject_DC.DCtype = pBuff->protocalDataInject_DC.DCtype;
switch(pBuff->protocalDataInject_DC.DCtype)
{
case 0x01:
Data.dataInject_DC.DC_13Ins.SwitchCmd = pBuff->protocalDataInject_DC.DC_13Ins.SwitchCmd;
Data.dataInject_DC.DC_13Ins.param1 = pBuff->protocalDataInject_DC.DC_13Ins.param1;
Data.dataInject_DC.DC_13Ins.param2 = pBuff->protocalDataInject_DC.DC_13Ins.param2;
memset(&(Data.dataInject_DC.DC_13Ins.reserve),0,sizeof(Data.dataInject_DC.DC_13Ins.reserve));
break;
case 0x02:
Data.dataInject_DC.DC_WHTJ.param = pBuff->protocalDataInject_DC.DC_WHTJ.param;
Data.dataInject_DC.DC_WHTJ.param2 = pBuff->protocalDataInject_DC.DC_WHTJ.param2;
Data.dataInject_DC.DC_WHTJ.param3 = pBuff->protocalDataInject_DC.DC_WHTJ.param3;
Data.dataInject_DC.DC_WHTJ.param4 = pBuff->protocalDataInject_DC.DC_WHTJ.param4;
Data.dataInject_DC.DC_WHTJ.param5 = pBuff->protocalDataInject_DC.DC_WHTJ.param5;
Data.dataInject_DC.DC_WHTJ.param6 = pBuff->protocalDataInject_DC.DC_WHTJ.param6;
Data.dataInject_DC.DC_WHTJ.param7 = pBuff->protocalDataInject_DC.DC_WHTJ.param7;
Data.dataInject_DC.DC_WHTJ.param8 = pBuff->protocalDataInject_DC.DC_WHTJ.param8;
Data.dataInject_DC.DC_WHTJ.param9 = pBuff->protocalDataInject_DC.DC_WHTJ.param9;
Data.dataInject_DC.DC_WHTJ.param10 = pBuff->protocalDataInject_DC.DC_WHTJ.param10;
Data.dataInject_DC.DC_WHTJ.param11 = pBuff->protocalDataInject_DC.DC_WHTJ.param11;
Data.dataInject_DC.DC_WHTJ.param12 = pBuff->protocalDataInject_DC.DC_WHTJ.param12;
Data.dataInject_DC.DC_WHTJ.param13 = pBuff->protocalDataInject_DC.DC_WHTJ.param13;
Data.dataInject_DC.DC_WHTJ.param14 = pBuff->protocalDataInject_DC.DC_WHTJ.param14;
break;
default:
break;
}
Data.crc16 = pBuff->crc16;
}
//void Phrase(const BYTE* Src, const UINT32 Count)
//{
//}
virtual struCHECK CheckCRC(BYTE* const p)
{
//return MakeCheckSum_WuHanTJDC(p,31);
return MakeCheckCRC(p+2,16);
}
};
#endif//_CDCFrameCkCmdFrame_

@ -0,0 +1,321 @@
// DCOverrollDlg.cpp : 实现文件
//
#include "stdafx.h"
#include "DCOverrollDlg.h"
#include "afxdialogex.h"
// DCOverrollDlg 对话框
IMPLEMENT_DYNAMIC(DCOverrollDlg, CDialogEx)
DCOverrollDlg::DCOverrollDlg(CWnd* pParent /*=NULL*/)
: CDialogEx(DCOverrollDlg::IDD, pParent)
{
//m_bkBrush.CreateSolidBrush(BKGCLR);
m_CurSelect = 99;
}
DCOverrollDlg::~DCOverrollDlg()
{
/*关闭定时器*/
DelateTimer();
}
//定时器回调函数
void FAR PASCAL m_DCOverrollTimer(WORD IDEvent, WORD uReserved, DWORD dwUser, DWORD dwReserved1, DWORD dwReserve2)
{
DCOverrollDlg *m_pView = (DCOverrollDlg *)dwUser;
m_pView->DC0verrollStep(dwUser);
}
void DCOverrollDlg::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
//DDX_Control(pDX, IDC_STATIC_DC, m_DCFrameInfoTab);
DDX_Control(pDX, IDC_STATIC_DC, m_ShowPosition);
}
BEGIN_MESSAGE_MAP(DCOverrollDlg, CDialogEx)
//ON_COMMAND(ID_13Ins, &DCOverrollDlg::OnUpdate13Ins)
//ON_UPDATE_COMMAND_UI(ID_WHTJ, &DCOverrollDlg::OnUpdateWHTJ)
ON_WM_CTLCOLOR()
ON_WM_CLOSE()
ON_BN_CLICKED(IDC_BTN_SHOW, &DCOverrollDlg::OnBnClickedBtnShow)
ON_CBN_SELCHANGE(IDC_DC_CHOSET, &DCOverrollDlg::OnCbnSelchangeDcChoset)
ON_BN_CLICKED(IDC_RADIO1, &DCOverrollDlg::OnBnClickedRadio1)
ON_BN_CLICKED(IDC_RADIO2, &DCOverrollDlg::OnBnClickedRadio2)
ON_MESSAGE(WM_PROCESS_DC_CMD, ProcessDCCMD)
END_MESSAGE_MAP()
HBRUSH DCOverrollDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialogEx::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: 在此更改 DC 的任何特性
/*
if(nCtlColor==CTLCOLOR_STATIC)
{
pDC->SetBkColor(RGB(0,0,0));
pDC->SetTextColor(TXTCLR);
pDC->SetBkMode(TRANSPARENT);
}*/
// TODO: 如果默认的不是所需画笔,则返回另一个画笔
return m_bkBrush;
}
// DCOverrollDlg 消息处理程序
BOOL DCOverrollDlg::OnInitDialog()
{
CDialogEx::OnInitDialog();
DlgDCOverroll_Hwnd = GetSafeHwnd();//获得自身的窗口句柄
//CRect m_crect;
//GetDlgItem(IDC_STATIC_DC_PUBLCI)->GetWindowRect(m_crect);
//ScreenToClient(&m_crect);
//this->MoveWindow(m_crect.left, m_crect.top, m_crect.Width()*1.05, m_crect.Height()*12);
this->CenterWindow();
///*根据屏幕分辨率最大化显示*/
//int cx = 0.65*GetSystemMetrics(SM_CXMAXIMIZED);
//int cy = 0.5*GetSystemMetrics(SM_CYMAXIMIZED);
//CRect rcRect(0,0,cx,cy);
//this->MoveWindow(rcRect,true);
//this->CenterWindow();
//CSize tabSize(180,25);
//m_DCFrameInfoTab.SetItemSize(tabSize);
//m_DCFrameInfoTab.SetNormalColor(RGB(230,230,230));
//m_DCFrameInfoTab.SetSelectedColor(0x32CD32);
CreateAllDlg();
((CComboBox *)GetDlgItem(IDC_DC_CHOSET))->InsertString(0, "13所吊舱控制");
((CComboBox *)GetDlgItem(IDC_DC_CHOSET))->InsertString(1, "天进吊舱控制");
((CComboBox *)GetDlgItem(IDC_DC_CHOSET))->SetCurSel(0);
((CButton *)GetDlgItem(IDC_RADIO1))->SetCheck(true);
/*启动定时器*/
//先关闭
DelateTimer();
//再启动
if((DCDC0verrollTimerId = timeSetEvent(20, 10, (LPTIMECALLBACK)m_DCOverrollTimer, (DWORD)this, TIME_PERIODIC)) == 0)
{
MessageBox( "通用控制吊舱定时器启动错误!" );
}
return 0;
}
BOOL DCOverrollDlg::CreateAllDlg()
{
CRect m_crect;
GetDlgItem(IDC_STATIC_DC_PUBLCI)->GetWindowRect(m_crect);//获得IDC_STATIC_DC_PUBLCI的位置
ScreenToClient(&m_crect);
CRect m_crect2;
GetDlgItem(IDC_STATIC_DC)->GetWindowRect(m_crect2);//获得IDC_STATIC_DC的位置
ScreenToClient(&m_crect2);
//吊舱新的控制方式 默认显示
if(!m_13InstituteDCNewDlg.GetSafeHwnd())
{
m_13InstituteDCNewDlg.Create(IDD_DIALOG_DC_13INSTITUTE_NEW,this);
}
m_13InstituteDCNewDlg.MoveWindow(m_crect2);//将IDD_DIALOG_DC_13INSTITUTE_NEW移到IDC_STATIC_DC_PUBLCI所在的位置
m_13InstituteDCNewDlg.ShowWindow(SW_SHOW);
if(!m_WHTJDCNewDlg.GetSafeHwnd())
{
m_WHTJDCNewDlg.Create(IDD_DIALOG_DC_WuHanTJ_NEW,this);
}
m_WHTJDCNewDlg.MoveWindow(m_crect2);//将IDD_DIALOG_DC_13INSTITUTE_NEW移到IDC_STATIC_DC_PUBLCI所在的位置
m_WHTJDCNewDlg.ShowWindow(SW_HIDE);
CRect m_RectShow; //显示部分的面积区域
GetWindowRect(&m_RectLarge);
GetDlgItem(IDC_STATIC_DC_PUBLCI)->GetWindowRect(&m_RectShow);
m_RectSmall.left = m_RectLarge.left;
m_RectSmall.top = m_RectLarge.top;
m_RectSmall.right = m_RectShow.right;
m_RectSmall.bottom = m_RectLarge.bottom;
SetWindowPos(NULL,0,0,m_RectSmall.Width(),m_RectSmall.Height(),SWP_NOMOVE|SWP_NOZORDER);
return true;
}
//定时器处理函数
void DCOverrollDlg::DC0verrollStep(DWORD)
{
}
void DCOverrollDlg::DelateTimer()
{
if(DCDC0verrollTimerId!=0)
{
timeKillEvent(DCDC0verrollTimerId);
DCDC0verrollTimerId = 0;
}
}
void DCOverrollDlg::OnClose()
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
/*关闭定时器*/
DelateTimer();
m_CurSelect = 99;
CDialogEx::OnClose();
}
void DCOverrollDlg::OnBnClickedBtnShow()
{
// TODO: 在此添加控件通知处理程序代码
CString str;
GetDlgItemText(IDC_BTN_SHOW, str);
if(str == _T("扩展显示>>"))
{
SetDlgItemText(IDC_BTN_SHOW, _T("隐藏显示<<"));
SetWindowPos(NULL, 0, 0, m_RectLarge.Width(), m_RectLarge.Height(),SWP_NOMOVE|SWP_NOZORDER);
}
else if(str == _T("隐藏显示<<"))
{
SetDlgItemText(IDC_BTN_SHOW, _T("扩展显示>>"));
SetWindowPos(NULL, 0, 0, m_RectSmall.Width(), m_RectSmall.Height(),SWP_NOMOVE|SWP_NOZORDER);
}
}
//LRESULT DCOverrollDlg::ProcessDCCMD(WPARAM wParam, LPARAM lParam)
//{
// if(!gCurGCSCtrlFlag)
// {
// return 0;
// }
// if(m_CurSelect == 1)
// {
// m_WHTJDCNewDlg.UpdateTJDCAction((int)lParam);
// }
// else if(m_CurSelect == 0 || m_CurSelect == 99)//默认控制13所吊舱
// {
// m_13InstituteDCNewDlg.UpdateDC13Action((int)lParam);
// }
//
// return 0;
//}
void DCOverrollDlg::OnCbnSelchangeDcChoset()
{
// TODO: 在此添加控件通知处理程序代码
// TODO: 在此添加控件通知处理程序代码
//int a = m_DCFrameInfoTab.GetCurSel();
UpdateData( true );
int iCount =((CComboBox *)GetDlgItem(IDC_DC_CHOSET))->GetCurSel();
if(m_CurSelect != iCount)
{
m_CurSelect = iCount;
if(m_CurSelect == 0)
{
/*
//吊舱旧的控制方式
//删除天进吊舱对话框
m_WuHanTJDCDlg.ShowWindow(SW_HIDE);
m_WuHanTJDCDlg.DelateTimer();
m_WuHanTJDCDlg.m_DCCommonDateProcess.DelateTimer();
//显示13所吊舱控制对话框
m_13InstituteDCDlg.ShowWindow(SW_SHOW);
m_13InstituteDCDlg.InitializeTimer();
*/
//吊舱新的控制方式
//显示13所吊舱控制对话框
m_13InstituteDCNewDlg.ShowWindow(SW_SHOW);
//隐藏天进吊舱控制对话框
m_WHTJDCNewDlg.ShowWindow(SW_HIDE);
Sleep(120);
}
if(m_CurSelect == 1)
{
/*
//吊舱旧的控制方式
//删除13所吊舱对话框
m_13InstituteDCDlg.ShowWindow(SW_HIDE);
m_13InstituteDCDlg.DelateTimer();
m_13InstituteDCDlg.m_DCCommonDateProcess.DelateTimer();
//显示天进吊舱控制对话框
m_WuHanTJDCDlg.ShowWindow(SW_SHOW);
m_WuHanTJDCDlg.InitializeTimer();
*/
//吊舱新的控制方式
//隐藏13所吊舱控制对话框
m_13InstituteDCNewDlg.ShowWindow(SW_HIDE);
//显示天进吊舱控制对话框
m_WHTJDCNewDlg.ShowWindow(SW_SHOW);
Sleep(120);
}
if(m_CurSelect == 99)//默认显示13所吊舱
{
/*
//吊舱旧的控制方式
m_WuHanTJDCDlg.DelateTimer();
m_WuHanTJDCDlg.ShowWindow(SW_HIDE);
m_WuHanTJDCDlg.m_DCCommonDateProcess.DelateTimer();
m_13InstituteDCDlg.DelateTimer();
m_13InstituteDCDlg.ShowWindow(SW_HIDE);
m_13InstituteDCDlg.m_DCCommonDateProcess.DelateTimer();
*/
//吊舱新的控制方式
//隐藏13所吊舱控制对话框
m_13InstituteDCNewDlg.ShowWindow(SW_HIDE);
//隐藏天进吊舱控制对话框
m_WHTJDCNewDlg.ShowWindow(SW_HIDE);
Sleep(120);
}
}
}
void DCOverrollDlg::OnBnClickedRadio1()
{
m_CurSelect = 0;
//显示13所吊舱控制对话框
m_13InstituteDCNewDlg.ShowWindow(SW_SHOW);
//隐藏天进吊舱控制对话框
m_WHTJDCNewDlg.ShowWindow(SW_HIDE);
Sleep(120);
}
void DCOverrollDlg::OnBnClickedRadio2()
{
m_CurSelect = 1;
//隐藏13所吊舱控制对话框
m_13InstituteDCNewDlg.ShowWindow(SW_HIDE);
//显示天进吊舱控制对话框
m_WHTJDCNewDlg.ShowWindow(SW_SHOW);
Sleep(120);
}
LRESULT DCOverrollDlg::ProcessDCCMD(WPARAM wParam, LPARAM lParam)
{
if(m_CurSelect == 1)
{
m_WHTJDCNewDlg.UpdateTJDCAction((int)lParam);
}
//else if(m_CurSelect == 0 || m_CurSelect == 99)//默认控制13所吊舱
//{
// m_13InstituteDCNewDlg.UpdateDC13Action((int)lParam);
//}
return 0;
}

@ -0,0 +1,61 @@
#pragma once
#include "resource.h"
#include "DlgWHTJDCNew.h" //武汉天进对话框类新
#include "Dlg13InstituteDCNew.h" //13所吊舱对话框类新
#include "afxwin.h"
#include "CMDBtn.h"
#include "BtnST.h"
#include "afxdlgs.h"
// DCOverrollDlg 对话框
class DCOverrollDlg : public CDialogEx
{
DECLARE_DYNAMIC(DCOverrollDlg)
private:
CBrush m_bkBrush; //界面背景画刷
public:
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
public:
DCOverrollDlg(CWnd* pParent = NULL); // 标准构造函数
virtual ~DCOverrollDlg();
// 对话框数据
enum { IDD = IDD_DIALOG_DC };
virtual BOOL OnInitDialog();
BOOL CreateAllDlg();
//CXTabCtrl m_DCFrameInfoTab;
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
public:
//吊舱新的控制方式
Dlg13InstituteDCNew m_13InstituteDCNewDlg; //13所吊舱新控制界面对话框
DlgWHTJDCNew m_WHTJDCNewDlg; //武汉天进吊舱新控制界面对话框
private:
CRect m_RectLarge; //整个,整体全部面积区域
CRect m_RectSmall; //隐藏之后的面积区域
public:
//CMFCToolBar m_wndToolBar;
//afx_msg void OnUpdate13Ins();
//afx_msg void OnUpdateWHTJ(CCmdUI *pCmdUI);
void DC0verrollStep(DWORD); //定时器处理函数
int DCDC0verrollTimerId; //定时ID
int m_CurSelect;
void DelateTimer(); //删除定时器
afx_msg void OnBnClickedButton1();
afx_msg void OnClose();
afx_msg void OnBnClickedBtnShow();
LRESULT ProcessDCCMD(WPARAM param, LPARAM lparam); //
afx_msg void OnCbnSelchangeDcChoset();
CStatic m_ShowPosition;
afx_msg void OnBnClickedRadio1();
afx_msg void OnBnClickedRadio2();
};

File diff suppressed because it is too large Load Diff

@ -0,0 +1,106 @@
#pragma once
#include "resource.h"
#include "global.h"
#include <MMSystem.h>
#include "afxwin.h"
#include "DCFrameCkCmd.h"
#include "CYHMudpSend.h"//自定义组播发送
#include "CMDBtn.h"
// Dlg13InstituteDCNew 对话框
class Dlg13InstituteDCNew : public CDialogEx
{
DECLARE_DYNAMIC(Dlg13InstituteDCNew)
public:
Dlg13InstituteDCNew(CWnd* pParent = NULL); // 标准构造函数
virtual ~Dlg13InstituteDCNew();
// 对话框数据
enum { IDD = IDD_DIALOG_DC_13INSTITUTE_NEW };
virtual BOOL OnInitDialog();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
public:
void TimeStep(DWORD); //定时器处理函数
int mTimerId; //定时ID
int num; //指令计数
bool injectstart; //吊舱装订开始的标志
public:
UINT8 SwitchCmd; //开关指令
INT16 PitchControl; //俯仰控制量
INT16 DirControl; //方位控制量
INT16 PitchRecord; //俯仰量记录
INT16 DirRecord; //方位量记录
public:
void Update13InsNewCmdBuffer(HWND);//更新控制指令到吊舱协议
void UpdateDataZ70_13Ins();//更新buffer到帧结构体
void UpdateFrame(int&);
void UpdateFrame2(int&);
void UpdateFrame3(int&);
void UpdateFrame4(int&);
void UpdateFrame5();
void UpdateFrame6();
void UpdateFrame7();
void UpdateFrame8();
void UpdateFrame9(int&);
void UpdateFrame10(int&);
void UpdateFrame11(int&);
void UpdateFrame12(int&);
void UpdateFrame13(int&);
void UpdateFrame14();
void UpdateFrame15();
void UpdateFrame16(int&);
void UpdateFrame17(int&);
void UpdateFrame18(int&);
void UpdateFrame19(int&);
void UpdateFrame20();
void UpdateFrame21();
void UpdateFrame22(int&);
void UpdateFrame23(int&);
void UpdateFrame24(int&);
void UpdateFrame25(int&);
void UpdateFrame26(int&);
void UpdateFrame27(int&);
void UpdateFrame28(int&);
void UpdateFrame29(int&);
void UpdateFrame30(int&);
void UpdateFrame31(int&);
void UpdateFrame32(int&);
void UpdateFrame33(int&);
void UpdateFrame34(int&);
void UpdateFrame35();//俯仰+范围50~-110
void UpdateFrame36();//俯仰-
void UpdateFrame37();//方位+范围180~-180
void UpdateFrame38();//方位-
//void UpdateFrame39(int&);
//void UpdateFrame40(int&);
//void UpdateDC13Action(int);
public:
HANDLE hCheckThread;//线程
DWORD ThreadCheckIDRegion;
afx_msg LRESULT OnUpdate13DCFrame(WPARAM wParam, LPARAM lParam);
int InfraredOrVisibleLight;//红外可见光切换
virtual BOOL PreTranslateMessage(MSG* pMsg);
//CFont m_oFont;//字体
CMFCButton DC13InsBtn[38];
CCMDBtn m_DCFlyCmd[12];
double Param1;
double Param2;
BYTE DC13InsCmdBuffer[5];
public:
CBrush m_brush;
CFont m_font;
public:
//afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
CDCFrameCkCmdFrame DCFrameCkCmd13;//数据注入指令从控发送数据帧---13所吊舱
CYHMudpSend m_MudpSend;
};

File diff suppressed because it is too large Load Diff

@ -0,0 +1,126 @@
#pragma once
#include "resource.h"
#include "global.h"
#include <MMSystem.h>
#include "afxwin.h"
#include "DCFrameCkCmd.h"
#include "CYHMudpSend.h"//自定义组播发送
#include "CMDBtn.h"
//#include "MCBtn.h"
// DlgWHTJDCNew 对话框
class DlgWHTJDCNew : public CDialogEx
{
DECLARE_DYNAMIC(DlgWHTJDCNew)
public:
DlgWHTJDCNew(CWnd* pParent = NULL); // 标准构造函数
virtual ~DlgWHTJDCNew();
// 对话框数据
enum { IDD = IDD_DIALOG_DC_WuHanTJ_NEW };
virtual BOOL OnInitDialog();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
public:
CCMDBtn m_DCFlyCmd[12];
CMFCButton DC13InsBtn[44];
BYTE TJDCCmdBuffer[15];
public:
UINT8 SwitchCmd; //开关指令
INT16 PitchControl; //俯仰控制量
INT16 DirControl; //方位控制量
INT16 PitchRecord; //俯仰量记录
INT16 DirRecord; //方位量记录
double Param1;
double Param2;
UINT8 CharacterSuperpositionSet;//字符叠加设置
INT16 DirAndPitchCrlSize;//方位俯仰控制量
CString m_TarTakTemSizeSetWidth;
CString m_TarTakTemSizeSetHigth;
UINT8 FogThroughMode; //透雾模式
UINT8 PseudoColorSwitch;//伪色彩切换
CString m_FocalDistanceSet;//焦距设置
CString m_DigitalGuidancePitch;//数引模式 俯仰
CString m_DigitalGuidanceDir;//数引模式 方位
CString m_SCanModelAngle;//扫描设置 角度
CString m_SCanModelSpeed;//扫描设置 速度
CString m_DirSCanSetCentre;//方位扫描设置 中心
CString m_DirSCanSetRange;//方位扫描设置 范围
CString m_PitchSCanSetCentre;//俯仰扫描设置 中心
CString m_PitchSCanSetRange;//俯仰扫描设置 范围
int FocalDistanceSIZE;//调焦/变倍等级1-7
public:
void UpdateWHTJDCCmdBuffer(HWND);//更新控制指令到吊舱协议
void DlgWHTJDCNew::UpdateDataZ70_TJDC();//更新数据注入指令Z70
void UpdateFrame(); //俯仰+ 长按
void UpdateFrame2(); //俯仰- 长按
void UpdateFrame3(); //方位+ 长按
void UpdateFrame4(); //方位- 长按
void UpdateFrame5(int&); //复位
void UpdateFrame6(int&); //图像切换
void UpdateFrame7(); //焦距+ 长按
void UpdateFrame8(); //焦距- 长按
void UpdateFrame9(int&); //可见光跟踪
void UpdateFrame10(int&); //拍一张照
void UpdateFrame11(int&); //停止照相
void UpdateFrame12(int&); //字符叠加设置
void UpdateFrame13(int&); //选点跟踪
void UpdateFrame13_1(); //选点跟踪执行
void UpdateFrame14(int&); //设置参数保存
void UpdateFrame15(int&); //单次激光测距
void UpdateFrame16(int&); //连续照相
void UpdateFrame17(int&); //开始录像
void UpdateFrame18(int&); //停止录像
void UpdateFrame19(int&); //取消跟踪
void UpdateFrame20(int&); //跟踪模板大小设置
void UpdateFrame21(int&); //查询反馈
void UpdateFrame22(int&); //开启激光测距
void UpdateFrame23(int&); //伪色彩切换
void UpdateFrame24(int&); //红外快门补偿
void UpdateFrame25(int&); //电子放大
void UpdateFrame26(int&); //红外图像增强
void UpdateFrame27(int&); //云台扫描
void UpdateFrame28(int&); //垂直下视
void UpdateFrame29(int&); //停止激光测距
void UpdateFrame30(); //变倍+ 长按
void UpdateFrame31(int&); //透雾模式
void UpdateFrame32(int&); //关伺服
void UpdateFrame33(int&); //方位弱随动
void UpdateFrame34(); //变倍- 长按
void UpdateFrame35(int&); //低照度模式
void UpdateFrame36(int&); //焦距设置
void UpdateFrame37(int&); //收藏模式
void UpdateFrame38(int&); //方位锁定
void UpdateFrame39(int&); //数字引导 72
void UpdateFrame40(int&); //吊舱扫描设置
void UpdateFrame41(int&); //姿态指引 7C
void UpdateFrame43(int&); //方位扫描设置
void UpdateFrame44(int&); //俯仰扫描设置
void UpdateFrame100(int&); //吊舱行为1
void UpdateFrame101(int&); //吊舱行为2
void UpdateTJDCAction(int); //吊舱行为控制
public:
HANDLE hCheckThread;//线程
DWORD ThreadCheckIDRegion;
afx_msg LRESULT OnUpdateWHTJDCFrame(WPARAM wParam, LPARAM lParam);
int InfraredOrVisibleLight;//红外可见光切换
virtual BOOL PreTranslateMessage(MSG* pMsg);
private:
CBrush m_brush;
//CFont m_font;
public:
CDCFrameCkCmdFrame DCFrameCkCmdWHTJ;//数据注入指令从控发送数据帧---武汉天进吊舱
afx_msg void OnCbnSelchangeComboTjdc2();//伺服控制步长选择
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
};

@ -252,6 +252,13 @@ void CALLBACK GetEOImgCenterOffset(CPoint offset, int flag)
{
g_payloadCtrlProtocol = 11;
g_TrackOffset = offset;
//天进吊舱-选点跟踪
if(SelectPointTrack)
{
g_TrackOffset = offset;
::SendMessageA(DlgDCOverroll_Hwnd, WM_PROCESS_DC_CMD, 0, 2);
}
}
// 右键点击可见光或红外,转换为手动跟踪
@ -506,6 +513,177 @@ void CH96_h264DecodeResultCallbackFun(unsigned char* data,int width,int height)
ReleaseMutex(g_hMutex_DisplayVideoCH96);
}
//void ProcessCH96Data()
//{
// while(g_bProcessDataFlag)
// {
// try
// {
// WaitForSingleObject(g_hMutex_ProcessDataCH96, INFINITE);
// // 是否成功将数据复制到临时位置,表征变量
// bool bHaveRelease = false;
// // 最小帧长
// if (g_validDataLen >= 512)
// {
// //if(DCTypeSelected_video==2)//h264数据
// //{
// // if (g_CH96_h264decoder != nullptr)
// // {
// // g_CH96_h264decoder->decoding(g_receiveDataBuffer , 2560);
// // }
// // if (g_pFileSaveVideoDataCH96 != NULL && g_bVideoCapture == TRUE)
// // {
// // fwrite(g_receiveDataBuffer, static_cast<size_t>(1), 2560, g_pFileSaveVideoDataCH96); // 写数据
// // }
// //}
// //else//13所或武汉天进吊舱数据
// //{
//
// if (g_CH96_h264decoder != nullptr)
// {
// g_CH96_h264decoder->decoding(g_receiveDataBuffer , 2560);
// }
// // 找帧头
// int _head = 0; // head 从0开始计数
// bool _bfindhead = false;
// int SetMaxLoc = g_validDataLen - 256; // 最多找到离尾256个字节处
//
// unsigned char midBuffer[256];
//
// for (_head = 0; ((_head < SetMaxLoc) && (_bfindhead == false)); _head++)
// {
// if (g_receiveDataBuffer[_head + 0] == 0xEB &&
// g_receiveDataBuffer[_head + 1] == 0x90)
// {
// _bfindhead = true;
// break; // 跳出for循环
// }
// } // for 循环找帧头
//
// // 如果找到了帧头
// if (_bfindhead == true)
// {
// // 数据复制
// memcpy(midBuffer, g_receiveDataBuffer + _head, 256);
// // 更新内存
// unsigned int frameLen = 256;
// g_validDataLen = g_validDataLen - _head - frameLen;
// memcpy(g_receiveDataBuffer_middle, g_receiveDataBuffer + _head + frameLen, g_validDataLen);
// memcpy(g_receiveDataBuffer, g_receiveDataBuffer_middle, g_validDataLen);
// ReleaseMutex(g_hMutex_ProcessDataCH96);
// // 数据成功复制到临时位置
// bHaveRelease = true;
//
// //if(DCTypeSelected_video==0)//13所吊舱数据
// //{
// // 飞行遥测数据
// if (midBuffer[4] == 0x2A)
// {
//
// }
// // 复接数据
// else if (midBuffer[4] == 0x50)
// {
// // 获取复接数据只保留复接数据中的9-158字节共150字节
// WaitForSingleObject(g_hMutex_SaveFJData, INFINITE);
// memcpy(&g_CH96FJData, midBuffer + 8, 150);
// // 复接数据转换
// TransCH96FJData(g_CH96TransFJData, g_CH96FJData);
// // 复接数据转换为情报处理用复接数据
// TransCH96FJDatatoQBData(g_CH96QBData, g_CH96TransFJData);
// ReleaseMutex(g_hMutex_SaveFJData);
// // 组播页面显示FJ数据内容
// ::PostMessageA(g_MulticastSocketReceiveDlgHwnd, WN_SHOW_CH96_FJDATA, 0, 0);
// // 发送消息,复接数据栏显示复接数据
// //::PostMessageA(g_mainDlgHwnd, WM_SHOW_CH96_INFO, 0, 0);
// // 显示激光测距值
// ::PostMessageA(g_QBTargetTrackFunctionsHwnd, WM_SHOW_LASERDIS_QBFUNCTIONSDLG, 0, 0);
// // 更新地图状态
// ::PostMessageA(g_MapGuideHwnd, WM_UPDATA_GOOGLEMAP, 0, 0);
// }
// // 图像数据
// else if (midBuffer[4] == 0xD5)
// {
// // 解码
// if (g_CH96_h264decoder != nullptr)
// {
// g_CH96_h264decoder->decoding(midBuffer + 8, 248);
// g_UDPTrans2Server.WriteBuffer(midBuffer + 8, 248);
// }
// /*
// if(g_tcpStarted==true){
//
// memcpy(g_tcpData+26,midBuffer + 8, 248);
// //帧计数
// memcpy(g_tcpData+5,&g_frameCountTX,4);
// g_frameCountTX++;
// unsigned int crc_;
// crc_=CreateCRC2(g_tcpData+2, 272);
// memcpy(g_tcpData+274,&crc_,2);
// g_TCPYYDT.WriteBuffer(g_tcpData,276);
//
// //g_TCPYYDT.WriteBuffer(g_tcpData + 5,4);
// //g_TCPYYDT.WriteBuffer(g_tcpData + 26,248);
// }
// */
//
// // 存储数据
// // 写入本地文件
// if (g_pFileSaveVideoDataCH96 != NULL && g_bVideoCapture == TRUE)
// {
// fwrite(midBuffer + 8, static_cast<size_t>(1), 248, g_pFileSaveVideoDataCH96); // 写数据
// }
// }
// // 数据类型有误
// else
// {
// // do nothing
// }
// //}
//
//
// //else if(DCTypeSelected_video==1)//武汉天进吊舱数据 EB 90 H264
// //{
// // if (g_CH96_h264decoder != nullptr)
// // {
// // g_CH96_h264decoder->decoding(midBuffer + 2, 254);
// // }
// // if (g_pFileSaveVideoDataCH96 != NULL && g_bVideoCapture == TRUE)
// // {
// // fwrite(midBuffer + 2, static_cast<size_t>(1), 254, g_pFileSaveVideoDataCH96); // 写数据
// // }
// //}
//
//
// }
// // 没找到帧头
// else
// {
// // head之前的删掉
// g_validDataLen = g_validDataLen - _head;
// memcpy(g_receiveDataBuffer_middle, g_receiveDataBuffer + _head, g_validDataLen);
// memcpy(g_receiveDataBuffer, g_receiveDataBuffer_middle, g_validDataLen);
// }
//
//
// //}
//
//
//
// }
//
// if (bHaveRelease == false)
// {
// ReleaseMutex(g_hMutex_ProcessDataCH96);
// }
// }
// catch(...)
// {
// //ReleaseMutex(g_hMutex_ProcessDataCH96);
// }
// }
//}
void ProcessCH96Data()
{
while(g_bProcessDataFlag)
@ -517,6 +695,23 @@ void ProcessCH96Data()
bool bHaveRelease = false;
// 最小帧长
if (g_validDataLen >= 512)
{
if(DCTypeSelected_video==2)//h264数据
{
if (g_CH96_h264decoder != nullptr)
{
g_CH96_h264decoder->decoding(g_receiveDataBuffer , g_validDataLen);
}
if (g_pFileSaveVideoDataCH96 != NULL && g_bVideoCapture == TRUE)
{
fwrite(g_receiveDataBuffer, static_cast<size_t>(1), g_validDataLen, g_pFileSaveVideoDataCH96); // 写数据
}
g_validDataLen = 0;
}
else//13所或武汉天进吊舱数据
{
// 找帧头
int _head = 0; // head 从0开始计数
@ -548,6 +743,9 @@ void ProcessCH96Data()
ReleaseMutex(g_hMutex_ProcessDataCH96);
// 数据成功复制到临时位置
bHaveRelease = true;
if(DCTypeSelected_video==0)//13所吊舱数据
{
// 飞行遥测数据
if (midBuffer[4] == 0x2A)
{
@ -612,6 +810,22 @@ void ProcessCH96Data()
// do nothing
}
}
else if(DCTypeSelected_video==1)//武汉天进吊舱数据 EB 90 H264
{
if (g_CH96_h264decoder != nullptr)
{
g_CH96_h264decoder->decoding(midBuffer + 2, 254);
}
if (g_pFileSaveVideoDataCH96 != NULL && g_bVideoCapture == TRUE)
{
fwrite(midBuffer + 2, static_cast<size_t>(1), 254, g_pFileSaveVideoDataCH96); // 写数据
}
}
}
// 没找到帧头
else
{
@ -620,6 +834,12 @@ void ProcessCH96Data()
memcpy(g_receiveDataBuffer_middle, g_receiveDataBuffer + _head, g_validDataLen);
memcpy(g_receiveDataBuffer, g_receiveDataBuffer_middle, g_validDataLen);
}
}
}
if (bHaveRelease == false)
@ -633,6 +853,7 @@ void ProcessCH96Data()
}
}
}
// 获取CH96复接数据
void TransCH96FJData(Data96TXD &dst, Protocal96TXD &src)
{
@ -2770,6 +2991,11 @@ void ProcessH264VideoData()
{
g_CH96_h264decoder->decoding(g_receiveDataBufferSocket, g_validDataLenSocket);
}
// 天进吊舱解码
if (g_CH96_h264decoder != nullptr)
{
g_CH96_h264decoder->decoding(g_receiveDataBufferSocket , 25600);
}
}
/*if (bHaveRelease == false)
@ -2800,3 +3026,68 @@ void GetSerialPortNumber(char *port, const CString portID)
memcpy( port, str.GetBuffer( 255 ), str.GetLength() );
str.ReleaseBuffer();
}
//正数+负数
bool IsNumber(CString str)
{
str = str.Trim();
if (str == "")
{
return false;
}
if (str[0] == '-') //可能为负数
{
str = str.Mid(1);
}
if (str.SpanIncluding(_T("0123456789.")) != str)
{
return false;
}
return true;
}
//正数
bool IsPositiveNumber(CString str)
{
str = str.Trim();
if(str == "")
{
return false;
}
if(str.SpanIncluding(_T("0123456789.")) != str)
{
return false;
}
return true;
}
//整数
bool IsInteger(CString str)
{
str = str.Trim();
if (str == "")
{
return false;
}
if (str[0] == '-') //可能为负数
{
str = str.Mid(1);
}
if (str.SpanIncluding(_T("0123456789")) != str)
{
return false;
}
return true;
}
//正整数
bool IsPositiveInteger(CString str)
{
str = str.Trim();
if (str == "")
{
return false;
}
if (str.SpanIncluding(_T("0123456789")) != str)
{
return false;
}
return true;
}

@ -3,7 +3,7 @@
#include "GlobalMember.h" // 全局变量
#include "MUDP.h"
#include "FrameFKU_Camera.h"
#include "MulticastSocket.h"
#define SAFE_DELETE(p) { if(p) { delete (p); (p) = nullptr; } }
#define SAFE_DELETE_ARRAY(p) { if(p) { delete[] (p); (p) = nullptr; } }
@ -12,6 +12,7 @@ extern CFrameFK_U_CAMERA g_FrameCamera;
extern CMUDP g_MUDPCamera;
extern BOOL g_IsSending;
// 获取指定磁盘剩余空间
extern long GetFreeVolumeLen(char *p = "C");
// 功能:获取软件当前工作目录
@ -137,3 +138,8 @@ extern void SocketReceiveH264VideoData(const void* buffer, int length);
extern void ProcessH264VideoData();
extern void GetSerialPortNumber(char *port, const CString portID);//串口数字换算到标准的串口输出
extern bool IsNumber(CString str);//正数+负数
extern bool IsPositiveNumber(CString str);//正数
extern bool IsInteger(CString str);//整数
extern bool IsPositiveInteger(CString str);//正整数

@ -488,3 +488,15 @@ CString gComBaudItems[BAUDITEMNUM] =
"57600",
"115200"
};
bool g_bBindData = false;//是否在装订的标志
//13所吊舱控制新
int g_commandNum; //控制指令序号
CDCFrameCkCmdFrame g_DCFrameCkCmd13; //数据注入指令从控发送数据帧---13所吊舱
//武汉天进吊舱控制
int g_WHTJDCCmdNum; //控制指令序号
int DCTypeSelected_video = 0; //吊舱类型选择_图像接收
bool SelectPointTrack;//选点跟踪
HWND DlgDCOverroll_Hwnd; //DCOverrollDlg句柄
float m_wndShowEO_Position_Max_x; //图像显示区域的坐标最大值x
float m_wndShowEO_Position_Max_y; //图像显示区域的坐标最大值y

@ -12,6 +12,7 @@ using namespace cv;
#include "QBStru.h"
#include "FrameIMP_DOWN.h"
#include "DlgIMP.h"
#include "DCFrameCkCmd.h"
// 命名
typedef unsigned __int8 UINT8;
@ -499,3 +500,19 @@ const unsigned BAUDITEMNUM =10; //
const unsigned NCOUNTER=500; //失败尝试次数
//波特率列表
extern CString gComBaudItems[BAUDITEMNUM];
extern bool g_bBindData;//是否在装订的标志
//13所吊舱控制新
#define WM_13DC_UPDAFRAME WM_USER + 148 //
extern int g_commandNum; //控制指令序号
extern CDCFrameCkCmdFrame g_DCFrameCkCmd13; //数据注入指令从控发送数据帧---13所吊舱
//武汉天进吊舱控制
#define WM_WHTJDC_UPDAFRAME WM_USER + 149 //
extern int g_WHTJDCCmdNum; //控制指令序号
extern int DCTypeSelected_video; //吊舱类型选择_图像接收
extern bool SelectPointTrack;//选点跟踪
extern HWND DlgDCOverroll_Hwnd; //DCOverrollDlg句柄
extern float m_wndShowEO_Position_Max_x; //图像显示区域的坐标最大值x
extern float m_wndShowEO_Position_Max_y; //图像显示区域的坐标最大值y

@ -96,4 +96,8 @@ const UINT WM_OUTPUT_QUADRANGLE = WM_USER + 6007;
#define WM_UPDATE_IMPDOWN_CHECKED WM_USER + 7008
#define WM_UPDATE_IMP_SERIAL_CONNECT WM_USER + 7009
//µõ²Õ
#define WM_PROCESS_DC_CMD WM_USER + 7010
#endif

@ -69,7 +69,7 @@ CMulticastSocketReceiveDlg::~CMulticastSocketReceiveDlg()
void CMulticastSocketReceiveDlg::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Control(pDX, IDC_IPADDRESS4,m_IPAddress_MultiCastIP);
DDX_Control(pDX, IDC_IPADDRESS4,m_IPAddress_MultiCastIP);//网络IP
DDX_Radio(pDX, IDC_RADIO_L, m_iVideoSrc);
@ -94,6 +94,9 @@ BEGIN_MESSAGE_MAP(CMulticastSocketReceiveDlg, CDialogEx)
ON_BN_CLICKED(IDC_BTN_IMP_SERIAL_CONNECT, &CMulticastSocketReceiveDlg::OnBnClickedBtnImpSerialConnect)
ON_BN_CLICKED(IDC_BTN_IMP_SERIAL_DISCONNECT, &CMulticastSocketReceiveDlg::OnBnClickedBtnImpSerialDisconnect)
ON_BN_CLICKED(IDC_RADIO_DC_13Ins, &CMulticastSocketReceiveDlg::OnBnClickedRadioDc13ins)
ON_BN_CLICKED(IDC_RADIO_DC_WHTJ, &CMulticastSocketReceiveDlg::OnBnClickedRadioDcWhtj)
ON_BN_CLICKED(IDC_RADIO_H264Data, &CMulticastSocketReceiveDlg::OnBnClickedRadioH264data)
END_MESSAGE_MAP()
BOOL CMulticastSocketReceiveDlg::OnInitDialog()
@ -126,6 +129,10 @@ BOOL CMulticastSocketReceiveDlg::OnInitDialog()
//添加波特率到列表框
AddBaudNumberToComboBox();
((CButton *)GetDlgItem(IDC_RADIO_DC_13Ins))->SetCheck(true);
((CButton *)GetDlgItem(IDC_RADIO_DC_WHTJ))->SetCheck(false);
((CButton *)GetDlgItem(IDC_RADIO_H264Data))->SetCheck(false);
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}
@ -186,6 +193,9 @@ void CMulticastSocketReceiveDlg::OnBnClickedBtnMultisocketConnect()
GetDlgItem(IDC_RADIO_L)->EnableWindow(FALSE);
GetDlgItem(IDC_RADIO_SAC1)->EnableWindow(FALSE);
GetDlgItem(IDC_RADIO_SAC2)->EnableWindow(FALSE);
GetDlgItem(IDC_RADIO_DC_13Ins)->EnableWindow(FALSE);
GetDlgItem(IDC_RADIO_DC_WHTJ)->EnableWindow(FALSE);
GetDlgItem(IDC_RADIO_H264Data)->EnableWindow(FALSE);
//UDP服务器传输
g_UDPTrans2Server.SetCallBack(NULL, this);
@ -410,7 +420,9 @@ void CMulticastSocketReceiveDlg::OnBnClickedBtnMultisocketDisconnect()
GetDlgItem(IDC_RADIO_L)->EnableWindow(TRUE);
GetDlgItem(IDC_RADIO_SAC1)->EnableWindow(TRUE);
GetDlgItem(IDC_RADIO_SAC2)->EnableWindow(TRUE);
GetDlgItem(IDC_RADIO_DC_13Ins)->EnableWindow(TRUE);
GetDlgItem(IDC_RADIO_DC_WHTJ)->EnableWindow(TRUE);
GetDlgItem(IDC_RADIO_H264Data)->EnableWindow(TRUE);
}
void CMulticastSocketReceiveDlg::ShowMulticastSocketInfo()
@ -480,7 +492,16 @@ void CMulticastSocketReceiveDlg::CreateUDPSocketReceiveData()
{
//卫通UDP连接
m_nSACUDPSocket.SetCallBack(OnReadFromUDPSACKU, this);
CString strLocalIPAddr = _T("192.168.1.20"); // ÎÀͨ½ÓÊÜIP
CString strLocalIPAddr;
strLocalIPAddr = _T("192.168.1.20"); // 卫通接受IP
GetDlgItem(IDC_EDIT_LOCALIP_RECEIVE)->GetWindowTextA(strLocalIPAddr);
/*自测用*/
//strLocalIPAddr = _T("172.10.1.183");
//m_strSACUDPIPAddr = _T("172.10.1.183");
//m_nSACUDPLocalPort = 8080;
//m_nSACUDPRemotePort = 8081;
/*自测用*/
m_nSACUDPSocket.SetParams(strLocalIPAddr, m_nSACUDPLocalPort, m_strSACUDPIPAddr, m_nSACUDPRemotePort);
if (m_nSACUDPSocket.StartListening())
{
@ -673,8 +694,6 @@ void CMulticastSocketReceiveDlg::OnBnClickedBtnImpSerialConnect()
::SendMessageA(g_IMPDLGhwnd,WM_UPDATE_IMP_SERIAL_CONNECT,(WPARAM)mComPortIMP.AllocSysString(), (LPARAM)mComBaudIMP.AllocSysString());
}
void CMulticastSocketReceiveDlg::OnBnClickedBtnImpSerialDisconnect()
{
// TODO: 在此添加控件通知处理程序代码
@ -683,3 +702,50 @@ void CMulticastSocketReceiveDlg::OnBnClickedBtnImpSerialDisconnect()
::SendMessageA(g_IMPDLGhwnd,WM_UPDATE_IMP_SERIAL_CONNECT,(WPARAM)mComPortIMP.AllocSysString(), (LPARAM)mComBaudIMP.AllocSysString());
}
void CMulticastSocketReceiveDlg::OnBnClickedRadioDc13ins()
{
// TODO: 在此添加控件通知处理程序代码
UpdateData(TRUE);
DCTypeSelected_video = 0;
//switch(m_DCvideoTypeSelct)
//{
//case 0:
// DCTypeSelected_video =0;
// break;
//case 1:
// DCTypeSelected_video =1;
// break;
//case 2:
// DCTypeSelected_video =2;
// break;
//default:
// DCTypeSelected_video =0;
//}
((CButton *)GetDlgItem(IDC_RADIO_DC_13Ins))->SetCheck(true);
((CButton *)GetDlgItem(IDC_RADIO_DC_WHTJ))->SetCheck(false);
((CButton *)GetDlgItem(IDC_RADIO_H264Data))->SetCheck(false);
}
void CMulticastSocketReceiveDlg::OnBnClickedRadioDcWhtj()
{
// TODO: 在此添加控件通知处理程序代码
UpdateData(TRUE);
DCTypeSelected_video = 1;
((CButton *)GetDlgItem(IDC_RADIO_DC_13Ins))->SetCheck(false);
((CButton *)GetDlgItem(IDC_RADIO_DC_WHTJ))->SetCheck(true);
((CButton *)GetDlgItem(IDC_RADIO_H264Data))->SetCheck(false);
}
void CMulticastSocketReceiveDlg::OnBnClickedRadioH264data()
{
// TODO: 在此添加控件通知处理程序代码
UpdateData(TRUE);
DCTypeSelected_video = 2;
((CButton *)GetDlgItem(IDC_RADIO_DC_13Ins))->SetCheck(false);
((CButton *)GetDlgItem(IDC_RADIO_DC_WHTJ))->SetCheck(false);
((CButton *)GetDlgItem(IDC_RADIO_H264Data))->SetCheck(true);
}

@ -33,7 +33,8 @@ public:
CString str_LocalIP_ReceiveMUDP;
CIPAddressCtrl m_IPAddress_MultiCastIP; //×é²¥
CIPAddressCtrl m_IPAddress_MultiCastIP; //组播 //网络IP
// WinSoc
HANDLE m_hThread_GetFH96DataFromNet;
DWORD m_ThreadID_GetFH96DataFromNet;
@ -107,4 +108,8 @@ private:
public:
afx_msg void OnBnClickedBtnImpSerialConnect();
afx_msg void OnBnClickedBtnImpSerialDisconnect();
afx_msg void OnBnClickedRadioDc13ins();//吊舱类型选择-13所吊舱
afx_msg void OnBnClickedRadioDcWhtj();//吊舱类型选择-武汉天进吊舱
afx_msg void OnBnClickedRadioH264data();//吊舱类型选择-h264数据
int m_DCvideoTypeSelct;
};

@ -1,3 +1,18 @@
202401221
增加IMP对话框
增加IMP上下行通信连接
20240510
增加13所吊舱控制功能
隐藏IMP对话框及上下行通信连接
20240617
优化13所吊舱控制协议帧
增加天进吊舱控制功能
优化控制指令发送逻辑(装订指令)
增加视频管理计算机指令(开关指令)发送
增加13所吊舱协议、天进吊舱协议、H264裸流视频协议解析选择
增加天进吊舱点击“单点跟踪”按钮后,双击图像区域发送吊舱跟踪坐标点
20240719
修改点单跟踪功能优化
Loading…
Cancel
Save