CMachineSetup.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #pragma once
  2. #include "CMachineCalibration.h"
  3. #include "CDataBaseOperate.h"
  4. #include "dt.h"
  5. #include <string>
  6. #include <windows.h>
  7. #include <mutex>
  8. #include <vector>
  9. using namespace std;
  10. #ifdef MACHINE_SETUP_DLL
  11. #define DLL_MACHINE_SETUP_API __declspec(dllexport)
  12. #else
  13. #define DLL_MACHINE_SETUP_API
  14. #endif
  15. namespace ns_db
  16. {
  17. #define MACHINE_SETUP_DATABASE_NAME ROOT_PATH##"\\db\\MachineSetup.db"
  18. #define PRODUCT_LIST_TABLE_NAME "ProductList"
  19. #define ALL_SUPPORT_STEP_LIST_TABLE_NAME "AllSupportStepList"
  20. #define ALL_SUPPORT_STEP_FUNCTION_TABLE_NAME "AllSupportStepFunction"
  21. typedef struct _STEP_INFO : TABLE_INFO_BASE
  22. {
  23. UINT iId;
  24. string strName;
  25. string strDescribe;
  26. } STEP_INFO;
  27. typedef struct _PRODUCT_LIST_STRUCT : TABLE_INFO_BASE
  28. {
  29. INT ID;
  30. string ProductName;
  31. bool IsUse;
  32. string Version;
  33. string User;
  34. string Describe;
  35. string Date;
  36. string FilePath;
  37. } PRODUCT_LIST_STRUCT;
  38. class DLL_MACHINE_SETUP_API CMachineSetup : public CDataBaseOperate
  39. {
  40. public:
  41. CMachineSetup();
  42. private:
  43. LONG SaveDB() override;
  44. LONG LoadDB() override;
  45. #pragma region ProductList表
  46. private:
  47. vector<PRODUCT_LIST_STRUCT> m_vetProductList;
  48. LONG LoadProductList();
  49. LONG SaveProductList();
  50. public:
  51. LONG GetCurrentProductPath(string& strPath);
  52. vector<PRODUCT_LIST_STRUCT> GetProductList() { return m_vetProductList; };
  53. //设置ProductList。bAppend=ture时,将vecProduct里有,而m_vetProductList没有的项追加进m_vetProductList
  54. LONG SetProductList(vector<PRODUCT_LIST_STRUCT> vecProduct,bool bAppend = false);
  55. #pragma endregion
  56. #pragma region AllSupportStepList表
  57. private:
  58. //保存所有支持的Step对应关系
  59. vector<STEP_INFO> m_vecAllSupportStep;
  60. //获取所有支持的Step列表
  61. LONG LoadAllSupportStepList();
  62. public:
  63. vector<STEP_INFO> GetAllSupportStepList() { return m_vecAllSupportStep; };
  64. LONG SetAllSupportStepList(vector<STEP_INFO> vecSupporStep, bool bAppend = false);
  65. LONG GetStepInfo(UINT iStepId, STEP_INFO& info);
  66. #pragma endregion
  67. };
  68. }