|
|
@@ -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);
|