瀏覽代碼

样品台编辑器标样框显示

cxs 1 年之前
父節點
當前提交
c709ff7134

+ 19 - 4
OTSIncAMeasureApp/7-OTSProgMgrInfo/Stage/DlgStageEdit.cs

@@ -420,11 +420,11 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             //draw boundery
             Brush pLTGrayBrush = new SolidBrush(Color.FromArgb(255, 0, 0));
             stageDisplayHelp.DrawStageBoundery(m_pStage, nWidth, nHeight, pDC, PixSize);
-            
-            ////draw STD
-            //Brush pBlackBrush = new SolidBrush(Color.FromArgb(255, 0, 0)); ;
 
-            //DrawStageSTD(m_pStage[m_nListBoxStageListIndex], nWidth, nHeight, pDC, PixSize);
+            //draw STD
+            Brush pBlackBrush = new SolidBrush(Color.FromArgb(255, 0, 0)); ;
+
+            stageDisplayHelp.DrawStageSTD(m_pStage, nWidth, nHeight, pDC, PixSize);
 
             ////draw holes
             //Brush pWriteBrush = new SolidBrush(Color.FromArgb(255, 0, 0)); ;
@@ -515,6 +515,20 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
                     }
                 }
             }
+            if(radioButton_BoundarySquare.Checked)
+            {
+                if(double.Parse(tBoundaryHeight.Text)==0)
+                {
+                    return false;
+                }
+            }
+            if (radioButton_StandardsampleSqare.Checked)
+            {
+                if (double.Parse(tStandardsampleHeight.Text) == 0)
+                {
+                    return false;
+                }
+            }
             return true;
         }
 
@@ -592,5 +606,6 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
                 
             }
         }
+
     }
 }

+ 1 - 16
OTSIncAMeasureApp/7-OTSProgMgrInfo/Stage/DlgStageMgr.cs

@@ -439,22 +439,7 @@ namespace OTSModelSharp.Measure.GetStageInfo
 
         //public void SetPackId(otsdataconst.OTS_SysType_ID a_nPackId) { m_nPackId = a_nPackId; }
 
-        public void DrawStageSTD(CStage a_pStage, int a_nWidth, int a_nHeight, Object pDC, double a_dPixSize) 
-        {
-            if (a_pStage == null)
-            {
-                return;
-            }
-
-            CDomain pSTD = a_pStage.GetSTD();
-            otsdataconst.DOMAIN_SHAPE nShape = (otsdataconst.DOMAIN_SHAPE)(-1);
-            nShape = pSTD.GetShape();
-
-            Rectangle PixRect = new Rectangle();
-            stageDisplayHelp.GetPixRect(pSTD, a_nWidth, a_nHeight, a_dPixSize,ref PixRect);
-
-            stageDisplayHelp.DrawShape(PixRect, pDC, nShape, false);
-        }
+        
         //public Brush GetStockObject(int i) {
 
         //      BrushConverter brushConverter = new BrushConverter(Color.Brown);

+ 18 - 0
OTSIncAMeasureApp/7-OTSProgMgrInfo/Stage/StageDisplayHelp.cs

@@ -329,5 +329,23 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             //g.Dispose();
         }
         #endregion
+
+
+        public void DrawStageSTD(CStage a_pStage, int a_nWidth, int a_nHeight, Object pDC, double a_dPixSize)
+        {
+            if (a_pStage == null)
+            {
+                return;
+            }
+
+            CDomain pSTD = a_pStage.GetSTD();
+            otsdataconst.DOMAIN_SHAPE nShape = (otsdataconst.DOMAIN_SHAPE)(-1);
+            nShape = pSTD.GetShape();
+
+            Rectangle PixRect = new Rectangle();
+            GetPixRect(pSTD, a_nWidth, a_nHeight, a_dPixSize, ref PixRect);
+
+            DrawShape(PixRect, pDC, nShape, true);
+        }
     }
 }