Browse Source

Merge branch 'OTSRelease3_0' of http://36.129.163.148:30080/gogsadmin/OTS into OTSRelease3_0

gsp 1 year ago
parent
commit
421e38313a

+ 5 - 1
OTSCPP/OTSClassifyEngine/ExpressionClassifyEngine.cpp

@@ -493,7 +493,11 @@ CElementChemistriesList ExpressionClassifyEngine::ZeroElementProcess(COTSParticl
 					}
 					for (auto ele : partEles)
 					{
-						ele->SetPercentage(ele->GetPercentage() / sumPercentage*100);
+						if (sumPercentage != 0)
+						{
+							ele->SetPercentage(ele->GetPercentage() / sumPercentage * 100);
+						}
+						
 					}
 
 				}

+ 1 - 1
OTSCPP/OTSClrInterface/ClassificationClr/OTSClassifyEngineClr.h

@@ -35,7 +35,7 @@ namespace OTSCLRINTERFACE {
 
 		double IfNeedMaxEDS(COTSParticleClr^ particle);
 
-		bool ZeroElementProcess(COTSParticleClr^ particle);
+		bool ZeroElementProcess(COTSParticleClr^ particle);             
 	private:
 		IClassifyEngine* engine;
 	};

+ 6 - 0
OTSCommon/ReportModel/ResultFile.cs

@@ -188,6 +188,12 @@ public    enum OTS_Y_AXIS_DIRECTION
             return STDName;
 
         }
