Przeglądaj źródła

纯洁度功能add

cxs 1 rok temu
rodzic
commit
268d109534

+ 182 - 0
OTSIncAReportApp/1-UI/GBCalculate/Purity.Designer.cs

@@ -0,0 +1,182 @@
+
+namespace OTSIncAReportApp._1_UI.GBCalculate
+{
+    partial class Purity
+    {
+        /// <summary>
+        /// Required designer variable.
+        /// </summary>
+        private System.ComponentModel.IContainer components = null;
+
+        /// <summary>
+        /// Clean up any resources being used.
+        /// </summary>
+        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        protected override void Dispose(bool disposing)
+        {
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
+        }
+
+        #region Windows Form Designer generated code
+
+        /// <summary>
+        /// Required method for Designer support - do not modify
+        /// the contents of this method with the code editor.
+        /// </summary>
+        private void InitializeComponent()
+        {
+            this.btn_cal = new System.Windows.Forms.Button();
+            this.label1 = new System.Windows.Forms.Label();
+            this.cBox_gride = new System.Windows.Forms.ComboBox();
+            this.label2 = new System.Windows.Forms.Label();
+            this.tB_result = new System.Windows.Forms.TextBox();
+            this.label3 = new System.Windows.Forms.Label();
+            this.rBx_process = new System.Windows.Forms.RichTextBox();
+            this.splitContainer1 = new System.Windows.Forms.SplitContainer();
+            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
+            this.splitContainer1.Panel1.SuspendLayout();
+            this.splitContainer1.Panel2.SuspendLayout();
+            this.splitContainer1.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // btn_cal
+            // 
+            this.btn_cal.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.btn_cal.Location = new System.Drawing.Point(192, 9);
+            this.btn_cal.Name = "btn_cal";
+            this.btn_cal.Size = new System.Drawing.Size(75, 23);
+            this.btn_cal.TabIndex = 0;
+            this.btn_cal.Text = "计算";
+            this.btn_cal.UseVisualStyleBackColor = true;
+            this.btn_cal.Click += new System.EventHandler(this.btn_cal_Click);
+            // 
+            // label1
+            // 
+            this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(10, 14);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(65, 12);
+            this.label1.TabIndex = 1;
+            this.label1.Text = "起评级别:";
+            // 
+            // cBox_gride
+            // 
+            this.cBox_gride.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.cBox_gride.FormattingEnabled = true;
+            this.cBox_gride.Location = new System.Drawing.Point(94, 11);
+            this.cBox_gride.Name = "cBox_gride";
+            this.cBox_gride.Size = new System.Drawing.Size(76, 20);
+            this.cBox_gride.TabIndex = 2;
+            // 
+            // label2
+            // 
+            this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.label2.AutoSize = true;
+            this.label2.Location = new System.Drawing.Point(10, 26);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(77, 12);
+            this.label2.TabIndex = 3;
+            this.label2.Text = "纯洁度结果:";
+            // 
+            // tB_result
+            // 
+            this.tB_result.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.tB_result.Location = new System.Drawing.Point(93, 23);
+            this.tB_result.Name = "tB_result";
+            this.tB_result.Size = new System.Drawing.Size(77, 21);
+            this.tB_result.TabIndex = 4;
+            // 
+            // label3
+            // 
+            this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(11, 63);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(65, 12);
+            this.label3.TabIndex = 5;
+            this.label3.Text = "计算过程:";
+            // 
+            // rBx_process
+            // 
+            this.rBx_process.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.rBx_process.Location = new System.Drawing.Point(94, 63);
+            this.rBx_process.Name = "rBx_process";
+            this.rBx_process.Size = new System.Drawing.Size(844, 438);
+            this.rBx_process.TabIndex = 6;
+            this.rBx_process.Text = "";
+            // 
+            // splitContainer1
+            // 
+            this.splitContainer1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.splitContainer1.Location = new System.Drawing.Point(0, 0);
+            this.splitContainer1.Name = "splitContainer1";
+            this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
+            // 
+            // splitContainer1.Panel1
+            // 
+            this.splitContainer1.Panel1.Controls.Add(this.btn_cal);
+            this.splitContainer1.Panel1.Controls.Add(this.label1);
+            this.splitContainer1.Panel1.Controls.Add(this.cBox_gride);
+            // 
+            // splitContainer1.Panel2
+            // 
+            this.splitContainer1.Panel2.Controls.Add(this.rBx_process);
+            this.splitContainer1.Panel2.Controls.Add(this.label2);
+            this.splitContainer1.Panel2.Controls.Add(this.label3);
+            this.splitContainer1.Panel2.Controls.Add(this.tB_result);
+            this.splitContainer1.Size = new System.Drawing.Size(950, 560);
+            this.splitContainer1.SplitterDistance = 43;
+            this.splitContainer1.TabIndex = 7;
+            // 
+            // Purity
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
+            this.ClientSize = new System.Drawing.Size(950, 560);
+            this.Controls.Add(this.splitContainer1);
+            this.Name = "Purity";
+            this.ShowIcon = false;
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+            this.Text = "纯净度";
+            this.Load += new System.EventHandler(this.Purity_Load);
+            this.splitContainer1.Panel1.ResumeLayout(false);
+            this.splitContainer1.Panel1.PerformLayout();
+            this.splitContainer1.Panel2.ResumeLayout(false);
+            this.splitContainer1.Panel2.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
+            this.splitContainer1.ResumeLayout(false);
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Button btn_cal;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.ComboBox cBox_gride;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.TextBox tB_result;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.RichTextBox rBx_process;
+        private System.Windows.Forms.SplitContainer splitContainer1;
+    }
+}

+ 172 - 0
OTSIncAReportApp/1-UI/GBCalculate/Purity.cs

@@ -0,0 +1,172 @@
+using OTSCLRINTERFACE;
+using OTSIncAReportApp.OTSDataMgrFunction;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+
+namespace OTSIncAReportApp._1_UI.GBCalculate
+{
+    public partial class Purity : Form
+    {
+        #region 全局变量
+        OTSIncAReportApp.frmReportApp m_ReportApp = null;
+        DataTable Table = new DataTable();
+        /// <summary>
+        /// 权重比重
+        /// </summary>
+        readonly Dictionary<string, double> weightFactor = new Dictionary<string, double>()
+        {
+            { "0.5",0.05 },
+            { "1",0.1 },
+            {"1.5",0.2 },
+            {"2",0.5 },
+            {"2.5",1 },
+            {"3",2 },
+            {"3.5",5 },
+            {"4",10 },
+            {"4.5",20},
+            {"5",50 }
+        };
+        #endregion
+
+        public Purity(OTSIncAReportApp.frmReportApp a_ReportApp)
+        {
+            InitializeComponent();
+            m_ReportApp = a_ReportApp;
+            cBox_gride.DataSource=new string[] { "0.5", "1", "1.5", "2", "2.5", "3", "3.5", "4", "4.5", "5" };
+            cBox_gride.SelectedIndex=0;
+        }
+
+        private void Purity_Load(object sender, EventArgs e)
+        {
+            InitTable(Table);
+        }
+
+        void InitTable(DataTable Table)
+        {
+            Table.Columns.Add("0.5", typeof(int));
+            Table.Columns.Add("1", typeof(int));
+            Table.Columns.Add("1.5", typeof(int));
+            Table.Columns.Add("2", typeof(int));
+            Table.Columns.Add("2.5", typeof(int));
+            Table.Columns.Add("3", typeof(int));
+            Table.Columns.Add("3.5", typeof(int));
+            Table.Columns.Add("4", typeof(int));
+            Table.Columns.Add("4.5", typeof(int));
+            Table.Columns.Add("5", typeof(int));
+            Table.Rows.Add(0, 0, 0, 0, 0, 0, 0, 0, 0,0);
+        }
+
+        private void btn_cal_Click(object sender, EventArgs e)
+        {
+            Table.Rows.Clear();
+            Table.Rows.Add(0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
+            tB_result.Text = "";this.Refresh();
+            Cursor = Cursors.WaitCursor;
+            rBx_process.Text = "";
+            Clipboard.SetDataObject(Properties.Resources.PurityFormula, false);//将图像放入剪切板
+            if (rBx_process.CanPaste(DataFormats.GetFormat(DataFormats.Bitmap)))//判断剪切板内是否是图像
+            {
+                rBx_process.Paste();//粘贴剪切板的内容到控件中
+                Clipboard.SetDataObject(String.Empty, false);//清空剪切板
+            }
+            rBx_process.AppendText("\n\n");
+
+            int index = m_ReportApp.m_conditionChoose.m_conditionData.GetComboDownListIndexByItemName(OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
+            for (int i = 0; i < m_ReportApp.m_rstDataMgr.ResultFilesList.Count; i++)
+            {
+                string anothername = m_ReportApp.m_rstDataMgr.ResultFilesList[i].anotherFileName.ToString();
+                string resultfile = m_ReportApp.m_rstDataMgr.ResultFilesList[i].FilePath.ToString() + "\\" + m_ReportApp.m_rstDataMgr.ResultFilesList[i].FileName_real.ToString();
+                m_ReportApp.m_rstDataMgr.m_ReportMgr.AddASmplMsrResultMgr(resultfile, anothername);
+            }
+            OTSCLRINTERFACE.CPropParamClr clr_prop = m_ReportApp.m_rstDataMgr.m_ReportMgr.GetPropertyParamTable();
+            List<string> datasourcelist = m_ReportApp.m_conditionChoose.m_conditionData.GetComboDownListByItemName(OTSSampleReportInfo.OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE);
+            clr_prop.SetDataSourceList(datasourcelist);
+            clr_prop.SetDataSourceId(index);
+            clr_prop.SetType((int)OTSSampleReportInfo.DisplayPicutureType.AnalyzeDataTable);//table
+            clr_prop.SetCalTableType((int)OTSSampleReportInfo.CALCULATE_TABLE_TYPE.GB_Method1);
+            DataTable tbl = m_ReportApp.m_rstDataMgr.m_ReportMgr.GetAllGBFields(clr_prop);
+            if (tbl != null)
+            {
+                foreach (DataRow row in tbl.Rows)
+                {
+                    string[] str = Convert.ToString(row["grade"]).Split(' ');
+                    for (int i = 0; i < str.Length; i++)
+                    {
+                        if (str[i].Contains(":"))
+                        {
+                            str[i] = Convert.ToString(str[i].Split(':')[1]);
+                        }
+                        switch (str[i])
+                        {
+                            case "0.5":
+                                Table.Rows[0]["0.5"] = Convert.ToInt64(Table.Rows[0]["0.5"]) + 1;
+                                break;
+                            case "1":
+                                Table.Rows[0]["1"] = Convert.ToInt64(Table.Rows[0]["1"]) + 1;
+                                break;
+                            case "1.5":
+                                Table.Rows[0]["1.5"] = Convert.ToInt64(Table.Rows[0]["1.5"]) + 1;
+                                break;
+                            case "2":
+                                Table.Rows[0]["2"] = Convert.ToInt64(Table.Rows[0]["2"]) + 1;
+                                break;
+                            case "2.5":
+                                Table.Rows[0]["2.5"] = Convert.ToInt64(Table.Rows[0]["2.5"]) + 1;
+                                break;
+                            case "3":
+                                Table.Rows[0]["3"] = Convert.ToInt64(Table.Rows[0]["3"]) + 1;
+                                break;
+                            case "3.5":
+                                Table.Rows[0]["3.5"] = Convert.ToInt64(Table.Rows[0]["3.5"]) + 1;
+                                break;
+                            case "4":
+                                Table.Rows[0]["4"] = Convert.ToInt64(Table.Rows[0]["4"]) + 1;
+                                break;
+                            case "4.5":
+                                Table.Rows[0]["4.5"] = Convert.ToInt64(Table.Rows[0]["4.5"]) + 1;
+                                break;
+                            case "5":
+                                Table.Rows[0]["5"] = Convert.ToInt64(Table.Rows[0]["5"]) + 1;
+                                break;
+                            default:
+                                break;
+                        }
+                    }
+                }
+            }
+
+            rBx_process.AppendText("经国标方法1评级后数据统计如下:\n");
+            string r1 = "";
+            string r2 = "K=( ";
+            double K = 0;
+            for (int i= cBox_gride.SelectedIndex;i< Table.Columns.Count; i++)
+            {
+                K += weightFactor[Convert.ToString(cBox_gride.SelectedItem)] * Convert.ToInt64(Table.Rows[0][i]);
+                r1 += cBox_gride.Items[i].ToString() + "级视场数:" + Table.Rows[0][i].ToString()+"\n";
+                r2 += weightFactor[Convert.ToString(cBox_gride.Items[i])].ToString() + " * " + Table.Rows[0][i].ToString() + " + ";
+            }
+            r2 = r2.Remove(r2.Length - 2, 2);
+            r2 += ")";
+            double area = m_ReportApp.m_rstDataMgr.CurResultFile.GetImageWidth() * m_ReportApp.m_rstDataMgr.CurResultFile.GetImageHeight() * m_ReportApp.m_rstDataMgr.CurResultFile.GetPixelSize() * m_ReportApp.m_rstDataMgr.CurResultFile.GetPixelSize();
+            K = K * 1000 / area;
+            tB_result.Text = (Math.Round(K, 3).ToString());
+
+            r1 += "总检验面积:" + area.ToString() + "\n";
+            r2 += "* 1000 /" + area.ToString();
+
+            rBx_process.AppendText(r1 + "\n");
+            rBx_process.AppendText("代入公式计算:\n");
+            rBx_process.AppendText(r2);
+
+            this.Refresh();
+            this.Cursor= Cursors.Default;
+        }
+    }
+}

+ 120 - 0
OTSIncAReportApp/1-UI/GBCalculate/Purity.resx

@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>

+ 19 - 4
OTSIncAReportApp/1-UI/OTSRibbon/OTSRibbonFun.cs

@@ -1,4 +1,5 @@
-using OTSIncAReportApp.OTSSampleReportInfo;
+using OTSCommon.Model;
+using OTSIncAReportApp.OTSSampleReportInfo;
 
 namespace OTSIncAReportApp.OTSRibbon
 {
@@ -30,6 +31,8 @@ namespace OTSIncAReportApp.OTSRibbon
             m_ReportApp.dpbExport.Enabled = bRibState;  //输出,下拉菜单中
             m_ReportApp.Backup.Enabled = bRibState;//备份数据库,下拉菜单
             m_ReportApp.ribbonOrbMenuItem_InclusionsTraceability.Enabled = bRibState;  //输出,下拉菜单中
+            m_ReportApp.ribbonOrbMenuItem_purity.Enabled = bRibState;
+            m_ReportApp.ribbonOrbMenuItem_Extremum.Enabled = bRibState;
 
             //Ribbon菜单中
             m_ReportApp.rbOpen.Enabled = true;                  //打开,ribbon中
@@ -61,7 +64,6 @@ namespace OTSIncAReportApp.OTSRibbon
                 m_ReportApp.dpbOpen.Enabled = true;
                 m_ReportApp.dpbExport.Enabled = true;
                 m_ReportApp.Backup.Enabled = true;
-                m_ReportApp.ribbonOrbMenuItem_InclusionsTraceability.Enabled = true;
 
                 //主菜单文件框里(保存、另存为、输出、新建)设置
                 m_ReportApp.rbSave.Enabled = true;
@@ -85,7 +87,6 @@ namespace OTSIncAReportApp.OTSRibbon
                 m_ReportApp.dpbOpen.Enabled = true;
                 m_ReportApp.dpbExport.Enabled = true;
                 m_ReportApp.Backup.Enabled = true;
-                //m_ReportApp.ribbonOrbMenuItem_InclusionsTraceability.Enabled = true;
 
                 //主菜单文件框里(保存、另存为、输出、新建)设置
                 m_ReportApp.rbSave.Enabled = true;
@@ -109,7 +110,6 @@ namespace OTSIncAReportApp.OTSRibbon
                 m_ReportApp.dpbOpen.Enabled = true;
                 m_ReportApp.dpbExport.Enabled = true;
                 m_ReportApp.Backup.Enabled = true;
-                //m_ReportApp.ribbonOrbMenuItem_InclusionsTraceability.Enabled = true;
 
                 //主菜单文件框里(保存、另存为、输出、新建)设置
                 m_ReportApp.rbSave.Enabled = true;
@@ -123,6 +123,21 @@ namespace OTSIncAReportApp.OTSRibbon
 
                 m_ReportApp.rbReMeasure.Enabled = true;
             }
+
+            
+            var m_RptConfigFile =RptConfigFile.GetRptConfig();         //报表程序的配置文件
+            if (m_RptConfigFile.Systype == OTS_SysType_ID.CleannessA)
+            {
+                m_ReportApp.ribbonOrbMenuItem_Extremum.Enabled = false;
+                m_ReportApp.ribbonOrbMenuItem_InclusionsTraceability.Enabled = false;
+                m_ReportApp.ribbonOrbMenuItem_purity.Enabled = false;
+            }
+            else
+            {
+                m_ReportApp.ribbonOrbMenuItem_InclusionsTraceability.Enabled = true;
+                m_ReportApp.ribbonOrbMenuItem_Extremum.Enabled = true;
+                m_ReportApp.ribbonOrbMenuItem_purity.Enabled = true;
+            }
         }
 
         #endregion

+ 61 - 60
OTSIncAReportApp/1-UI/frmReportApp.Designer.cs

@@ -31,21 +31,21 @@
             this.components = new System.ComponentModel.Container();
             System.Windows.Forms.RibbonPanel ribbonPanel1;
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmReportApp));
-            OTS.WinFormsUI.Docking.DockPanelSkin dockPanelSkin1 = new OTS.WinFormsUI.Docking.DockPanelSkin();
-            OTS.WinFormsUI.Docking.AutoHideStripSkin autoHideStripSkin1 = new OTS.WinFormsUI.Docking.AutoHideStripSkin();
-            OTS.WinFormsUI.Docking.DockPanelGradient dockPanelGradient1 = new OTS.WinFormsUI.Docking.DockPanelGradient();
-            OTS.WinFormsUI.Docking.TabGradient tabGradient1 = new OTS.WinFormsUI.Docking.TabGradient();
-            OTS.WinFormsUI.Docking.DockPaneStripSkin dockPaneStripSkin1 = new OTS.WinFormsUI.Docking.DockPaneStripSkin();
-            OTS.WinFormsUI.Docking.DockPaneStripGradient dockPaneStripGradient1 = new OTS.WinFormsUI.Docking.DockPaneStripGradient();
-            OTS.WinFormsUI.Docking.TabGradient tabGradient2 = new OTS.WinFormsUI.Docking.TabGradient();
-            OTS.WinFormsUI.Docking.DockPanelGradient dockPanelGradient2 = new OTS.WinFormsUI.Docking.DockPanelGradient();
-            OTS.WinFormsUI.Docking.TabGradient tabGradient3 = new OTS.WinFormsUI.Docking.TabGradient();
-            OTS.WinFormsUI.Docking.DockPaneStripToolWindowGradient dockPaneStripToolWindowGradient1 = new OTS.WinFormsUI.Docking.DockPaneStripToolWindowGradient();
-            OTS.WinFormsUI.Docking.TabGradient tabGradient4 = new OTS.WinFormsUI.Docking.TabGradient();
-            OTS.WinFormsUI.Docking.TabGradient tabGradient5 = new OTS.WinFormsUI.Docking.TabGradient();
-            OTS.WinFormsUI.Docking.DockPanelGradient dockPanelGradient3 = new OTS.WinFormsUI.Docking.DockPanelGradient();
-            OTS.WinFormsUI.Docking.TabGradient tabGradient6 = new OTS.WinFormsUI.Docking.TabGradient();
-            OTS.WinFormsUI.Docking.TabGradient tabGradient7 = new OTS.WinFormsUI.Docking.TabGradient();
+            OTS.WinFormsUI.Docking.DockPanelSkin dockPanelSkin2 = new OTS.WinFormsUI.Docking.DockPanelSkin();
+            OTS.WinFormsUI.Docking.AutoHideStripSkin autoHideStripSkin2 = new OTS.WinFormsUI.Docking.AutoHideStripSkin();
+            OTS.WinFormsUI.Docking.DockPanelGradient dockPanelGradient4 = new OTS.WinFormsUI.Docking.DockPanelGradient();
+            OTS.WinFormsUI.Docking.TabGradient tabGradient8 = new OTS.WinFormsUI.Docking.TabGradient();
+            OTS.WinFormsUI.Docking.DockPaneStripSkin dockPaneStripSkin2 = new OTS.WinFormsUI.Docking.DockPaneStripSkin();
+            OTS.WinFormsUI.Docking.DockPaneStripGradient dockPaneStripGradient2 = new OTS.WinFormsUI.Docking.DockPaneStripGradient();
+            OTS.WinFormsUI.Docking.TabGradient tabGradient9 = new OTS.WinFormsUI.Docking.TabGradient();
+            OTS.WinFormsUI.Docking.DockPanelGradient dockPanelGradient5 = new OTS.WinFormsUI.Docking.DockPanelGradient();
+            OTS.WinFormsUI.Docking.TabGradient tabGradient10 = new OTS.WinFormsUI.Docking.TabGradient();
+            OTS.WinFormsUI.Docking.DockPaneStripToolWindowGradient dockPaneStripToolWindowGradient2 = new OTS.WinFormsUI.Docking.DockPaneStripToolWindowGradient();
+            OTS.WinFormsUI.Docking.TabGradient tabGradient11 = new OTS.WinFormsUI.Docking.TabGradient();
+            OTS.WinFormsUI.Docking.TabGradient tabGradient12 = new OTS.WinFormsUI.Docking.TabGradient();
+            OTS.WinFormsUI.Docking.DockPanelGradient dockPanelGradient6 = new OTS.WinFormsUI.Docking.DockPanelGradient();
+            OTS.WinFormsUI.Docking.TabGradient tabGradient13 = new OTS.WinFormsUI.Docking.TabGradient();
+            OTS.WinFormsUI.Docking.TabGradient tabGradient14 = new OTS.WinFormsUI.Docking.TabGradient();
             this.rbSave = new System.Windows.Forms.RibbonButton();
             this.rbSaveAs = new System.Windows.Forms.RibbonButton();
             this.rbOut = new System.Windows.Forms.RibbonButton();
