Przeglądaj źródła

修改OTSSamplespaceWindow类

sunyi 5 lat temu
rodzic
commit
4b9d69b110

+ 3 - 3
OTS/OTSIncAMeasureApp/OTSDataMgrFunction/OTSDataMgrFun.cs

@@ -380,11 +380,11 @@ namespace OTSIncAMeasureApp
         }
 
         //将Sem 坐标转换为样品台坐标
-        public System.Windows.Point ConverSEMToOTSPoint(System.Drawing.Point PSEMCoord)
+        public System.Drawing.Point ConverSEMToOTSPoint(System.Drawing.Point PSEMCoord)
         {
             ValueType VOTSCoord = new System.Windows.Point();
             m_StageFile.ConverSEMToOTSPoint(PSEMCoord, (System.Drawing.Point)VOTSCoord);
-            return (System.Windows.Point)VOTSCoord;
+            return (System.Drawing.Point)VOTSCoord;
         }
 
         //添加样品
@@ -1619,7 +1619,7 @@ namespace OTSIncAMeasureApp
 
 
         // 获取测量样品中之前已经测量完成Field帧图,(上一次未测量完成继续测试)
-        public bool GetBeforeCompleteField(ref string MsrSampleName, ref List<System.Windows.Point> FieldList)
+        public bool GetBeforeCompleteField(ref string MsrSampleName, ref List<System.Drawing.Point> FieldList)
         {
             COTSSample WSample = m_ProjDataMgr.GetWorkingSample();
             if (null == WSample)

+ 34 - 30
OTS/OTSIncAMeasureApp/OTSSamplespaceWindow.cs

@@ -9,6 +9,8 @@ using OTSIncAMeasureApp.OTSSamplespaceGraphicsPanel;
 using OTSIncAMeasureApp.OTSMeasureThread;
 
 using System.Collections;
+using OTSModelSharp;
+using OTSDataType;
 
 namespace OTSIncAMeasureApp
 {
@@ -92,6 +94,8 @@ namespace OTSIncAMeasureApp
         public static double m_PropIWDistance = 0;
         public static double m_PropDMagni = 0;
 
+        public static NLog.Logger Nloger = NLog.LogManager.GetCurrentClassLogger();
+
         #region 鼠标滚动所需参数
         public static float m_ScaleNum = 1;
         public static float m_GlobalZoomNum = 1;//记录每次比例缩放后的总体比例系数。
@@ -299,15 +303,15 @@ namespace OTSIncAMeasureApp
                         if (m_SingleGDIObjects.Count == 0)
                         {
                             string message = table["message1"].ToString();
-                            m_MeasureAppForm.Nloger.TraceLog("Rev_MeasureApp_SwitchWorkSample_Event:--"+ message + "--begin--");
+                            Nloger.Trace("Rev_MeasureApp_SwitchWorkSample_Event:--"+ message + "--begin--");
                             showSingleInfo();
-                            m_MeasureAppForm.Nloger.TraceLog("Rev_MeasureApp_SwitchWorkSample_Event:--" + message + "--end--");
+                            Nloger.Trace("Rev_MeasureApp_SwitchWorkSample_Event:--" + message + "--end--");
                             break;
                         }
                     }
                 }
                 ////绘制已完成的帧图状态
-                CProjMgrClr cProjMgrClr = m_MeasureAppForm.m_DataMgrFun.m_ProjDataMgr;
+                COTSProjMgrFile cProjMgrClr = m_MeasureAppForm.m_DataMgrFun.m_ProjDataMgr;
                 //当前工作样品的测量区域 获取帧图信息
                 m_CompletedFieldsCount = cProjMgrClr.GetWorkingSample().GetMsrStatus().GetCompletedFields();
                 if (m_CompletedFieldsCount > 0)
@@ -317,7 +321,7 @@ namespace OTSIncAMeasureApp
                         showSingleInfo();
                     }
                     //获取已完成测量的帧图中心点
-                    List<Point> CompleteFieldList = cProjMgrClr.GetWorkingSample().GetMsrStatus().GetCpltedCenter();
+                    List<Point> CompleteFieldList = cProjMgrClr.GetWorkingSample().GetMsrStatus().GetCompletedFieldsCenter();
                     //修改帧图完成状态
                     OTSMeasureResult.ChangeCompleteFieldMeasureState(CompleteFieldList, Color.Green);
                 }
