Browse Source

颗粒列表添加硬度阶段提交2

CXS 3 years ago
parent
commit
381ac97d65

+ 0 - 4
OTSIncAReportApp/1-UI/Control_Graph/Controls/Control_DrawDistrbutionImageAndBSE.cs

@@ -1480,10 +1480,6 @@ namespace OTSIncAReportGraph.Controls
                 Thread bThread = new Thread(new ThreadStart(outpic.opencv_outpic));
                 bThread.IsBackground = true;
                 bThread.Start();
-               
-
-
-              
             }
             
         }

+ 26 - 17
OTSIncAReportApp/1-UI/Control_Grids/ParticlesGridDevidePage.cs

@@ -304,9 +304,9 @@ namespace OTSIncAReportGrids
                         DataRow[] dr = userLibraryData.Select("STDId=" + dtUelect.Rows[i]["TypeId"].ToString());
                         if (dr.Length > 0)
                         {
-                            dtUelect.Rows[i]["Hardness"] = dr[0]["Hardness"].ToString();
-                            dtUelect.Rows[i]["Density"] = dr[0]["Density"].ToString();
-                            dtUelect.Rows[i]["Electrical_conductivity"] = dr[0]["Electrical_conductivity"].ToString();
+                            dtUelect.Rows[i]["Hardness"] = System.Text.RegularExpressions.Regex.Replace(dr[0]["Hardness"].ToString(), @"[^\d.\d]", "");
+                            dtUelect.Rows[i]["Density"] = System.Text.RegularExpressions.Regex.Replace(dr[0]["Density"].ToString(), @"[^\d.\d]", "");
+                            dtUelect.Rows[i]["Electrical_conductivity"] = System.Text.RegularExpressions.Regex.Replace(dr[0]["Electrical_conductivity"].ToString(), @"[^\d.\d]", "");
                         }
                         else
                         {
@@ -344,9 +344,9 @@ namespace OTSIncAReportGrids
                         DataRow[] dr = userLibraryData.Select("STDId=" + particlesAll.Rows[i]["TypeId"].ToString());
                         if (dr.Length>0)
                         {
-                            particlesAll.Rows[i]["Hardness"] = dr[0]["Hardness"].ToString();
-                            particlesAll.Rows[i]["Density"] = dr[0]["Density"].ToString();
-                            particlesAll.Rows[i]["Electrical_conductivity"] = dr[0]["Electrical_conductivity"].ToString();
+                            particlesAll.Rows[i]["Hardness"] = System.Text.RegularExpressions.Regex.Replace(dr[0]["Hardness"].ToString(), @"[^\d.\d]", "");
+                            particlesAll.Rows[i]["Density"] = System.Text.RegularExpressions.Regex.Replace(dr[0]["Density"].ToString(), @"[^\d.\d]", "");
+                            particlesAll.Rows[i]["Electrical_conductivity"] = System.Text.RegularExpressions.Regex.Replace(dr[0]["Electrical_conductivity"].ToString(), @"[^\d.\d]", "");
                         }
                         else
                         {
@@ -555,7 +555,7 @@ namespace OTSIncAReportGrids
 
             dgV_ParticlesDevidePage.Rows.Clear();
             dgV_ParticlesDevidePage.Columns.Clear();
-
+            string startFun = ((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)result.ResultInfo["Sample"])["Members"])["MsrParams"])["SysType"].ToString();
             //从报告xml文件中加载,显示计算列,显示元素信息
             string str_DefaultComputedColName = "", str_ElementsColName = "";
             DataSet ds = OTSIncAReportApp.DataOperation.DataAccess.XMLoperate.GetXmlData(Application.StartupPath + m_ReportApp.m_OTSReportMgrParamFile, "XMLData");
@@ -641,17 +641,20 @@ namespace OTSIncAReportGrids
                 {
                     keyValues.Add("ORIENTATION", table["str33"].ToString());
                 }
