MsrSampleStatus.h 2.8 KB

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