#pragma once #include "../MyLib/StaticEx.h" // CMTerm2CommDevView 窗体视图 class CMTerm2CommDevView : public CFormView { DECLARE_DYNCREATE(CMTerm2CommDevView) // 构造 public: protected: CMTerm2CommDevView(); // 动态创建所使用的受保护的构造函数 virtual ~CMTerm2CommDevView(); #ifdef AFX_DESIGN_TIME enum { IDD = IDD_MTerm2CommDevView2 }; #endif #ifdef _DEBUG virtual void AssertValid() const; CMTerm2Doc* CMTerm2CommDevView::GetDocument() const { return reinterpret_cast(m_pDocument); } #ifndef _WIN32_WCE virtual void Dump(CDumpContext& dc) const; #endif #endif protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持 DECLARE_MESSAGE_MAP() public: virtual void OnInitialUpdate(); // CStatusBar m_wndStatusBar; // CToolBar m_wndToolBar; // CImageList m_ColorTreeImages; // CTreeCtrl m_treectrl1; afx_msg void OnClose(); afx_msg void OnSize(UINT nType, int cx, int cy); afx_msg void OnTimer(UINT_PTR nIDEvent); afx_msg BOOL OnDeviceChange(UINT nEventType, DWORD_PTR dwData); void FindComPort(); int BInited; int m_bResourceOpened; int m_bPause; CString sComSelStr; CString sBaudSelStr; DWORD dComNum; volatile int MyThreadProc1ToRun = 0; volatile int MyThreadProc1Running = 0; CRect MainClientRect; CRect LeftRect; CRect RightRect; CRect ItemRect; CRect OrgButtonRect; CRect ButtonRect; CRect PicRect; CRect PicRectUp; CRect PicRectDown; CRect LogRect; int calLayerOuts(); int DisplayParams(); int GetParams(); int DelayInit(); int LoadResourceList(); int SaveResourceList(); int LoadModel(); int SaveModel(); int OpenResource(CStringA ResourceStr); int CloseResource(); int SaveData(CString sFilePathName); int LoadData(CString sFilePathName); int MonitorPLC(); int UpdateDataDisplay(); public: static UINT MyJumper1(LPVOID pParam); DWORD WINAPI MyThreadProc1(LPVOID pParam); bool m_bOnline = false; bool m_bRunning = false; bool m_bMonitoring = false; // Combo Com port select CComboBox m_combo_comport; // Combo Com Baud select CComboBox m_combo_com_baud; afx_msg void OnBnClickedButtonStart(); afx_msg void OnBnClickedButtonStop(); afx_msg void OnBnClickedButtonClrscr(); afx_msg void OnBnClickedButtonSend(); CEdit m_edit_display; // Combo Input CComboBox m_combo_input; afx_msg void OnCbnEditchangeComboInput(); afx_msg void OnCbnSelchangeComboRes(); afx_msg void OnBnClickedButtonDo(); afx_msg void OnCbnSelchangeComboCmdType(); afx_msg void OnCbnSelchangeComboDcount(); afx_msg void OnBnClickedButtonStartBulkTest(); afx_msg void OnBnClickedButtonStopBulkTest(); afx_msg void OnMenuDownload(); afx_msg void OnMenuUpload(); afx_msg void OnMenuOnline(); afx_msg void OnMenuOffline(); afx_msg void OnMenuMonitor(); afx_msg void OnMenuRun(); afx_msg void OnUpdateMenuRun(CCmdUI *pCmdUI); afx_msg void OnUpdateMenuMonitor(CCmdUI *pCmdUI); afx_msg void OnUpdateMenuOffline(CCmdUI *pCmdUI); afx_msg void OnUpdateMenuOnline(CCmdUI *pCmdUI); CEdit m_edit_mon1; CEdit m_edit_mon2; afx_msg void OnMenuCommset(); afx_msg void OnMenuSysregSet(); afx_msg void OnMenuStatusShow(); afx_msg void OnMenuInfoDisplay(); afx_msg void OnMenuCoilMon(); afx_msg void OnMenuDataMon(); afx_msg void OnMenuCommTool(); afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt); afx_msg void OnBnClickedButtonClearStat(); int Clear_COM_Stats(); afx_msg void OnBnClickedButtonRead(); afx_msg void OnBnClickedButtonConnect(); afx_msg void OnMenuEventLog(); afx_msg void OnMenuCommTest(); afx_msg void OnMenuForceIo(); afx_msg void OnMenuDatetime(); CStaticEx m_static_connect; afx_msg void OnBnClickedButtonDisconnect(); afx_msg void OnBnClickedButton11(); afx_msg void OnBnClickedButton12(); afx_msg void OnBnClickedButton13(); afx_msg void OnBnClickedButton31(); afx_msg void OnBnClickedButton2(); afx_msg void OnBnClickedButton3(); int UpdateLEDDisplay(); };