Browse Source

minor improvements on the variable naming and some notation in C#

gsp 3 years ago
parent
commit
d7aae5519f

+ 2 - 2
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/CStageManage.cs

@@ -58,7 +58,7 @@ namespace OTSMeasureApp
                                 NewSample.DrawRegionF = items.DrawRegionF;
                                 //绘制样品路径
                                 GraphicsPath NewSamplePath = new GraphicsPath();
-                                if (NewSample.Shape == (int)CreateRectangleType.CirCle)
+                                if (NewSample.Shape == (int)CreateRectangleType.Circle)
                                 {
                                     NewSamplePath.AddEllipse(NewSample.Region);
                                 }
@@ -631,7 +631,7 @@ namespace OTSMeasureApp
                                 itemMeasure.DrawRegionF = new RectangleF(itemMeasure.DrawRegionF.X, itemMeasure.DrawRegionF.Y, itemMeasure.DrawRegionF.Height, itemMeasure.DrawRegionF.Height);
                                 itemMeasure.Shape = iShape;
                                 GraphicsPath NewMeasurePath = new GraphicsPath();
-                                if (itemMeasure.Shape == (int)CreateRectangleType.CirCle)
+                                if (itemMeasure.Shape == (int)CreateRectangleType.Circle)
                                 {
                                     NewMeasurePath.AddEllipse(itemMeasure.Region);
                                 }

+ 6 - 6
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/CreateRectangle.cs

@@ -530,7 +530,7 @@ namespace OTSMeasureApp
                 e.Graphics.DrawPath(Pens.Black, grPath);
             }
             //样品台-圆形
-            else if (createType == (int)CreateRectangleType.SampleBackGround_CirCle)
+            else if (createType == (int)CreateRectangleType.SampleBackGround_Circle)
             {
                 //获取颜色
                 string ColorStr = OTSSamplespaceGraphicsPanelFun.GetColorValue(ColorType.SampleBackGroundColor);
@@ -543,7 +543,7 @@ namespace OTSMeasureApp
                 e.Graphics.DrawEllipse(Pens.Black, m_Region);
             }
             //圆形
-            else if (createType == (int)CreateRectangleType.CirCle)
+            else if (createType == (int)CreateRectangleType.Circle)
             {
                 System.Drawing.SolidBrush sampleBrush = new System.Drawing.SolidBrush(System.Drawing.Color.White);
                 e.Graphics.SmoothingMode = SmoothingMode.AntiAlias;  //图片柔顺模式选择
@@ -669,7 +669,7 @@ namespace OTSMeasureApp
                 e.Graphics.FillRectangle(sampleBrush, m_Region);
             }
             //绘制标样
