Explorar o código

三点法 ———— 缩放及读取sem数据

CXS %!s(int64=3) %!d(string=hai) anos
pai
achega
3a170b5fff

+ 2 - 2
OTS.sln

@@ -62,8 +62,8 @@ Global
 		Release|x86 = Release|x86
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{3FBF0B16-5E6C-4AA1-995B-471C47C5367D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{3FBF0B16-5E6C-4AA1-995B-471C47C5367D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{3FBF0B16-5E6C-4AA1-995B-471C47C5367D}.Debug|Any CPU.ActiveCfg = Debug|x64
+		{3FBF0B16-5E6C-4AA1-995B-471C47C5367D}.Debug|Any CPU.Build.0 = Debug|x64
 		{3FBF0B16-5E6C-4AA1-995B-471C47C5367D}.Debug|x64.ActiveCfg = Debug|x64
 		{3FBF0B16-5E6C-4AA1-995B-471C47C5367D}.Debug|x64.Build.0 = Debug|x64
 		{3FBF0B16-5E6C-4AA1-995B-471C47C5367D}.Debug|x86.ActiveCfg = Debug|Any CPU

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

@@ -1389,9 +1389,7 @@ namespace OTSMeasureApp
             }
             else if(measureItem.CreateType == (int)CreateRectangleType.CircleByThreePoints)
             {
-                GraphicsPath PolygonMeasurePath = new GraphicsPath();
-                PolygonMeasurePath.AddPolygon(measureItem.PolygonPointRegionF.ToArray());
-                GPath = PolygonMeasurePath;
+                GPath.AddEllipse(rectPara);
             }
             else
             {

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

@@ -1136,11 +1136,12 @@ namespace OTSMeasureApp
                     if (m_PolygonPoint.Count == 3)
                     {
                         //转为圆形这里
-                        //m_DrawMeasureType = (int)CreateRectangleType.Circle;
+                        m_DrawMeasureType = (int)CreateRectangleType.Circle;
                         float r = 0;
                         PointF Centerpoint = new PointF();
                         GetTriangleExcenterRadius(m_PolygonPoint[0], m_PolygonPoint[1], m_PolygonPoint[2], out r, out Centerpoint);
-                        RectangleF rectangleThree = new RectangleF(new PointF(Centerpoint.X-r, Centerpoint.Y-r), new SizeF(r*2, r*2));
+                        //RectangleF rectangleThree = new RectangleF(new PointF((Centerpoint.X-r) / m_GlobalZoomNum, (Centerpoint.Y-r) / m_GlobalZoomNum), new SizeF(r*2 / m_GlobalZoomNum, r*2 / m_GlobalZoomNum));
+                        RectangleF rectangleThree = new RectangleF(new PointF(Centerpoint.X - r, Centerpoint.Y - r), new SizeF(r * 2, r * 2));
                         //在样品台内部缩放
                         if (OTSSamplespaceGraphicsPanelFun.CheckMeasureAreaIsBeyondStageArea(new Rectangle(new Point((int)(Centerpoint.X - r), (int)(Centerpoint.Y - r)), new Size((int)r * 2, (int)r * 2)), m_RectangleGDIObjects[0].Region, (int)CreateRectangleType.Circle))
                         {
@@ -1154,7 +1155,8 @@ namespace OTSMeasureApp
                         Color MeasureColor = Color.Red;
                         CreateRectangle createRectangle = new CreateRectangle(rectangleThree, m_PolygonPoint[0], (int)CreateRectangleType.CircleByThreePoints, m_DrawMeasureType, sampleName, sampleName, MeasureColor);
                         //在鼠标点击时添加一个默认大小与位置的图形
-                        createRectangle.RegionF = createRectangle.Region;
+                        //createRectangle.RegionF = createRectangle.Region;
+                        createRectangle.RegionF = new RectangleF(createRectangle.RegionF.X / m_GlobalZoomNum, createRectangle.RegionF.Y / m_GlobalZoomNum, createRectangle.RegionF.Width / m_GlobalZoomNum, createRectangle.RegionF.Height / m_GlobalZoomNum);
                         createRectangle.DrawRegionF = createRectangle.Region;
                         if (m_DrawMeasureGDIObjects.Count > 0)
                         {
@@ -1184,6 +1186,16 @@ namespace OTSMeasureApp
                         }
                         m_MeasureGDIObjects.Add(m_DrawMeasureGDIObjects[0]);
                         m_DrawMeasureGDIObjects.Clear();
+                        if (OTSSamplespaceGraphicsPanelFun.SetWorkSamplHoleAndMeasureArea(m_MeasureGDIObjects[0], m_MeasureAppForm, m_OTSSampleStageData, m_RectangleGDIObjects[0], IsWidth, Width, Height, m_WDomain))
+                        {
+                            m_MeasureAppForm.m_MessageStates = (int)MessageState.StartMeasure;
+                            CMeasureThreadWrapper.DoRunType = (int)MSR_THREAD_RunSTATUS.RUNMEASURE;
+                            //showSingleInfo();
+                            // 设置工作样品
+                            m_MeasureAppForm.Rev_SoluWindowReqSwitchWSample_Event(m_SampleSelectName);
+                            Invalidate();
+                        }
+
                         //设置手绘标识
                         m_IsDrawMeasureReady = false;
                         this.Cursor = Cursors.Default;
@@ -2671,7 +2683,6 @@ namespace OTSMeasureApp
                         if (m_DrawMeasureGDIObjects[i] != null)
                         {
                             m_DrawMeasureGDIObjects[i].EndPoint = this.m_MouseMovePoint;
-                            log.Trace("aaa");
                             m_DrawMeasureGDIObjects[i].OnPaint(e);
                         }
                     }