소스 검색

报告程序功能新增-显示非默认标准库测量结果,在左侧显示数据库分类名和颜色列表

zhangjiaxin 8 달 전
부모
커밋
01cd3f8c8a

+ 1 - 1
Bin/x64/Debug/Config/SysData/OTSProgMgrParam.pmf

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<XMLData RunMode="ProfessionalMode" SysType="IncA">
+<XMLData RunMode="ProfessionalMode" SysType="TCCleannessA">
   <Member RegName="GenParam" DefaultArea="100" DefaultSampleName="Sample" DefaultShape="0" MeasParamFileFolderName=".\Config\ProData\" MeasSwitch="true" PartSTDLibFolderName=".\Config\SysData\" PropertyDisplayMode="0" StdLibFileName="OTS_TC_Axia_per" SteelTechnology="0" UseSysSTD="true" />
   <Member RegName="ImageProcParam" AutoBGRemoveType="0:MIDDLE" BGRemoveType="0:AUTO" MatrixStep="50" OverlapParam="0" ParticleSelectionCondition="">
     <Member RegName="BGGray" end="60" start="0" />

+ 1 - 1
Bin/x64/Debug/Config/SysData/OTSReportMgrParam.rpf

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<XMLData systype="IncA">
+<XMLData systype="TCCleannessA">
   <Member RegName="Scale" strValue="1000" />
   <Member RegName="DefaultComputedColName" strValue="Area,EquivalentCircleDiameter,MaxDiameter,MinDiameter,DiameterRatio,FerretDiameter,PERP,PERI,INSCR,MEAN,ELONG,ASPECT_ELONG,Orientation" />
   <Member RegName="ElementsColName" strValue="C,O,Al,Fe,F,Ti,Na,Mn,Mg" />

+ 104 - 0
OTSIncAReportApp/1-UI/FormStandardLibraryInformation.Designer.cs

@@ -0,0 +1,104 @@
+namespace OTSIncAReportApp._1_UI
+{
+    partial class FormStandardLibraryInformation
+    {
+        /// <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.panel1 = new System.Windows.Forms.Panel();
+            this.listView1 = new System.Windows.Forms.ListView();
+            this.label1 = new System.Windows.Forms.Label();
+            this.label2 = new System.Windows.Forms.Label();
+            this.panel1.SuspendLayout();
+            this.SuspendLayout();
+            // 
+            // panel1
+            // 
+            this.panel1.AutoScroll = true;
+            this.panel1.Controls.Add(this.label2);
+            this.panel1.Controls.Add(this.label1);
+            this.panel1.Controls.Add(this.listView1);
+            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.panel1.Location = new System.Drawing.Point(0, 0);
+            this.panel1.Name = "panel1";
+            this.panel1.Size = new System.Drawing.Size(284, 450);
+            this.panel1.TabIndex = 0;
+            // 
+            // listView1
+            // 
+            this.listView1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.listView1.HideSelection = false;
+            this.listView1.Location = new System.Drawing.Point(0, 0);
+            this.listView1.Name = "listView1";
+            this.listView1.Size = new System.Drawing.Size(284, 450);
+            this.listView1.TabIndex = 0;
+            this.listView1.UseCompatibleStateImageBehavior = false;
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.BackColor = System.Drawing.Color.Transparent;
+            this.label1.Location = new System.Drawing.Point(58, 9);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(41, 12);
+            this.label1.TabIndex = 1;
+            this.label1.Text = "分类名";
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.BackColor = System.Drawing.Color.Transparent;
+            this.label2.Location = new System.Drawing.Point(201, 9);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(29, 12);
+            this.label2.TabIndex = 2;
+            this.label2.Text = "颜色";
+            // 
+            // FormStandardLibraryInformation
+            // 
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+            this.ClientSize = new System.Drawing.Size(284, 450);
+            this.Controls.Add(this.panel1);
+            this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Name = "FormStandardLibraryInformation";
+            this.Text = "标准库信息";
+            this.Activated += new System.EventHandler(this.FormStandardLibraryInformation_Activated);
+            this.Load += new System.EventHandler(this.FormStandardLibraryInformation_Load);
+            this.panel1.ResumeLayout(false);
+            this.panel1.PerformLayout();
+            this.ResumeLayout(false);
+
+        }
+
+        #endregion
+
+        private System.Windows.Forms.Panel panel1;
+        private System.Windows.Forms.ListView listView1;
+        private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.Label label1;
+    }
+}