@@ -317,6 +317,7 @@
             this.ribbonOrbMenuItem_purity.ToolTip = null;
             this.ribbonOrbMenuItem_purity.ToolTipImage = null;
             this.ribbonOrbMenuItem_purity.ToolTipTitle = null;
+            this.ribbonOrbMenuItem_purity.Click += new System.EventHandler(this.ribbonOrbMenuItem_purity_Click);
             // 
             // Backup
             // 
@@ -658,50 +659,50 @@
             this.DockWindowPanel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.DockWindowPanel.Name = "DockWindowPanel";
             this.DockWindowPanel.Size = new System.Drawing.Size(1701, 541);
-            dockPanelGradient1.EndColor = System.Drawing.SystemColors.ControlLight;
-            dockPanelGradient1.StartColor = System.Drawing.SystemColors.ControlLight;
-            autoHideStripSkin1.DockStripGradient = dockPanelGradient1;
-            tabGradient1.EndColor = System.Drawing.SystemColors.Control;
-            tabGradient1.StartColor = System.Drawing.SystemColors.Control;
-            tabGradient1.TextColor = System.Drawing.SystemColors.ControlDarkDark;
-            autoHideStripSkin1.TabGradient = tabGradient1;
-            dockPanelSkin1.AutoHideStripSkin = autoHideStripSkin1;
-            tabGradient2.EndColor = System.Drawing.SystemColors.ControlLightLight;
-            tabGradient2.StartColor = System.Drawing.SystemColors.ControlLightLight;
-            tabGradient2.TextColor = System.Drawing.SystemColors.ControlText;
-            dockPaneStripGradient1.ActiveTabGradient = tabGradient2;
-            dockPanelGradient2.EndColor = System.Drawing.SystemColors.Control;
-            dockPanelGradient2.StartColor = System.Drawing.SystemColors.Control;
-            dockPaneStripGradient1.DockStripGradient = dockPanelGradient2;
-            tabGradient3.EndColor = System.Drawing.SystemColors.ControlLight;
-            tabGradient3.StartColor = System.Drawing.SystemColors.ControlLight;
-            tabGradient3.TextColor = System.Drawing.SystemColors.ControlText;
-            dockPaneStripGradient1.InactiveTabGradient = tabGradient3;
-            dockPaneStripSkin1.DocumentGradient = dockPaneStripGradient1;
-            tabGradient4.EndColor = System.Drawing.SystemColors.ActiveCaption;
-            tabGradient4.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
-            tabGradient4.StartColor = System.Drawing.SystemColors.GradientActiveCaption;
-            tabGradient4.TextColor = System.Drawing.SystemColors.ActiveCaptionText;
-            dockPaneStripToolWindowGradient1.ActiveCaptionGradient = tabGradient4;
-            tabGradient5.EndColor = System.Drawing.SystemColors.Control;
-            tabGradient5.StartColor = System.Drawing.SystemColors.Control;
-            tabGradient5.TextColor = System.Drawing.SystemColors.ControlText;
-            dockPaneStripToolWindowGradient1.ActiveTabGradient = tabGradient5;
-            dockPanelGradient3.EndColor = System.Drawing.SystemColors.ControlLight;
-            dockPanelGradient3.StartColor = System.Drawing.SystemColors.ControlLight;
-            dockPaneStripToolWindowGradient1.DockStripGradient = dockPanelGradient3;
-            tabGradient6.EndColor = System.Drawing.SystemColors.GradientInactiveCaption;
-            tabGradient6.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
-            tabGradient6.StartColor = System.Drawing.SystemColors.GradientInactiveCaption;
-            tabGradient6.TextColor = System.Drawing.SystemColors.ControlText;
-            dockPaneStripToolWindowGradient1.InactiveCaptionGradient = tabGradient6;
-            tabGradient7.EndColor = System.Drawing.Color.Transparent;
-            tabGradient7.StartColor = System.Drawing.Color.Transparent;
-            tabGradient7.TextColor = System.Drawing.SystemColors.ControlDarkDark;
-            dockPaneStripToolWindowGradient1.InactiveTabGradient = tabGradient7;
-            dockPaneStripSkin1.ToolWindowGradient = dockPaneStripToolWindowGradient1;
-            dockPanelSkin1.DockPaneStripSkin = dockPaneStripSkin1;
-            this.DockWindowPanel.Skin = dockPanelSkin1;
+            dockPanelGradient4.EndColor = System.Drawing.SystemColors.ControlLight;
+            dockPanelGradient4.StartColor = System.Drawing.SystemColors.ControlLight;
+            autoHideStripSkin2.DockStripGradient = dockPanelGradient4;
+            tabGradient8.EndColor = System.Drawing.SystemColors.Control;
+            tabGradient8.StartColor = System.Drawing.SystemColors.Control;
+            tabGradient8.TextColor = System.Drawing.SystemColors.ControlDarkDark;
+            autoHideStripSkin2.TabGradient = tabGradient8;
+            dockPanelSkin2.AutoHideStripSkin = autoHideStripSkin2;
+            tabGradient9.EndColor = System.Drawing.SystemColors.ControlLightLight;
+            tabGradient9.StartColor = System.Drawing.SystemColors.ControlLightLight;
+            tabGradient9.TextColor = System.Drawing.SystemColors.ControlText;
+            dockPaneStripGradient2.ActiveTabGradient = tabGradient9;
+            dockPanelGradient5.EndColor = System.Drawing.SystemColors.Control;
+            dockPanelGradient5.StartColor = System.Drawing.SystemColors.Control;
+            dockPaneStripGradient2.DockStripGradient = dockPanelGradient5;
+            tabGradient10.EndColor = System.Drawing.SystemColors.ControlLight;
+            tabGradient10.StartColor = System.Drawing.SystemColors.ControlLight;
+            tabGradient10.TextColor = System.Drawing.SystemColors.ControlText;
+            dockPaneStripGradient2.InactiveTabGradient = tabGradient10;
+            dockPaneStripSkin2.DocumentGradient = dockPaneStripGradient2;
+            tabGradient11.EndColor = System.Drawing.SystemColors.ActiveCaption;
+            tabGradient11.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
+            tabGradient11.StartColor = System.Drawing.SystemColors.GradientActiveCaption;
+            tabGradient11.TextColor = System.Drawing.SystemColors.ActiveCaptionText;
+            dockPaneStripToolWindowGradient2.ActiveCaptionGradient = tabGradient11;
+            tabGradient12.EndColor = System.Drawing.SystemColors.Control;
+            tabGradient12.StartColor = System.Drawing.SystemColors.Control;
+            tabGradient12.TextColor = System.Drawing.SystemColors.ControlText;
+            dockPaneStripToolWindowGradient2.ActiveTabGradient = tabGradient12;
+            dockPanelGradient6.EndColor = System.Drawing.SystemColors.ControlLight;
+            dockPanelGradient6.StartColor = System.Drawing.SystemColors.ControlLight;
+            dockPaneStripToolWindowGradient2.DockStripGradient = dockPanelGradient6;
+            tabGradient13.EndColor = System.Drawing.SystemColors.GradientInactiveCaption;
+            tabGradient13.LinearGradientMode = System.Drawing.Drawing2D.LinearGradientMode.Vertical;
+            tabGradient13.StartColor = System.Drawing.SystemColors.GradientInactiveCaption;
+            tabGradient13.TextColor = System.Drawing.SystemColors.ControlText;
+            dockPaneStripToolWindowGradient2.InactiveCaptionGradient = tabGradient13;
+            tabGradient14.EndColor = System.Drawing.Color.Transparent;
+            tabGradient14.StartColor = System.Drawing.Color.Transparent;
+            tabGradient14.TextColor = System.Drawing.SystemColors.ControlDarkDark;
+            dockPaneStripToolWindowGradient2.InactiveTabGradient = tabGradient14;
+            dockPaneStripSkin2.ToolWindowGradient = dockPaneStripToolWindowGradient2;
+            dockPanelSkin2.DockPaneStripSkin = dockPaneStripSkin2;
+            this.DockWindowPanel.Skin = dockPanelSkin2;
             this.DockWindowPanel.TabIndex = 5;
             // 
             // ribbonOrbMenuItem5
