CResources.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. 资源类,
  3. 软件启动时加载软资源,保存资源(工单、工艺单、通用坐标系)
  4. */
  5. #pragma once
  6. #include <vector>
  7. #include <string>
  8. #include <map>
  9. #include "CBondMatrix.h"
  10. #include "CPRStrategy.h"
  11. #include "CWaferMatrix.h"
  12. using namespace std;
  13. using namespace ns_mat;
  14. using namespace ns_pr;
  15. #pragma region 坐标系
  16. typedef struct _COORDSYS_STRUCT
  17. {
  18. double OriginPtX;
  19. double OriginPtY;
  20. int DirectX;
  21. int DierctY;
  22. int DierectZ;
  23. }COORDSYS_STRUCT;
  24. #pragma endregion
  25. #ifdef DB_RESCOURCES_EXPORTS
  26. #define DB_RESCOURCES_DLL_API __declspec(dllexport)
  27. #else
  28. #define DB_RESCOURCES_DLL_API //__declspec(dllimport)
  29. #endif
  30. class DB_RESCOURCES_DLL_API CResources
  31. {
  32. private:
  33. CResources();
  34. ~CResources();
  35. public:
  36. static CResources* GetInstance();
  37. static void releaseInstance();
  38. void GetParam();
  39. void SetParam();
  40. //工艺单
  41. std::map<int, std::vector<int>> GetStepMap(int productID);
  42. std::vector<int> GetStepList(int productID,int StepListID);
  43. void SaveStepMap();
  44. //工单,每个step对应的参数
  45. //STEP_PARAM GetStepParamByID(int id);
  46. //点位数据,
  47. CBondMatrix* GetBondMatrix();
  48. //PR,视觉库存模板,只需将模块使用模板和PRID对应起来。
  49. CPRStrategy* GetPRStrategyByID(int ModuleID);
  50. //坐标系
  51. //将位置转换为全局坐标系
  52. XY_DOUBLE_STRUCT ToGlobalCoord(int moduleID, XY_DOUBLE_STRUCT point);
  53. X_Y_Z_STRUCT ToGlobalCoord(int moduleID, X_Y_Z_STRUCT point);
  54. //将全局坐标系转换位模组坐标系
  55. XY_DOUBLE_STRUCT ToLocalCoord(int moduleID, XY_DOUBLE_STRUCT point);
  56. X_Y_Z_STRUCT ToLocalCoord(int moduleID, X_Y_Z_STRUCT point);
  57. private:
  58. static CResources* m_instance;
  59. //最外层productID,第二层不同的StepListID,第三层StepID排序
  60. std::map<int,std::map<int, std::vector<int>>> m_mapStep;
  61. //Bond的点位矩阵
  62. CBondMatrix* m_pBondMatrix = nullptr;
  63. //点位数据1、多个华夫盒对象,每个华夫盒对应一套点位数据 2、固晶那里也对应点位数据
  64. std::map<int, CBondMatrix*> m_mapPositionInfo;//Key为ID
  65. //坐标系
  66. map<int,COORDSYS_STRUCT> m_vetModuleCoords;//模组坐标系
  67. COORDSYS_STRUCT m_stGlobalCoord;//全局坐标系
  68. };