+ 338 - 0
OTSIncAReportApp/1-UI/FormStandardLibraryInformation.cs

@@ -0,0 +1,338 @@
+using DevExpress.Utils;
+using OTS.WinFormsUI.Docking;
+using OTSCommon.DBOperate;
+using OTSIncAReportApp.OTSRstMgrFunction;
+using OTSIncAReportApp.OTSSampleReportInfo;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using static OTSIncAReportApp.OTSReport_Export;
+using static System.Windows.Forms.VisualStyles.VisualStyleElement;
+
+namespace OTSIncAReportApp._1_UI
+{
+    public partial class FormStandardLibraryInformation :  DockContent
+    {
+        //测量结果
+        frmReportApp m_frmReportApp = null;
+        frmReportConditionChoose m_condition;
+        public List<string[]> LibraryName = new List<string[]>();
+        private bool isExport = true;
+        public c_TemplateClass m_mbszclass = null;
+        DataTable m_data=new DataTable();
+        public FormStandardLibraryInformation(frmReportApp frmReportApp)
+        {
+            InitializeComponent();
+            m_frmReportApp = frmReportApp;
+            m_condition = frmReportApp.m_conditionChoose;
+            m_mbszclass = new c_TemplateClass();
+        }
+
+        private void FormStandardLibraryInformation_Load(object sender, EventArgs e)
+        {
+            label1.Text = " ";
+            label2.Text = " ";
+            // 设置ListView为详细视图
+            listView1.View = View.Details;
+            listView1.FullRowSelect = true; // 可选,设置是否选择整行
+            listView1.GridLines = true; // 可选,设置是否显示网格线
+            listView1.Columns.Clear();
+            listView1.Columns.Add(" ", 170, HorizontalAlignment.Left);
+            listView1.Columns.Add(" ", 100, HorizontalAlignment.Left);
+            listView1.Items.Clear();
+            DataLoad();
+        }
+
+        private void GetDBData(ResultFile resultFile)
+        {
+            listView1.Items.Clear();
+            ResultFile resfile = resultFile;
+            string Name = "";
+            string rstSTD = resfile.GetSTDName();
+
+            string input1 = rstSTD;
+            string[] fruits1 = input1.Split('.');
+
+            if ("NoSTDDB" == fruits1[0] ||
+                "NoSTDDB.db" == fruits1[0])
+            {
+                Name = "OTSIncASysSTD";
+                return;
+            }
+            else
+            {
+                Name = fruits1[0];
+            }
+            try
+            {
+                ReadClassification();
+            }
+            catch (Exception ex) { return; }
+            
+            //listView1.Columns.Clear();
+            //// 设置ListView为详细视图
+            //listView1.View = View.Details;
+            //listView1.FullRowSelect = true; // 可选,设置是否选择整行
+            //listView1.GridLines = true; // 可选,设置是否显示网格线
+
+
+            // 添加列
+            //listView1.Columns.Add("名称", 160, HorizontalAlignment.Left); 
+            //listView1.Columns.Add("颜色", 100, HorizontalAlignment.Left); 
+                                                                        
+            
+
+            for (int i=0;i< LibraryName.Count;i++)
+            {
+                string input = LibraryName[i][0];
+                string[] fruits = input.Split('.');
+                if ( Name== fruits[0])
+                {
+                    DataTable dt_stl = new DataTable();
+                    SqLiteHelper sh = new SqLiteHelper("data source='" + LibraryName[i][1] + "'");
+                    dt_stl = sh.ExecuteQuery("select * from ClassifySTD");
+                    m_data= dt_stl.Copy();
+                    for (int a=0;a<dt_stl.Rows.Count;a++)
+                    {
+                        ListViewItem item1 = new ListViewItem(dt_stl.Rows[a]["StrName"].ToString());
+                        item1.SubItems.Add(dt_stl.Rows[a]["Color"].ToString()); 
+                        
+                        item1.UseItemStyleForSubItems = false; // 允许为每个 SubItem 设置不同的样式
+                        item1.SubItems[1].BackColor = Color.LightBlue; // 这将不会生效,除非我们处理 OwnerDraw
+                        listView1.Items.Add(item1);
+                    }
+                }
+            }
+            label1.Text = "分类名";
+            label2.Text = "颜色";
+            // 由于 ListViewItem 不直接支持为 SubItem 设置背景色,我们需要启用 OwnerDrawFixed 模式
+            listView1.OwnerDraw = true;
+            listView1.DrawItem += new DrawListViewItemEventHandler(ListView1_DrawItem);
+            listView1.DrawSubItem += new DrawListViewSubItemEventHandler(ListView1_DrawSubItem);
+
+        }
+
+
+
+        static List<string> GetDbFilesInDirectory(string directoryPath)
+        {
+            List<string> files = new List<string>();
+
+            // 使用搜索模式 "*.db" 来查找所有.db文件  
+            string[] allDbFiles = Directory.GetFiles(directoryPath, "*.db");
+
+            // 将找到的文件名添加到列表中  
+            files.AddRange(allDbFiles.Select(Path.GetFileName)); // 如果只需要文件名,而不是完整路径  
+
+            // 如果你需要文件的完整路径,可以直接返回 allDbFiles 数组(转换为List<string>)  
+            // return allDbFiles.ToList();  
+
+            return files;
+        }
+       
+        private void ListView1_DrawItem(object sender, DrawListViewItemEventArgs e)
+        {
+            // 这里可以自定义绘制整个 ListViewItem
+            // 但由于我们只关心 SubItem 的颜色,所以主要逻辑将在 DrawSubItem 中
+            e.DrawDefault = true; // 默认情况下使用标准绘制
+        }
+
+        private void ListView1_DrawSubItem(object sender, DrawListViewSubItemEventArgs e)
+        {
+            // 检查是否是我们要自定义颜色的那一列
+            if (e.ColumnIndex == 1) // 第二列的索引是 1
+            {
+                Color color = ColorTranslator.FromHtml(e.SubItem.Text);
+
+                // 自定义绘制 SubItem
+                e.Graphics.FillRectangle(new SolidBrush(color), e.Bounds);
+                TextRenderer.DrawText(e.Graphics, e.SubItem.Text, e.SubItem.Font, e.Bounds, color, TextFormatFlags.Left);
+
+                // 告诉 ListView 我们已经处理了绘制
+                e.DrawDefault = false;
+            }
+            else
+            {
+                // 对于其他列,使用默认绘制
+                e.DrawDefault = true;
+            }
+        }
+
+        private void ReadClassificationNo()
+        {
+            LibraryName.Clear();
+            string MeasurementFiles = System.IO.Directory.GetCurrentDirectory() + "\\Config\\SysData";
+            // 获取文件夹中的所有文件信息  
+            List<string> getNameM = GetDbFilesInDirectory(MeasurementFiles);
+            // 遍历文件信息数组并打印出文件名  
+            for (int i = 0; i < getNameM.Count; i++)
+            {
+                string[] vs = new string[] { getNameM[i], MeasurementFiles + "\\" + getNameM[i] };
+                LibraryName.Add(vs);
+            }
+            if (m_mbszclass.M_SY.StandardLibraryName == "NoSTDDB.db")
+            {
+                m_mbszclass.M_SY.StandardLibraryName = "";
+            }
+        }
+
+        private void ReadClassification()
+        {
+            LibraryName.Clear();
+            string fullPathM = "";
+            string fullPathR = "";
+            ResultFile resfile = m_frmReportApp.m_rstDataMgr.ResultFilesList[m_frmReportApp.m_rstDataMgr.GetWorkingResultId()];
+            string str_libraryName = resfile.GetSTDName();
+            bool endsWithDb = str_libraryName.EndsWith(".db", StringComparison.OrdinalIgnoreCase);
+            if (!endsWithDb)
+            {
+                str_libraryName = str_libraryName + ".db";
+            }
+            try
+            {
+                fullPathM = System.IO.Directory.GetCurrentDirectory() + "\\Config\\SysData\\" + str_libraryName /*+ ".db"*/;
+                string MeasurementFiles = System.IO.Directory.GetCurrentDirectory() + "\\Config\\SysData";
+                // 获取文件夹中的所有文件信息  
+                List<string> getNameM = GetDbFilesInDirectory(MeasurementFiles);
+                // 遍历文件信息数组并打印出文件名  
+                for (int i = 0; i < getNameM.Count; i++)
+                {
+                    string[] vs = new string[] { getNameM[i], MeasurementFiles + "\\" + getNameM[i] };
+                    LibraryName.Add(vs);
+                }
+
+            }
+            catch
+            {
+
+            }
+            try
+            {
+                fullPathR = m_frmReportApp.m_rstDataMgr.CurResultFile.FilePath + "\\" + str_libraryName /*+ ".db"*/;
+                string ReportFile = m_frmReportApp.m_rstDataMgr.CurResultFile.FilePath;
+                // 获取文件夹中的所有文件信息  
+                List<string> getNameR = GetDbFilesInDirectory(ReportFile);
+                for (int i = 0; i < getNameR.Count; i++)
+                {
+                    string[] vs = new string[] { getNameR[i], ReportFile + "\\" + getNameR[i] };
+                    LibraryName.Add(vs);
+                }
+            }
+            catch
+            {
+
+            }
+
+            if (str_libraryName == "NoSTDDB.db" || m_mbszclass.M_SY.StandardLibraryName == "NoSTDDB.db")
+            {
+                m_mbszclass.M_SY.StandardLibraryName = "";
+            }
+            else
+            {
+
+                if (System.IO.File.Exists(fullPathR))
+                {
+                    return;
+                }
+                else if (System.IO.File.Exists(fullPathM))
+                {
+                    return;
+                }
+                else
+                {
+                    //MessageBox.Show(table["library_does_not_match"].ToString());
+                }
+
+            }
+        }
+
+        private void FormStandardLibraryInformation_Activated(object sender, EventArgs e)
+        {
+            //DataLoad();
+        }
+
+        public void DataRefresh()
+        {
+            DataLoad();
+            listView1.View = View.Details;
+            listView1.FullRowSelect = true; // 可选,设置是否选择整行
+            listView1.GridLines = true; // 可选,设置是否显示网格线
+        }
+
+        public void DataDeletion()
+        {
+            listView1.Items.Clear();
+        }
+
+        private void DataLoad()
+        {
+            if (m_condition.m_CurrentConditions.Count == 0)
+            {
+                return;
+            }
+            listView1.Items.Clear();
+            string sou = m_condition.m_CurrentConditions[OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE].itemDisplayVal.ToString();
+            if (sou.Contains("+"))
+            {
+                for (int i = 0; i < sou.Split('+').Length; i++)
+                {
+                    ResultFile resultFile = m_frmReportApp.m_rstDataMgr.ResultFilesList.Find(s => s.anotherFileName == sou.Split('+')[i]);
+                    if (resultFile != null)
+                    {
+                        GetDBData(resultFile);
+                    }
+                }
+            }
+            else
+            {
+                for (int i = 0; i < m_frmReportApp.m_rstDataMgr.ResultFilesList.Count; i++)
+                {
+                    if (sou == m_frmReportApp.m_rstDataMgr.ResultFilesList[i].anotherFileName.ToString())
+                    {
+                        GetDBData(m_frmReportApp.m_rstDataMgr.ResultFilesList[i]);
+                    }
+
+                }
+
+            }
+
+            ////根据标签索引 显示默认的数据图表
+            //if (m_frmReportApp.m_ChartsWindow.Controls != null)
+            //{
+            //    if (m_frmReportApp.m_ChartsWindow.Controls.Count == 0)
+            //    {
+            //        m_frmReportApp.m_conditionChoose.tabIndex = DisplayPicutureType.AnalyzeStandardLibrary;
+            //        m_frmReportApp.m_conditionChoose.ShowsTheDefaultPic();
+            //    }
+            //}
+            //m_frmReportApp.m_RstWindow.SelectWorkSampleNode();
+            ////设置每个功能模块限制菜单的显示
+            //if (this.Controls.Count != 0)
+            //{
+            //    m_frmReportApp.m_RibbonFun.SetRibbonButnStatu_ByModule(DisplayPicutureType.AnalyzeStandardLibrary);
+            //}
+
+            ////判断样品属性与样品窗口在主窗体的位置
+            //if (m_frmReportApp.m_conditionChoose.DockState != m_frmReportApp.m_RstWindow.DockState)
+            //{
+            //    m_frmReportApp.m_RstWindow.Activate();
+            //}
+            //else
+            //{
+            //    if (!m_frmReportApp.m_conditionChoose.Focus())
+            //    {
+            //        m_frmReportApp.m_RstWindow.Activate();
+            //    }
+            //}
+
+
+        }
+    }
+}

