瀏覽代碼

修改 测量程序加载已测试过的样品时 清楚数据的报错问题(现在用的trycatch后续有时间修改数据库读取方式非流reader)

cxs 1 年之前
父節點
當前提交
8127300ead

+ 10 - 3
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/OTSSamplespaceWindow.cs

@@ -233,9 +233,16 @@ namespace OTSMeasureApp
                 case "DeleteSampleData":
                     if (MessageBox.Show("The result data of this sample will be deleted, continue?", "DeleteData", MessageBoxButtons.OKCancel) == DialogResult.OK)
                     {
-                        m_MeasureAppForm.DeleteCurrentSampleData();
-                        m_MeasureAppForm.m_MeasureResultWindow.SetInit();
-                        PrepareMeasureField(GetWorkingVisualSample(), MSR_RUN_TYPE.RUNMEASURE);
+                        try
+                        {
+                            m_MeasureAppForm.DeleteCurrentSampleData();
+                            m_MeasureAppForm.m_MeasureResultWindow.SetInit();
+                            PrepareMeasureField(GetWorkingVisualSample(), MSR_RUN_TYPE.RUNMEASURE);
+                        }
+                        catch(Exception ex)
+                        {
+                            MessageBox.Show(ex.ToString());
+                        }
                     }
                     break;
                 case "SlopFocusMenuItem":

+ 8 - 8
OTSIncAMeasureApp/6-OTSDisplayTreeViewData/OTSSolutionWindow.cs

@@ -320,14 +320,14 @@ namespace OTSMeasureApp
                 {
                     //当前工作样品的测量区域 获取帧图信息
                     int CompletedFieldsCount = cSample.GetMsrStatus().GetCompletedFields();
-                    if (CompletedFieldsCount > 0)
-                    {
-                        ClearMeasureData.Visible = true;
-                    }
-                    else
-                    {
-                        ClearMeasureData.Visible = false;
-                    }
+                    //if (CompletedFieldsCount > 0)
+                    //{
+                    //    ClearMeasureData.Visible = true;
+                    //}
+                    //else
+                    //{
+                    ClearMeasureData.Visible = false;
+                    //}
                 }
                 CurrentNode.ContextMenuStrip = RightClickCheckContextMenuStrip;