DigitalTwinLogger.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #pragma once
  2. namespace DIOS::Dev::Detail::MachineryECOM
  3. {
  4. class DigitalTwinLogger
  5. {
  6. public:
  7. DigitalTwinLogger();
  8. ~DigitalTwinLogger();
  9. public:
  10. static DigitalTwinLogger *Instance();
  11. void Initialize(const std::string &workpath);
  12. SimpleLog *&Get();
  13. public:
  14. void ReceiveTimePoint();
  15. void ReceiveExamMode(const std::string &examMode);
  16. void ReceiveDetectorHeight(float height);
  17. void ReceiveSID(float sid);
  18. void ReceiveMotionInitialPosition(int angleSensorValue, int heightSensorvalue);
  19. void ReceiveTomoStartPosition(int angleSensorValue,int heightSensorvalue);
  20. void ReceiveTomoExposureAnglePosition(int angleSensorValues);
  21. void ReceiveTomoExposureHeightPosition(int heightSensorValue);
  22. void ReceiveTomoSliceRotateSpeeds(int *speeds,int count);
  23. void ReceiveTomoSliceRotateSteps(int *steps, int count);
  24. void ReceiveTomoHeightSpeed(float speed);
  25. void ReceiveTomoNormalRotatePeriod(int period);
  26. void ReceiveMotionStopPosition(int angleSensorValue, int heightSensorvalue);
  27. void ReceiveTomoProjectParams(float acc,float lat,float sus,float brk);
  28. void ReceiveTomoProjectSliceParams(float *heights, int heightcount);
  29. void ReceiveTomoScanParam(int projectNumber, float scanAngle);
  30. template<class T> void Receive(const std::string &key,const T& data);
  31. void ReceiveErrorStop();
  32. void SaveMotionRecord();
  33. private:
  34. void Clear();
  35. std::string FormatIntVectors(std::vector<int> &params);
  36. std::string FormatFloatVectors(std::vector<float> &params);
  37. std::string FormatLLongVectors(std::vector<ULONGLONG> &params);
  38. std::string FormatPairs(std::vector<int> &params, std::vector<ULONGLONG> &ticks);
  39. private:
  40. static DigitalTwinLogger *m_instance;
  41. SimpleLog *m_logger;
  42. std::string m_examMode;
  43. float m_detectorHeight;
  44. float m_sid;
  45. int m_initialAngleSensorValue;
  46. int m_initialHeightSensorValue;
  47. int m_tomoStartAngleSensorValue;
  48. int m_tomoStartHeightSensorValue;
  49. std::vector<int> m_tomoExpAngleSensorValues;
  50. std::vector<int> m_tomoExpHeightSensorValues;
  51. std::vector<int> m_tomoSliceRotateSpeeds;
  52. std::vector<int> m_tomoSliceRotateSteps;
  53. std::vector<ULONGLONG> m_tomoExpATimes;
  54. std::vector<ULONGLONG> m_tomoExpHTimes;
  55. float m_tomoHeightSpeed;
  56. int m_motionStopAngleSensorValue;
  57. int m_motionStopHeightSensorValue;
  58. BOOL m_errorStoped;
  59. int m_tomoNormalRotatePeriod;
  60. float m_acc;
  61. float m_lat;
  62. float m_sus;
  63. float m_brk;
  64. std::vector<float> m_tomoSliceHeights;
  65. int m_tomoProjectNumber;
  66. float m_tomoScanAngle;
  67. std::vector<ULONGLONG> m_tomoTimeLine;
  68. };
  69. }