+ 120 - 0
OTSIncAReportApp/1-UI/FormStandardLibraryInformation.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>

+ 3 - 1
OTSIncAReportApp/1-UI/OTSDisplaySourceGridData/OTSSampleReportInfo/OTSSampleReportInfo.cs

@@ -26,7 +26,9 @@ namespace OTSIncAReportApp.OTSSampleReportInfo
         //分析数据表
         AnalyzeDataTable = 1,
         //分析数据图
-        AnalyzeDataChart = 2
+        AnalyzeDataChart = 2,
+        //标准库
+        AnalyzeStandardLibrary=3
     }
     public enum IMAGE_DISPLAY_TYPE
     {

+ 3 - 0
OTSIncAReportApp/1-UI/OTSDisplaySourceGridData/frmReportConditionChoose.cs

@@ -340,10 +340,12 @@ namespace OTSIncAReportApp
                                     data.ConditionItemList[i].itemDisplayVal = data.ConditionItemList[i].comboDownList[0].ToString();
                                     data.ConditionItemList[i].itemVal = 0;
                                     m_rstDataMgr.SetWorkingResultId((int)data.ConditionItemList[i].itemVal);
+                                    m_ReportApp.m_StandardLibrary.DataRefresh();
                                 }
                                 else
                                 {
                                     m_rstDataMgr.SetWorkingResultId((int)data.ConditionItemList[i].itemVal);
+                                    m_ReportApp.m_StandardLibrary.DataRefresh();
                                 }
 
                             }