+        public bool GetUseSysSTD()
+        {
+            Dictionary<string, object> sampleMembers = ((Dictionary<string, object>)((Dictionary<string, object>)ResultInfo["Sample"])["Members"]);
+            string UseSysSTD = ((Dictionary<string, object>)sampleMembers["MsrParams"])["UseSysSTD"].ToString();
+            return Convert.ToBoolean(UseSysSTD);
+        }
         public int GetIncASteeltech()
         {
             //--------the int number  meaning----------

+ 117 - 117
OTSIncAMeasureApp/1-OTSMeasure/Measure/DBDataTransition/ElementChemistryDB.cs

@@ -14,153 +14,153 @@ namespace OTSModelSharp.DTLBase
     public class CElementChemistryDB : CSQLiteDB
     {
         List<CPosXrayClr> m_listPosXrayInfo = new List<CPosXrayClr>();
-        public CElementChemistryDB(IDBStoreBase _conStr, IDBTableBase _table):base(_conStr,_table) 		
-	{
-		
+        public CElementChemistryDB(IDBStoreBase _conStr, IDBTableBase _table) : base(_conStr, _table)
+        {
 
-    }
 
- 
+        }
 
-      public System.Data.DataTable GetQueryById( long a_nXrayId, long a_nFieldId,  long a_nElementId,  long a_nElementSize)
-	  {
 
-        
 
-        var datastorePtr = GetDatastore();
-   
-        var tableInfoPtr = GetTableInfo();
-   
+        public System.Data.DataTable GetQueryById(long a_nXrayId, long a_nFieldId, long a_nElementId, long a_nElementSize)
+        {
+
+
+
+            var datastorePtr = GetDatastore();
+
+            var tableInfoPtr = GetTableInfo();
 
-        var sXrayIdColumnName = tableInfoPtr.GetColumnName((int)CElementChemistryTable.ColumnID.N_XRAY_INDEX - (int)CElementChemistryTable.ColumnID.MIN);
-        var sFieldIdColumnName = tableInfoPtr.GetColumnName((int)CElementChemistryTable.ColumnID.N_FIELD_ID - (int)CElementChemistryTable.ColumnID.MIN);
-        var sElementIdColumnName = tableInfoPtr.GetColumnName((int)CElementChemistryTable.ColumnID.N_ELEMENT_ID - (int)CElementChemistryTable.ColumnID.MIN);
-        var sElementNumColumnName = tableInfoPtr.GetColumnName((int)CElementChemistryTable.ColumnID.N_ELEMENT_TOTAL - (int)CElementChemistryTable.ColumnID.MIN);
 
+            var sXrayIdColumnName = tableInfoPtr.GetColumnName((int)CElementChemistryTable.ColumnID.N_XRAY_INDEX - (int)CElementChemistryTable.ColumnID.MIN);
+            var sFieldIdColumnName = tableInfoPtr.GetColumnName((int)CElementChemistryTable.ColumnID.N_FIELD_ID - (int)CElementChemistryTable.ColumnID.MIN);
+            var sElementIdColumnName = tableInfoPtr.GetColumnName((int)CElementChemistryTable.ColumnID.N_ELEMENT_ID - (int)CElementChemistryTable.ColumnID.MIN);
+            var sElementNumColumnName = tableInfoPtr.GetColumnName((int)CElementChemistryTable.ColumnID.N_ELEMENT_TOTAL - (int)CElementChemistryTable.ColumnID.MIN);
 
-        String  sSQLCommand= String.Format("SELECT * FROM \'{0}\' WHERE {1} = {2} AND {3} ={4} AND {5} ={6} AND {7} = {8};", (String)tableInfoPtr.GetTableName(), sFieldIdColumnName,
-        a_nFieldId, sXrayIdColumnName, a_nXrayId,sElementIdColumnName, a_nElementId,sElementNumColumnName, a_nElementSize);
 
-      
+            String sSQLCommand = String.Format("SELECT * FROM \'{0}\' WHERE {1} = {2} AND {3} ={4} AND {5} ={6} AND {7} = {8};", (String)tableInfoPtr.GetTableName(), sFieldIdColumnName,
+            a_nFieldId, sXrayIdColumnName, a_nXrayId, sElementIdColumnName, a_nElementId, sElementNumColumnName, a_nElementSize);
 
-        var q=datastorePtr.QueryByCmdForDataTable(sSQLCommand);
-           
-        return q;
-	  }
 
-    
 
-     public   List< CPosXrayClr> GetXrayInfoList( bool a_bForce/* = FALSE*/)
-	{
-		if (a_bForce)
-		{
-            m_listPosXrayInfo.Clear();
-		}
+            var q = datastorePtr.QueryByCmdForDataTable(sSQLCommand);
 
-		if (m_listPosXrayInfo.Count == 0)
-		{
-			ReadXrayPointInfoList();
+            return q;
         }
 
-		return m_listPosXrayInfo;
-	}
 
-       public  bool ReadXrayPointInfoList()
+
+        public List<CPosXrayClr> GetXrayInfoList(bool a_bForce/* = FALSE*/)
+        {
+            if (a_bForce)
+            {
+                m_listPosXrayInfo.Clear();
+            }
+
+            if (m_listPosXrayInfo.Count == 0)
+            {
+                ReadXrayPointInfoList();
+            }
+
+            return m_listPosXrayInfo;
+        }
+
+        public bool ReadXrayPointInfoList()
         {
             var tableInfoPtr = GetTableInfo();
-            
+
             var query = GetTableQueryForDataTable("");
-           
+
             m_listPosXrayInfo = ReadXrayPointInfoList(query);
 
             return true;
         }
 
-     
-      public  bool SaveElementChemistriesList(List<CPosXrayClr> a_xrayPointList)
-	{
-		
-          var tableInfoPtr = GetTableInfo();
-   
-          var datastorePtr = GetDatastore();
+
+        public bool SaveElementChemistriesList(List<CPosXrayClr> a_xrayPointList)
+        {
+
+            var tableInfoPtr = GetTableInfo();
+
+            var datastorePtr = GetDatastore();
 
             String sInsertFormat = tableInfoPtr.GetInsertCommandFormatString();
-          String sSQLCommand = "";
+            String sSQLCommand = "";
 
-		foreach (var xrayPointInfo in a_xrayPointList)
-		{
-			List<CElementChemistryClr> listElemnentChemistries = xrayPointInfo.GetElementQuantifyData();
+            foreach (var xrayPointInfo in a_xrayPointList)
+            {
+                List<CElementChemistryClr> listElemnentChemistries = xrayPointInfo.GetElementQuantifyData();
 
-            int nSize = (int)listElemnentChemistries.Count;
-            int nElementIndex = 0;
-			foreach (var pElementChemistry in listElemnentChemistries)
-			{
-                    sSQLCommand= String.Format(sInsertFormat,
+                int nSize = (int)listElemnentChemistries.Count;
+                int nElementIndex = 0;
+                foreach (var pElementChemistry in listElemnentChemistries)
+                {
+                    sSQLCommand = String.Format(sInsertFormat,
                     xrayPointInfo.GetIndex(),
-					xrayPointInfo.GetScanFieldId(),
-					nElementIndex,
-					nSize,
-					pElementChemistry.GetName(),
-					pElementChemistry.GetPercentage());
+                    xrayPointInfo.GetScanFieldId(),
+                    nElementIndex,
+                    nSize,
+                    pElementChemistry.GetName(),
+                    pElementChemistry.GetPercentage());
                     //var helper = new SQLiteHelper(datastorePtr);         
                     if (datastorePtr.RunCommand(sSQLCommand) != true)
-				   {
+                    {
 
 
 
                         return false;
-				}
+                    }
 
-				nElementIndex++;
-			}
+                    nElementIndex++;
+                }
 
-		}
+            }
 
             return true;
-	}
+        }
 
-      public  bool SaveElementChemistriesList( CPosXrayClr a_pxrayPoint)
-	{
-		
-       var tableInfoPtr = GetTableInfo();
-    
-       var datastorePtr = GetDatastore();
+        public bool SaveElementChemistriesList(CPosXrayClr a_pxrayPoint)
+        {
+
+            var tableInfoPtr = GetTableInfo();
+
+            var datastorePtr = GetDatastore();
 
             String sInsertFormat = tableInfoPtr.GetInsertCommandFormatString();
-        String sSQLCommand = "";
+            String sSQLCommand = "";
 
-       List<CElementChemistryClr >listElemnentChemistries = a_pxrayPoint.GetElementQuantifyData();
+            List<CElementChemistryClr> listElemnentChemistries = a_pxrayPoint.GetElementQuantifyData();
 
-        int nSize = (int)listElemnentChemistries.Count;
-        int nElementIndex = 0;
-		foreach (var pElementChemistry in listElemnentChemistries)
-		{
-                sSQLCommand=String.Format(sInsertFormat,
+            int nSize = (int)listElemnentChemistries.Count;
+            int nElementIndex = 0;
+            foreach (var pElementChemistry in listElemnentChemistries)
+            {
+                sSQLCommand = String.Format(sInsertFormat,
                 a_pxrayPoint.GetIndex(),
-				a_pxrayPoint.GetScanFieldId(),
-				nElementIndex,
-				nSize,
-				pElementChemistry.GetName(),
-				pElementChemistry.GetPercentage(),
-				pElementChemistry.GetMolarPercentage());
-                    
+                a_pxrayPoint.GetScanFieldId(),
+                nElementIndex,
+                nSize,
+                pElementChemistry.GetName(),
+                pElementChemistry.GetPercentage(),
+                pElementChemistry.GetMolarPercentage());
+
                 if (datastorePtr.RunCommand(sSQLCommand) != true)
-			    {
+                {
 
                     return false;
-			    }
+                }
 
-			nElementIndex++;
-		}
+                nElementIndex++;
+            }
 
             return true;
-	}
-        public List<KeyValuePair<string,SQLiteParameter[]>> GetSavingElementChemistriesCmds(CPosXrayClr a_pxrayPoint)
+        }
+        public List<KeyValuePair<string, SQLiteParameter[]>> GetSavingElementChemistriesCmds(CPosXrayClr a_pxrayPoint)
         {
             List<KeyValuePair<string, SQLiteParameter[]>> cmds = new List<KeyValuePair<string, SQLiteParameter[]>>();
             var tableInfoPtr = GetTableInfo();
 
-          
+
 
             var sInsertFormat = tableInfoPtr.GetInsertCommand();
             var parasTem = sInsertFormat.Value;
@@ -183,9 +183,9 @@ namespace OTSModelSharp.DTLBase
                 paras[3].Value = nSize;
                 paras[4].Value = pElementChemistry.GetName();
                 paras[5].Value = pElementChemistry.GetPercentage();
-             
 
-               
+
+
                 nElementIndex++;
                 cmds.Add(new KeyValuePair<string, SQLiteParameter[]>(sInsertFormat.Key, paras));
             }
@@ -194,7 +194,7 @@ namespace OTSModelSharp.DTLBase
         }
 
         public bool DeleteElementChemistryById(long a_nFieldId, long a_nXrayId)
-        {            
+        {
             if (m_listPosXrayInfo.Count != 0)
             {
                 for (int itr = 0; itr < m_listPosXrayInfo.Count; itr++)
@@ -213,28 +213,28 @@ namespace OTSModelSharp.DTLBase
             String sTableName = tableInfoPtr.GetTableName();
             if (IsTableExists(sTableName))
             {
-                
 
-           
 
-            var sXrayIdColumnName = tableInfoPtr.GetColumnName((int)CElementChemistryTable.ColumnID.N_XRAY_INDEX - (int)CElementChemistryTable.ColumnID.MIN);
-            var sFieldIdColumnName = tableInfoPtr.GetColumnName((int)CElementChemistryTable.ColumnID.N_FIELD_ID - (int)CElementChemistryTable.ColumnID.MIN);
 
-            String sSQLCommand = 
-            String.Format("DELETE FROM \'{0}\' WHERE {1} = {2} AND {3} ={4};",
-			sTableName,
-			sXrayIdColumnName,
-            a_nXrayId,
-			sFieldIdColumnName,
-			a_nFieldId);
 
-            //var helper = new SQLiteHelper(datastorePtr);
+                var sXrayIdColumnName = tableInfoPtr.GetColumnName((int)CElementChemistryTable.ColumnID.N_XRAY_INDEX - (int)CElementChemistryTable.ColumnID.MIN);
+                var sFieldIdColumnName = tableInfoPtr.GetColumnName((int)CElementChemistryTable.ColumnID.N_FIELD_ID - (int)CElementChemistryTable.ColumnID.MIN);
+
+                String sSQLCommand =
+                String.Format("DELETE FROM \'{0}\' WHERE {1} = {2} AND {3} ={4};",
+                sTableName,
+                sXrayIdColumnName,
+                a_nXrayId,
+                sFieldIdColumnName,
+                a_nFieldId);
+
+                //var helper = new SQLiteHelper(datastorePtr);
 
-             datastorePtr.RunCommand(sSQLCommand);
+                datastorePtr.RunCommand(sSQLCommand);
             }
             return true;
 
-    }
+        }
 
         public bool IsTableExists(String a_sTableName)
         {
@@ -243,26 +243,26 @@ namespace OTSModelSharp.DTLBase
 
         }
 
-       public List<CPosXrayClr> ReadXrayPointInfoList(DataTable a_query)
+        public List<CPosXrayClr> ReadXrayPointInfoList(DataTable a_query)
         {
             List<CPosXrayClr> xrayList = new List<CPosXrayClr>();
             Dictionary<string, CPosXrayClr> mapXrayInfo = new Dictionary<string, CPosXrayClr>();
             foreach (DataRow row in a_query.Rows)
             {
-               int nCol = (int)CElementChemistryTable.ColumnID.N_FIELD_ID- (int)CElementChemistryTable.ColumnID.MIN;
+                int nCol = (int)CElementChemistryTable.ColumnID.N_FIELD_ID - (int)CElementChemistryTable.ColumnID.MIN;
                 int curFldId = Convert.ToInt32(row[nCol]);
                 nCol = (int)CElementChemistryTable.ColumnID.N_XRAY_INDEX - (int)CElementChemistryTable.ColumnID.MIN;
                 int xrayId = Convert.ToInt32(row[nCol]);
                 string fldvec = "";
-                fldvec+=curFldId.ToString();
+                fldvec += curFldId.ToString();
                 fldvec += "_";
                 fldvec += xrayId.ToString();
-               
+
                 nCol = (int)CElementChemistryTable.ColumnID.S_NAME - (int)CElementChemistryTable.ColumnID.MIN;
                 string cheName = Convert.ToString(row[nCol]);
                 nCol = (int)CElementChemistryTable.ColumnID.F_PERCENTAGE - (int)CElementChemistryTable.ColumnID.MIN;
                 double percentage = Convert.ToDouble(row[nCol]);
-                CElementChemistryClr che = new CElementChemistryClr(cheName,percentage);
+                CElementChemistryClr che = new CElementChemistryClr(cheName, percentage);
 
                 if (!mapXrayInfo.ContainsKey(fldvec))
                 {
@@ -271,7 +271,7 @@ namespace OTSModelSharp.DTLBase
 
                     mapXrayInfo.Add(fldvec, xray);
                 }
-                else 
+                else
                 {
                     CPosXrayClr xray = mapXrayInfo[fldvec];
                     xray.AddQuantifyElement(che);
@@ -286,9 +286,9 @@ namespace OTSModelSharp.DTLBase
 
             }
             return xrayList;
-            
+
         }
-      public  bool GetAllMapedXrayInfo(ref Dictionary<string, CPosXrayClr> mapXrayInfo)
+        public bool GetAllMapedXrayInfo(ref Dictionary<string, CPosXrayClr> mapXrayInfo)
         {
             DataTable a_query = GetTableQueryForDataTable();
             //Dictionary<string, CPosXrayClr> mapXrayInfo = new Dictionary<string, CPosXrayClr>();

+ 1 - 0
OTSIncAMeasureApp/1-OTSMeasure/Measure/DBDataTransition/IncAFileMgr.cs

@@ -38,6 +38,7 @@ namespace OTSModelSharp
 
         CIncADataDB m_IncADataDB;
 
+
      
 
         CSQLiteDBStore dbStore ;

+ 20 - 10
OTSIncAReportApp/1-UI/frmMeasureRstMgr.Designer.cs

@@ -31,11 +31,12 @@
             this.components = new System.ComponentModel.Container();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmMeasureRstMgr));
             this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
+            this.计算边界颗粒合成ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.contextMenuStrip2 = new System.Windows.Forms.ContextMenuStrip(this.components);
             this.AddSample = new System.Windows.Forms.ToolStripMenuItem();
             this.treeView1 = new System.Windows.Forms.TreeView();
             this.button1 = new System.Windows.Forms.Button();
-            this.计算边界颗粒合成ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.ToolStripMenuItem_Zeroelementprocess = new System.Windows.Forms.ToolStripMenuItem();
             this.contextMenuStrip1.SuspendLayout();
             this.contextMenuStrip2.SuspendLayout();
             this.SuspendLayout();
@@ -44,9 +45,17 @@
             // 
             this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(24, 24);
             this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.计算边界颗粒合成ToolStripMenuItem});
+            this.计算边界颗粒合成ToolStripMenuItem,
+            this.ToolStripMenuItem_Zeroelementprocess});
             this.contextMenuStrip1.Name = "contextMenuStrip1";
