using FEIApiControl; using OTSCLRINTERFACE; using OTSModelSharp.ServiceCenter; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using NSDLL_CLR; namespace OTSMeasureApp.ServiceCenter.Coxm { class CoxmEDSController : IEDSController { public static int imgwidth=800; public static int imgheight = 600; private IEDSController m_eds; static string eds_deviceType = "Bruker";//"Oxford" "FEI" NSRestClient m_coxm_api; public CoxmEDSController(string SemType,string deviceType, int imgwidth, int imgheight ,int expectcount, bool ifautoid, string knownelements) { eds_deviceType = deviceType; CoxmEDSController.imgwidth = imgwidth; CoxmEDSController.imgheight = imgheight; //get eds switch (deviceType) { case "Oxford": m_eds = new OxfordEDSController(expectcount, ifautoid, knownelements); break; case "Bruker": { var ctrl = new EDSController("Bruker", expectcount, ifautoid, knownelements); //var delayQuant = Convert.ToBoolean(FileHelper.GetIfDelayQuantify()); var delayQuant = false;//Now it has proved that this method won't increase the speed of xray analysis.So deactivate it here. ctrl.delayQuant = delayQuant; m_eds = ctrl; } break; default: m_eds = new EDSController("OffLine", expectcount, ifautoid, knownelements); break; } m_coxm_api = CoxmSemController.GetApiClassInstance(); } public bool CollectSpectrum(uint a_nXRayAQTime, ref uint[] a_XrayData) { return m_eds.CollectSpectrum( a_nXRayAQTime, ref a_XrayData); } public bool Connect() { m_coxm_api.ServerConnect(); if(m_coxm_api.IsServerConnectStatus()) { return false; } return m_eds.Connect(); } public EDSTYPE GetEDSType() { return EDSTYPE.COXM; } public int GetExpectCount() { return m_eds.GetExpectCount(); } public bool GetIfDelayQuantify() { return m_eds.GetIfDelayQuantify(); } public bool GetXRayByFeatures(List a_listParticles, double a_nXRayAQTime, bool a_bElementInfo) { return m_eds.GetXRayByFeatures( a_listParticles, a_nXRayAQTime, a_bElementInfo); } public bool GetXRayByParts(List a_listParticles, uint a_nXRayAQTime, bool a_bElementInfo) { return m_eds.GetXRayByParts( a_listParticles, a_nXRayAQTime, a_bElementInfo); } public bool QuantifyXrayByPart(COTSParticleClr part) { return m_eds.QuantifyXrayByPart( part); } public void SetFilterKeyEleNames(List KeyNameList) { m_eds.SetFilterKeyEleNames(KeyNameList); } public void SetResolution(int resolutionWidth, int resolutionHeight) { imgwidth= resolutionWidth; imgheight= resolutionHeight; m_eds.SetResolution(resolutionWidth, resolutionHeight); } bool IEDSController.GetXRayByExpandFeatures(List a_listParticles, double a_nXRayAQTime, bool a_bElementInfo) { return m_eds.GetXRayByExpandFeatures( a_listParticles, a_nXRayAQTime, a_bElementInfo); } void IEDSController.SetQuantifiCationParam(bool IfAutoId, string knownElements) { m_eds.SetQuantifiCationParam(IfAutoId, knownElements); } } }