瀏覽代碼

优化打开老版本报告程序时测量区域面积读不到的问题

zhangjiaxin 1 月之前
父節點
當前提交
8a025abf33
共有 1 個文件被更改,包括 11 次插入5 次删除
  1. 11 5
      OTSIncAReportApp/1-UI/Control_Grids/ResultGrid.cs

+ 11 - 5
OTSIncAReportApp/1-UI/Control_Grids/ResultGrid.cs

@@ -273,18 +273,24 @@ namespace OTSIncAReportGrids
             TimeSpan timeSpan = end - star;
             double Magnification = resfile.GetMeasurementMagnification();
             int filedCount = fielddata.GetFiledCount();
-
-            double wide = resfile.GetImageWidth();
+			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 particleArea = fielddata.GetparticleArea();
             double filedsArea = resfile.GetTotalArea();
 
-            //double ratio = particleArea / filedsArea;
+			if (filedsArea == -1)
+			{
+				filedsArea = scanFieldSize * (scanFieldSize * high / wide) * filedCount;
+                filedsArea = filedsArea / 1000000;
+			}
 
-            //报告参数文件
-            string xmlpath = Application.StartupPath + RptConfigFile.m_ReportMgrParamFile;
+			//double ratio = particleArea / filedsArea;
+
+			//报告参数文件
+			string xmlpath = Application.StartupPath + RptConfigFile.m_ReportMgrParamFile;
             DataSet ds = XMLoperate.GetXmlData(xmlpath, "XMLData");
             DataTable dt1 = ds.Tables["Member"];
             string sizestr = "1000";