-            this.contextMenuStrip1.Size = new System.Drawing.Size(181, 48);
+            this.contextMenuStrip1.Size = new System.Drawing.Size(181, 70);
+            // 
+            // 计算边界颗粒合成ToolStripMenuItem
+            // 
+            this.计算边界颗粒合成ToolStripMenuItem.Name = "计算边界颗粒合成ToolStripMenuItem";
+            this.计算边界颗粒合成ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
+            this.计算边界颗粒合成ToolStripMenuItem.Text = "计算边界颗粒合成";
+            this.计算边界颗粒合成ToolStripMenuItem.Click += new System.EventHandler(this.计算边界颗粒合成ToolStripMenuItem_Click);
             // 
             // contextMenuStrip2
             // 
@@ -71,7 +80,7 @@
             | System.Windows.Forms.AnchorStyles.Right)));
             this.treeView1.CheckBoxes = true;
             this.treeView1.DrawMode = System.Windows.Forms.TreeViewDrawMode.OwnerDrawAll;
-            this.treeView1.Font = new System.Drawing.Font("SimSun", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.treeView1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.treeView1.Location = new System.Drawing.Point(0, 25);
             this.treeView1.Name = "treeView1";
             this.treeView1.ShowLines = false;
@@ -95,12 +104,12 @@
             this.button1.Visible = false;
             this.button1.Click += new System.EventHandler(this.button1_Click);
             // 
-            // 计算边界颗粒合成ToolStripMenuItem
+            // ToolStripMenuItem_Zeroelementprocess
             // 
-            this.计算边界颗粒合成ToolStripMenuItem.Name = "计算边界颗粒合成ToolStripMenuItem";
-            this.计算边界颗粒合成ToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
-            this.计算边界颗粒合成ToolStripMenuItem.Text = "计算边界颗粒合成";
-            this.计算边界颗粒合成ToolStripMenuItem.Click += new System.EventHandler(this.计算边界颗粒合成ToolStripMenuItem_Click);
+            this.ToolStripMenuItem_Zeroelementprocess.Name = "ToolStripMenuItem_Zeroelementprocess";
+            this.ToolStripMenuItem_Zeroelementprocess.Size = new System.Drawing.Size(180, 22);
+            this.ToolStripMenuItem_Zeroelementprocess.Text = "零元素归一化";
+            this.ToolStripMenuItem_Zeroelementprocess.Click += new System.EventHandler(this.ToolStripMenuItem_Zeroelementprocess_Click);
             // 
             // frmMeasureRstMgr
             // 
@@ -114,7 +123,7 @@
             this.DockAreas = ((OTS.WinFormsUI.Docking.DockAreas)((((OTS.WinFormsUI.Docking.DockAreas.DockLeft | OTS.WinFormsUI.Docking.DockAreas.DockRight) 
             | OTS.WinFormsUI.Docking.DockAreas.DockTop) 
             | OTS.WinFormsUI.Docking.DockAreas.DockBottom)));
-            this.Font = new System.Drawing.Font("SimSun", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
             this.Margin = new System.Windows.Forms.Padding(4);
             this.Name = "frmMeasureRstMgr";
@@ -134,5 +143,6 @@
         public System.Windows.Forms.TreeView treeView1;
         private System.Windows.Forms.Button button1;
         private System.Windows.Forms.ToolStripMenuItem 计算边界颗粒合成ToolStripMenuItem;
+        private System.Windows.Forms.ToolStripMenuItem ToolStripMenuItem_Zeroelementprocess;
     }
 }

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

