Browse Source

修改样品台编辑器bug

cxs 4 months ago
parent
commit
3a4f5d4636

+ 11 - 1
Bin/x64/Debug/Config/SysData/OTSStage.stg

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?xml version="1.0" encoding="UTF-8"?>
-<XMLData Modify="true" PathName=".\Config\SysData\OTSStage.stg" WorkingStageId="4">
+<XMLData Modify="true" PathName=".\Config\SysData\OTSStage.stg" WorkingStageId="5">
   <Collection RegName="Stagelist">
   <Collection RegName="Stagelist">
     <Member strName="圆形九圆孔50mm">
     <Member strName="圆形九圆孔50mm">
       <Member RegName="boundary" PolygonPoint="" rectDomian="0,0,50000,0" shape="0:ROUND" />
       <Member RegName="boundary" PolygonPoint="" rectDomian="0,0,50000,0" shape="0:ROUND" />
@@ -78,5 +78,15 @@
         <Member HoleName="18" rectDomian="-14500,-24500,12000,0" shape="0" />
         <Member HoleName="18" rectDomian="-14500,-24500,12000,0" shape="0" />
       </Collection>
       </Collection>
     </Member>
     </Member>
+    <Member strName="Apreo2S四孔方形台">
+      <Member RegName="boundary" PolygonPoint="" rectDomian="0,0,154000,154000" shape="1:RECTANGLE" />
+      <Member RegName="std" PolygonPoint="" rectDomian="0,0,2,0" shape="0:ROUND" />
+      <Collection RegName="Holes">
+        <Member HoleName="1" rectDomian="-23500,23500,47000,0" shape="0" />
+        <Member HoleName="2" rectDomian="23500,23500,47000,0" shape="0" />
+        <Member HoleName="3" rectDomian="23500,-23500,47000,0" shape="0" />
+        <Member HoleName="4" rectDomian="-23500,-23500,47000,0" shape="0" />
+      </Collection>
+    </Member>
   </Collection>
   </Collection>
 </XMLData>
 </XMLData>

+ 1 - 1
OTSIncAMeasureApp/7-OTSProgMgrInfo/Stage/DlgStageEdit.Designer.cs

@@ -85,7 +85,7 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             this.m_ctrlStagePicture.Location = new System.Drawing.Point(554, 10);
             this.m_ctrlStagePicture.Location = new System.Drawing.Point(554, 10);
             this.m_ctrlStagePicture.Margin = new System.Windows.Forms.Padding(2);
             this.m_ctrlStagePicture.Margin = new System.Windows.Forms.Padding(2);
             this.m_ctrlStagePicture.Name = "m_ctrlStagePicture";
             this.m_ctrlStagePicture.Name = "m_ctrlStagePicture";
-            this.m_ctrlStagePicture.Size = new System.Drawing.Size(570, 566);
+            this.m_ctrlStagePicture.Size = new System.Drawing.Size(570, 570);
             this.m_ctrlStagePicture.TabIndex = 2;
             this.m_ctrlStagePicture.TabIndex = 2;
             this.m_ctrlStagePicture.TabStop = false;
             this.m_ctrlStagePicture.TabStop = false;
             this.m_ctrlStagePicture.Paint += new System.Windows.Forms.PaintEventHandler(this.m_ctrlStagePicture_Paint);
             this.m_ctrlStagePicture.Paint += new System.Windows.Forms.PaintEventHandler(this.m_ctrlStagePicture_Paint);

+ 15 - 25
OTSIncAMeasureApp/7-OTSProgMgrInfo/Stage/DlgStageEdit.cs

@@ -453,31 +453,25 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             {
             {
                 nBounderyHeight = (int)(BounderyRect.Width);
                 nBounderyHeight = (int)(BounderyRect.Width);
             }
             }
-            double PixSize = 0;
+            double PixSizeX = 0;
+            double PixSizeY = 0;
             double coordinateSystemEndpoint /*= 0*/;
             double coordinateSystemEndpoint /*= 0*/;
-            if (nBounderyWidth > nBounderyHeight)
-            {
-                PixSize = (long)((double)nBounderyWidth / (double)(nWidth - StageDisplayHelp.PIC_EDGE * 2));
-                coordinateSystemEndpoint = nBounderyWidth/2;
-            }
-            else
-            {
-                PixSize = (long)((double)nBounderyHeight / (double)(nHeight - StageDisplayHelp.PIC_EDGE * 2));
-                coordinateSystemEndpoint = nBounderyHeight/2;
-            }
+            PixSizeX = (long)((double)nBounderyWidth / (double)(nWidth - StageDisplayHelp.PIC_EDGE * 2));
+            coordinateSystemEndpoint = nBounderyWidth/2;
+            PixSizeY = (long)((double)nBounderyHeight / (double)(nHeight - StageDisplayHelp.PIC_EDGE * 2));
             //draw boundery
             //draw boundery
             Brush pLTGrayBrush = new SolidBrush(Color.FromArgb(255, 0, 0));
             Brush pLTGrayBrush = new SolidBrush(Color.FromArgb(255, 0, 0));
-            stageDisplayHelp.DrawStageBoundery(Stage, nWidth, nHeight, pDC, PixSize);
+            stageDisplayHelp.DrawStageBoundery(Stage, nWidth, nHeight, pDC,PixSizeX,PixSizeY);
 
 
             //draw STD
             //draw STD
             Brush pBlackBrush = new SolidBrush(Color.FromArgb(255, 0, 0));
             Brush pBlackBrush = new SolidBrush(Color.FromArgb(255, 0, 0));
 
 
