gsp 2 роки тому
батько
коміт
b3ec248f2a

+ 55 - 75
OTSCPP/OTSControl/Bruker/OTSBrukerImpl.cpp

@@ -5,12 +5,8 @@
 #include "BrukerSPXFileMgr.h"
 #include "ControllerHelper.h"
 #include <COTSUtilityDllFunExport.h>
-#include "CFindPeaks.h"
-
 
 namespace OTSController {
-	
-
 
 	unsigned int DEFAULT_MAX_WAIT_TIME_COLLECT_COUNTS = 5000;
 
@@ -866,8 +862,9 @@ namespace OTSController {
 
 		// create array of BrukerSegment
 		long nCollectCount = (long)a_vXPoints.size();
-		//boost::scoped_array<BrukerSegment> segmentArray(new BrukerSegment[nCollectCount]);
-		BrukerDll::PSegmentList segmentArray=new BrukerDll::TSegment[nCollectCount];
+
+		boost::scoped_array<BrukerDll::TSegment> segmentArray(new BrukerDll::TSegment[nCollectCount]);
+
 		for (int i = 0; i < nCollectCount; ++i)
 		{
 			CPoint poi = a_vXPoints[i]->GetPosition();
@@ -876,7 +873,7 @@ namespace OTSController {
 		}
 
 		// ask bruker to collect a set of x ray data
-		if (!StartPointListMeasurement(nCollectCount, segmentArray, a_nACTimeMS))
+		if (!StartPointListMeasurement(nCollectCount, segmentArray.get(), a_nACTimeMS))
 		{
 			// failed to call StartPointListMeasurement method
 			LogTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::CollectXRayPoints: failed to call StartPointListMeasurement method."));
@@ -890,7 +887,7 @@ namespace OTSController {
 			LogTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::CollectXRayPoints: failed to call ReadXRayPoints method."));
 			return FALSE;
 		}
-		delete segmentArray;
+		//delete segmentArray;
 		// ok return TRUE
 		return TRUE;
 	}
@@ -915,8 +912,9 @@ namespace OTSController {
 
 		// create array of BrukerSegment
 		long nCollectCount = (long)a_listXrayPois.size();
-		//boost::scoped_array<BrukerSegment> segmentArray(new BrukerSegment[nCollectCount]);
-		BrukerDll::PSegmentList segmentArray=new BrukerDll::TSegment[nCollectCount];
+
+		boost::scoped_array<BrukerDll::TSegment> segmentArray(new BrukerDll::TSegment[nCollectCount]);
+
 		for (int i = 0; i < nCollectCount; ++i)
 		{
 			CPoint poi = a_listXrayPois[i]->GetPosition();
@@ -926,7 +924,7 @@ namespace OTSController {
 		}
 
 		// ask bruker to collect a set of x ray data
-		if (!StartPointListMeasurement(nCollectCount, segmentArray, a_nACTimeMS))
+		if (!StartPointListMeasurement(nCollectCount, segmentArray.get(), a_nACTimeMS))
 		{
 			// failed to call StartPointListMeasurement method
 			LogTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::CollectXRayPoints: failed to call StartPointListMeasurement method."));
@@ -940,7 +938,7 @@ namespace OTSController {
 			LogTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::CollectXRayPoints: failed to call ReadXRayPoints method."));
 			return FALSE;
 		}
-		delete segmentArray;
+		//delete segmentArray;
 		// ok return TRUE
 		return TRUE;
 	}
@@ -975,11 +973,10 @@ namespace OTSController {
 		long nCollectCount = (long)a_vXPoints.size();
 		long nTotalPixelCount = 0;
 
-		// add by Jieshi 23/08/2017
-		/*boost::scoped_array<WORD> pixelTimes(new WORD[nCollectCount]);
-		boost::scoped_array<BrukerFeature> features(new BrukerFeature[nCollectCount]);*/
-		SHORT* pixelTimes(new SHORT[nCollectCount]);
-		BrukerDll::TFeatureData* features(new BrukerDll::TFeatureData[nCollectCount]);
+
+		boost::scoped_array<SHORT*> pixelTimes(new SHORT*[nCollectCount]);
+		boost::scoped_array<BrukerDll::TFeatureData> features(new BrukerDll::TFeatureData[nCollectCount]);
+
 
 		std::vector<BrukerDll::TSegment> extraSegments;
 		for (size_t i = 0; i < a_vXPoints.size(); i++)
@@ -989,12 +986,12 @@ namespace OTSController {
 			{
 				int segCount = features[i].SegmentCount;
 				auto ofeature = a_vFeatures[i];
-				features->Segments = new BrukerDll::TSegment[segCount];
+				features.get()->Segments = new BrukerDll::TSegment[segCount];
 					for (int j = 0; j < segCount; j++)
 					{
-						features->Segments[j].XStart = ofeature.pSegment[j].XStart;
-						features->Segments[j].XCount = ofeature.pSegment[j].XCount;
-						features->Segments[j].Y = ofeature.pSegment[j].Y;
+						features.get()->Segments[j].XStart = ofeature.pSegment[j].XStart;
+						features.get()->Segments[j].XCount = ofeature.pSegment[j].XCount;
+						features.get()->Segments[j].Y = ofeature.pSegment[j].Y;
 					}
 					
 				//features[i].Segments = &a_vFeatures[i].pSegment;
@@ -1006,7 +1003,7 @@ namespace OTSController {
 					nPixelCount += features[i].Segments[j].XCount;
 				}
 
-				pixelTimes[i] = (WORD)(a_nACTimeMS * 1000 / nPixelCount);
+				*pixelTimes[i] = (SHORT)(a_nACTimeMS * 1000 / nPixelCount);
 				nTotalPixelCount += nPixelCount;
 			}
 			else
@@ -1019,12 +1016,13 @@ namespace OTSController {
 				features[i].SegmentCount = 1;
 				features[i].Segments = &extraSegments[extraSegments.size() - 1];
 
-				pixelTimes[i] = (WORD)(a_nACTimeMS * 1000);
+				*pixelTimes[i] = (SHORT)(a_nACTimeMS * 1000);
 			}
 		}
 
 		// ask bruker to collect a set of x-ray data
-		if (!StartFeatureListMeasurement(nCollectCount, features, &pixelTimes))
+
+		if (!StartFeatureListMeasurement(nCollectCount, features.get(), pixelTimes.get()))
 		{
 			// failed to call StartFeatureListMeasurement method
 			LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::CollectXRayPointsByFeatures: failed to call StartFeatureListMeasurement method."));
@@ -1039,9 +1037,7 @@ namespace OTSController {
 			return FALSE;
 		}
 
-		delete pixelTimes;
-		delete features;
-		// ok, return TRUE
+
 		return TRUE;
 	}
 
@@ -2543,7 +2539,9 @@ BOOL COTSBrukerImpl::GetXRayByPoints(CPosXraysList& a_listXrayPois, DWORD a_nACT
 
 		// create array of BrukerSegment
 		long nCollectCount = (long)a_listXrayPois.size();
-		BrukerDll::PSegmentList segmentArray=new BrukerDll::TSegment[nCollectCount];
+
+		boost::scoped_array<BrukerDll::TSegment> segmentArray(new BrukerDll::TSegment[nCollectCount]);
+
 		for (int i = 0; i < nCollectCount; ++i)
 		{
 			CPoint poi = a_listXrayPois[i]->GetPosition();
@@ -2553,7 +2551,7 @@ BOOL COTSBrukerImpl::GetXRayByPoints(CPosXraysList& a_listXrayPois, DWORD a_nACT
 		}
 
 		// ask Bruker to collect a set of x ray data
-		if (!StartPointListMeasurement(nCollectCount, segmentArray, a_nACTimeMS))
+		if (!StartPointListMeasurement(nCollectCount, segmentArray.get(), a_nACTimeMS))
 		{
 			// failed to call StartPointListMeasurement method
 			LogTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::CollectXRayPoints: failed to call StartPointListMeasurement method."));
@@ -2567,7 +2565,7 @@ BOOL COTSBrukerImpl::GetXRayByPoints(CPosXraysList& a_listXrayPois, DWORD a_nACT
 			LogTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::CollectXRayPoints: failed to call ReadXRayPoints method."));
 			return FALSE;
 		}
-		delete[] segmentArray;
+		//delete[] segmentArray;
 		// ok return TRUE
 		return TRUE;
 
@@ -2600,38 +2598,11 @@ BOOL COTSBrukerImpl::SetXRayPoints(CPosXraysList& a_listXrayPois, const DWORD a_
 		// cleanup data storage
 		memset(nChannelData, 0, sizeof(DWORD) * (int)BRUKER_PARAM::RT_SPECTRUM_CHANNELS);
 
-		// 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;
-		}
-
-		/*std::vector<double> peakList;
-		std::vector<CString> eleList;
-		for (size_t i = 0; i < a_listXrayPois[i]->GetElementQuantifyData().size(); i++)
-		{
-			eleList.push_back(a_listXrayPois[i]->GetElementQuantifyData()[i]->GetName());
-		}
-		bool isFilter = false;*/
-		/*if (eleList.size() != 0)
+		if (m_bDoQuantification)
 		{
-			isFilter = CPeak::FindPeaks(nChannelData, eleList);
-		}*/
-
-		//bool isFilter = true;
 
-		if (m_bDoQuantification/* && isFilter*/)
-		{
 			// quantify the spectrum
-			char* pcMethod = "Oxides";//"Default";//"Automatic";//Oxides
+			char* pcMethod = "Default";//"Default";//"Automatic";
 			char* pcParams = "ResultType=quantification";
 			char cResult[10000];
 			memset(cResult, 0, 10000);
@@ -2641,13 +2612,22 @@ BOOL COTSBrukerImpl::SetXRayPoints(CPosXraysList& a_listXrayPois, const DWORD a_
 				LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::SetXRayPoints failed to call QuantifyPointListSpectrum method at index %d, error code %d"), i, -1);
 				//return FALSE;
 			}
-			//LogErrorTrace(__FILE__, __LINE__, cResult);
 			CElementChemistriesList listElement = CElement::ExtractElementChemistrys(CControllerHelper::CharToString(cResult));
 			a_listXrayPois[i]->SetElementQuantifyData(listElement);
 		}
-		else
+
+		// get spectrum data of a point
+		bool success = GetPointListSpectrum(i, (long*)nChannelData);
+		if (!success)
 		{
-			a_listXrayPois[i]->GetElementQuantifyData().clear();
+			// 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
@@ -2729,10 +2709,11 @@ BOOL COTSBrukerImpl::GetXRayByFeatures(CPosXraysList& a_vXPoints, std::vector<Br
 	long nCollectCount = (long)a_vXPoints.size();
 	long nTotalPixelCount = 0;
 
-	// added by Jieshi 23/08/2017
-	SHORT* pixelTimes(new SHORT[nCollectCount]);
-	BrukerDll::PFeatureDataList features=new BrukerDll::TFeatureData[nCollectCount];
+
+	boost::scoped_array<SHORT*> pixelTimes(new SHORT*[nCollectCount]);
+	boost::scoped_array<BrukerDll::TFeatureData> features(new BrukerDll::TFeatureData[nCollectCount]);
 	std::vector<BrukerDll::TSegment> extraSegments;
+
 	for (size_t i = 0; i < nCollectCount; i++)
 	{
 		BrukerFeature ofeature = a_vFeatures[i];
@@ -2741,12 +2722,12 @@ BOOL COTSBrukerImpl::GetXRayByFeatures(CPosXraysList& a_vXPoints, std::vector<Br
 		{
 			int segCount = features[i].SegmentCount;
 			auto ofeature = a_vFeatures[i];
-			features->Segments = new BrukerDll::TSegment[segCount];
+			features.get()->Segments = new BrukerDll::TSegment[segCount];
 			for (int j = 0; j < segCount; j++)
 			{
-				features->Segments[j].XStart = ofeature.pSegment[j].XStart;
-				features->Segments[j].XCount = ofeature.pSegment[j].XCount;
-				features->Segments[j].Y = ofeature.pSegment[j].Y;
+				features.get()->Segments[j].XStart = ofeature.pSegment[j].XStart;
+				features.get()->Segments[j].XCount = ofeature.pSegment[j].XCount;
+				features.get()->Segments[j].Y = ofeature.pSegment[j].Y;
 			}
 
 			// calculate pixel time
@@ -2757,7 +2738,7 @@ BOOL COTSBrukerImpl::GetXRayByFeatures(CPosXraysList& a_vXPoints, std::vector<Br
 			{
 				nPixelCount += ofeature.pSegment[j].XCount;
 			}
-			pixelTimes[i] = (WORD)(ceil((double)a_nACTimeMS * 1000.0 / (double)nPixelCount));
+			*pixelTimes[i] = (SHORT)(ceil((double)a_nACTimeMS * 1000.0 / (double)nPixelCount));
 
 			nTotalPixelCount += nPixelCount;
 		}
@@ -2765,7 +2746,7 @@ BOOL COTSBrukerImpl::GetXRayByFeatures(CPosXraysList& a_vXPoints, std::vector<Br
 		{
 			// will generate according to the x-ray position
 			// this shouldn't happen
-			//BrukerFeature* features(new BrukerFeature[nCollectCount]);
+			
 			BrukerDll::PFeatureDataList features = new BrukerDll::TFeatureData[nCollectCount];
 			extraSegments.push_back(BrukerDll::TSegment());
 			extraSegments[extraSegments.size() - 1].XStart = a_vXPoints[i]->GetPosition().x;
@@ -2773,13 +2754,14 @@ BOOL COTSBrukerImpl::GetXRayByFeatures(CPosXraysList& a_vXPoints, std::vector<Br
 			features[i].SegmentCount = 1;
 			features[i].Segments = &extraSegments[extraSegments.size() - 1];
 
-			pixelTimes[i] = (WORD)(a_nACTimeMS * 1000);
+			*pixelTimes[i] = (SHORT)(a_nACTimeMS * 1000);
 			
 		}
 	}
 
 	// ask bruker to collect a set of x-ray data
-	if (!StartFeatureListMeasurement(nCollectCount, features, &pixelTimes))
+
+	if (!StartFeatureListMeasurement(nCollectCount, features.get(), pixelTimes.get()))
 	{
 		// failed to call StartFeatureListMeasurement method
 		LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::CollectXRayPointsByFeatures: failed to call StartFeatureListMeasurement method."));
@@ -2793,8 +2775,6 @@ BOOL COTSBrukerImpl::GetXRayByFeatures(CPosXraysList& a_vXPoints, std::vector<Br
 		LogErrorTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::CollectXRayPointsByFeatures: failed to call ReadXRayPointsByFeature method."));
 		return FALSE;
 	}
-	delete[] pixelTimes;
-	delete[] features;
 	
 	return TRUE;
 }

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

@@ -4,6 +4,7 @@
 
 // Load ClientDll 
 #include "OTSBrukerImpl_const.h"
+//#include "OTSBrukerClientDll.h"
 #include "Bruker.API.Esprit.h"
 #include "otsdataconst.h"
 #include "Element.h"

+ 49 - 21
OTSCPP/OTSControl/Bruker/OTSEDSBrucker.cpp

@@ -240,12 +240,12 @@ namespace OTSController {
 		
 
 		// turn SEM to external
-		if (!m_pBrukerImpl->SetSEMExternalOn())
-		{
-			// failed to call SetSEMExternalOn method
-			LogTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::GetXRayByPoints: failed to call SetSEMExternalOn method."));
-			return FALSE;
-		}
+		//if (!m_pBrukerImpl->SetSEMExternalOn())
+		//{
+		//	// failed to call SetSEMExternalOn method
+		//	LogTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::GetXRayByPoints: failed to call SetSEMExternalOn method."));
+		//	return FALSE;
+		//}
 
 		//std::vector<CPosXrayPtr> listXRayPointsTemp;
 		//for (int i = 0; i < (int)a_vXRayPoints.size(); i++)
@@ -260,10 +260,18 @@ namespace OTSController {
 		//	
 		//}
 
-		if (!m_pBrukerImpl->GetXRayByPoints(a_vXRayPoints, a_nXRayAQTime))
+		std::vector<CPosXrayPtr> listXRayPointsTemp;
+		/*for (int i = 0; i < (int)a_vXRayPoints.size(); i++)
 		{
-			LogErrorTrace(__FILE__, __LINE__, _T("GetXRayByPoints: failed to get element."));
-		}
+			listXRayPointsTemp.push_back(a_vXRayPoints[i]);*/
+
+			if (!m_pBrukerImpl->GetXRayByPoints(a_vXRayPoints, a_nXRayAQTime))// one point per time,or we cann't get the full element data. gsp 2020-11-30
+			{
+				LogErrorTrace(__FILE__, __LINE__, _T("GetXRayByPoints: failed to get element."));
+			}
+		/*	listXRayPointsTemp.clear();
+
+		}*/
 		
 
 		//if (!m_pBrukerImpl->SetSEMExternalOff())
@@ -296,36 +304,56 @@ namespace OTSController {
 			return FALSE;
 		}
 
-		std::vector<CPosXrayPtr> listXRayPointsTemp;
+		//std::vector<CPosXrayPtr> listXRayPointsTemp;
+		//std::vector<BrukerFeature> listFeatureTemp;
+		//for (int i = 0; i < (int)a_listXRayPoints.size(); i++)
+		//{
+		//	listXRayPointsTemp.push_back(a_listXRayPoints[i]);
+		//	listFeatureTemp.push_back(a_listFeatures[i]);
+
+		//	// collect x-Ray points (area scan)
+		//	if (!m_pBrukerImpl->GetXRayByFeatures(listXRayPointsTemp, listFeatureTemp, a_nXRayAQTime))
+		//	{
+		//		// failed to call bruker controller CollectXRayPointsByFeatures method.
+		//		LogErrorTrace(__FILE__, __LINE__, _T("COTSEDSBrucker::CollectXRayPointsByFeatures: failed to call bruker controller CollectXRayPointsByFeatures method."));
+		//	
+		//	}
+
+		//	
+		//	listXRayPointsTemp.clear();
+		//	listFeatureTemp.clear();
+
+		//}
+	/*	std::vector<CPosXrayPtr> listXRayPointsTemp;
 		std::vector<BrukerFeature> listFeatureTemp;
 		for (int i = 0; i < (int)a_listXRayPoints.size(); i++)
 		{
 			listXRayPointsTemp.push_back(a_listXRayPoints[i]);
-			listFeatureTemp.push_back(a_listFeatures[i]);
+			listFeatureTemp.push_back(a_listFeatures[i]);*/
 
 			// collect x-Ray points (area scan)
-			if (!m_pBrukerImpl->GetXRayByFeatures(listXRayPointsTemp, listFeatureTemp, a_nXRayAQTime))
+			if (!m_pBrukerImpl->GetXRayByFeatures(a_listXRayPoints, a_listFeatures, a_nXRayAQTime))
 			{
 				// failed to call bruker controller CollectXRayPointsByFeatures method.
 				LogErrorTrace(__FILE__, __LINE__, _T("COTSEDSBrucker::CollectXRayPointsByFeatures: failed to call bruker controller CollectXRayPointsByFeatures method."));
-			
+
 			}
 
-			
-			listXRayPointsTemp.clear();
+
+			/*listXRayPointsTemp.clear();
 			listFeatureTemp.clear();
 
-		}
+		}*/
 
 
 
 		
-		//if (!m_pBrukerImpl->SetSEMExternalOff())
-		//{
-		//	// failed to call SetSEMExternalOn method
-		//	LogTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::GetXRayByPoints: failed to call SetSEMExternalOff method."));
+		if (!m_pBrukerImpl->SetSEMExternalOff())
+		{
+			// failed to call SetSEMExternalOn method
+			LogTrace(__FILE__, __LINE__, _T("COTSBrukerImpl::GetXRayByPoints: failed to call SetSEMExternalOff method."));
 
-		//}
+		}
 		// ok, return TRUE
 		return TRUE;
 	}

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

@@ -41,7 +41,7 @@ namespace OTSController {
 		virtual BOOL SetDwellTime(long nDwellTime) override;
 
 		// acquire BSE image
-		virtual CBSEImgPtr AcquireBSEImage() override;
+		virtual CBSEImgPtr AcquireBSEImage(/*int a_nMatrixIndex, int nReads, int nDwell*/) override;
 
 	
 		virtual long GetDwellTimeByIndex(const long a_nIndex) override;

+ 3 - 3
OTSCPP/OTSControl/stdafx.h

@@ -47,9 +47,9 @@
 #pragma warning( push )
 //#pragma warning ( disable : ALL_CODE_ANALYSIS_WARNINGS )
 
-//#include "boost\shared_array.hpp"
-//#include "boost\scoped_array.hpp"
-//#include "boost\utility.hpp"
+#include "boost\shared_array.hpp"
+#include "boost\scoped_array.hpp"
+#include "boost\utility.hpp"
 
 #include <iostream>
 #include <fstream>

+ 7 - 0
OTSCommon/Model/ResultFile.cs

@@ -50,6 +50,13 @@ namespace OTSCommon.Model
             set;
         }
         public List<Field> List_OTSField { get => list_OTSField; set => list_OTSField = value; }
+
+        public OTS_SysType_ID GetResultSystype()
+        {
+            var Systype = ((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)(Dictionary<string, object>)this.ResultInfo["Sample"])["Members"])["MsrParams"])["SysType"];
+
+            return (OTS_SysType_ID)Systype;
+        }
     }
 
 

+ 10 - 0
OTSCommon/Model/RptConfigFile.cs

@@ -1,5 +1,6 @@
 using System;
 using System.Data;
+using System.Windows.Forms;
 
 namespace OTSCommon.Model
 {
@@ -39,6 +40,15 @@ namespace OTSCommon.Model
             this.TriTempFile = m_TriTempFile;
         }
 
+
+        public OTS_SysType_ID GetSysType()
+        {
+            DataSet ds = XMLoperate.GetXmlData(Application.StartupPath + m_ReportMgrParamFile, "XMLData");
+            DataTable dt = ds.Tables["Member"];
+
+            return OTS_SysType_ID.CleannessA;
+        }
+
         public string GetDataFromDataSetXml(DataSet dataSrc, string propertyName,string memberName="XMLData")//the particular schema of OTS system.such as "<XMLData p1="aa" p2="bb"><Member RegName="cc" p1="dd"/>...</XMLData>
         {
             string v = "";

+ 4 - 4
OTSIncAMeasureApp/0-OTSModel/Measure/3-MeasureFlow/CSmplMeasure.cs

@@ -161,16 +161,16 @@ namespace OTSModelSharp
             switch (nDwellTime)
             {
                 case OTS_IMAGE_SCANSPEED_OPTIONS.low:
-                    nBrukerDwellTimeId = 2;
+                    nBrukerDwellTimeId = 1;
                     break;
                 case OTS_IMAGE_SCANSPEED_OPTIONS.meddium:
-                    nBrukerDwellTimeId = 3;
+                    nBrukerDwellTimeId = 2;
                     break;
                 case OTS_IMAGE_SCANSPEED_OPTIONS.high:
-                    nBrukerDwellTimeId = 4;
+                    nBrukerDwellTimeId = 3;
                     break;
                 default:
-                    nBrukerDwellTimeId = 2;
+                    nBrukerDwellTimeId = 1;
                     break;
 
             }

+ 4 - 2
OTSIncAReportApp/1-UI/OTSDisplaySourceGridData/frmReportConditionChoose.cs

@@ -158,8 +158,10 @@ namespace OTSIncAReportApp
             //数据表类型
             List<string> list2 = new List<string>() { surveyResults, sampleMeasurementInformation, granularComponent, particleSizeDistribution, averageElementComposition };
             ResultFile resultinfo = m_rstDataMgr.ResultFilesList[m_rstDataMgr.GetWorkingResultId()];
-            var Systype = ((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)(Dictionary<string, object>)resultinfo.ResultInfo["Sample"])["Members"])["MsrParams"])["SysType"].ToString();
-            if (Systype == "0:IncA")
+            //var Systype = ((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)(Dictionary<string, object>)resultinfo.ResultInfo["Sample"])["Members"])["MsrParams"])["SysType"].ToString();
+            var Systype = resultinfo.GetResultSystype();
+
+            if (Systype == OTS_SysType_ID.IncA)
             {
                 string[] aa = m_ReportApp.Text.Split('-');
                 List<string> listStd = new List<string>() { chineseStandard1, chineseStandard2, americanStandard, germanStandard };

+ 2 - 2
OTSIncAReportApp/1-UI/OTSMgrInfo/frmPartSizeEditorNew.cs

@@ -206,7 +206,7 @@ namespace OTSIncAReportApp
                     dr["FileName"] = nextifile.Name;
 
                     //根据xml读取内容
-                    XmlConfigUtil xmlutil = new XmlConfigUtil(nextifile.FullName);
+                    XmlOperateUtil xmlutil = new XmlOperateUtil(nextifile.FullName);
                     dr["Name"] = xmlutil.GetAttribute("Name", "XMLData");
                     dr["Value"] = xmlutil.GetAttribute("Sizes", "XMLData");
 
@@ -358,7 +358,7 @@ namespace OTSIncAReportApp
                 return;
             }
 
-            XmlConfigUtil xmlutil = new XmlConfigUtil(tb_lj.Text);
+            XmlOperateUtil xmlutil = new XmlOperateUtil(tb_lj.Text);
             xmlutil.SetAttribute("Name", tb_ljm.Text.Trim(), "XMLData");
             xmlutil.SetAttribute("Sizes", tb_ljz.Text.Trim(), "XMLData");
 

+ 5 - 5
OTSIncAReportApp/1-UI/OTSTemplateDesigner/OTSReport_Export.cs

@@ -41,8 +41,8 @@ namespace OTSIncAReportApp
         public string strPath = "./Config/ReportTemplate/ReportTemplateConfig.xml"; //报告模板设置文件的路径
        
         public string strPath2;
-        public XmlConfigUtil xmlutil;
-        public XmlConfigUtil xmlutil2;
+        public XmlOperateUtil xmlutil;
+        public XmlOperateUtil xmlutil2;
         public c_TemplateClass m_mbszclass = null;
         OTS_DEVReport DEVReport;
         GBReport GB_Report;
@@ -604,7 +604,7 @@ namespace OTSIncAReportApp
             m_export_reporttemplate = new Export_ReportTemplate(this);
 
             //初始化xml类
-            xmlutil = new XmlConfigUtil(strPath);
+            xmlutil = new XmlOperateUtil(strPath);
 
             m_mbszclass = new c_TemplateClass();
 
@@ -640,7 +640,7 @@ namespace OTSIncAReportApp
                 strPath2 = m_mbszclass.M_DZ.route;
             }
 
-            xmlutil2 = new XmlConfigUtil(strPath2);
+            xmlutil2 = new XmlOperateUtil(strPath2);
             //首页
             m_mbszclass.M_SY.str_tb_ZBT = xmlutil2.Read("M_SY", "str_tb_ZBT");
             m_mbszclass.M_SY.str_tb_FBT = xmlutil2.Read("M_SY", "str_tb_FBT");
@@ -1636,7 +1636,7 @@ namespace OTSIncAReportApp
             {
                 tb_mblj.Text = path;
                 m_mbszclass.M_DZ.route = path;
-                OTSIncAReportApp.Controls.XmlConfigUtil xmlutil = new OTSIncAReportApp.Controls.XmlConfigUtil(path);
+                OTSIncAReportApp.Controls.XmlOperateUtil xmlutil = new OTSIncAReportApp.Controls.XmlOperateUtil(path);
                 //首页
                 m_mbszclass.M_SY.str_tb_ZBT = xmlutil.Read("M_SY", "str_tb_ZBT");
                 m_mbszclass.M_SY.str_tb_FBT = xmlutil.Read("M_SY", "str_tb_FBT");

+ 2 - 2
OTSIncAReportApp/1-UI/OTSTemplateDesigner/OTSReport_TemplateDesignerRM.cs

@@ -217,7 +217,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             if (path != string.Empty)
             {
                 m_OTSReport_Export.m_mbszclass.M_DZ.route = path;
-                OTSIncAReportApp.Controls.XmlConfigUtil xmlutil = new OTSIncAReportApp.Controls.XmlConfigUtil(path);
+                OTSIncAReportApp.Controls.XmlOperateUtil xmlutil = new OTSIncAReportApp.Controls.XmlOperateUtil(path);
 
                 //首页
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_SY.str_tb_ZBT.ToString(), "M_SY", "str_tb_ZBT");
@@ -405,7 +405,7 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
 
             if (path != string.Empty)
             {
-                OTSIncAReportApp.Controls.XmlConfigUtil xmlutil = new OTSIncAReportApp.Controls.XmlConfigUtil(path);
+                OTSIncAReportApp.Controls.XmlOperateUtil xmlutil = new OTSIncAReportApp.Controls.XmlOperateUtil(path);
                 //首页
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_SY.str_tb_ZBT.ToString(), "M_SY", "str_tb_ZBT");
                 xmlutil.Write(m_OTSReport_Export.m_mbszclass.M_SY.str_tb_FBT.ToString(), "M_SY", "str_tb_FBT");

+ 0 - 200
OTSIncAReportApp/2-CommonFunction/CommonClass/XmlConfigUtil.cs

@@ -1,200 +0,0 @@
-using System;
-using System.IO;
-using System.Linq;
-using System.Xml;
-
-namespace OTSIncAReportApp.Controls
-{
-    /// <summary>
-    /// XML操作类
-    /// </summary>
-    public class XmlConfigUtil
-    {
-        #region 全局变量
-        string _xmlPath;        //文件所在路径
-        #endregion
-
-        #region 构造函数
-        /// <summary>
-        /// 初始化一个配置
-        /// </summary>
-        /// <param name="xmlPath">配置所在路径</param>
-        public XmlConfigUtil(string xmlPath)
-        {
-            _xmlPath = Path.GetFullPath(xmlPath);
-        }
-        #endregion
-
-        #region 公有方法
-        /// <summary>
-        /// 写入配置,也可以用来修改
-        /// </summary>
-        /// <param name="value">写入的值</param>
-        /// <param name="nodes">节点</param>
-        public void Write(string value, params string[] nodes)
-        {
-            //初始化xml
-            XmlDocument xmlDoc = new XmlDocument();
-            if (File.Exists(_xmlPath))
-                xmlDoc.Load(_xmlPath);
-            else
-                xmlDoc.LoadXml("<XmlConfig />");
-            XmlNode xmlRoot = xmlDoc.ChildNodes[0];
-
-            //新增、编辑 节点
-            string xpath = string.Join("/", nodes);
-            XmlNode node = xmlDoc.SelectSingleNode(xpath);
-            if (node == null)    //新增节点
-            {
-                node = makeXPath(xmlDoc, xmlRoot, xpath);
-            }
-            node.InnerText = value;
-
-            //保存
-            xmlDoc.Save(_xmlPath);
-        }
-
-        /// <summary>
-        /// 设置节点上属性的值
-        /// </summary>
-        /// <param name="AttributeName">属性名</param>
-        /// <param name="AttributeValue">属性值</param>
-        /// <param name="nodes">选择节点</param>
-        public void SetAttribute(string AttributeName, string AttributeValue, params string[] nodes)
-        {
-            //初始化xml
-            XmlDocument xmlDoc = new XmlDocument();
-            if (File.Exists(_xmlPath))
-                xmlDoc.Load(_xmlPath);
-            else
-                xmlDoc.LoadXml("<XmlConfig />");
-            XmlNode xmlRoot = xmlDoc.ChildNodes[0];
-
-            //新增、编辑 节点
-            string xpath = string.Join("/", nodes);
-            XmlElement element = (XmlElement)xmlDoc.SelectSingleNode(xpath);
-            if (element == null)    //新增节点
-            {
-                element = (XmlElement)makeXPath(xmlDoc, xmlRoot, xpath);
-            }
-
-            //设置节点上属性的值
-            element.SetAttribute(AttributeName, AttributeValue);
-            //保存
-            xmlDoc.Save(_xmlPath);
-        }
-
-        public string GetAttribute(string AttributeName, params string[] nodes)
-        {
-            //初始化xml
-            XmlDocument xmlDoc = new XmlDocument();
-            if (File.Exists(_xmlPath))
-                xmlDoc.Load(_xmlPath);
-            else
-                xmlDoc.LoadXml("<XmlConfig />");
-            XmlNode xmlRoot = xmlDoc.ChildNodes[0];
-
-            //新增、编辑 节点
-            string xpath = string.Join("/", nodes);
-            XmlElement element = (XmlElement)xmlDoc.SelectSingleNode(xpath);
-            if (element == null)    //新增节点
-            {
-                element = (XmlElement)makeXPath(xmlDoc, xmlRoot, xpath);
-            }
-
-            //设置节点上属性的值
-            string retstr = element.GetAttribute(AttributeName);
-            //保存
-            xmlDoc.Save(_xmlPath);
-
-            return retstr;
-        }
-
-
-        /// <summary>
-        /// 读取配置
-        /// </summary>
-        /// <param name="nodes">节点</param>
-        /// <returns></returns>
-        public string Read(params string[] nodes)
-        {
-            XmlDocument xmlDoc = new XmlDocument();
-            if (File.Exists(_xmlPath) == false)
-                return null;
-            else
-                xmlDoc.Load(_xmlPath);
-
-            string xpath = string.Join("/", nodes);
-            XmlNode node = xmlDoc.SelectSingleNode("/XmlConfig/" + xpath);
-            if (node == null)
-                return null;
-
-            return node.InnerText;
-        }
-
-        /// <summary>
-        /// 删除节点
-        /// </summary>
-        /// <param name="nodes"></param>
-        public void RemoveNode(params string[] nodes)
-        {
-            XmlDocument xmlDoc = new XmlDocument();
-            if (File.Exists(_xmlPath) == false)
-                return;
-            else
-                xmlDoc.Load(_xmlPath);
-
-            string xpath = string.Join("/", nodes);
-            XmlNode node = xmlDoc.SelectSingleNode("/XmlConfig/" + xpath);
-
-            //取得父节点
-            string[] father_nodes = new string[nodes.Count() - 1];
-
-            //对父节点进行初始化
-            for (int i = 0; i < nodes.Count() - 1; i++)
-            {
-                father_nodes[i] = (string)nodes[i].Clone();
-            }
-
-
-            string fast_xpath = string.Join("/", father_nodes);
-            XmlNode fastnode = xmlDoc.SelectSingleNode("/XmlConfig/" + fast_xpath);
-
-            if (node == null)
-                return;
-            if (fastnode == null)
-                return;
-
-            //使用父节点删除子节点
-            fastnode.RemoveChild(node);
-
-            //保存
-            xmlDoc.Save(_xmlPath);
-        }
-
-
-        #endregion
-
-        #region 私有方法
-        //递归根据 xpath 的方式进行创建节点
-        static private XmlNode makeXPath(XmlDocument doc, XmlNode parent, string xpath)
-        {
-
-            // 在XPath抓住下一个节点的名称;父级如果是空的则返回
-            string[] partsOfXPath = xpath.Trim('/').Split('/');
-            string nextNodeInXPath = partsOfXPath.First();
-            if (string.IsNullOrEmpty(nextNodeInXPath))
-                return parent;
-
-            // 获取或从名称创建节点
-            XmlNode node = parent.SelectSingleNode(nextNodeInXPath);
-            if (node == null)
-                node = parent.AppendChild(doc.CreateElement(nextNodeInXPath));
-
-            // 加入的阵列作为一个XPath表达式和递归余数
-            string rest = String.Join("/", partsOfXPath.Skip(1).ToArray());
-            return makeXPath(doc, node, rest);
-        }
-        #endregion
-    }
-}

+ 1 - 1
OTSIncAReportApp/3-ServiceCenter/HardwareController.cs

@@ -99,7 +99,7 @@ namespace ServiceInterface
             }
             try
             {
-                return remoteObj.AcquireBSEImage(sampleName, width, height, dwellTime, ref ImageByte);
+                return remoteObj.AcquireBSEImage(sampleName,width,height,dwellTime,ref ImageByte);
             }
             catch (Exception e)
             {

+ 1 - 1
OTSIncAReportApp/OTSIncAReportApp.csproj

@@ -521,7 +521,7 @@
     <Compile Include="2-CommonFunction\CommonClass\INIHelper.cs" />
     <Compile Include="2-CommonFunction\CommonClass\Language.cs" />
     <Compile Include="2-CommonFunction\CommonClass\MemoryManagement.cs" />
-    <Compile Include="2-CommonFunction\CommonClass\XmlConfigUtil.cs" />
+    <Compile Include="2-CommonFunction\CommonClass\XmlOperateUtil.cs" />
     <Compile Include="2-CommonFunction\OTSDataMgrFunction\XmlResourceData.cs" />
     <Compile Include="3-ServiceCenter\DataOperation\DataAccess\FeatureData.cs" />
     <Compile Include="3-ServiceCenter\DataOperation\DataAccess\FieldData.cs" />