Browse Source

Merge branch 'release2.2' of http://172.16.3.77:10080/gaoshipeng/OTS2_0 into release2.2

zhangjiaxin 4 years ago
parent
commit
a66629c0b7
23 changed files with 168 additions and 305 deletions
  1. 5 4
      OTSCPP/OTSImagePro/OTSImageProcess.cpp
  2. 14 0
      OTSCleanReportApp/frmReportApp.resx
  3. 1 1
      OTSIncAMeasureApp/0-OTSModel/Measure/1-OTSInclution/SmplMeasureInclution.cs
  4. 23 13
      OTSIncAMeasureApp/0-OTSModel/Measure/3-MeasureFlow/CSmplMeasure.cs
  5. 17 12
      OTSIncAMeasureApp/0-OTSModel/Measure/BSEPicData/COTSFieldData.cs
  6. 1 1
      OTSIncAMeasureApp/0-OTSModel/Measure/ParticleData/MergedParticles/MergeParticleDB.cs
  7. 2 1
      OTSIncAMeasureApp/1-OTSMeasure/CMeasureThreadWrapper.cs
  8. 5 8
      OTSIncAMeasureApp/1-OTSMeasure/OTSMeasureDisplayResult.cs
  9. 2 1
      OTSIncAMeasureApp/2-OTSMeasureParamManage/COTSMeasureParam.cs
  10. 2 1
      OTSIncAMeasureApp/3-OTSDisplaySourceGridData/OTSDisplaySampleGrid.cs
  11. 2 1
      OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/SEMDATAFieldManage.cs
  12. 2 1
      OTSIncAMeasureApp/5-OTSMeasureStatuImageFun/OTSBSEImageFun.cs
  13. 4 8
      OTSIncAMeasureApp/5-OTSMeasureStatuImageFun/OTSImageData.cs
  14. 2 1
      OTSIncAMeasureApp/5-OTSMeasureStatuImageFun/ToolWindow.cs
  15. 2 1
      OTSIncAMeasureApp/6-OTSDisplayTreeViewData/OTSDisplayTreeBase.cs
  16. 2 1
      OTSIncAMeasureApp/7-OTSProgMgrInfo/ProgMgrInfoForm.cs
  17. 2 1
      OTSIncAMeasureApp/ServiceCenter/DTLBase/CSQLiteDBStore.cs
  18. 4 4
      OTSIncAMeasureApp/ServiceCenter/DTLBase/SQliteHelper.cs
  19. 0 1
      OTSIncAReportApp/Control_Grids/ParticlesGridDevidePage.Designer.cs
  20. 33 220
      OTSIncAReportApp/Control_Grids/ParticlesGridDevidePage.cs
  21. 0 11
      OTSIncAReportApp/frmMeasureRstMgr.cs
  22. 30 13
      OTSIncAReportApp/frmReportApp.Designer.cs
  23. 13 0
      OTSIncAReportApp/frmReportApp.cs

+ 5 - 4
OTSCPP/OTSImagePro/OTSImageProcess.cpp

@@ -2172,7 +2172,8 @@ namespace OTSIMGPROC
 			auto newPart = COTSParticlePtr(new COTSParticle());
 			COTSSegmentsList newSegs;
 			auto p = pair.first;
-
+			newPart->SetAbsolutePos(p->GetAbsolutPos());
+			
 			//firstly,we sum up all the merged particles's area and get the represent string.
 			std::string partsStr = std::to_string(p->GetFieldId()) + ":" + std::to_string(p->GetAnalysisId());
 			double allPartArea = p->GetArea();//Get the first particle's area.
@@ -2204,12 +2205,12 @@ namespace OTSIMGPROC
 				}
 				int fldWidth = allFields[0]->Width;
 				int fldHeight = allFields[0]->Height;
-				CPoint fldLeftUpPos = CPoint(myFldPos.x + fldWidth / 2 * pixelSize, myFldPos.y + fldHeight / 2 * pixelSize);
+				CPoint fldLeftUpPos = CPoint(myFldPos.x + fldWidth / 2 , myFldPos.y + fldHeight / 2 );
 				for (auto s : subp->GetFeature()->GetSegmentsList())
 				{
 					COTSSegmentPtr newseg = COTSSegmentPtr(new COTSSegment());
-					newseg->SetStart(s->GetStart() * pixelSize + fldLeftUpPos.x);
-					newseg->SetHeight((0 - s->GetHeight() * pixelSize) + fldLeftUpPos.y);//the coordinate system of segment in a field is different with the OTS coordinate system.OTS system's y axis is upward positive ,yet the field is downward positive.
+					newseg->SetStart(s->GetStart()  + fldLeftUpPos.x);
+					newseg->SetHeight((0 - s->GetHeight()) + fldLeftUpPos.y);//the coordinate system of segment in a field is different with the OTS coordinate system.OTS system's y axis is upward positive ,yet the field is downward positive.
 					newseg->SetLength(s->GetLength());
 					newSegs.push_back(newseg);
 				}

+ 14 - 0
OTSCleanReportApp/frmReportApp.resx

@@ -185,6 +185,20 @@
     <value>
         iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAW
         JQAAFiUBSVIk8AAAABNJREFUOE9jGAWjYBSMAjBgYAAABBAAAadEfGMAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="ribbonOrbMenuItem1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+        YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAAaSURBVFhH7cEBAQAAAIIg/69uSEAAAADAuRoQIAABnXhJ
+        QwAAAABJRU5ErkJggg==
+</value>
+  </data>
+  <data name="ribbonOrbMenuItem1.SmallImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+        YQUAAAAJcEhZcwAAFiUAABYlAUlSJPAAAAATSURBVDhPYxgFo2AUjAIwYGAAAAQQAAGnRHxjAAAAAElF
+        TkSuQmCC
 </value>
   </data>
   <data name="ribbonOrbOptionButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">

