CResources.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. //PR,视觉库存模板,只需将模块使用模板和PRID对应起来。
  50. CPRStrategy* GetPRStrategyByID(int ModuleID);
  51. //坐标系
  52. //将位置转换为全局坐标系
  53. XY_DOUBLE_STRUCT ToGlobalCoord(int moduleID, XY_DOUBLE_STRUCT point);
  54. X_Y_Z_STRUCT ToGlobalCoord(int moduleID, X_Y_Z_STRUCT point);
  55. //将全局坐标系转换位模组坐标系
  56. XY_DOUBLE_STRUCT ToLocalCoord(int moduleID, XY_DOUBLE_STRUCT point);
  57. X_Y_Z_STRUCT ToLocalCoord(int moduleID, X_Y_Z_STRUCT point);
  58. private:
  59. static CResources* m_instance;
  60. //最外层productID,第二层不同的StepListID,第三层StepID排序
  61. std::map<int,std::map<int, std::vector<int>>> m_mapStep;
  62. //Bond的点位矩阵
  63. CBondMatrix* m_pBondMatrix = nullptr;
  64. //点位数据1、多个华夫盒对象,每个华夫盒对应一套点位数据 2、固晶那里也对应点位数据
  65. std::map<int, CBondMatrix*> m_mapPositionInfo;//Key为ID
  66. //坐标系
  67. map<int,COORDSYS_STRUCT> m_vetModuleCoords;//模组坐标系
  68. COORDSYS_STRUCT m_stGlobalCoord;//全局坐标系
  69. };