12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- #pragma once
- namespace DIOS::Dev::Detail::MachineryECOM
- {
- class DigitalTwinLogger
- {
- public:
- DigitalTwinLogger();
- ~DigitalTwinLogger();
- public:
- static DigitalTwinLogger *Instance();
- void Initialize(const std::string &workpath);
- SimpleLog *&Get();
- public:
- void ReceiveTimePoint();
- void ReceiveExamMode(const std::string &examMode);
- void ReceiveDetectorHeight(float height);
- void ReceiveSID(float sid);
- void ReceiveMotionInitialPosition(int angleSensorValue, int heightSensorvalue);
- void ReceiveTomoStartPosition(int angleSensorValue,int heightSensorvalue);
- void ReceiveTomoExposureAnglePosition(int angleSensorValues);
- void ReceiveTomoExposureHeightPosition(int heightSensorValue);
- void ReceiveTomoSliceRotateSpeeds(int *speeds,int count);
- void ReceiveTomoSliceRotateSteps(int *steps, int count);
- void ReceiveTomoHeightSpeed(float speed);
- void ReceiveTomoNormalRotatePeriod(int period);
- void ReceiveMotionStopPosition(int angleSensorValue, int heightSensorvalue);
- void ReceiveTomoProjectParams(float acc,float lat,float sus,float brk);
- void ReceiveTomoProjectSliceParams(float *heights, int heightcount);
- void ReceiveTomoScanParam(int projectNumber, float scanAngle);
- template<class T> void Receive(const std::string &key,const T& data);
- void ReceiveErrorStop();
- void SaveMotionRecord();
- private:
- void Clear();
- std::string FormatIntVectors(std::vector<int> ¶ms);
- std::string FormatFloatVectors(std::vector<float> ¶ms);
- std::string FormatLLongVectors(std::vector<ULONGLONG> ¶ms);
- std::string FormatPairs(std::vector<int> ¶ms, std::vector<ULONGLONG> &ticks);
- private:
- static DigitalTwinLogger *m_instance;
- SimpleLog *m_logger;
- std::string m_examMode;
- float m_detectorHeight;
- float m_sid;
- int m_initialAngleSensorValue;
- int m_initialHeightSensorValue;
- int m_tomoStartAngleSensorValue;
- int m_tomoStartHeightSensorValue;
- std::vector<int> m_tomoExpAngleSensorValues;
- std::vector<int> m_tomoExpHeightSensorValues;
- std::vector<int> m_tomoSliceRotateSpeeds;
- std::vector<int> m_tomoSliceRotateSteps;
- std::vector<ULONGLONG> m_tomoExpATimes;
- std::vector<ULONGLONG> m_tomoExpHTimes;
- float m_tomoHeightSpeed;
- int m_motionStopAngleSensorValue;
- int m_motionStopHeightSensorValue;
- BOOL m_errorStoped;
- int m_tomoNormalRotatePeriod;
- float m_acc;
- float m_lat;
- float m_sus;
- float m_brk;
- std::vector<float> m_tomoSliceHeights;
- int m_tomoProjectNumber;
- float m_tomoScanAngle;
- std::vector<ULONGLONG> m_tomoTimeLine;
- };
- }
|