Browse Source

change the quantification code of the bruker eds

gsp 1 year ago
parent
commit
e840d56260

+ 54 - 4
OTSCPP/OTSControl/Bruker/OTSBrukerImpl.cpp

@@ -5,9 +5,23 @@
 #include "BrukerSPXFileMgr.h"
 #include "ControllerHelper.h"
 #include <COTSUtilityDllFunExport.h>
-
+ 
 namespace OTSController {
-
+	namespace 
+	{
+		void Split(CString source, CStringArray& dest, CString division)
+		{
+			dest.RemoveAll();
+			int pos = 0;
+			int pre_pos = 0;
+			while (-1 != pos) {
+				pre_pos = pos;
+				pos = source.Find(division, (pos + 1));
+				dest.Add(source.Mid(pre_pos, (pos - pre_pos)));
+			}
+		}
+	
+	}
 	unsigned int DEFAULT_MAX_WAIT_TIME_COLLECT_COUNTS = 5000;
 
 	const CString DllXMLFileName = "./Config/ProData/HardwareConfig.xml";
@@ -1399,6 +1413,24 @@ BOOL COTSBrukerImpl::QuantifyPosXrayPointOnLine(CPosXrayPtr a_vXRayPart)
 {
 	char* pcMethod = "Default";//"Default";//"Automatic";
 	char* pcParams = "ResultType=quantification";
+	if (m_ifAutoId == TRUE)
+	{
+		pcParams = "ResultType=quantification";
+	}
+	else
+	{
+		
+		CStringArray eles;
+		CString elementspara;
+		Split(m_knownElements, eles, _T(","));
+		for (int i = 0; i < eles.GetSize(); i++)
+		{
+			elementspara += _T("Element=") + eles.GetAt(i) + _T(" ");
+		}
+		elementspara.TrimRight();
+		CString pcPara = _T("ResultType=quantification ") + elementspara;
+		pcParams = pcPara.GetBuffer();
+	}
 	char cResult[10000];
 	memset(cResult, 0, 10000);
 
@@ -2238,11 +2270,20 @@ BOOL COTSBrukerImpl::QuantifyPosXrayPointsOnLine(CPosXrayList& a_listXrayPois)
 			char* pcParams;
 			if (m_ifAutoId == TRUE)
 			{
-				 pcParams = "ResultType=quantification";
+				pcParams = "ResultType=quantification";
 			}
 			else
 			{
-				CString pcPara = _T("ResultType=quantification Element=" ) + m_knownElements;
+
+				CStringArray eles;
+				CString elementspara;
+				Split(m_knownElements, eles, _T(","));
+				for (int i = 0; i < eles.GetSize(); i++)
+				{
+					elementspara += _T("Element=") + eles.GetAt(i) + _T(" ");
+				}
+				elementspara.TrimRight();
+				CString pcPara = _T("ResultType=quantification ") + elementspara;
 				pcParams = pcPara.GetBuffer();
 			}
 			
@@ -2383,6 +2424,15 @@ BOOL COTSBrukerImpl::SetXRayPointsByFeature(CPosXrayList& a_vXPoints, const DWOR
 			// quantify the spectrum
 			char* pcMethod = "Default";//"Default";// "Automatic";
 			char* pcParams = "ResultType=quantification";
+			if (m_ifAutoId == TRUE)
+			{
+				pcParams = "ResultType=quantification";
+			}
+			else
+			{
+				CString pcPara = _T("ResultType=quantification ") + m_knownElements;
+				pcParams = pcPara.GetBuffer();
+			}
 			char cResult[10000];
 			int index = a_vXPoints[i]->GetIndex();
 			memset(cResult, 0, 10000);

+ 1 - 1
OTSCPP/OTSControl/Bruker/OTSBrukerImpl.h

@@ -236,7 +236,7 @@ namespace OTSController {
 		BOOL m_bShowQuantificationSpectrum;		
 
 		int m_expectCount;
-		BOOL m_ifAutoId;
+		BOOL m_ifAutoId=TRUE;
 		CString m_knownElements;
 
 	};

+ 1 - 1
OTSIncAMeasureApp/ServiceCenter/CPP(Bruker)API/EDSController.cs

@@ -358,7 +358,7 @@ namespace OTSModelSharp.ServiceCenter
 
         public void SetQuantifiCationParam(bool IfAutoId, string knownElements)
         {
-            throw new NotImplementedException();
+            eds.SetQuantificationParam(IfAutoId, knownElements);
         }
     }
 }

+ 1 - 1
OTSIncAMeasureApp/ServiceCenter/FEIAutoScript/FEIEDSController.cs

@@ -176,7 +176,7 @@ namespace OTSMeasureApp.ServiceCenter
 
         public void SetQuantifiCationParam(bool IfAutoId, string knownElements)
         {
-            throw new NotImplementedException();
+            ApiClass.SetQuantificationParam(IfAutoId, knownElements);
         }
     }
 }