@@ -757,6 +759,7 @@ namespace OTSIncAReportApp
                             m_ReportApp.im_ResultGrid.Dock = DockStyle.Fill;
                             m_ReportApp.m_TablesWindow.Controls.Add(m_ReportApp.im_ResultGrid);
                             m_ReportApp.m_TablesWindow.Activate();
+                            m_ReportApp.m_StandardLibrary.DataRefresh();
                             break;
                         case CALCULATE_TABLE_TYPE.PARTICALE_GENE_INFO:
                             if (m_ReportApp.im_ParticlesGridDevidePage != null && m_ReportApp.im_ParticlesGridDevidePage.FileName == m_fileName&&(m_ReportApp.im_Control_DrawDistrbutionImageAndBSE==null||!m_ReportApp.im_Control_DrawDistrbutionImageAndBSE.WhetherThereAreDeleteParticles()))

+ 2 - 0
OTSIncAReportApp/1-UI/frmMeasureRstMgr.cs

@@ -364,6 +364,7 @@ namespace OTSIncAReportApp
                     //treeView1.Nodes.Clear();
                     //如果已经没有测量结果,则将报告程序初始化到刚打开的状态
                     m_ReportApp.InitReportProState();
+                    m_ReportApp.m_StandardLibrary.DataDeletion();
                 }
                 else
                 {
@@ -386,6 +387,7 @@ namespace OTSIncAReportApp
                 m_ConditionChoose.m_conditionData.SetItemvalByItemName(OTS_REPORT_PROP_GRID_ITEMS.DATA_SOURCE, 0);
             }
 