-            stageDisplayHelp.DrawStageSTD(Stage, nWidth, nHeight, pDC, PixSize);
+            stageDisplayHelp.DrawStageSTD(Stage, nWidth, nHeight, pDC, PixSizeX, PixSizeY);
 
 
             ////draw holes
             ////draw holes
             //Brush pWriteBrush = new SolidBrush(Color.FromArgb(255, 0, 0)); ;
             //Brush pWriteBrush = new SolidBrush(Color.FromArgb(255, 0, 0)); ;
 
 
-            stageDisplayHelp.DrawStageHole(Stage, nWidth, nHeight, pDC, PixSize);
+            stageDisplayHelp.DrawStageHole(Stage, nWidth, nHeight, pDC, PixSizeX, PixSizeY);
 
 
             // draw ratio
             // draw ratio
             stageDisplayHelp.DrawRatio(nBounderyWidth, nWidth, nHeight, pDC, (IntPtr)pWnd, rc);
             stageDisplayHelp.DrawRatio(nBounderyWidth, nWidth, nHeight, pDC, (IntPtr)pWnd, rc);
@@ -485,7 +479,7 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             {
             {
                 double coordinateSystemEndpointX = nBounderyWidth / 2;
                 double coordinateSystemEndpointX = nBounderyWidth / 2;
                 double coordinateSystemEndpointY = nBounderyHeight / 2;
                 double coordinateSystemEndpointY = nBounderyHeight / 2;
-                stageDisplayHelp.DrawXY(pDC, m_ctrlStagePicture.Width, m_ctrlStagePicture.Height, PixSize, coordinateSystemEndpointX, coordinateSystemEndpointY);
+                stageDisplayHelp.DrawXY(pDC, m_ctrlStagePicture.Width, m_ctrlStagePicture.Height, PixSizeX, PixSizeY, coordinateSystemEndpointX, coordinateSystemEndpointY);
             }
             }
 
 
             pLTGrayBrush.Dispose();
             pLTGrayBrush.Dispose();
@@ -626,22 +620,18 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
                 {
                 {
                     nBounderyHeight = 50000;
                     nBounderyHeight = 50000;
                 }
                 }
-                double PixSize = 0;
+                double PixSizeX = 0;
+                double PixSizeY = 0;
                 double coordinateSystemEndpointX = nBounderyWidth / 2;
                 double coordinateSystemEndpointX = nBounderyWidth / 2;
                 double coordinateSystemEndpointY= nBounderyHeight / 2;
                 double coordinateSystemEndpointY= nBounderyHeight / 2;
                 if(radioButton_BoundaryCircle.Checked)
                 if(radioButton_BoundaryCircle.Checked)
                 {
                 {
                     coordinateSystemEndpointY = coordinateSystemEndpointX;
                     coordinateSystemEndpointY = coordinateSystemEndpointX;
                 }
                 }
-                if (nBounderyWidth > nBounderyHeight)
-                {
-                    PixSize = (long)((double)nBounderyWidth / (double)(nWidth - StageDisplayHelp.PIC_EDGE * 2));
-                }
-                else
-                {
-                    PixSize = (long)((double)nBounderyHeight / (double)(nHeight - StageDisplayHelp.PIC_EDGE * 2));
-                }
-                stageDisplayHelp.DrawXY(pDC, m_ctrlStagePicture.Width, m_ctrlStagePicture.Height, PixSize, coordinateSystemEndpointX,coordinateSystemEndpointY);
+
+                PixSizeX = (long)((double)nBounderyWidth / (double)(nWidth - StageDisplayHelp.PIC_EDGE * 2));
+                PixSizeY = (long)((double)nBounderyHeight / (double)(nHeight - StageDisplayHelp.PIC_EDGE * 2));
+                stageDisplayHelp.DrawXY(pDC, m_ctrlStagePicture.Width, m_ctrlStagePicture.Height, PixSizeX, PixSizeY, coordinateSystemEndpointX,coordinateSystemEndpointY);
                 button_Coordinate.Text = "坐标系关闭";
                 button_Coordinate.Text = "坐标系关闭";
             }
             }
             else
             else

+ 25 - 37
OTSIncAMeasureApp/7-OTSProgMgrInfo/Stage/DlgStageMgr.Designer.cs

@@ -53,20 +53,17 @@
             this.groupBox1.Controls.Add(this.m_ctrlBtnApply);
             this.groupBox1.Controls.Add(this.m_ctrlBtnApply);
             this.groupBox1.Controls.Add(this.m_ctrlStagePicture);
             this.groupBox1.Controls.Add(this.m_ctrlStagePicture);
             this.groupBox1.Controls.Add(this.m_ctrlListBoxStageList);
             this.groupBox1.Controls.Add(this.m_ctrlListBoxStageList);
-            this.groupBox1.Location = new System.Drawing.Point(3, 2);
-            this.groupBox1.Margin = new System.Windows.Forms.Padding(4);
+            this.groupBox1.Location = new System.Drawing.Point(2, 1);
             this.groupBox1.Name = "groupBox1";
             this.groupBox1.Name = "groupBox1";
-            this.groupBox1.Padding = new System.Windows.Forms.Padding(4);
-            this.groupBox1.Size = new System.Drawing.Size(1046, 476);
+            this.groupBox1.Size = new System.Drawing.Size(614, 352);
             this.groupBox1.TabIndex = 0;
             this.groupBox1.TabIndex = 0;
             this.groupBox1.TabStop = false;
             this.groupBox1.TabStop = false;
             // 
             // 
             // button_New
             // button_New
             // 
             // 
