Browse Source

fix some bugs in area statistics

gsp 1 year ago
parent
commit
8e0b2c3451

+ 26 - 2
Bin/x64/Debug/Config/SysData/OTSStage.stg

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<XMLData Modify="true" PathName=".\Config\SysData\OTSStage.stg" WorkingStageId="0">
+<XMLData Modify="true" PathName=".\Config\SysData\OTSStage.stg" WorkingStageId="3">
   <Collection RegName="Stagelist">
     <Member strName="圆形九圆孔50mm">
       <Member RegName="boundary" PolygonPoint="" rectDomian="0,0,50000,0" shape="0:ROUND" />
@@ -54,7 +54,7 @@
         <Member HoleName="7" rectDomian="-23000,0,15000,0" shape="0" />
       </Collection>
     </Member>
-    <Member strName="Apero12_90">
+    <Member strName="Apero90mm">
       <Member RegName="boundary" PolygonPoint="" rectDomian="0,0,90000,90000" shape="1:RECTANGLE" />
       <Member RegName="std" PolygonPoint="" rectDomian="6300,0,2,0" shape="0:ROUND" />
       <Collection RegName="Holes">
@@ -78,5 +78,29 @@
         <Member HoleName="18" rectDomian="-14500,-24500,12000,0" shape="0" />
       </Collection>
     </Member>
+    <Member strName="Apero">
+      <Member RegName="boundary" PolygonPoint="" rectDomian="0,0,130000,120000" shape="1:RECTANGLE" />
+      <Member RegName="std" PolygonPoint="" rectDomian="6300,0,2,0" shape="0:ROUND" />
+      <Collection RegName="Holes">
+        <Member HoleName="9" rectDomian="0,0,10000,0" shape="0" />
+        <Member HoleName="2" rectDomian="0,25000,10000,0" shape="0" />
+        <Member HoleName="3" rectDomian="-15000,25000,10000,0" shape="0" />
+        <Member HoleName="1" rectDomian="15000,25500,10000,0" shape="0" />
+        <Member HoleName="4" rectDomian="22000,13000,10000,0" shape="0" />
+        <Member HoleName="5" rectDomian="7000,13000,10000,0" shape="0" />
+        <Member HoleName="6" rectDomian="-7500,13000,10000,0" shape="0" />
+        <Member HoleName="7" rectDomian="-22500,13000,10000,0" shape="0" />
+        <Member HoleName="8" rectDomian="14000,0,10000,0" shape="0" />
+        <Member HoleName="10" rectDomian="-15000,0,10000,0" shape="0" />
+        <Member HoleName="11" rectDomian="-30000,0,10000,0" shape="0" />
+        <Member HoleName="12" rectDomian="22000,-12500,10000,0" shape="0" />
+        <Member HoleName="13" rectDomian="7000,-12500,10000,0" shape="0" />
+        <Member HoleName="14" rectDomian="-7500,-12500,10000,0" shape="0" />
+        <Member HoleName="15" rectDomian="-22500,-12500,10000,0" shape="0" />
+        <Member HoleName="16" rectDomian="14500,-24500,10000,0" shape="0" />
+        <Member HoleName="17" rectDomian="-500,-24500,10000,0" shape="0" />
+        <Member HoleName="18" rectDomian="-14500,-24500,10000,0" shape="0" />
+      </Collection>
+    </Member>
   </Collection>
 </XMLData>

+ 1 - 0
OTSCPP/OTSImagePro/OTSImageProcess.cpp

@@ -617,6 +617,7 @@ namespace OTSIMGPROC
 			int errodDilateParam =5;
 			if (errodDilateParam > 0)
 			{
+				
 				BErode3(pPixel, pTempImg, errodDilateParam, nHeightImg, nWidthImg);
 				BDilate3(pTempImg, pPixel, errodDilateParam, nHeightImg, nWidthImg);
 			}

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

@@ -1322,24 +1322,24 @@ namespace OTSModelSharp
             // get measure result items of the sample
             CMsrResultItems pMsrResults = m_Sample.GetMsrResults();
 
-            // cumulate field data info
-        
+           
+            // go through the particles list
+            foreach (COTSParticleClr pParticle in listParticles)
+            {
+                // create a measure result item
+
+                pMsrResults.CumulateMeasureResult(pParticle);
+            }
             pMsrResults.CumulateMeasuredArea(a_nMeasuredArea);
 
             // cumulate ratio
-            double dRatio = 10000 * pMsrResults.GetTotalParticleArea();
+            double dRatio = pMsrResults.GetTotalParticleArea();
             dRatio = dRatio / pMsrResults.GetMeasuredArea();
             pMsrResults.SetRatio(dRatio);
 
 
         
-            // go through the particles list
-            foreach (COTSParticleClr pParticle in listParticles)
-            {
-                // create a measure result item
-
-                pMsrResults.CumulateMeasureResult(pParticle);
-            }
+           
             m_Sample.SetMsrResults(pMsrResults);
           
             return true;

+ 6 - 5
OTSIncAMeasureApp/1-OTSMeasure/Measure/ParamData/COTSMsrPrjResultData.cs

@@ -118,7 +118,7 @@ namespace OTSModelSharp
                 var noParticledataFields = smpl.GetFieldsData();//there's only the field postion info in the xml file,so the initial filed has only postion info.
                 List<COTSField> allflddata = new List<COTSField>();//contains all the field 
 