+            
 
             m_ConditionChoose.DisCurrentPicProperty();
 

+ 64 - 5
OTSIncAReportApp/1-UI/frmReportApp.cs

@@ -20,6 +20,7 @@ using System.IO;
 using System.Runtime.InteropServices;
 using System.Windows.Forms;
 using OTSCommon.DBOperate.Model;
+using OTSIncAReportApp._1_UI;
 
 namespace OTSIncAReportApp
 {
@@ -42,6 +43,8 @@ namespace OTSIncAReportApp
         public frmSampleImage m_SImageWindow = null;                            //BSE窗体
         public frmCharts m_ChartsWindow = null;                                //图表窗体
         public frmTables m_TablesWindow = null;                                //报表窗体
+        public FormStandardLibraryInformation m_StandardLibrary = null;         //标准库窗体
+
         public frmReportSysConfig m_ReportSysConfigForm;                        //配置参数窗体
 
         #endregion //-----------------------------------------------------------------------------------------------
@@ -208,7 +211,8 @@ namespace OTSIncAReportApp
             m_OutputNlog.Visible = true;
             log = NLog.LogManager.GetCurrentClassLogger();
 
-            
+               
+
             InitializeComponent();
            
             //初始化Ribbon类,操作Ribbon按钮的可用或者不可用
@@ -227,9 +231,12 @@ namespace OTSIncAReportApp
             m_ChartsWindow = new frmCharts(this);
             //grid表格窗体
             m_TablesWindow = new frmTables(this);
+            //标准库窗体
+            m_StandardLibrary = new FormStandardLibraryInformation (this);
 
 
-
+            m_StandardLibrary = new FormStandardLibraryInformation(this);
+            m_StandardLibrary.Visible = true;
             SetTag();
 
             #region 国际化语言
@@ -271,6 +278,8 @@ namespace OTSIncAReportApp
         {
             m_OutputNlog = new OutputNlog();
             m_OutputNlog.Visible = true;
+
+           
             log = NLog.LogManager.GetCurrentClassLogger();
 
             m_str_resultfilepaths = str_resultfilepaths;
@@ -295,9 +304,11 @@ namespace OTSIncAReportApp
             m_ChartsWindow = new frmCharts(this);
             //grid表格窗体
             m_TablesWindow = new frmTables(this);
-            
+            //标准库窗体
+            m_StandardLibrary = new FormStandardLibraryInformation(this);
 
-           
+            m_StandardLibrary = new FormStandardLibraryInformation(this);
+            m_StandardLibrary.Visible = true;
             SetTag();
             #region 国际化语言
             Language lan = new Language(this);
@@ -351,7 +362,8 @@ namespace OTSIncAReportApp
             m_rstDataMgr.m_RptConfigFile.LoadDataFromFile();
             //设置菜单按钮,都为true状态
             m_RibbonFun.SetAllRibbonButnStatu(false);
-
+            //激活标准库窗体
+            this.m_StandardLibrary.Activate();
             //创建,树窗口,属性grid窗口,分布图,grid,chart窗体等。
             CreateNewWorkspaceWindow();
 
@@ -359,6 +371,8 @@ namespace OTSIncAReportApp
             this.m_RstWindow.Activate();
             //激活表图窗体
             this.m_TablesWindow.Activate();
+
+            
             //----------------end the initialization
 
             if (m_str_resultfilepaths != null)
@@ -457,6 +471,7 @@ namespace OTSIncAReportApp
                 Cursor = Cursors.WaitCursor;
                 this.m_RstWindow.AddSampleResult(path);
                 Cursor = Cursors.Default;
+                this.m_StandardLibrary.DataRefresh();
             }
         }
 