@@ -818,7 +819,7 @@
         private System.Windows.Forms.RibbonPanel ribbonPanelOthers;
         public System.Windows.Forms.RibbonButton ribbonButton3;
         public System.Windows.Forms.RibbonButton rbHelp;
-        private System.Windows.Forms.RibbonOrbMenuItem ribbonOrbMenuItem_Extremum;
+        public System.Windows.Forms.RibbonOrbMenuItem ribbonOrbMenuItem_Extremum;
         public System.Windows.Forms.RibbonOrbMenuItem Backup;
         public System.Windows.Forms.RibbonOrbMenuItem ribbonOrbMenuItem_InclusionsTraceability;
         public System.Windows.Forms.RibbonOrbMenuItem ribbonOrbMenuItem_purity;

+ 18 - 19
OTSIncAReportApp/1-UI/frmReportApp.cs

@@ -383,8 +383,8 @@ namespace OTSIncAReportApp
                     this.m_RstWindow.AddSampleResult(m_str_resultfilepaths[i].Replace("^", " "));
                 }
             }
-           
-            if(Language.ReadDefaultLanguage()=="EN")
+
+            if (Language.ReadDefaultLanguage() == "EN")
             {
                 rbHelp.Enabled = false;
             }
@@ -392,23 +392,8 @@ namespace OTSIncAReportApp
             {
                 rbHelp.Enabled = true;
             }
