Sfoglia il codice sorgente

修复m_MeasureCheckReportInfoWindow错误

cxs 1 anno fa
parent
commit
89e879dd9a

+ 2 - 1
OTSIncAMeasureApp/0-OTSModel/OTSDataType/otsdataconst.cs

@@ -268,7 +268,8 @@ namespace OTSDataType
             //MIN = 0,
             START = 1,
             STOPPED = 2,
-            //MAX = 2
+            COMPLT = 3,
+            //MAX = 3
         }
 
         public enum STEEL_TECHNOLOGY

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

@@ -327,13 +327,13 @@ namespace OTSMeasureApp
                     }
                     else if (MSTMsg.STMSampleStu.iMsrSampleStatu == OTSDataType.OTS_MSR_SAMPLE_STATUS.FAILED)
                     {
-                        StopMeasure(MSTMsg);
+                        //StopMeasure(MSTMsg);
                         log.Error("(OTSGetMreRetThread) MSTMsg.STMSampleStu.iMeasureSampleStatus = RET_MEASURE_SAMPLE_STATUS.FAILED Failed");
 
                     }
                     else if (MSTMsg.STMSampleStu.iMsrSampleStatu == OTSDataType.OTS_MSR_SAMPLE_STATUS.SUCCESSED)
                     {
-                        StopMeasure(MSTMsg);
+                        //StopMeasure(MSTMsg);
                     }
                     else if(MSTMsg.STMSampleStu.iMsrSampleStatu == OTSDataType.OTS_MSR_SAMPLE_STATUS.PAUSED)
                     {
@@ -349,8 +349,6 @@ namespace OTSMeasureApp
 
                         if (iHeight > 0 && iWidth > 0)
                         {
-
-                           
                             m_OTSMeasureResult.Field_BSE_DATA(MSTMsg);
                         }
                         else
@@ -498,7 +496,7 @@ namespace OTSMeasureApp
             
 
                 List<COTSSample> MeasureCompleteSampleList = new List<COTSSample>();
-                
+                MeasureCompleteSampleList = m_measure.GetListMeasurableSamples();
 
 
                 DateTime DTime = new DateTime();

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

@@ -769,8 +769,8 @@ namespace OTSModelSharp
 
                     m_Sample.GetMsrStatus().SetStatus(OTS_MSR_SAMPLE_STATUS.SUCCESSED);
 
-                   
-                   curFld.SetIsMeasureComplete(true);
+
+                    curFld.SetIsMeasureComplete(true);
 
                    
                  

+ 18 - 5
OTSIncAMeasureApp/1-OTSMeasure/Measure/3-MeasureFlow/MsrThreadStatus.cs

@@ -132,16 +132,15 @@ namespace OTSModelSharp
             {
                 if (m_timeStart == new DateTime())
                 {
-                    m_timeStart = DateTime.Now;
+                    m_timeStart = DateTime.Now; //OleDateTime.GetCurrentTime();
                     m_timeStartCur = m_timeStart;
-
+                    m_timeUsedLast = m_timeUsed;
                 }
                 else
                 {
                     m_timeStartCur = DateTime.Now;
                     m_timeUsedLast = m_timeUsed;
                 }
-                //m_timeEnd = DateTime.Now;
             }
             else if (a_nType == OTS_THREAD_TIME_TYPE.STOPPED)
             {
@@ -164,9 +163,23 @@ namespace OTSModelSharp
 
                
             }
-            else
+            else if (a_nType == OTS_THREAD_TIME_TYPE.COMPLT)
             {
-                return false;
+                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;
+                }
+
+
             }
 
             return true;

+ 9 - 5
OTSIncAMeasureApp/1-OTSMeasure/Measure/ParamData/COTSMsrPrjResultData.cs

@@ -559,7 +559,8 @@ namespace OTSModelSharp
             // file open dialog
             SaveFileDialog saveFileDialog = new SaveFileDialog();
             saveFileDialog.FileName = m_strPathName.Split('\\')[m_strPathName.Split('\\').Length - 1];
-            saveFileDialog.Filter = "Probject Files (*.prj)|*.prj|All files (*.*)|*.*";
+            saveFileDialog.Filter = "Directory (*.*)|*.*";
+            saveFileDialog.AddExtension=false;
             if (saveFileDialog.ShowDialog() != DialogResult.OK)
             {
                 return false;
@@ -568,13 +569,16 @@ namespace OTSModelSharp
             // get file pathname
             strPathName = saveFileDialog.FileName;
             string DirectoryName = Path.GetDirectoryName(strPathName);
-            DirectoryInfo Folder = new DirectoryInfo(DirectoryName);
-            List<string> FolderNames = new List<string>();
-            if (Folder.GetDirectories().Length != 0)
+            try
+            {
+                Directory.CreateDirectory(strPathName);
+            }
+            catch
             {
-                MessageBox.Show("Save failed, a folder exists in the current location, delete or create a new one!", "Tip", MessageBoxButtons.OK, MessageBoxIcon.Warning);
+                MessageBox.Show("CreateDirectoryFailed!");
                 return false;
             }
+            strPathName += "\\"+Path.GetFileNameWithoutExtension(strPathName) + ".prj";
             //保存测量项目文件 .prj
             XmlDocument doc = new XmlDocument();
             //添加xml文件头申明

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

@@ -111,7 +111,7 @@ namespace OTSMeasureApp
                         m_OTSMeasureResultWindow = m_MeasureApp.m_MeasureResultWindow;
                     }
                     //设置工作样品
-                    //m_MeasureApp.m_ProjParam.SetWorkSample(m_OTSSamplespaceWindow.GetWorkingVisualSample().GetSampleName());
+                    m_MeasureApp.m_ProjParam.SetWorkSample(m_OTSSamplespaceWindow.GetWorkingVisualSample().GetSampleName());
                     //获取工作样品信息
                     COTSSample WSample = m_MeasureApp.m_ProjParam.GetWorkSample();
                     CMsrResultItems MsrResults = WSample.GetMsrResults();
@@ -150,7 +150,7 @@ namespace OTSMeasureApp
                 m_MeasureCheckReportInfoWindow = new MeasureCheckResultInfoWindow();
             }
             SetMeasureResultInfo(sMSR);
-            //m_MeasureCheckReportInfoWindow.Activate();
+            m_MeasureCheckReportInfoWindow.Activate();
             m_MeasureCheckReportInfoWindow.Show();
            
         }