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 deviceType, int imgwidth, int imgheight ,int expectcount, bool ifautoid, string knownelements) //(string deviceType, int expectcount, bool ifautoid, string knownelements) { CoxmEDSController.imgwidth = imgwidth; CoxmEDSController.imgheight = imgheight; m_eds = EDSController.GetEDSController(eds_deviceType, imgwidth, imgheight, expectcount, ifautoid, knownelements); 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); } } }