-          m_RptConfigFile =  RptConfigFile.GetRptConfig();         //报表程序的配置文件
-            if (m_RptConfigFile.Systype == OTS_SysType_ID.CleannessA)
-            {
-                ribbonOrbMenuItem_Extremum.Enabled = false;
-                ribbonOrbMenuItem_InclusionsTraceability.Enabled = false;
-                ribbonOrbMenuItem_purity.Enabled = false;
-            }
-            else
-            {
-                ribbonOrbMenuItem_Extremum.Enabled = true;
-                ribbonOrbMenuItem_InclusionsTraceability.Enabled = true;
-                ribbonOrbMenuItem_purity.Enabled = true;
-            }
-            this.Text = "ReportApp("+m_RptConfigFile.Systype.ToString()+")";
-
-
-
+            m_RptConfigFile = RptConfigFile.GetRptConfig();         //报表程序的配置文件
+            this.Text = "ReportApp(" + m_RptConfigFile.Systype.ToString() + ")";
         }
 
         #endregion
@@ -1278,6 +1263,20 @@ namespace OTSIncAReportApp
         {
 
         }
+
+        private void ribbonOrbMenuItem_purity_Click(object sender, EventArgs e)
+        {
+            try
+            {
+                _1_UI.GBCalculate.Purity purity = new _1_UI.GBCalculate.Purity(this);
+                purity.Show();
+            }
+            catch (Exception ex)
+            {
+                log.Error("purity:" + ex.ToString());
+                MessageBox.Show("purity启动失败!");
+            }
+        }
     }
 }
 