-            this.button_New.Location = new System.Drawing.Point(654, 436);
-            this.button_New.Margin = new System.Windows.Forms.Padding(4);
+            this.button_New.Location = new System.Drawing.Point(358, 323);
             this.button_New.Name = "button_New";
             this.button_New.Name = "button_New";
-            this.button_New.Size = new System.Drawing.Size(112, 34);
+            this.button_New.Size = new System.Drawing.Size(75, 23);
             this.button_New.TabIndex = 8;
             this.button_New.TabIndex = 8;
             this.button_New.Text = "新建";
             this.button_New.Text = "新建";
             this.button_New.UseVisualStyleBackColor = true;
             this.button_New.UseVisualStyleBackColor = true;
@@ -74,10 +71,9 @@
             // 
             // 
             // button_edit
             // button_edit
             // 
             // 
-            this.button_edit.Location = new System.Drawing.Point(129, 436);
-            this.button_edit.Margin = new System.Windows.Forms.Padding(4);
+            this.button_edit.Location = new System.Drawing.Point(85, 323);
             this.button_edit.Name = "button_edit";
             this.button_edit.Name = "button_edit";
-            this.button_edit.Size = new System.Drawing.Size(99, 34);
+            this.button_edit.Size = new System.Drawing.Size(66, 23);
             this.button_edit.TabIndex = 7;
             this.button_edit.TabIndex = 7;
             this.button_edit.Text = "编辑";
             this.button_edit.Text = "编辑";
             this.button_edit.UseVisualStyleBackColor = true;
             this.button_edit.UseVisualStyleBackColor = true;
@@ -85,10 +81,9 @@
             // 
             // 
             // m_ctrlBtnExport
             // m_ctrlBtnExport
             // 
             // 
-            this.m_ctrlBtnExport.Location = new System.Drawing.Point(928, 436);
-            this.m_ctrlBtnExport.Margin = new System.Windows.Forms.Padding(4);
+            this.m_ctrlBtnExport.Location = new System.Drawing.Point(533, 323);
             this.m_ctrlBtnExport.Name = "m_ctrlBtnExport";
             this.m_ctrlBtnExport.Name = "m_ctrlBtnExport";
-            this.m_ctrlBtnExport.Size = new System.Drawing.Size(112, 34);
+            this.m_ctrlBtnExport.Size = new System.Drawing.Size(75, 23);
             this.m_ctrlBtnExport.TabIndex = 6;
             this.m_ctrlBtnExport.TabIndex = 6;
             this.m_ctrlBtnExport.Text = "导出";
             this.m_ctrlBtnExport.Text = "导出";
             this.m_ctrlBtnExport.UseVisualStyleBackColor = true;
             this.m_ctrlBtnExport.UseVisualStyleBackColor = true;
@@ -96,10 +91,9 @@
             // 
             // 
             // IDC_BTN_IMPORT
             // IDC_BTN_IMPORT
             // 
             // 
-            this.IDC_BTN_IMPORT.Location = new System.Drawing.Point(788, 436);
-            this.IDC_BTN_IMPORT.Margin = new System.Windows.Forms.Padding(4);
+            this.IDC_BTN_IMPORT.Location = new System.Drawing.Point(439, 323);
             this.IDC_BTN_IMPORT.Name = "IDC_BTN_IMPORT";
             this.IDC_BTN_IMPORT.Name = "IDC_BTN_IMPORT";
-            this.IDC_BTN_IMPORT.Size = new System.Drawing.Size(112, 34);
+            this.IDC_BTN_IMPORT.Size = new System.Drawing.Size(75, 23);
             this.IDC_BTN_IMPORT.TabIndex = 5;
             this.IDC_BTN_IMPORT.TabIndex = 5;
             this.IDC_BTN_IMPORT.Text = "导入";
             this.IDC_BTN_IMPORT.Text = "导入";
             this.IDC_BTN_IMPORT.UseVisualStyleBackColor = true;
             this.IDC_BTN_IMPORT.UseVisualStyleBackColor = true;
@@ -107,10 +101,9 @@
             // 
             // 
             // m_ctrlBtnRename
             // m_ctrlBtnRename
             // 
             // 
-            this.m_ctrlBtnRename.Location = new System.Drawing.Point(339, 436);
-            this.m_ctrlBtnRename.Margin = new System.Windows.Forms.Padding(4);
+            this.m_ctrlBtnRename.Location = new System.Drawing.Point(225, 323);
             this.m_ctrlBtnRename.Name = "m_ctrlBtnRename";
             this.m_ctrlBtnRename.Name = "m_ctrlBtnRename";
-            this.m_ctrlBtnRename.Size = new System.Drawing.Size(97, 34);
+            this.m_ctrlBtnRename.Size = new System.Drawing.Size(65, 23);
             this.m_ctrlBtnRename.TabIndex = 4;
             this.m_ctrlBtnRename.TabIndex = 4;
             this.m_ctrlBtnRename.Text = "重命名";
             this.m_ctrlBtnRename.Text = "重命名";
             this.m_ctrlBtnRename.UseVisualStyleBackColor = true;
             this.m_ctrlBtnRename.UseVisualStyleBackColor = true;
@@ -118,10 +111,9 @@
             // 
             // 
             // m_ctrlBtnDelete
             // m_ctrlBtnDelete
             // 
             // 