@@ -875,6 +890,8 @@ namespace OTSIncAReportApp
         /// </summary>
         public void CreateNewWorkspaceWindow()
         {
+
+            
             //创建测量数据窗口
             CreateCTablesWindow();
             //Show BSE图窗口
@@ -882,10 +899,15 @@ namespace OTSIncAReportApp
             //创建图表窗口
             CreateChartsWindow();
 
+            //StandardLibraryWindow();
+
             m_OutputNlog.Show(DockWindowPanel, OTS.WinFormsUI.Docking.DockState.DockRight);
             m_OutputNlog.Visible = true;
+            m_StandardLibrary.Show(DockWindowPanel, DockState.DockLeft);
             m_RstWindow.Show(DockWindowPanel, OTS.WinFormsUI.Docking.DockState.DockLeft);
             m_conditionChoose.Show(DockWindowPanel);
+           
+            //m_StandardLibrary.Visible = true;`
             DockWindowPanel.DockLeftPortion = 300;
             DockWindowPanel.DockRightPortion = 351;
         }
@@ -912,6 +934,11 @@ namespace OTSIncAReportApp
             {
                 text = table["analysisdatachart"].ToString();
             }
+            else
+            {
+                text = "标准库信息";
+            }
+           
 
             WorkWindow.Text = text;
             return WorkWindow;
