OTSSemBase.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. #pragma once
  2. #include "SEMCommonConst.h"
  3. #include "SEMDataMsr.h"
  4. #include "SEMDataGnr.h"
  5. namespace OTSController {
  6. using namespace OTSDATA;
  7. const long WAITING_INVERAL = 500;
  8. const int SCREEN_SIZE_DEFAULT_MAG100_X = 1142;
  9. const int SCREEN_SIZE_DEFAULT_MAG100_Y = 856; //SCREEN_SIZE_DEFAULT_MAG100_Y = SCREEN_SIZE_DEFAULT_MAG100_X * 0.75
  10. // Base of SEM Function
  11. class __declspec(dllexport) COTSSemBase
  12. {
  13. public:
  14. COTSSemBase();
  15. ~COTSSemBase();
  16. public:
  17. // move SEM to the given point
  18. virtual BOOL MoveSEMToPoint(const CPoint& a_poiPosition, const double& a_dRotation);
  19. // SEM data measure
  20. virtual BOOL GetSEMDataMsr(CSEMDataMsrPtr a_pSEMDataMsr);
  21. virtual BOOL SetSEMDataMsr(CSEMDataMsrPtr a_pSEMDataMsr);
  22. // SEM data general
  23. virtual BOOL GetSEMDataGnr(CSEMDataGnrPtr a_pSEMDataGnr);
  24. virtual BOOL SetSEMDataGnr(CSEMDataGnrPtr a_pSEMDataGnr);
  25. // returns the name of the EM
  26. virtual CString GetName() { return OTSSEMController::GetName((int)GetType()); }
  27. // SEM Controller type ID
  28. virtual OTSSEMController::SEM_ID GetType() = 0;
  29. // calls the SEM to create a connection
  30. virtual BOOL Connect(void) = 0;
  31. // disconnects from the SEM
  32. virtual BOOL Disconnect(void) = 0;
  33. // connect test
  34. virtual BOOL IsConnected(void) = 0;
  35. // beam blank
  36. virtual BOOL GetBeamBlank(long& a_nBeamBlank) = 0;
  37. virtual BOOL SetBeamBlank(long a_nBeamBlank) = 0;
  38. // brightness
  39. virtual BOOL GetBrightness(double& a_dBrightness) = 0;
  40. virtual BOOL SetBrightness(double a_dBrightness) = 0;
  41. // contrast
  42. virtual BOOL GetContrast(double& a_dContrast) = 0;
  43. virtual BOOL SetContrast(double a_dContrast) = 0;
  44. // working distance
  45. virtual BOOL GetWorkingDistance(double& a_dWorkingDistance) = 0;
  46. virtual BOOL SetWorkingDistance(double a_dWorkingDistance) = 0;
  47. //high tension
  48. virtual BOOL GetHighTension(double& a_dKV) = 0;
  49. virtual BOOL SetHighTension(double a_dKV) = 0;
  50. // magnification
  51. virtual BOOL GetMagnification(double& a_dMagnification) = 0;
  52. virtual BOOL SetMagnification(double a_dMagnification) = 0;
  53. // scan field size
  54. virtual BOOL GetScanFieldSize(double& a_dScanFieldSizeX, double& a_dScanFieldSizeY) = 0;
  55. virtual BOOL SetScanFieldSizeX(double a_dScanFieldSizeX) = 0;
  56. // HT
  57. virtual BOOL GetHTOnOff(BOOL& a_bHTValue) = 0;
  58. virtual BOOL SetHTOnOff(BOOL a_bHTValue) = 0;
  59. virtual BOOL SetBeamCurrent(BOOL a_bValue) = 0;//bvalue=true
  60. // spot size
  61. virtual BOOL GetSpotSize(double& a_dSpotSize) = 0;
  62. virtual BOOL SetSpotSize(double a_dSpotSize) = 0;
  63. // scan mode
  64. virtual BOOL GetScanMode(long& a_nScanMode) = 0;
  65. virtual BOOL SetScanMode(long a_nScanMode) = 0;
  66. // external mode
  67. virtual int GetExternalMode() = 0;
  68. virtual BOOL SetScanExternal(BOOL externalOn) = 0;
  69. // position
  70. virtual BOOL GetPositionXY(double& a_dPositionX, double& a_dPositionY, double& a_dRotation) = 0;
  71. virtual BOOL SetPositionXY(double a_dPositionX, double a_dPositionY, double a_dRotation) = 0;
  72. virtual BOOL SetPositionXY(double a_dPositionX, double a_dPositionY) = 0;
  73. // scan field100
  74. virtual CSize GetScanField100() { return m_oScanField100; }
  75. virtual void SetScanField100(const CSize& a_oScanField100) { m_oScanField100 = a_oScanField100; }
  76. // rotation flag
  77. BOOL GetRotationFlag() { return m_bAllowRotation; }
  78. void SetRotationFlag(BOOL a_bAllowRotation) { m_bAllowRotation = a_bAllowRotation; }
  79. protected:
  80. // convert scan field size to magnification
  81. BOOL ScanFieldSizeToMag(double& a_dMagnification, double a_dScanFieldSizeX);
  82. // convert magnification to scan field size.
  83. BOOL MagToScanFieldSize(double a_dMagnification, double& a_dScanFieldSizeX, double& a_dScanFieldSizeY);
  84. // The scan field at 100 mag
  85. CSize m_oScanField100;
  86. // rotation flag
  87. BOOL m_bAllowRotation;
  88. };
  89. typedef std::shared_ptr<COTSSemBase> __declspec(dllexport) CSemBasePtr;
  90. }