Browse Source

概况表测量面积修改
颗粒成分表选择颗粒修改一半

CXS 3 years ago
parent
commit
4041b6894e

+ 1 - 0
Bin/x64/Debug/Resources/XMLData/AppResource_EN.xml

@@ -761,6 +761,7 @@
 	  <Control name="str9" text="Color" />
 	  <Control name="str10" text="TotalParticles" />
 	  <Control name="str11" text="Small" />
+	  <Control name="str13" text="AreaRadio" />
 	   <Control name="partcletype0" text="SMALL" />
 	  <Control name="partcletype1" text="OVERSIZE" />
 	  <Control name="partcletype2" text="AVE_GRAY_NOT_INRANRE" />

+ 1 - 0
Bin/x64/Debug/Resources/XMLData/AppResource_ZH.xml

@@ -757,6 +757,7 @@
 	  <Control name="str9" text="代表色" />
 	  <Control name="str10" text="颗粒数" />
 	  <Control name="str11" text="小颗粒" />
+	  <Control name="str13" text="面积占比" />
 	  <Control name="partcletype0" text="过小颗粒" />
 	  <Control name="partcletype1" text="过大颗粒" />
 	  <Control name="partcletype2" text="亮度不在分析范围内的颗粒" />

+ 41 - 5
OTSIncAReportApp/1-UI/Control_Grids/CompositionDistributionGrid.cs

@@ -36,6 +36,7 @@ namespace OTSIncAReportGrids
         /// </summary>
         public void BindDataGridView(string path, int num, string filename)
         {
+            
             OTSGridView gridView = new OTSGridView();
 
             OTSIncAReportApp.DataOperation.DataAccess.ParticleData particledata = new OTSIncAReportApp.DataOperation.DataAccess.ParticleData(path);
@@ -50,6 +51,7 @@ namespace OTSIncAReportGrids
             string str9 = table["str9"].ToString();
             string str10 = table["str10"].ToString();
             string str11 = table["str11"].ToString();
+            string str13 = table["str13"].ToString();
             //创建Grid的列序号
             gridView.Columns.Add("rowid", str1);
             //创建Grid的列颗粒名
@@ -60,6 +62,8 @@ namespace OTSIncAReportGrids
             gridView.Columns.Add("con", str10);
             //创建Grid的列颗粒数
             //gridView.Columns.Add("SmallParticle", str11);
+            //创建Grid的列面积占比
+            gridView.Columns.Add("AreaRadio", str13);
             string con = m_ReportApp.m_conditionChoose.m_SourceGridData.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.SIZE_CAL_METHOD_TYPE).ToString();
             string po = "";
             switch (con)
@@ -78,7 +82,7 @@ namespace OTSIncAReportGrids
                     //创建Grid的列最大直径
                     gridView.Columns.Add("max", str7);
                     break;
-                case "Area":
+                case "CIRCLE":
                     po = "Area";
                     //创建Grid的列平均直径
                     gridView.Columns.Add("av", str3);
@@ -93,9 +97,11 @@ namespace OTSIncAReportGrids
                     gridView.Columns.Add("max", str7);
                     break;
             }
+            double totalarea = 0;
 
             //int idx = m_ReportApp.m_DataMgrFun.GetPropIndexByPropItemName(m_ReportApp.SourceGridData.ConditionItemList, OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
-            int sel = m_ReportApp.m_conditionChoose.m_SourceGridData.GetPropIndexByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
+            //int sel = m_ReportApp.m_conditionChoose.m_SourceGridData.GetPropIndexByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
+            int sel = m_ReportApp.m_conditionChoose.m_SourceGridData.GetComboDownListIndexByItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
             string filedAndParticl = "";
             if (sel == 1)
             {
@@ -108,8 +114,15 @@ namespace OTSIncAReportGrids
                 {
                     filedAndParticl = filedAndParticl + ",";
                 }
+                totalarea = OTSIncAReportApp.frmReportApp.selectedRegion.Width * OTSIncAReportApp.frmReportApp.selectedRegion.Height;
+            }
+            else
+            {
+                double ScanFieldSize = Convert.ToDouble(((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)result.ResultInfo["Sample"])["Members"])["SEMDataMsr"])["ScanFieldSize"]);
+                double ImagePixelSize = Convert.ToDouble(((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)result.ResultInfo["Sample"])["Members"])["MsrParams"])["Members"])["ImageScanParam"])["ImagePixelSize"]);
+                int filedCount = Convert.ToInt32(((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)result.ResultInfo["Sample"])["Members"])["SEMDataMsr"])["TotalFields"]);
+                totalarea = ScanFieldSize * ScanFieldSize / ImagePixelSize * filedCount;
             }
-
             DataTable dt = particledata.GetParticleListByIncA(po, filedAndParticl);
             List<int> FLID = new List<int>() { 0, 1, 2, 4, 6, 7, 8, 9 };
             List<string> NameList = new List<string>() { table["partcletype0"].ToString(), table["partcletype1"].ToString(), table["partcletype2"].ToString(), table["partcletype4"].ToString(), table["partcletype6"].ToString(), table["partcletype7"].ToString(), table["partcletype8"].ToString(), table["partcletype9"].ToString() };