@@ -938,6 +965,36 @@ namespace OTSIncAReportApp
                 m_SImageWindow.Show(DockWindowPanel);
             }
         }
+        private void StandardLibraryWindow()
+        {
+            if (null == m_StandardLibrary)
+            {
+                m_StandardLibrary = new FormStandardLibraryInformation(this);
+            }
+
+            m_StandardLibrary = (FormStandardLibraryInformation)CreateNewDocument(m_StandardLibrary, DisplayPicutureType.AnalyzeStandardLibrary);
+
+            if (DockWindowPanel.DocumentStyle == DocumentStyle.SystemMdi)
+            {
+                m_StandardLibrary.MdiParent = this;
+                m_StandardLibrary.Show();
+            }
+            else
+            {
+                m_StandardLibrary.Show(DockWindowPanel);
+            }
+            //m_StandardLibrary.Text = "标准库数据";
+            //if (DockWindowPanel.DocumentStyle == DocumentStyle.SystemMdi)
+            //{
+            //    m_StandardLibrary.MdiParent = this;
+            //    m_StandardLibrary.Show();
+            //}
+            //else
+            //{
+            //    m_StandardLibrary.Show(DockWindowPanel);
+            //}
+        }
+
 
         /// <summary>
         /// 创建Grid表格窗体
@@ -1075,6 +1132,7 @@ namespace OTSIncAReportApp
                     foreach (System.IO.FileInfo file in directory.GetFiles("*.rst"))
                     {
                         this.m_RstWindow.AddSampleResult(file.FullName);
+                        this.m_StandardLibrary.DataRefresh();
                     }
                 }
                 this.Cursor = Cursors.Default;
@@ -1234,6 +1292,7 @@ namespace OTSIncAReportApp
         private void rbClose_Click(object sender, EventArgs e)
         {
            m_RstWindow. RemoveSample();
+            //m_StandardLibrary.DataDeletion();
         }
 
         private void rbClose_DoubleClick(object sender, EventArgs e)

+ 9 - 0
OTSIncAReportApp/OTSIncAReportApp.csproj

@@ -564,6 +564,12 @@
       <DependentUpon>SpectrumExportConfirmation.cs</DependentUpon>
     </Compile>
     <Compile Include="1-UI\ElementSubscript.cs" />
+    <Compile Include="1-UI\FormStandardLibraryInformation.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="1-UI\FormStandardLibraryInformation.Designer.cs">
+      <DependentUpon>FormStandardLibraryInformation.cs</DependentUpon>
+    </Compile>
     <Compile Include="1-UI\frmCharts.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -969,6 +975,9 @@
     <EmbeddedResource Include="1-UI\Control_Grids\SpectrumExportConfirmation.resx">
       <DependentUpon>SpectrumExportConfirmation.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="1-UI\FormStandardLibraryInformation.resx">
+      <DependentUpon>FormStandardLibraryInformation.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="1-UI\frmCharts.resx">
       <DependentUpon>frmCharts.cs</DependentUpon>
     </EmbeddedResource>