@@ -11,6 +11,7 @@ using System;
 using System.Collections;
 using System.Collections.Generic;
 using System.Drawing;
+using System.IO;
 using System.Runtime.InteropServices;
 using System.Windows.Forms;
 
@@ -686,5 +687,139 @@ namespace OTSIncAReportApp
             return true;
         }
 
+        private void ToolStripMenuItem_Zeroelementprocess_Click(object sender, EventArgs e)
+        {
+            if (this.treeView1.SelectedNode == null) return;
+            var SampleName = this.treeView1.SelectedNode.Text;
+            var resultfile = m_RstDataMgr.GetResultFileObjByName(SampleName);
+            if (resultfile == null) return;
+            var log = NLog.LogManager.GetCurrentClassLogger();
+            log.Info("Start to Zeroelementprocess!");
+            this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
+            List<COTSParticleClr> ParticleClrs = new List<COTSParticleClr>();
+            ParticleClrs = GetParticleClrFromFields(resultfile.List_OTSField);
+            if (m_ReportApp.m_RptConfigFile.Systype == OTS_SysType_ID.IncA)
+            {
+                if (resultfile.GetUseSysSTD())
+                {
+                    OTSCLRINTERFACE.COTSClassifyEngineClr EngineClr = new COTSClassifyEngineClr(EngineType.InclutionEng, "NoSTDDB");
+                    ParticleClrs = ZeroElementProcess(EngineClr, ParticleClrs);
+                }
+                string libname = resultfile.GetSTDName();
+                if (!libname.Contains(".db"))
+                {
+                    libname += ".db";
+                }
+                if (libname.ToLower() != "nostddb" && libname.ToLower() != "nostddb.db")
+                {
+                    if (!File.Exists(".\\Config\\SysData\\" + libname))
+                    {
+                        MessageBox.Show("未加载到标准库!");
+                        return;
+                    }
+                    OTSCLRINTERFACE.COTSClassifyEngineClr EngineClr2 = new COTSClassifyEngineClr(EngineType.ExpressionClassifyEng, libname);
+                    ParticleClrs = ZeroElementProcess(EngineClr2, ParticleClrs);
+                }
+            }
+            else
+            {
+                string libname = resultfile.GetSTDName();
+                if (!libname.Contains(".db"))
+                {
+                    libname += ".db";
+                }
+                if (libname.ToLower() != "nostddb" && libname.ToLower() != "nostddb.db")
+                {
+                    if (!File.Exists(".\\Config\\SysData\\" + libname))
+                    {
+                        MessageBox.Show("未加载到标准库!");
+                        return;
+                    }
+                    OTSCLRINTERFACE.COTSClassifyEngineClr EngineClr = new COTSClassifyEngineClr(EngineType.ExpressionClassifyEng, libname);
+                    ParticleClrs = ZeroElementProcess(EngineClr, ParticleClrs);
+                }
+            }
+
+            log.Info("begin particle data db saving...");
+
+            if(UpdateElementofParticles(ParticleClrs,resultfile.GetResultDBPath()))
+            {
+              MessageBox.Show("零元素归一化完毕,请重启报告以便数据生效!");
+            }
+            else
+            {
+
+            }
+            
+            this.Cursor = System.Windows.Forms.Cursors.Default;
+        }
+
+        List<COTSParticleClr> ZeroElementProcess(OTSCLRINTERFACE.COTSClassifyEngineClr ClassifyEngineClr, List<COTSParticleClr> allParticles)
+        {
+            //List<COTSParticleClr> ParticleClrs = new List<COTSParticleClr>();
+            foreach (COTSParticleClr particleClr in allParticles)
+            {
+                ClassifyEngineClr.ZeroElementProcess(particleClr);
+                //ParticleClrs.Add(particleClr);
+            }
+            return allParticles;
+        }
+
+        List<COTSParticleClr> GetParticleClrFromFields(List<OTSCommon.Model.Field> allFields)
+        {
+            List<COTSParticleClr> ParticleClrs = new List<COTSParticleClr>();
+            foreach (var f in allFields)
+            {
+                var parts = f.ParticleList;
+                foreach (var p in parts)
+                {
+                    COTSParticleClr part = new COTSParticleClr();
+                    COTSFeatureClr fea = new COTSFeatureClr();
+
+                    part.SetFeature(fea);
+                    var xray = part.GetXray();
+
+                    foreach (var ele in p.ElementList)
+                    {
+                        CElementChemistryClr eleclr = new CElementChemistryClr();
+                        eleclr.SetName(ele.Name);
+                        eleclr.SetPercentage(ele.Percentage);
+                        xray.AddQuantifyElement(eleclr);
+                    }
+
+                    part.SetFieldId(p.FieldId);
+                    part.SetAnalysisId(p.XrayId);
+                    part.SetParticleId(p.ParticleId);
+                    part.SetXray(xray);
+                    ParticleClrs.Add(part);
+                }
+            }
+            return ParticleClrs;
+        }
+
+        public bool UpdateElementofParticles(List<COTSParticleClr> Parts, string dbfile)
+        {
+            CIncAFileMgr pDBFileMgr = new CIncAFileMgr(dbfile);
+            CPosXrayDBMgr pXrayDBMgr = pDBFileMgr.GetPosXrayDBMgr();
+            CElementChemistryDB xraydb = pXrayDBMgr.GetElementChemistryDB();
+            List<CPosXrayClr> ches = new List<CPosXrayClr>();
+            foreach (COTSParticleClr part in Parts)
+            {
+                part.GetXray().SetIndex(part.GetParticleId());
+                part.GetXray().SetScanFieldId(part.GetFieldId());
+                ches.Add(part.GetXray());
+            }
+            xraydb.RemoveAllRows();
+            try
+            {
+                xraydb.SaveElementChemistriesList(ches);
+            }
+            catch(Exception ex)
+            {
+                MessageBox.Show(ex.ToString());
+                return false;
+            }
+            return true;
+        }
     }
 }