-            this.m_ctrlBtnDelete.Location = new System.Drawing.Point(236, 436);
-            this.m_ctrlBtnDelete.Margin = new System.Windows.Forms.Padding(4);
+            this.m_ctrlBtnDelete.Location = new System.Drawing.Point(156, 323);
             this.m_ctrlBtnDelete.Name = "m_ctrlBtnDelete";
             this.m_ctrlBtnDelete.Name = "m_ctrlBtnDelete";
-            this.m_ctrlBtnDelete.Size = new System.Drawing.Size(95, 34);
+            this.m_ctrlBtnDelete.Size = new System.Drawing.Size(63, 23);
             this.m_ctrlBtnDelete.TabIndex = 3;
             this.m_ctrlBtnDelete.TabIndex = 3;
             this.m_ctrlBtnDelete.Text = "删除";
             this.m_ctrlBtnDelete.Text = "删除";
             this.m_ctrlBtnDelete.UseVisualStyleBackColor = true;
             this.m_ctrlBtnDelete.UseVisualStyleBackColor = true;
@@ -129,10 +121,9 @@
             // 
             // 
             // m_ctrlBtnApply
             // m_ctrlBtnApply
             // 
             // 
-            this.m_ctrlBtnApply.Location = new System.Drawing.Point(9, 436);
-            this.m_ctrlBtnApply.Margin = new System.Windows.Forms.Padding(4);
+            this.m_ctrlBtnApply.Location = new System.Drawing.Point(4, 323);
             this.m_ctrlBtnApply.Name = "m_ctrlBtnApply";
             this.m_ctrlBtnApply.Name = "m_ctrlBtnApply";
-            this.m_ctrlBtnApply.Size = new System.Drawing.Size(112, 34);
+            this.m_ctrlBtnApply.Size = new System.Drawing.Size(75, 23);
             this.m_ctrlBtnApply.TabIndex = 2;
             this.m_ctrlBtnApply.TabIndex = 2;
             this.m_ctrlBtnApply.Text = "应用";
             this.m_ctrlBtnApply.Text = "应用";
             this.m_ctrlBtnApply.UseVisualStyleBackColor = true;
             this.m_ctrlBtnApply.UseVisualStyleBackColor = true;
@@ -141,36 +132,33 @@
             // m_ctrlStagePicture
             // m_ctrlStagePicture
             // 
             // 
             this.m_ctrlStagePicture.BackColor = System.Drawing.Color.White;
             this.m_ctrlStagePicture.BackColor = System.Drawing.Color.White;
-            this.m_ctrlStagePicture.Location = new System.Drawing.Point(474, 26);
-            this.m_ctrlStagePicture.Margin = new System.Windows.Forms.Padding(4);
+            this.m_ctrlStagePicture.Location = new System.Drawing.Point(316, 17);
             this.m_ctrlStagePicture.Name = "m_ctrlStagePicture";
             this.m_ctrlStagePicture.Name = "m_ctrlStagePicture";
-            this.m_ctrlStagePicture.Size = new System.Drawing.Size(567, 400);
+            this.m_ctrlStagePicture.Size = new System.Drawing.Size(292, 292);
             this.m_ctrlStagePicture.TabIndex = 1;
             this.m_ctrlStagePicture.TabIndex = 1;
             this.m_ctrlStagePicture.TabStop = false;
             this.m_ctrlStagePicture.TabStop = false;
             // 
             // 
             // m_ctrlListBoxStageList
             // m_ctrlListBoxStageList
             // 
             // 
             this.m_ctrlListBoxStageList.FormattingEnabled = true;
             this.m_ctrlListBoxStageList.FormattingEnabled = true;
-            this.m_ctrlListBoxStageList.ItemHeight = 18;
-            this.m_ctrlListBoxStageList.Location = new System.Drawing.Point(9, 26);
-            this.m_ctrlListBoxStageList.Margin = new System.Windows.Forms.Padding(4);
+            this.m_ctrlListBoxStageList.ItemHeight = 12;
+            this.m_ctrlListBoxStageList.Location = new System.Drawing.Point(6, 17);
             this.m_ctrlListBoxStageList.Name = "m_ctrlListBoxStageList";
             this.m_ctrlListBoxStageList.Name = "m_ctrlListBoxStageList";
-            this.m_ctrlListBoxStageList.Size = new System.Drawing.Size(439, 400);
+            this.m_ctrlListBoxStageList.Size = new System.Drawing.Size(294, 292);
             this.m_ctrlListBoxStageList.TabIndex = 0;
             this.m_ctrlListBoxStageList.TabIndex = 0;
             this.m_ctrlListBoxStageList.SelectedValueChanged += new System.EventHandler(this.OnSelchangeListStage);
             this.m_ctrlListBoxStageList.SelectedValueChanged += new System.EventHandler(this.OnSelchangeListStage);
             // 
             // 
             // DlgStageMgr
             // DlgStageMgr
             // 
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1040, 454);
+            this.ClientSize = new System.Drawing.Size(619, 357);
             this.Controls.Add(this.groupBox1);
             this.Controls.Add(this.groupBox1);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
-            this.Margin = new System.Windows.Forms.Padding(4);
             this.MaximizeBox = false;
             this.MaximizeBox = false;
-            this.MaximumSize = new System.Drawing.Size(1062, 510);
+            this.MaximumSize = new System.Drawing.Size(635, 396);
             this.MinimizeBox = false;
             this.MinimizeBox = false;
