|
|
@@ -9,112 +9,121 @@ using System.Threading.Tasks;
|
|
|
|
|
|
namespace OTSMeasureApp.ServiceCenter.PicoSmart
|
|
|
{
|
|
|
- class PicoSmartEDSController : EDSController
|
|
|
- {
|
|
|
- public PicoSmartEDSController(string deviceType, int expectcount, bool ifautoid, string knownelements) : base(deviceType, expectcount, ifautoid, knownelements)
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
- //public PicoSmartApi_cshape m_api = null;
|
|
|
-
|
|
|
- //private int AnalyExpCount = 100000;
|
|
|
- //private string strResolution = "";
|
|
|
- //private int width = 0;
|
|
|
- //private int height = 0;
|
|
|
- //public PicoSmartEDSController(int MaxCounts)
|
|
|
+ //class PicoSmartEDSController : EDSController
|
|
|
+ //{
|
|
|
+ //public PicoSmartEDSController(string deviceType, int expectcount, bool ifautoid, string knownelements) : base(deviceType, expectcount, ifautoid, knownelements)
|
|
|
//{
|
|
|
- // m_api = PicoSmartSemController.GetApiClassInstance();
|
|
|
- // AnalyExpCount = MaxCounts;
|
|
|
- // Connect();
|
|
|
- //}
|
|
|
|
|
|
- //public bool CollectSpectrum(uint a_nXRayAQTime, ref uint[] a_XrayData)
|
|
|
- //{
|
|
|
- // return false;
|
|
|
//}
|
|
|
|
|
|
- //public bool Connect()
|
|
|
- //{
|
|
|
-
|
|
|
+ class PicoSmartEDSController : IEDSController
|
|
|
+ {
|
|
|
+ public PicoSmartApi_cshape m_api = null;
|
|
|
+ private static string EdsDeviceType = "Bruker";
|
|
|
+ private IEDSController m_eds=null;
|
|
|
+ private int imgwidth=640 ;
|
|
|
+ private int imgheight = 480;
|
|
|
+ public static void set_EdsDeviceType(string DeviceType)
|
|
|
+ {
|
|
|
+ EdsDeviceType=DeviceType;
|
|
|
+ }
|
|
|
+ private int AnalyExpCount = 100000;
|
|
|
+ private string strResolution = "";
|
|
|
+
|
|
|
+ public PicoSmartEDSController(string deviceType, int imgwidth, int imgheight, int expectcount, bool ifautoid, string knownelements)
|
|
|
+ {
|
|
|
+ m_api = PicoSmartSemController.GetApiClassInstance();
|
|
|
+ AnalyExpCount = expectcount;
|
|
|
+ Connect();
|
|
|
+ m_eds = EDSController.GetEDSController(EdsDeviceType, imgwidth, imgheight, expectcount, ifautoid, knownelements);
|
|
|
+ this.imgwidth = imgwidth;
|
|
|
+ this.imgheight = imgheight;
|
|
|
+ //加载能谱
|
|
|
|
|
|
- // string FEIIP = FileHelper.GetXMLInformations("FEIIP");
|
|
|
- // string FEIPORT = FileHelper.GetXMLInformations("FEIPORT");
|
|
|
- // if (FEIIP == "" || FEIPORT == "")
|
|
|
- // {
|
|
|
- // NLog.LogManager.GetCurrentClassLogger().Error("FEI电镜端口配置为空!");
|
|
|
- // return false;
|
|
|
- // }
|
|
|
- // m_api.set_ip(FEIIP);
|
|
|
- // m_api.set_port(int.Parse( FEIPORT));
|
|
|
- // if (m_api.isStart()==1)
|
|
|
- // {
|
|
|
- // return true;
|
|
|
- // }
|
|
|
-
|
|
|
- // if (m_api.start() == 1)
|
|
|
- // {
|
|
|
- // return true;
|
|
|
- // }
|
|
|
- // return false;
|
|
|
- //}
|
|
|
+ }
|
|
|
|
|
|
- //public EDSTYPE GetEDSType()
|
|
|
- //{
|
|
|
- // return EDSTYPE.PICOSMART;
|
|
|
- //}
|
|
|
+ public bool CollectSpectrum(uint a_nXRayAQTime, ref uint[] a_XrayData)
|
|
|
+ {
|
|
|
+ return m_eds.CollectSpectrum(a_nXRayAQTime, ref a_XrayData);
|
|
|
+ }
|
|
|
|
|
|
- //public int GetExpectCount()
|
|
|
- //{
|
|
|
- // return AnalyExpCount;
|
|
|
- //}
|
|
|
+ public bool Connect()
|
|
|
+ {
|
|
|
|
|
|
- //public bool GetIfDelayQuantify()
|
|
|
- //{
|
|
|
- // return false;
|
|
|
- //}
|
|
|
|
|
|
- //public bool GetXRayByFeatures(List<COTSParticleClr> a_listParticles, double a_nXRayAQTime, bool a_bElementInfo)
|
|
|
- //{
|
|
|
- // return false;
|
|
|
- //}
|
|
|
+ string FEIIP = FileHelper.GetXMLInformations("FEIIP");
|
|
|
+ string FEIPORT = FileHelper.GetXMLInformations("FEIPORT");
|
|
|
+ if (FEIIP == "" || FEIPORT == "")
|
|
|
+ {
|
|
|
+ NLog.LogManager.GetCurrentClassLogger().Error("FEI电镜端口配置为空!");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ m_api.set_ip(FEIIP);
|
|
|
+ m_api.set_port(int.Parse(FEIPORT));
|
|
|
+ if (m_api.isStart() == 1)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ else if (m_api.start() == 1)
|
|
|
+ {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
|
|
|
- //public bool GetXRayByParts(List<COTSParticleClr> a_listParticles, uint a_nXRayAQTime, bool a_bElementInfo)
|
|
|
- //{
|
|
|
- // return false;
|
|
|
- //}
|
|
|
+ public EDSTYPE GetEDSType()
|
|
|
+ {
|
|
|
+ return EDSTYPE.COXM;
|
|
|
+ }
|
|
|
|
|
|
- //public bool QuantifyXrayByPart(COTSParticleClr part)
|
|
|
- //{
|
|
|
- // return false;
|
|
|
- //}
|
|
|
+ public int GetExpectCount()
|
|
|
+ {
|
|
|
+ return m_eds.GetExpectCount();
|
|
|
+ }
|
|
|
|
|
|
- //public void SetFilterKeyEleNames(List<string> KeyNameList)
|
|
|
- //{
|
|
|
+ public bool GetIfDelayQuantify()
|
|
|
+ {
|
|
|
+ return m_eds.GetIfDelayQuantify();
|
|
|
+ }
|
|
|
|
|
|
- //}
|
|
|
+ public bool GetXRayByFeatures(List<COTSParticleClr> a_listParticles, double a_nXRayAQTime, bool a_bElementInfo)
|
|
|
+ {
|
|
|
+ return m_eds.GetXRayByFeatures(a_listParticles, a_nXRayAQTime, a_bElementInfo);
|
|
|
+ }
|
|
|
|
|
|
- //public void SetResolution(int resolutionWidth, int resolutionHeight)
|
|
|
- //{
|
|
|
+ public bool GetXRayByParts(List<COTSParticleClr> 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);
|
|
|
+ }
|
|
|
|
|
|
- //bool IEDSController.GetXRayByExpandFeatures(List<COTSParticleClr> a_listParticles, double a_nXRayAQTime, bool a_bElementInfo)
|
|
|
- //{
|
|
|
- // return true;
|
|
|
- //}
|
|
|
+ public void SetFilterKeyEleNames(List<string> KeyNameList)
|
|
|
+ {
|
|
|
+ m_eds.SetFilterKeyEleNames(KeyNameList);
|
|
|
+ }
|
|
|
|
|
|
- //private bool SetAnalyExpCount(int MaxCounts)
|
|
|
- //{
|
|
|
+ public void SetResolution(int resolutionWidth, int resolutionHeight)
|
|
|
+ {
|
|
|
+ imgwidth = resolutionWidth;
|
|
|
+ imgheight = resolutionHeight;
|
|
|
+ m_eds.SetResolution(resolutionWidth, resolutionHeight);
|
|
|
+ }
|
|
|
|
|
|
- // AnalyExpCount = MaxCounts;
|
|
|
+ bool IEDSController.GetXRayByExpandFeatures(List<COTSParticleClr> a_listParticles, double a_nXRayAQTime, bool a_bElementInfo)
|
|
|
+ {
|
|
|
+ return m_eds.GetXRayByExpandFeatures(a_listParticles, a_nXRayAQTime, a_bElementInfo);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
- // return true;
|
|
|
- //}
|
|
|
|
|
|
- //void IEDSController.SetQuantifiCationParam(bool IfAutoId, string knownElements)
|
|
|
- //{
|
|
|
- // //throw new NotImplementedException();
|
|
|
- //}
|
|
|
+ void IEDSController.SetQuantifiCationParam(bool IfAutoId, string knownElements)
|
|
|
+ {
|
|
|
+ m_eds.SetQuantifiCationParam(IfAutoId, knownElements);
|
|
|
+ }
|
|
|
}
|
|
|
}
|