+ 60 - 59
OTSPartA_STDEditor/Form_Main.Designer.cs

@@ -28,21 +28,21 @@
         /// </summary>
         private void InitializeComponent()
         {
-            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();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form_Main));
             this.ribbonSeparator1 = new System.Windows.Forms.RibbonSeparator();
             this.ribbonTextBox1 = new System.Windows.Forms.RibbonTextBox();
@@ -424,50 +424,50 @@
             this.dockPanel1.Location = new System.Drawing.Point(0, 130);
             this.dockPanel1.Name = "dockPanel1";
             this.dockPanel1.Size = new System.Drawing.Size(1805, 660);
-            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.dockPanel1.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.dockPanel1.Skin = dockPanelSkin2;
             this.dockPanel1.TabIndex = 31;
             // 
             // ribbonOrbRecentItem1
@@ -609,6 +609,7 @@
             this.IsMdiContainer = true;
             this.Name = "Form_Main";
             this.ShowIcon = false;
+            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
             this.Text = "表达式编辑器";
             this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form_ConstantsEditor2_FormClosing);

+ 4 - 1
OTSPartA_STDEditor/STDEditor.Designer.cs

@@ -71,6 +71,7 @@
             this.comboBox_Elem1 = new System.Windows.Forms.ComboBox();
             this.comboBox_Elem = new System.Windows.Forms.ComboBox();
             this.comboBox_ImgProperty = new System.Windows.Forms.ComboBox();
+            this.helpProvider1 = new System.Windows.Forms.HelpProvider();
             this.tabSTDStandrad.SuspendLayout();
             this.tabSTD.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.dataGridView_SubElements)).BeginInit();
@@ -606,7 +607,7 @@
             this.comboBox_ImgProperty.FormattingEnabled = true;
             this.comboBox_ImgProperty.Location = new System.Drawing.Point(372, 25);
             this.comboBox_ImgProperty.Name = "comboBox_ImgProperty";
-            this.comboBox_ImgProperty.Size = new System.Drawing.Size(122, 20);
+            this.comboBox_ImgProperty.Size = new System.Drawing.Size(124, 20);
             this.comboBox_ImgProperty.TabIndex = 4;
             this.comboBox_ImgProperty.SelectedIndexChanged += new System.EventHandler(this.comboBox_ImgProperty_SelectedIndexChanged);
             // 
@@ -620,6 +621,7 @@
             this.CloseButtonVisible = false;
             this.Controls.Add(this.tabSTDStandrad);
             this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.HelpButton = true;
             this.Name = "STDEditor";
             this.ShowIcon = false;
             this.Text = "STDEditor";
@@ -685,5 +687,6 @@
         public System.Windows.Forms.DataGridView dataGridView_SubElements;
         private System.Windows.Forms.Button button_PeriodicTableSwitch;
         private System.Windows.Forms.Button button_del;
+        private System.Windows.Forms.HelpProvider helpProvider1;
     }
 }

+ 3 - 0
OTSPartA_STDEditor/STDEditor.resx

@@ -117,4 +117,7 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
+  <metadata name="helpProvider1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
+    <value>17, 17</value>
+  </metadata>
 </root>

+ 185 - 189
OTSSysMgrApp/ControllerSettingForm.Designer.cs

@@ -32,6 +32,18 @@
             System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ControllerSettingForm));
             this.tabSetting = new System.Windows.Forms.TabControl();
+            this.tabImage = new System.Windows.Forms.TabPage();
+            this.ddlDwellTime = new System.Windows.Forms.ComboBox();
+            this.groupBox2 = new System.Windows.Forms.GroupBox();
+            this.panel1 = new System.Windows.Forms.Panel();
+            this.pbImage = new System.Windows.Forms.PictureBox();
+            this.btnClear = new System.Windows.Forms.Button();
+            this.btnSaveImage = new System.Windows.Forms.Button();
+            this.btnDisplay = new System.Windows.Forms.Button();
+            this.tbRHeight = new System.Windows.Forms.TextBox();
+            this.tbRWidth = new System.Windows.Forms.TextBox();
+            this.lblDwellTime = new System.Windows.Forms.Label();
+            this.lblResolution = new System.Windows.Forms.Label();
             this.tabXRay = new System.Windows.Forms.TabPage();
             this.groupBox1 = new System.Windows.Forms.GroupBox();
             this.chartXRay = new System.Windows.Forms.DataVisualization.Charting.Chart();
@@ -45,20 +57,9 @@
             this.tbCollectionTime = new System.Windows.Forms.TextBox();
             this.label2 = new System.Windows.Forms.Label();
             this.lblCollectionTime = new System.Windows.Forms.Label();
-            this.tabImage = new System.Windows.Forms.TabPage();
-            this.ddlDwellTime = new System.Windows.Forms.ComboBox();
-            this.groupBox2 = new System.Windows.Forms.GroupBox();
-            this.panel1 = new System.Windows.Forms.Panel();
-            this.pbImage = new System.Windows.Forms.PictureBox();
-            this.btnClear = new System.Windows.Forms.Button();
-            this.btnSaveImage = new System.Windows.Forms.Button();
-            this.btnDisplay = new System.Windows.Forms.Button();
-            this.tbRHeight = new System.Windows.Forms.TextBox();
-            this.tbRWidth = new System.Windows.Forms.TextBox();
-            this.lblDwellTime = new System.Windows.Forms.Label();
-            this.lblResolution = new System.Windows.Forms.Label();
             this.tabImage2 = new System.Windows.Forms.TabPage();
             this.splitContainer1 = new System.Windows.Forms.SplitContainer();
+            this.btn_Recommendedconfiguration = new System.Windows.Forms.Button();
             this.label5 = new System.Windows.Forms.Label();
             this.cb_imageresolution = new System.Windows.Forms.ComboBox();
             this.label4 = new System.Windows.Forms.Label();
@@ -75,15 +76,14 @@
             this.pictureBox4 = new System.Windows.Forms.PictureBox();
             this.pictureBox2 = new System.Windows.Forms.PictureBox();
             this.pictureBox1 = new System.Windows.Forms.PictureBox();
-            this.btn_Recommendedconfiguration = new System.Windows.Forms.Button();
             this.tabSetting.SuspendLayout();
-            this.tabXRay.SuspendLayout();
-            this.groupBox1.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.chartXRay)).BeginInit();
             this.tabImage.SuspendLayout();
             this.groupBox2.SuspendLayout();
             this.panel1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pbImage)).BeginInit();
+            this.tabXRay.SuspendLayout();
+            this.groupBox1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.chartXRay)).BeginInit();
             this.tabImage2.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
             this.splitContainer1.Panel1.SuspendLayout();
@@ -108,6 +108,159 @@
             this.tabSetting.Size = new System.Drawing.Size(835, 736);
             this.tabSetting.TabIndex = 2;
             // 