@@ -331,7 +335,7 @@ namespace OTSIncAMeasureApp
             {
                 string message = table["message2"].ToString();
                 //记录错误日志
-                m_MeasureAppForm.Nloger.TraceLog("Rev_MeasureApp_SwitchWorkSample_Event():"+ message + ":" + ex.ToString() + "");
+                Nloger.Trace("Rev_MeasureApp_SwitchWorkSample_Event():"+ message + ":" + ex.ToString() + "");
             }
         }
 
@@ -358,7 +362,7 @@ namespace OTSIncAMeasureApp
             {
                 string message = table["message2"].ToString();
                 //记录错误日志
-                m_MeasureAppForm.Nloger.TraceLog("Rev_MeasureApp_ChangeWorkSampleName_Event():"+ message + ":" + ex.ToString() + "");
+                Nloger.Trace("Rev_MeasureApp_ChangeWorkSampleName_Event():"+ message + ":" + ex.ToString() + "");
             }
         }
 
@@ -404,7 +408,7 @@ namespace OTSIncAMeasureApp
             {
                 string message = table["message2"].ToString();
                 //记录错误日志
-                m_MeasureAppForm.Nloger.TraceErrorLog("Rev_MeasureApp_DeleteWorkSample_Event():"+ message + ":" + ex.ToString() + "");
+                Nloger.Error("Rev_MeasureApp_DeleteWorkSample_Event():"+ message + ":" + ex.ToString() + "");
             }
         }
 
@@ -452,7 +456,7 @@ namespace OTSIncAMeasureApp
             {
                 string message = table["message2"].ToString();
                 //记录错误日志
-                m_MeasureAppForm.Nloger.TraceErrorLog("changeShape():"+ message + ":" + ex.ToString() + "");
+               Nloger.Error("changeShape():"+ message + ":" + ex.ToString() + "");
             }
         }
         #endregion
@@ -495,7 +499,7 @@ namespace OTSIncAMeasureApp
             {
                 string message = table["message2"].ToString();
                 //记录错误日志
-                m_MeasureAppForm.Nloger.TraceErrorLog("changeShape():"+ message + ":" + ex.ToString() + "");
+                Nloger.Error("changeShape():"+ message + ":" + ex.ToString() + "");
             }
         }
         #endregion
@@ -544,7 +548,7 @@ namespace OTSIncAMeasureApp
             {
                 string message = table["message2"].ToString();
                 //记录错误日志
-                m_MeasureAppForm.Nloger.TraceErrorLog("OTSSamplespaceWindow_Rev_MeasureApp_AddSample_Event():--"+ message + ":" + ex.ToString() + "");
+                Nloger.Error("OTSSamplespaceWindow_Rev_MeasureApp_AddSample_Event():--"+ message + ":" + ex.ToString() + "");
             }
         }
 
@@ -747,7 +751,7 @@ namespace OTSIncAMeasureApp
             catch (Exception ex)
             {
                 string message = table["message2"].ToString();
-                m_MeasureAppForm.Nloger.TraceErrorLog("OTSSamplespaceWindow_DrawSampleInfo():--"+ message + ":" + ex.ToString() + "");
+                Nloger.Error("OTSSamplespaceWindow_DrawSampleInfo():--"+ message + ":" + ex.ToString() + "");
             }
         }
         #endregion
@@ -815,7 +819,7 @@ namespace OTSIncAMeasureApp
             catch (Exception ex)
             {
                 string message = table["message2"].ToString();
-                m_MeasureAppForm.Nloger.TraceErrorLog("OTSSamplespaceWindow_OTSSamplespaceWindow_Load:--"+ message + ":" + ex.ToString() + "");
+                Nloger.Error("OTSSamplespaceWindow_OTSSamplespaceWindow_Load:--"+ message + ":" + ex.ToString() + "");
             }
         }
         protected override void OnMouseDown(MouseEventArgs e)
@@ -2581,14 +2585,14 @@ namespace OTSIncAMeasureApp
                 case "SetSemData":
                     double SemMag = 0;
                     double dDistance = 0;