-                if (strs[i] == "Hardness")
-                {
-                    keyValues.Add("Hardness", table["str34"].ToString());
-                }
-                if (strs[i] == "Density")
-                {
-                    keyValues.Add("Density", table["str35"].ToString());
-                }
-                if (strs[i] == "Electrical_conductivity")
+                if (startFun == "1:CleannessA")
                 {
-                    keyValues.Add("Electrical_conductivity", table["str36"].ToString());
+                    if (strs[i] == "Hardness")
+                    {
+                        keyValues.Add("Hardness", table["str34"].ToString());
+                    }
+                    if (strs[i] == "Density")
+                    {
+                        keyValues.Add("Density", table["str35"].ToString());
+                    }
+                    if (strs[i] == "Electrical_conductivity")
+                    {
+                        keyValues.Add("Electrical_conductivity", table["str36"].ToString());
+                    }
                 }
 
             }
@@ -1853,6 +1856,12 @@ namespace OTSIncAReportGrids
                     }
                 }
 
+                ISheet sheet2;
+                sheet2 = workbook.CreateSheet("Peak spectrum");//创建工作表
+                //设置颗粒名列宽
+                sheet.SetColumnWidth(1, 30 * 256);//夹杂物名列宽
+
+
                 //完成后,对Excel进行保存
                 FileStream file = new FileStream(sfd.FileName, FileMode.Create);
                 workbook.Write(file);

+ 7 - 7
OTSIncAReportApp/1-UI/OTSMgrInfo/frmReportSysConfig.Designer.cs

@@ -384,7 +384,7 @@ namespace OTSIncAReprotCharts
             // cB_Electrical_conductivity
             // 
             this.cB_Electrical_conductivity.AutoSize = true;
-            this.cB_Electrical_conductivity.Location = new System.Drawing.Point(166, 241);
+            this.cB_Electrical_conductivity.Location = new System.Drawing.Point(166, 235);
             this.cB_Electrical_conductivity.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.cB_Electrical_conductivity.Name = "cB_Electrical_conductivity";
             this.cB_Electrical_conductivity.Size = new System.Drawing.Size(74, 19);
@@ -395,7 +395,7 @@ namespace OTSIncAReprotCharts
             // cB_Density
             // 
             this.cB_Density.AutoSize = true;
-            this.cB_Density.Location = new System.Drawing.Point(489, 210);
+            this.cB_Density.Location = new System.Drawing.Point(489, 204);
             this.cB_Density.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.cB_Density.Name = "cB_Density";
             this.cB_Density.Size = new System.Drawing.Size(59, 19);
@@ -406,7 +406,7 @@ namespace OTSIncAReprotCharts
             // cB_Hardness
             // 
             this.cB_Hardness.AutoSize = true;
-            this.cB_Hardness.Location = new System.Drawing.Point(335, 210);
+            this.cB_Hardness.Location = new System.Drawing.Point(335, 204);
             this.cB_Hardness.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.cB_Hardness.Name = "cB_Hardness";
             this.cB_Hardness.Size = new System.Drawing.Size(59, 19);
@@ -439,7 +439,7 @@ namespace OTSIncAReprotCharts
             // cb_EquivalentCircleDiameter
             // 
             this.cb_EquivalentCircleDiameter.AutoSize = true;
-            this.cb_EquivalentCircleDiameter.Location = new System.Drawing.Point(166, 177);
+            this.cb_EquivalentCircleDiameter.Location = new System.Drawing.Point(166, 175);
             this.cb_EquivalentCircleDiameter.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.cb_EquivalentCircleDiameter.Name = "cb_EquivalentCircleDiameter";
             this.cb_EquivalentCircleDiameter.Size = new System.Drawing.Size(120, 19);
@@ -450,7 +450,7 @@ namespace OTSIncAReprotCharts
             // cb_ASPECT_ELONG
             // 
             this.cb_ASPECT_ELONG.AutoSize = true;
-            this.cb_ASPECT_ELONG.Location = new System.Drawing.Point(489, 177);
+            this.cb_ASPECT_ELONG.Location = new System.Drawing.Point(489, 175);
             this.cb_ASPECT_ELONG.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.cb_ASPECT_ELONG.Name = "cb_ASPECT_ELONG";
             this.cb_ASPECT_ELONG.Size = new System.Drawing.Size(104, 19);
