瀏覽代碼

解决分支合并后,报告程序分布图打不开的问题

zhangjiaxin 3 年之前
父節點
當前提交
035d446f25

+ 1 - 1
OTSIncAReportApp/Control_Graph/Controls/Control_DrawDistrbutionImageAndBSE.cs

@@ -261,7 +261,7 @@ namespace OTSIncAReportGraph.Controls
 
 
             //执行获取颗粒分布图数据,总过程函数
-            m_OTSIncAReportFun.GetDistrbutionImageAndBSE_Total();
+            m_OTSIncAReportFun.GetDistrbutionImageAndBSE_Total(m_ReportApp);
 
             //设置双缓冲
             SetDoubleBufferByIsDraw();

+ 1 - 1
OTSIncAReportApp/Control_Graph/Controls/Control_DrawDistrbutionSortImage.cs

@@ -227,7 +227,7 @@ namespace OTSIncAReportGraph.Controls
 
 
             //调用填充排序图颗粒数据,总过程方法
-            m_OTSIncAReportFun.GetDistrbutionSortImage_Total();
+            m_OTSIncAReportFun.GetDistrbutionSortImage_Total(m_ReportApp);
 
             //设置双缓冲
             SetDoubleBufferByIsDraw();

+ 4 - 4
OTSIncAReportApp/Control_Graph/OTSIncAReportGraphFuncation/OTSIncAReportFun.cs

@@ -589,7 +589,7 @@ namespace OTSIncAReportGraph.OTSIncAReportGraphFuncation
         /// <summary>
         /// 获取组整个获取分布图和排序图图像数据的底层数据组建方式,的总过程
         /// </summary>
-        public void GetDistrbutionImageAndBSE_Total()
+        public void GetDistrbutionImageAndBSE_Total(OTSIncAReportApp.frmReportApp a_Report)
         {
             string str27 = "开始从底层加载数据....";
             str27 = table["str27"].ToString();
@@ -600,7 +600,7 @@ namespace OTSIncAReportGraph.OTSIncAReportGraphFuncation
 
             string path = resultFile.FilePath;
             FieldData fieldData = new FieldData(path);
-            List<Field> fieldlist = fieldData.GetFieldList();
+            List<Field> fieldlist = fieldData.GetFieldList(a_Report);
 
             //防止有时底层返回的Field的List是0,直接返回
             if (fieldlist.Count == 0)
@@ -996,7 +996,7 @@ namespace OTSIncAReportGraph.OTSIncAReportGraphFuncation
         /// <summary>
         /// 排序图获取底层数据,组建整张排序图的总方法过程
         /// </summary>
-        public void GetDistrbutionSortImage_Total()
+        public void GetDistrbutionSortImage_Total(OTSIncAReportApp.frmReportApp a_ReportApp)
         {
             string str48 = "开始从底层加载数据....";
             str48 = table["str48"].ToString();
@@ -1004,7 +1004,7 @@ namespace OTSIncAReportGraph.OTSIncAReportGraphFuncation
 
             string path = resultFile.FilePath;
             FieldData fieldData = new FieldData(path);
-            List<Field> fieldlist = fieldData.GetFieldList();
+            List<Field> fieldlist = fieldData.GetFieldList(a_ReportApp);
             //将field的list对象给全局变量中,供后面获取xray使用
             m_list_COTSFieldMgrClr = fieldlist;
             string str49 = "开始组建图像资源....";

+ 8 - 14
OTSIncAReportApp/DataOperation/DataAccess/FieldData.cs

@@ -9,7 +9,7 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
     public class FieldData
     {
         private SqlHelper dbHelper;
-        private frmReportApp m_Report=new frmReportApp();
+        //private frmReportApp m_Report=null;
         //测量文件地址
         private string filePath;
         public FieldData(string path)
@@ -18,19 +18,13 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             filePath = path + "\\FIELD_FILES\\";
         }
         
-        public FieldData(string path, frmReportApp a_ReportApp)
-        {
-           
-            dbHelper = new SqlHelper("data source='" + path + "\\FIELD_FILES\\Inclusion.db'");
-            filePath = path + "\\FIELD_FILES\\";
-            m_Report = a_ReportApp;
-        }
+       
         /// <summary>
         /// 获取SegmentList
         /// </summary>
         /// <param name="model">Feature</param>
         /// <returns></returns>
-        public List<Model.Field> GetFieldList()
+        public List<Model.Field> GetFieldList(frmReportApp a_ReportApp)
         {
             //获取field信息
             string sql = "select fieldid,fieldposx,fieldposy,SEMPosX,SEMPosY from IncAData group by fieldid,fieldposx,fieldposy";
@@ -54,24 +48,24 @@ namespace OTSIncAReportApp.DataOperation.DataAccess
             for (int i=0;i< count; i++)
             {
                 
-                string imagePath = filePath + "Field" + m_Report.OriginalPoint.Rows[i]["ID"].ToString() + ".bmp";
+                string imagePath = filePath + "Field" + a_ReportApp.OriginalPoint.Rows[i]["ID"].ToString() + ".bmp";
 
 
-                Model.Field modelf = new Model.Field() { FieldID = Convert.ToInt32(m_Report.OriginalPoint.Rows[i]["ID"].ToString()), FieldPosX = Convert.ToInt32(m_Report.OriginalPoint.Rows[i]["FieldX"].ToString()), FieldPosY = Convert.ToInt32(m_Report.OriginalPoint.Rows[i]["FieldY"].ToString()), FieldImage = imagePath };
+                Model.Field modelf = new Model.Field() { FieldID = Convert.ToInt32(a_ReportApp.OriginalPoint.Rows[i]["ID"].ToString()), FieldPosX = Convert.ToInt32(a_ReportApp.OriginalPoint.Rows[i]["FieldX"].ToString()), FieldPosY = Convert.ToInt32(a_ReportApp.OriginalPoint.Rows[i]["FieldY"].ToString()), FieldImage = imagePath };
 
-                DataRow[] drp = DTP.Select("fieldid=" + m_Report.OriginalPoint.Rows[i]["ID"].ToString());
+                DataRow[] drp = DTP.Select("fieldid=" + a_ReportApp.OriginalPoint.Rows[i]["ID"].ToString());
 
                 List<Model.Particle> listp = dbHelper.RowsToList<Model.Particle>(drp);
 
                 foreach (Model.Particle modelp in listp)
                 {
                     //添加FeatureList信息
-                    DataRow[] drs = DTS.Select("fieldid=" + m_Report.OriginalPoint.Rows[i]["ID"].ToString() + " and particleid=" + modelp.ParticleId.ToString());
+                    DataRow[] drs = DTS.Select("fieldid=" + a_ReportApp.OriginalPoint.Rows[i]["ID"].ToString() + " and particleid=" + modelp.ParticleId.ToString());
                     List<Model.Feature> flist = dbHelper.RowsToList<Model.Feature>(drs);
                     modelp.FeatureList = flist;
 
                     //添加ElementList信息
-                    DataRow[] dre = DTE.Select("fieldid=" + m_Report.OriginalPoint.Rows[i]["ID"].ToString() + " and XRayId=" + modelp.XrayId.ToString());
+                    DataRow[] dre = DTE.Select("fieldid=" + a_ReportApp.OriginalPoint.Rows[i]["ID"].ToString() + " and XRayId=" + modelp.XrayId.ToString());
                     List<Model.Element> elist = dbHelper.RowsToList<Model.Element>(dre);
                     modelp.ElementList = elist;
                 }