123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217 |
- using FEIApiControl;
- using OTSCLRINTERFACE;
- using OTSModelSharp.ServiceCenter;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace OTSMeasureApp.ServiceCenter
- {
- class FEISemController : ISemController
- {
- static APIClass m_ApiClass = null;
- public FEISemController()
- {
- m_ApiClass = new APIClass();
- }
- public static APIClass GetApiClassInstance()
- {
- if (m_ApiClass == null)
- {
- m_ApiClass = new APIClass();
- }
- return m_ApiClass;
- }
- public bool Connect()
- {
- string FEIIP = FileHelper.GetXMLInformations("FEIIP");
- string FEIPORT = FileHelper.GetXMLInformations("FEIPORT");
- if (FEIIP == "" || FEIPORT == "")
- {
- NLog.LogManager.GetCurrentClassLogger().Error("FEI电镜端口配置为空!");
- return false;
- }
- if (m_ApiClass.isConnect())
- {
- return true;
- }
- return m_ApiClass.Connect(FEIIP, FEIPORT);
- }
- public bool DisConnect()
- {
- return m_ApiClass.DisConnect();
- }
-
- public bool GetMagnification(ref double a_dMagnification)
- {
- return m_ApiClass.GetMagnification(ref a_dMagnification);
- }
- public bool GetScanFieldSize(ref double dScanFieldSizeX, ref double dScanFieldSizeY)
- {
- return m_ApiClass.GetSemScanFieldSize(ref dScanFieldSizeX, ref dScanFieldSizeY);
- }
- public bool GetScanFieldSize100(ref double dScanFieldSizeX, ref double dScanFieldSizeY)
- {
- m_ApiClass.SetMagnification(100);
- return m_ApiClass.GetSemScanFieldSize(ref dScanFieldSizeX, ref dScanFieldSizeY);
- }
- public bool GetSemBeamBlank(ref int a_nBeamBlank)
- {
- if (m_ApiClass.GetIsBlanked())
- {
- a_nBeamBlank = 1;
- }
- else
- {
- a_nBeamBlank = 0;
- }
- return true;
- }
- public bool GetSemBrightness(ref double a_dBrightness)
- {
- a_dBrightness = m_ApiClass.GetDetectorBrightness();
- return true;
- }
- public bool GetSemContrast(ref double a_dContrast)
- {
- a_dContrast = m_ApiClass.GetDetectorContrast();
- return true;
- }
- public bool GetSemHighTension(ref double a_dKV)
- {
- a_dKV = m_ApiClass.GetHightVoltage() / 1000;
- return true;
- }
- public bool GetSemPositionXY(ref double a_dPositionX, ref double a_dPositionY, ref double a_dPositionR)
- {
- double a_dPositionZ = 0;
- double a_dPositionT = 0;
- return m_ApiClass.GetSemPositionXYZRT(ref a_dPositionX, ref a_dPositionY, ref a_dPositionZ, ref a_dPositionR, ref a_dPositionT);
- }
- public bool GetWorkingDistance(ref double a_distance)
- {
- return m_ApiClass.GetWorkingDistance(ref a_distance);
- }
- public bool IsConnected()
- {
- return m_ApiClass.isConnect();
- }
- public bool MoveSEMToPoint(double a_dPositionX, double a_dPositionY, double rotation)
- {
- return m_ApiClass.SetSemPositionXYR(a_dPositionX, a_dPositionY, rotation);
- }
- public bool MoveSEMToPoint(double a_dPositionX, double a_dPositionY)
- {
- return m_ApiClass.SetSemPositionXY(a_dPositionX, a_dPositionY);
- }
- public bool SetMagnification(double a_dMagnification)
- {
- return m_ApiClass.SetMagnification(a_dMagnification);
- }
- public bool SetScanExternal(bool b)
- {
- return m_ApiClass.SetSemScanExternal(b);
- }
- public bool SetScanFieldSize100(double dScanFieldSizeX, double dScanFieldSizeY)
- {
- throw new NotImplementedException();
- }
- public bool SetSemBeamBlank(bool val)
- {
- if (val)
- {
- return m_ApiClass.SetBeamStateOn();
- }
- else
- {
- return m_ApiClass.SetBeamStateOff();
- }
- }
- public bool SetSemBeamCurrentOff(bool val)
- {
- if (val)
- {
- return m_ApiClass.SetBeamStateOn();
- }
- else
- {
- return m_ApiClass.SetBeamStateOff();
- }
- }
- public bool SetSemBrightness(double a_dBrightness)
- {
- return m_ApiClass.SetDetectorBrightness(a_dBrightness);
- }
- public bool SetSemContrast(double a_dContrast)
- {
- return m_ApiClass.SetDetectorContrast(a_dContrast);
- }
- public bool SetSemHighTension(double a_dKV)
- {
- return m_ApiClass.SetHightVoltage(a_dKV);
- }
- public bool SetSemHTOff(bool value)
- {
- return m_ApiClass.SetBeamStateOff();
- }
- public bool SetWorkingDistance(double a_distance)
- {
- return m_ApiClass.SetWorkingDistance(a_distance);
- }
- public bool StopXrayAcquisition()
- {
- return m_ApiClass.DisConnect();
- }
- public bool RunHIGH_VACUUM()
- {
- return m_ApiClass.RunHIGH_VACUUM();
- }
- public bool StopImageAcquisition()
- {
- return m_ApiClass.Stop_acquisition();
- }
- public bool SetReducedArea()
- {
- return m_ApiClass.SetReducedArea();
- }
- public bool SetFullFrame()
- {
- return m_ApiClass.SetFullFrame();
- }
- }
- }
|