Jelajahi Sumber

Merge branch 'OTSRelease3_2' of http://36.129.169.60:30080/gogsadmin/OTS into OTSRelease3_2

zhangjiaxin 1 bulan lalu
induk
melakukan
10ad7d3728

+ 2 - 2
Bin/x64/Debug/Config/SysData/OTSProgMgrParam.pmf

@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <XMLData RunMode="ProfessionalMode" SysType="TCCleannessA">
   <Member RegName="BrightnessContrastRegulateParam" AutoRegulateType="EveryPeriod" BrightPhaseElement="Al" BrightPhaseValue="124" DarkPhaseElement="C" DarkPhaseValue="11" InitialBrightness="45.53382111" InitialContrast="60.21995716" mag="100" Period="5" StdMaterialOTSPos="41475,-4357" ToRun="false" />
-  <Member RegName="GenParam" DefaultArea="50" DefaultSampleName="Sample" DefaultShape="0" EngineType="0:InclustionEngine" MeasParamFileFolderName=".\Config\ProData\" MeasSwitch="true" PartSTDLibFolderName=".\Config\SysData\" PropertyDisplayMode="0" StdLibFileName="Cleanness_N" SteelTechnology="0" />
+  <Member RegName="GenParam" DefaultArea="50" DefaultSampleName="Sample" DefaultShape="1" EngineType="0:InclustionEngine" MeasParamFileFolderName=".\Config\ProData\" MeasSwitch="true" PartSTDLibFolderName=".\Config\SysData\" PropertyDisplayMode="0" StdLibFileName="Baohuzha" SteelTechnology="0" />
   <Member RegName="ImageProcParam" AutoBGRemoveType="0:MIDDLE" BGRemoveType="0:AUTO" MatrixStep="0" OverlapParam="0" ParticleSelectionCondition="">
     <Member RegName="BGGray" end="77" start="0" />
     <Member RegName="IncArea" end="1000" start="10" />
     <Member RegName="ParticleGray" end="255" start="0" />
   </Member>
-  <Member RegName="ImageScanParam" ImageResolution="4:_1536_1024" SatrtImageMode="1:Snake" ScanImageSpeed="0:low" StopMode="0:CoverMode" StopParamArea="10" StopParamFields="2" StopParamMeasTime="360" StopParamParticles="5000" />
+  <Member RegName="ImageScanParam" FieldDistributeMode="0:Normal" ImageResolution="5:_1536_1024" SatrtImageMode="1:Snake" ScanImageSpeed="0:low" StopMode="0:CoverMode" StopParamArea="10" StopParamFields="2" StopParamMeasTime="360" StopParamParticles="5000" />
   <Member RegName="SpecialGrayParam" ToRun="false">
     <Collection RegName="GrayRangeList" />
   </Member>

+ 2 - 1
Bin/x64/Debug/Resources/XMLData/ResourceForMeasureSourceGrid-EN.xml

@@ -21,7 +21,8 @@
 			<member itemKey="20015" itemName="" itemText="MeasureStopArea(mm2)"/>
 			<member itemKey="20016" itemName="" itemText="ScanResolution" comboContent="Low,Medium,High"/>
 			<member itemKey="20017" itemName="" itemText="MeasureImageResolution" comboContent="" />
-	
+	          	<member itemKey="20018" itemName="" itemText="FieldDistribution" comboContent="Normal,Cover,Internal"  description="choose the field cover mode"/>
+
 			<member itemKey="20163" itemName="" itemText="Random"/>
 			<member itemKey="20170" itemName="" itemText="CoverMeasureArea"/>
 			<member itemKey="20171" itemName="" itemText="FieldNumber"/>

+ 2 - 4
Bin/x64/Debug/Resources/XMLData/ResourceForMeasureSourceGrid-ZH.xml