+            // tabImage
+            // 
+            this.tabImage.Controls.Add(this.ddlDwellTime);
+            this.tabImage.Controls.Add(this.groupBox2);
+            this.tabImage.Controls.Add(this.btnSaveImage);
+            this.tabImage.Controls.Add(this.btnDisplay);
+            this.tabImage.Controls.Add(this.tbRHeight);
+            this.tabImage.Controls.Add(this.tbRWidth);
+            this.tabImage.Controls.Add(this.lblDwellTime);
+            this.tabImage.Controls.Add(this.lblResolution);
+            this.tabImage.Location = new System.Drawing.Point(4, 22);
+            this.tabImage.Margin = new System.Windows.Forms.Padding(2);
+            this.tabImage.Name = "tabImage";
+            this.tabImage.Padding = new System.Windows.Forms.Padding(2);
+            this.tabImage.Size = new System.Drawing.Size(827, 710);
+            this.tabImage.TabIndex = 1;
+            this.tabImage.Text = "BSE测试";
+            this.tabImage.UseVisualStyleBackColor = true;
+            // 
+            // ddlDwellTime
+            // 
+            this.ddlDwellTime.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.ddlDwellTime.FormattingEnabled = true;
+            this.ddlDwellTime.Items.AddRange(new object[] {
+            "4",
+            "8",
+            "16",
+            "32",
+            "64",
+            "128",
+            "256"});
+            this.ddlDwellTime.Location = new System.Drawing.Point(266, 16);
+            this.ddlDwellTime.Margin = new System.Windows.Forms.Padding(2);
+            this.ddlDwellTime.Name = "ddlDwellTime";
+            this.ddlDwellTime.Size = new System.Drawing.Size(82, 20);
+            this.ddlDwellTime.TabIndex = 0;
+            // 
+            // groupBox2
+            // 
+            this.groupBox2.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.groupBox2.BackColor = System.Drawing.Color.White;
+            this.groupBox2.Controls.Add(this.panel1);
+            this.groupBox2.Controls.Add(this.btnClear);
+            this.groupBox2.Location = new System.Drawing.Point(6, 45);
+            this.groupBox2.Margin = new System.Windows.Forms.Padding(2);
+            this.groupBox2.Name = "groupBox2";
+            this.groupBox2.Padding = new System.Windows.Forms.Padding(2);
+            this.groupBox2.Size = new System.Drawing.Size(822, 665);
+            this.groupBox2.TabIndex = 13;
+            this.groupBox2.TabStop = false;
+            this.groupBox2.Text = "图像显示";
+            // 
+            // panel1
+            // 
+            this.panel1.AutoScroll = true;
+            this.panel1.Controls.Add(this.pbImage);
+            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.panel1.Location = new System.Drawing.Point(2, 16);
+            this.panel1.Margin = new System.Windows.Forms.Padding(2);
+            this.panel1.Name = "panel1";
+            this.panel1.Size = new System.Drawing.Size(818, 647);
+            this.panel1.TabIndex = 2;
+            // 
+            // pbImage
+            // 
+            this.pbImage.BackColor = System.Drawing.Color.White;
+            this.pbImage.Dock = System.Windows.Forms.DockStyle.Fill;
+            this.pbImage.Location = new System.Drawing.Point(0, 0);
+            this.pbImage.Margin = new System.Windows.Forms.Padding(2);
+            this.pbImage.Name = "pbImage";
+            this.pbImage.Size = new System.Drawing.Size(818, 647);
+            this.pbImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
+            this.pbImage.TabIndex = 0;
+            this.pbImage.TabStop = false;
+            // 
+            // btnClear
+            // 
+            this.btnClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.btnClear.Location = new System.Drawing.Point(750, 77);
+            this.btnClear.Margin = new System.Windows.Forms.Padding(2);
+            this.btnClear.Name = "btnClear";
+            this.btnClear.Size = new System.Drawing.Size(67, 50);
+            this.btnClear.TabIndex = 1;
+            this.btnClear.Text = "Clear";
+            this.btnClear.UseVisualStyleBackColor = true;
+            this.btnClear.Visible = false;
+            this.btnClear.Click += new System.EventHandler(this.btnClear_Click);
+            // 
+            // btnSaveImage
+            // 
+            this.btnSaveImage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.btnSaveImage.Location = new System.Drawing.Point(550, 8);
+            this.btnSaveImage.Margin = new System.Windows.Forms.Padding(2);
+            this.btnSaveImage.Name = "btnSaveImage";
+            this.btnSaveImage.Size = new System.Drawing.Size(67, 33);
+            this.btnSaveImage.TabIndex = 4;
+            this.btnSaveImage.Text = "保存图片";
+            this.btnSaveImage.UseVisualStyleBackColor = true;
+            this.btnSaveImage.Visible = false;
+            this.btnSaveImage.Click += new System.EventHandler(this.btnSaveImage_Click);
+            // 
+            // btnDisplay
+            // 
+            this.btnDisplay.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.btnDisplay.Location = new System.Drawing.Point(756, 8);
+            this.btnDisplay.Margin = new System.Windows.Forms.Padding(2);
+            this.btnDisplay.Name = "btnDisplay";
+            this.btnDisplay.Size = new System.Drawing.Size(67, 33);
+            this.btnDisplay.TabIndex = 5;
+            this.btnDisplay.Text = "图像采集";
+            this.btnDisplay.UseVisualStyleBackColor = true;
+            this.btnDisplay.Click += new System.EventHandler(this.btnDisplay_Click);
+            // 
+            // tbRHeight
+            // 
+            this.tbRHeight.Location = new System.Drawing.Point(119, 15);
+            this.tbRHeight.Margin = new System.Windows.Forms.Padding(2);
+            this.tbRHeight.Name = "tbRHeight";
+            this.tbRHeight.Size = new System.Drawing.Size(48, 21);
+            this.tbRHeight.TabIndex = 2;
+            this.tbRHeight.Text = "768";
+            // 
+            // tbRWidth
+            // 
+            this.tbRWidth.Location = new System.Drawing.Point(66, 15);
+            this.tbRWidth.Margin = new System.Windows.Forms.Padding(2);
+            this.tbRWidth.Name = "tbRWidth";
+            this.tbRWidth.Size = new System.Drawing.Size(48, 21);
+            this.tbRWidth.TabIndex = 1;
+            this.tbRWidth.Text = "1024";
+            // 
+            // lblDwellTime
+            // 
+            this.lblDwellTime.AutoSize = true;
+            this.lblDwellTime.Location = new System.Drawing.Point(189, 19);
+            this.lblDwellTime.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.lblDwellTime.Name = "lblDwellTime";
+            this.lblDwellTime.Size = new System.Drawing.Size(53, 12);
+            this.lblDwellTime.TabIndex = 10;
+            this.lblDwellTime.Text = "采集时间";
+            // 
+            // lblResolution
+            // 
+            this.lblResolution.AutoSize = true;
+            this.lblResolution.Location = new System.Drawing.Point(-3, 19);
+            this.lblResolution.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.lblResolution.Name = "lblResolution";
+            this.lblResolution.Size = new System.Drawing.Size(41, 12);
+            this.lblResolution.TabIndex = 10;
+            this.lblResolution.Text = "分辨率";
+            // 
             // tabXRay
             // 
             this.tabXRay.Controls.Add(this.groupBox1);