-            else if (createType == (int)CreateRectangleType.SpecimenCirCle)
+            else if (createType == (int)CreateRectangleType.SpecimenCircle)
             {
                 Color myColor = System.Drawing.Color.Black;
                 System.Drawing.SolidBrush sampleBrush = new System.Drawing.SolidBrush(myColor);
@@ -922,9 +922,9 @@ namespace OTSMeasureApp
     public enum CreateRectangleType
     {
         //样品台-圆形
-        SampleBackGround_CirCle = -1,
+        SampleBackGround_Circle = -1,
         //圆形
-        CirCle = 0,
+        Circle = 0,
         //圆角矩形
         SampleBackGround_Rectangle = 1,
         //样品孔中的文字
@@ -940,7 +940,7 @@ namespace OTSMeasureApp
         //表样-矩形
         SpecimenRectangle = 7,
         //表样-圆形
-        SpecimenCirCle = 8,
+        SpecimenCircle = 8,
         //帧图-矩形绘制
         SingleRectangle = 9,
         //颗粒直线图

+ 1 - 1
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/OTSSamplespaceGraphicsPanelFun.cs

@@ -1389,7 +1389,7 @@ namespace OTSMeasureApp
             }
             else
             {
-                if (measureItem.Shape == (int)CreateRectangleType.CirCle)
+                if (measureItem.Shape == (int)CreateRectangleType.Circle)
                 {
                     GPath.AddEllipse(rectPara);
                 }

+ 3 - 2
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/OTSSamplespaceWindow.Designer.cs

@@ -1,6 +1,7 @@
 
 namespace OTSMeasureApp
 {
+    using  MyControls;
     partial class OTSSamplespaceWindow
     {
         /// <summary>
@@ -168,7 +169,7 @@ namespace OTSMeasureApp
             this.lblFocus.Size = new System.Drawing.Size(0, 12);
             this.lblFocus.TabIndex = 4;
             this.lblFocus.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
-            control_Ruler2 = new MyControls.Control_Ruler();
+            control_Ruler2 = new Control_Ruler();
             // 
             // OTSSamplespaceWindow
             // 
@@ -213,7 +214,7 @@ namespace OTSMeasureApp
         private System.Windows.Forms.ToolStripMenuItem DriveSEMToCenterLocation;
         private System.Windows.Forms.ToolStripMenuItem DriveSEMToCurrentLocation;
         private System.Windows.Forms.ToolStripMenuItem DeleteBSEPicture;
-        private MyControls.Control_Ruler control_Ruler2;
+        private Control_Ruler control_Ruler2;
         private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
         private System.Windows.Forms.ToolStripMenuItem ShootBSEPicture;
         private System.Windows.Forms.ToolStripMenuItem SetSemData;

+ 28 - 28
OTSIncAMeasureApp/4-OTSSamplespaceGraphicsPanel/OTSSamplespaceWindow.cs

@@ -23,15 +23,15 @@ namespace OTSMeasureApp
         public StageDrawingData m_OTSSampleStageData = null;
         //样品测量集合对象
         public List<SampleMeasurePara> m_SMeasrueAreaList = null;
-        //样品台存在的List集合
+        //样品台存在的List集合 the rectangle on the edge of  stage ,usually one.
         public static List<ARectangleGDIObject> m_RectangleGDIObjects;
-        //标样存在的List集合
+        //标样存在的List集合 usually it is a samll circle.
         public static List<ARectangleGDIObject> m_SpecimenGDIObjects;
         //样品孔的List集合
         string m_SampleHoleSelectName = string.Empty;
         public static string m_SampleSelectName = string.Empty;
         string m_MeasureSelectName = string.Empty;
-        public static List<ARectangleGDIObject> m_SampleHoleGDIObjects;
+        public static List<ARectangleGDIObject> m_SampleHoleGDIObjects;// the hole gdi of the stage 
         //样品的List集合
         string m_SelectName = string.Empty;
         public static ARectangleGDIObject selectSampleGDIObjects;
@@ -42,7 +42,7 @@ namespace OTSMeasureApp
         //测量区域
         public static List<ARectangleGDIObject> m_MeasureGDIObjects;
         //文字内容
-        public static List<ARectangleGDIObject> m_ContentGDIObjects;
+        public static List<ARectangleGDIObject> m_ContentGDIObjects;//the text that will display in the hole.
         //测量区域
         public static List<ARectangleGDIObject> m_MeasurePathGDIObjects;
         //帧图
@@ -224,7 +224,7 @@ namespace OTSMeasureApp
         public void Rev_DDrawCircleMeasure_MeasureAppToSampleWindow_Event()
         {
             //手绘测量区域类型为圆形
-            m_DrawMeasureType = (int)CreateRectangleType.CirCle;
+            m_DrawMeasureType = (int)CreateRectangleType.Circle;
             m_IsDrawMeasureReady = true;
             m_RectangIsDragging = false;
             this.Cursor = Cursors.Hand;
@@ -632,11 +632,11 @@ namespace OTSMeasureApp
         {
             GetSampleStageData(SStage, SEMStageData);
             m_GlobalZoomNum = 1;
-          var SData=  m_OTSSampleStageData ;
+        
             //清除所有绘制的图形信息
             ClearDrawInfo();
             //绘制样品台信息
-            DrawSampleStage(SData);
+            DrawSampleStage(m_OTSSampleStageData);
             //标尺初始化
             RulerInit();
             //重新绘制
@@ -764,7 +764,7 @@ namespace OTSMeasureApp
                 }
                 else
                 {
-                    CreateBourary = OTSSamplespaceGraphicsPanelFun.GetPixRect(widthDomain, xDomain, yDomain, (int)CreateRectangleType.SampleBackGround_CirCle, "", "", IsWidth, m_DefaultW, m_DefaultH);
+                    CreateBourary = OTSSamplespaceGraphicsPanelFun.GetPixRect(widthDomain, xDomain, yDomain, (int)CreateRectangleType.SampleBackGround_Circle, "", "", IsWidth, m_DefaultW, m_DefaultH);
                 }
                 //获取默认尺寸
                 m_DefaultWidth = CreateBourary.Region.Width;
@@ -772,7 +772,7 @@ namespace OTSMeasureApp
                 //添加样品台 对象
                 //设置路径
                 GraphicsPath MeasurePath = new GraphicsPath();
-                if (StageShape == (int)CreateRectangleType.CirCle)
+                if (StageShape == (int)CreateRectangleType.Circle)
                 {
                     MeasurePath.AddEllipse(CreateBourary.Region);
                 }
@@ -818,14 +818,14 @@ namespace OTSMeasureApp
                         }
                         else
                         {
-                            CreateHole = OTSSamplespaceGraphicsPanelFun.GetPixRect(widthDomain, xHole, yHole, (int)CreateRectangleType.CirCle, "", ChloeClrList[i].sSHoleName, IsWidth, m_DefaultW, m_DefaultH);
+                            CreateHole = OTSSamplespaceGraphicsPanelFun.GetPixRect(widthDomain, xHole, yHole, (int)CreateRectangleType.Circle, "", ChloeClrList[i].sSHoleName, IsWidth, m_DefaultW, m_DefaultH);
                         }
                         //获取样品孔默认尺寸
                         m_DefaultStageWidth = CreateHole.Region.Width;
                         m_DefaultStageHeight = CreateHole.Region.Height;
                         //绘制样品孔路径
                         GraphicsPath HolePath = new GraphicsPath();
-                        if (ChloeClrList[i].iSHoleShape == (int)CreateRectangleType.CirCle)
+                        if (ChloeClrList[i].iSHoleShape == (int)CreateRectangleType.Circle)
                         {
                             HolePath.AddEllipse(CreateHole.Region);
                         }
@@ -852,9 +852,9 @@ namespace OTSMeasureApp
 
                 //获取矩形
                 CreateRectangle CreateSTD = OTSSamplespaceGraphicsPanelFun.GetPixRect(widthDomain, xSTD, ySTD, (int)CreateRectangleType.Rectangle, "", "", IsWidth, m_DefaultW, m_DefaultH);
-                if (StageShapes == (int)CreateRectangleType.CirCle)
+                if (StageShapes == (int)CreateRectangleType.Circle)
                 {
-                    CreateSTD = OTSSamplespaceGraphicsPanelFun.GetPixRect(widthDomain, xSTD, ySTD, (int)CreateRectangleType.SpecimenCirCle, "", "", IsWidth, m_DefaultW, m_DefaultH);
+                    CreateSTD = OTSSamplespaceGraphicsPanelFun.GetPixRect(widthDomain, xSTD, ySTD, (int)CreateRectangleType.SpecimenCircle, "", "", IsWidth, m_DefaultW, m_DefaultH);
                 }
                 else
                 {
@@ -864,7 +864,7 @@ namespace OTSMeasureApp
                 m_DefaultSampleHeight = CreateSTD.Region.Height;
                 //绘制标样路径
                 GraphicsPath STDPath = new GraphicsPath();
-                if (StageShapes == (int)CreateRectangleType.CirCle)
+                if (StageShapes == (int)CreateRectangleType.Circle)
                 {
                     STDPath.AddEllipse(CreateSTD.Region);
                 }
@@ -1173,7 +1173,7 @@ namespace OTSMeasureApp
                                     {
                                         isSelMeasure = true;
                                         Rectangle rect = new Rectangle(e.Location, new Size(WH, WH));
-                                        int CheckShape = (int)CreateRectangleType.CirCle;
+                                        int CheckShape = (int)CreateRectangleType.Circle;
                                         if (m_MeasureGDIObjects[0].Shape == (int)CreateRectangleType.SampleBackGround_Rectangle)
                                         {
                                             CheckShape = (int)CreateRectangleType.SampleBackGround_Rectangle;
@@ -1251,7 +1251,7 @@ namespace OTSMeasureApp
                             }
                             Rectangle rect = new Rectangle(e.Location, new Size(WH, WH));
                             //判断样品形状
-                            int CheckShape = (int)CreateRectangleType.CirCle;
+                            int CheckShape = (int)CreateRectangleType.Circle;
                             if (m_MeasureGDIObjects[0].Shape == (int)CreateRectangleType.SampleBackGround_Rectangle)
                             {
                                 CheckShape = (int)CreateRectangleType.SampleBackGround_Rectangle;
@@ -1300,7 +1300,7 @@ namespace OTSMeasureApp
                         if (item.Region.Contains(e.Location))
                         {
                             Rectangle rect = new Rectangle(e.Location, new Size(WH, WH));
-                            int CheckShape = (int)CreateRectangleType.CirCle;
+                            int CheckShape = (int)CreateRectangleType.Circle;
                             if (item.Shape == (int)CreateRectangleType.SampleBackGround_Rectangle)
                             {
                                 CheckShape = (int)CreateRectangleType.SampleBackGround_Rectangle;
@@ -1636,7 +1636,7 @@ namespace OTSMeasureApp
                         switch (enumMouse)
                         {
                             case OTSSamplespaceGraphicsPanelFun.EnumMousePointPosition.MouseSizeTopLeft:
-                                if (m_DrawMeasureType == (int)CreateRectangleType.CirCle)
+                                if (m_DrawMeasureType == (int)CreateRectangleType.Circle)
                                 {
                                     LTPoint.X = m_MouseDownPoint.X - tmp;
                                     LTPoint.Y = m_MouseDownPoint.Y - tmp;
@@ -1654,7 +1654,7 @@ namespace OTSMeasureApp
                                 }
                                 break;
                             case OTSSamplespaceGraphicsPanelFun.EnumMousePointPosition.MouseSizeTopRight:
-                                if (m_DrawMeasureType == (int)CreateRectangleType.CirCle)
+                                if (m_DrawMeasureType == (int)CreateRectangleType.Circle)
                                 {
                                     LTPoint.X = m_MouseDownPoint.X;
                                     LTPoint.Y = m_MouseDownPoint.Y - tmp;
@@ -1672,7 +1672,7 @@ namespace OTSMeasureApp
                                 }
                                 break;
                             case OTSSamplespaceGraphicsPanelFun.EnumMousePointPosition.MouseSizeBottomLeft:
-                                if (m_DrawMeasureType == (int)CreateRectangleType.CirCle)
+                                if (m_DrawMeasureType == (int)CreateRectangleType.Circle)
                                 {
                                     LTPoint.X = m_MouseDownPoint.X - tmp;
                                     LTPoint.Y = m_MouseDownPoint.Y;
@@ -1690,7 +1690,7 @@ namespace OTSMeasureApp
                                 }
                                 break;
                             case OTSSamplespaceGraphicsPanelFun.EnumMousePointPosition.MouseSizeBottomRight:
-                                if (m_DrawMeasureType == (int)CreateRectangleType.CirCle)
+                                if (m_DrawMeasureType == (int)CreateRectangleType.Circle)
                                 {
                                     LTPoint.X = m_MouseDownPoint.X;
                                     LTPoint.Y = m_MouseDownPoint.Y;
@@ -1766,7 +1766,7 @@ namespace OTSMeasureApp
                                                         Rectangle rectTemp = item.Region;
                                                         rectTemp.X = item.Region.Left + e.X - item.DraggingPoint.X;
                                                         rectTemp.Y = item.Region.Top + e.Y - item.DraggingPoint.Y;
-                                                        int CheckShape = (int)CreateRectangleType.CirCle;
+                                                        int CheckShape = (int)CreateRectangleType.Circle;
                                                         if (m_RectangleGDIObjects[0].Shape == (int)CreateRectangleType.SampleBackGround_Rectangle)
                                                         {
                                                             CheckShape = (int)CreateRectangleType.SampleBackGround_Rectangle;
@@ -1808,7 +1808,7 @@ namespace OTSMeasureApp
                                                         Rectangle rectTemp = item.Region;
                                                         rectTemp.X = item.Region.Left + e.X - item.DraggingPoint.X;
                                                         rectTemp.Y = item.Region.Top + e.Y - item.DraggingPoint.Y;
-                                                        int CheckShape = (int)CreateRectangleType.CirCle;
+                                                        int CheckShape = (int)CreateRectangleType.Circle;
                                                         if (m_RectangleGDIObjects[0].Shape == (int)CreateRectangleType.SampleBackGround_Rectangle)
                                                         {
                                                             CheckShape = (int)CreateRectangleType.SampleBackGround_Rectangle;
@@ -1886,7 +1886,7 @@ namespace OTSMeasureApp
                                         //获取鼠标坐标
                                         Point xy2 = e.Location;
                                         Rectangle rectTemp = new Rectangle();
-                                        int CheckShape = (int)CreateRectangleType.CirCle;
+                                        int CheckShape = (int)CreateRectangleType.Circle;
                                         if (item.CreateType == (int)CreateRectangleType.Polygon)
                                         {
                                             if (m_IsSelPolygonPoint)
@@ -2771,7 +2771,7 @@ namespace OTSMeasureApp
             Rectangle rectTemp = item.Region;
             rectTemp.X = item.Region.Left + e.X - item.DraggingPoint.X;
             rectTemp.Y = item.Region.Top + e.Y - item.DraggingPoint.Y;
-            int CheckShape = (int)CreateRectangleType.CirCle;
+            int CheckShape = (int)CreateRectangleType.Circle;
             if (m_RectangleGDIObjects[0].Shape == (int)CreateRectangleType.SampleBackGround_Rectangle)
             {
                 CheckShape = (int)CreateRectangleType.SampleBackGround_Rectangle;
@@ -2808,7 +2808,7 @@ namespace OTSMeasureApp
             if (item.Shape == (int)CreateRectangleType.Polygon)
             {
                 //判断样品台形状
-                int CheckShape = (int)CreateRectangleType.CirCle;
+                int CheckShape = (int)CreateRectangleType.Circle;
                 if (m_RectangleGDIObjects[0].Shape == (int)CreateRectangleType.SampleBackGround_Rectangle)
                 {
                     CheckShape = (int)CreateRectangleType.SampleBackGround_Rectangle;
@@ -2885,7 +2885,7 @@ namespace OTSMeasureApp
             rectTemp.Y = m_StageCenterPoint.Y - semLocation.Y;// - rectTemp.Height/ 2;
             rectTemp.Width = 2;
             rectTemp.Height = 2;
-            int CheckShape = (int)CreateRectangleType.CirCle;
+            int CheckShape = (int)CreateRectangleType.Circle;
             if (m_RectangleGDIObjects[0].Shape == (int)CreateRectangleType.SampleBackGround_Rectangle)
             {
                 CheckShape = (int)CreateRectangleType.SampleBackGround_Rectangle;
@@ -4527,7 +4527,7 @@ namespace OTSMeasureApp
                     {
                         if (m_MeasureGDIObjects[i].IsWorkSample)
                         {
-                            ARectangleGDIObject m_ResetMeasureGDIobjects = CStageManage.ResetMeasure((int)CreateRectangleType.CirCle, itemSample, m_MeasureGDIObject, m_GlobalZoomNum);
+                            ARectangleGDIObject m_ResetMeasureGDIobjects = CStageManage.ResetMeasure((int)CreateRectangleType.Circle, itemSample, m_MeasureGDIObject, m_GlobalZoomNum);
                             m_MeasureGDIObjects[i].Region = m_ResetMeasureGDIobjects.Region;
                             m_MeasureGDIObjects[i].RegionF = m_ResetMeasureGDIobjects.RegionF;
                             m_MeasureGDIObjects[i].DrawRegionF = m_ResetMeasureGDIobjects.DrawRegionF;

+ 1 - 1
OTSIncAMeasureApp/5-OTSMeasureStatuImageFun/OTSMeasureStatusWindow.cs

@@ -1375,7 +1375,7 @@ namespace OTSMeasureApp
             }
             else
             {
-                CreateBourary = OTSSamplespaceGraphicsPanelFun.GetPixRect(widthDomain, xDomain, yDomain, (int)CreateRectangleType.SampleBackGround_CirCle, "", "", IsWidth, this.Width, this.Height);
+                CreateBourary = OTSSamplespaceGraphicsPanelFun.GetPixRect(widthDomain, xDomain, yDomain, (int)CreateRectangleType.SampleBackGround_Circle, "", "", IsWidth, this.Width, this.Height);
 
             }
             //获取SEM位置

+ 1 - 0
OTSIncAMeasureApp/OTSIncAMeasureApp.csproj

@@ -507,6 +507,7 @@
     <None Include="0-OTSModel\OTSDataType\COTSSample.cd" />
     <None Include="1-OTSMeasure\MeasureRetThread.cd" />
     <None Include="2-OTSMeasureParamManage\MeasureParam.cd" />
+    <None Include="4-OTSSamplespaceGraphicsPanel\GDIUIClass.cd" />
     <None Include="app.manifest" />
     <None Include="packages.config" />
     <None Include="Properties\Settings.settings">