@@ -24,10 +24,8 @@
 			<member itemKey="20015" itemName="" itemText="测量结束面积(mm2)" description="输入测量结束面积。"/>
 			<member itemKey="20016" itemName="" itemText="扫描精度" comboContent="低,中,高" description="选择扫描精度。"/>
 			<member itemKey="20017" itemName="" itemText="测量图精度" comboContent=""  description="选择扫描图精度(尺寸)。"/>
-			
-           
-
-			
+			<member itemKey="20018" itemName="" itemText="视场分布" comboContent="常规,覆盖,内部"  description="选择取视场的方式"/>
+ 
 		
 		</collection>
 

+ 7 - 7
OTSCPP/OTSClrInterface/ImageProClr/FieldMgrClr.cpp

@@ -1,4 +1,4 @@
-#include "stdafx.h"
+#include "stdafx.h"
 #include "FieldMgrClr.h"
 #include "../OTSLog/COTSUtilityDllFunExport.h"
 
@@ -91,12 +91,12 @@ namespace OTSCLRINTERFACE {
 
 	
 
-	List<Point>^ CFieldMgrClr::GetFieldCentrePoints()
+	List<Point>^ CFieldMgrClr::GetFieldCentrePoints(int distributionMode)
 	{
 		List<Point>^ NameClr = gcnew List<Point>();
 		if (m_LpFieldMgr != nullptr)
 		{
-			std::vector<CPoint> sName = m_LpFieldMgr->get()->GetFieldCentrePoints();
+			std::vector<CPoint> sName = m_LpFieldMgr->get()->GetFieldCentrePoints(distributionMode);
 			for each(auto p in sName)
 			{
 				NameClr->Add( Point(p.x, p.y));
@@ -109,12 +109,12 @@ namespace OTSCLRINTERFACE {
 
 	
 
-	int CFieldMgrClr::GetTotalFields()
+	int CFieldMgrClr::GetTotalFields(int distributionMode)
 	{
-		return m_LpFieldMgr->get()->GetTotalFields ();
+		return m_LpFieldMgr->get()->GetTotalFields (distributionMode);
 	}
 	
-	SortedList<int,Point>^ CFieldMgrClr::GetUnmeasuredFieldCentrePoints(List<Point>^ a_listMeasuredFieldCentrePoints)
+	SortedList<int,Point>^ CFieldMgrClr::GetUnmeasuredFieldCentrePoints(List<Point>^ a_listMeasuredFieldCentrePoints,int distributionMode)
 	{
 		SortedList<int,Point>^ Pts = gcnew SortedList<int,Point>();
 		std::vector<CPoint> measuredPoint;
@@ -124,7 +124,7 @@ namespace OTSCLRINTERFACE {
 		}
 		if (m_LpFieldMgr != nullptr)
 		{
-			std::vector<CPoint> ps = m_LpFieldMgr->get()->GetUnmeasuredFieldCentrePoints(measuredPoint);
+			std::vector<CPoint> ps = m_LpFieldMgr->get()->GetUnmeasuredFieldCentrePoints(measuredPoint,distributionMode);
 			for (int i=0;i<ps.size();i++)
 			{
 				auto p = ps[i];

+ 4 - 4
OTSCPP/OTSClrInterface/ImageProClr/FieldMgrClr.h

@@ -1,4 +1,4 @@
-#pragma once
+#pragma once
 #include "DomainClr.h"
 #include "OTSImgScanPrmClr.h"
 
@@ -33,12 +33,12 @@ namespace OTSCLRINTERFACE {
 		int GetEffectiveFieldHeight();
 
 		// field centre points list
-		List<Point>^ GetFieldCentrePoints();
+		List<Point>^ GetFieldCentrePoints(int distributionMode);
 		//bool GetFieldRectByIndex(int a_nIndex, System::Drawing::Rectangle^ % a_rctField);
-		int GetTotalFields();
+		int GetTotalFields(int distributionMode);
 
 		// unmeasured field centre points list
-		SortedList<int,Point>^ GetUnmeasuredFieldCentrePoints(List<Point>^ a_listMeasuredFieldCentrePoints);
+		SortedList<int,Point>^ GetUnmeasuredFieldCentrePoints(List<Point>^ a_listMeasuredFieldCentrePoints, int distributionMode);
 		bool IsThisPointInMeasureArea(Point^ p);
 
 		// measure area

+ 123 - 71
OTSCPP/OTSImagePro/FieldMgr.cpp

@@ -141,9 +141,9 @@ namespace OTSIMGPROC {
 
 		return TRUE;
 	}
-	std::vector<CPoint> CFieldMgr::GetUnmeasuredFieldCentrePoints(std::vector<CPoint> a_listMeasuredFieldCentrePoints)
+	std::vector<CPoint> CFieldMgr::GetUnmeasuredFieldCentrePoints(std::vector<CPoint> a_listMeasuredFieldCentrePoints,int distributionMode)
 	{
-		std::vector<CPoint> allPoints = CalculateFieldCentrePoints();
+		std::vector<CPoint> allPoints = CalculateFieldCentrePoints(distributionMode);
 		std::vector<CPoint> unmeasuredPoints;
 		for(auto p:allPoints)
 		if (!IsInMeasuredFieldList(p,a_listMeasuredFieldCentrePoints))
@@ -154,17 +154,17 @@ namespace OTSIMGPROC {
 		return unmeasuredPoints;
 	}
 
-	std::vector<CPoint> CFieldMgr::GetFieldCentrePoints()
+	std::vector<CPoint> CFieldMgr::GetFieldCentrePoints(int distributionMode)
 	{
-		 auto m_listFieldCentrePoints = CalculateFieldCentrePoints();
+		 auto m_listFieldCentrePoints = CalculateFieldCentrePoints(distributionMode);
 		 return m_listFieldCentrePoints; 
 	}
 
 
 
-	int CFieldMgr::GetTotalFields()
+	int CFieldMgr::GetTotalFields(int distributionMode)
 	{
-		auto m_listFieldCentrePoints = CalculateFieldCentrePoints();
+		auto m_listFieldCentrePoints = CalculateFieldCentrePoints(distributionMode);
 		return (int)m_listFieldCentrePoints.size();
 	}
 
@@ -254,7 +254,7 @@ namespace OTSIMGPROC {
 
 	
 	// calculate field centre points list
-	std::vector<CPoint>  CFieldMgr::CalculateFieldCentrePoints()
+	std::vector<CPoint>  CFieldMgr::CalculateFieldCentrePoints(int distributionMode)
 	{
 		// field centre points list
 		std::vector<CPoint> m_listFieldCentrePoints;
@@ -354,11 +354,30 @@ namespace OTSIMGPROC {
 				{
 					for (auto itr : mapCenterPoint)
 					{
-						if (IsInMeasureArea(itr.second, sizeImage))
+						switch (distributionMode)
 						{
-							m_listFieldCentrePoints.push_back(itr.second);
-					
+							case 0://center in
+								if (IsCenterInMeasureArea(itr.second, sizeImage))
+								{
+									m_listFieldCentrePoints.push_back(itr.second);
+								}
+								break;
+							case 1://partly in , field will cover all the measure area
+								if (IsPartlyInMeasureArea(itr.second, sizeImage))
+								{
+									m_listFieldCentrePoints.push_back(itr.second);
+								}
+								break;
+							case 2://totally in, field is totally in the measure area
+								if (IsTotallyInMeasureArea(itr.second, sizeImage))
+								{
+									m_listFieldCentrePoints.push_back(itr.second);
+								}
+								break;
+						default:
+							break;
 						}
+						
 					}
 				}
 
@@ -499,7 +518,7 @@ namespace OTSIMGPROC {
 	}
 
 	// test if field is in or partly in the measure domain area
-	BOOL CFieldMgr::IsInMeasureArea(CPoint a_poiField, CSize a_sizeImageSize)
+	BOOL CFieldMgr::IsCenterInMeasureArea(CPoint a_poiField, CSize a_sizeImageSize)
 	{
 		// check measure area parameter
 		ASSERT(m_pMeasureArea);
@@ -517,76 +536,109 @@ namespace OTSIMGPROC {
 			return TRUE;
 		}
 
-		//// get measure field centre
-		//CPoint poiMsrAreaCentre = m_pMeasureArea->GetDomainCenter();
+		
 
-		//// move to left top postion.
-		//a_poiField -= CPoint(a_sizeImageSize.cx / 2, a_sizeImageSize.cy / 2);
+		// this field is not in the area , return FALSE.
+		return FALSE;
+	}
+	// test if field is in or partly in the measure domain area
+	BOOL CFieldMgr::IsPartlyInMeasureArea(CPoint a_poiField, CSize a_sizeImageSize)
+	{
+		// check measure area parameter
+		ASSERT(m_pMeasureArea);
+		if (!m_pMeasureArea)
+		{
+			// shouldn't happen
+			LogErrorTrace(__FILE__, __LINE__, _T("IsInDomainArea: invalid measure area parameter."));
+			return FALSE;
+		}
 
-		//// rectangle of the field
-		//CRect rectFiled(a_poiField, a_sizeImageSize);
+		// test field centre point first
+		if (m_pMeasureArea->PtInDomain(a_poiField))
+		{
+			// centre in the measure domain area, return TRUE 
+			return TRUE;
+		}
 
-		//// check field position
-		//if (rectFiled.left <= poiMsrAreaCentre.x && rectFiled.right >= poiMsrAreaCentre.x)
-		//{
-		//	// centre column field or centre field
-		//	return TRUE;
-		//}
-		//else if (rectFiled.top <= poiMsrAreaCentre.y && rectFiled.bottom >= poiMsrAreaCentre.y)
-		//{
-		//	// centre row field?
-		//	return TRUE;
-		//}
-		//else if ( rectFiled.right <= poiMsrAreaCentre.x)
-		//{
-		//	// on the left side		
-
-		//	//up
-		//	if (rectFiled.top >= poiMsrAreaCentre.y)
-		//	{
-		//		// on the top left side, need to test the bottom right  corner
-		//		if (m_pMeasureArea->PtInDomain(CPoint(rectFiled.right, rectFiled.top)))
-		//		{
-		//			return TRUE;
-		//		}
-		//	}
-		//	else if(rectFiled.bottom <= poiMsrAreaCentre.y) //down//
-		//	{
-		//		// on the bottom left side, need to test the top right corner
-		//		if (m_pMeasureArea->PtInDomain(rectFiled.BottomRight()))
-		//		{
-		//			return TRUE;
-		//		}
-		//	}
+		// get measure field centre
+		CPoint poiMsrAreaCentre = m_pMeasureArea->GetDomainCenter();
 
-		//}
-		//else if(rectFiled.left >= poiMsrAreaCentre.x)
-		//{
-		//	// on the right side
+		// move to left top postion.
+		a_poiField -= CPoint(a_sizeImageSize.cx / 2, a_sizeImageSize.cy / 2);
 
-		//	//up
-		//	if (rectFiled.top >= poiMsrAreaCentre.y)
-		//	{
-		//		// on the top left side, need to test the bottom right  corner
-		//		if (m_pMeasureArea->PtInDomain(rectFiled.TopLeft()))
-		//		{
-		//			return TRUE;
-		//		}
-		//	}
-		//	else if (rectFiled.bottom <= poiMsrAreaCentre.y) //down//
-		//	{
-		//		// on the bottom left side, need to test the top right corner
-		//		if (m_pMeasureArea->PtInDomain(CPoint(rectFiled.left, rectFiled.bottom)))
-		//		{
-		//			return TRUE;
-		//		}
-		//	}
+		// rectangle of the field
+		CRect rectFiled(a_poiField, a_sizeImageSize);
+
+		if (m_pMeasureArea->PtInDomain(CPoint(rectFiled.right, rectFiled.top)))
+		{
+			return true;
+		}
 
-		//}
+		if (m_pMeasureArea->PtInDomain(rectFiled.BottomRight()))
+		{
+			return true;
+		}
+
+		if (m_pMeasureArea->PtInDomain(rectFiled.TopLeft()))
+		{
+			return true;
+		}
+
+		if (m_pMeasureArea->PtInDomain(CPoint(rectFiled.left, rectFiled.bottom)))
+		{
+			return true;
+		}
+		// check field position
+		
 
 		// this field is not in the area , return FALSE.
 		return FALSE;
 	}
+	BOOL CFieldMgr::IsTotallyInMeasureArea(CPoint a_poiField, CSize a_sizeImageSize)
+	{
+		// check measure area parameter
+		ASSERT(m_pMeasureArea);
+		if (!m_pMeasureArea)
+		{
+			// shouldn't happen
+			LogErrorTrace(__FILE__, __LINE__, _T("IsInDomainArea: invalid measure area parameter."));
+			return FALSE;
+		}
+
+		// get measure field centre
+		CPoint poiMsrAreaCentre = m_pMeasureArea->GetDomainCenter();
+
+		// move to left top postion.
+		a_poiField -= CPoint(a_sizeImageSize.cx / 2, a_sizeImageSize.cy / 2);
+
+		// rectangle of the field
+		CRect rectFiled(a_poiField, a_sizeImageSize);
+
+		
+		
+		if (!m_pMeasureArea->PtInDomain(CPoint(rectFiled.right, rectFiled.top)))
+		{
+			return false;
+		}
+		
+		if (!m_pMeasureArea->PtInDomain(rectFiled.BottomRight()))
+		{
+			return false;
+		}
+		
+		if (!m_pMeasureArea->PtInDomain(rectFiled.TopLeft()))
+		{
+			return false;
+		}
+			
+		
+		if (!m_pMeasureArea->PtInDomain(CPoint(rectFiled.left, rectFiled.bottom)))
+		{
+			return false;
+		}
+		
+		return true;
+	}
 
 	// test if field is in the measured field centre points list
 	BOOL CFieldMgr::IsInMeasuredFieldList(CPoint a_poiField, std::vector<CPoint> m_listHaveMeasuredFieldCentrePoints)

+ 10 - 6
OTSCPP/OTSImagePro/FieldMgr.h

@@ -1,4 +1,4 @@
-#pragma once
+#pragma once
 #include "Domain.h"
 #include "OTSImageScanParam.h"
 #include "SEMDataMsr.h"
@@ -27,14 +27,14 @@ namespace OTSIMGPROC {
 		// initialization
 		BOOL Init(CDomainPtr a_pMeasureArea, int a_FieldStartMode);
 		// unmeasured field centre points list
-		std::vector<CPoint> GetUnmeasuredFieldCentrePoints(std::vector<CPoint> a_listHaveMeasuredFieldCentrePoints);
+		std::vector<CPoint> GetUnmeasuredFieldCentrePoints(std::vector<CPoint> a_listHaveMeasuredFieldCentrePoints, int distributionMode);
 
 		// field centre points list
-		std::vector<CPoint> GetFieldCentrePoints();
+		std::vector<CPoint> GetFieldCentrePoints(int distributionMode);
 
 		BOOL IsThisPointInMeasureArea(CPoint a_position);
 		
-		int GetTotalFields();
+		int GetTotalFields(int distributionMode);
 		
 		//overlap
 		int GetOverlap() { return m_overlap; }
@@ -73,12 +73,16 @@ namespace OTSIMGPROC {
 		CSize m_ResolutionSize;
 		int m_fieldStartMode;
 		// calculate field centre points list
-		std::vector<CPoint> CalculateFieldCentrePoints();
+		std::vector<CPoint> CalculateFieldCentrePoints(int distributionMode);
 
 		
 
 		// test if field is in or partly in the measure domain area
-		BOOL IsInMeasureArea(CPoint a_poiField, CSize a_sizeImageSize);
+		BOOL IsCenterInMeasureArea(CPoint a_poiField, CSize a_sizeImageSize);
+
+		BOOL IsPartlyInMeasureArea(CPoint a_poiField, CSize a_sizeImageSize);
+
+		BOOL IsTotallyInMeasureArea(CPoint a_poiField, CSize a_sizeImageSize);
 
 		// test if field is in the measured field centre points list
 		BOOL IsInMeasuredFieldList(CPoint a_poiField ,std::vector<CPoint> m_listHaveMeasuredFieldCentrePoints);

+ 33 - 12
OTSIncAMeasureApp/0-OTSModel/OTSDataType/COTSImageScanParam.cs

@@ -19,6 +19,7 @@ namespace OTSDataType
         private OTS_IMAGE_SCANSPEED_OPTIONS m_nScanImageSpeed;
         private OTS_IMAGE_RESULOTION_OPTIONS m_nImageResulotion;
         private OTS_MEASURE_FIELD_STOP_MODE m_nFieldStopMode;
+        private OTS_FIELD_DISTRIBUTION_MODE m_FieldDistributionMode=0;
         private int m_nFieldAreaPercentage;
         private int m_nFieldLargeParticles;
         private int m_nFieldLargeParticlesPercentage;
@@ -27,9 +28,6 @@ namespace OTSDataType
         //private int m_OverlapParam;
 
 
-
-        //const OTS_MEASURE_STOP_MODE DEFUALT_MEASURE_STOP_MODE = OTS_MEASURE_STOP_MODE.CoverMode;
-
         // stop parameters
         const int DEFUALT_PARAM_FIELD = 500;
          const int DEFUALT_PARAM_TIME = 300;
@@ -44,6 +42,17 @@ namespace OTSDataType
 
         // image size
         const OTS_IMAGE_RESULOTION_OPTIONS DEFAULE_IMAGE_SIZE = OTS_IMAGE_RESULOTION_OPTIONS._1024_768;
+
+        public OTS_FIELD_DISTRIBUTION_MODE GetFieldDistributionMode()
+        {
+            return m_FieldDistributionMode;
+        }
+
+        public void SetFieldDistributionMode(OTS_FIELD_DISTRIBUTION_MODE value)
+        {
+            m_FieldDistributionMode = value;
+        }
+
         void Init()
         {
 
@@ -62,6 +71,7 @@ namespace OTSDataType
             m_nFieldLargeParticlesPercentage = 100;
             m_nFieldSmallParticles = 10000;
             m_nFieldSmallParticlesPercentage = 100;
+            m_FieldDistributionMode = OTS_FIELD_DISTRIBUTION_MODE.Normal;
 
         }
         public COTSImgScanPrm ()
@@ -90,11 +100,11 @@ namespace OTSDataType
 		m_nFieldLargeParticlesPercentage = a_oSource.m_nFieldLargeParticlesPercentage;
 		m_nFieldSmallParticles = a_oSource.m_nFieldSmallParticles;
 		m_nFieldSmallParticlesPercentage = a_oSource.m_nFieldSmallParticlesPercentage;
+        m_FieldDistributionMode = a_oSource.m_FieldDistributionMode;
+           
 
-            //m_OverlapParam = a_oSource.m_OverlapParam;
 
-       
-    }
+        }
        
         public COTSImgScanPrm Duplicate()
         {
@@ -116,7 +126,7 @@ namespace OTSDataType
             prm.m_nFieldLargeParticlesPercentage = a_oSource.m_nFieldLargeParticlesPercentage;
             prm.m_nFieldSmallParticles = a_oSource.m_nFieldSmallParticles;
             prm.m_nFieldSmallParticlesPercentage = a_oSource.m_nFieldSmallParticlesPercentage;
-
+            prm.m_FieldDistributionMode = a_oSource.m_FieldDistributionMode;
             //m_OverlapParam = a_oSource.m_OverlapParam;
             return prm;
 
@@ -221,7 +231,7 @@ namespace OTSDataType
             xString xnSatrtImageMode = new xString();
             xString xnScanImageSpeed = new xString();
             xString xnImageSize = new xString();
-          
+          xString xFieldDistributeMode = new xString();
             Slo slo=new Slo();
 
             slo.Register("StopMode", xnStopMode);
@@ -233,7 +243,8 @@ namespace OTSDataType
             slo.Register("SatrtImageMode", xnSatrtImageMode);
             slo.Register("ScanImageSpeed", xnScanImageSpeed);
             slo.Register("ImageResolution", xnImageSize);
-         
+            slo.Register("FieldDistributeMode", xFieldDistributeMode);
+
 
 
 
@@ -258,10 +269,11 @@ namespace OTSDataType
                 xnSatrtImageMode.AssignValue((int)m_nSatrtImageMode+":"+m_nSatrtImageMode.ToString());
                 xnScanImageSpeed.AssignValue((int)m_nScanImageSpeed+":"+ m_nScanImageSpeed.ToString());
                 xnImageSize.AssignValue( (int)m_nImageResulotion+":"+m_nImageResulotion.ToString());
+                xFieldDistributeMode.AssignValue( (int)m_FieldDistributionMode + ":" + m_FieldDistributionMode.ToString());
+
+
 
-      
 
-              
 
                 slo.Serialize(true, classDoc, rootNode);
             }
@@ -284,8 +296,17 @@ namespace OTSDataType
                 m_nSatrtImageMode = (OTS_GET_IMAGE_MODE)Convert.ToInt32(xnSatrtImageMode.value().Split(':')[0]);
                 m_nScanImageSpeed = (OTS_IMAGE_SCANSPEED_OPTIONS)Convert.ToInt32(xnScanImageSpeed.value().Split(':')[0]);
                 m_nImageResulotion = (OTS_IMAGE_RESULOTION_OPTIONS)Convert.ToInt32(xnImageSize.value().Split(':')[0]);
+                if (xFieldDistributeMode.value() !="")
+                {
+                    m_FieldDistributionMode = (OTS_FIELD_DISTRIBUTION_MODE)Convert.ToInt32(xFieldDistributeMode.value().Split(':')[0]);
+                }
+                else
+                {
+                    m_FieldDistributionMode= OTS_FIELD_DISTRIBUTION_MODE.Normal;    
+                }
+               
+
 
-       
 
 
             }

+ 6 - 1
OTSIncAMeasureApp/0-OTSModel/OTSDataType/otsdataconst.cs

@@ -285,7 +285,12 @@ namespace OTSDataType
             Snake = 1,
             Zshape = 2          
         }
-
+        public enum OTS_FIELD_DISTRIBUTION_MODE
+        {
+            Normal = 0,
+            Cover = 1,
+            Internal = 2
+        }
 
         public enum OTS_IMAGE_SCANSPEED_OPTIONS
         {

+ 28 - 3
OTSIncAMeasureApp/3-OTSDisplaySourceGridData/OTSSampleVisualPropertyInfo.cs

@@ -632,8 +632,15 @@ namespace OTSMeasureApp
                         m_poSEMDataMsr.SetScanFieldHeight100(heigth100);
                     }
                     break;
+                case OTS_SAMPLE_PROP_GRID_ITEMS.FIELD_DISTRIBUTION_MODE:
+                    {
+                        m_poMsrParams.GetImageScanParam().SetFieldDistributionMode((OTS_FIELD_DISTRIBUTION_MODE)(int)objVal);
+
+
+                    }
+                    break;
+
 
-              
 
                 case OTS_SAMPLE_PROP_GRID_ITEMS.XRAYSCAN_MODE:
                     {
@@ -999,7 +1006,11 @@ namespace OTSMeasureApp
                             nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.IMAGE_RESOLUTION;
                             poPropItem.InitialSmplParameter(a_nId, nItemId, OTS_ITEM_TYPES.COMBO, false, bShow);
                             a_listPropItems.Add(poPropItem);
-
+                            //field distribution
+                            poPropItem = new CPropItem();
+                            nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.FIELD_DISTRIBUTION_MODE;
+                            poPropItem.InitialSmplParameter(a_nId, nItemId, OTS_ITEM_TYPES.COMBO, false, bShow);
+                            a_listPropItems.Add(poPropItem);
                         }
                         break;
 
@@ -1543,7 +1554,11 @@ namespace OTSMeasureApp
                             poPropItem.InitialSmplParameter(a_nId, nItemId, OTS_ITEM_TYPES.COMBO, false, bShow);
                             a_listPropItems.Add(poPropItem);
 
-
+                            //field distribution
+                            poPropItem = new CPropItem();
+                            nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.FIELD_DISTRIBUTION_MODE;
+                            poPropItem.InitialSmplParameter(a_nId, nItemId, OTS_ITEM_TYPES.COMBO, false, bShow);
+                            a_listPropItems.Add(poPropItem);
 
                         }
                         break;
@@ -2079,6 +2094,11 @@ namespace OTSMeasureApp
                             nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.IMAGE_RESOLUTION;
                             poPropItem.InitialSmplParameter(a_nId, nItemId, OTS_ITEM_TYPES.COMBO, false, bShow);
                             a_listPropItems.Add(poPropItem);
+                            //field distribution
+                            poPropItem = new CPropItem();
+                            nItemId = OTS_SAMPLE_PROP_GRID_ITEMS.FIELD_DISTRIBUTION_MODE;
+                            poPropItem.InitialSmplParameter(a_nId, nItemId, OTS_ITEM_TYPES.COMBO, false, bShow);
+                            a_listPropItems.Add(poPropItem);
 
                         }
                         break;
@@ -2857,6 +2877,11 @@ namespace OTSMeasureApp
                         a_nValue = (int)m_poMsrParams.GetImageScanParam().GetImageResulotion();
                     }
                     break;
+                case OTS_SAMPLE_PROP_GRID_ITEMS.FIELD_DISTRIBUTION_MODE:
+                    {
+                        a_nValue = (int)m_poMsrParams.GetImageScanParam().GetFieldDistributionMode();
+                    }
+                    break;
 
 
 

+ 2 - 2
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/CFieldPositionHelper.cs

@@ -76,14 +76,14 @@ namespace OTSModelSharp
                 var p = a_listMeasuredFieldCentrePoints[i];
                 fieldpoints.Add(new System.Drawing.Point((int)p.X, (int)p.Y));
             }
-            var sortedlistUnmeasuredFieldCentrePoints = fieldmgrclr.GetUnmeasuredFieldCentrePoints(fieldpoints);
+            var sortedlistUnmeasuredFieldCentrePoints = fieldmgrclr.GetUnmeasuredFieldCentrePoints(fieldpoints,(int)m_poImageScanParam.GetFieldDistributionMode());
             for (int i = 0; i < sortedlistUnmeasuredFieldCentrePoints.Count; i++)
             {
                 var p = sortedlistUnmeasuredFieldCentrePoints[i];
                 m_listUnmeasuredFieldCentrePoints.Add(p);
             }
 
-            m_listFieldCentrePoints = fieldmgrclr.GetFieldCentrePoints();
+            m_listFieldCentrePoints = fieldmgrclr.GetFieldCentrePoints((int)m_poImageScanParam.GetFieldDistributionMode());
 
             return true;
         }

+ 3 - 2
OTSIncAMeasureApp/ResourceManage/ResourceData.cs

@@ -41,8 +41,9 @@ namespace OTSModelSharp.ResourceManage
         STOP_PARAM_AREA = 20015,
         SCAN_SPEED = 20016,
         IMAGE_RESOLUTION = 20017,
-      
-      
+        FIELD_DISTRIBUTION_MODE = 20018,
+
+
         PARTICLE_AREA_MIN = 20020,
         PARTICLE_AREA_MAX = 20021,
         BG_GRAY_MIN = 20022,