Browse Source

set tagid the same as analysisid.(don't assign small particle and oversize particle any id number.)

gsp 3 years ago
parent
commit
1213a61c7b

+ 5 - 7
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();

+ 10 - 7
OTSIncAMeasureApp/0-OTSModel/Measure/BSEPicData/COTSFieldData.cs

@@ -154,10 +154,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,12 +170,17 @@ 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);
@@ -256,7 +259,7 @@ namespace OTSModelSharp
 
             return m_nID == a_oSource.m_nID &&
                 PoiPos == a_oSource.PoiPos;
-                //m_strFieldFileFolder==a_oSource.m_strFieldFileFolder;
+              
         }
 
         // destructor

+ 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;";
              
             
         }