@@ -282,159 +435,6 @@
             this.lblCollectionTime.TabIndex = 0;
             this.lblCollectionTime.Text = "采集时间";
             // 
-            // tabImage
-            // 
-            this.tabImage.Controls.Add(this.ddlDwellTime);
-            this.tabImage.Controls.Add(this.groupBox2);
-            this.tabImage.Controls.Add(this.btnSaveImage);
-            this.tabImage.Controls.Add(this.btnDisplay);
-            this.tabImage.Controls.Add(this.tbRHeight);
-            this.tabImage.Controls.Add(this.tbRWidth);
-            this.tabImage.Controls.Add(this.lblDwellTime);
-            this.tabImage.Controls.Add(this.lblResolution);
-            this.tabImage.Location = new System.Drawing.Point(4, 22);
-            this.tabImage.Margin = new System.Windows.Forms.Padding(2);
-            this.tabImage.Name = "tabImage";
-            this.tabImage.Padding = new System.Windows.Forms.Padding(2);
-            this.tabImage.Size = new System.Drawing.Size(827, 710);
-            this.tabImage.TabIndex = 1;
-            this.tabImage.Text = "BSE测试";
-            this.tabImage.UseVisualStyleBackColor = true;
-            // 
-            // ddlDwellTime
-            // 
-            this.ddlDwellTime.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.ddlDwellTime.FormattingEnabled = true;
-            this.ddlDwellTime.Items.AddRange(new object[] {
-            "4",
-            "8",
-            "16",
-            "32",
-            "64",
-            "128",
-            "256"});
-            this.ddlDwellTime.Location = new System.Drawing.Point(266, 16);
-            this.ddlDwellTime.Margin = new System.Windows.Forms.Padding(2);
-            this.ddlDwellTime.Name = "ddlDwellTime";
-            this.ddlDwellTime.Size = new System.Drawing.Size(82, 20);
-            this.ddlDwellTime.TabIndex = 0;
-            // 
-            // groupBox2
-            // 
-            this.groupBox2.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.groupBox2.BackColor = System.Drawing.Color.White;
-            this.groupBox2.Controls.Add(this.panel1);
-            this.groupBox2.Controls.Add(this.btnClear);
-            this.groupBox2.Location = new System.Drawing.Point(6, 45);
-            this.groupBox2.Margin = new System.Windows.Forms.Padding(2);
-            this.groupBox2.Name = "groupBox2";
-            this.groupBox2.Padding = new System.Windows.Forms.Padding(2);
-            this.groupBox2.Size = new System.Drawing.Size(822, 665);
-            this.groupBox2.TabIndex = 13;
-            this.groupBox2.TabStop = false;
-            this.groupBox2.Text = "图像显示";
-            // 
-            // panel1
-            // 
-            this.panel1.AutoScroll = true;
-            this.panel1.Controls.Add(this.pbImage);
-            this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.panel1.Location = new System.Drawing.Point(2, 16);
-            this.panel1.Margin = new System.Windows.Forms.Padding(2);
-            this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(818, 647);
-            this.panel1.TabIndex = 2;
-            // 
-            // pbImage
-            // 
-            this.pbImage.BackColor = System.Drawing.Color.White;
-            this.pbImage.Dock = System.Windows.Forms.DockStyle.Fill;
-            this.pbImage.Location = new System.Drawing.Point(0, 0);
-            this.pbImage.Margin = new System.Windows.Forms.Padding(2);
-            this.pbImage.Name = "pbImage";
-            this.pbImage.Size = new System.Drawing.Size(818, 647);
-            this.pbImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
-            this.pbImage.TabIndex = 0;
-            this.pbImage.TabStop = false;
-            // 
-            // btnClear
-            // 
-            this.btnClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnClear.Location = new System.Drawing.Point(750, 77);
-            this.btnClear.Margin = new System.Windows.Forms.Padding(2);
-            this.btnClear.Name = "btnClear";
-            this.btnClear.Size = new System.Drawing.Size(67, 50);
-            this.btnClear.TabIndex = 1;
-            this.btnClear.Text = "Clear";
-            this.btnClear.UseVisualStyleBackColor = true;
-            this.btnClear.Visible = false;
-            this.btnClear.Click += new System.EventHandler(this.btnClear_Click);
-            // 
-            // btnSaveImage
-            // 
-            this.btnSaveImage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnSaveImage.Location = new System.Drawing.Point(550, 8);
-            this.btnSaveImage.Margin = new System.Windows.Forms.Padding(2);
-            this.btnSaveImage.Name = "btnSaveImage";
-            this.btnSaveImage.Size = new System.Drawing.Size(67, 33);
-            this.btnSaveImage.TabIndex = 4;
-            this.btnSaveImage.Text = "保存图片";
-            this.btnSaveImage.UseVisualStyleBackColor = true;
-            this.btnSaveImage.Visible = false;
-            this.btnSaveImage.Click += new System.EventHandler(this.btnSaveImage_Click);
-            // 
-            // btnDisplay
-            // 
-            this.btnDisplay.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
-            this.btnDisplay.Location = new System.Drawing.Point(756, 8);
-            this.btnDisplay.Margin = new System.Windows.Forms.Padding(2);
-            this.btnDisplay.Name = "btnDisplay";
-            this.btnDisplay.Size = new System.Drawing.Size(67, 33);
-            this.btnDisplay.TabIndex = 5;
-            this.btnDisplay.Text = "图像采集";
-            this.btnDisplay.UseVisualStyleBackColor = true;
-            this.btnDisplay.Click += new System.EventHandler(this.btnDisplay_Click);
-            // 
-            // tbRHeight
-            // 
-            this.tbRHeight.Location = new System.Drawing.Point(119, 15);
-            this.tbRHeight.Margin = new System.Windows.Forms.Padding(2);
-            this.tbRHeight.Name = "tbRHeight";
-            this.tbRHeight.Size = new System.Drawing.Size(48, 21);
-            this.tbRHeight.TabIndex = 2;
-            this.tbRHeight.Text = "768";
-            // 
-            // tbRWidth
-            // 
-            this.tbRWidth.Location = new System.Drawing.Point(66, 15);
-            this.tbRWidth.Margin = new System.Windows.Forms.Padding(2);
-            this.tbRWidth.Name = "tbRWidth";
-            this.tbRWidth.Size = new System.Drawing.Size(48, 21);
-            this.tbRWidth.TabIndex = 1;
-            this.tbRWidth.Text = "1024";
-            // 
-            // lblDwellTime
-            // 
-            this.lblDwellTime.AutoSize = true;
-            this.lblDwellTime.Location = new System.Drawing.Point(189, 19);
-            this.lblDwellTime.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.lblDwellTime.Name = "lblDwellTime";
-            this.lblDwellTime.Size = new System.Drawing.Size(53, 12);
-            this.lblDwellTime.TabIndex = 10;
-            this.lblDwellTime.Text = "采集时间";
-            // 
-            // lblResolution
-            // 
-            this.lblResolution.AutoSize = true;
-            this.lblResolution.Location = new System.Drawing.Point(-3, 19);
-            this.lblResolution.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
-            this.lblResolution.Name = "lblResolution";
-            this.lblResolution.Size = new System.Drawing.Size(41, 12);
-            this.lblResolution.TabIndex = 10;
-            this.lblResolution.Text = "分辨率";
-            // 
             // tabImage2
             // 
             this.tabImage2.Controls.Add(this.splitContainer1);
