agv-control/Plugin/Fast/FastMainDialog.h
美食博主 22881ced28 优化角度计算与TCP服务器功能
在 `CDriverMainDlg::ProcessPipeMsg` 中修改了角度计算逻辑,增加了对角度绝对值的判断,并更新了 `CorrectAngle` 函数的调用。调整了 PID 控制器的参数以优化控制效果。

在 `CFastMainDialog` 中实现了 TCP 监听线程,新增了 `StartTCPServer` 和 `StopTCPServer` 函数,并在对话框初始化时启动 TCP 服务器。更新了项目文件以支持新的编译环境。
2025-07-07 08:34:56 +08:00

48 lines
969 B
C++

#pragma once
#include "afxcmn.h"
#include "afxwin.h"
#include "FastView.h"
class CFastMainDialog : public CDialogEx
{
DECLARE_DYNAMIC(CFastMainDialog)
public:
CFastMainDialog(CWnd* pParent = NULL); // 标准构造函数
virtual ~CFastMainDialog();
void StartTCPServer();
void StopTCPServer();
// 对话框数据
#ifdef AFX_DESIGN_TIME
enum { IDD = IDD_MAIN_DIALOG };
#endif
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
virtual BOOL PreTranslateMessage(MSG* pMsg);
DECLARE_MESSAGE_MAP()
public:
virtual BOOL OnInitDialog();
void InitLocalCamera();
public:
CFastView m_FastCam[4];
std::vector<MV3D_RGBD_DEVICE_INFO> m_CameraDev;
afx_msg void OnTimer(UINT_PTR nIDEvent);
void ProcessPipeMsg(int lMsgId, char* pData, int lLen);
private:
static UINT __cdecl TCPListenerThread(LPVOID pParam);
void ProcessTCPMessage(const CString& strJson);
CWinThread* m_pListenerThread;
SOCKET m_hServerSocket;
};