Browse Source

add the DelayQuant parameter.

gsp 1 năm trước cách đây
mục cha
commit
0c0e59b391

+ 2 - 2
Bin/x64/Debug/Config/ProData/HardwareConfig.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XMLData PathName="HardwareConfig.xml" ID="1">
-  <Member RegName="SemControllerName" Value="Oxford" ImageInputSources="SE" />
-  <Member RegName="EDSName" Value="Oxford" />
+  <Member RegName="SemControllerName" Value="OffLine" ImageInputSources="SE" />
+  <Member RegName="EDSName" Value="OffLine" DelayQuantify="true" />
   <Member RegName="BrukerDllVersion" Version="Bruker.API.Esprit64.dll" />
   <Member RegName="FEIIP" Value="192.168.0.1" />
   <Member RegName="FEIPORT" Value="7520" />

+ 0 - 1
OTSCPP/OTSClassifyEngine/CGroupClassify.cpp

@@ -1,6 +1,5 @@
 #include "stdafx.h"
 #include "LanguageID.h"
-//#include "MultiLang.h"
 #include "CGroupClassify.h"
 #include <algorithm>
 #include "OTSSTDLibFileMgr.h"

+ 27 - 38
OTSCPP/OTSControl/Bruker/OTSBrukerImpl.cpp

@@ -1452,7 +1452,7 @@ BOOL COTSBrukerImpl::StartSpectrumMeasurement()
 
 // call IsSpectrumMeterRunning
 // return true if success