+ 2 - 2
OTSIncAMeasureApp/ServiceCenter/OxfordExtender/OxfordEDSController.cs

@@ -32,7 +32,7 @@ namespace OTSMeasureApp.ServiceCenter
         public OxfordEDSController( int MaxCounts,bool ifautoid, string knownelements)
         {
             iExtender = ExtenderWrapperIpc.GetExtenderWrapper();
-            iExtender.SetQuantifiCationParam(ifautoid, knownelements);
+            iExtender.SetQuantifiCationParam1(ifautoid, knownelements);
             SetAnalyExpCount(MaxCounts);
         }
 
@@ -193,7 +193,7 @@ namespace OTSMeasureApp.ServiceCenter
 
         public void SetQuantifiCationParam(bool IfAutoId, string knownElements)
         {
-            throw new NotImplementedException();
+            iExtender.SetQuantifiCationParam1(IfAutoId, knownElements);
         }
     }
 }

+ 3 - 3
OxfordExtenderWrapper/ExtenderIpcUI1.cs

@@ -346,10 +346,10 @@ namespace OxfordExtenderWrapper
 
 
         }
-        public void SetQuantifiCationParam(bool IfAutoId, string knownElements)
+        public void SetQuantifiCationParam1(bool IfAutoId, string knownElements)
         {
-        
-        
+
+            iExtender.SetQuantifiCationParam(IfAutoId, knownElements);
         }
 
 

+ 12 - 6
OxfordExtenderWrapper/ExtenderWrapper.cs

@@ -319,8 +319,10 @@ namespace OxfordExtenderWrapper
     (",Fr,Ra,Ac") +
 
     (",Th,Pa,U,Np,Pu,Am,Cm,Bk,Cf,Es,Fm,Md,No,Lr");
-    //构造函数
-    public ExtenderWrapper()
+        private bool m_ifautoid = true;
+        private string m_knownelements;
+        //构造函数
+        public ExtenderWrapper()
         {
             //ConnectToEDSHardware();
         }
@@ -1379,8 +1381,7 @@ namespace OxfordExtenderWrapper
             4096,
             8192
         };
-        private bool m_ifautoid;
-        private string m_knownelements;
+       
 
         public double GetDImagePixelsize()
         {
@@ -1651,6 +1652,9 @@ namespace OxfordExtenderWrapper
             {
                 if (m_ifautoid == false)
                 {
+                    log.Warn(autoIdSettings.KnownElements);
+                    autoIdSettings.ClearKnownElements();
+                    //m_knownelements = "K,Ca,Sc,Ti,V,Mn,Co,Ni,Cu,Zn,Ga,Ge,As,Se,Br,Kr";
                     var knownelenames = m_knownelements.Split(',');
 
                     foreach (var ele in knownelenames)
@@ -1663,13 +1667,15 @@ namespace OxfordExtenderWrapper
                         }
 
                     }
-                  
 
+                    log.Warn(autoIdSettings.KnownElements);
+                   
                 }
                 else 
                 {
-                    autoIdSettings.ClearKnownElements();
+                   
                 }
+                
                 EdSpectrumProcessing.IdentifyElements(e.Value, autoIdSettings);
                 // While it is possible to choose other elements, Oxygen is the only supported element by stoichiometry.
                 quantSettings.CombinedElement = 8;