+ 1 - 1
OTSIncAMeasureApp/0-OTSModel/Measure/1-OTSInclution/SmplMeasureInclution.cs

@@ -149,7 +149,7 @@ namespace OTSModelSharp
             foreach (var p in curFldData.ListAnalysisParticles)
             {
                
-                Point fldOtsPos = new Point(curFldData.PoiPos.X, curFldData.PoiPos.Y);
+                Point fldOtsPos = new Point(curFldData.PoiPos.X, curFldData.PoiPos.Y);//take the field position as the particle's position instead
                 Point semPos = new Point();
                 pCSEMStageData.ConverOTSToSEMPoint(fldOtsPos, ref semPos);
                 p.SetAbsolutPos(semPos);

+ 23 - 13
OTSIncAMeasureApp/0-OTSModel/Measure/3-MeasureFlow/CSmplMeasure.cs

@@ -22,7 +22,7 @@ namespace OTSModelSharp
 
     class CSmplMeasure
     {
-        protected static NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
+        protected static NLog.Logger log ;
         protected bool bSaveThreadWorking;
         protected System.Threading.Thread m_thread_ptr;
    
@@ -42,11 +42,10 @@ namespace OTSModelSharp
         protected IClassifyEngine m_classifyEngine;
         public CSmplMeasure()
         {
-            if (log == null)
-            {
+          
                 log = NLog.LogManager.GetCurrentClassLogger();
 
-            }
+           
             m_pSampleRstFile = new CSmplMsrResult();
             m_SemHardwareMgr = new SemController();
             m_ScanHardwareMgr = new ScanController();
@@ -57,11 +56,10 @@ namespace OTSModelSharp
 
         public CSmplMeasure( string a_strWorkingFolder, COTSSample a_pSample)
         {
-            if (log == null)
-            {
+          
                 log = NLog.LogManager.GetCurrentClassLogger();
 
-            }
+          
             m_strWorkingFolder = a_strWorkingFolder;
             m_pSampleRstFile = new CSmplMsrResult( a_strWorkingFolder,  a_pSample);// new CSmplMsrResultFile(m_strWorkingFolder,a_pSample);
             m_SemHardwareMgr = new SemController();
@@ -750,13 +748,14 @@ namespace OTSModelSharp
                     Thread.Sleep(100);
                 }
                 //merging particles
-                log.Info("Merging big particles on the field edge!");
+                log.Info("Merging big particles which are crossing the field edge!");
                 CImageHandler imgpro = new CImageHandler();
                 int scanfldsize = m_Sample.GetSEMDataMsr().GetScanFieldSize();
                 List<COTSParticleClr> mergedParticles = new List<COTSParticleClr>();
-                imgpro.MergeBigBoundaryParticles(m_pSampleRstFile.GetFieldData(), m_Sample.CalculatePixelSize(), scanfldsize, m_Sample.GetResolutionSize(), ref mergedParticles);
-
-                
+                double pixelSize = m_Sample.CalculatePixelSize();
+                imgpro.MergeBigBoundaryParticles(m_pSampleRstFile.GetFieldData(), pixelSize, scanfldsize, m_Sample.GetResolutionSize(), ref mergedParticles);
+               
+                CalculateMergedPartProperty(mergedParticles,pixelSize);
 
                 ClassifyMergedParticles(mergedParticles);
                 log.Warn("begin particle data db saving...");
@@ -778,7 +777,18 @@ namespace OTSModelSharp
                 m_pMsrThread.SendMessageToMeasureApp(MsgSmplEnd);
             }
     }
-      
+
+        private void CalculateMergedPartProperty(List<COTSParticleClr> mergedParticles,double pixelSize)
+        {
+           var m_ImagePro = new CImageHandler();
+            foreach (COTSParticleClr part in mergedParticles)
+            {
+
+                m_ImagePro.CalParticleImageProp(part, pixelSize);
+            }
+          
+        }
+
         public void DoHolePreview(int a_nHoleID)
         {
             using (AutoResetSEMControl autoReset = new AutoResetSEMControl(this))
@@ -1051,7 +1061,7 @@ namespace OTSModelSharp
  
             foreach (COTSParticleClr part in mergedParts)
             {
-                mergedpartdb.SaveAParticle(part, part.GetXray(), new System.Drawing.Point(0, 0));
+                mergedpartdb.SaveAParticle(part, part.GetXray(), (Point)part.GetAbsolutPos());
             }
             CPosXrayDBMgr pXrayDBMgr = pDBFileMgr.GetPosXrayDBMgr();
             CElementChemistryDB xraydb = pXrayDBMgr.GetElementChemistryDB();

+ 17 - 12
OTSIncAMeasureApp/0-OTSModel/Measure/BSEPicData/COTSFieldData.cs

@@ -15,7 +15,7 @@ namespace OTSModelSharp
    using  COTSFieldDataList = List<COTSFieldData>;
    public class COTSFieldData
     {
-        protected static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
+        protected  NLog.Logger log ;
         // ID
         int m_nID;
 
@@ -45,6 +45,7 @@ namespace OTSModelSharp
 
         public COTSFieldData(CBSEImgClr a_pBSEImg, double a_dPixelSize)
         {
+            log = NLog.LogManager.GetCurrentClassLogger();
             Init();
             m_pBSEImg = a_pBSEImg;
             m_pixelSize = a_dPixelSize;
@@ -54,6 +55,7 @@ namespace OTSModelSharp
         }
         public COTSFieldData()
         {
+            log = NLog.LogManager.GetCurrentClassLogger();
             //m_pBSEImg = a_pBSEImg;
             Init();
         }
@@ -97,7 +99,7 @@ namespace OTSModelSharp
             if (a_pBSEImg == null)
             {
                 // invalid BSE image.
-                logger.Error("SetBSEImage: invalid BSE image.");
+                log.Error("SetBSEImage: invalid BSE image.");
                 return;
             }
             m_pBSEImg = a_pBSEImg;
@@ -145,7 +147,7 @@ namespace OTSModelSharp
             int tooSmallnum = 0;
          
             int overSizenum = 0;
-            logger.Info("Total Particles: " + listParticles.Count);
+            log.Info("Total Particles: " + listParticles.Count);
             foreach (COTSParticleClr pParticle in listParticles)
             {
                 // get particle area 
@@ -154,10 +156,8 @@ namespace OTSModelSharp
                 pParticle.SetArea(dPartArea);
                 // get average gray level 
                 int nAveGrayLevel = pParticle.GetAveGray();
-                // set particle tag id
-                pParticle.SetTagId(nTagId++);
-                // set field id
-                pParticle.SetFieldId(GetId());
+            
+            
                 // oversize particles
                 if (dPartArea > (double)dAreaHigh)
                 {
@@ -172,15 +172,20 @@ namespace OTSModelSharp
                     tooSmallnum += 1;
                     continue;
                 }
+                // set particle tag id
+                pParticle.SetTagId(nTagId++);
+                // set field id
+                pParticle.SetFieldId(GetId());
                 // add the particle into the output particles list
                 pParticle.SetType((int)otsdataconst.OTS_PARTCLE_TYPE.NO_ANALYSIS_X_RAY);
                 pParticle.SetTypeName("Not Identified");
-                pParticle.SetAnalysisId(nAnalysisPartId);
+              
+                pParticle.SetAnalysisId(nAnalysisPartId++);
                 m_listAnalysisParticles.Add(pParticle);
-                ++nAnalysisPartId;
+               
             }
-            logger.Info("TooSmall Particles (<"+ dAreaLow .ToString("f2") + "): " + tooSmallnum);
-            logger.Info("OverSize Particles (>"+ dAreaHigh.ToString("f2") + "): " + overSizenum);
+            log.Info("TooSmall Particles (<"+ dAreaLow .ToString("f2") + "): " + tooSmallnum);
+            log.Info("OverSize Particles (>"+ dAreaHigh.ToString("f2") + "): " + overSizenum);
 
         }
        
@@ -256,7 +261,7 @@ namespace OTSModelSharp
 
             return m_nID == a_oSource.m_nID &&
                 PoiPos == a_oSource.PoiPos;
-                //m_strFieldFileFolder==a_oSource.m_strFieldFileFolder;
+              
         }
 
         // destructor

+ 1 - 1
OTSIncAMeasureApp/0-OTSModel/Measure/ParticleData/MergedParticles/MergeParticleDB.cs

@@ -23,7 +23,7 @@ namespace OTSModelSharp
 		var tableInfoPtr = GetTableInfo();		
 		var datastorePtr = GetDatastore();
             Rectangle prec = (Rectangle)a_pParticle.GetParticleRect();
-            System.Drawing.Point pos = (System.Drawing.Point)a_pParticle.GetXRayPos();
+            System.Drawing.Point pos = (System.Drawing.Point)a_pParticle.GetAbsolutPos();
             String sInsertFormat = tableInfoPtr.GetInsertCommandFormatString(true);
         String sSQLCommand = String.Format(sInsertFormat,
             a_pParticle.GetFieldId(),

+ 2 - 1
OTSIncAMeasureApp/1-OTSMeasure/CMeasureThreadWrapper.cs

@@ -23,12 +23,13 @@ namespace OTSMeasureApp
         public static int DoRunType = 1;
         public static int m_HoleID;
         public static CDomain c_DomainMessure;
-        NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
+        NLog.Logger log ;
         #endregion
         COTSMsrPrjResultData m_ProjData;
         #region 构造方法
         public CMeasureThreadWrapper(OTSIncAMeasureAppForm MeasureApp)
         {
+            log = NLog.LogManager.GetCurrentClassLogger();
             m_ProjData = MeasureApp.m_ProjData;
             m_MeasureApp = MeasureApp;
             m_bgWorker = new BackgroundWorker();

+ 5 - 8
OTSIncAMeasureApp/1-OTSMeasure/OTSMeasureDisplayResult.cs

@@ -17,9 +17,10 @@ namespace OTSMeasureApp
 {
     class OTSMeasureDisplayResult
     {
-        NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
+        NLog.Logger log ;
         public enum ProgressState
         {
+           
             MeasureCheckReport = 1,
             MeasureResult = 2
         }
@@ -55,8 +56,8 @@ namespace OTSMeasureApp
         #region 构造方法
         public OTSMeasureDisplayResult( OTSIncAMeasureAppForm m_MeasureApps, BackgroundWorker a_bgWorker)
         {
-            try
-            {
+            log = NLog.LogManager.GetCurrentClassLogger();
+          
                 m_MeasureApp = m_MeasureApps;
                
                 m_OTSSamplespaceWindow = m_MeasureApps.m_SamplepaceWindow;
@@ -76,11 +77,7 @@ namespace OTSMeasureApp
                 m_bgWorker.ProgressChanged += new ProgressChangedEventHandler(backgroundWorker_ProgressChanged);
                 m_bgWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker_RunWorkerCompleted);
               
-            }
-            catch (Exception ex)
-            {
-                log.Error("OTSIncAMeasureApp_OTSMeasureResult:--构造方法--错误日志:" + ex.ToString());
-            }
+          
         }
         #endregion
 

+ 2 - 1
OTSIncAMeasureApp/2-OTSMeasureParamManage/COTSMeasureParam.cs

@@ -82,10 +82,11 @@ namespace OTSMeasureApp
         //测量样品链表
         List<COTSSample> m_MeasureSampleList = new List<COTSSample>();
 
-        NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
+        NLog.Logger log ;
 
         public COTSMeasureParam(OTSIncAMeasureAppForm MeasureApp)
         {
+            log = NLog.LogManager.GetCurrentClassLogger();
             m_MeasureAppFrom = MeasureApp;
            
             m_ResultData = new COTSMsrPrjResultData();

+ 2 - 1
OTSIncAMeasureApp/3-OTSDisplaySourceGridData/OTSDisplaySampleGrid.cs

@@ -67,10 +67,11 @@ namespace OTSMeasureApp
         //工作样品对象
         OTSSamplePropertyInfo m_WSampleInfo = new OTSSamplePropertyInfo();
 
-        NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
+        NLog.Logger log ;
 
         public OTSDisplaySampleGrid(OTSPropertyWindow Propwindow)
         {
+            log = NLog.LogManager.GetCurrentClassLogger();
             m_PropWindow = Propwindow;
 
             m_PropWindow.PropGrid.Redim(Const_Grid_Row, Const_Grid_Column);

+ 2 - 1
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/SEMDATAFieldManage.cs

@@ -30,13 +30,14 @@ namespace OTSMeasureApp
         COTSMeasureParam m_ProjData;
         CFieldPositionMgr cFieldMgrClr;
 
-        NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
+        NLog.Logger log ;
         #endregion
 
         #region 构造方法
     
         public SEMDATAFieldManage(COTSMeasureParam a_DataMgr)
         {
+            log = NLog.LogManager.GetCurrentClassLogger();
             //获取主窗体对象
             if (m_ProjData == null)
             {

+ 2 - 1
OTSIncAMeasureApp/5-OTSMeasureStatuImageFun/OTSBSEImageFun.cs

@@ -13,10 +13,11 @@ namespace OTSMeasureApp
     public class OTSBSEImageFun
     {
         //OTSIncAMeasureAppForm m_MsrApp = null;
-        NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
+        NLog.Logger log ;
         CImageHandler imageHandle;
         public OTSBSEImageFun()
         {
+            log = NLog.LogManager.GetCurrentClassLogger();
             imageHandle = new CImageHandler();
         }
         public bool GetBSEImage(COTSSample WSample,byte[] BSEImage, int iHeight, int iWidth, ref byte[] BSEImageNoBG)

+ 4 - 8
OTSIncAMeasureApp/5-OTSMeasureStatuImageFun/OTSImageData.cs

@@ -34,18 +34,14 @@ namespace OTSMeasureApp
 
         static ExcelEdit m_xe = new ExcelEdit();
 
-        NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
+        NLog.Logger log ;
         public OTSImageData(OTSMeasureStatusWindow MeasureStatuWindow, OTSIncAMeasureAppForm oTSIncAMeasureAppForm)
         {
-            try
-            {
+            log = NLog.LogManager.GetCurrentClassLogger();
+            
                 m_MeasureStatuWindow = MeasureStatuWindow;
                 m_MeasureApp = oTSIncAMeasureAppForm;
-            }
-            catch (Exception ex)
-            {
-               log.Error("(OTSMeasureStatusWindow.ShowGrayLevelLine_Click)  " + ex.ToString());
-            }
+           
 
         }
 

+ 2 - 1
OTSIncAMeasureApp/5-OTSMeasureStatuImageFun/ToolWindow.cs

@@ -21,9 +21,10 @@ namespace OTSMeasureApp
         public OTSIncAMeasureAppForm m_MeasureAppForm;
         public OTSMeasureStatusWindow MeasureStatuWindow;
         OTSImageData m_ImageData = null;
-        NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
+        NLog.Logger log ;
         public ToolWindow(OTSIncAMeasureAppForm m_MeasureForm, OTSMeasureStatusWindow MeasureStatuForm)
         {
+            log = NLog.LogManager.GetCurrentClassLogger();
             InitializeComponent();
             m_MeasureAppForm = m_MeasureForm;
             MeasureStatuWindow = MeasureStatuForm;

+ 2 - 1
OTSIncAMeasureApp/6-OTSDisplayTreeViewData/OTSDisplayTreeBase.cs

@@ -15,9 +15,10 @@ namespace OTSMeasureApp
         //  TreeNode m_Menunode = new TreeNode();     //树的跟节点
         //     String m_csSolutionName = "未加载样品名";
         //    String m_csSampleName = "";
-        NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
+        NLog.Logger log;
         public OTSDisplayTreeBase(OTSSolutionWindow SolutionWindow)
         {
+            log = NLog.LogManager.GetCurrentClassLogger();
             m_SolutionWindow = SolutionWindow;
 
             m_SolutionWindow.treeView1.Nodes.Clear();     //清除Treeview所有节点           

+ 2 - 1
OTSIncAMeasureApp/7-OTSProgMgrInfo/ProgMgrInfoForm.cs

@@ -39,7 +39,7 @@ namespace OTSMeasureApp
         OTSSysMgrTools.Language lan;
         Hashtable table;
 
-        NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
+        NLog.Logger log ;
         #endregion
         /// <summary>
         /// 样品台加载
@@ -62,6 +62,7 @@ namespace OTSMeasureApp
         /// </summary>
         public ProgMgrInfoForm()
         {
+            log = NLog.LogManager.GetCurrentClassLogger();
             m_cotsprogmgrparamfile = new COTSDefaultParam();
             m_cstagefile = new CStageParam();
       

+ 2 - 1
OTSIncAMeasureApp/ServiceCenter/DTLBase/CSQLiteDBStore.cs

@@ -11,12 +11,13 @@ namespace OTSModelSharp.DTLBase
    public class CSQLiteDBStore : IDBStoreBase,IDBFileBase
     {
         SQLiteHelper helper;
-        NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
+        NLog.Logger log ;
         string m_DBFileName;
         SQLiteConnection connForTrans;
         SQLiteTransaction trans;
         public CSQLiteDBStore(string dbFileName)
         {
+            log = NLog.LogManager.GetCurrentClassLogger();
             helper = new SQLiteHelper(dbFileName);
             connForTrans = helper.GetDBConnection();
            

+ 4 - 4
OTSIncAMeasureApp/ServiceCenter/DTLBase/SQliteHelper.cs

@@ -30,16 +30,16 @@ namespace OTSModelSharp.DTLBase
         /// </summary>
         private SQLiteDataReader dataReader;
         private DataTable dt;
-        private NLog.Logger log = NLog.LogManager.GetCurrentClassLogger();
+        private NLog.Logger log;
         /// <summary>
         /// 构造函数
         /// </summary>
         /// <param name="con">连接SQLite库字符串</param>
         public SQLiteHelper(string a_sFileName)
         {
-            
-                
-                 connectionString = "data source='" + a_sFileName + "'" + ";Version=3;";
+            log = NLog.LogManager.GetCurrentClassLogger();
+
+            connectionString = "data source='" + a_sFileName + "'" + ";Version=3;";
              
             
         }

+ 0 - 1
OTSIncAReportApp/Control_Grids/ParticlesGridDevidePage.Designer.cs

@@ -100,7 +100,6 @@
             this.panel2.Name = "panel2";
             this.panel2.Size = new System.Drawing.Size(2254, 56);
             this.panel2.TabIndex = 6;
-            this.panel2.Paint += new System.Windows.Forms.PaintEventHandler(this.panel2_Paint);
             // 
             // label_Condition
             // 

+ 33 - 220
OTSIncAReportApp/Control_Grids/ParticlesGridDevidePage.cs

@@ -503,7 +503,7 @@ namespace OTSIncAReportGrids
             }
 
             ParticleData fielddata = new ParticleData(result.FilePath);
-            DataTable particles = fielddata.GetInfoForPartucleDevidePage(PageIndex, pageSize, OrderFunction, condition);
+            DataTable particles = fielddata.GetInfoForPartucleDevidePage2(PageIndex, pageSize, OrderFunction, condition);
             if(PageSize==-1)
             {
                 PageSize = particles.Rows.Count;
@@ -514,7 +514,7 @@ namespace OTSIncAReportGrids
                 return;
             }
 
-
+            string particleM = "";
             //获取需要显示的元素名
             List<string> ElementTypeSort = new List<string>(str_ElementsColName.Split(',').ToList());//去重
             for (int i = 0; i < ElementTypeSort.Count; i++)
@@ -551,35 +551,35 @@ namespace OTSIncAReportGrids
                         }
                         if (enl.Current.Key == "ParticleImage")
                         {
-                            //string subt = particles.Rows[i]["SubParticles"].ToString();
-                            //if (subt != null && subt != "")
-                            //{
-                            //    double ScanFieldSize = Convert.ToDouble(((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)result.ResultInfo["Sample"])["Members"])["SEMDataMsr"])["ScanFieldSize"]);
-                            //    string filePatht = result.FilePath + "\\FIELD_FILES\\";
-                            //    string imagePatht = filePatht + "Field" + subt.Split(',')[0].Split(':')[0].ToString() + ".bmp";
-                            //    //然后将取出的数据,转换成Bitmap对象
-                            //    Bitmap tempbit = fielddata.ReadImageFile(imagePatht);
-                            //    int pixw = tempbit.Width;
-                            //    double xs = pixw / ScanFieldSize;
-
-                            //    particleM = particleM + "," + subt;
-                            //    Bitmap bmap = fielddata.GetBitmapForBig(subt, xs, result.FilePath);
-                            //    if (bmap != null)
-                            //    {
-                            //        bmap.Tag = new List<string>() { subt.Split(',')[0].Split(':')[0], subt.Split(',')[0].Split(':')[1], particles.Rows[i]["TypeId"].ToString() };
-                            //        dgV_ParticlesDevidePage.Rows[add_rowindex].Height = 150;
-                            //        dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Value = bmap;
-                            //        dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Style.BackColor = Color.Azure;
-                            //    }
-                            //    else
-                            //    {
-                            //        dgV_ParticlesDevidePage.Rows[add_rowindex].Height = 150;
-
-                            //        dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Style.BackColor = Color.Azure;
-                            //    }
-                            //}
-                            //else
-                            //{
+                            string subt = particles.Rows[i]["SubParticles"].ToString();
+                            if (subt != null && subt != "")
+                            {
+                                double ScanFieldSize = Convert.ToDouble(((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)result.ResultInfo["Sample"])["Members"])["SEMDataMsr"])["ScanFieldSize"]);
+                                string filePatht = result.FilePath + "\\FIELD_FILES\\";
+                                string imagePatht = filePatht + "Field" + subt.Split(',')[0].Split(':')[0].ToString() + ".bmp";
+                                //然后将取出的数据,转换成Bitmap对象
+                                Bitmap tempbit = fielddata.ReadImageFile(imagePatht);
+                                int pixw = tempbit.Width;
+                                double xs = pixw / ScanFieldSize;
+
+                                particleM = particleM + "," + subt;
+                                Bitmap bmap = fielddata.GetBitmapForBig(subt, xs, result.FilePath);
+                                if (bmap != null)
+                                {
+                                    bmap.Tag = new List<string>() { subt.Split(',')[0].Split(':')[0], subt.Split(',')[0].Split(':')[1], particles.Rows[i]["TypeId"].ToString() };
+                                    dgV_ParticlesDevidePage.Rows[add_rowindex].Height = 150;
+                                    dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Value = bmap;
+                                    dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Style.BackColor = Color.Azure;
+                                }
+                                else
+                                {
+                                    dgV_ParticlesDevidePage.Rows[add_rowindex].Height = 150;
+
+                                    dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Style.BackColor = Color.Azure;
+                                }
+                            }
+                            else
+                            {
                                 if (FieldImage.Key != particles.Rows[i]["fieldid"].ToString() || FieldImage.Value == null)
                                 {
                                     string imagePath = filePath + "Field" + particles.Rows[i]["fieldid"].ToString() + ".bmp";
@@ -590,8 +590,8 @@ namespace OTSIncAReportGrids
                                 Bitmap bmap = fielddata.GetBitmapByParticle(FieldImage.Value, rectangle);
                                 bmap.Tag = new List<string>() { particles.Rows[i]["FieldId"].ToString(), particles.Rows[i]["ParticleId"].ToString(), particles.Rows[i]["TypeId"].ToString() };
                                 dgV_ParticlesDevidePage.Rows[add_rowindex].Cells[k].Value = bmap;
-                                dgV_ParticlesDevidePage.Rows[add_rowindex].Height = bmap.Height+20;
-                            //}
+                                dgV_ParticlesDevidePage.Rows[add_rowindex].Height = bmap.Height + 20;
+                            }
                         }
                         if (enl.Current.Key == "DiameterRatio")
                         {
@@ -1297,7 +1297,6 @@ namespace OTSIncAReportGrids
             btnGo.Enabled = true;
         }
 
-        bool isTextChanged = false;
         /// <summary>
         /// 分页属性改变了。
         /// </summary>
@@ -1311,26 +1310,6 @@ namespace OTSIncAReportGrids
             else { txtPageNum.Text = "1"; }
         }
 
-        /// <summary>
-        /// 光标离开分页属性
-        private void txtPageSize_Leave(object sender, EventArgs e)
-        {
-            if (isTextChanged)
-            {
-                isTextChanged = false;
-                lnkFirst_Click(null, null);
-            }
-        }
-
-        private void txtPageSize_KeyPress(object sender, KeyPressEventArgs e)
-        {
-            if (isTextChanged)
-            {
-                isTextChanged = false;
-                lnkFirst_Click(null, null);
-            }
-        }
-
         private void lnkFirst_Click(object sender, EventArgs e)
         {
             PageIndex = 1;
@@ -1375,27 +1354,6 @@ namespace OTSIncAReportGrids
             }
         }
 
-        /// <summary>
-        /// 跳转页数限制
-        /// </summary>
-        private void txtPageNum_TextChanged(object sender, EventArgs e)
-        {
-            int num = 0;
-            if (int.TryParse(txtPageNum.Text.Trim(), out num) && num > 0)
-            {
-
-            }
-            else { txtPageNum.Text = "1"; }
-        }
-
-        /// <summary>
-        /// enter键功能
-        /// </summary>
-        private void txtPageNum_KeyPress(object sender, KeyPressEventArgs e)
-        {
-            btnGo_Click(null, null);
-        }
-
         private void cbB_PageSize_SelectedIndexChanged(object sender, EventArgs e)
         {
             if (cbB_PageSize.SelectedItem.ToString() == "All")
@@ -1640,151 +1598,6 @@ namespace OTSIncAReportGrids
             return ms.ToArray();
         }
 
-        /// <summary>
-        /// 返回原子序数
-        /// </summary>
-        /// <param name="ElementName"></param>
-        /// <returns></returns>
-        int ReturnsAtomicNumberByElementName(string ElementName)
-        {
-            switch (ElementName)
-            {
-                case "H": return 1;
-                case "He": return 2;
-                case "Li": return 3;
-                case "Be": return 4;
-                case "B": return 5;
-                case "C": return 6;
-                case "N": return 7;
-                case "O": return 8;
-                case "F": return 9;
-                case "Ne": return 10;
-                case "Na": return 11;
-                case "Mg": return 12;
-                case "Al": return 13;
-                case "Si": return 14;
-                case "P": return 15;
-                case "S": return 16;
-                case "Cl": return 17;
-                case "Ar": return 18;
-                case "K": return 19;
-                case "Ca": return 20;
-                case "Sc": return 21;
-                case "Ti": return 22;
-                case "V": return 23;
-                case "Cr": return 24;
-                case "Mn": return 25;
-                case "Fe": return 26;
-                case "Co": return 27;
-                case "Ni": return 28;
-                case "Cu": return 29;
-                case "Zn": return 30;
-                case "Ga": return 31;
-                case "Ge": return 32;
-                case "As": return 33;
-                case "Se": return 34;
-                case "Br": return 35;
-                case "Kr": return 36;
-                case "Rb": return 37;
-                case "Sr": return 38;
-                case "Y": return 39;
-                case "Zr": return 40;
-                case "Nb": return 41;
-                case "Mo": return 42;
-                case "Tc": return 43;
-                case "Ru": return 44;
-                case "Rh": return 45;
-                case "Pd": return 46;
-                case "Ag": return 47;
-                case "Cd": return 48;
-                case "In": return 49;
-                case "Sn": return 50;
-                case "Sb": return 51;
-                case "Te": return 52;
-                case "I": return 53;
-                case "Xe": return 54;
-                case "Cs": return 55;
-                case "Ba": return 56;
-                case "La": return 57;
-                case "Ce": return 58;
-                case "Pr": return 59;
-                case "Nd": return 60;
-                case "Pm": return 61;
-                case "Sm": return 62;
-                case "Eu": return 63;
-                case "Gd": return 64;
-                case "Tb": return 65;
-                case "Dy": return 66;
-                case "Ho": return 67;
-                case "Er": return 68;
-                case "Tm": return 69;
-                case "Yb": return 70;
-                case "Lu": return 71;
-                case "Hf": return 72;
-                case "Ta": return 73;
-                case "W": return 74;
-                case "Re": return 75;
-                case "Os": return 76;
-                case "Ir": return 77;
-                case "Pt": return 78;
-                case "Au": return 79;
-                case "Hq": return 80;
-                case "TI": return 81;
-                case "Pb": return 82;
-                case "Bi": return 83;
-                case "Po": return 84;
-                case "At": return 85;
-                case "Rn": return 86;
-                case "Fr": return 87;
-                case "Ra": return 88;
-                case "Ac": return 89;
-                case "Th": return 90;
-                case "Pa": return 91;
-                case "U": return 92;
-                case "Np": return 93;
-                case "Pu": return 94;
-                case "Am": return 95;
-                case "Cm": return 96;
-                case "Bk": return 97;
-                case "Cf": return 98;
-                case "Es": return 99;
-                case "Fm": return 100;
-                case "Mc": return 101;
-                case "No": return 102;
-                case "Lr": return 103;
-                case "Rf": return 104;
-                case "Db": return 105;
-                case "Sg": return 106;
-                case "Bh": return 107;
-                case "Hs": return 108;
-                case "Mt": return 109;
-                case "Ds": return 110;
-                case "Rg": return 111;
-                case "Unb": return 112;
-                default: return 1000;
-            }
-        }
-
-
-
-        public List<string> GetElementsColName()
-        {
-            List<string> list_str = new List<string>();
-            string ls_str = "Ar,Al,Si,B,P,C,S,N,Cl,O,F,Ne,He,Lr,Lu,Rn,Xe,Kr,Md,Tm,Po,Te,Se,Es,Ho,Pb,Sn,Ge,Np,Pm,Os,Ru,Fe,Bk,Tb,Hg,Cd,Zn,Pa,Pr,W,Mo,Cr,No,Yb,At,I,Br,Fm,Er,Bi,Sb,As,Hf,Zr,Ti,Am,Eu,Pt,Pd,Ni,U,Nd,Re,Tc,Mn,Cf,Dy,Tl,In,Ga,Ra,Ba,Sr,Ca,Cm,Gd,Au,Ag,Cu,Th,Ce,Ta,Pu,Nb,Sm,V,Ir,Rh,Co,Ac,La,Y,Sc,Fr,Cs,Rb,K,Na,Mg,Be,Li,H";
-
-            string[] strs = ls_str.Split(',');
-            for (int i = 0; i < strs.Count(); i++)
-            {
-                list_str.Add(strs[i]);
-            }
-
-            return list_str;
-        }
-
-        private void panel2_Paint(object sender, PaintEventArgs e)
-        {
-
-        }
     }
 
 

+ 0 - 11
OTSIncAReportApp/frmMeasureRstMgr.cs

@@ -323,17 +323,6 @@ namespace OTSIncAReportApp
                 return;
             }
 
-            //添加启动系统界面显示
-            string SystemMode = ((Dictionary<string, object>)((Dictionary<string, object>)((Dictionary<string, object>)suggestions["Sample"])["Members"])["MsrParams"])["SysType"].ToString();
-            if (SystemMode == "IncA")
-            {
-                m_ReportApp.Text = m_ReportApp.Text.Split(' ')[0] + " -- Inclusion Analysis System";
-            }
-            else if (SystemMode == "CleanlinessA")
-            {
-                m_ReportApp.Text = m_ReportApp.Text.Split(' ')[0] + " -- Cleanliness Analysis System";
-            }
-
             DataOperation.Model.ResultFile result = new DataOperation.Model.ResultFile()
             {
                 FileId = workingid.ToString(),

+ 30 - 13
OTSIncAReportApp/frmReportApp.Designer.cs

@@ -57,6 +57,7 @@
             this.dpbExport = new System.Windows.Forms.RibbonOrbMenuItem();
             this.dpbCopy = new System.Windows.Forms.RibbonOrbMenuItem();
             this.dpbCopyAll = new System.Windows.Forms.RibbonOrbMenuItem();
+            this.ribbonOrbMenuItem_Extremum = new System.Windows.Forms.RibbonOrbMenuItem();
             this.ribbonOrbOptionButton1 = new System.Windows.Forms.RibbonOrbOptionButton();
             this.ribbonOrbRecentItem1 = new System.Windows.Forms.RibbonOrbRecentItem();
             this.ribbonTab1 = new System.Windows.Forms.RibbonTab();
@@ -182,7 +183,7 @@
             // 
             this.ribbon1.Font = new System.Drawing.Font("微软雅黑", 9F);
             this.ribbon1.Location = new System.Drawing.Point(0, 0);
-            this.ribbon1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.ribbon1.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.ribbon1.Minimized = false;
             this.ribbon1.Name = "ribbon1";
             // 
@@ -194,10 +195,11 @@
             this.ribbon1.OrbDropDown.MenuItems.Add(this.dpbExport);
             this.ribbon1.OrbDropDown.MenuItems.Add(this.dpbCopy);
             this.ribbon1.OrbDropDown.MenuItems.Add(this.dpbCopyAll);
+            this.ribbon1.OrbDropDown.MenuItems.Add(this.ribbonOrbMenuItem_Extremum);
             this.ribbon1.OrbDropDown.Name = "";
             this.ribbon1.OrbDropDown.OptionItems.Add(this.ribbonOrbOptionButton1);
             this.ribbon1.OrbDropDown.RecentItems.Add(this.ribbonOrbRecentItem1);
-            this.ribbon1.OrbDropDown.Size = new System.Drawing.Size(527, 248);
+            this.ribbon1.OrbDropDown.Size = new System.Drawing.Size(527, 292);
             this.ribbon1.OrbDropDown.TabIndex = 0;
             this.ribbon1.OrbImage = global::OTSIncAReportApp.Properties.Resources.logo_40;
             // 
@@ -210,7 +212,7 @@
             this.ribbon1.QuickAcessToolbar.ToolTip = null;
             this.ribbon1.QuickAcessToolbar.ToolTipImage = null;
             this.ribbon1.QuickAcessToolbar.ToolTipTitle = null;
-            this.ribbon1.Size = new System.Drawing.Size(1276, 130);
+            this.ribbon1.Size = new System.Drawing.Size(1914, 130);
             this.ribbon1.TabIndex = 0;
             this.ribbon1.Tabs.Add(this.ribbonTab1);
             this.ribbon1.Tabs.Add(this.rbMenu);
@@ -277,6 +279,21 @@
             this.dpbCopyAll.ToolTipTitle = null;
             this.dpbCopyAll.Click += new System.EventHandler(this.ribbonOrbMenuItem8_Click);
             // 
+            // ribbonOrbMenuItem_Extremum
+            // 
+            this.ribbonOrbMenuItem_Extremum.AltKey = null;
+            this.ribbonOrbMenuItem_Extremum.DropDownArrowDirection = System.Windows.Forms.RibbonArrowDirection.Left;
+            this.ribbonOrbMenuItem_Extremum.DropDownArrowSize = new System.Drawing.Size(5, 3);
+            this.ribbonOrbMenuItem_Extremum.Image = global::OTSIncAReportApp.Properties.Resources.Mouse;
+            this.ribbonOrbMenuItem_Extremum.SmallImage = global::OTSIncAReportApp.Properties.Resources.Mouse;
+            this.ribbonOrbMenuItem_Extremum.Style = System.Windows.Forms.RibbonButtonStyle.Normal;
+            this.ribbonOrbMenuItem_Extremum.Tag = null;
+            this.ribbonOrbMenuItem_Extremum.Text = "极值分析法";
+            this.ribbonOrbMenuItem_Extremum.ToolTip = null;
+            this.ribbonOrbMenuItem_Extremum.ToolTipImage = null;
+            this.ribbonOrbMenuItem_Extremum.ToolTipTitle = null;
+            this.ribbonOrbMenuItem_Extremum.Click += new System.EventHandler(this.ribbonOrbMenuItem_Extremum_Click);
+            // 
             // ribbonOrbOptionButton1
             // 
             this.ribbonOrbOptionButton1.AltKey = null;
@@ -527,11 +544,11 @@
             this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
             this.RSGrayVal,
             this.mouseMatter});
-            this.statusStrip1.Location = new System.Drawing.Point(0, 666);
+            this.statusStrip1.Location = new System.Drawing.Point(0, 1003);
             this.statusStrip1.Name = "statusStrip1";
-            this.statusStrip1.Padding = new System.Windows.Forms.Padding(9, 0, 1, 0);
+            this.statusStrip1.Padding = new System.Windows.Forms.Padding(14, 0, 2, 0);
             this.statusStrip1.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
-            this.statusStrip1.Size = new System.Drawing.Size(1276, 26);
+            this.statusStrip1.Size = new System.Drawing.Size(1914, 35);
             this.statusStrip1.TabIndex = 4;
             this.statusStrip1.Text = "statusStrip1";
             // 
@@ -539,14 +556,14 @@
             // 
             this.RSGrayVal.BorderSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Right;
             this.RSGrayVal.Name = "RSGrayVal";
-            this.RSGrayVal.Size = new System.Drawing.Size(48, 21);
+            this.RSGrayVal.Size = new System.Drawing.Size(68, 28);
             this.RSGrayVal.Text = "灰度值";
             // 
             // mouseMatter
             // 
             this.mouseMatter.BorderSides = System.Windows.Forms.ToolStripStatusLabelBorderSides.Right;
             this.mouseMatter.Name = "mouseMatter";
-            this.mouseMatter.Size = new System.Drawing.Size(84, 21);
+            this.mouseMatter.Size = new System.Drawing.Size(122, 28);
             this.mouseMatter.Text = "鼠标点的物质";
             // 
             // DockWindowPanel
@@ -555,9 +572,8 @@
             this.DockWindowPanel.Dock = System.Windows.Forms.DockStyle.Fill;
             this.DockWindowPanel.DockBackColor = System.Drawing.SystemColors.Control;
             this.DockWindowPanel.Location = new System.Drawing.Point(0, 130);
-            this.DockWindowPanel.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.DockWindowPanel.Name = "DockWindowPanel";
-            this.DockWindowPanel.Size = new System.Drawing.Size(1276, 536);
+            this.DockWindowPanel.Size = new System.Drawing.Size(1914, 873);
             dockPanelGradient1.EndColor = System.Drawing.SystemColors.ControlLight;
             dockPanelGradient1.StartColor = System.Drawing.SystemColors.ControlLight;
             autoHideStripSkin1.DockStripGradient = dockPanelGradient1;
@@ -634,15 +650,15 @@
             // 
             // frmReportApp
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1276, 692);
+            this.ClientSize = new System.Drawing.Size(1914, 1038);
             this.Controls.Add(this.DockWindowPanel);
             this.Controls.Add(this.statusStrip1);
             this.Controls.Add(this.ribbon1);
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
             this.IsMdiContainer = true;
-            this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.Name = "frmReportApp";
             this.Text = "报告程序";
             this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
@@ -702,6 +718,7 @@
         public System.Windows.Forms.RibbonOrbMenuItem dpbUnDo;
         public System.Windows.Forms.RibbonOrbMenuItem dpbReDo;
         private System.Windows.Forms.ToolTip toolTip1;
+        private System.Windows.Forms.RibbonOrbMenuItem ribbonOrbMenuItem_Extremum;
     }
 }
 

+ 13 - 0
OTSIncAReportApp/frmReportApp.cs

@@ -1268,6 +1268,19 @@ namespace OTSIncAReportApp
             ServiceInterface.SemController sem = new ServiceInterface.SemController();
             sem.DisConnect();
         }
+
+        private void ribbonOrbMenuItem_Extremum_Click(object sender, EventArgs e)
+        {
+            try
+            {
+                System.Diagnostics.Process p = System.Diagnostics.Process.Start(".\\OTSExtremum.exe");
+                p.WaitForExit();
+            }
+            catch (Exception ex)
+            {
+                log.Error("OTSPartA_STDEditor:" + ex.ToString());
+            }
+        }
     }
 }