瀏覽代碼

Merge branch 'Release2.3' into cxs

CXS 3 年之前
父節點
當前提交
f2a995b8c4

+ 1 - 1
OTSIncAReportApp/1-UI/Control_ECharts/EChart_ParticlesComposition.cs

@@ -333,7 +333,7 @@ namespace OTSIncAReportApp.Control_ECharts
 
                 Item item = new Item()
                 {
-                    value = decimal.Round(decimal.Parse(dt.Rows[k]["ar"].ToString()), 2).ToString(),
+                    value =Convert.ToInt32(dt.Rows[k]["ar"]).ToString(),
                     name = name
                 };
                 listData.Add(item);

+ 9 - 8
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionImageAndBSE.cs

@@ -1020,7 +1020,7 @@ namespace OTSIncAReportGraph.Controls
                             {
                                 dp.IsMouseOver = true;
 
-                               
+
                                 //显示x-ray能谱图 
                                 if (control_XRayTable1.Visible == false)
                                     ShowXRay(dp);
@@ -1372,13 +1372,13 @@ namespace OTSIncAReportGraph.Controls
         {
             if (m_mouseOver_dparticle == null)
                 return;
-           if (m_mouseOver_dparticle.guid == in_dparticle.guid)
+            if (m_mouseOver_dparticle.guid == in_dparticle.guid || m_mouseOver_dparticle.IsDeleted==true)
             {
                 //如果是刚才移动过的颗粒的话,那么这里再对xray进行隐藏
                 control_XRayTable1.Visible = false;
                 delaytimer.Enabled = false;
             }
-          
+
         }
 
 
@@ -2059,11 +2059,12 @@ namespace OTSIncAReportGraph.Controls
                 {
                     MessageBox.Show("Deleted successfully");
 
-                    
-                    FieldData fieldData = new FieldData(resultFile.FilePath);
-                    List<Field> fieldlist = fieldData.GetFieldList();
-                    m_ReportApp.m_rstDataMgr.CurResultFile.List_OTSField = fieldlist;
-                    LoadUpdateDisplay();
+
+                    m_mouseOver_dparticle.IsDeleted=true;
+                    //FieldData fieldData = new FieldData(resultFile.FilePath);
+                    //List<Field> fieldlist = fieldData.GetFieldList();
+                    //m_ReportApp.m_rstDataMgr.CurResultFile.List_OTSField = fieldlist;
+                    //LoadUpdateDisplay();
                 }
                else
                 {

+ 24 - 6
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage.cs

@@ -240,6 +240,11 @@ namespace OTSIncAReportGrids
             
         }
         private void ParticlesGridDevidePage_Load(object sender, EventArgs e)
+        {
+
+            UpdateLoad();
+        }
+        private void UpdateLoad()
         {
             if (!Init())
             {
@@ -251,7 +256,7 @@ namespace OTSIncAReportGrids
             {
                 return;
             }
-
+           
             cbB_PageSize.Items.Add("20");
             cbB_PageSize.Items.Add("100");
             cbB_PageSize.Items.Add("500");
@@ -259,11 +264,9 @@ namespace OTSIncAReportGrids
             cbB_PageSize.Items.Add("5000");
             cbB_PageSize.Items.Add("All");
             cbB_PageSize.SelectedIndex = 0;
-
         }
-
         #region 自定义方法
-       
+
         bool UpdateTable()
         {
             int sel = m_ReportApp.m_conditionChoose.m_SourceGridData.GetComboDownListIndexByItemName(OTSIncAReportApp.OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE_TYPE);
@@ -1632,8 +1635,7 @@ namespace OTSIncAReportGrids
                 DrawControl(true);
             }
         }
-
-        private void cbB_PageSize_SelectedIndexChanged(object sender, EventArgs e)
+        private void DisplayData()
         {
             if (cbB_PageSize.SelectedItem.ToString() == "All")
             {
@@ -1647,6 +1649,11 @@ namespace OTSIncAReportGrids
             SetDataGridViewStyle();
         }
 
+        private void cbB_PageSize_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            DisplayData();
+        }
+
         /// <summary>
         /// 在帧图上标记颗粒的位置矩形,并保存到FIELD_FILES_MARK文件夹中
         /// </summary>
@@ -1996,6 +2003,17 @@ namespace OTSIncAReportGrids
                             if (ReportFun.DeleteParticlesFromLibrary(item.ParticleId, item.FieldId))
                             {
                                 MessageBox.Show("Deleted successfully");
+                                
+                                for (int i=0;i< particlesAll.Rows.Count;i++)
+                                {
+                                    if (particlesAll.Rows[i]["Fieldid"].ToString()== item.FieldId.ToString() && particlesAll.Rows[i]["Particleid"].ToString()==item.ParticleId.ToString())
+                                    {
+                                        particlesAll.Rows.RemoveAt(i);
+                                    }
+                                }
+
+                                DisplayData();
+
                             }
                             else
                             {

+ 10 - 2
OTSIncAReportApp/1-UI/OTSTemplateDesigner/Export_ReportTemplate.cs

@@ -1947,14 +1947,22 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             //{
             //    totalInclusionArea = totalInclusionArea + Convert.ToDouble(ls_gv.Rows[i].Cells[2].Value.ToString());
             //}
-            totalInclusionArea= Convert.ToDouble(decimal.Parse(AllAnalysisDetails.Compute("sum(Area)", "").ToString())); 
+            //Convert.ToInt32
+            int sumArea = 0;
+      for(int i=0;i< AllAnalysisDetails.Rows.Count;i++)
+            {
+                sumArea = sumArea + Convert.ToInt32(AllAnalysisDetails.Rows[i]["Area"]);
+            }
+
+                //totalInclusionArea = Convert.ToInt32(AllAnalysisDetails.Compute("sum(Area)", "").ToString());
+            //totalInclusionArea = Convert.ToDouble(decimal.Parse(AllAnalysisDetails.Compute("sum(Area)", "").ToString())); 
             for (int i=0;i< AllAnalysisDetails.Rows.Count;i++)
             {
                 DataRow dr = AreaRatio.NewRow();
                 dr["e1"] = AllAnalysisDetails.Rows[i]["Class"].ToString();
                 dr["e2"] = AllAnalysisDetails.Rows[i]["Name"].ToString();
                 dr["e3"] =  Convert.ToDouble(AllAnalysisDetails.Rows[i]["Area"]);
-                dr["e4"]= Math.Round((Convert.ToDouble(AllAnalysisDetails.Rows[i]["Area"]) / totalInclusionArea) * 100, 2);
+                dr["e4"]= Math.Round((Convert.ToDouble(AllAnalysisDetails.Rows[i]["Area"]) / sumArea) * 100, 2);
                 dr["e5"] = Math.Round((Convert.ToDouble(AllAnalysisDetails.Rows[i]["Area"]) / Convert.ToDouble(m_list_dt.Where(aa => aa.TableName.Contains("ResultGrid")).ToList()[0].Rows[0][5])) * 100, 4);
                 AreaRatio.Rows.Add(dr);
             }