Przeglądaj źródła

修改标准库和样品台的bug

cxs 1 rok temu
rodzic
commit
59a82d94da

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

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<XMLData Modify="true" PathName=".\Config\SysData\OTSStage.stg" WorkingStageId="0">
+<XMLData Modify="false" PathName=".\Config\SysData\OTSStage.stg" WorkingStageId="0">
   <Collection RegName="Stagelist">
     <Member strName="圆形九圆孔50mm">
       <Member RegName="boundary" PolygonPoint="" rectDomian="0,0,50000,0" shape="0:ROUND" />

+ 44 - 7
OTSIncAMeasureApp/7-OTSProgMgrInfo/Stage/DlgStageEdit.cs

@@ -228,6 +228,24 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
                 MessageBox.Show("Please check Params!");
                 return;
             }
+            if (tBoundaryWide.Text == "1" || tBoundaryHeight.Text == "1" || tStandardsampleWide.Text == "1" || tStandardsampleHeight.Text == "1")
+            {
+                this.button_Ok.Enabled = false;
+                MessageBox.Show("The length value cannot be 1!");
+                return;
+            }
+            for (int i = 0; i < dataGridView_Holes.Rows.Count; i++)
+            {
+                for (int j = 4; j <= 5; j++)
+                {
+                    if (dataGridView_Holes.Rows[i].Cells[j].Value.ToString() == "1")
+                    {
+                        this.button_Ok.Enabled = false;
+                        MessageBox.Show("The length value cannot be 1!");
+                        return;
+                    }
+                }
+            }
             CSEMStageData a_pCSEMStageData = new CSEMStageData();
             //获取配置文件中 StageData 内容
             COTSDefaultParam m_DefaultParam = new COTSDefaultParam();
@@ -420,11 +438,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)); ;
@@ -433,8 +451,13 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
 
             // draw ratio
             stageDisplayHelp.DrawRatio(nBounderyWidth, nWidth, nHeight, pDC, (IntPtr)pWnd, rc);
-            
-            //stageDisplayHelp.DrawXY(pDC, m_ctrlStagePicture.Width, m_ctrlStagePicture.Height, PixSize, coordinateSystemEndpoint);
+            if (button_Coordinate.Text == "坐标系关闭")
+            {
+                double coordinateSystemEndpointX = nBounderyWidth / 2;
+                double coordinateSystemEndpointY = nBounderyHeight / 2;
+                stageDisplayHelp.DrawXY(pDC, m_ctrlStagePicture.Width, m_ctrlStagePicture.Height, PixSize, coordinateSystemEndpointX, coordinateSystemEndpointY);
+            }
+
             pLTGrayBrush.Dispose();
             //pBlackBrush.Dispose();
             //pWriteBrush.Dispose();
@@ -510,6 +533,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;
         }
 
@@ -575,6 +612,7 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
             }
             else
             {
+                button_Coordinate.Text = "坐标系显示";
                 if(m_pStage != null)
                 {
                     DrawStage();
@@ -583,7 +621,6 @@ namespace OTSMeasureApp._7_OTSProgMgrInfo.Stage
                 {
                     m_ctrlStagePicture.Refresh();
                 }
-                button_Coordinate.Text = "坐标系显示";
             }
         }
     }

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

@@ -439,22 +439,6 @@ 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);

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

@@ -329,5 +329,22 @@ 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, false);
+        }
     }
 }

+ 1 - 1
OTSPartA_STDEditor/Form_Main.cs

@@ -1575,7 +1575,7 @@ namespace OTSPartA_STDEditor
                         OtsDatabaseCommand.ExecuteNonQuery();
                         OtsDatabaseCommand.CommandText = "CREATE TABLE STDMinerals (id INTEGER,SPEC BLOB)";
                         OtsDatabaseCommand.ExecuteNonQuery();
-                        OtsDatabaseCommand.CommandText = "CREATE TABLE ZeroElementRules (ZeroElement TEXT,UsingElementList TEXT, UsingImgPropertyList TEXT,Expression TEXT)";
+                        OtsDatabaseCommand.CommandText = "CREATE TABLE ZeroElementRules (ZeroElement TEXT,UsingElementList TEXT, UsingImgPropertyList TEXT,UsingOtherPropertyList TEXT,Expression TEXT)";
                         OtsDatabaseCommand.ExecuteNonQuery();
                         System.Data.Common.DbTransaction trans = m_OtsDatabaseConnection.BeginTransaction();