+ 6 - 6
OTSIncAReportApp/1-UI/frmReportApp.resx

@@ -167,6 +167,12 @@
     <value>
         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAW
         JQAAFiUBSVIk8AAAABNJREFUOE9jGAWjYBSMAjBgYAAABBAAAadEfGMAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="rbOpen.SmallImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
+        wwAADsMBx2+oZAAAABNJREFUOE9jGAWjYBSMAjBgYAAABBAAAadEfGMAAAAASUVORK5CYII=
 </value>
   </data>
   <data name="ribbonButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
@@ -179,12 +185,6 @@
     <value>
         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAW
         JQAAFiUBSVIk8AAAABNJREFUOE9jGAWjYBSMAjBgYAAABBAAAadEfGMAAAAASUVORK5CYII=
-</value>
-  </data>
-  <data name="rbOpen.SmallImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-    <value>
-        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
-        wwAADsMBx2+oZAAAABNJREFUOE9jGAWjYBSMAjBgYAAABBAAAadEfGMAAAAASUVORK5CYII=
 </value>
   </data>
   <data name="rbClose.SmallImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">

+ 10 - 0
OTSIncAReportApp/OTSIncAReportApp.csproj

@@ -459,6 +459,12 @@
     <Compile Include="1-UI\frmReMeasure.Designer.cs">
       <DependentUpon>frmReMeasure.cs</DependentUpon>
     </Compile>
