CResources.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. const BOND_DIR m_BondMatrixSearchDie = BOND_DIR::OrderAndS;
  36. public:
  37. static CResources* GetInstance();
  38. static void releaseInstance();
  39. long GetParam();
  40. long SetParam();
  41. //工艺单
  42. std::map<int, std::vector<int>> GetStepMap(int productID);
  43. std::vector<int> GetStepList(int productID,int StepListID);
  44. void SaveStepMap();
  45. //工单,每个step对应的参数
  46. //STEP_PARAM GetStepParamByID(int id);
  47. //点位数据,
  48. CBondMatrix* GetBondMatrix();
  49. CWaferMatrix* GetWaferMatrix();
  50. //PR,视觉库存模板,只需将模块使用模板和PRID对应起来。
  51. CPRStrategy* GetPRStrategyByID(int ModuleID);
  52. //坐标系
  53. //将位置转换为全局坐标系
  54. XY_DOUBLE_STRUCT ToGlobalCoord(int moduleID, XY_DOUBLE_STRUCT point);
  55. X_Y_Z_STRUCT ToGlobalCoord(int moduleID, X_Y_Z_STRUCT point);
  56. //将全局坐标系转换位模组坐标系
  57. XY_DOUBLE_STRUCT ToLocalCoord(int moduleID, XY_DOUBLE_STRUCT point);
  58. X_Y_Z_STRUCT ToLocalCoord(int moduleID, X_Y_Z_STRUCT point);
  59. private:
  60. static CResources* m_instance;
  61. //最外层productID,第二层不同的StepListID,第三层StepID排序
  62. std::map<int,std::map<int, std::vector<int>>> m_mapStep;
  63. //Bond的点位矩阵
  64. CBondMatrix* m_pBondMatrix = nullptr;
  65. CWaferMatrix* m_pWaferMatrix = nullptr;
  66. //点位数据1、多个华夫盒对象,每个华夫盒对应一套点位数据 2、固晶那里也对应点位数据
  67. std::map<int, CBondMatrix*> m_mapPositionInfo;//Key为ID
  68. //坐标系
  69. map<int,COORDSYS_STRUCT> m_vetModuleCoords;//模组坐标系
  70. COORDSYS_STRUCT m_stGlobalCoord;//全局坐标系
  71. };