浏览代码

Merge branch 'OTSRelease3_2' of http://36.129.169.60:30080/gogsadmin/OTS into OTSRelease3_2

gsp 3 月之前
父节点
当前提交
6b60e14077

+ 4 - 4
Bin/x64/Debug/Config/ReportTemplate/TCleannessA_Template/ReportTemplateConfig.xml

@@ -12,7 +12,7 @@
     <str_xzkl>全部颗粒</str_xzkl>
     <int_xzkl>0</int_xzkl>
     <LOGName>ReportIdentification.bmp</LOGName>
-    <StandardLibraryName>OTSCleanlinessSTD1.db</StandardLibraryName>
+    <StandardLibraryName>STD.db</StandardLibraryName>
     <str_tb_SampleName>
     </str_tb_SampleName>
     <str_tb_djsb>
@@ -142,11 +142,11 @@
     <b_ck_chart>False</b_ck_chart>
   </M_JZWZB>
   <whole>
-    <list_str_MainPriority>System.Collections.Generic.List`1[System.String]<YS0>Mullite</YS0><YS1>Ti-Zr-Al oxid</YS1><YS2>Ti-Al-Si oxide</YS2><YS3>Ti-Al oxide</YS3><YS4>A1-Si-Ca oxide</YS4><YS5>Al-Si-Zr-Ni oxide</YS5><YS6>Ca-Al oxide</YS6><YS7>Si-Mg-Al oxide</YS7><YS8>Al-silicate</YS8><YS9>Apatite MgAlSi</YS9><YS10>Corundum</YS10><YS11>Si-Zr oxide</YS11><YS12>Quartz</YS12><YS13>Mo-Fe-Co-Ni</YS13><YS14>Mg-Fe Silicate</YS14><YS15>Fe oxide</YS15><YS16>Monazite</YS16><YS17>Ca-Mg oxide</YS17><YS18>Xenotime</YS18><YS19>Rutile</YS19><YS20>Willemite</YS20><YS21>Fluorite</YS21><YS22>Periclase</YS22><YS23>Ilmenite</YS23></list_str_MainPriority>
+    <list_str_MainPriority>System.Collections.Generic.List`1[System.String]<YS0>Cu</YS0><YS1>Zn</YS1><YS2>Fe</YS2><YS3>Other Non-Magnetic</YS3></list_str_MainPriority>
     <list_str_SecondaryPriority>System.Collections.Generic.List`1[System.String]<YS0>Nialloy</YS0><YS1>Fe-O</YS1><YS2>Fe-Cr</YS2><YS3>Fe-alloy</YS3></list_str_SecondaryPriority>
-    <str_MainPriority>Mullite , Ti-Zr-Al oxid , Ti-Al-Si oxide , Ti-Al oxide , A1-Si-Ca oxide , Al-Si-Zr-Ni oxide , Ca-Al oxide , Si-Mg-Al oxide , Al-silicate , Apatite MgAlSi , Corundum , Si-Zr oxide , Quartz , Mo-Fe-Co-Ni , Mg-Fe Silicate , Fe oxide , Monazite , Ca-Mg oxide , Xenotime , Rutile , Willemite , Fluorite , Periclase , Ilmenite</str_MainPriority>
+    <str_MainPriority>Cu , Zn , Fe , Other Non-Magnetic</str_MainPriority>
     <str_SecondaryPriority>Nialloy,Fe-O,Fe-Cr,Fe-alloy</str_SecondaryPriority>
-    <list_str_MainPriority_Serial>System.Collections.Generic.List`1[System.String]<YS0>40001</YS0><YS1>40004</YS1><YS2>40006</YS2><YS3>40003</YS3><YS4>40010</YS4><YS5>40012</YS5><YS6>40013</YS6><YS7>40016</YS7><YS8>40014</YS8><YS9>40023</YS9><YS10>40002</YS10><YS11>40007</YS11><YS12>40009</YS12><YS13>40005</YS13><YS14>40008</YS14><YS15>40011</YS15><YS16>40015</YS16><YS17>40017</YS17><YS18>40018</YS18><YS19>40019</YS19><YS20>40020</YS20><YS21>40021</YS21><YS22>40022</YS22><YS23>40024</YS23></list_str_MainPriority_Serial>
+    <list_str_MainPriority_Serial>System.Collections.Generic.List`1[System.String]<YS0>40004</YS0><YS1>40007</YS1><YS2>40005</YS2><YS3>40006</YS3></list_str_MainPriority_Serial>
   </whole>
   <M_DZ>
     <Notes>

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

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

+ 2 - 1
OTSIncAMeasureApp/0-OTSModel/OTSDataType/COTSField.cs

@@ -5,6 +5,7 @@ using OTSModelSharp.ServiceCenter;
 using System;
 using System.Collections.Generic;
 using System.Drawing;
+using System.Drawing.Imaging;
 using System.Linq;
 using System.Xml;
 
@@ -192,7 +193,7 @@ namespace OTSDataType
         {
             CImageHandler imghandler = new CImageHandler();
             List<COTSParticleClr> Parts = GetListAnalysisParticles();
-            Bitmap img = new Bitmap(this.ImgWidth, this.ImgHeight);
+            Bitmap img = new Bitmap(this.ImgWidth, this.ImgHeight, PixelFormat.Format24bppRgb);
             var imgparam = m_sample.GetMsrParams().GetImageProcessParam();
             var pixelsize = m_sample.CalculatePixelSize();
             imghandler.GetImageWithSTDColoredParts(Parts, imgparam, pixelsize, ref img);

+ 49 - 12
OTSIncAReportApp/1-UI/OTSReportExport/Category.cs

@@ -25,16 +25,19 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport
         public List<string> vs = new List<string>();
         private bool isRemove = false;
         Hashtable table;
-     
-        public Category(List<string> a_ElementList,DataTable AllList,bool a_Remove)
+        private DataTable ResultLibrary = new DataTable();//测量结果库
+
+
+		public Category(List<string> a_ElementList,DataTable AllList,bool a_Remove,DataTable a_ResultLibrary)
         {
             InitializeComponent();
             ElementList = AllList.Copy();
             CheckTheOptions = a_ElementList.Copy();
             OutElementList = a_ElementList.Copy();
             isRemove = a_Remove;
-            #region 国际化语言
-            OTSCommon.Language lan = new OTSCommon.Language(this);
+            ResultLibrary = a_ResultLibrary.Copy();
+			#region 国际化语言
+			OTSCommon.Language lan = new OTSCommon.Language(this);
             table = lan.GetNameTable(this.Name);
             #endregion
         }
@@ -83,17 +86,45 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport
                         }
                         flowLayoutPanel.Controls.Add(box1);
                     }
-                    Panel panel = new Panel();
+
+                    if (ResultLibrary.Rows.Count > 0)
+                    {
+                        for (int i = 0; i < ResultLibrary.Rows.Count; i++)
+                        {
+							// 添加控件到 FlowLayoutPanel 中
+							CheckBox box1 = new CheckBox();
+							box1.Text = ResultLibrary.Rows[i][1].ToString();
+							box1.Width = flowLayoutPanel.Width - 40;
+							box1.Height = 25;
+							Font font = new Font("宋体", 15, FontStyle.Regular);
+							box1.Font = font;
+							if (CheckTheOptions.Count == 0)
+							{
+								if (!isRemove)
+									box1.Checked = true;
+								else
+									box1.Checked = false;
+							}
+							else
+							{
+								for (int a = 0; a < CheckTheOptions.Count; a++)
+								{
+									if (ResultLibrary.Rows[i][0].ToString() == CheckTheOptions[a].ToString())
+										box1.Checked = true;
+								}
+							}
+							flowLayoutPanel.Controls.Add(box1);
+						}
+
+					}
+						Panel panel = new Panel();
                     panel.Size = new Size(10, 10);
                     panel.BackColor = Color.Transparent;
                     flowLayoutPanel.Controls.Add(panel);
 
-
-                    this.checkBox_selall.CheckedChanged -= new System.EventHandler(this.checkBox_selall_CheckedChanged);
-                    checkBox_selall.Checked = true;
-                    this.checkBox_selall.CheckedChanged += new System.EventHandler(this.checkBox_selall_CheckedChanged);
                 }
-            }
+
+			}
 
         }
 
@@ -174,8 +205,14 @@ namespace OTSIncAReportApp._1_UI.OTSReportExport
                     vs.Add(ElementList.Rows[i]["STDId"].ToString());
                 }
             }
-
-            IsModify = true;
+			for (int i = 0; i < ResultLibrary.Rows.Count; i++)
+			{
+				if (blList[i])
+				{
+					vs.Add(ResultLibrary.Rows[i][0].ToString());
+				}
+			}
+			IsModify = true;
             this.Close();
         }
         /// <summary>

+ 86 - 21
OTSIncAReportApp/1-UI/OTSReportExport/OTSReport_Template_CleannessA.cs

@@ -3,7 +3,9 @@ using DevExpress.Utils.Extensions;
 using NPOI.Util;
 using OTSCommon.DBOperate;
 using OTSIncAReportApp._1_UI.OTSReportExport;
+using OTSIncAReportApp._1_UI.OTSReportExport.DataIntegration;
 using OTSIncAReportApp._1_UI.OTSTemplateDesigner;
+using OTSIncAReportApp.DataOperation.DataAccess;
 using OTSIncAReportApp.OTSSampleReportInfo;
 using OTSIncAReportApp.SysMgrTools;
 using OTSPeriodicTable;
@@ -15,6 +17,7 @@ using System.Data;
 using System.Drawing;
 using System.IO;
 using System.Windows.Forms;
+using static DevExpress.XtraCharts.GLGraphics.GL;
 using static OTSDataType.otsdataconst;
 
 namespace OTSIncAReportApp.OTSTemplateDesigner
@@ -31,11 +34,15 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
         private bool SwitchCategories = false;
         private List<string> TCCleannessAList = new List<string>();
         private List<string> list_MainPriority = new List<string>();
-        #endregion
 
-        #region 构造函数及窗体加载
+		ParticleData fielddata;
+
+        bool isRefresh = false;
+		#endregion
 
-        public OTSReport_Template_CleannessA(OTSReport_Export in_otsreport_export,string a_FileName)
+		#region 构造函数及窗体加载
+
+		public OTSReport_Template_CleannessA(OTSReport_Export in_otsreport_export,string a_FileName)
         {
             InitializeComponent();
             m_OTSReport_Export = in_otsreport_export;
@@ -53,7 +60,11 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             BindControl();
             //读取默认值
             LoadControls();
-            label_StandardLibraryName.Text= table["standardlibrary"].ToString() + m_OTSReport_Export.m_mbszclass.M_SY.StandardLibraryName;
+
+			TableHeaderData HeaderData = new TableHeaderData();
+			DataTable data = HeaderData.GetData(m_OTSReport_Export);
+			string strResultLibraryName = data.Rows[3][1].ToString()+".db";
+			label_StandardLibraryName.Text= table["standardlibrary"].ToString() + m_OTSReport_Export.m_mbszclass.M_SY.StandardLibraryName;
             for (int i=0;i< m_OTSReport_Export.LibraryName.Count;i++)
             {
                 comboBox1.Items.Add(m_OTSReport_Export.LibraryName[i][0]);
@@ -62,24 +73,39 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
 
             for (int i=0;i< m_OTSReport_Export.LibraryName.Count;i++)
             {
-                if (m_OTSReport_Export.m_mbszclass.M_SY.StandardLibraryName== m_OTSReport_Export.LibraryName[i][0])
+                if (strResultLibraryName == m_OTSReport_Export.LibraryName[i][0])
                 {
                     CurrentName = i;
                     break;
                 }
             }
-            if (m_OTSReport_Export.m_mbszclass.M_SY.StandardLibraryName !="")
+            //if (m_OTSReport_Export.m_mbszclass.M_SY.StandardLibraryName !="")
+            //{
+            //    comboBox1.SelectedIndex = CurrentName;
+            //}
+            if (m_OTSReport_Export.m_mbszclass.M_SY.StandardLibraryName == strResultLibraryName)
             {
-                comboBox1.SelectedIndex = CurrentName;
-            }
+				TCCleannessAList = m_OTSReport_Export.m_mbszclass.list_str_MainPriority_Serial.Copy();
+				list_MainPriority = m_OTSReport_Export.m_mbszclass.list_str_MainPriority.Copy();
+				textBox_zypxss.Text = m_OTSReport_Export.m_mbszclass.str_MainPriority;
+				comboBox1.SelectedIndex = CurrentName;
+			}
+			
 
-            if (m_OTSReport_Export.m_ReportApp.m_RptConfigFile.Systype == OTS_SysType_ID.TCCleannessA)
+			if (m_OTSReport_Export.m_ReportApp.m_RptConfigFile.Systype == OTS_SysType_ID.TCCleannessA)
             {
                 cb_TccleanlinessA.Enabled = true;
             }
-            
 
-        }
+			try
+			{
+				fielddata = new ParticleData(m_OTSReport_Export.m_ReportApp.m_rstDataMgr.ResultFilesList[m_OTSReport_Export.m_ReportApp.m_rstDataMgr.GetWorkingResultId()].FilePath);
+			}
+			catch
+			{
+
+			}
+		}
 
 
         /// <summary>
@@ -372,9 +398,12 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             {
                 m_OTSReport_Export.m_mbszclass.M_YSFXJG.list_str_tb_ysfx_xsys.Add(after[i]);
             }
-         
-            //主要优先显示
-            m_OTSReport_Export.m_mbszclass.list_str_MainPriority.Clear();
+
+
+            m_OTSReport_Export.m_mbszclass.M_SY.StandardLibraryName = comboBox1.Text;
+
+			//主要优先显示
+			m_OTSReport_Export.m_mbszclass.list_str_MainPriority.Clear();
             m_OTSReport_Export.m_mbszclass.list_str_MainPriority = list_MainPriority.Copy();
   
 
@@ -480,14 +509,13 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
             comboBox_p3.SelectedIndex = m_OTSReport_Export.m_mbszclass.M_KLLBXX.index_cb_kllb_sort_p3;
            
             //delete_Class.Text = m_OTSReport_Export.m_mbszclass.M_KLLBXX.str_kllb_DeleteClass;
-            textBox_zypxss.Text = m_OTSReport_Export.m_mbszclass.str_MainPriority;
+            
 
             numericMin.Text = m_OTSReport_Export.m_mbszclass.M_KLLBXX.list_int_kllb_number.ToString();
 
 
             textBox1.Text = m_OTSReport_Export.m_mbszclass.M_DZ.Notes;
-            TCCleannessAList = m_OTSReport_Export.m_mbszclass.list_str_MainPriority_Serial.Copy();
-            list_MainPriority = m_OTSReport_Export.m_mbszclass.list_str_MainPriority.Copy();
+            
             LoadingIcon();
         }
         private void  LoadingIcon()
@@ -790,12 +818,21 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                 {
                     if (textBox_zypxss.Text.Split(',')[i] != "")
                         vs.Add(MainPriority[i]);
-                }
+				}
             }
+			DataTable fieldData = fielddata.GetAreaByAllIncA("");
+            DataTable ResultLibrary = fieldData.Clone();
+            for (int i = 0; i < fieldData.Rows.Count; i++)
+            {
+                if (Convert.ToInt64(fieldData.Rows[i][0]) > 50000)
+                {
+                    ResultLibrary.Rows.Add(fieldData.Rows[i].ItemArray);
 
+				}
+            }
 
-            //Category category = new Category(vs, ReadClassification(comboBox1.SelectedIndex));
-            Category category = new Category(m_OTSReport_Export.m_mbszclass.list_str_MainPriority_Serial.Copy(), ReadClassification(comboBox1.SelectedIndex),false);
+			//Category category = new Category(vs, ReadClassification(comboBox1.SelectedIndex));
+			Category category = new Category(m_OTSReport_Export.m_mbszclass.list_str_MainPriority_Serial.Copy(), ReadClassification(comboBox1.SelectedIndex),false, ResultLibrary);
             category.ShowDialog();
             List<string> ls = category.OutElementList;
             TCCleannessAList = category.vs;
@@ -842,11 +879,39 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
 
         private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
         {
+            if (!isRefresh)
+            {
+                isRefresh = true;
+                return;
+
+			}
+
             if (CurrentDatabase != comboBox1.Text)
             {
                 CurrentDatabase = comboBox1.Text;
                 SwitchCategories = true;
-            }
+                TCCleannessAList.Clear();
+                list_MainPriority.Clear();
+				DataTable dataTable = ReadClassification(comboBox1.SelectedIndex);
+                for (int i = 0; i < dataTable.Rows.Count; i++)
+                {
+                    TCCleannessAList.Add(dataTable.Rows[i][0].ToString());
+					list_MainPriority.Add(dataTable.Rows[i][1].ToString());
+				}
+				string str = "";
+				for (int i = 0; i < list_MainPriority.Count; i++)
+				{
+					if (i == list_MainPriority.Count - 1)
+					{
+						str = str + list_MainPriority[i];
+					}
+					else
+					{
+						str = str + list_MainPriority[i] + " , ";
+					}
+				}
+                textBox_zypxss.Text = str;
+			}
         }
     }
 }

+ 10 - 1
OTSIncAReportApp/1-UI/OTSReportExport/OTSReport_Template_INCA.cs

@@ -869,7 +869,16 @@ namespace OTSIncAReportApp.OTSTemplateDesigner
                         data.Rows.Add(dr);
                     }
                 }
-                Category category = new Category(DeleteClass_Serial, data, true);
+				DataTable ResultLibrary = fieldData.Clone();
+				for (int i = 0; i < fieldData.Rows.Count; i++)
+				{
+					if (Convert.ToInt64(fieldData.Rows[i][0]) > 50000)
+					{
+						ResultLibrary.Rows.Add(fieldData.Rows[i].ItemArray);
+
+					}
+				}
+				Category category = new Category(DeleteClass_Serial, data, true, ResultLibrary);
                 category.ShowDialog();
                 if (category.IsModify)
                 {

+ 2 - 2
OTSIncAReportApp/1-UI/OTSReportExport/Template/DataTemplate.cs

@@ -123,14 +123,14 @@ namespace OTSIncAReportApp._1_UI.OTSTemplateDesigner
         public void International_language()
         {
             basicData = new BasicData();
-            basicData.SetDBData(TemplateClass,m_otsreport_export,ComputeMode);
+			basicData.IsFilePath(m_otsreport_export);
+			basicData.SetDBData(TemplateClass,m_otsreport_export,ComputeMode);
             basicData.SetParticlesizeTable(m_otsreport_export);
             basicData.newParticleData(m_otsreport_export);
             basicData.SetAllClass();
             basicData.SetAllElement();
             basicData.IsThereAMajorClassification();
             basicData.IsResultFilesList(m_otsreport_export);
-            basicData.IsFilePath(m_otsreport_export);
             setXRLabelData(dev_ypmc_up, "产品名称:");
             setXRLabelData(dev_ypbh_up, "产品型号:");//样品编号(中间的)
             //setXRLabelData(dev_ypmc_up, GetlanguageData("dev_ypmc_up", dev_ypmc_up.Text));