MsrSampleStatus.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. #pragma once
  2. #include "otsdataconst.h"
  3. #include "XMLSerialization.h"
  4. namespace OTSMODEL {
  5. using namespace OTSDATA;
  6. __declspec(dllexport) const OTS_MSR_SAMPLE_STATUS DEFAULT_MSR_SAMPLE_STATUS = OTS_MSR_SAMPLE_STATUS::UNMEASURED;
  7. // CMsrSampleStatus command target
  8. class __declspec(dllexport) CMsrSampleStatus : public xmls::ISlo
  9. {
  10. public:
  11. CMsrSampleStatus(); // constructor
  12. CMsrSampleStatus(const CMsrSampleStatus&); // copy constructor
  13. CMsrSampleStatus(CMsrSampleStatus*); // copy constructor
  14. CMsrSampleStatus& operator=(const CMsrSampleStatus&); // =operator
  15. BOOL operator==(const CMsrSampleStatus&); // ==operator
  16. virtual ~CMsrSampleStatus(); // destructor
  17. // serialization
  18. //void Serialize(CArchive& ar);
  19. void Serialize(bool isStoring, tinyxml2::XMLDocument * classDoc, tinyxml2::XMLElement * rootNode);
  20. // status
  21. OTS_MSR_SAMPLE_STATUS GetStatus() { return m_nStatus; }
  22. void SetStatus(OTS_MSR_SAMPLE_STATUS a_nStatus) { m_nStatus = a_nStatus; }
  23. // start time
  24. COleDateTime GetStartTime() { return m_timeStart; }
  25. void SetStartTime(COleDateTime a_timeStart) { m_timeStart = a_timeStart; }
  26. // used time
  27. COleDateTimeSpan GetUsedTime() { return m_timeUsed; }
  28. void SetUsedTime(COleDateTimeSpan a_timeUsed) { m_timeUsed = a_timeUsed; }
  29. // end time
  30. COleDateTime GetEndTime() { return m_timeEnd; }
  31. void SetEndTime(COleDateTime a_timeEnd) { m_timeEnd = a_timeEnd; }
  32. // completed fields
  33. int GetCompletedFields() { return m_nCompletedFields; }
  34. void SetCompletedFields(int a_nCompletedFields) { m_nCompletedFields = a_nCompletedFields; }
  35. // completed fieldCenter
  36. std::vector<CPoint>& GetCompletedFieldsCenter() { return m_listCpltedCenter; }
  37. void SetCompletedFieldsCenter(std::vector<CPoint>& a_listCpltedCenter);
  38. // current start time
  39. COleDateTime GetStartTimeCur() { return m_timeStartCur; }
  40. void SetStartTimeCur(COleDateTime a_timeStartCur) { a_timeStartCur = m_timeStartCur; }
  41. // compute time
  42. BOOL ComputeTime(OTS_MSR_TIME_TYPE a_nType);
  43. protected:
  44. // cleanup
  45. void Cleanup();
  46. // initialization
  47. void Init();
  48. // duplication
  49. void Duplicate(const CMsrSampleStatus& a_oSource);
  50. // status
  51. OTS_MSR_SAMPLE_STATUS m_nStatus;
  52. // start time
  53. COleDateTime m_timeStart;
  54. // used time
  55. COleDateTimeSpan m_timeUsed;
  56. // end time
  57. COleDateTime m_timeEnd;
  58. // completed fields
  59. int m_nCompletedFields;
  60. // completed fieldCenter
  61. std::vector<CPoint> m_listCpltedCenter;
  62. // current start time
  63. COleDateTime m_timeStartCur;
  64. // last used time
  65. COleDateTimeSpan m_timeUsedLast;
  66. };
  67. typedef std::shared_ptr<CMsrSampleStatus> __declspec(dllexport) CMsrSampleStatusPtr;
  68. typedef std::vector<CMsrSampleStatusPtr> __declspec(dllexport) CMsrSampleStatusList;
  69. }