diff --git a/Include/calc_api.h b/Include/calc_api.h new file mode 100644 index 0000000..c2ab965 --- /dev/null +++ b/Include/calc_api.h @@ -0,0 +1,89 @@ +#pragma once +#include + +#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 \ No newline at end of file diff --git a/Include/libcalcdis/relsease/calc_api.h b/Include/libcalcdis/relsease/calc_api.h new file mode 100644 index 0000000..553ad3a --- /dev/null +++ b/Include/libcalcdis/relsease/calc_api.h @@ -0,0 +1,89 @@ +#pragma once +#include + +#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 \ No newline at end of file diff --git a/Include/libcalcdis/relsease/libcalcdis.dll b/Include/libcalcdis/relsease/libcalcdis.dll new file mode 100644 index 0000000..ecbf4ba Binary files /dev/null and b/Include/libcalcdis/relsease/libcalcdis.dll differ diff --git a/Src/CH91PayloadSoftware/CH91PayloadSoftware.rc b/Src/CH91PayloadSoftware/CH91PayloadSoftware.rc index 37da237..8e86fc1 100644 Binary files a/Src/CH91PayloadSoftware/CH91PayloadSoftware.rc and b/Src/CH91PayloadSoftware/CH91PayloadSoftware.rc differ diff --git a/Src/CH91PayloadSoftware/CH91PayloadSoftware.vcxproj b/Src/CH91PayloadSoftware/CH91PayloadSoftware.vcxproj index 3061e0d..e344180 100644 --- a/Src/CH91PayloadSoftware/CH91PayloadSoftware.vcxproj +++ b/Src/CH91PayloadSoftware/CH91PayloadSoftware.vcxproj @@ -72,9 +72,9 @@ Windows true - 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) + 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;libcalcdis.lib;%(AdditionalDependencies) $(OutDir)$(TargetName)$(TargetExt) - C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\ProgramFiles\opencv245\lib\x86;C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\ProgramFiles\gdal\lib;%(AdditionalLibraryDirectories) + C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\ProgramFiles\opencv245\lib\x86;C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\ProgramFiles\gdal\lib;C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\client-video\Include\libcalcdis\debug;%(AdditionalLibraryDirectories) false @@ -104,7 +104,7 @@ true true 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) - C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\ProgramFiles\gdal\lib;C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\ProgramFiles\opencv245\lib\x86;%(AdditionalLibraryDirectories) + C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\ProgramFiles\gdal\lib;C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\ProgramFiles\opencv245\lib\x86;C:\1銆丠tsdfp\2銆丟CS\3銆丗H-98鏈鸿浇鐩告満鐩戞帶杞欢2023\client-video\Include\libcalcdis\relsease;%(AdditionalLibraryDirectories) false @@ -162,6 +162,7 @@ + @@ -169,6 +170,8 @@ + + @@ -228,6 +231,8 @@ + + diff --git a/Src/CH91PayloadSoftware/CH91PayloadSoftware.vcxproj.filters b/Src/CH91PayloadSoftware/CH91PayloadSoftware.vcxproj.filters index 3a99993..947ff04 100644 --- a/Src/CH91PayloadSoftware/CH91PayloadSoftware.vcxproj.filters +++ b/Src/CH91PayloadSoftware/CH91PayloadSoftware.vcxproj.filters @@ -97,6 +97,12 @@ {be9a2dce-ba4c-44fd-9db6-fefe7b53caa0} + + {cb87282a-274d-4638-a083-106c128d494c} + + + {2a097b77-7c88-49b8-a119-d4c206be658a} + @@ -387,20 +393,29 @@ IMP\鍗忚 - + CYH鏂板 - CYH鏂板 + CYH鏂板\鍚婅埍鎺у埗 - - CYH鏂板 + + CYH鏂板\鍚婅埍鎺у埗 + + + CYH鏂板\鍚婅埍鎺у埗 - CYH鏂板 + CYH鏂板\鍚婅埍鎺у埗 - - CYH鏂板 + + CYH鏂板\闈跺悜鐩爣 + + + CYH鏂板\闈跺悜鐩爣 + + + CYH鏂板\闈跺悜鐩爣 @@ -527,17 +542,23 @@ IMP\鍗忚 - - CYH鏂板 - CYH鏂板 + + CYH鏂板\鍚婅埍鎺у埗 + + + CYH鏂板\鍚婅埍鎺у埗 + - CYH鏂板 + CYH鏂板\鍚婅埍鎺у埗 - - CYH鏂板 + + CYH鏂板\闈跺悜鐩爣 + + + CYH鏂板\闈跺悜鐩爣 diff --git a/Src/CH91PayloadSoftware/CalcDestination.cpp b/Src/CH91PayloadSoftware/CalcDestination.cpp new file mode 100644 index 0000000..9330b41 --- /dev/null +++ b/Src/CH91PayloadSoftware/CalcDestination.cpp @@ -0,0 +1,84 @@ +#include "stdAfx.h" +#include "CalcDestination.h" +// +// +//CalcDestination::CalcDestination() +//{ +// memset(&_calcData, 0 , sizeof(CALC_DES_DATA)); +// memset(&_airDropLocation, 0 , sizeof(DES_LOCATION)); +//} +// +//CalcDestination::~CalcDestination() +//{ +//} +// +///********************************************** +//* @func setFlyParameter +//* @brief 设置飞机定位数据参数 +//* @param DataFKD 飞机遥测 +//**********************************************/ +//void CalcDestination::setFlyLocationParameter(const DataFKD& data) +//{ +// _calcData.FlyCurrentLongitude = data.DataA2.GPSLongitude;//data.DataA8.OEM718DLon; +// _calcData.FlyCurrentLatitude = data.DataA2.GPSLatitude;//data.DataA8.OEM718DLat; +// _calcData.FlyCurrentHeight = data.DataA2.HBHeight;//data.DataA8.OEM718DAlt; +//} +// +///********************************************** +//* @func setFlyAttitudeParmeter +//* @brief 设置飞机姿态数据参数 +//* @param DataFKD 飞机遥测 +//**********************************************/ +//void CalcDestination::setFlyAttitudeParmeter(const DataFKD& data) +//{ +// _calcData.FlyHeadingAngle = data.DataA7.Heading; +// _calcData.FlyPitchAngle = data.DataA7.Pitch; +// _calcData.FlyRollAngle = data.DataA7.Roll; +//} +// +///********************************************** +//* @func setPodAttitudeParmerter +//* @brief 设置吊舱姿态数据参数 +//* @param DataFKD 飞机遥测 +//**********************************************/ +//void CalcDestination::setPodAttitudeParmerter(const DataFKD& data) +//{ +// _calcData.PodDirectionAngle = data.DataAC.sub1.PodYaw; +// _calcData.PodPitchAngle = data.DataAC.sub1.PodPitch; +// _calcData.PodRollAngle = data.DataAC.sub1.PodRoll; +// _calcData.LaserDistance = data.DataAC.sub2.TargetDistance;//100;//data.DataAC.sub1. 激光测距距离参数 +//} +// +///********************************************** +//* @func setDesLocation +//* @brief 设置空投靶向目标点定位数据 +//* @param DataFKD 飞机遥测 +//**********************************************/ +//void CalcDestination::setDesLocation(double lat, double lon, float height) +//{ +// _airDropLocation.Dislatitude = lat; +// _airDropLocation.DisLongitude = lon; +// _airDropLocation.DisHeight = height; +//} +// +///********************************************** +//* @func calcDesLocation +//* @brief 根据飞机与吊舱姿态数据计算目标点的定位信息 +//* @param DataFKD 飞机遥测 +//**********************************************/ +//void CalcDestination::calcDesLocation(DES_LOCATION& desLoaction) +//{ +// desLoaction = calcDisLocation2(_calcData); +//} +// +///********************************************** +//* @func calcDesLocation +//* @brief 根据飞机与吊舱姿态数据计算目标点的定位信息 +//* @param DataFKD 飞机遥测 +//**********************************************/ +//void CalcDestination::calcPodNeedAngle(POD_NEED_ANGLE& needAngle) +//{ +// auto angle = calcPodNeedAngle2(_calcData, _airDropLocation); +// needAngle.directionAngle = angle.directionAngle; +// needAngle.PitchAngle = angle.PitchAngle; +//} diff --git a/Src/CH91PayloadSoftware/CalcDestination.h b/Src/CH91PayloadSoftware/CalcDestination.h new file mode 100644 index 0000000..af05ca4 --- /dev/null +++ b/Src/CH91PayloadSoftware/CalcDestination.h @@ -0,0 +1,34 @@ +#pragma once +#include "calc_api.h" +//#include "framelib/FrameFKD_JE.h" +// +//class CalcDestination : public CBCGPPropertyPage +//{ +//public: +// CalcDestination(); +// virtual ~CalcDestination(); +// +// //设置飞机位置信息参数 +// void setFlyLocationParameter(const DataFKD& data); +// +// //设置飞机姿态信息参数 +// void setFlyAttitudeParmeter(const DataFKD& data); +// +// //设置吊舱姿态信息参数 +// void setPodAttitudeParmerter(const DataFKD& data); +// +// //设置空投靶向目标点定位数据 +// void setDesLocation(double lat, double lon, float height); +// +// //计算目标点位置 +// void calcDesLocation(DES_LOCATION& desLoaction); +// +// //计算空投目标点转向与俯仰应变化的角度 +// void calcPodNeedAngle(POD_NEED_ANGLE& needAngle); +// +//private: +// CALC_DES_DATA _calcData; //空投靶向目标需求飞机、吊舱相关数据 +// DES_LOCATION _desLocation;//目标点位置信息 +// DES_LOCATION _airDropLocation;//空投点位置信息 +//}; +// diff --git a/Src/CH91PayloadSoftware/CalcDestinationDlg.cpp b/Src/CH91PayloadSoftware/CalcDestinationDlg.cpp new file mode 100644 index 0000000..1f84ae2 --- /dev/null +++ b/Src/CH91PayloadSoftware/CalcDestinationDlg.cpp @@ -0,0 +1,120 @@ +#include "StdAfx.h" +#include "CalcDestinationDLG.h" +// +//IMPLEMENT_DYNAMIC(CalcDestinationDLG, CBCGPPropertyPage) +// +//CalcDestinationDLG::CalcDestinationDLG(CWnd* pParent) +//: CBCGPPropertyPage(CalcDestinationDLG::IDD) +//, _airDropLon(0.0) +//, _airDropLat(0.0) +//, _airDropHeight(0.0) +//, _podPitch(0.0) +//, _podYaw(0.0) +//, _desLon(0.0) +//, _desLat(0.0) +//, _desHeight(0.0) +//{ +// memset(&_podNeedAngle, 0,sizeof(POD_NEED_ANGLE)); +// memset(&_desLocation, 0 ,sizeof(DES_LOCATION)); +//} +// +//CalcDestinationDLG::~CalcDestinationDLG() +//{ +//} +// +//void CalcDestinationDLG::DoDataExchange(CDataExchange* pDX) +//{ +// CBCGPPropertyPage::DoDataExchange(pDX); +// +// DDX_Text(pDX, IDC_EDIT_AIR_LON, _airDropLon); +// DDX_Text(pDX, IDC_EDIT_AIR_LAT, _airDropLat); +// DDX_Text(pDX, IDC_EDIT_AIR_HEIGHT, _airDropHeight); +// DDX_Text(pDX, IDC_EDIT_RAW, _podYaw); +// DDX_Text(pDX, IDC_EDIT_PITCH, _podPitch); +// DDX_Text(pDX, IDC_EDIT_DES_LON, _desLon); +// DDX_Text(pDX, IDC_EDIT_DES_LAT, _desLat); +// DDX_Text(pDX, IDC_EDIT_DES_HEIGHT, _desHeight); +// +//} +// +//BEGIN_MESSAGE_MAP(CalcDestinationDLG, CBCGPPropertyPage) +// ON_BN_CLICKED(IDC_BUTTON_SETLOCATION, &CalcDestinationDLG::onBtnClickedSetFlyLocation) +// ON_BN_CLICKED(IDC_BUTTON_SETLOCATION2, &CalcDestinationDLG::onBtnClickedSetAirLocation) +// ON_BN_CLICKED(IDC_BUTTON_CALCANGLE, &CalcDestinationDLG::onBtnClickedCalcAngle) +// ON_BN_CLICKED(IDC_BUTTON_CALC, &CalcDestinationDLG::onBtnClickedCalc) +// +// ON_BN_CLICKED(IDC_BUTTON_TURN, &CalcDestinationDLG::OnBnClickedButtonTurn) +//END_MESSAGE_MAP() +// +//void CalcDestinationDLG::onBtnClickedSetFlyLocation() +//{ +// CString str; +// if(g_CurFrameFKD != NULL) +// { +// str.Format("%.7f",g_CurFrameFKD->Data.DataA2.GPSLongitude); //经度 +// GetDlgItem(IDC_EDIT_AIR_LON)->SetWindowText(str); +// str.Format("%.7f",g_CurFrameFKD->Data.DataA2.GPSLatitude); //纬度 +// GetDlgItem(IDC_EDIT_AIR_LAT)->SetWindowText(str); +// str.Format("%.2f",g_CurFrameFKD->Data.DataA2.HBHeight); //海拔高度 +// GetDlgItem(IDC_EDIT_AIR_HEIGHT)->SetWindowText(str); +// +// _airDropLon = g_CurFrameFKD->/*Data.DataA8.OEM718DLon;*/Data.DataA2.GPSLongitude; //经度 +// _airDropLat = g_CurFrameFKD->/*Data.DataA8.OEM718DLat;*/Data.DataA2.GPSLatitude; //纬度 +// _airDropHeight = g_CurFrameFKD->/*Data.DataA8.OEM718DAlt;*/Data.DataA2.HBHeight; //海拔高度 +// } +//} +// +//void CalcDestinationDLG::onBtnClickedSetAirLocation() +//{ +// UpdateData(TRUE); +// g_calcDestination.setDesLocation(_airDropLat, _airDropLon, _airDropHeight); +//} +// +//void CalcDestinationDLG::onBtnClickedCalcAngle() +//{ +// +// g_calcDestination.calcPodNeedAngle(_podNeedAngle); +// +// _podPitch = _podNeedAngle.PitchAngle; +// _podYaw = _podNeedAngle.directionAngle; +// +// /** 对于晶品吊舱************ +// *方位轴:360°×n(连续,机头方向向右为正); +// *俯仰轴:360°×n(视轴垂直下视为0°,向上为正); +// **************************/ +// +// _podPitch = _podPitch + 90.0; +// if (_podYaw < 0) +// _podYaw = _podYaw + 360.0; +// CString str; +// str.Format("%.2f", _podPitch); //俯仰角 +// GetDlgItem(IDC_EDIT_PITCH)->SetWindowText(str); +// str.Format("%.2f", _podYaw); //转向角 +// GetDlgItem(IDC_EDIT_RAW)->SetWindowText(str); +// +// +//} +// +//void CalcDestinationDLG::onBtnClickedCalc() +//{ +// g_calcDestination.calcDesLocation(_desLocation); +// _desLon = _desLocation.DisLongitude; +// _desLat = _desLocation.Dislatitude; +// _desHeight = _desLocation.DisHeight; +// +// CString str; +// str.Format("%.7f",_desLon); //经度 +// GetDlgItem(IDC_EDIT_DES_LON)->SetWindowText(str); +// str.Format("%.7f",_desLat); //纬度 +// GetDlgItem(IDC_EDIT_DES_LAT)->SetWindowText(str); +// str.Format("%.2f",_desHeight); //海拔高度 +// GetDlgItem(IDC_EDIT_DES_HEIGHT)->SetWindowText(str); +//} +// +// +// +//void CalcDestinationDLG::OnBnClickedButtonTurn() +//{ +// UpdateData(TRUE); +// ::SendMessageA(g_dlgVideoShowHandle, WM_CALCDES_PODRURN, (WPARAM)&_podPitch, (LPARAM)&_podYaw); +//} diff --git a/Src/CH91PayloadSoftware/CalcDestinationDlg.h b/Src/CH91PayloadSoftware/CalcDestinationDlg.h new file mode 100644 index 0000000..f28ffa4 --- /dev/null +++ b/Src/CH91PayloadSoftware/CalcDestinationDlg.h @@ -0,0 +1,42 @@ +#pragma once +#include "resource.h" +#include "global.h" +//#include "framelib/FrameFKD_JE.h" +// +// +//class CalcDestinationDLG : +// public CBCGPPropertyPage +//{ +// DECLARE_DYNAMIC(CalcDestinationDLG) +// +//public: +// CalcDestinationDLG(CWnd* pParent = NULL); +// virtual ~CalcDestinationDLG(); +// +// enum { IDD = IDD_DLG_AIR_DROP}; +// +//protected: +// virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 +// //virtual BOOL OnInitDialog(); +// DECLARE_MESSAGE_MAP() +// +//private: +// double _airDropLon; +// double _airDropLat; +// float _airDropHeight; +// POD_NEED_ANGLE _podNeedAngle; +// float _podYaw; +// float _podPitch; +// DES_LOCATION _desLocation; +// +// double _desLon; +// double _desLat; +// float _desHeight; +//public: +// afx_msg void onBtnClickedSetFlyLocation(); +// afx_msg void onBtnClickedSetAirLocation(); +// afx_msg void onBtnClickedCalcAngle(); +// afx_msg void onBtnClickedCalc(); +// afx_msg void OnBnClickedButtonTurn(); +//}; +// diff --git a/Src/CH91PayloadSoftware/DlgWHTJDCNew.cpp b/Src/CH91PayloadSoftware/DlgWHTJDCNew.cpp index 59d01d2..b0a989e 100644 --- a/Src/CH91PayloadSoftware/DlgWHTJDCNew.cpp +++ b/Src/CH91PayloadSoftware/DlgWHTJDCNew.cpp @@ -42,8 +42,8 @@ DlgWHTJDCNew::DlgWHTJDCNew(CWnd* pParent /*=NULL*/) , m_FocalDistanceSet(_T("")) , m_DigitalGuidanceDir(_T("")) , m_DigitalGuidancePitch(_T("")) - , m_SCanModelAngle(_T("")) - , m_SCanModelSpeed(_T("")) + , m_SCanModelDirSpeed(_T("")) + , m_SCanModelPitchSpeed(_T("")) , m_DirSCanSetCentre(_T("")) , m_DirSCanSetRange(_T("")) , m_PitchSCanSetCentre(_T("")) @@ -107,6 +107,7 @@ void DlgWHTJDCNew::DoDataExchange(CDataExchange* pDX) DDX_Control(pDX, IDC_BTN_WHTJDC_NEW42, DC13InsBtn[41]); DDX_Control(pDX, IDC_BTN_WHTJDC_NEW43, DC13InsBtn[42]); DDX_Control(pDX, IDC_BTN_WHTJDC_NEW44, DC13InsBtn[43]); + DDX_Control(pDX, IDC_BTN_WHTJDC_NEW45, DC13InsBtn[44]); //DDX_Text(pDX, IDC_EDIT_Pitch_Param, Param1); //DDX_Text(pDX, IDC_EDIT_Dir_Param, Param2); @@ -130,8 +131,8 @@ void DlgWHTJDCNew::DoDataExchange(CDataExchange* pDX) DDX_Text(pDX, IDC_EDIT_WHTD_5, m_FocalDistanceSet); DDX_Text(pDX, IDC_EDIT_WHTD_3, m_DigitalGuidanceDir); DDX_Text(pDX, IDC_EDIT_WHTD_4, m_DigitalGuidancePitch); - DDX_Text(pDX, IDC_EDIT_WHTD_1, m_SCanModelAngle); - DDX_Text(pDX, IDC_EDIT_WHTD_2, m_SCanModelSpeed); + DDX_Text(pDX, IDC_EDIT_WHTD_1, m_SCanModelDirSpeed); + DDX_Text(pDX, IDC_EDIT_WHTD_2, m_SCanModelPitchSpeed); DDX_Text(pDX, IDC_EDIT_WHTD_8, m_DirSCanSetCentre); DDX_Text(pDX, IDC_EDIT_WHTD_9, m_DirSCanSetRange); DDX_Text(pDX, IDC_EDIT_WHTD_10, m_PitchSCanSetCentre); @@ -147,7 +148,7 @@ BOOL DlgWHTJDCNew::OnInitDialog() CFont m_oFont;//字体 m_oFont.CreatePointFont(80, _T("Times New Roman"),NULL); - for(int i = 0;i<44;++i) + for(int i = 0;i<45;++i) { //DC13InsBtn[i].SetTextColor(RGB(255,255,255)); //DC13InsBtn[i].SetFont(&m_oFont); @@ -176,31 +177,31 @@ BOOL DlgWHTJDCNew::OnInitDialog() CWnd* pWnd2 = GetDlgItem(IDC_EDIT_WHTD_1); pWnd2->SetFont(&m_font2); - GetDlgItem(IDC_EDIT_WHTD_1)->SetWindowText("100"); + GetDlgItem(IDC_EDIT_WHTD_1)->SetWindowText("1"); CWnd* pWnd3 = GetDlgItem(IDC_EDIT_WHTD_2); pWnd3->SetFont(&m_font2); - GetDlgItem(IDC_EDIT_WHTD_2)->SetWindowText("5"); + GetDlgItem(IDC_EDIT_WHTD_2)->SetWindowText("1"); CWnd* pWnd4 = GetDlgItem(IDC_EDIT_WHTD_3); pWnd4->SetFont(&m_font2); - GetDlgItem(IDC_EDIT_WHTD_3)->SetWindowText("0.00"); + GetDlgItem(IDC_EDIT_WHTD_3)->SetWindowText("10.00"); CWnd* pWnd5 = GetDlgItem(IDC_EDIT_WHTD_4); pWnd5->SetFont(&m_font2); - GetDlgItem(IDC_EDIT_WHTD_4)->SetWindowText("0.00"); + GetDlgItem(IDC_EDIT_WHTD_4)->SetWindowText("10.00"); CWnd* pWnd6 = GetDlgItem(IDC_EDIT_WHTD_5); pWnd6->SetFont(&m_font2); - GetDlgItem(IDC_EDIT_WHTD_5)->SetWindowText("0.0"); + GetDlgItem(IDC_EDIT_WHTD_5)->SetWindowText("4.3"); CWnd* pWnd7 = GetDlgItem(IDC_EDIT_WHTD_6); pWnd7->SetFont(&m_font2); - GetDlgItem(IDC_EDIT_WHTD_6)->SetWindowText("0"); + GetDlgItem(IDC_EDIT_WHTD_6)->SetWindowText("20"); CWnd* pWnd8 = GetDlgItem(IDC_EDIT_WHTD_7); pWnd8->SetFont(&m_font2); - GetDlgItem(IDC_EDIT_WHTD_7)->SetWindowText("0"); + GetDlgItem(IDC_EDIT_WHTD_7)->SetWindowText("20"); CWnd* pWnd9 = GetDlgItem(IDC_EDIT_WHTD_8); pWnd9->SetFont(&m_font2); @@ -393,6 +394,9 @@ afx_msg LRESULT DlgWHTJDCNew::OnUpdateWHTJDCFrame(WPARAM wParam, LPARAM lParam) case 44: UpdateFrame44((int&)lParam); break; + case 45: + UpdateFrame45((int&)lParam); + break; case 100: UpdateFrame100((int&)lParam); break; @@ -679,6 +683,12 @@ void DlgWHTJDCNew::UpdateWHTJDCCmdBuffer(HWND hwnd) hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 CloseHandle(hCheckThread); } + if(hwnd ==GetDlgItem(IDC_BTN_WHTJDC_NEW45)->m_hWnd) + { + g_WHTJDCCmdNum = 45; + hCheckThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadWHTJDCNew, NULL, 0, &ThreadCheckIDRegion);//开启线程 + CloseHandle(hCheckThread); + } } void DlgWHTJDCNew::UpdateDataZ70_TJDC() { @@ -836,7 +846,7 @@ void DlgWHTJDCNew::UpdateFrame11(int &sendEnd) if(sendEnd==0) { TJDCCmdBuffer[0]=0x02; - TJDCCmdBuffer[1]=0x33; + TJDCCmdBuffer[1]=0x34; UpdateDataZ70_TJDC(); g_bBindData = true; } @@ -1409,30 +1419,33 @@ void DlgWHTJDCNew::UpdateFrame40(int &sendEnd) MessageBox(_T("请输入正确数据!!!")); return; } - if(!IsPositiveInteger(m_SCanModelSpeed)||!IsPositiveInteger(m_SCanModelAngle)) + if(!IsPositiveNumber(m_SCanModelPitchSpeed)||!IsPositiveNumber(m_SCanModelDirSpeed)) { - MessageBox(_T("请输入正整数!")); + MessageBox(_T("请输入正数!")); return; } - INT16 SCanModelSpeed,SCanModelAngle; - SCanModelSpeed = _ttoi(m_SCanModelSpeed); - SCanModelAngle = _ttoi(m_SCanModelAngle); - if(SCanModelAngle<0||SCanModelAngle>180) + float SCanModelPitchSpeed,SCanModelDirSpeed; + SCanModelPitchSpeed = _ttof(m_SCanModelPitchSpeed); + SCanModelDirSpeed = _ttof(m_SCanModelDirSpeed); + if(SCanModelDirSpeed<0||SCanModelDirSpeed>100) { - MessageBox(_T("扫描角度设置范围0-180!")); + MessageBox(_T("方位扫描速度设置范围[0,180]!")); return; } - if(SCanModelSpeed<0||SCanModelSpeed>100) + if(SCanModelPitchSpeed<0||SCanModelPitchSpeed>180) { - MessageBox(_T("扫描速度设置范围0-100!")); + MessageBox(_T("俯仰扫描速度设置范围[0,180]!")); return; } + UINT16 UINT16SCanModelDirSpeed,UINT16SCanModelPitchSpeed; + UINT16SCanModelDirSpeed = (UINT16)(SCanModelDirSpeed*10); + UINT16SCanModelPitchSpeed = (UINT16)(SCanModelPitchSpeed*10); TJDCCmdBuffer[0]=0x02; TJDCCmdBuffer[1]=0x79; - TJDCCmdBuffer[2]=SCanModelAngle; - TJDCCmdBuffer[3]=SCanModelAngle>>8; - TJDCCmdBuffer[4]=SCanModelSpeed; - TJDCCmdBuffer[5]=SCanModelSpeed>>8; + TJDCCmdBuffer[2]=UINT16SCanModelDirSpeed; + TJDCCmdBuffer[3]=UINT16SCanModelDirSpeed>>8; + TJDCCmdBuffer[4]=UINT16SCanModelPitchSpeed; + TJDCCmdBuffer[5]=UINT16SCanModelPitchSpeed>>8; UpdateDataZ70_TJDC(); g_bBindData = true; } @@ -1574,7 +1587,25 @@ void DlgWHTJDCNew::UpdateFrame44(int &sendEnd) g_bBindData = false; } } - +void DlgWHTJDCNew::UpdateFrame45(int &sendEnd) +{ + if(sendEnd==0) + { + TJDCCmdBuffer[0]=0x02; + TJDCCmdBuffer[1]=0x45; + TJDCCmdBuffer[2]=0x05; + TJDCCmdBuffer[3]=0x00; + TJDCCmdBuffer[4]=0x00; + TJDCCmdBuffer[5]=0x00; + TJDCCmdBuffer[6]=0x00; + UpdateDataZ70_TJDC(); + g_bBindData = true; + } + else + { + g_bBindData = false; + } +} void DlgWHTJDCNew::UpdateFrame100(int &sendEnd) { @@ -1675,25 +1706,25 @@ void DlgWHTJDCNew::OnCbnSelchangeComboTjdc2() DirAndPitchCrlSize = 4; break; case 3: - DirAndPitchCrlSize = 6; + DirAndPitchCrlSize = 7; break; case 4: - DirAndPitchCrlSize = 8; + DirAndPitchCrlSize = 10; break; case 5: - DirAndPitchCrlSize = 10; + DirAndPitchCrlSize = 15; break; case 6: - DirAndPitchCrlSize = 12; + DirAndPitchCrlSize = 20; break; case 7: - DirAndPitchCrlSize = 14; + DirAndPitchCrlSize = 25; break; case 8: - DirAndPitchCrlSize = 16; + DirAndPitchCrlSize = 30; break; default: - DirAndPitchCrlSize = 8; + DirAndPitchCrlSize = 10; break; } } diff --git a/Src/CH91PayloadSoftware/DlgWHTJDCNew.h b/Src/CH91PayloadSoftware/DlgWHTJDCNew.h index 035774b..0003e6b 100644 --- a/Src/CH91PayloadSoftware/DlgWHTJDCNew.h +++ b/Src/CH91PayloadSoftware/DlgWHTJDCNew.h @@ -28,7 +28,7 @@ protected: public: CCMDBtn m_DCFlyCmd[12]; - CMFCButton DC13InsBtn[44]; + CMFCButton DC13InsBtn[45]; BYTE TJDCCmdBuffer[15]; public: UINT8 SwitchCmd; //开关指令 @@ -47,8 +47,8 @@ public: CString m_FocalDistanceSet;//焦距设置 CString m_DigitalGuidancePitch;//数引模式 俯仰 CString m_DigitalGuidanceDir;//数引模式 方位 - CString m_SCanModelAngle;//扫描设置 角度 - CString m_SCanModelSpeed;//扫描设置 速度 + CString m_SCanModelDirSpeed;//扫描设置 角度 + CString m_SCanModelPitchSpeed;//扫描设置 速度 CString m_DirSCanSetCentre;//方位扫描设置 中心 CString m_DirSCanSetRange;//方位扫描设置 范围 CString m_PitchSCanSetCentre;//俯仰扫描设置 中心 @@ -59,24 +59,24 @@ public: void DlgWHTJDCNew::UpdateDataZ70_TJDC();//更新数据注入指令Z70 void UpdateFrame(); //俯仰+ 长按 void UpdateFrame2(); //俯仰- 长按 - void UpdateFrame3(); //方位+ 长按 - void UpdateFrame4(); //方位- 长按 + void UpdateFrame3(); //方位- 长按 + void UpdateFrame4(); //方位+ 长按 void UpdateFrame5(int&); //复位 void UpdateFrame6(int&); //图像切换 void UpdateFrame7(); //焦距+ 长按 void UpdateFrame8(); //焦距- 长按 void UpdateFrame9(int&); //可见光跟踪 void UpdateFrame10(int&); //拍一张照 - void UpdateFrame11(int&); //停止照相 + void UpdateFrame11(int&); //停止照相34 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 UpdateFrame16(int&); //连续照相34 + void UpdateFrame17(int&); //开始录像33 + void UpdateFrame18(int&); //停止录像33 void UpdateFrame19(int&); //取消跟踪 void UpdateFrame20(int&); //跟踪模板大小设置 void UpdateFrame21(int&); //查询反馈 @@ -102,6 +102,7 @@ public: void UpdateFrame41(int&); //姿态指引 7C void UpdateFrame43(int&); //方位扫描设置 void UpdateFrame44(int&); //俯仰扫描设置 + void UpdateFrame45(int&); //自动调焦 void UpdateFrame100(int&); //吊舱行为1 void UpdateFrame101(int&); //吊舱行为2 diff --git a/Src/CH91PayloadSoftware/resource.h b/Src/CH91PayloadSoftware/resource.h index 99cf08b..3963961 100644 Binary files a/Src/CH91PayloadSoftware/resource.h and b/Src/CH91PayloadSoftware/resource.h differ