OTSOxfordImpl.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #pragma once
  2. #include "..\OTSControl\OTSSingleton.h"
  3. #include "..\OTSControl\Oxford\OxfordImplConst.h"
  4. #include "otsdataconst.h"
  5. #include "Element.h"
  6. #include "BSEImg.h"
  7. #include "PosXray.h"
  8. #include "OTSFeature.h"
  9. #include "boost\noncopyable.hpp"
  10. #include <Bruker\OTSBrukerImpl_const.h>
  11. namespace OTSController
  12. {
  13. using namespace OTSDATA;
  14. typedef enum class __declspec(dllexport) OXFORD_PARAM
  15. {
  16. BUF_LENGTH = 1024,
  17. MAX_SEGMENTS = 8192,
  18. MAX_PIXEL_MICROSECONDS = 32000,
  19. RT_SPECTRUM_BUFFER_SIZE = 64000, // SpectrumBufferSize
  20. RT_SPECTRUM_CHANNELS = 2000, // XANA_CHANNELS = 2000,
  21. RT_SPECTRUM_CHANNELS_LONG = 3000 // RT_SPECTRUM_CHANNELS_LONG = 3000,
  22. } OXFORD_PARAM;
  23. class OxfordImpl : public Singleton<OxfordImpl>, public boost::noncopyable
  24. {
  25. public:
  26. OxfordImpl(void);
  27. ~OxfordImpl(void);
  28. bool Connect();
  29. bool DisConnect();
  30. bool IsConnected();
  31. bool GetPositionXY(double& a_dPosX, double& a_dPosY);
  32. bool SetPositionXY(double a_dPosX, double a_dPosY);
  33. bool GetWorkingDistance(double& a_dWorkingDistance);
  34. bool SetWorkingDistance(double a_dWorkingDistance);
  35. bool GetMagnification(double& a_dMagnification);
  36. bool SetMagnification(double a_dMagnification);
  37. bool GetHighVoltage(double& a_dHighVoltage);
  38. bool SetHighVoltage(double a_dHighVoltage);
  39. bool GetBeamOn(bool& a_bBeamOn);
  40. bool SetBeamOn(bool a_bBeamOn);
  41. bool GetBeamBlank(bool& a_bBeamBlank);
  42. bool SetBeamBlank(bool a_bBeamBlank);
  43. bool GetExternal(bool& a_bExternal);
  44. bool SetExternal(bool a_bExternal);
  45. bool CollectXrayData(const long a_nAcTime, long* a_pnCounts, DWORD a_nBufferSize);
  46. bool CollectXrayDataAtPos(const double a_dPosX, const double a_dPosY, const long a_nAcTime, long* a_pnCounts, DWORD a_nBufferSize);
  47. bool SetBeamPosition(const double a_dPosX, const double a_dPosY);
  48. bool SetScanSpeed(const long a_nMilliseconds);
  49. bool GetImageSize(long& a_nWidth, long& a_nHeight);
  50. bool SetImageSize(const long a_nWidth, const long a_nHeight);
  51. bool CollectImage(BYTE* a_pImageBits);
  52. bool QuantifySpectrum(unsigned char* cResult);
  53. // if do x-ray quantification
  54. BOOL GetQuantificationFlag() { return m_bDoQuantification; }
  55. void SetQuantificationFlag(BOOL a_bDoQuantification) { m_bDoQuantification = a_bDoQuantification; }
  56. // m_bDoQuantification should be set first.
  57. BOOL GetXRayByPoints(CPosXraysList& a_listXrayPois, DWORD a_nACTimeMS);
  58. BOOL GetXRayByFeatures(CPosXraysList&a_listXRayPoints, std::vector<BrukerFeature>& a_vFeatures, DWORD a_nXRayAQTime);
  59. protected:
  60. void CloseClient(void);//there's no need to call from out ,the single instance destruction method will call it automatically.
  61. bool m_bInit; // initialize flag
  62. BOOL m_bDoQuantification; // if do x-ray quantification
  63. };
  64. }