-            this.MinimumSize = new System.Drawing.Size(1062, 510);
+            this.MinimumSize = new System.Drawing.Size(635, 396);
             this.Name = "DlgStageMgr";
             this.Name = "DlgStageMgr";
             this.ShowIcon = false;
             this.ShowIcon = false;
             this.ShowInTaskbar = false;
             this.ShowInTaskbar = false;

+ 6 - 11
OTSIncAMeasureApp/7-OTSProgMgrInfo/Stage/DlgStageMgr.cs

@@ -359,18 +359,13 @@ namespace OTSModelSharp.Measure.GetStageInfo
                 System.Drawing.RectangleF BounderyRect = pBoundery.GetDomainRect();
                 System.Drawing.RectangleF BounderyRect = pBoundery.GetDomainRect();
                 int nBounderyWidth = (int)(BounderyRect.Width);//um,,pixle is (nWidth - PIC_EDGE * 2 )
                 int nBounderyWidth = (int)(BounderyRect.Width);//um,,pixle is (nWidth - PIC_EDGE * 2 )
                 int nBounderyHeight = (int)(BounderyRect.Height);
                 int nBounderyHeight = (int)(BounderyRect.Height);
-                double PixSize = 0;
-                if (nBounderyWidth > nBounderyHeight)
-                {
-                    PixSize = (long)((double)nBounderyWidth / (double)(nWidth - StageDisplayHelp.PIC_EDGE * 2));
-                }
-                else
-                {
-                    PixSize = (long)((double)nBounderyHeight / (double)(nHeight - StageDisplayHelp.PIC_EDGE * 2));
-                }
+                double PixSizeX = 0;
+                double PixSizeY = 0;
+                PixSizeX = (long)((double)nBounderyWidth / (double)(nWidth - StageDisplayHelp.PIC_EDGE * 2));
+                PixSizeY = (long)((double)nBounderyHeight / (double)(nHeight - StageDisplayHelp.PIC_EDGE * 2));
                 //draw boundery
                 //draw boundery
                 Brush pLTGrayBrush = new SolidBrush(Color.FromArgb(255, 0, 0));
                 Brush pLTGrayBrush = new SolidBrush(Color.FromArgb(255, 0, 0));
-                stageDisplayHelp.DrawStageBoundery(pStage[m_nListBoxStageListIndex], nWidth, nHeight, pDC, PixSize);
+                stageDisplayHelp.DrawStageBoundery(pStage[m_nListBoxStageListIndex], nWidth, nHeight, pDC, PixSizeX, PixSizeY);
 
 
                 ////draw STD
                 ////draw STD
                 //Brush pBlackBrush = new SolidBrush(Color.FromArgb(255, 0, 0)); ;
                 //Brush pBlackBrush = new SolidBrush(Color.FromArgb(255, 0, 0)); ;
@@ -380,7 +375,7 @@ namespace OTSModelSharp.Measure.GetStageInfo
                 ////draw holes
                 ////draw holes
                 //Brush pWriteBrush = new SolidBrush(Color.FromArgb(255, 0, 0)); ;
                 //Brush pWriteBrush = new SolidBrush(Color.FromArgb(255, 0, 0)); ;
 
 
-                stageDisplayHelp.DrawStageHole(pStage[m_nListBoxStageListIndex], nWidth, nHeight, pDC, PixSize);
+                stageDisplayHelp.DrawStageHole(pStage[m_nListBoxStageListIndex], nWidth, nHeight, pDC, PixSizeX, PixSizeY);
 
 
                 // draw ratio
                 // draw ratio
                 stageDisplayHelp.DrawRatio(nBounderyWidth, nWidth, nHeight, pDC, (IntPtr)pWnd, rc);
                 stageDisplayHelp.DrawRatio(nBounderyWidth, nWidth, nHeight, pDC, (IntPtr)pWnd, rc);

+ 41 - 43
OTSIncAMeasureApp/7-OTSProgMgrInfo/Stage/StageDisplayHelp.cs

@@ -20,7 +20,7 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
         {
         {
 
 
         }
         }