@@ -461,7 +461,7 @@ namespace OTSIncAReprotCharts
             // cb_Orientation
             // 
             this.cb_Orientation.AutoSize = true;
-            this.cb_Orientation.Location = new System.Drawing.Point(335, 175);
+            this.cb_Orientation.Location = new System.Drawing.Point(335, 173);
             this.cb_Orientation.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.cb_Orientation.Name = "cb_Orientation";
             this.cb_Orientation.Size = new System.Drawing.Size(104, 19);
@@ -472,7 +472,7 @@ namespace OTSIncAReprotCharts
             // cb_MEAN
             // 
             this.cb_MEAN.AutoSize = true;
-            this.cb_MEAN.Location = new System.Drawing.Point(166, 210);
+            this.cb_MEAN.Location = new System.Drawing.Point(166, 204);
             this.cb_MEAN.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.cb_MEAN.Name = "cb_MEAN";
             this.cb_MEAN.Size = new System.Drawing.Size(134, 19);

+ 48 - 3
OTSIncAReportApp/1-UI/OTSMgrInfo/frmReportSysConfig.cs

@@ -415,6 +415,9 @@ namespace OTSIncAReprotCharts
             cb_ELONG.Checked = false;
             cb_ASPECT_ELONG.Checked = false;
             cb_Orientation.Checked = false;
+            cB_Hardness.Checked = false;
+            cB_Density.Checked = false;
+            cB_Electrical_conductivity.Checked = false;
 
 
             //面积
@@ -495,6 +498,48 @@ namespace OTSIncAReprotCharts
                 cb_Orientation.Checked = true;
             }
 
+            List<OTSIncAReportApp.DataOperation.Model.ResultFile> resfileList = m_ReportApp.m_rstDataMgr.ResultFilesList;
+            if (resfileList.Count > 0)
+            {
+                OTSIncAReportApp.DataOperation.Model.ResultFile resfile = resfileList[m_ReportApp.m_rstDataMgr.GetWorkingResult()];
+
+                if (((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)resfile.ResultInfo["Sample"])["Members"])["MsrParams"])["SysType"].ToString() == "1:CleannessA")
+                {
+                    cB_Hardness.Enabled = true;
+                    cB_Density.Enabled = true;
+                    cB_Electrical_conductivity.Enabled = true;
+                    //硬度
+                    if (in_str.IndexOf("Hardness") > -1)
+                    {
+                        cB_Hardness.Checked = true;
+                    }
+
+                    //密度
+                    if (in_str.IndexOf("Density") > -1)
+                    {
+                        cB_Density.Checked = true;
+                    }
+
+                    //导电性
+                    if (in_str.IndexOf("Electrical_conductivity") > -1)
+                    {
+                        cB_Electrical_conductivity.Checked = true;
+                    }
+                }
+                else
+                {
+                    cB_Hardness.Enabled = false;
+                    cB_Density.Enabled = false;
+                    cB_Electrical_conductivity.Enabled = false;
+                }
+            }
+            else
+            {
+                cB_Hardness.Enabled = false;
+                cB_Density.Enabled = false;
+                cB_Electrical_conductivity.Enabled = false;
+            }
+
             //按高经理要求,先都默认全部都是勾选上
             //cb_Area.Checked = true;
             //cb_EquivalentCircleDiameter.Checked = true;
@@ -598,17 +643,17 @@ namespace OTSIncAReprotCharts
             {
                 str_ret = str_ret + "Orientation" + ",";
             }
-
+            //导电性
             if (cB_Electrical_conductivity.Checked == true)
             {
                 str_ret = str_ret + "Electrical_conductivity" + ",";
             }
-
+            //密度
             if (cB_Density.Checked == true)
             {
                 str_ret = str_ret + "Density" + ",";
             }
-
+            //硬度
             if (cB_Hardness.Checked == true)
             {
                 str_ret = str_ret + "Hardness" + ",";