-BOOL COTSBrukerImpl::IsSpectrumMeterRunning(BOOL& a_bRunning)
+BOOL COTSBrukerImpl::IsSpectrumMeasureRunning(BOOL& a_bRunning)
 {
 
 	double nState;
@@ -1579,20 +1579,20 @@ BOOL COTSBrukerImpl::QuantifyXrayPoint(CPosXray* a_pXRayPoint, CString a_strMeth
 	// ok, return true
 	return true;
 }
-BOOL COTSBrukerImpl::QuantifyPosXrayPointsOnLine(std::vector<CPosXrayPtr>& a_vXRayParts)
-{
-
-	
-	if (!SetXRayPoints(a_vXRayParts))
-	{
-		// failed to call ReadXRayPoints method
-		LogTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::CollectXRayPoints: failed to call ReadXRayPoints method."));
-		return FALSE;
-	}
-
-	// ok, return true
-	return true;
-}
+//BOOL COTSBrukerImpl::QuantifyPosXrayPointsOnLine(std::vector<CPosXrayPtr>& a_vXRayParts)
+//{
+//
+//	
+//	if (!QuantifyPosXrayPointsOnLine(a_vXRayParts))
+//	{
+//		// failed to call ReadXRayPoints method
+//		LogTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::CollectXRayPoints: failed to call ReadXRayPoints method."));
+//		return FALSE;
+//	}
+//
+//	// ok, return true
+//	return true;
+//}
 BOOL COTSBrukerImpl::QuantifyPosXrayPointOnLine(CPosXrayPtr a_vXRayPart)
 {
 	char* pcMethod = "Default";//"Default";//"Automatic";
@@ -1943,7 +1943,7 @@ BOOL COTSBrukerImpl::SpectrumLifeTimeMeasurement(DWORD a_nLifeTime)
 	{
 #pragma warning(suppress: 28159)
 		nEnd = GetTickCount();
-		if (!IsSpectrumMeterRunning(bRunning))
+		if (!IsSpectrumMeasureRunning(bRunning))
 		{
 			// error, failed to call IsSpectrumMeterRunning method
 			LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::SpectrumLifeTimeMeasurement: failed to call IsSpectrumMeterRunning method."));
@@ -1999,7 +1999,7 @@ BOOL COTSBrukerImpl::SpectrumRealTimeMeasurement(DWORD a_nRealTime)
 	{
 #pragma warning(suppress: 28159)
 		nEnd = GetTickCount();
-		if (!IsSpectrumMeterRunning(bRunning))
+		if (!IsSpectrumMeasureRunning(bRunning))
 		{
 			// error, failed to call IsSpectrumMeterRunning method
 			LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::SpectrumRealTimeMeasurement: failed to call IsSpectrumMeterRunning method."));
@@ -2040,7 +2040,7 @@ BOOL COTSBrukerImpl::SpectrumCountsMeasurement(DWORD a_nTotalCounts, int a_nTime
 	BOOL bRunning = TRUE;
 	do
 	{
-		if (!IsSpectrumMeterRunning(bRunning))
+		if (!IsSpectrumMeasureRunning(bRunning))
 		{
 			// error, failed to call IsSpectrumMeterRunning method
 			LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::SpectrumCountsMeasurement: failed to call IsSpectrumMeterRunning method."));
@@ -2442,6 +2442,10 @@ BOOL COTSBrukerImpl::GetXRayByPoints(CPosXrayList& a_listXrayPois, DWORD a_nACTi
 			// set spectrum data for the x-ray point
 			a_listXrayPois[i]->SetXrayData(nChannelData);
 		}
+		if (m_bDoQuantification)
+		{
+			QuantifyPosXrayPointsOnLine(a_listXrayPois);
+		}
 		
 		return TRUE;
 
@@ -2456,7 +2460,7 @@ BOOL COTSBrukerImpl::GetXRayByPoints(CPosXrayList& a_listXrayPois, DWORD a_nACTi
 	return FALSE;
 }
 
-BOOL COTSBrukerImpl::SetXRayPoints(CPosXrayList& a_listXrayPois/*, const DWORD a_nACTimeMS*/)
+BOOL COTSBrukerImpl::QuantifyPosXrayPointsOnLine(CPosXrayList& a_listXrayPois/*, const DWORD a_nACTimeMS*/)
 {
 	// Fail a_vXPoints is empty
 	if (a_listXrayPois.empty())
@@ -2481,8 +2485,8 @@ BOOL COTSBrukerImpl::SetXRayPoints(CPosXrayList& a_listXrayPois/*, const DWORD a
 			char* pcParams = "ResultType=quantification";
 			char cResult[10000];
 			memset(cResult, 0, 10000);
-
-			if (BrukerDll::QuantifyPointListSpectrum(m_nClientID, i, pcMethod, pcParams, cResult, 10000, (BrukerDll::PRTSpectrumHeaderRec)m_psRTSpectrumBuffer.get(), (int)BRUKER_PARAM::RT_SPECTRUM_BUFFER_SIZE) != 0)
+			int xraySequence = a_listXrayPois[i]->GetIndex();
+			if (BrukerDll::QuantifyPointListSpectrum(m_nClientID, xraySequence, pcMethod, pcParams, cResult, 10000, (BrukerDll::PRTSpectrumHeaderRec)m_psRTSpectrumBuffer.get(), (int)BRUKER_PARAM::RT_SPECTRUM_BUFFER_SIZE) != 0)
 			{
 				LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::SetXRayPoints failed to call QuantifyPointListSpectrum method at index %d, error code %d"), i, -1);
 				
@@ -2491,22 +2495,6 @@ BOOL COTSBrukerImpl::SetXRayPoints(CPosXrayList& a_listXrayPois/*, const DWORD a
 			a_listXrayPois[i]->SetElementQuantifyData(listElement);
 		
 
-		// get spectrum data of a point
-		//bool success = GetPointListSpectrum(i, (long*)nChannelData);
-		//if (!success)
-		//{
-		//	// error
-		//	CPoint poi = a_listXrayPois[i]->GetPosition();
-		//	LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::SetXRayPoints:Call GetPointListSpectrum failed : index = %d(x : %d, y : %d)"),
-		//		i,
-		//		poi.x,
-		//		poi.y);
-
-		//	return FALSE;
-		//}
-
-		//// set spectrum data for the x-ray point
-		//a_listXrayPois[i]->SetXrayData(nChannelData);
 	}
 
 	
@@ -2631,8 +2619,9 @@ BOOL COTSBrukerImpl::SetXRayPointsByFeature(CPosXrayList& a_vXPoints, const DWOR
 			char* pcMethod = "Default";//"Default";// "Automatic";
 			char* pcParams = "ResultType=quantification";
 			char cResult[10000];
+			int index = a_vXPoints[i]->GetIndex();
 			memset(cResult, 0, 10000);
-			if (BrukerDll::QuantifyFeatureListSpectrum(m_nClientID, i, pcMethod, pcParams, cResult, 10000, (BrukerDll::PRTSpectrumHeaderRec)m_psRTSpectrumBuffer.get(), (int)BRUKER_PARAM::RT_SPECTRUM_BUFFER_SIZE) != 0)
+			if (BrukerDll::QuantifyFeatureListSpectrum(m_nClientID, index, pcMethod, pcParams, cResult, 10000, (BrukerDll::PRTSpectrumHeaderRec)m_psRTSpectrumBuffer.get(), (int)BRUKER_PARAM::RT_SPECTRUM_BUFFER_SIZE) != 0)
 			{
 				LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::SetXRayPoints failed to call QuantifyPointListSpectrum method, error code %d"), -1);
 				//return FALSE;

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

@@ -126,7 +126,7 @@ namespace OTSController {
 
 		// spectrum measurement 
 		BOOL StartSpectrumMeasurement();
-		BOOL IsSpectrumMeterRunning(BOOL& a_bRunning);
+		BOOL IsSpectrumMeasureRunning(BOOL& a_bRunning);
 		BOOL StopSpectrumMeasure(void);
 		BOOL ReadSpectrum(long* a_pnCounts, DWORD a_nBufferSize);
 
@@ -147,8 +147,8 @@ namespace OTSController {
 		
 		BOOL GetXRayByFeatures(CPosXrayList& a_vXPoints, std::vector<BrukerFeature> a_vFeatures, SHORT a_nACTimeMS);
 		BOOL SetXRayPointsByFeature(CPosXrayList& a_vXPoints, const DWORD a_nACTimeMS);
-
-		BOOL QuantifyPosXrayPointsOnLine(std::vector<CPosXrayPtr>& a_vXRayParts);//delay quantifying 
+		BOOL QuantifyPosXrayPointsOnLine(CPosXrayList& a_vXRayParts/*, const DWORD a_nACTimeMS*/);//delay quantifying 
+		
 		BOOL QuantifyPosXrayPointOnLine(CPosXrayPtr a_vXRayPart);//delay quantifying 
 
 	protected:
@@ -160,7 +160,7 @@ namespace OTSController {
 
 		BOOL LoadSpectrum(char* a_sFilePathName);
 		BOOL ReadSpectrum(void);
-		BOOL SetXRayPoints(CPosXrayList& a_listXrayPois/*, const DWORD a_nACTimeMS*/);
+		
 		BOOL PutSpectrum(char* m_pBuffer, long a_nBufferSize);
 		BOOL CreateSpectrum(char* m_pParamBuffer, BrukerDll::PRTSpectrumHeaderRec a_poSpcHR, char* m_pResultBuffer, int32_t& a_nBufferSize);
 

+ 0 - 4
OTSCPP/OTSControl/Simulate/OTSEDSSim.cpp

@@ -271,10 +271,6 @@ namespace OTSController {
 	}
 
 
-	/*BOOL  COTSEDSSim::IsSupportQuantification()
-	{
-		return TRUE;		
-	}*/
 
 	BOOL  COTSEDSSim::GetQuantificationMethods(std::vector<CString>& a_vMethods)
 	{

+ 1 - 23
OTSIncAMeasureApp/1-OTSMeasure/Measure/1-OTSInclution/SmplMeasureInclution.cs

@@ -51,29 +51,7 @@ namespace OTSModelSharp
             }
 
         }
-        //public override void ClassifyMergedParticles(List<COTSParticleClr> mergedParts)
-        //{
-        //    try
-        //    {
-
-        //        var quantifyparts = mergedParts;
-        //        int nSize = quantifyparts.Count();
-
-        //        // go through all analysis particles
-        //        for (int i = 0; i < nSize; ++i)
-        //        {
-        //            string libname = m_Sample.GetMsrParams().GetSTDName();
-        //            ClassifyIncAParticle(quantifyparts[i], libname);
-        //        }
-
-
-        //    }
-        //    catch (Exception e)
-        //    {
-        //        log.Info("merged parts classify failed. " + e.Message);
-        //    }
-
-        //}
+      
 
         public bool ClassifyIncAParticle(COTSParticleClr particle, string libname)// classify particles
         {

+ 2 - 5
OTSIncAMeasureApp/1-OTSMeasure/Measure/3-MeasureFlow/CSmplMeasure.cs

@@ -488,7 +488,7 @@ namespace OTSModelSharp
                 if (thecount < expect)
                 {
 
-                    particle.SetType((int)OTS_PARTICLE_TYPE.LOW_COUNT);//4 represent "lowcount"
+                    particle.SetType((int)OTS_PARTICLE_TYPE.LOW_COUNT);
                     particle.SetTypeColor("#000000");
                     particle.SetTypeName("LowCounts");
                     return true;
@@ -500,10 +500,7 @@ namespace OTSModelSharp
         {
             return;
         }
-        //public virtual void ClassifyMergedParticles(List<COTSParticleClr> parts)
-        //{
-        //    return;
-        //}
+      
         private class SEMStateObject
         {
             private PointF pos;

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

@@ -16,9 +16,14 @@ namespace OTSModelSharp.ServiceCenter
         private COTSControlFunExport eds;
         static IEDSController edsctrl = null;
         private List<String> keyElenamelist = new List<string>();
+        static bool delayQuant;
+
+        //public bool DelayQuant { get => delayQuant; set => delayQuant = value; }
+
         public static IEDSController GetEDSController(int imgwidth,int imgheight,int expectCount)
         {
             string deviceType = FileHelper.GetXMLInformations("EDSName");
+            delayQuant = Convert.ToBoolean(FileHelper.GetIfDelayQuantify());
             if (edsctrl == null)
             {
                 if (deviceType == "FEI")
@@ -34,12 +39,13 @@ namespace OTSModelSharp.ServiceCenter
                 else if (deviceType == "Bruker")
                 {
                     edsctrl = new EDSController("Bruker",expectCount);
-
+                    delayQuant = Convert.ToBoolean(FileHelper.GetIfDelayQuantify());
 
                 }
                 else if (deviceType == "OffLine")
                 {
                     edsctrl = new EDSController("OffLine",expectCount);
+                  
 
                 }
                 edsctrl.SetResolution(imgwidth, imgheight);
@@ -132,7 +138,10 @@ namespace OTSModelSharp.ServiceCenter
 
             COTSParticleClr[] parts = a_listParticles.ToArray();
 
-
+            if (delayQuant)
+            {
+                a_bElementInfo = false;
+            }
             result= eds.GetXRayByFeatures((uint)a_nXRayAQTime, parts, a_bElementInfo);
 
 
@@ -225,7 +234,7 @@ namespace OTSModelSharp.ServiceCenter
                         lastParts[m] = a_listParticles[nTimes * 1024 + m];
                         lastPs[m] = Ps[nTimes * 1024 + m];
                     }
-
+                    
                     if (!eds.GetXRayByPoints(a_nXRayAQTime, lastPs, lastParts, a_bElementInfo))
                     {
                         NLog.LogManager.GetCurrentClassLogger().Error("GetXRayByPoints: failed to get element.");
@@ -242,7 +251,10 @@ namespace OTSModelSharp.ServiceCenter
             {
                 COTSParticleClr[] parts = a_listParticles.ToArray();
 
-
+                if (delayQuant)
+                {
+                    a_bElementInfo = false;
+                }
 
                 result = eds.GetXRayByPoints(a_nXRayAQTime, Ps, parts, a_bElementInfo);
 

+ 49 - 4
OTSIncAMeasureApp/ServiceCenter/FileHelper.cs

@@ -22,13 +22,56 @@ namespace OTSModelSharp.ServiceCenter
             return folderName;
        
         }
+        public static string GetXMLInformations(string Name)
+        {
+            try
+            {
+                XmlDocument doc;
+                string value = string.Empty;
+                if (Hardwareconfigdoc == null)
+                {
+                    string xmlFilePath = System.Configuration.ConfigurationManager.ConnectionStrings["XMLFileName"].ConnectionString;
+
+
+                    Hardwareconfigdoc = new XmlDocument();
+
+                    Hardwareconfigdoc.Load(xmlFilePath);    //加载Xml文件 
+                    doc = Hardwareconfigdoc;
+
+                }
+                else
+                {
+                    doc = Hardwareconfigdoc;
+                }
+
+
+                XmlElement root = doc.DocumentElement;   //获取根节点  
 
+                XmlNodeList mainNodes = root.GetElementsByTagName("Member"); //获取子节点集合  
+
+                foreach (XmlNode node in mainNodes)
+                {
+                    //获取Name属性值
+                    string name = ((XmlElement)node).GetAttribute("RegName");
+                    if (name.Equals(Name))
+                    {
+                        value = ((XmlElement)node).GetAttribute("Value");
+                        break;
+                    }
+                }
+                return value;
+            }
+            catch (Exception)
+            {
+                return "";
+            }
+        }
         /// <summary>
         /// 获取XML节点参数
         /// </summary>
         /// <param name="Name">节点参数名称</param>
         /// <returns>节点参数</returns>
-        public static string GetXMLInformations(string Name)
+        public static string GetIfDelayQuantify()
         {
             try
             {
@@ -59,9 +102,11 @@ namespace OTSModelSharp.ServiceCenter
                 {
                     //获取Name属性值
                     string name = ((XmlElement)node).GetAttribute("RegName");
-                    if (name.Equals(Name))
+                    if (name.Equals("EDSName"))
                     {
-                        value = ((XmlElement)node).GetAttribute("Value");
+                       
+                            value = ((XmlElement)node).GetAttribute("DelayQuantify");
+                       
                         break;
                     }
                 }
@@ -69,7 +114,7 @@ namespace OTSModelSharp.ServiceCenter
             }
             catch (Exception)
             {
-                return "";
+                return "false";
             }
         }
         public static string GetOxfordInputSourceType()