-                if (GetAllFieldsFromDB(ref allMeasuredFlds, ref poMsrStatus,smpl.GetName(), poMsrResults, aFldArea, new Size(w, h), pixelsize))
+                if (GetAllFieldsFromDB(ref allMeasuredFlds, ref poMsrStatus,smpl.GetName(),ref poMsrResults, aFldArea, new Size(w, h), pixelsize))
                 {
                     //------------complete the infomation that doesn't contain in database-----
 
@@ -226,7 +226,7 @@ namespace OTSModelSharp
         // file pathname
         public String GetPathName() { return m_strPathName; }
 
-        public bool GetAllFieldsFromDB(ref List<COTSField> allFlds, ref CMsrSampleStatus status,string sampleName, CMsrResultItems rst, double aFieldArea, Size picSize, double pixelSize)
+        public bool GetAllFieldsFromDB(ref List<COTSField> allFlds, ref CMsrSampleStatus status,string sampleName,ref CMsrResultItems rst, double aFieldArea, Size picSize, double pixelSize)
         {
           
             String strFilePath = GetFolderName(m_strPathName);
@@ -347,9 +347,9 @@ namespace OTSModelSharp
 
                         }
 
-                        msrFldsArea += aFieldArea;
+                      
                     }
-
+                    msrFldsArea += aFieldArea;
 
 
                 }
@@ -424,10 +424,11 @@ namespace OTSModelSharp
             List<CMsrResultItem> rstItms = new List<CMsrResultItem>();
             double allPartArea = 0;
             int typeNum;
-            double typeArea = 0;
+            
             foreach (var typeParticles in mapTypeParticles)
             {
                 typeNum = 0;
+                double typeArea = 0;
                 CMsrResultItem rstItm = new CMsrResultItem();
                 foreach (var p in typeParticles.Value)
                 {

+ 9 - 1
OTSIncAMeasureApp/3-OTSDisplaySourceGridData/OTSSampleVisualPropertyInfo.cs

@@ -1785,7 +1785,15 @@ namespace OTSMeasureApp
                         double dVal = 0;
                         if (GetPropdoubleData(ItemID, out dVal))
                         {
-                            valStr = dVal.ToString("f2");//点后面几个0就保留几位                                                                          
+                            if (ItemID == OTS_SAMPLE_PROP_GRID_ITEMS.RATIO)
+                            {
+                                valStr = dVal.ToString("f6");//点后面几个0就保留几位   
+                            }
+                            else 
+                            {
+                                valStr = dVal.ToString("f2");//点后面几个0就保留几位   
+                            }
+                                                                                                   
                         }
 
                     }

+ 6 - 14
OTSIncAReportApp/1-UI/Control_Grids/ResultGrid.cs

@@ -67,10 +67,8 @@ namespace OTSIncAReportGrids
             Gview_gz.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.EnableResizing;
             Gview_gz.ColumnHeadersHeight = 30;
 
-            //int idx = m_frmReportApp.m_DataMgrFun.GetPropIndexByPropItemName(m_frmReportApp.SourceGridData.ConditionItemList, OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
-            //string sou = m_frmReportApp.SourceGridData.ConditionItemList[idx].itemVal.ToString();
+          
             string sou = m_condition.m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
-            //string sou=  m_frmReportApp.m_conditionChoose.m_SourceGridData.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
             if (sou.Contains("+"))
             {
                 for (int i = 0; i < sou.Split('+').Length; i++)
@@ -89,9 +87,7 @@ namespace OTSIncAReportGrids
                     if(sou== m_frmReportApp.m_rstDataMgr.ResultFilesList[i].anotherFileName.ToString())
                         addGrid(m_frmReportApp.m_rstDataMgr.ResultFilesList[i]);
                 }
-                //int item= (int)m_frmReportApp.m_conditionChoose.m_SourceGridData.GetPropItemDisplayValueByPropItem(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
-                //m_frmReportApp.m_rstDataMgr.SetWorkingResult(item);
-                //addGrid(m_frmReportApp.m_rstDataMgr.ResultFilesList[m_frmReportApp.m_rstDataMgr.GetWorkingResult()]);
+
             }
         }
 
@@ -132,18 +128,14 @@ namespace OTSIncAReportGrids
             }
             TimeSpan timeSpan = end - star;
             int filedCount = fielddata.GetFiledCount();
-            //double scanFieldSize = resfile.GetScanFieldSizeX();
+            double scanFieldSize = resfile.GetScanFieldSizeX();
             double wide = resfile.GetImageWidth();
             double high = resfile.GetImageHeight();
-            double pixelSize = resfile.GetPixelSize();
-            double filedsArea = Math.Round(high * wide * pixelSize* pixelSize*  filedCount, 2);
+           
+            double filedsArea = scanFieldSize * (scanFieldSize * high / wide) * filedCount;
             int particleArea = fielddata.GetparticleArea();
 
-            //float ScanFieldSize100 = resfile.GetScanFieldSizeX100();
-            //float ScanFieldSize = resfile.GetScanFieldSizeX();
-
-
-            //double Magnification = ScanFieldSize100 * 100 / ScanFieldSize;
+     
 
             double Magnification= resfile.GetMeasurementMagnification();
             //报告参数文件