@@ -475,9 +475,20 @@
             this.splitContainer1.Panel2.Controls.Add(this.pictureBox2);
             this.splitContainer1.Panel2.Controls.Add(this.pictureBox1);
             this.splitContainer1.Size = new System.Drawing.Size(813, 695);
-            this.splitContainer1.SplitterDistance = 82;
+            this.splitContainer1.SplitterDistance = 81;
             this.splitContainer1.TabIndex = 3;
             // 
+            // btn_Recommendedconfiguration
+            // 
+            this.btn_Recommendedconfiguration.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
+            this.btn_Recommendedconfiguration.Location = new System.Drawing.Point(259, 41);
+            this.btn_Recommendedconfiguration.Name = "btn_Recommendedconfiguration";
+            this.btn_Recommendedconfiguration.Size = new System.Drawing.Size(75, 23);
+            this.btn_Recommendedconfiguration.TabIndex = 16;
+            this.btn_Recommendedconfiguration.Text = "推荐配置";
+            this.btn_Recommendedconfiguration.UseVisualStyleBackColor = true;
+            this.btn_Recommendedconfiguration.Click += new System.EventHandler(this.btn_Recommendedconfiguration_Click);
+            // 
             // label5
             // 
             this.label5.AutoSize = true;
@@ -595,7 +606,6 @@
             this.pictureBox3.Margin = new System.Windows.Forms.Padding(2);
             this.pictureBox3.Name = "pictureBox3";
             this.pictureBox3.Size = new System.Drawing.Size(400, 300);
-            this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
             this.pictureBox3.TabIndex = 4;
             this.pictureBox3.TabStop = false;
             // 
@@ -607,7 +617,6 @@
             this.pictureBox4.Margin = new System.Windows.Forms.Padding(2);
             this.pictureBox4.Name = "pictureBox4";
             this.pictureBox4.Size = new System.Drawing.Size(400, 300);
-            this.pictureBox4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
             this.pictureBox4.TabIndex = 3;
             this.pictureBox4.TabStop = false;
             // 
@@ -619,7 +628,6 @@
             this.pictureBox2.Margin = new System.Windows.Forms.Padding(2);
             this.pictureBox2.Name = "pictureBox2";
             this.pictureBox2.Size = new System.Drawing.Size(400, 300);
-            this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
             this.pictureBox2.TabIndex = 2;
             this.pictureBox2.TabStop = false;
             // 
@@ -631,21 +639,9 @@
             this.pictureBox1.Margin = new System.Windows.Forms.Padding(2);
             this.pictureBox1.Name = "pictureBox1";
             this.pictureBox1.Size = new System.Drawing.Size(400, 300);
-            this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
             this.pictureBox1.TabIndex = 1;
             this.pictureBox1.TabStop = false;
             // 
-            // btn_Recommendedconfiguration
-            // 
-            this.btn_Recommendedconfiguration.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
-            this.btn_Recommendedconfiguration.Location = new System.Drawing.Point(259, 41);
-            this.btn_Recommendedconfiguration.Name = "btn_Recommendedconfiguration";
-            this.btn_Recommendedconfiguration.Size = new System.Drawing.Size(75, 23);
-            this.btn_Recommendedconfiguration.TabIndex = 16;
-            this.btn_Recommendedconfiguration.Text = "推荐配置";
-            this.btn_Recommendedconfiguration.UseVisualStyleBackColor = true;
-            this.btn_Recommendedconfiguration.Click += new System.EventHandler(this.btn_Recommendedconfiguration_Click);
-            // 
             // ControllerSettingForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -662,15 +658,15 @@
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ControllerSettingForm_FormClosing);
             this.Load += new System.EventHandler(this.ControllerSettingForm_Load);
             this.tabSetting.ResumeLayout(false);
-            this.tabXRay.ResumeLayout(false);
-            this.tabXRay.PerformLayout();
-            this.groupBox1.ResumeLayout(false);
-            ((System.ComponentModel.ISupportInitialize)(this.chartXRay)).EndInit();
             this.tabImage.ResumeLayout(false);
             this.tabImage.PerformLayout();
             this.groupBox2.ResumeLayout(false);
             this.panel1.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.pbImage)).EndInit();
+            this.tabXRay.ResumeLayout(false);
+            this.tabXRay.PerformLayout();
+            this.groupBox1.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.chartXRay)).EndInit();
             this.tabImage2.ResumeLayout(false);
             this.splitContainer1.Panel1.ResumeLayout(false);
             this.splitContainer1.Panel1.PerformLayout();

+ 13 - 3
OTSSysMgrApp/ControllerSettingForm.cs

@@ -1177,6 +1177,11 @@ namespace OTSSysMgrApp
             pictureBox3.Image = null;
             pictureBox4.Image = null;
 
+            pictureBox1.BorderStyle = BorderStyle.None;
+            pictureBox2.BorderStyle = BorderStyle.None;
+            pictureBox3.BorderStyle = BorderStyle.None;
+            pictureBox4.BorderStyle = BorderStyle.None;
+
             btn_continuousshot.Enabled = false;
             btn_confirm.Enabled = false;
             this.Refresh();
@@ -1222,9 +1227,9 @@ namespace OTSSysMgrApp
                 height = Convert.ToInt32(cb_imageresolution.Text.Split('*')[1]);
 
                 pictureBox1.Height = pictureBox1.Width * height / width;
-                pictureBox2.Height = pictureBox1.Width * height / width;
-                pictureBox3.Height = pictureBox1.Width * height / width;
-                pictureBox4.Height = pictureBox1.Width * height / width;
+                pictureBox2.Height = pictureBox1.Height;
+                pictureBox3.Height = pictureBox1.Height;
+                pictureBox4.Height = pictureBox1.Height;
                 pictureBox2.Location = new Point(pictureBox1.Location.X + pictureBox1.Width, pictureBox1.Location.Y);
                 pictureBox3.Location = new Point(pictureBox1.Location.X, pictureBox1.Location.Y + pictureBox1.Height);
                 pictureBox4.Location = new Point(pictureBox1.Location.X + pictureBox1.Width, pictureBox1.Location.Y + pictureBox1.Height);
@@ -1304,6 +1309,11 @@ namespace OTSSysMgrApp
             catch (Exception ex)
             {
                 log.Error("continuousshot--错误信息:" + ex.ToString());
+
+                pictureBox1.BorderStyle = BorderStyle.FixedSingle;
+                pictureBox2.BorderStyle = BorderStyle.FixedSingle;
+                pictureBox3.BorderStyle = BorderStyle.FixedSingle;
+                pictureBox4.BorderStyle = BorderStyle.FixedSingle;
             }
             finally
             {