Просмотр исходного кода

optimize the measure flow and the measue statue management.

GSP 1 месяц назад
Родитель
Сommit
90095a7a40

+ 12 - 35
OTSIncAMeasureApp/0-OTSModel/OTSDataType/CMsrSampleStatus.cs

@@ -9,24 +9,21 @@ namespace OTSDataType
 {
     public enum OTS_MSR_SAMPLE_STATUS
     {
-        INVALID = -1,
-        MIN = 0,
+      
         UNMEASURED = 0,
-        INPROCESS = 1,
-        //PAUSED=2,
+        START = 1,     
+        FAILED = 2,
         STOPPED = 3,
-        FAILED = 4,
-        COMPLETED = 5,
-        MAX = 5
+        COMPLETED = 4
+
     }
 
     public enum OTS_MSR_TIME_TYPE
     {
-        MIN = 0,
+       
         START = 1,
-        STOPPED = 2,
-        COMPLT = 3,
-        MAX = 3
+  
+        END = 2
     }
     public class CMsrSampleStatus
     {
@@ -196,13 +193,13 @@ namespace OTSDataType
         // compute time
         public bool ComputeTime(OTS_MSR_TIME_TYPE a_nType)
         {
-            //DateTime time = new DateTime();
+           
 
             if (a_nType == OTS_MSR_TIME_TYPE.START)
             {
                 if (m_timeStart == new DateTime())
                 {
-                    m_timeStart = DateTime.Now; //OleDateTime.GetCurrentTime();
+                    m_timeStart = DateTime.Now; 
                     m_timeStartCur = m_timeStart;
                     m_timeUsedLast = m_timeUsed;
                 }                    
@@ -215,28 +212,8 @@ namespace OTSDataType
 
 
 
-            }
-            else if (a_nType == OTS_MSR_TIME_TYPE.STOPPED)
-            {
-                // set current time as end time
-                m_timeEnd =DateTime.Now;
-
-          
-
-                if (m_timeStartCur == m_timeStart)
-                {
-                    // first compute time
-                    m_timeUsed = m_timeEnd - m_timeStart;
-                }
-                else
-                {
-                    // not the first compute time
-                    m_timeUsed = m_timeEnd - m_timeStartCur + m_timeUsedLast;
-                }
-
-             
-            }
-            else if(a_nType == OTS_MSR_TIME_TYPE.COMPLT)
+            }           
+            else if(a_nType == OTS_MSR_TIME_TYPE.END)
             {
                 m_timeEnd = DateTime.Now;
 

+ 5 - 5
OTSIncAMeasureApp/0-OTSModel/OTSDataType/otsdataconst.cs

@@ -325,23 +325,23 @@ namespace OTSDataType
         public enum OTS_MSR_THREAD_STATUS
         {
             READY = 0,
-            //MIN = 0,
+          
             INPROCESS = 1,
             PAUSED=2,
             STOPPED = 3,
             FAILED = 4,
-            COMPLETED = 5,
-            //MAX = 4
+            FINISHED = 5,
+         
         }
    
 
         public enum OTS_THREAD_TIME_TYPE
         {
-            //MIN = 0,
+           
             START = 1,
             STOPPED = 2,
             COMPLT = 3,
-            //MAX = 3
+          
         }
 
         public enum STEEL_TECHNOLOGY

+ 5 - 13
OTSIncAMeasureApp/1-OTSMeasure/Measure/3-MeasureFlow/CMeasure.cs

@@ -88,7 +88,7 @@ namespace OTSModelSharp
            
             SendMessageToMeasureGUI(MsrMsg);
 
-            if (m_ThreadStatus.GetStatus() == otsdataconst.OTS_MSR_THREAD_STATUS.FAILED || m_ThreadStatus.GetStatus() == otsdataconst.OTS_MSR_THREAD_STATUS.COMPLETED)
+            if (m_ThreadStatus.GetStatus() == otsdataconst.OTS_MSR_THREAD_STATUS.FAILED || m_ThreadStatus.GetStatus() == otsdataconst.OTS_MSR_THREAD_STATUS.FINISHED)
             {
 
                 if (m_pProjData.GetGenParam().AutoBeamOff)
@@ -142,7 +142,7 @@ namespace OTSModelSharp
 
         public bool  IsMeasureRunning() { return m_ThreadStatus.GetStatus() == OTS_MSR_THREAD_STATUS.INPROCESS; }
         public bool  IsMeasureFailed() { return m_ThreadStatus.GetStatus() == OTS_MSR_THREAD_STATUS.FAILED; }
-        public bool  IsMeasureCompleted() { return m_ThreadStatus.GetStatus() == OTS_MSR_THREAD_STATUS.COMPLETED; }
+        public bool  IsMeasureFinished() { return m_ThreadStatus.GetStatus() == OTS_MSR_THREAD_STATUS.FINISHED; }
        public void StopBrightnessContrastRegulation()
         {
             if (BCregulater != null)
@@ -254,7 +254,7 @@ namespace OTSModelSharp
                 else
                 {
                     pSmplMeasure = mapSmplMsr[pSample.GetName()];
-                    pSample.GetMsrStatus().SetStatus(OTS_MSR_SAMPLE_STATUS.INPROCESS);
+                    pSample.GetMsrStatus().SetStatus(OTS_MSR_SAMPLE_STATUS.START);
                     m_ThreadStatus.SetStatus(OTS_MSR_THREAD_STATUS.INPROCESS);
                 }
 
@@ -287,28 +287,20 @@ namespace OTSModelSharp
 
                 // update thread measure status class, let the main thread know that this sample measurement failed
                 ST_MSTMsg MsgSmpFailed=new ST_MSTMsg(m_ThreadStatus);
-                    MsgSmpFailed.InitThreadFailedMsg();
+                    MsgSmpFailed.InitsampleFailedMsg();
                    
                  SendMessageToMeasureGUI(MsgSmpFailed);
                 ThreadOver();
 				  return;
 			    }
 
-              
-                // update thread measure status class, let the main thread know that this sample measurement successes
-                ST_MSTMsg MsgSmpSuccess = new ST_MSTMsg(m_ThreadStatus);
-                MsgSmpSuccess.InitThreadSucceedMsg();
-
-                SendMessageToMeasureGUI(MsgSmpSuccess);
-
-
                 // continue to the next sample
                 listMeasuredSamples.Add(pSample.GetName());
 
             }
 
             // measurement completed
-            m_ThreadStatus.SetStatus(OTS_MSR_THREAD_STATUS.COMPLETED);
+            m_ThreadStatus.SetStatus(OTS_MSR_THREAD_STATUS.FINISHED);
             // record end time
             m_ThreadStatus.ComputeTime(OTS_THREAD_TIME_TYPE.STOPPED);
 

+ 12 - 18
OTSIncAMeasureApp/1-OTSMeasure/Measure/3-MeasureFlow/CMeasureThreadWrapper.cs

@@ -83,7 +83,7 @@ namespace OTSMeasureApp
 
 
                     }
-                    else if (MSTMsg.STMThreadStu.iMsrStatu == otsdataconst.OTS_MSR_THREAD_STATUS.COMPLETED)
+                    else if (MSTMsg.STMThreadStu.iMsrStatu == otsdataconst.OTS_MSR_THREAD_STATUS.FINISHED)
                     {
                         m_MeasureApp.SetStopMeasureRibbonStatus();
                       
@@ -133,7 +133,7 @@ namespace OTSMeasureApp
         {
             foreach(var s in m_measure.GetListMeasurableSamples())
             {
-                if (s.GetMsrStatus().GetStatus() == OTS_MSR_SAMPLE_STATUS.INPROCESS)
+                if (s.GetMsrStatus().GetStatus() == OTS_MSR_SAMPLE_STATUS.START)
                 {
                     return true;
                 }
@@ -253,12 +253,12 @@ namespace OTSMeasureApp
                         GetMsrRetData(ref MSTMsg.STMThreadStu.SMsrCompleteData);
 
 
-                        m_OTSMeasureResult.MeasureFailed(MSTMsg);
+                        m_OTSMeasureResult.MeasureStopped(MSTMsg);
                         log.Error("(OTSGetMreRetThread)  MSTMsg.STMThreadStu.iMThreadStatus = RET_MEASURE_THREAD_STATUS.FAILED");
 
 
                     }
-                    else if (MSTMsg.STMThreadStu.iMsrStatu == otsdataconst.OTS_MSR_THREAD_STATUS.COMPLETED)
+                    else if (MSTMsg.STMThreadStu.iMsrStatu == otsdataconst.OTS_MSR_THREAD_STATUS.FINISHED)
                     {
 
                         m_MeasureApp.SetStopMeasureRibbonStatus();
@@ -266,13 +266,15 @@ namespace OTSMeasureApp
                         GetMsrRetData(ref MSTMsg.STMThreadStu.SMsrCompleteData);
 
 
-                        m_OTSMeasureResult.MeasureComplete(MSTMsg);
+                        m_OTSMeasureResult.MeasureStopped(MSTMsg);
 
                     }
                     else if (MSTMsg.STMThreadStu.iMsrStatu == otsdataconst.OTS_MSR_THREAD_STATUS.PAUSED)
                     {
 
                         m_MeasureApp.SetPauseMeasureRibbonStatus();
+                       
+                        log.Warn("This sample measure is paused!");
 
                     }
                     else
@@ -282,33 +284,25 @@ namespace OTSMeasureApp
                     break;
 
                 case ENUM_MSG_TYPE.MSAMPLESTATUS:
-                    if (MSTMsg.STMSampleStu.iMsrSampleStatu == OTSDataType.OTS_MSR_SAMPLE_STATUS.INPROCESS)   // 开始测量样品
+                    if (MSTMsg.STMSampleStu.iMsrSampleStatu == OTSDataType.OTS_MSR_SAMPLE_STATUS.START)   // 开始测量样品
                     {
                         string csName = MSTMsg.STMSampleStu.cSampleName;
                         m_MeasureApp.SwitchDisplayMeasureSample(csName);
 
                         StartMsrSample(MSTMsg);
 
-                    }
-                    else if (MSTMsg.STMSampleStu.iMsrSampleStatu == OTSDataType.OTS_MSR_SAMPLE_STATUS.STOPPED)
-                    {
-                        StopMeasure(MSTMsg);
-                    }
+                    }                 
                     else if (MSTMsg.STMSampleStu.iMsrSampleStatu == OTSDataType.OTS_MSR_SAMPLE_STATUS.FAILED)
                     {
                         
-                        log.Error("(OTSGetMreRetThread) MSTMsg.STMSampleStu.iMeasureSampleStatus = RET_MEASURE_SAMPLE_STATUS.FAILED Failed");
+                        log.Error(MSTMsg.STMSampleStu.cSampleName + " measure failed");
 
                     }
                     else if (MSTMsg.STMSampleStu.iMsrSampleStatu == OTSDataType.OTS_MSR_SAMPLE_STATUS.COMPLETED)
                     {
-                        log.Info("Sample measure succeeded");
+                        log.Info(MSTMsg.STMSampleStu.cSampleName+" measure succeeded");
                     }
-                    //else if(MSTMsg.STMSampleStu.iMsrSampleStatu == OTSDataType.OTS_MSR_SAMPLE_STATUS.PAUSED)
-                    //{
-                    //    m_MeasureApp.SetPauseMeasureRibbonStatus();
-                    //    log.Warn("This sample measure is paused!");
-                    //}
+                
                     break;
                 case ENUM_MSG_TYPE.MSAMPLERESULT:
                     if (MSTMsg.STMSampleRetData.iRetDataType ==MSAMPLE_RET.BSE_DATA)

+ 18 - 24
OTSIncAMeasureApp/1-OTSMeasure/Measure/3-MeasureFlow/CSmplMeasure.cs

@@ -216,11 +216,6 @@ namespace OTSModelSharp
             m_strWorkingFolder = a_strWorkingFolder + m_Sample.GetName() + "\\";
         }
        
-        protected bool IsAborted()
-        {
-           
-            return m_pMsrThread.IsMeasureStopped();
-        }
         protected bool IsPaused()
         {
             
@@ -444,7 +439,7 @@ namespace OTSModelSharp
             {
                 // let the main thread to know that this sample measurement starts
                 var pStatus = m_Sample.GetMsrStatus();
-                pStatus.SetStatus(OTS_MSR_SAMPLE_STATUS.INPROCESS);
+                pStatus.SetStatus(OTS_MSR_SAMPLE_STATUS.START);
 
                 // set current time to current time
                 pStatus.ComputeTime(OTS_MSR_TIME_TYPE.START);
@@ -461,7 +456,7 @@ namespace OTSModelSharp
                 {
                     log.Error("DoMeasure: fail to set SEM data.");
                     pStatus.SetStatus(OTS_MSR_SAMPLE_STATUS.FAILED);
-                    pStatus.ComputeTime(OTS_MSR_TIME_TYPE.STOPPED);
+                    pStatus.ComputeTime(OTS_MSR_TIME_TYPE.END );
 
                     return;
                 }
@@ -471,7 +466,7 @@ namespace OTSModelSharp
                 {
                     log.Error("DoMeasure: fail to set BSE param.");
                     pStatus.SetStatus(OTS_MSR_SAMPLE_STATUS.FAILED);
-                    pStatus.ComputeTime(OTS_MSR_TIME_TYPE.STOPPED);
+                    pStatus.ComputeTime(OTS_MSR_TIME_TYPE.END );
 
                     return;
                 }
@@ -501,7 +496,7 @@ namespace OTSModelSharp
                 {// failed to call measure result file Save method
                     log.Error("DoMeasure: failed to call measure result file Save method.");
                     pStatus.SetStatus(OTS_MSR_SAMPLE_STATUS.FAILED);
-                    pStatus.ComputeTime(OTS_MSR_TIME_TYPE.STOPPED);
+                    pStatus.ComputeTime(OTS_MSR_TIME_TYPE.END );
                     return;
                 }
 
@@ -524,9 +519,7 @@ namespace OTSModelSharp
                         }
                         if (IsPaused())
                         {// measure stopped			
-                            //pStatus.SetStatus(OTS_MSR_SAMPLE_STATUS.PAUSED);
-                            // record end time
-                            //pStatus.ComputeTime(OTS_MSR_TIME_TYPE.STOPPED);
+                       
                             //must wait for the saving data thread  finished,or we'll get null pointer exception when we stop the measure process.			
                             while (fieldQueue.Count() > 0)
                             {
@@ -535,11 +528,11 @@ namespace OTSModelSharp
 
                             SetSEMExteralOff();
                             // update thread measure status class, let the main thread know that this sample measurement stopped
-                            ST_MSTMsg MsgSmpStop = new ST_MSTMsg(m_Sample);
+                            ST_MSTMsg MsgSmppause = new ST_MSTMsg(m_Sample);
 
-                            MsgSmpStop.InitSamplePausedMsg();
+                            MsgSmppause.InitThreadPausedMsg();
 
-                            m_pMsrThread.SendMessageToMeasureGUI(MsgSmpStop);
+                            m_pMsrThread.SendMessageToMeasureGUI(MsgSmppause);
                             while (IsPaused())
                             {
                                 Thread.Sleep(300);
@@ -547,12 +540,13 @@ namespace OTSModelSharp
                             }
 
                         }
-                        if (IsAborted())
+                        if (m_pMsrThread.IsMeasureStopped())
                         {// measure stopped			
                             pStatus.SetStatus(OTS_MSR_SAMPLE_STATUS.STOPPED);
                             // record end time
-                            pStatus.ComputeTime(OTS_MSR_TIME_TYPE.STOPPED);
-                            //must wait for the saving data thread  finished,or we'll get null pointer exception when we stop the measure process.			
+                            pStatus.ComputeTime(OTS_MSR_TIME_TYPE.END);
+
+                            //must wait for the saving data thread to finish,or we'll get null pointer exception when we stop the measure process.			
                             while (fieldQueue.Count() > 0)
                             {
                                 Thread.Sleep(100);
@@ -566,7 +560,7 @@ namespace OTSModelSharp
                         if (IsSampleOver(pScanParam))
                         {
                             pStatus.SetStatus(OTS_MSR_SAMPLE_STATUS.COMPLETED);
-                            pStatus.ComputeTime(OTS_MSR_TIME_TYPE.COMPLT);
+                            pStatus.ComputeTime(OTS_MSR_TIME_TYPE.END);
                             break;
                         }
                         var BCregulater = m_pMsrThread.BCregulater;
@@ -595,7 +589,7 @@ namespace OTSModelSharp
                             log.Error("DoMeasure: failed to move SEM to the field centre point.");
                             pStatus.SetStatus(OTS_MSR_SAMPLE_STATUS.FAILED);
                             // record end time
-                            pStatus.ComputeTime(OTS_MSR_TIME_TYPE.STOPPED);
+                            pStatus.ComputeTime(OTS_MSR_TIME_TYPE.END);
                             return;
                         }
                         log.Info("Begin to Acquire BSE image!");
@@ -720,7 +714,7 @@ namespace OTSModelSharp
                         pStatus.AddCompletedFieldCenter(curFld.GetOTSPosition());
                        
                       
-                        pStatus.ComputeTime(OTS_MSR_TIME_TYPE.STOPPED);
+                        pStatus.ComputeTime(OTS_MSR_TIME_TYPE.END);
 
                         SendFieldParticlesInfoToGUI(curFld, m_Sample.GetMsrStatus());
                     }
@@ -737,7 +731,7 @@ namespace OTSModelSharp
                     Thread.Sleep(1000);
                     log.Warn("db saving!");
                 }
-
+                pStatus.SetStatus(OTS_MSR_SAMPLE_STATUS.COMPLETED); 
                 TheLastWorkOfSampleMeasure();
             }
             catch (Exception e)
@@ -755,9 +749,9 @@ namespace OTSModelSharp
             var pStatus = theSample.GetMsrStatus();
            
 
-            pStatus.ComputeTime(OTS_MSR_TIME_TYPE.COMPLT);
+            pStatus.ComputeTime(OTS_MSR_TIME_TYPE.END);
 
-            //pStatus.SetStatus(OTS_MSR_SAMPLE_STATUS.SUCCESSED);
+           
 
             // let main thread to know that this sample measurement completes
             ST_MSTMsg MsgSmplEnd = new ST_MSTMsg(m_Sample);

+ 1 - 1
OTSIncAMeasureApp/1-OTSMeasure/Measure/3-MeasureFlow/CSmplPreviewMeasure.cs

@@ -199,7 +199,7 @@ namespace OTSMeasureApp._1_OTSMeasure.Measure._3_MeasureFlow
             m_pMsrThread. SendHolePreviewMessageToMeasureGUI(MsgSmpSuccess);
 
             // measurement completed
-            m_pMsrThread. SetMsrLoopStatus(otsdataconst.OTS_MSR_THREAD_STATUS.COMPLETED);
+            m_pMsrThread. SetMsrLoopStatus(otsdataconst.OTS_MSR_THREAD_STATUS.FINISHED);
           
          
 

+ 18 - 24
OTSIncAMeasureApp/1-OTSMeasure/Measure/3-MeasureFlow/ST_MSTMsg.cs

@@ -123,7 +123,7 @@ namespace OTSMeasureApp._1_OTSMeasure.Measure._3_MeasureFlow
         internal void InitThreadOverMsg()
         {
             iMsgType = ENUM_MSG_TYPE.MTHREADSTATUS;
-            STMThreadStu.iMsrStatu = m_msrStatus.GetStatus();
+            STMThreadStu.iMsrStatu = OTS_MSR_THREAD_STATUS.FINISHED;
             DateTime timeEnd = m_msrStatus.GetEndTime();
             STMThreadStu.csMsrEndTime = timeEnd.ToString("yyyy-MM-dd HH:mm:ss");
         }
@@ -145,51 +145,45 @@ namespace OTSMeasureApp._1_OTSMeasure.Measure._3_MeasureFlow
 
         internal void InitThreadPausedMsg()
         {
-            this.iMsgType = ENUM_MSG_TYPE.MSAMPLESTATUS;
-           STMThreadStu.iMsrStatu = OTS_MSR_THREAD_STATUS.PAUSED;
-            STMSampleStu.iMsrSampleStatu = OTS_MSR_SAMPLE_STATUS.PAUSED;
-           STMThreadStu.csMsrEndTime = DateTime.Now.ToShortDateString();
+            this.iMsgType = ENUM_MSG_TYPE.MTHREADSTATUS;
             STMThreadStu.iMsrStatu = OTS_MSR_THREAD_STATUS.PAUSED;
+          
+           STMThreadStu.csMsrEndTime = DateTime.Now.ToShortDateString();
+           
         }
 
         internal void InitThreadStoppedMsg()
         {
-            iMsgType = ENUM_MSG_TYPE.MSAMPLESTATUS;
+            iMsgType = ENUM_MSG_TYPE.MTHREADSTATUS;
             STMThreadStu.iMsrStatu = OTS_MSR_THREAD_STATUS.STOPPED;
-            STMSampleStu.iMsrSampleStatu = OTS_MSR_SAMPLE_STATUS.STOPPED;
+            
             STMThreadStu.csMsrEndTime = DateTime.Now.ToShortDateString();
-            STMThreadStu.iMsrStatu = OTS_MSR_THREAD_STATUS.STOPPED;
+         
         }
 
-        internal void InitThreadFailedMsg()
+        internal void InitsampleFailedMsg()
         {
             iMsgType = ENUM_MSG_TYPE.MSAMPLESTATUS;
            STMSampleStu.iMsrSampleStatu = OTS_MSR_SAMPLE_STATUS.FAILED;
         }
 
-        internal void InitThreadSucceedMsg()
+        internal void InitThreadFinishedMsg()
         {
-            iMsgType = ENUM_MSG_TYPE.MSAMPLESTATUS;
-            STMSampleStu.iMsrSampleStatu = OTS_MSR_SAMPLE_STATUS.COMPLETED;
-        }
+            iMsgType = ENUM_MSG_TYPE.MTHREADSTATUS;
 
-       
+            STMThreadStu.iMsrStatu = OTS_MSR_THREAD_STATUS.FINISHED;
+           
+        }
 
         internal void InitSampleStartMsg()
         {
             this.iMsgType = ENUM_MSG_TYPE.MSAMPLESTATUS;
-            this.STMSampleStu.iMsrSampleStatu = OTS_MSR_SAMPLE_STATUS.INPROCESS;
+            this.STMSampleStu.iMsrSampleStatu = OTS_MSR_SAMPLE_STATUS.START;
             this.STMSampleStu.cSampleName = m_sample.GetName();
             
         }
 
-        internal void InitSamplePausedMsg()
-        {
-            this.iMsgType = ENUM_MSG_TYPE.MSAMPLESTATUS;
-            //this.STMThreadStu.iMsrStatu = m_sample.GetMsrStatus().GetStatus();
-            this.STMSampleStu.iMsrSampleStatu = OTS_MSR_SAMPLE_STATUS.PAUSED;
-            this.STMThreadStu.csMsrEndTime = DateTime.Now.ToShortDateString();
-        }
+   
         internal void InitSampleCompleteMsg()
         {
             this.iMsgType = ENUM_MSG_TYPE.MSAMPLESTATUS;
@@ -278,7 +272,7 @@ namespace OTSMeasureApp._1_OTSMeasure.Measure._3_MeasureFlow
         internal void InitHolePreThreadSucceedMsg()
         {
             iMsgType = ENUM_MSG_TYPE.MTHREADSTATUS;
-            STMSampleStu.iMsrSampleStatu = OTS_MSR_SAMPLE_STATUS.COMPLETED;
+            STMSampleStu.iMsrSampleStatu = OTS_MSR_SAMPLE_STATUS.STOPPED;
 
         }
         internal void InitHolePreBSEDataMsg(CBSEImgClr pBSEIamge,Point poiFieldCenter)
@@ -298,7 +292,7 @@ namespace OTSMeasureApp._1_OTSMeasure.Measure._3_MeasureFlow
         internal void InitHolePreSampleEndMsg()
         {
             iMsgType = ENUM_MSG_TYPE.MTHREADSTATUS;
-            STMThreadStu.iMsrStatu = OTS_MSR_THREAD_STATUS.COMPLETED;
+            STMThreadStu.iMsrStatu = OTS_MSR_THREAD_STATUS.FINISHED;
         }
 
       

+ 1 - 1
OTSIncAMeasureApp/1-OTSMeasure/Measure/ParamData/frmPre_measurementDetection.cs

@@ -313,7 +313,7 @@ namespace OTSMeasureApp._1_OTSMeasure.Measure.ParamData
 
         bool IsMeasureCompletedSmpl(COTSSample a_pSample)
         {
-            if (a_pSample.GetMsrStatus().GetStatus() != OTSDataType.OTS_MSR_SAMPLE_STATUS.COMPLETED)
+            if (a_pSample.GetMsrStatus().GetStatus() != OTSDataType.OTS_MSR_SAMPLE_STATUS.STOPPED)
             {
 
                 return false;

+ 29 - 30
OTSIncAMeasureApp/1-OTSMeasure/OTSMeasureDisplayResult.cs

@@ -201,7 +201,7 @@ namespace OTSMeasureApp
         
             switch (SMsrData.STMThreadStu.iMsrStatu)
             {
-                case OTS_MSR_THREAD_STATUS.COMPLETED:
+                case OTS_MSR_THREAD_STATUS.FINISHED:
                     measureState = table["state1"].ToString();
                     break;
                 case OTS_MSR_THREAD_STATUS.FAILED:
@@ -219,23 +219,23 @@ namespace OTSMeasureApp
 
        
 
-        public void MeasureComplete(ST_MSTMsg SMsrData)
-        {
+        //public void MeasureComplete(ST_MSTMsg SMsrData)
+        //{
 
 
-            string inprocessEndTime = SMsrData.STMThreadStu.csMsrEndTime;
+        //    string inprocessEndTime = SMsrData.STMThreadStu.csMsrEndTime;
            
            
-            //获取需显示的grid信息
-            var sample = m_MeasureApp.m_ProjParam.GetWorkSample();
-            var stype = m_MeasureApp.m_ProjParam.GetDefaultParam().GetSysType();
-            OTSSampleVisualPropertyInfo MeasureInfo = new OTSSampleVisualPropertyInfo(sample, stype);
-            m_MeasureApp.m_SPropertyWindows.DisplaySampleMeasureInfo(MeasureInfo);
-            SetMeasureResultInfo(SMsrData);
-            MeasureResultMsrData = SMsrData;
+        //    //获取需显示的grid信息
+        //    var sample = m_MeasureApp.m_ProjParam.GetWorkSample();
+        //    var stype = m_MeasureApp.m_ProjParam.GetDefaultParam().GetSysType();
+        //    OTSSampleVisualPropertyInfo MeasureInfo = new OTSSampleVisualPropertyInfo(sample, stype);
+        //    m_MeasureApp.m_SPropertyWindows.DisplaySampleMeasureInfo(MeasureInfo);
+        //    SetMeasureResultInfo(SMsrData);
+        //    MeasureResultMsrData = SMsrData;
 
-            m_bgWorker.ReportProgress((int)ProgressState.MeasureCheckReport);
-        }
+        //    m_bgWorker.ReportProgress((int)ProgressState.MeasureCheckReport);
+        //}
 
 
 
@@ -312,10 +312,9 @@ namespace OTSMeasureApp
                         m_MeasureApp.m_SamplepaceWindow.SetSampleOrder(sampleName);
 
 
-                        //if (m_MeasureApp.GetRunType() == MSR_RUN_TYPE.RUNMEASURE)
-                        //{
-                            m_OTSMeasureResultWindow.SetSampleName(sampleName);
-                        //}
+                       
+                        m_OTSMeasureResultWindow.SetSampleName(sampleName);
+                        
                         m_MeasureApp.m_SamplepaceWindow.Invalidate();
                    
                     //设置开始时间
@@ -344,22 +343,22 @@ namespace OTSMeasureApp
             m_MeasureApp.m_SPropertyWindows.DisplaySampleMeasureInfo(MeasureInfo);
         }
 
-        public void MeasureFailed(ST_MSTMsg SMsrData)
-        {
-            string failedEndTime = SMsrData.STMThreadStu.csMsrEndTime;
-            SetMeasureResultInfo(SMsrData);
-            MeasureResultMsrData = SMsrData;
-           m_bgWorker.ReportProgress((int)ProgressState.MeasureCheckReport);
+        //public void MeasureFailed(ST_MSTMsg SMsrData)
+        //{
+        //    string failedEndTime = SMsrData.STMThreadStu.csMsrEndTime;
+        //    SetMeasureResultInfo(SMsrData);
+        //    MeasureResultMsrData = SMsrData;
+        //   m_bgWorker.ReportProgress((int)ProgressState.MeasureCheckReport);
 
 
 
-            //测量失败,更新Grid显示的测量信息
-            //获取需显示的grid信息
-            var sample = m_MeasureApp.m_ProjParam.GetWorkSample();
-            var stype = m_MeasureApp.m_ProjParam.GetDefaultParam().GetSysType();
-            OTSSampleVisualPropertyInfo MeasureInfo = new OTSSampleVisualPropertyInfo(sample, stype);
-            m_MeasureApp.m_SPropertyWindows.DisplaySampleMeasureInfo(MeasureInfo);
-        }
+        //    //测量失败,更新Grid显示的测量信息
+        //    //获取需显示的grid信息
+        //    var sample = m_MeasureApp.m_ProjParam.GetWorkSample();
+        //    var stype = m_MeasureApp.m_ProjParam.GetDefaultParam().GetSysType();
+        //    OTSSampleVisualPropertyInfo MeasureInfo = new OTSSampleVisualPropertyInfo(sample, stype);
+        //    m_MeasureApp.m_SPropertyWindows.DisplaySampleMeasureInfo(MeasureInfo);
+        //}
 
         #endregion
 

+ 1 - 1
OTSIncAMeasureApp/OTSIncAMeasureAppForm.cs

@@ -1222,7 +1222,7 @@ namespace OTSMeasureApp
                 m_MsrThreadWrapper.SetMeasureThreadStatus(otsdataconst.OTS_MSR_THREAD_STATUS.STOPPED);
                 foreach (KeyValuePair<string, CSmplMeasure> smpl in m_MsrThreadWrapper.m_measure.mapSmplMsr)
                 {
-                    if (smpl.Value.GetSample().GetMsrStatus().GetStatus() == OTS_MSR_SAMPLE_STATUS.INPROCESS)
+                    if (smpl.Value.GetSample().GetMsrStatus().GetStatus() == OTS_MSR_SAMPLE_STATUS.START)
                     {
                         smpl.Value.TheLastWorkOfSampleMeasure();
                         SetStopMeasureRibbonStatus();