PosXray.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. #pragma once
  2. #include "afx.h"
  3. #include "Element.h"
  4. #include "CSpectrumData.h"
  5. namespace OTSDATA
  6. {
  7. class __declspec(dllexport) CPosXray/* : public CPosXrayInfo*/
  8. {
  9. public:
  10. CPosXray(); // constructor
  11. CPosXray(const CPoint); // constructor
  12. //CPosXray(CPosXrayInfo*); // constructor
  13. CPosXray(const CPosXray&); // copy constructor
  14. CPosXray(CPosXray*); // copy constructor
  15. CPosXray& operator=(const CPosXray&); // =operator
  16. virtual ~CPosXray(); // destructor
  17. // channels
  18. long GetChannelsNum() const { return GENERALXRAYCHANNELS; }
  19. // x-ray data
  20. DWORD* GetXrayData() const { return (DWORD*)m_nXrayData; }
  21. void SetXrayData(DWORD* a_pnXrayData);
  22. double GetXrayDataVectorNorm();
  23. DWORD GetTotalCount() const;
  24. void GetMaxHeightPosition(long& a_nMaxHeight, long& a_nPosition) const;
  25. // clear the x-ray data
  26. // if start position is [0, GENERALXRAYCHANNELS - 1], will do the clear
  27. void ClearXrayData(const long a_nStartPos = -1);
  28. // set x-ray data at channel
  29. void SetXrayDataAtChannel(DWORD a_nXray, const long a_nChannel);
  30. static CElementChemistriesList RemoveFe(CElementChemistriesList a_listElementChemistries);
  31. static CElementChemistriesList RemoveC(CElementChemistriesList a_listElementChemistries);
  32. //--------------------cposXrayinfo.h
  33. CPoint GetPosition() const { return m_poiPosition; }
  34. void SetPosition(const CPoint& a_poiPosition) { m_poiPosition = a_poiPosition; }
  35. // index for quantify identification
  36. long GetIndex() const { return m_nIndex; }
  37. void SetIndex(const long a_nIndex) { m_nIndex = a_nIndex; }
  38. // field id
  39. long GetScanFieldId() const { return m_nFieldId; }
  40. void SetScanFieldId(const long a_nScanfieldId) { m_nFieldId = a_nScanfieldId; }
  41. // particle tag id
  42. long GetPartTagId() const { return m_nPartTagId; }
  43. void SetPartTagId(const long a_nPartTagId) { m_nPartTagId = a_nPartTagId; }
  44. // feature id
  45. long GetFeatureId() const { return m_nFeatureId; }
  46. void SetFeatureId(const long a_nFeatureId) { m_nFeatureId = a_nFeatureId; }
  47. // element quantify data
  48. CElementChemistriesList& GetElementQuantifyData() { return m_listElementQuantifyData; }
  49. CString GetQuantifiedElementsStr();
  50. void AddQuantifyElement(CElementChemistryPtr che) { m_listElementQuantifyData.push_back(che); }
  51. void SetElementQuantifyData(CElementChemistriesList& a_listElementQuantifyData);
  52. void AddElementQuantifyData(CElementChemistryPtr a_ElementQuantifyData);
  53. void NormalizeXrayQuantifyData();
  54. // record this only for DB
  55. long GetElementNum() { return m_nElementNum; }
  56. void SetElementNum(long a_nElementNum) { m_nElementNum = a_nElementNum; }
  57. protected:
  58. // cleanup
  59. void Cleanup();
  60. // initialization
  61. void Init();
  62. // duplication
  63. void Duplicate(const CPosXray& a_oSource);
  64. // x-ray data
  65. DWORD m_nXrayData[GENERALXRAYCHANNELS];
  66. //--------------------------------------------cposXrayInfo.h
  67. // position
  68. CPoint m_poiPosition;
  69. // index
  70. long m_nIndex;
  71. // field id
  72. long m_nFieldId;
  73. // particle tag id
  74. long m_nPartTagId;
  75. // feature id
  76. long m_nFeatureId;
  77. // element quantify data
  78. CElementChemistriesList m_listElementQuantifyData;
  79. // record this only for DB
  80. long m_nElementNum;
  81. //--------------------------------------------
  82. CSpectrumData* m_spectrum;
  83. };
  84. typedef std::shared_ptr<CPosXray> __declspec(dllexport) CPosXrayPtr;
  85. typedef std::vector<CPosXrayPtr> __declspec(dllexport) CPosXrayList;
  86. }