-                    m_MeasureAppForm.Nloger.TraceLog("OTSSamplespaceWindow_CMStrip_ItemClicked:--begin--");
+                    Nloger.Trace("OTSSamplespaceWindow_CMStrip_ItemClicked:--begin--");
                     if (m_MeasureAppForm.m_DataMgrFun.GetMagAndDistance(ref SemMag, ref dDistance))
                     {
                         //设置SEM数据
                         bool IsTrue = SetSEMDATAMParameter(SemMag, dDistance);
                         if (!IsTrue)
                         {
-                            m_MeasureAppForm.Nloger.TraceErrorLog("OTSSamplespaceWindow_CMStrip_ItemClicked:--SetSemData:--Mag:" + SemMag + "--Distance:" + dDistance + "--");
+                           Nloger.Error("OTSSamplespaceWindow_CMStrip_ItemClicked:--SetSemData:--Mag:" + SemMag + "--Distance:" + dDistance + "--");
                         }
                     }
                     break;
@@ -2744,7 +2748,7 @@ namespace OTSIncAMeasureApp
             catch (Exception ex)
             {
                 string message = table["message2"].ToString();
-                m_MeasureAppForm.Nloger.TraceErrorLog("OTSSamplespaceWindow_ClearDrawInfo():--"+ message + ":" + ex.ToString() + "");
+               Nloger.Error("OTSSamplespaceWindow_ClearDrawInfo():--"+ message + ":" + ex.ToString() + "");
             }
         }
         public void ClearDrawInfo()
@@ -2808,7 +2812,7 @@ namespace OTSIncAMeasureApp
             catch (Exception ex)
             {
                 string message = table["message2"].ToString();
-                m_MeasureAppForm.Nloger.TraceErrorLog("OTSSamplespaceWindow_ClearDrawInfo():--"+ message + ":" + ex.ToString() + "");
+                Nloger.Error("OTSSamplespaceWindow_ClearDrawInfo():--"+ message + ":" + ex.ToString() + "");
             }
         }
         public void InvalidateDrawSingle()
@@ -2980,7 +2984,7 @@ namespace OTSIncAMeasureApp
                     //是否获取过帧图标识
                     bool IsSingle = false;
                     //获取当前工作的测量区域信息
-                    CDomainClr cDomainClr = new CDomainClr();
+                    CDomain cDomainClr = new CDomain();
                     int iShape = 0;
                     Rectangle Srect = new Rectangle();
                     //获取测量区域形状与位置
@@ -2996,7 +3000,7 @@ namespace OTSIncAMeasureApp
                                 iShape = sampleMeasure.iShape;
                                 Srect = sampleMeasure.MeasureRect;
                                 //设置测量区域形状
-                                cDomainClr.SetShape(iShape);
+                                cDomainClr.SetShape((DOMAIN_SHAPE)iShape);
                                 cDomainClr.SetRectDomain(Srect);
                                 //线程执行类型 1:测量类型 2:获取样品孔图片类型
                                 OTSMeasureThreadFun.DoRunType = (int)MSR_THREAD_RunSTATUS.RUNMEASURE;
@@ -3153,7 +3157,7 @@ namespace OTSIncAMeasureApp
             catch (Exception ex)
             {
                 string message = table["message2"].ToString();
-                m_MeasureAppForm.Nloger.TraceErrorLog("OTSSamplespaceWindow_CMStrip_ItemClicked:--"+ message + ":" + ex.ToString());
+                Nloger.Error("OTSSamplespaceWindow_CMStrip_ItemClicked:--"+ message + ":" + ex.ToString());
             }
         }
         #endregion
@@ -3269,7 +3273,7 @@ namespace OTSIncAMeasureApp
             catch (Exception ex)
             {
                 string message = table["message2"].ToString();
-                m_MeasureAppForm.Nloger.TraceErrorLog("OTSSamplespaceWindow_SetSEMCenterLocation_"+ message + ":" + ex.ToString());
+                Nloger.Error("OTSSamplespaceWindow_SetSEMCenterLocation_"+ message + ":" + ex.ToString());
             }
         }
         #endregion
@@ -3307,7 +3311,7 @@ namespace OTSIncAMeasureApp
             catch (Exception ex)
             {
                 string message = table["message3"].ToString();
-                m_MeasureAppForm.Nloger.TraceErrorLog("OTSSamplespaceWindow_"+ message + ":" + ex.ToString() + "");
+                Nloger.Error("OTSSamplespaceWindow_"+ message + ":" + ex.ToString() + "");
                 return false;
             }
         }