+    <Compile Include="1-UI\GBCalculate\Purity.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="1-UI\GBCalculate\Purity.Designer.cs">
+      <DependentUpon>Purity.cs</DependentUpon>
+    </Compile>
     <Compile Include="1-UI\OTSDisplaySourceGridData\frmReportConditionChoose.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -799,6 +805,9 @@
     <EmbeddedResource Include="1-UI\frmReMeasure.resx">
       <DependentUpon>frmReMeasure.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="1-UI\GBCalculate\Purity.resx">
+      <DependentUpon>Purity.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="1-UI\OTSDisplaySourceGridData\frmReportConditionChoose.resx">
       <DependentUpon>frmReportConditionChoose.cs</DependentUpon>
     </EmbeddedResource>
@@ -1552,6 +1561,7 @@
     <None Include="Resources\输出.png" />
     <None Include="Resources\移动SEM到当前位置.png" />
     <EmbeddedResource Include="Resources\设置颗粒.png" />
+    <None Include="Resources\纯洁度公式.png" />
     <Content Include="Resources\输出16.png" />
     <None Include="Resources\选择颗粒.png" />
     <None Include="Resources\选择颗粒1.png" />

+ 10 - 0
OTSIncAReportApp/Properties/Resources.Designer.cs

@@ -1040,6 +1040,16 @@ namespace OTSIncAReportApp.Properties {
             }
         }
         
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        public static System.Drawing.Bitmap PurityFormula {
+            get {
+                object obj = ResourceManager.GetObject("PurityFormula", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>

+ 3 - 0
OTSIncAReportApp/Properties/Resources.resx

@@ -2463,4 +2463,7 @@
   <data name="cut" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>..\Resources\cut.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
   </data>
+  <data name="PurityFormula" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\纯洁度公式.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
 </root>

BIN
OTSIncAReportApp/Resources/纯洁度公式.png