#pragma once #ifndef SELECTDP5_H #define SELECTDP5_H //#include "Resource.h" #include "SCommon.h" #include "Label.h" #include "afxwin.h" #include "NetFinder.h" #include "afxadv.h" // for cfg file clipboard copy #ifdef _DEBUG #define isDebug true #else #define isDebug false #endif // CSelectDP5 dialog //DS_FIXEDSYS | //#define IDD_DP5_CONNECT 129 class CSelectDP5 : public CDialog { //DECLARE_DYNAMIC(CSelectDP5) public: //CSelectDP5(CWnd* pParent = NULL); // standard constructor CSelectDP5(); //virtual ~CSelectDP5(); // Dialog Data //enum { IDD = IDD_DP5_CONNECT }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support DECLARE_MESSAGE_MAP() CToolTipCtrl m_ToolTip; // Tooltip control public: virtual BOOL OnInitDialog(); // ===== RS232 ========================================== void ComPortEnum(); int GetComPortID(); void SetComPortID(int iComPort); afx_msg void OnCbnSelchangeComboComport(); afx_msg void OnBnClickedButtonClosePort(); // serial communications controls afx_msg void OnBnClickedButtonOpenPort(); afx_msg void OnBnClickedButtonSerialReqData(); void SetDataRcvTimer(long Bytes); CComboBox cboComPort; // Communications Timer RS232 100ms Timer 1 UINT_PTR m_nTmrRS232Id; // return SetTimer Return Value (0=false,TimerID if OK) UINT_PTR m_nTmrRS232EventId; // Timer Event Identifier UINT m_nTmrRS232Elapse; // Timeout value in milliseconds void ReqDataStatus(); DP4_FORMAT_STATUS m_DP5_Status; //void Process_Status(DP4_FORMAT_STATUS *m_DP5_Status); unsigned char DataIn[4096]; afx_msg void OnTimer(UINT nIDEvent); afx_msg LONG OnCommunication(UINT, LONG); void OnComm(); // ====================================================== // ===== USB ============================================ afx_msg void OnBnClickedButtonFindUsbDevice(); // ====================================================== // ===== ETHERNET ======================================= afx_msg void OnBnClickedButtonFindDp5Ip(); //void OnReceive(int nErrorCode); afx_msg LONG OnReceive(UINT, LONG); void SendBroadcast(BOOL NewRand); void ReceivePacket(); void UpdateNetFinderStatus(CString strStatus, COLORREF rgbConnect, int idxEntry); void ClearNetFinderStatus(int idxEntry); void ClearNetFinderStatusAll(); void ReqDataStatusSock(unsigned long DppAddr); CLabel lblNetFinder[4]; // CStatic netfinder display CNetFinder FindDpp; // netfinder helper class CNetFinder FindDppRS232; // netfinder helper class CNetFinder FindDppUSB; // netfinder helper class SocketOwnerType m_PrevOwner; // previous socket owner // ====================================================== virtual BOOL DestroyWindow(); // has ethernet previous owner swap // ===== shared functions =============================== void EnableCommFunctions(int ControlGroup); // enables/disables control groups // radio button selects communications type afx_msg void OnBnClickedRadioCommtype1(); // rs232 afx_msg void OnBnClickedRadioCommtype2(); // usb afx_msg void OnBnClickedRadioCommtype3(); // ethernet CLabel lblDppFound[3]; // displays dpp found by comm type // ====================================================== afx_msg void OnBnClickedOk(); int IpSelectBtn[4]; unsigned long IpSelectAddr[4]; void UpdateNetfinderIpAddr(unsigned long IpAddr); afx_msg void OnBnClickedButtonIpSelect1(); afx_msg void OnBnClickedButtonIpSelect2(); afx_msg void OnBnClickedButtonIpSelect3(); afx_msg void OnBnClickedButtonIpSelect4(); afx_msg void OnStnClickedStaticNetfinder1(); afx_msg void OnStnClickedStaticNetfinder2(); afx_msg void OnStnClickedStaticNetfinder3(); afx_msg void OnStnClickedStaticNetfinder4(); afx_msg void OnBnClickedButtonCountDevices(); CSpinButtonCtrl m_SpinSelectDevice; afx_msg void OnDeltaposSpinSelectDevice(NMHDR *pNMHDR, LRESULT *pResult); afx_msg void OnBnClickedButtonCloseDevice(); afx_msg void OnBnClickedCheckTypeIpAddress(); CButton m_TypeInIPAddressCheck; afx_msg void OnBnClickedConnectOK(); virtual void OnOK(); //virtual void OnCancel(); //afx_msg void OnDestroy(); BOOL bTypeInIPAddress; void CopyTextToClip(CString strTitle, CString strDesc); afx_msg void OnBnClickedButtonClipboardCopy(); void SetModified(BOOL bChanged); BOOL m_bModified; CEdit m_SpectrumRefreshTimeCtrl; afx_msg void OnEnChangeSpectrumRefreshTime(); afx_msg void OnBnClickedButtonSpectrumRefreshDefault(); afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo); }; #endif //SELECTDP5_H