@@ -3342,7 +3346,7 @@ namespace OTSIncAMeasureApp
             catch (Exception ex)
             {
                 string message = table["message4"].ToString();
-                m_MeasureAppForm.Nloger.TraceErrorLog("OTSSamplespaceWindow_"+ message + ":" + ex.ToString() + "");
+                Nloger.Error("OTSSamplespaceWindow_"+ message + ":" + ex.ToString() + "");
                 return false;
             }
         }
@@ -3379,7 +3383,7 @@ namespace OTSIncAMeasureApp
             catch (Exception ex)
             {
                 string message = table["message5"].ToString();
-                m_MeasureAppForm.Nloger.TraceErrorLog("OTSSamplespaceWindow_"+ message + ":" + ex.ToString() + "");
+                Nloger.Error("OTSSamplespaceWindow_"+ message + ":" + ex.ToString() + "");
                 return false;
             }
         }
@@ -3444,11 +3448,11 @@ namespace OTSIncAMeasureApp
             }
             string message = table["message6"].ToString();
             //连接电镜连接
-            m_MeasureAppForm.Nloger.TraceLog("--"+ message + "--");
+            Nloger.Trace("--"+ message + "--");
             bool result = m_SEMDATAFieldManage.InitAndConntion();
             if (result)
             {
-                m_MeasureAppForm.Nloger.TraceLog("--" + message + ":True--");
+                Nloger.Trace("--" + message + ":True--");
             }
             return result;
         }
@@ -3651,7 +3655,7 @@ namespace OTSIncAMeasureApp
             catch (Exception ex)
             {
                 string message = table["message9"].ToString();
-                m_MeasureAppForm.Nloger.TraceLog(message + ex.ToString());
+                Nloger.Trace(message + ex.ToString());
             }
         }
         public void DeleteHoleBSEImageDataNoMessageBox()
@@ -3739,7 +3743,7 @@ namespace OTSIncAMeasureApp
         public void GetBSEPictures()
         { 
             //获取当前工作的测量区域信息
-            CDomainClr cDomainClr = new CDomainClr();
+            CDomain cDomainClr = new CDomain();
             int iShape = 0;
             Rectangle Srect = new Rectangle();
             //拍摄样品孔BSE照片
@@ -3761,7 +3765,7 @@ namespace OTSIncAMeasureApp
                                 iShape = sampleHolePara.iShape;
                                 Srect = sampleHolePara.SampleHoleRect;
                                 //设置测量区域形状
-                                cDomainClr.SetShape(iShape);
+                                cDomainClr.SetShape((DOMAIN_SHAPE)iShape);
                                 cDomainClr.SetRectDomain(Srect);
                                 //开始获取样品孔中的照片
                                 m_MeasureAppForm.StartSampleHoleBSEImage((int)MSR_THREAD_RunSTATUS.RUNSampleHoleImage, sampleHoleIndex, cDomainClr);
@@ -3783,7 +3787,7 @@ namespace OTSIncAMeasureApp
                             iShape = sampleHolePara.iShape;
                             Srect = sampleHolePara.SampleHoleRect;
                             //设置测量区域形状
-                            cDomainClr.SetShape(iShape);
+                            cDomainClr.SetShape((DOMAIN_SHAPE)iShape);
                             cDomainClr.SetRectDomain(Srect);
                             //开始获取样品孔中的照片
                             m_MeasureAppForm.StartSampleHoleBSEImage((int)MSR_THREAD_RunSTATUS.RUNSampleHoleImage, 2, cDomainClr);
@@ -3798,7 +3802,7 @@ namespace OTSIncAMeasureApp
         #region 复位工作样品区域
         public void ResetWorkSampleMeasure()
         {
-            COTSSampleClr WSample = m_MeasureAppForm.m_DataMgrFun.GetWorkSample();
+            COTSSample WSample = m_MeasureAppForm.m_DataMgrFun.GetWorkSample();
             OTSSampleMeaInfo MeasureInfo = new OTSSampleMeaInfo();
             if (!m_MeasureAppForm.m_DataMgrFun.GetWorkSamplePropertyVal(WSample, ref MeasureInfo))
             {