146 lines
3.5 KiB
C
146 lines
3.5 KiB
C
|
|
|
|||
|
|
// UCIDemoProjDlg.h : ͷ<>ļ<EFBFBD>
|
|||
|
|
//
|
|||
|
|
|
|||
|
|
#pragma once
|
|||
|
|
|
|||
|
|
#include "lib\uci.h"
|
|||
|
|
#include <queue>
|
|||
|
|
#include "afxwin.h"
|
|||
|
|
#include "lib\dso_base.h"//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>
|
|||
|
|
#include "lib\unit.h"//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9>
|
|||
|
|
|
|||
|
|
class CMyMFCButton : public CMFCButton {
|
|||
|
|
public:
|
|||
|
|
void SetDelayFullTextTooltipSet(bool DelayFullTextTooltipSet) {
|
|||
|
|
m_bDelayFullTextTooltipSet = DelayFullTextTooltipSet;
|
|||
|
|
}
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
// CUCIDemoProjDlg <20>Ի<EFBFBD><D4BB><EFBFBD>
|
|||
|
|
class CUCIDemoProjDlg : public CDialogEx
|
|||
|
|
{
|
|||
|
|
// <20><><EFBFBD><EFBFBD>
|
|||
|
|
public:
|
|||
|
|
CUCIDemoProjDlg(CWnd* pParent = NULL); // <20><><EFBFBD><D7BC><EFBFBD>캯<EFBFBD><ECBAAF>
|
|||
|
|
|
|||
|
|
// <20>Ի<EFBFBD><D4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
enum { IDD = IDD_UCIDEMOPROJ_DIALOG };
|
|||
|
|
|
|||
|
|
protected:
|
|||
|
|
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV ֧<><D6A7>
|
|||
|
|
|
|||
|
|
public:
|
|||
|
|
static CUCIDemoProjDlg* c_object;
|
|||
|
|
// ʵ<><CAB5>
|
|||
|
|
protected:
|
|||
|
|
HICON m_hIcon;
|
|||
|
|
CEdit m_Ctrl_Edit_Msg;
|
|||
|
|
UINT m_Val_Timeout;
|
|||
|
|
int m_Val_BytesToRead;
|
|||
|
|
CMFCEditBrowseCtrl m_CtrlFileChoose;
|
|||
|
|
CComboBox m_cbxCMD;
|
|||
|
|
CMyMFCButton m_btnWriteParam_File;
|
|||
|
|
|
|||
|
|
protected:
|
|||
|
|
CToolTipCtrl m_tips;
|
|||
|
|
protected:
|
|||
|
|
bool m_IsConnect;
|
|||
|
|
int m_MaxCMDHistoryCount;
|
|||
|
|
CString m_strCMDListPath;
|
|||
|
|
CString m_DevName, m_IDN;
|
|||
|
|
CString m_ConnectAddrIP;
|
|||
|
|
CString m_ConnectAddrPort;
|
|||
|
|
int m_nConnectAddrPort;
|
|||
|
|
int m_COMType;
|
|||
|
|
|
|||
|
|
uci::Node m_Nodes[100];
|
|||
|
|
|
|||
|
|
CString m_CommandString, m_Path;
|
|||
|
|
|
|||
|
|
protected:
|
|||
|
|
void GetCMDString(CString& _msg);
|
|||
|
|
int UCIWrite(const TCHAR* _cmd, UINT _timeOut);
|
|||
|
|
int UCIRead(const TCHAR* _cmd, u_byte* _data, u_size _dataLen, UINT _timeOut);
|
|||
|
|
|
|||
|
|
static int __stdcall UCI_MessageProc(uci::UCIMSG* _msg);
|
|||
|
|
|
|||
|
|
void Disconnect();
|
|||
|
|
void RecordCMD(const CString& _msg);
|
|||
|
|
|
|||
|
|
void ShowResult(int _r, int _idsSOerationString, const TCHAR* _format = NULL, ...);
|
|||
|
|
|
|||
|
|
// @brief : <><D7B7><EFBFBD><EFBFBD>Ϣ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
|||
|
|
// @param : const u_tchar * _format
|
|||
|
|
// @param : ...
|
|||
|
|
// @return : void
|
|||
|
|
// @remarks :
|
|||
|
|
void AppendTraceMsg(const u_tchar * _format, ...);
|
|||
|
|
// <20><><EFBFBD>ɵ<EFBFBD><C9B5><EFBFBD>Ϣӳ<CFA2>亯<EFBFBD><E4BAAF>
|
|||
|
|
virtual BOOL OnInitDialog();
|
|||
|
|
|
|||
|
|
void InitUI();
|
|||
|
|
void LoadCMDList();
|
|||
|
|
bool GetAppFolderPath(CString& _strPath);
|
|||
|
|
void EnableWidgets(BOOL _isConnect);
|
|||
|
|
|
|||
|
|
CString FindConnectAddrField(const CString& _addr, const CString& _fieldBegin, const CString&_fieldEnd);
|
|||
|
|
|
|||
|
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
void ParseParamsMeasure(byte* _data, int _data_len);
|
|||
|
|
void ParseParamsMeasure_User(byte* _data, int _data_len);
|
|||
|
|
void PrintMeaParam(const TCHAR * _name, const comAPICommon::MeaValue& _p);
|
|||
|
|
|
|||
|
|
bool GetCommandString();
|
|||
|
|
bool GetFilePath();
|
|||
|
|
protected:
|
|||
|
|
afx_msg void OnPaint();
|
|||
|
|
afx_msg HCURSOR OnQueryDragIcon();
|
|||
|
|
DECLARE_MESSAGE_MAP()
|
|||
|
|
afx_msg void OnBnClickedButtonQueryNodes();
|
|||
|
|
afx_msg LRESULT AFX_MSG_CALL OnLANDisconnect(WPARAM wParam, LPARAM lParam);
|
|||
|
|
|
|||
|
|
public:
|
|||
|
|
afx_msg void OnBnClickedButtonClear();
|
|||
|
|
afx_msg void OnBnClickedButtonOpen();
|
|||
|
|
afx_msg void OnBnClickedBtnWrite();
|
|||
|
|
afx_msg void OnBnClickedBtnRead();
|
|||
|
|
|
|||
|
|
const CString& CreateBmpFileName(CString &msg, CString& fileName);
|
|||
|
|
|
|||
|
|
afx_msg void OnBnClickedButtonWriteFile();
|
|||
|
|
afx_msg void OnBnClickedButtonReadFile();
|
|||
|
|
afx_msg void OnDestroy();
|
|||
|
|
afx_msg void OnBnClickedBtnWriteInFile();
|
|||
|
|
|
|||
|
|
bool CheckConnectiion();
|
|||
|
|
|
|||
|
|
afx_msg void OnBnSetfocusBtnWriteInFile();
|
|||
|
|
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
|||
|
|
|
|||
|
|
// <20><>ʾ<EFBFBD>豸<EFBFBD><E8B1B8>ַ<EFBFBD>б<EFBFBD>
|
|||
|
|
CComboBox m_cbxDevAddr;
|
|||
|
|
|
|||
|
|
inline CString GetCurrentTime() {
|
|||
|
|
SYSTEMTIME t = { 0 };
|
|||
|
|
GetLocalTime(&t);
|
|||
|
|
|
|||
|
|
CString s;
|
|||
|
|
s.Format(_T("%02d-%02d-%02d"), t.wHour, t.wMinute, t.wSecond);
|
|||
|
|
return s;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
inline CString LoadString(UINT idRes) {
|
|||
|
|
CString str;
|
|||
|
|
BOOL bNameValid = str.LoadString(idRes);
|
|||
|
|
ASSERT(bNameValid);
|
|||
|
|
return str;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
inline void SetWidgetText(UINT _idWidget, UINT _idString) {
|
|||
|
|
SetDlgItemText(_idWidget, LoadString(_idString));
|
|||
|
|
}
|
|||
|
|
CString m_cbBoxText;
|
|||
|
|
};
|