Dlg_ZuTaiAdd.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #pragma once
  2. #include "afxcmn.h"
  3. #include "MyExcel.h"
  4. // CDlg_ZuTaiAdd 对话框
  5. class CDlg_ZuTaiAdd : public CDialog
  6. {
  7. DECLARE_DYNAMIC(CDlg_ZuTaiAdd)
  8. public:
  9. CDlg_ZuTaiAdd(CWnd* pParent = NULL); // 标准构造函数
  10. virtual ~CDlg_ZuTaiAdd();
  11. // 对话框数据
  12. enum { IDD = IDD_DLG_ZUTAI_ADD };
  13. protected:
  14. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
  15. DECLARE_MESSAGE_MAP()
  16. public:
  17. virtual BOOL OnInitDialog();
  18. afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
  19. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  20. int m_nDevAddr;
  21. int m_nCommPort;
  22. int m_nEdit_DevNumber;
  23. DWORD m_nNetIP;
  24. int m_nNetPort;
  25. afx_msg void OnBnClickedBtnTest();
  26. afx_msg void OnBnClickedBtnCreate();
  27. afx_msg void OnBnClickedBtnQuit();
  28. CTreeCtrl m_ctrlDevFolder;
  29. CImageList m_imagelistTree;
  30. void MyExpandTree(HTREEITEM hTreeItem);
  31. CString m_sMainType;//主类
  32. CString m_sSlaveType;//次类
  33. CString m_sDevBrand;//设备品牌
  34. CString m_sDevVersion;//设备型号
  35. int m_nChooseItem;//选择的序号 在g_DVP中
  36. int GetCommunicationTreaty( CString sData );
  37. int GetBaudRateIndex( CString sBaudRate );
  38. int GetCommDataBitIndex( CString sDataBit );
  39. bool OpenDevExcel();//打开设备文件
  40. bool OpenVarExcel( CString sPath );//打开变量文件
  41. void ListDeviceTypes(HTREEITEM hItemParent = TVI_ROOT);
  42. afx_msg void OnTvnSelchangedTreeDeviceFolder(NMHDR *pNMHDR, LRESULT *pResult);
  43. int SelChangedTreeDeviceFolder(HTREEITEM hItemSelect);
  44. int AddVarToDB( );
  45. int AddDeviceToDB( CString sDevName,CString sDevUid,int nCommPort,int nDevAddr,DWORD nNetIP,int nNetPort );
  46. void GetDevIDFromUID( CString sDevUid,int &nDevDriveID, int &nDevFactoryID, int &nDevTypeID );
  47. void ChangeVarInfo( CString sDevUid,int nDevIndex );
  48. void ChangeVarToPic( CString &sVarName );
  49. bool ChangePicRelevanceVar( CString sPicPath,CString sPicName );
  50. bool m_bIsJubgeHaveBit;//是否已经判断过有没有BIT位信息
  51. bool m_bHaveBit;//是否有位信息
  52. bool m_bChangeVarToPic;//判断是否更改画面文件变量成功
  53. bool m_bIsExistExcel;
  54. CMyExcel m_ExcelMain;
  55. afx_msg void OnClose();
  56. bool m_bReadResourceFinish;//判断是否已经加载资源
  57. void ReadResource();
  58. CString m_sFilePath;
  59. bool m_bIsUserZuTai;//是否用了组态,用于记录
  60. };