DeviceView.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. #pragma once
  2. // CDeviceView 窗体视图
  3. class CDeviceView : public CFormView
  4. {
  5. DECLARE_DYNCREATE(CDeviceView)
  6. protected:
  7. CDeviceView(); // 动态创建所使用的受保护的构造函数
  8. virtual ~CDeviceView();
  9. public:
  10. #ifdef AFX_DESIGN_TIME
  11. enum { IDD = DLG_DEVICEMANAGER };
  12. #endif
  13. #ifdef _DEBUG
  14. virtual void AssertValid() const;
  15. #ifndef _WIN32_WCE
  16. virtual void Dump(CDumpContext& dc) const;
  17. #endif
  18. #endif
  19. protected:
  20. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
  21. DECLARE_MESSAGE_MAP()
  22. public:
  23. //////////////////////////////////////////////////////////////////////////
  24. // 读取baidu.cfg配置文件内容;
  25. typedef struct __COUNT_INFO__
  26. {
  27. std::string app_id;
  28. std::string api_key;
  29. std::string secret_key;
  30. std::string ret_count;
  31. }CountInfo, *pCountInfo;
  32. typedef struct __BAIDU_CFG__
  33. {
  34. std::string cur_count;
  35. std::string reset_time;
  36. std::map<std::string, __COUNT_INFO__> list_count;
  37. }BaiduCfg, *pBaiduCfg;
  38. BaiduCfg m_bdcfg;
  39. TCHAR m_szBaiduCfgPath[MAX_PATH];
  40. void ReadBaiduCfg(BaiduCfg &bdcfg);
  41. //////////////////////////////////////////////////////////////////////////
  42. // 读取resource_run.cfg配置文件内容;
  43. typedef struct __RS_RUN_CFG__
  44. {
  45. std::string sound_list; // 声音级别;
  46. std::string full_cut; // 是否全步骤截图;('True/False')
  47. //....
  48. std::string tg39_port;
  49. std::string tv_port;
  50. std::string sat_home;
  51. std::string sat_result_dir;
  52. std::string chroma22293;
  53. //...
  54. std::string menutree_chip;
  55. std::string menutree_style;
  56. std::string menutree_channel;
  57. //...
  58. std::string chroma1;
  59. std::string chroma2;
  60. }RsRunCfg, *pRsRunCfg;
  61. RsRunCfg m_rscfg;
  62. TCHAR m_szRsCfgPath[MAX_PATH];
  63. void ReadRsRunCfg(RsRunCfg &rscfg);
  64. //////////////////////////////////////////////////////////////////////////
  65. // 读取menutree目录;
  66. typedef struct __UI_TREE__
  67. {
  68. std::string ui;
  69. std::vector<std::string> vtSubUI;
  70. }UITree, *pUITree;
  71. std::map<std::string, std::vector<UITree>> m_map_tree;
  72. void ReadTreePath();
  73. // 解析json;
  74. void ParseJson();
  75. // 运行设备;
  76. void RunDevice();
  77. std::vector<std::string> m_vtCOM;
  78. void InitCombobox_port();
  79. BOOL IsPortInserted(CComboBox* pCommbox, LPCTSTR lpPort);
  80. afx_msg BOOL OnDeviceChange(UINT nEventType, DWORD_PTR dwData);
  81. public:
  82. virtual void OnInitialUpdate();
  83. virtual void OnDraw(CDC* /*pDC*/);
  84. afx_msg void OnPaint();
  85. afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
  86. // 全步骤截图;
  87. afx_msg void OnCheckFullCut();
  88. afx_msg void OnUpdateCheckFullCut(CCmdUI* pCmdUI);
  89. // 有声按钮;
  90. afx_msg void OnHadSound();
  91. afx_msg void OnUpdateHadSound(CCmdUI* pCmdUI);
  92. // 声音默认按钮;
  93. afx_msg void OnDefSound();
  94. afx_msg void OnUpdateDefSound(CCmdUI* pCmdUI);
  95. // 声音等级编辑框;
  96. // OCR账号下拉框;
  97. afx_msg void OnComboxOcr();
  98. afx_msg void OnUpdateComboxOcr(CCmdUI* pCmdUI);
  99. // MenuTree项目下拉框;
  100. afx_msg void OnComboProduct();
  101. afx_msg void OnUpdateComboProduct(CCmdUI* pCmdUI);
  102. // MenuTree UI下拉框;
  103. afx_msg void OnComboUi();
  104. afx_msg void OnUpdateComboUi(CCmdUI* pCmdUI);
  105. // MenuTree 子UI下拉框;
  106. afx_msg void OnComboSubUi();
  107. afx_msg void OnUpdateComboSubUi(CCmdUI* pCmdUI);
  108. // 信号仪1下拉框;
  109. afx_msg void OnCombo1_22293();
  110. afx_msg void OnUpdateCombo1_22293(CCmdUI* pCmdUI);
  111. // 信号仪2下拉框;
  112. afx_msg void OnCombo2_22293();
  113. afx_msg void OnUpdateCombo2_22293(CCmdUI* pCmdUI);
  114. // 信号仪1CheckBox;
  115. afx_msg void OnCheck1_22293();
  116. afx_msg void OnUpdateCheck1_22293(CCmdUI* pCmdUI);
  117. // 信号仪2CheckBox;
  118. afx_msg void OnCheck2_22293();
  119. afx_msg void OnUpdateCheck2_22293(CCmdUI* pCmdUI);
  120. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  121. //////////////////////////////////////////////////////////////////////////
  122. // 对话框控件;
  123. CComboBox m_cb_chroma1;
  124. CComboBox m_cb_chroma2;
  125. CButton m_ck_chroma1;
  126. CButton m_ck_chroma2;
  127. afx_msg void OnBnClickedButton1();
  128. afx_msg void OnBnClickedButton2();
  129. afx_msg void OnBnClickedCheck1();
  130. afx_msg void OnBnClickedCheck2();
  131. afx_msg void OnCbnSelchangeCombo1();
  132. afx_msg void OnCbnSelchangeCombo2();
  133. };