@@ -137,9 +150,22 @@ namespace OTSIncAReportGrids
                     }
                     else if (gridView.Columns[k].Name.ToLower() == "av" || gridView.Columns[k].Name.ToLower() == "max")
                     {
-                        gridView.Rows[add_rowindex].Cells[k].Value = Math.Round(Convert.ToDouble(dt.Rows[i][gridView.Columns[k].Name]), 2);
+                        if (con == "CIRCLE")
+                        {
+                            double Area = Convert.ToDouble(dt.Rows[i][gridView.Columns[k].Name]);
+                            gridView.Rows[add_rowindex].Cells[k].Value = Math.Round(Math.Sqrt(Area / Math.PI), 2);
+                        }
+                        else
+                        {
+                            gridView.Rows[add_rowindex].Cells[k].Value = Math.Round(Convert.ToDouble(dt.Rows[i][gridView.Columns[k].Name]), 2);
+                        }
                         gridView.Rows[add_rowindex].Cells[k].Style.BackColor = Color.Azure;
                     }
+                    else if (gridView.Columns[k].Name.ToLower() == "AreaRadio")
+                    {
+                        gridView.Rows[add_rowindex].Cells[k].Value = dt.Rows[i]["Area"].ToString();
+
+                    }
                     else
                     {
                         gridView.Rows[add_rowindex].Cells[k].Value = dt.Rows[i][gridView.Columns[k].Name];
@@ -173,7 +199,15 @@ namespace OTSIncAReportGrids
                     }
                     else if (gridView.Columns[k].Name.ToLower() == "av" || gridView.Columns[k].Name.ToLower() == "max")
                     {
-                        gridView.Rows[add_rowindex].Cells[k].Value = Math.Round(Convert.ToDouble(dt.Rows[i][gridView.Columns[k].Name]), 2);
+                        if (con == "CIRCLE")
+                        {
+                            double Area = Convert.ToDouble(dt.Rows[i][gridView.Columns[k].Name]);
+                            gridView.Rows[add_rowindex].Cells[k].Value = Math.Round(Math.Sqrt(Area / Math.PI), 2);
+                        }
+                        else
+                        {
+                            gridView.Rows[add_rowindex].Cells[k].Value = Math.Round(Convert.ToDouble(dt.Rows[i][gridView.Columns[k].Name]), 2);
+                        }
                         gridView.Rows[add_rowindex].Cells[k].Style.BackColor = Color.Azure;
                     }
                     else if (gridView.Columns[k].Name == "TypeName")
@@ -282,6 +316,7 @@ namespace OTSIncAReportGrids
         private void CompositionDistributionGrid_Load(object sender, EventArgs e)
         {
             //int idx = m_ReportApp.m_DataMgrFun.GetPropIndexByPropItemName(m_ReportApp.SourceGridData.ConditionItemList, OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
+           //string sou = m_ReportApp.m_conditionChoose.m_SourceGridData.GetPropItemValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
             string sou = m_ReportApp.m_conditionChoose.m_SourceGridData.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
             if (sou.Contains("+"))
             {
@@ -368,6 +403,7 @@ namespace OTSIncAReportGrids
             }
 
             //int idx = m_ReportApp.m_DataMgrFun.GetPropIndexByPropItemName(m_ReportApp.SourceGridData.ConditionItemList, OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
+            //string sou = source.GetPropItemValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
             string sou = source.GetPropItemDisplayValueByPropItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE).ToString();
             if (sou.Contains("+"))
             {

+ 2 - 3
OTSIncAReportApp/1-UI/Control_Grids/ResultGrid.cs

@@ -126,9 +126,8 @@ namespace OTSIncAReportGrids
             int filedCount = fielddata.GetFiledCount();
 
             double ScanFieldSize = Convert.ToDouble(((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)resfile.ResultInfo["Sample"])["Members"])["SEMDataMsr"])["ScanFieldSize"]);
-
-            double filedsArea = ScanFieldSize * ScanFieldSize * 0.75 * filedCount;
-
+            double ImagePixelSize= Convert.ToDouble(((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)resfile.ResultInfo["Sample"])["Members"])["MsrParams"])["Members"])["ImageScanParam"])["ImagePixelSize"]);
+            double filedsArea = ScanFieldSize * ScanFieldSize / ImagePixelSize * filedCount;
             int particleArea = fielddata.GetparticleArea();
 
             double ratio = particleArea / filedsArea;

+ 1 - 1
OTSIncAReportApp/3-ServiceCenter/DataOperation/DataAccess/ParticleData.cs

@@ -106,7 +106,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
         /// <returns></returns>
         public DataTable GetParticleListByIncA(string con, string fieldAndPartic)
         {
-            string sqlp = @"select TypeId,TypeName,TypeColor,count(1) as con,avg(" + con
+            string sqlp = @"select TypeId,TypeName,TypeColor,count(1) as con,sum(Area) as Area,avg(" + con
                 + ") as av,max(" + con
                 + ") as max ";
             sqlp = sqlp + " from IncAData group by TypeId";