-        public void DrawStageBoundery(CStage a_pStage, int a_nWidth, int a_nHeight, Object pDC, double a_dPixSize)
+        public void DrawStageBoundery(CStage a_pStage, int a_nWidth, int a_nHeight, Object pDC, double a_dPixSizeX, double a_dPixSizeY)
         {
         {
             if (a_pStage == null)
             if (a_pStage == null)
             {
             {
@@ -32,12 +32,12 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             nShape = pBoundery.GetShape();
             nShape = pBoundery.GetShape();
 
 
             Rectangle PixRect = new Rectangle();
             Rectangle PixRect = new Rectangle();
-            GetPixRect(pBoundery, a_nWidth, a_nHeight, a_dPixSize, ref PixRect);
+            GetPixRect(pBoundery, a_nWidth, a_nHeight, a_dPixSizeX, a_dPixSizeY, ref PixRect);
             DrawShape(PixRect, pDC, nShape, true);
             DrawShape(PixRect, pDC, nShape, true);
         }
         }
 
 
         // draw stage hole
         // draw stage hole
-        public void DrawStageHole(CStage a_pStage, int a_nWidth, int a_nHeight, Object pDC, double a_dPixSize)
+        public void DrawStageHole(CStage a_pStage, int a_nWidth, int a_nHeight, Object pDC, double a_dPixSizeX, double a_dPixSizeY)
         {
         {
             if (a_pStage == null)
             if (a_pStage == null)
             {
             {
@@ -55,12 +55,10 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
                 nShape = pHole.GetShape();
                 nShape = pHole.GetShape();
 
 
                 Rectangle PixRect = new Rectangle();
                 Rectangle PixRect = new Rectangle();
-                GetPixRect(pHole, a_nWidth, a_nHeight, a_dPixSize, ref PixRect);
+                GetPixRect(pHole, a_nWidth, a_nHeight, a_dPixSizeX, a_dPixSizeY, ref PixRect);
 
 
                 DrawShape(PixRect, pDC, nShape, true);
                 DrawShape(PixRect, pDC, nShape, true);
 
 
-                int nHeight = PixRect.Height * 2 / 3;
-
                 //设置文字对齐方式
                 //设置文字对齐方式
                 StringFormat sf = new StringFormat();
                 StringFormat sf = new StringFormat();
                 sf.Alignment = StringAlignment.Center;
                 sf.Alignment = StringAlignment.Center;
@@ -119,7 +117,7 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
         }
         }
 
 
         // get pixle rect
         // get pixle rect
-        public bool GetPixRect(CDomain a_pDomain, int a_nWidth, int a_nHeight, double a_dPixSize, ref Rectangle PixRect)
+        public bool GetPixRect(CDomain a_pDomain, int a_nWidth, int a_nHeight, double a_dPixSizeX, double a_dPixSizeY, ref Rectangle PixRect)
         {
         {
             if (a_pDomain == null)
             if (a_pDomain == null)
             {
             {
@@ -128,25 +126,25 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
 
 
             RectangleF DomainRect = a_pDomain.GetDomainRect();
             RectangleF DomainRect = a_pDomain.GetDomainRect();
 
 
-            int CenterX = a_nWidth / 2;     //pixle center
-            int CenterY = a_nHeight / 2;
+            Double CenterX = a_nWidth / 2;     //pixle center
+            Double CenterY = a_nHeight / 2;
 
 
             PointF DomainCenter = a_pDomain.GetDomainCenter();  // um center
             PointF DomainCenter = a_pDomain.GetDomainCenter();  // um center
 
 
-            Point PixCenter = new Point();
-            PixCenter.X = (int)((double)DomainCenter.X / a_dPixSize);
-            PixCenter.Y = (int)((double)DomainCenter.Y / a_dPixSize); // um to pixle
+            PointF PixCenter = new Point();
+            PixCenter.X = (float)(DomainCenter.X / a_dPixSizeX);
+            PixCenter.Y = (float)(DomainCenter.Y / a_dPixSizeY); // um to pixle
 
 
-            int PixRectCenterX = CenterX + PixCenter.X;
-            int PixRectCenterY = CenterY - PixCenter.Y;//OTS y dirction is different with pixle direction
+            Double PixRectCenterX = CenterX + PixCenter.X;
+            Double PixRectCenterY = CenterY - PixCenter.Y;//OTS y dirction is different with pixle direction
 
 
-            int delteX = PixRectCenterX - PixCenter.X;
-            int delteY = PixRectCenterY - PixCenter.Y;
+            Double delteX = PixRectCenterX - PixCenter.X;
+            Double delteY = PixRectCenterY - PixCenter.Y;
 
 
-            int Left = (int)(DomainRect.Left / a_dPixSize + delteX);
-            int Top = (int)(DomainRect.Top / a_dPixSize + delteY);
-            int Right = (int)(DomainRect.Right / a_dPixSize + delteX);
-            int Bottom = (int)(DomainRect.Bottom / a_dPixSize + delteY);
+            int Left = (int)Math.Round(DomainRect.Left / a_dPixSizeX + delteX);
+            int Top = (int)Math.Round(DomainRect.Top / a_dPixSizeY + delteY);
+            int Right = (int)Math.Round(DomainRect.Right / a_dPixSizeX + delteX);
+            int Bottom = (int)Math.Round(DomainRect.Bottom / a_dPixSizeY + delteY);
 
 
             PixRect.Location = new Point(Left, Top);
             PixRect.Location = new Point(Left, Top);
             PixRect.Size = new Size(Math.Abs(Right - Left), Math.Abs(Bottom - Top));
             PixRect.Size = new Size(Math.Abs(Right - Left), Math.Abs(Bottom - Top));
@@ -256,7 +254,7 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
         /// 在任意的panel里画一个坐标,坐标所在的四边形距离panel边50像素
         /// 在任意的panel里画一个坐标,坐标所在的四边形距离panel边50像素
         /// </summary>
         /// </summary>
         /// <param name="pan"></param>
         /// <param name="pan"></param>
-        public void DrawXY(Object a_pDC, double width,double height, double a_dPixSize,double coordinateSystemEndpointX, double coordinateSystemEndpointY)
+        public void DrawXY(Object a_pDC, double width,double height, double a_dPixSizeX, double a_dPixSizeY, double coordinateSystemEndpointX, double coordinateSystemEndpointY)
         {
         {
             if (a_pDC == null)
             if (a_pDC == null)
             {
             {
@@ -267,19 +265,19 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             //绘制X轴,
             //绘制X轴,
             double ObjectCenterX =  width/ 2;     
             double ObjectCenterX =  width/ 2;     
             double ObjectCenterY = height / 2;
             double ObjectCenterY = height / 2;
-            int X0 = (int)(coordinateSystemEndpointX / a_dPixSize + ObjectCenterX);
-            int Y0 = (int)(0 / a_dPixSize + ObjectCenterY);
-            int X1 = (int)(-coordinateSystemEndpointX / a_dPixSize + ObjectCenterX);
-            int Y1 = (int)(0 / a_dPixSize + ObjectCenterY);
+            int X0 = (int)(coordinateSystemEndpointX / a_dPixSizeX + ObjectCenterX);
+            int Y0 = (int)(0 / a_dPixSizeX + ObjectCenterY);
+            int X1 = (int)(-coordinateSystemEndpointX / a_dPixSizeX + ObjectCenterX);
+            int Y1 = (int)(0 / a_dPixSizeX + ObjectCenterY);
             Point px1 = new Point(X0, Y0);
             Point px1 = new Point(X0, Y0);
             Point px2 = new Point(X1, Y1);
             Point px2 = new Point(X1, Y1);
             Pen pen = new Pen(Brushes.Green, 1);
             Pen pen = new Pen(Brushes.Green, 1);
             g.DrawLine(pen, px1, px2);
             g.DrawLine(pen, px1, px2);
             //绘制Y轴
             //绘制Y轴
-            int X3 = (int)(0 / a_dPixSize + ObjectCenterX);
-            int Y3 = (int)(coordinateSystemEndpointY / a_dPixSize + ObjectCenterY);
-            int X4 = (int)(0 / a_dPixSize + ObjectCenterX);
-            int Y4 = (int)(-coordinateSystemEndpointY / a_dPixSize + ObjectCenterY);
+            int X3 = (int)(0 / a_dPixSizeY + ObjectCenterX);
+            int Y3 = (int)(coordinateSystemEndpointY / a_dPixSizeY + ObjectCenterY);
+            int X4 = (int)(0 / a_dPixSizeY + ObjectCenterX);
+            int Y4 = (int)(-coordinateSystemEndpointY / a_dPixSizeY + ObjectCenterY);
             PointF py1 = new PointF(X3, Y3);
             PointF py1 = new PointF(X3, Y3);
             PointF py2 = new PointF(X4, Y4);
             PointF py2 = new PointF(X4, Y4);
             g.DrawLine(pen, py1, py2);
             g.DrawLine(pen, py1, py2);
@@ -287,54 +285,54 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             int move = 5,len=10;
             int move = 5,len=10;
             for (int i = 1; i <= len; i++)    //len等分Y正轴
             for (int i = 1; i <= len; i++)    //len等分Y正轴
             {
             {
-                Point px3 = new Point((int)ObjectCenterX + move, (int)(ObjectCenterY + (-coordinateSystemEndpointY / a_dPixSize) / len * i));
-                Point px4 = new Point((int)ObjectCenterX, (int)(ObjectCenterY + (-coordinateSystemEndpointY / a_dPixSize) / len * i));
+                Point px3 = new Point((int)ObjectCenterX + move, (int)(ObjectCenterY + (-coordinateSystemEndpointY / a_dPixSizeY) / len * i));
+                Point px4 = new Point((int)ObjectCenterX, (int)(ObjectCenterY + (-coordinateSystemEndpointY / a_dPixSizeY) / len * i));
                 string sx = ((int)(-(-coordinateSystemEndpointY) / len * i)).ToString();
                 string sx = ((int)(-(-coordinateSystemEndpointY) / len * i)).ToString();
                 g.DrawLine(pen, px3, px4);
                 g.DrawLine(pen, px3, px4);
                 StringFormat drawFormat = new StringFormat();
                 StringFormat drawFormat = new StringFormat();
                 drawFormat.Alignment = StringAlignment.Far;
                 drawFormat.Alignment = StringAlignment.Far;
                 drawFormat.LineAlignment = StringAlignment.Center;
                 drawFormat.LineAlignment = StringAlignment.Center;
-                g.DrawString(sx, new Font("宋体", 8f), Brushes.Green, new Point((int)ObjectCenterX - 5, (int)(ObjectCenterY + (-coordinateSystemEndpointY / a_dPixSize) / len * i)), drawFormat);
+                g.DrawString(sx, new Font("宋体", 8f), Brushes.Green, new Point((int)ObjectCenterX - 5, (int)(ObjectCenterY + (-coordinateSystemEndpointY / a_dPixSizeY) / len * i)), drawFormat);
             }
             }
             for (int i = 1; i <= len; i++)    
             for (int i = 1; i <= len; i++)    
             {
             {
-                Point px3 = new Point((int)ObjectCenterX + move, (int)(ObjectCenterY + (coordinateSystemEndpointY / a_dPixSize) / len * i));
-                Point px4 = new Point((int)ObjectCenterX, (int)(ObjectCenterY + (coordinateSystemEndpointY / a_dPixSize) / len * i));
+                Point px3 = new Point((int)ObjectCenterX + move, (int)(ObjectCenterY + (coordinateSystemEndpointY / a_dPixSizeY) / len * i));
+                Point px4 = new Point((int)ObjectCenterX, (int)(ObjectCenterY + (coordinateSystemEndpointY / a_dPixSizeY) / len * i));
                 string sx = ((int)((-coordinateSystemEndpointY) / len * i)).ToString();
                 string sx = ((int)((-coordinateSystemEndpointY) / len * i)).ToString();
                 g.DrawLine(pen, px3, px4);
                 g.DrawLine(pen, px3, px4);
                 StringFormat drawFormat = new StringFormat();
                 StringFormat drawFormat = new StringFormat();
                 drawFormat.Alignment = StringAlignment.Far;
                 drawFormat.Alignment = StringAlignment.Far;
                 drawFormat.LineAlignment = StringAlignment.Center;
                 drawFormat.LineAlignment = StringAlignment.Center;
-                g.DrawString(sx, new Font("宋体", 8f), Brushes.Green, new Point((int)ObjectCenterX - 5, (int)(ObjectCenterY + (coordinateSystemEndpointY / a_dPixSize) / len * i)), drawFormat);
+                g.DrawString(sx, new Font("宋体", 8f), Brushes.Green, new Point((int)ObjectCenterX - 5, (int)(ObjectCenterY + (coordinateSystemEndpointY / a_dPixSizeY) / len * i)), drawFormat);
             }
             }
             for (int i = 1; i <= len; i++)    //len等分X正轴
             for (int i = 1; i <= len; i++)    //len等分X正轴
             {
             {
-                Point px3 = new Point((int)(ObjectCenterX + (coordinateSystemEndpointX / a_dPixSize) / len * i) , (int)(ObjectCenterY + move));
-                Point px4 = new Point((int)(ObjectCenterX + (coordinateSystemEndpointX / a_dPixSize) / len * i), (int)ObjectCenterY);
+                Point px3 = new Point((int)(ObjectCenterX + (coordinateSystemEndpointX / a_dPixSizeX) / len * i) , (int)(ObjectCenterY + move));
+                Point px4 = new Point((int)(ObjectCenterX + (coordinateSystemEndpointX / a_dPixSizeX) / len * i), (int)ObjectCenterY);
                 string sx = ((int)(coordinateSystemEndpointX / len * i)).ToString();
                 string sx = ((int)(coordinateSystemEndpointX / len * i)).ToString();
                 g.DrawLine(pen, px3, px4);
                 g.DrawLine(pen, px3, px4);
                 StringFormat drawFormat = new StringFormat();
                 StringFormat drawFormat = new StringFormat();
                 drawFormat.Alignment = StringAlignment.Far;
                 drawFormat.Alignment = StringAlignment.Far;
                 drawFormat.LineAlignment = StringAlignment.Center;
                 drawFormat.LineAlignment = StringAlignment.Center;
-                g.DrawString(sx, new Font("宋体", 6f), Brushes.Green, new Point((int)(ObjectCenterX + (coordinateSystemEndpointX / a_dPixSize) / len * i)+5, (int)(ObjectCenterY + 15)), drawFormat);
+                g.DrawString(sx, new Font("宋体", 6f), Brushes.Green, new Point((int)(ObjectCenterX + (coordinateSystemEndpointX / a_dPixSizeX) / len * i)+5, (int)(ObjectCenterY + 15)), drawFormat);
             }
             }
             for (int i = 1; i <= len; i++)
             for (int i = 1; i <= len; i++)
             {
             {
-                Point px3 = new Point((int)(ObjectCenterX + (-coordinateSystemEndpointX / a_dPixSize) / len * i), (int)(ObjectCenterY + move));
-                Point px4 = new Point((int)(ObjectCenterX + (-coordinateSystemEndpointX / a_dPixSize) / len * i), (int)(ObjectCenterY));
+                Point px3 = new Point((int)(ObjectCenterX + (-coordinateSystemEndpointX / a_dPixSizeX) / len * i), (int)(ObjectCenterY + move));
+                Point px4 = new Point((int)(ObjectCenterX + (-coordinateSystemEndpointX / a_dPixSizeX) / len * i), (int)(ObjectCenterY));
                 string sx = ((int)((-coordinateSystemEndpointX) / len * i)).ToString();
                 string sx = ((int)((-coordinateSystemEndpointX) / len * i)).ToString();
                 g.DrawLine(pen, px3, px4);
                 g.DrawLine(pen, px3, px4);
                 StringFormat drawFormat = new StringFormat();
                 StringFormat drawFormat = new StringFormat();
                 drawFormat.Alignment = StringAlignment.Far;
                 drawFormat.Alignment = StringAlignment.Far;
                 drawFormat.LineAlignment = StringAlignment.Center;
                 drawFormat.LineAlignment = StringAlignment.Center;
-                g.DrawString(sx, new Font("宋体", 6f), Brushes.Green, new Point((int)(ObjectCenterX + (-coordinateSystemEndpointX / a_dPixSize) / len * i)+5, (int)(ObjectCenterY + 15)), drawFormat);
+                g.DrawString(sx, new Font("宋体", 6f), Brushes.Green, new Point((int)(ObjectCenterX + (-coordinateSystemEndpointX / a_dPixSizeX) / len * i)+5, (int)(ObjectCenterY + 15)), drawFormat);
             }
             }
 
 
             //g.Dispose();
             //g.Dispose();
         }
         }
         #endregion
         #endregion
 
 
-        public void DrawStageSTD(CStage a_pStage, int a_nWidth, int a_nHeight, Object pDC, double a_dPixSize)
+        public void DrawStageSTD(CStage a_pStage, int a_nWidth, int a_nHeight, Object pDC, double a_dPixSizeX, double a_dPixSizeY)
         {
         {
             if (a_pStage == null)
             if (a_pStage == null)
             {
             {
@@ -346,7 +344,7 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             nShape = pSTD.GetShape();
             nShape = pSTD.GetShape();
 
 
             Rectangle PixRect = new Rectangle();
             Rectangle PixRect = new Rectangle();
-            GetPixRect(pSTD, a_nWidth, a_nHeight, a_dPixSize, ref PixRect);
+            GetPixRect(pSTD, a_nWidth, a_nHeight, a_dPixSizeX, a_dPixSizeY, ref PixRect);
 
 
             DrawShape(PixRect, pDC, nShape, false);
             DrawShape(PixRect, pDC, nShape, false);
         }
         }