Ver Fonte

improve OxfordSemController.cs logic of connection.

gsp há 1 ano atrás
pai
commit
a6533b1332

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

@@ -247,21 +247,7 @@ namespace OTSModelSharp
                
                 pSmplMeasure.DoMeasureForOneSample();
 
-                // check if measurement is successful
-                //if (pSample.GetMsrStatus().GetStatus() == OTS_MSR_SAMPLE_STATUS.PAUSED)
-                //{// record end time
-                //    m_ThreadStatus.SetStatus(OTS_MSR_THREAD_STATUS.PAUSED);
-                //    m_ThreadStatus.ComputeTime(OTS_THREAD_TIME_TYPE.STOPPED);
-
-                //    // update thread measure status class, let the main thread know that this sample measurement stopped
-                //    ST_MSTMsg MsgSmpStop = new ST_MSTMsg(m_ThreadStatus);
-                //    MsgSmpStop.InitThreadPausedMsg();
-                //    SendMessageToMeasureGUI(MsgSmpStop);
-
-
-                //    ThreadOver();
-                //    return;
-                //}
+               
                 if (pSample.GetMsrStatus().GetStatus() == OTS_MSR_SAMPLE_STATUS.STOPPED)
                 {// record end time
                     m_ThreadStatus.SetStatus(OTS_MSR_THREAD_STATUS.STOPPED);

+ 9 - 1
OTSIncAMeasureApp/ServiceCenter/OxfordExtender/OxfordSemController.cs

@@ -110,7 +110,15 @@ namespace OTSMeasureApp.ServiceCenter
 
         public bool IsConnected()
         {
-            return true;
+            if (Connect())
+            {
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+           
         }
 
         public bool MoveSEMToPoint(double a_dPositionX, double a_dPositionY, double rotation)