CViewInterface.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #pragma once
  2. #define C_MACHINE_EXPORTS
  3. #include "Machine.h"
  4. #include "CDieBondFsm.h"
  5. #include "CMessageBox.h"
  6. #include "dt.h"
  7. #include "CRunButton.h"
  8. #include "CViewMotion.h"
  9. #include "CViewMatrix.h"
  10. #include "CCamerAndLamp.h"
  11. #pragma comment(lib,"CLog.lib")
  12. #pragma comment(lib,"Module.lib")
  13. #pragma comment(lib,"Control.lib")
  14. namespace ns_module
  15. {
  16. class __declspec(dllexport) CViewInterface
  17. {
  18. public:
  19. struct THREAD_BUTTON_RUN
  20. {
  21. CViewInterface* pClass;
  22. ST_BUTTON_FUN stButtonInfo;
  23. };
  24. private:
  25. static CViewInterface* m_instance;
  26. static HANDLE m_hEvent;
  27. bool m_bIsInitSuccess = false;
  28. CManageDB* m_pCManageDB = nullptr;
  29. Machine* m_pMachine = nullptr;
  30. CCameraManage* m_pCameraManage = nullptr;
  31. CBondHead* m_pBondHead = nullptr;
  32. CWaferTable* m_pWaferTable = nullptr;
  33. CWaferHead* m_pWaferHead = nullptr;
  34. CTransferTable* m_pWaferTransferTable = nullptr;
  35. CTransferTable* m_pWaffleTransferTable = nullptr;
  36. CResources* m_pResource = nullptr;
  37. CDieBondFsm* m_pDieBondFsm = nullptr;
  38. LONG Init();
  39. public:
  40. static CViewInterface* GetInstance();
  41. #pragma region 界面方面接口
  42. private:
  43. CXYCalib* GetCalibXY(int iCameraId);
  44. public:
  45. //界面退出通知
  46. long ViewExit();
  47. //机台重新加载所有配置
  48. long ResetLoadAllConfig();
  49. //将所有数据保存到数据库
  50. long SaveAllConfigToDateBase();
  51. CViewMotion* GetViewMotion();
  52. CViewMatrix* GetViewMatrix();
  53. CCamerAndLamp* GetCamerAndLamp();
  54. /// <summary>
  55. /// 获取CPK数据信息
  56. /// </summary>
  57. /// <param name="CpkList">CPK数据</param>
  58. /// <returns>成功返回0,否则返回错误码</returns>
  59. long GetCpkList(std::vector<CPK_LIST_STRUCT>& CpkList);
  60. /// <summary>
  61. /// 读取表中指定GroupId的配置信息
  62. /// </summary>
  63. /// <param name="iGroupId">组Id</param>
  64. /// <param name="strTableName">表名</param>
  65. /// <param name="vecConfig">返回的配置信息</param>
  66. /// <returns>成功返回0,否则返回错误码</returns>
  67. long LoadConfigDB(string strTableName, vector<int> iGroupId, vector<CONFIG_BASE_STRUCT>& vecConfig);
  68. /// <summary>
  69. /// 保存配置信息
  70. /// </summary>
  71. /// <param name="strTableName">表名</param>
  72. /// <param name="vecConfig">要保存的配置信息</param>
  73. /// <returns>成功返回0,否则返回错误码</returns>
  74. long SaveConfigDB(string strTableName, vector<CONFIG_BASE_STRUCT> vecConfig);
  75. //设置弹出框回调
  76. long SetButtonRunDoneFunc(SendButtonRunDone func);
  77. //设置按钮执行完回调
  78. long SetPopMessageBoxFunc(CallMessageBox func);
  79. //数据更改后发送通知
  80. long DataChangNotice(string strDbName,string strTableName);
  81. //接收数据更改后的通知
  82. void RecvDataChangNotice(string strDbName, string strTableName, DataNoticeCallbackFun callBackFun);
  83. //停止
  84. long RunStop();
  85. //自动固晶
  86. long RunAutoBond();
  87. //执行按钮命令
  88. long RunButton(ST_BUTTON_FUN stInfo);
  89. #pragma endregion
  90. };
  91. }