Browse Source

Merge branch 'Release2.8' into GSP

gsp 1 year ago
parent
commit
107a526d87

+ 7 - 7
Bin/x64/Debug/Resources/XMLData/ResourceForMeasureSourceGrid-ZH.xml

@@ -372,10 +372,10 @@
         <member itemKey="12262" itemName="" itemText="自上而下"/>
         <member itemKey="12263" itemName="" itemText="自下而上"/>
         <member itemKey="12264" itemName="" itemText="随机"/>
-        <member itemKey="12265" itemName="" itemText=""/>
-        <member itemKey="12266" itemName="" itemText=""/>
-        <member itemKey="12267" itemName="" itemText=""/>
-        <member itemKey="12268" itemName="" itemText=""/>
+        <member itemKey="12265" itemName="" itemText="通用方法"/>
+        <member itemKey="12266" itemName="" itemText="钙处理"/>
+        <member itemKey="12267" itemName="" itemText="镁处理"/>
+        <member itemKey="12268" itemName="" itemText="稀土处理"/>
         <member itemKey="12269" itemName="" itemText="空"/>
         <member itemKey="12270" itemName="" itemText="低"/>
         <member itemKey="12271" itemName="" itemText="中"/>
@@ -398,9 +398,9 @@
         <member itemKey="12288" itemName="" itemText="点扫描"/>
         <member itemKey="12289" itemName="" itemText="面扫描"/>
         <member itemKey="12290" itemName="" itemText="空"/>
-        <member itemKey="12291" itemName="" itemText=""/>
-        <member itemKey="12292" itemName="" itemText=""/>
-        <member itemKey="12293" itemName="" itemText=""/>
+        <member itemKey="12291" itemName="" itemText="取中"/>
+        <member itemKey="12292" itemName="" itemText="向下"/>
+        <member itemKey="12293" itemName="" itemText="向上"/>
         <member itemKey="12294" itemName="" itemText="空"/>
         <member itemKey="12295" itemName="" itemText="低"/>
         <member itemKey="12296" itemName="" itemText="中"/>

+ 2 - 0
OTSIncAMeasureApp/0-OTSModel/Measure/3-MeasureFlow/CSmplMeasure.cs

@@ -519,7 +519,9 @@ namespace OTSModelSharp
                     sm.SetBSEParam();
                    
                     sm.m_SemHardwareMgr.SetMagnification(semState.Magnification);
+                    Thread.Sleep(100);
                     sm.MoveSEMToPoint(semState.Pos);
+                    Thread.Sleep(100);
                     sm.m_SemHardwareMgr.SetWorkingDistance(semState.WorkingDistance);
                    
 

+ 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);
+        }
     }
 }

+ 2 - 2
OTSIncAMeasureApp/ResourceManage/ResourceData.cs

@@ -241,7 +241,7 @@ namespace OTSModelSharp.ResourceManage
             string strId = "";
 
            
-                strId = XmlResourceData.GetInstance().GetStringByKey(ResourceID.GrpGeneral, ResourceID.IDS_MEMBRANE_TYPE + (int)a_nSteelTech);
+                strId = XmlResourceData.GetInstance().GetStringByKey(ResourceID.GrpOtherParam, ResourceID.IDS_MEMBRANE_TYPE + (int)a_nSteelTech);
           
 
             return strId;
@@ -307,7 +307,7 @@ namespace OTSModelSharp.ResourceManage
             string strIMAGEMODE = "";
 
             
-                strIMAGEMODE = XmlResourceData.GetInstance().GetStringByKey(ResourceID.GrpImageProcess, ResourceID.IDS_AUTOBGREMOVE_TYPE + (int)a_nIMAGEMODE);
+                strIMAGEMODE = XmlResourceData.GetInstance().GetStringByKey(ResourceID.GrpOtherParam, ResourceID.IDS_AUTOBGREMOVE_TYPE + (int)a_nIMAGEMODE);
            
 
             return strIMAGEMODE;

+ 2 - 2
OTSIncAMeasureApp/ResourceManage/ResourceID.cs

@@ -46,10 +46,10 @@ namespace OTSModelSharp.ResourceManage
         public const int IDS_SYSTEMSTD_NAME_FIRST = 20335;
         public const int IDS_STRING20350 = 20350;
         public const int IDS_STRING20351 = 20351;
-        public const int IDS_MEMBRANE_TYPE = 20353;
+        public const int IDS_MEMBRANE_TYPE = 12265;
         public const int IDS_FIELD_STOP_TYPE = 20401;
         public const int IDS_BGREMOVE_TYPE = 20027;
-        public const int IDS_AUTOBGREMOVE_TYPE = 20029;
+        public const int IDS_AUTOBGREMOVE_TYPE = 12291;
         public const int IDS_STEEL_TECHNOLOGY = 20353;
 
         public const int IDD_LICENSE_INFO = 12000;

+ 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();
 

+ 290 - 35
OTSSysMgrApp/ControllerSettingForm.Designer.cs

@@ -57,6 +57,24 @@
             this.tbRWidth = new System.Windows.Forms.TextBox();
             this.lblDwellTime = new System.Windows.Forms.Label();
             this.lblResolution = new System.Windows.Forms.Label();
+            this.tabImage2 = new System.Windows.Forms.TabPage();
+            this.splitContainer1 = new System.Windows.Forms.SplitContainer();
+            this.label5 = new System.Windows.Forms.Label();
+            this.cb_imageresolution = new System.Windows.Forms.ComboBox();
+            this.label4 = new System.Windows.Forms.Label();
+            this.label3 = new System.Windows.Forms.Label();
+            this.tB_scanFieldSize100 = new System.Windows.Forms.TextBox();
+            this.label1 = new System.Windows.Forms.Label();
+            this.btn_confirm = new System.Windows.Forms.Button();
+            this.cb_Ydirection = new System.Windows.Forms.ComboBox();
+            this.label_y = new System.Windows.Forms.Label();
+            this.cb_Xdirection = new System.Windows.Forms.ComboBox();
+            this.label_x = new System.Windows.Forms.Label();
+            this.btn_continuousshot = new System.Windows.Forms.Button();
+            this.pictureBox3 = new System.Windows.Forms.PictureBox();
+            this.pictureBox4 = new System.Windows.Forms.PictureBox();
+            this.pictureBox2 = new System.Windows.Forms.PictureBox();
+            this.pictureBox1 = new System.Windows.Forms.PictureBox();
             this.tabSetting.SuspendLayout();
             this.tabXRay.SuspendLayout();
             this.groupBox1.SuspendLayout();
@@ -65,18 +83,28 @@
             this.groupBox2.SuspendLayout();
             this.panel1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pbImage)).BeginInit();
+            this.tabImage2.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
+            this.splitContainer1.Panel1.SuspendLayout();
+            this.splitContainer1.Panel2.SuspendLayout();
+            this.splitContainer1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
             this.SuspendLayout();
             // 
             // tabSetting
             // 
             this.tabSetting.Controls.Add(this.tabXRay);
             this.tabSetting.Controls.Add(this.tabImage);
+            this.tabSetting.Controls.Add(this.tabImage2);
             this.tabSetting.Dock = System.Windows.Forms.DockStyle.Fill;
             this.tabSetting.Location = new System.Drawing.Point(0, 0);
-            this.tabSetting.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.tabSetting.Margin = new System.Windows.Forms.Padding(2);
             this.tabSetting.Name = "tabSetting";
             this.tabSetting.SelectedIndex = 0;
-            this.tabSetting.Size = new System.Drawing.Size(835, 481);
+            this.tabSetting.Size = new System.Drawing.Size(835, 736);
             this.tabSetting.TabIndex = 2;
             // 
             // tabXRay
@@ -93,10 +121,10 @@
             this.tabXRay.Controls.Add(this.label2);
             this.tabXRay.Controls.Add(this.lblCollectionTime);
             this.tabXRay.Location = new System.Drawing.Point(4, 22);
-            this.tabXRay.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.tabXRay.Margin = new System.Windows.Forms.Padding(2);
             this.tabXRay.Name = "tabXRay";
-            this.tabXRay.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
-            this.tabXRay.Size = new System.Drawing.Size(827, 455);
+            this.tabXRay.Padding = new System.Windows.Forms.Padding(2);
+            this.tabXRay.Size = new System.Drawing.Size(827, 710);
             this.tabXRay.TabIndex = 0;
             this.tabXRay.Text = "X-Ray设置";
             this.tabXRay.UseVisualStyleBackColor = true;
@@ -109,10 +137,10 @@
             this.groupBox1.BackColor = System.Drawing.Color.White;
             this.groupBox1.Controls.Add(this.chartXRay);
             this.groupBox1.Location = new System.Drawing.Point(6, 45);
-            this.groupBox1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.groupBox1.Margin = new System.Windows.Forms.Padding(2);
             this.groupBox1.Name = "groupBox1";
-            this.groupBox1.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
-            this.groupBox1.Size = new System.Drawing.Size(819, 410);
+            this.groupBox1.Padding = new System.Windows.Forms.Padding(2);
+            this.groupBox1.Size = new System.Drawing.Size(819, 665);
             this.groupBox1.TabIndex = 16;
             this.groupBox1.TabStop = false;
             this.groupBox1.Text = "图像显示";
@@ -124,7 +152,7 @@
             this.chartXRay.ChartAreas.Add(chartArea1);
             this.chartXRay.Dock = System.Windows.Forms.DockStyle.Fill;
             this.chartXRay.Location = new System.Drawing.Point(2, 16);
-            this.chartXRay.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.chartXRay.Margin = new System.Windows.Forms.Padding(2);
             this.chartXRay.Name = "chartXRay";
             series1.ChartArea = "ChartArea1";
             series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line;
@@ -136,7 +164,7 @@
             series1.XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Int64;
             series1.YValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.Int64;
             this.chartXRay.Series.Add(series1);
-            this.chartXRay.Size = new System.Drawing.Size(815, 392);
+            this.chartXRay.Size = new System.Drawing.Size(815, 647);
             this.chartXRay.SuppressExceptions = true;
             this.chartXRay.TabIndex = 2;
             this.chartXRay.Text = "chart2";
@@ -145,7 +173,7 @@
             // 
             this.btnClearData.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.btnClearData.Location = new System.Drawing.Point(688, 9);
-            this.btnClearData.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnClearData.Margin = new System.Windows.Forms.Padding(2);
             this.btnClearData.Name = "btnClearData";
             this.btnClearData.Size = new System.Drawing.Size(39, 33);
             this.btnClearData.TabIndex = 5;
@@ -157,7 +185,7 @@
             // 
             this.btnAreaRay.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.btnAreaRay.Location = new System.Drawing.Point(476, 9);
-            this.btnAreaRay.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnAreaRay.Margin = new System.Windows.Forms.Padding(2);
             this.btnAreaRay.Name = "btnAreaRay";
             this.btnAreaRay.Size = new System.Drawing.Size(67, 33);
             this.btnAreaRay.TabIndex = 4;
@@ -169,7 +197,7 @@
             // 
             this.btnPointXRay.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.btnPointXRay.Location = new System.Drawing.Point(617, 9);
-            this.btnPointXRay.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnPointXRay.Margin = new System.Windows.Forms.Padding(2);
             this.btnPointXRay.Name = "btnPointXRay";
             this.btnPointXRay.Size = new System.Drawing.Size(67, 33);
             this.btnPointXRay.TabIndex = 3;
@@ -181,7 +209,7 @@
             // 
             this.btnEanalysis.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.btnEanalysis.Location = new System.Drawing.Point(756, 9);
-            this.btnEanalysis.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnEanalysis.Margin = new System.Windows.Forms.Padding(2);
             this.btnEanalysis.Name = "btnEanalysis";
             this.btnEanalysis.Size = new System.Drawing.Size(67, 33);
             this.btnEanalysis.TabIndex = 6;
@@ -193,7 +221,7 @@
             // 
             this.btnDisplayXRay.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.btnDisplayXRay.Location = new System.Drawing.Point(547, 9);
-            this.btnDisplayXRay.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnDisplayXRay.Margin = new System.Windows.Forms.Padding(2);
             this.btnDisplayXRay.Name = "btnDisplayXRay";
             this.btnDisplayXRay.Size = new System.Drawing.Size(67, 33);
             this.btnDisplayXRay.TabIndex = 2;
@@ -215,7 +243,7 @@
             // 
             this.btnCollectionTime.Enabled = false;
             this.btnCollectionTime.Location = new System.Drawing.Point(167, 15);
-            this.btnCollectionTime.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnCollectionTime.Margin = new System.Windows.Forms.Padding(2);
             this.btnCollectionTime.Name = "btnCollectionTime";
             this.btnCollectionTime.Size = new System.Drawing.Size(40, 21);
             this.btnCollectionTime.TabIndex = 8;
@@ -227,7 +255,7 @@
             // tbCollectionTime
             // 
             this.tbCollectionTime.Location = new System.Drawing.Point(76, 16);
-            this.tbCollectionTime.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.tbCollectionTime.Margin = new System.Windows.Forms.Padding(2);
             this.tbCollectionTime.Name = "tbCollectionTime";
             this.tbCollectionTime.Size = new System.Drawing.Size(63, 21);
             this.tbCollectionTime.TabIndex = 1;
@@ -264,10 +292,10 @@
             this.tabImage.Controls.Add(this.lblDwellTime);
             this.tabImage.Controls.Add(this.lblResolution);
             this.tabImage.Location = new System.Drawing.Point(4, 22);
-            this.tabImage.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.tabImage.Margin = new System.Windows.Forms.Padding(2);
             this.tabImage.Name = "tabImage";
-            this.tabImage.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
-            this.tabImage.Size = new System.Drawing.Size(827, 455);
+            this.tabImage.Padding = new System.Windows.Forms.Padding(2);
+            this.tabImage.Size = new System.Drawing.Size(827, 710);
             this.tabImage.TabIndex = 1;
             this.tabImage.Text = "BSE设置";
             this.tabImage.UseVisualStyleBackColor = true;
@@ -285,7 +313,7 @@
             "128",
             "256"});
             this.ddlDwellTime.Location = new System.Drawing.Point(266, 16);
-            this.ddlDwellTime.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.ddlDwellTime.Margin = new System.Windows.Forms.Padding(2);
             this.ddlDwellTime.Name = "ddlDwellTime";
             this.ddlDwellTime.Size = new System.Drawing.Size(82, 20);
             this.ddlDwellTime.TabIndex = 3;
@@ -299,10 +327,10 @@
             this.groupBox2.Controls.Add(this.panel1);
             this.groupBox2.Controls.Add(this.btnClear);
             this.groupBox2.Location = new System.Drawing.Point(6, 45);
-            this.groupBox2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.groupBox2.Margin = new System.Windows.Forms.Padding(2);
             this.groupBox2.Name = "groupBox2";
-            this.groupBox2.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
-            this.groupBox2.Size = new System.Drawing.Size(822, 410);
+            this.groupBox2.Padding = new System.Windows.Forms.Padding(2);
+            this.groupBox2.Size = new System.Drawing.Size(822, 665);
             this.groupBox2.TabIndex = 13;
             this.groupBox2.TabStop = false;
             this.groupBox2.Text = "图像显示";
@@ -313,9 +341,9 @@
             this.panel1.Controls.Add(this.pbImage);
             this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.panel1.Location = new System.Drawing.Point(2, 16);
-            this.panel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.panel1.Margin = new System.Windows.Forms.Padding(2);
             this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(818, 392);
+            this.panel1.Size = new System.Drawing.Size(818, 647);
             this.panel1.TabIndex = 2;
             // 
             // pbImage
@@ -323,9 +351,9 @@
             this.pbImage.BackColor = System.Drawing.Color.White;
             this.pbImage.Dock = System.Windows.Forms.DockStyle.Fill;
             this.pbImage.Location = new System.Drawing.Point(0, 0);
-            this.pbImage.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.pbImage.Margin = new System.Windows.Forms.Padding(2);
             this.pbImage.Name = "pbImage";
-            this.pbImage.Size = new System.Drawing.Size(818, 392);
+            this.pbImage.Size = new System.Drawing.Size(818, 647);
             this.pbImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
             this.pbImage.TabIndex = 0;
             this.pbImage.TabStop = false;
@@ -334,7 +362,7 @@
             // 
             this.btnClear.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.btnClear.Location = new System.Drawing.Point(750, 77);
-            this.btnClear.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnClear.Margin = new System.Windows.Forms.Padding(2);
             this.btnClear.Name = "btnClear";
             this.btnClear.Size = new System.Drawing.Size(67, 50);
             this.btnClear.TabIndex = 1;
@@ -347,7 +375,7 @@
             // 
             this.btnSaveImage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.btnSaveImage.Location = new System.Drawing.Point(550, 8);
-            this.btnSaveImage.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnSaveImage.Margin = new System.Windows.Forms.Padding(2);
             this.btnSaveImage.Name = "btnSaveImage";
             this.btnSaveImage.Size = new System.Drawing.Size(67, 33);
             this.btnSaveImage.TabIndex = 4;
@@ -360,7 +388,7 @@
             // 
             this.btnDisplay.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
             this.btnDisplay.Location = new System.Drawing.Point(756, 8);
-            this.btnDisplay.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnDisplay.Margin = new System.Windows.Forms.Padding(2);
             this.btnDisplay.Name = "btnDisplay";
             this.btnDisplay.Size = new System.Drawing.Size(67, 33);
             this.btnDisplay.TabIndex = 5;
@@ -371,7 +399,7 @@
             // tbRHeight
             // 
             this.tbRHeight.Location = new System.Drawing.Point(119, 15);
-            this.tbRHeight.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.tbRHeight.Margin = new System.Windows.Forms.Padding(2);
             this.tbRHeight.Name = "tbRHeight";
             this.tbRHeight.Size = new System.Drawing.Size(48, 21);
             this.tbRHeight.TabIndex = 2;
@@ -380,7 +408,7 @@
             // tbRWidth
             // 
             this.tbRWidth.Location = new System.Drawing.Point(66, 15);
-            this.tbRWidth.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.tbRWidth.Margin = new System.Windows.Forms.Padding(2);
             this.tbRWidth.Name = "tbRWidth";
             this.tbRWidth.Size = new System.Drawing.Size(48, 21);
             this.tbRWidth.TabIndex = 1;
@@ -406,15 +434,214 @@
             this.lblResolution.TabIndex = 10;
             this.lblResolution.Text = "分辨率";
             // 
+            // tabImage2
+            // 
+            this.tabImage2.Controls.Add(this.splitContainer1);
+            this.tabImage2.Location = new System.Drawing.Point(4, 22);
+            this.tabImage2.Name = "tabImage2";
+            this.tabImage2.Padding = new System.Windows.Forms.Padding(3);
+            this.tabImage2.Size = new System.Drawing.Size(827, 710);
+            this.tabImage2.TabIndex = 2;
+            this.tabImage2.Text = "轴方向测试";
+            this.tabImage2.UseVisualStyleBackColor = true;
+            // 
+            // splitContainer1
+            // 
+            this.splitContainer1.Location = new System.Drawing.Point(7, 8);
+            this.splitContainer1.Name = "splitContainer1";
+            this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
+            // 
+            // splitContainer1.Panel1
+            // 
+            this.splitContainer1.Panel1.Controls.Add(this.label5);
+            this.splitContainer1.Panel1.Controls.Add(this.cb_imageresolution);
+            this.splitContainer1.Panel1.Controls.Add(this.label4);
+            this.splitContainer1.Panel1.Controls.Add(this.label3);
+            this.splitContainer1.Panel1.Controls.Add(this.tB_scanFieldSize100);
+            this.splitContainer1.Panel1.Controls.Add(this.label1);
+            this.splitContainer1.Panel1.Controls.Add(this.btn_confirm);
+            this.splitContainer1.Panel1.Controls.Add(this.cb_Ydirection);
+            this.splitContainer1.Panel1.Controls.Add(this.label_y);
+            this.splitContainer1.Panel1.Controls.Add(this.cb_Xdirection);
+            this.splitContainer1.Panel1.Controls.Add(this.label_x);
+            this.splitContainer1.Panel1.Controls.Add(this.btn_continuousshot);
+            // 
+            // splitContainer1.Panel2
+            // 
+            this.splitContainer1.Panel2.Controls.Add(this.pictureBox3);
+            this.splitContainer1.Panel2.Controls.Add(this.pictureBox4);
+            this.splitContainer1.Panel2.Controls.Add(this.pictureBox2);
+            this.splitContainer1.Panel2.Controls.Add(this.pictureBox1);
+            this.splitContainer1.Size = new System.Drawing.Size(813, 695);
+            this.splitContainer1.SplitterDistance = 83;
+            this.splitContainer1.TabIndex = 3;
+            // 
+            // label5
+            // 
+            this.label5.AutoSize = true;
+            this.label5.Location = new System.Drawing.Point(512, 53);
+            this.label5.Name = "label5";
+            this.label5.Size = new System.Drawing.Size(131, 12);
+            this.label5.TabIndex = 15;
+            this.label5.Text = "请在 100 放大倍数调试";
+            // 
+            // cb_imageresolution
+            // 
+            this.cb_imageresolution.FormattingEnabled = true;
+            this.cb_imageresolution.Location = new System.Drawing.Point(66, 45);
+            this.cb_imageresolution.Name = "cb_imageresolution";
+            this.cb_imageresolution.Size = new System.Drawing.Size(121, 20);
+            this.cb_imageresolution.TabIndex = 14;
+            // 
+            // label4
+            // 
+            this.label4.AutoSize = true;
+            this.label4.Location = new System.Drawing.Point(7, 48);
+            this.label4.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+            this.label4.Name = "label4";
+            this.label4.Size = new System.Drawing.Size(47, 12);
+            this.label4.TabIndex = 13;
+            this.label4.Text = "分辨率:";
+            // 
+            // label3
+            // 
+            this.label3.AutoSize = true;
+            this.label3.Location = new System.Drawing.Point(597, 11);
+            this.label3.Name = "label3";
+            this.label3.Size = new System.Drawing.Size(29, 12);
+            this.label3.TabIndex = 8;
+            this.label3.Text = "微米";
+            // 
+            // tB_scanFieldSize100
+            // 
+            this.tB_scanFieldSize100.Location = new System.Drawing.Point(491, 7);
+            this.tB_scanFieldSize100.Name = "tB_scanFieldSize100";
+            this.tB_scanFieldSize100.Size = new System.Drawing.Size(100, 21);
+            this.tB_scanFieldSize100.TabIndex = 7;
+            this.tB_scanFieldSize100.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Location = new System.Drawing.Point(391, 11);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(107, 12);
+            this.label1.TabIndex = 6;
+            this.label1.Text = "100倍下屏幕宽度:";
+            // 
+            // btn_confirm
+            // 
+            this.btn_confirm.Location = new System.Drawing.Point(730, 11);
+            this.btn_confirm.Name = "btn_confirm";
+            this.btn_confirm.Size = new System.Drawing.Size(75, 60);
+            this.btn_confirm.TabIndex = 5;
+            this.btn_confirm.Text = "保存";
+            this.btn_confirm.UseVisualStyleBackColor = true;
+            this.btn_confirm.Click += new System.EventHandler(this.btn_confirm_Click);
+            // 
+            // cb_Ydirection
+            // 
+            this.cb_Ydirection.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.cb_Ydirection.FormattingEnabled = true;
+            this.cb_Ydirection.Location = new System.Drawing.Point(259, 7);
+            this.cb_Ydirection.Name = "cb_Ydirection";
+            this.cb_Ydirection.Size = new System.Drawing.Size(119, 20);
+            this.cb_Ydirection.TabIndex = 4;
+            // 
+            // label_y
+            // 
+            this.label_y.AutoSize = true;
+            this.label_y.Location = new System.Drawing.Point(193, 11);
+            this.label_y.Name = "label_y";
+            this.label_y.Size = new System.Drawing.Size(71, 12);
+            this.label_y.TabIndex = 3;
+            this.label_y.Text = "y轴正方向:";
+            // 
+            // cb_Xdirection
+            // 
+            this.cb_Xdirection.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+            this.cb_Xdirection.FormattingEnabled = true;
+            this.cb_Xdirection.Location = new System.Drawing.Point(68, 8);
+            this.cb_Xdirection.Name = "cb_Xdirection";
+            this.cb_Xdirection.Size = new System.Drawing.Size(119, 20);
+            this.cb_Xdirection.TabIndex = 2;
+            // 
+            // label_x
+            // 
+            this.label_x.AutoSize = true;
+            this.label_x.Location = new System.Drawing.Point(3, 11);
+            this.label_x.Name = "label_x";
+            this.label_x.Size = new System.Drawing.Size(71, 12);
+            this.label_x.TabIndex = 1;
+            this.label_x.Text = "x轴正方向:";
+            // 
+            // btn_continuousshot
+            // 
+            this.btn_continuousshot.Location = new System.Drawing.Point(649, 11);
+            this.btn_continuousshot.Name = "btn_continuousshot";
+            this.btn_continuousshot.Size = new System.Drawing.Size(75, 61);
+            this.btn_continuousshot.TabIndex = 0;
+            this.btn_continuousshot.Text = "轴方向验证";
+            this.btn_continuousshot.UseVisualStyleBackColor = true;
+            this.btn_continuousshot.Click += new System.EventHandler(this.btn_continuousshot_Click);
+            // 
+            // pictureBox3
+            // 
+            this.pictureBox3.BackColor = System.Drawing.Color.White;
+            this.pictureBox3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.pictureBox3.Location = new System.Drawing.Point(405, 305);
+            this.pictureBox3.Margin = new System.Windows.Forms.Padding(2);
+            this.pictureBox3.Name = "pictureBox3";
+            this.pictureBox3.Size = new System.Drawing.Size(400, 300);
+            this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
+            this.pictureBox3.TabIndex = 4;
+            this.pictureBox3.TabStop = false;
+            // 
+            // pictureBox4
+            // 
+            this.pictureBox4.BackColor = System.Drawing.Color.White;
+            this.pictureBox4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.pictureBox4.Location = new System.Drawing.Point(5, 305);
+            this.pictureBox4.Margin = new System.Windows.Forms.Padding(2);
+            this.pictureBox4.Name = "pictureBox4";
+            this.pictureBox4.Size = new System.Drawing.Size(400, 300);
+            this.pictureBox4.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
+            this.pictureBox4.TabIndex = 3;
+            this.pictureBox4.TabStop = false;
+            // 
+            // pictureBox2
+            // 
+            this.pictureBox2.BackColor = System.Drawing.Color.White;
+            this.pictureBox2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.pictureBox2.Location = new System.Drawing.Point(405, 5);
+            this.pictureBox2.Margin = new System.Windows.Forms.Padding(2);
+            this.pictureBox2.Name = "pictureBox2";
+            this.pictureBox2.Size = new System.Drawing.Size(400, 300);
+            this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
+            this.pictureBox2.TabIndex = 2;
+            this.pictureBox2.TabStop = false;
+            // 
+            // pictureBox1
+            // 
+            this.pictureBox1.BackColor = System.Drawing.Color.White;
+            this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.pictureBox1.Location = new System.Drawing.Point(5, 5);
+            this.pictureBox1.Margin = new System.Windows.Forms.Padding(2);
+            this.pictureBox1.Name = "pictureBox1";
+            this.pictureBox1.Size = new System.Drawing.Size(400, 300);
+            this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
+            this.pictureBox1.TabIndex = 1;
+            this.pictureBox1.TabStop = false;
+            // 
             // ControllerSettingForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.White;
-            this.ClientSize = new System.Drawing.Size(835, 481);
+            this.ClientSize = new System.Drawing.Size(835, 736);
             this.Controls.Add(this.tabSetting);
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
-            this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.Margin = new System.Windows.Forms.Padding(2);
             this.MinimumSize = new System.Drawing.Size(639, 403);
             this.Name = "ControllerSettingForm";
             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
@@ -431,6 +658,16 @@
             this.groupBox2.ResumeLayout(false);
             this.panel1.ResumeLayout(false);
             ((System.ComponentModel.ISupportInitialize)(this.pbImage)).EndInit();
+            this.tabImage2.ResumeLayout(false);
+            this.splitContainer1.Panel1.ResumeLayout(false);
+            this.splitContainer1.Panel1.PerformLayout();
+            this.splitContainer1.Panel2.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
+            this.splitContainer1.ResumeLayout(false);
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox4)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
             this.ResumeLayout(false);
 
         }
@@ -462,5 +699,23 @@
         private System.Windows.Forms.Button btnPointXRay;
         private System.Windows.Forms.Button btnClearData;
         private System.Windows.Forms.Button btnEanalysis;
+        private System.Windows.Forms.TabPage tabImage2;
+        private System.Windows.Forms.SplitContainer splitContainer1;
+        private System.Windows.Forms.Label label5;
+        private System.Windows.Forms.ComboBox cb_imageresolution;
+        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label label3;
+        private System.Windows.Forms.TextBox tB_scanFieldSize100;
+        private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Button btn_confirm;
+        private System.Windows.Forms.ComboBox cb_Ydirection;
+        private System.Windows.Forms.Label label_y;
+        private System.Windows.Forms.ComboBox cb_Xdirection;
+        private System.Windows.Forms.Label label_x;
+        private System.Windows.Forms.Button btn_continuousshot;
+        private System.Windows.Forms.PictureBox pictureBox3;
+        private System.Windows.Forms.PictureBox pictureBox4;
+        private System.Windows.Forms.PictureBox pictureBox2;
+        private System.Windows.Forms.PictureBox pictureBox1;
     }
 }

+ 221 - 1
OTSSysMgrApp/ControllerSettingForm.cs

@@ -144,6 +144,18 @@ namespace OTSSysMgrApp
             int width=Convert.ToInt32( tbRWidth.Text);
             int height =Convert.ToInt32(tbRHeight.Text);
             m_EDSHardwareMgr = EDSController.GetEDSController(width,height,5000);
+
+            cb_Xdirection.Items.Add("LEFT_TOWARD");
+            cb_Xdirection.Items.Add("RIGHT_TOWARD");
+            cb_Ydirection.Items.Add("UP_TOWARD");
+            cb_Ydirection.Items.Add("DOWN_TOWARD");
+            tB_scanFieldSize100.Text = "1270";
+            cb_imageresolution.Items.Add("1024*768");
+            cb_imageresolution.Items.Add("1024*704");
+            cb_imageresolution.Items.Add("1536*1024");
+            cb_Xdirection.SelectedIndex = 0;
+            cb_Ydirection.SelectedIndex = 0;
+            cb_imageresolution.SelectedIndex = 0;
         }
 
         Thread ScanThread = null;
@@ -1134,7 +1146,215 @@ namespace OTSSysMgrApp
 
             return true;
         }
-       
+
         #endregion
+
+        private void btn_continuousshot_Click(object sender, EventArgs e)
+        {
+            pictureBox1.Image = null;
+            pictureBox2.Image = null;
+            pictureBox3.Image = null;
+            pictureBox4.Image = null;
+
+            btn_continuousshot.Enabled = false;
+            btn_confirm.Enabled = false;
+            this.Refresh();
+
+            ISemController m_Sem = SemController.GetSEMController();
+            bool flag = m_Sem.Connect();
+            //电镜设置对象
+            var cfun = ScanController.GetScanController();
+
+            bool IsConnec = cfun.Init();
+
+            double Magnification = 0;
+            m_Sem.GetMagnification(ref Magnification);
+
+            //double a_dScanFieldSizeX = 0;
+            //double a_dScanFieldSizeY = 0;
+            //m_Sem.GetScanFieldSize(ref a_dScanFieldSizeX,ref a_dScanFieldSizeY);
+
+            double scanFieldSize100 = 0;
+            double.TryParse(tB_scanFieldSize100.Text, out scanFieldSize100);
+            double scanFieldSize = scanFieldSize100 * 100 / Magnification;
+
+            double PositionX = 0;
+            double PositionY = 0;
+            double PositionR = 0;
+            m_Sem.GetSemPositionXY(ref PositionX, ref PositionY, ref PositionR);
+
+            double PositionXO = PositionX;
+            double PositionYO = PositionY;
+            //double PositionR0 = PositionR;
+
+            int width = 1024;
+            int height = 768;
+            //设置图像分辨率
+            if (cb_imageresolution.Text.Trim() == "")
+            {
+                MessageBox.Show("imageresolution cannot be null!");
+                return;
+            }
+            else
+            {
+                width = Convert.ToInt32(cb_imageresolution.Text.Split('*')[0]);
+                height = Convert.ToInt32(cb_imageresolution.Text.Split('*')[1]);
+
+                pictureBox1.Height = pictureBox1.Width * height / width;
+                pictureBox2.Height = pictureBox1.Width * height / width;
+                pictureBox3.Height = pictureBox1.Width * height / width;
+                pictureBox4.Height = pictureBox1.Width * height / width;
+                pictureBox2.Location = new Point(pictureBox1.Location.X + pictureBox1.Width, pictureBox1.Location.Y);
+                pictureBox3.Location = new Point(pictureBox1.Location.X, pictureBox1.Location.Y + pictureBox1.Height);
+                pictureBox4.Location = new Point(pictureBox1.Location.X + pictureBox1.Width, pictureBox1.Location.Y + pictureBox1.Height);
+            }
+
+            this.Refresh();
+
+            double scanFieldSizeH = scanFieldSize * height / width;
+
+            m_Sem.SetScanExternal(true);
+
+            try
+            {
+                for (int i = 0; i < 4; i++)
+                {
+                    if (i == 0)
+                    {
+
+                    }
+                    else if (i == 1)
+                    {
+                        switch (cb_Xdirection.SelectedItem.ToString())
+                        {
+                            case "RIGHT_TOWARD": PositionX += scanFieldSize; break;
+                            default: PositionX -= scanFieldSize; break;
+                        }
+                        m_Sem.MoveSEMToPoint(PositionX, PositionY);
+                    }
+                    else if (i == 2)
+                    {
+                        switch (cb_Ydirection.SelectedItem.ToString())
+                        {
+                            case "UP_TOWARD": PositionY -= scanFieldSizeH; break;
+                            default: PositionY += scanFieldSizeH; break;
+                        }
+                        m_Sem.MoveSEMToPoint(PositionX, PositionY);
+                    }
+                    else
+                    {
+                        switch (cb_Xdirection.SelectedItem.ToString())
+                        {
+                            case "RIGHT_TOWARD": PositionX -= scanFieldSize; break;
+                            default: PositionX += scanFieldSize; break;
+                        }
+                        m_Sem.MoveSEMToPoint(PositionX, PositionY);
+                    }
+                    //Thread.Sleep(50);
+                    byte[] ImageByte = new byte[width * height];
+                    bool resultValue = GetScanImage(width, height, "2", ref ImageByte);
+
+                    if (resultValue)
+                    {
+                        if (ImageByte != null)
+                        {
+                            var bitmap = CImageHandler.ToGrayBitmap(ImageByte, width, height);
+                            switch (i)
+                            {
+                                case 0:
+                                    pictureBox1.Image = bitmap;
+                                    break;
+                                case 1:
+                                    pictureBox2.Image = bitmap;
+                                    break;
+                                case 2:
+                                    pictureBox4.Image = bitmap;
+                                    break;
+                                case 3:
+                                    pictureBox3.Image = bitmap;
+                                    break;
+                            }
+                            this.Refresh();
+                        }
+                    }
+                }
+                m_Sem.MoveSEMToPoint(PositionXO, PositionYO);
+            }
+            catch (Exception ex)
+            {
+                log.Error("continuousshot--错误信息:" + ex.ToString());
+            }
+            finally
+            {
+                m_Sem.SetScanExternal(false);
+                m_Sem.DisConnect();
+                btn_continuousshot.Enabled = true;
+                btn_confirm.Enabled = true;
+                btn_continuousshot.Refresh();
+            }
+        }
+        bool SaveConfigXml(string xmlpath, string xAxisDir, string yAxisDir, string scanFieldSize)
+        {
+            try
+            {
+                XmlDocument xmlDocument = new XmlDocument();
+                xmlDocument.Load(xmlpath);
+                XmlNodeList nodeList = xmlDocument.SelectSingleNode("XMLData").ChildNodes;
+
+                foreach (XmlNode xn in nodeList)
+                {
+                    XmlElement xe = (XmlElement)xn;
+                    if (xe.GetAttribute("RegName") == "StageData")
+                    {
+                        xe.SetAttribute("scanFieldSize", scanFieldSize);
+                        xe.SetAttribute("xAxisDir", xAxisDir);
+                        xe.SetAttribute("yAxisDir", yAxisDir);
+                        break;
+                    }
+                }
+
+                xmlDocument.Save(xmlpath);
+            }
+            catch (Exception ex)
+            {
+                MessageBox.Show(ex.ToString());
+                return false;
+            }
+            return true;
+        }
+
+        private void btn_confirm_Click(object sender, EventArgs e)
+        {
+            double dscanFieldSize100 = 0;
+            if (cb_Xdirection.Text.Trim() != null && cb_imageresolution.Text.Trim() != null && cb_Ydirection.Text.Trim() != null && double.TryParse(tB_scanFieldSize100.Text, out dscanFieldSize100))
+            {
+                string xmlpath = Application.StartupPath + @"\Config\SysData\OTSProgMgrParam.pmf";
+                string xAxisDir = "";
+                string yAxisDir = "";
+                switch (cb_Xdirection.SelectedItem.ToString())
+                {
+                    case "LEFT_TOWARD":
+                        xAxisDir = "0:LEFT_TOWARD";
+                        break;
+                    default:
+                        xAxisDir = "1:RIGHT_TOWARD";
+                        break;
+                }
+                switch(cb_Ydirection.Text)
+                {
+                    case "UP_TOWARD":
+                        yAxisDir="0:" + cb_Ydirection.Text;
+                        break;
+                    default:
+                        yAxisDir = "1:DOWN_TOWARD";
+                        break;
+                }
+                SaveConfigXml(xmlpath, xAxisDir, yAxisDir, tB_scanFieldSize100.Text);
+            }
+            else
+            {
+                MessageBox.Show("Please check params!");
+            }
+        }
     }
 }

+ 61 - 16
OTSSysMgrApp/OTSSystemManagerForms.Designer.cs

@@ -44,11 +44,15 @@
             this.pictureBox2 = new System.Windows.Forms.PictureBox();
             this.button2 = new System.Windows.Forms.Button();
             this.button1 = new System.Windows.Forms.Button();
+            this.tabSysType = new System.Windows.Forms.TabPage();
+            this.radioButton_CleannessA = new System.Windows.Forms.RadioButton();
+            this.radioButton_IncA = new System.Windows.Forms.RadioButton();
             this.tabLanguage.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
             this.tabControl1.SuspendLayout();
             this.tabHardwareSet.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
+            this.tabSysType.SuspendLayout();
             this.SuspendLayout();
             // 
             // tabLanguage
@@ -57,9 +61,9 @@
             this.tabLanguage.Controls.Add(this.rdb_en);
             this.tabLanguage.Controls.Add(this.rdb_ch);
             this.tabLanguage.Location = new System.Drawing.Point(4, 22);
-            this.tabLanguage.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.tabLanguage.Margin = new System.Windows.Forms.Padding(2);
             this.tabLanguage.Name = "tabLanguage";
-            this.tabLanguage.Size = new System.Drawing.Size(545, 127);
+            this.tabLanguage.Size = new System.Drawing.Size(546, 133);
             this.tabLanguage.TabIndex = 2;
             this.tabLanguage.Text = "语言";
             this.tabLanguage.UseVisualStyleBackColor = true;
@@ -68,7 +72,7 @@
             // 
             this.pictureBox3.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox3.Image")));
             this.pictureBox3.Location = new System.Drawing.Point(38, 22);
-            this.pictureBox3.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.pictureBox3.Margin = new System.Windows.Forms.Padding(2);
             this.pictureBox3.Name = "pictureBox3";
             this.pictureBox3.Size = new System.Drawing.Size(67, 66);
             this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
@@ -80,7 +84,7 @@
             this.rdb_en.AutoSize = true;
             this.rdb_en.Checked = true;
             this.rdb_en.Location = new System.Drawing.Point(147, 58);
-            this.rdb_en.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.rdb_en.Margin = new System.Windows.Forms.Padding(2);
             this.rdb_en.Name = "rdb_en";
             this.rdb_en.Size = new System.Drawing.Size(71, 16);
             this.rdb_en.TabIndex = 0;
@@ -93,7 +97,7 @@
             // 
             this.rdb_ch.AutoSize = true;
             this.rdb_ch.Location = new System.Drawing.Point(147, 25);
-            this.rdb_ch.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.rdb_ch.Margin = new System.Windows.Forms.Padding(2);
             this.rdb_ch.Name = "rdb_ch";
             this.rdb_ch.Size = new System.Drawing.Size(71, 16);
             this.rdb_ch.TabIndex = 0;
@@ -105,9 +109,10 @@
             // 
             this.tabControl1.Controls.Add(this.tabHardwareSet);
             this.tabControl1.Controls.Add(this.tabLanguage);
+            this.tabControl1.Controls.Add(this.tabSysType);
             this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill;
             this.tabControl1.Location = new System.Drawing.Point(0, 0);
-            this.tabControl1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.tabControl1.Margin = new System.Windows.Forms.Padding(2);
             this.tabControl1.Name = "tabControl1";
             this.tabControl1.SelectedIndex = 0;
             this.tabControl1.Size = new System.Drawing.Size(554, 159);
@@ -125,9 +130,9 @@
             this.tabHardwareSet.Controls.Add(this.button2);
             this.tabHardwareSet.Controls.Add(this.button1);
             this.tabHardwareSet.Location = new System.Drawing.Point(4, 22);
-            this.tabHardwareSet.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.tabHardwareSet.Margin = new System.Windows.Forms.Padding(2);
             this.tabHardwareSet.Name = "tabHardwareSet";
-            this.tabHardwareSet.Padding = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.tabHardwareSet.Padding = new System.Windows.Forms.Padding(2);
             this.tabHardwareSet.Size = new System.Drawing.Size(546, 133);
             this.tabHardwareSet.TabIndex = 1;
             this.tabHardwareSet.Text = "硬件";
@@ -145,7 +150,7 @@
             "Oxford",
             "FEI"});
             this.CmbSEMController.Location = new System.Drawing.Point(227, 22);
-            this.CmbSEMController.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.CmbSEMController.Margin = new System.Windows.Forms.Padding(2);
             this.CmbSEMController.Name = "CmbSEMController";
             this.CmbSEMController.Size = new System.Drawing.Size(193, 20);
             this.CmbSEMController.TabIndex = 13;
@@ -161,7 +166,7 @@
             "Oxford",
             "FEI"});
             this.CmbEDSController.Location = new System.Drawing.Point(227, 74);
-            this.CmbEDSController.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.CmbEDSController.Margin = new System.Windows.Forms.Padding(2);
             this.CmbEDSController.Name = "CmbEDSController";
             this.CmbEDSController.Size = new System.Drawing.Size(193, 20);
             this.CmbEDSController.TabIndex = 14;
@@ -170,7 +175,7 @@
             // btnEDSTest
             // 
             this.btnEDSTest.Location = new System.Drawing.Point(429, 70);
-            this.btnEDSTest.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnEDSTest.Margin = new System.Windows.Forms.Padding(2);
             this.btnEDSTest.Name = "btnEDSTest";
             this.btnEDSTest.Size = new System.Drawing.Size(77, 24);
             this.btnEDSTest.TabIndex = 12;
@@ -181,7 +186,7 @@
             // btnSEMTest
             // 
             this.btnSEMTest.Location = new System.Drawing.Point(429, 20);
-            this.btnSEMTest.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.btnSEMTest.Margin = new System.Windows.Forms.Padding(2);
             this.btnSEMTest.Name = "btnSEMTest";
             this.btnSEMTest.Size = new System.Drawing.Size(77, 24);
             this.btnSEMTest.TabIndex = 10;
@@ -213,7 +218,7 @@
             // 
             this.pictureBox2.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox2.Image")));
             this.pictureBox2.Location = new System.Drawing.Point(38, 22);
-            this.pictureBox2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.pictureBox2.Margin = new System.Windows.Forms.Padding(2);
             this.pictureBox2.Name = "pictureBox2";
             this.pictureBox2.Size = new System.Drawing.Size(67, 66);
             this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
@@ -223,7 +228,7 @@
             // button2
             // 
             this.button2.Location = new System.Drawing.Point(482, 366);
-            this.button2.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.button2.Margin = new System.Windows.Forms.Padding(2);
             this.button2.Name = "button2";
             this.button2.Size = new System.Drawing.Size(67, 22);
             this.button2.TabIndex = 2;
@@ -233,13 +238,48 @@
             // button1
             // 
             this.button1.Location = new System.Drawing.Point(410, 366);
-            this.button1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.button1.Margin = new System.Windows.Forms.Padding(2);
             this.button1.Name = "button1";
             this.button1.Size = new System.Drawing.Size(67, 22);
             this.button1.TabIndex = 2;
             this.button1.Text = "button1";
             this.button1.UseVisualStyleBackColor = true;
             // 
+            // tabSysType
+            // 
+            this.tabSysType.Controls.Add(this.radioButton_CleannessA);
+            this.tabSysType.Controls.Add(this.radioButton_IncA);
+            this.tabSysType.Location = new System.Drawing.Point(4, 22);
+            this.tabSysType.Name = "tabSysType";
+            this.tabSysType.Padding = new System.Windows.Forms.Padding(3);
+            this.tabSysType.Size = new System.Drawing.Size(546, 133);
+            this.tabSysType.TabIndex = 3;
+            this.tabSysType.Text = "系统类型设置";
+            this.tabSysType.UseVisualStyleBackColor = true;
+            // 
+            // radioButton_CleannessA
+            // 
+            this.radioButton_CleannessA.AutoSize = true;
+            this.radioButton_CleannessA.Location = new System.Drawing.Point(29, 71);
+            this.radioButton_CleannessA.Name = "radioButton_CleannessA";
+            this.radioButton_CleannessA.Size = new System.Drawing.Size(65, 16);
+            this.radioButton_CleannessA.TabIndex = 1;
+            this.radioButton_CleannessA.TabStop = true;
+            this.radioButton_CleannessA.Text = " OTS102";
+            this.radioButton_CleannessA.UseVisualStyleBackColor = true;
+            // 
+            // radioButton_IncA
+            // 
+            this.radioButton_IncA.AutoSize = true;
+            this.radioButton_IncA.Location = new System.Drawing.Point(29, 32);
+            this.radioButton_IncA.Name = "radioButton_IncA";
+            this.radioButton_IncA.Size = new System.Drawing.Size(65, 16);
+            this.radioButton_IncA.TabIndex = 0;
+            this.radioButton_IncA.TabStop = true;
+            this.radioButton_IncA.Text = " OTS101";
+            this.radioButton_IncA.UseVisualStyleBackColor = true;
+            this.radioButton_IncA.CheckedChanged += new System.EventHandler(this.radioButton_IncA_CheckedChanged);
+            // 
             // OTSSystemManagerForms
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -248,7 +288,7 @@
             this.ClientSize = new System.Drawing.Size(554, 159);
             this.Controls.Add(this.tabControl1);
             this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
-            this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.Margin = new System.Windows.Forms.Padding(2);
             this.MaximizeBox = false;
             this.MaximumSize = new System.Drawing.Size(570, 198);
             this.MinimumSize = new System.Drawing.Size(570, 198);
@@ -264,6 +304,8 @@
             this.tabHardwareSet.ResumeLayout(false);
             this.tabHardwareSet.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
+            this.tabSysType.ResumeLayout(false);
+            this.tabSysType.PerformLayout();
             this.ResumeLayout(false);
 
         }
@@ -285,5 +327,8 @@
         private System.Windows.Forms.PictureBox pictureBox2;
         private System.Windows.Forms.Button button2;
         private System.Windows.Forms.Button button1;
+        private System.Windows.Forms.TabPage tabSysType;
+        private System.Windows.Forms.RadioButton radioButton_CleannessA;
+        private System.Windows.Forms.RadioButton radioButton_IncA;
     }
 }

+ 43 - 1
OTSSysMgrApp/OTSSystemManagerForms.cs

@@ -206,6 +206,8 @@ namespace OTSSysMgrApp
                     rdb_en.Checked = true;
                     break;
             }
+
+            ReadSysType();
         }
         /// <summary>
         /// 将所有参数保存
@@ -340,6 +342,41 @@ namespace OTSSysMgrApp
 
         }
 
+        private void ReadSysType()
+        {
+            string path = Application.StartupPath + @"\Config\SysData\OTSProgMgrParam.pmf";
+            string Type = "";
+            bool result = XMLOperationClass.ReadSysType(path, "SysType",ref Type);
+            if (result)
+            {
+                if(Type== "IncA")
+                {
+                    radioButton_IncA.Checked = true;
+                }
+                else if(Type == "CleannessA")
+                {
+                    radioButton_CleannessA.Checked = true;
+                }
+            }
+        }
+
+        private void WriteSysType()
+        {
+            string path = Application.StartupPath + @"\Config\SysData\OTSProgMgrParam.pmf";
+            string Type = "";
+            if (radioButton_IncA.Checked)
+            {
+                Type = "IncA";
+            }
+            else if (radioButton_CleannessA.Checked)
+            {
+                Type = "CleannessA";
+            }
+            bool result = XMLOperationClass.WriteSysType(path, "SysType", Type);
+            string path2 = Application.StartupPath + @"\Config\SysData\OTSReportMgrParam.rpf";
+            bool resultreport = XMLOperationClass.WriteSysType(path2, "systype", Type);
+        }
+
         private void GetSEMAndEDSController()
         {
             string xmlNodeSEM = XMLOperationClass.GetXMLInformations("SEMName");
@@ -380,7 +417,7 @@ namespace OTSSysMgrApp
                 }
             }
             catch (Exception)
-            {
+            {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
                 //MessageBox.Show("读取失败,请以管理员身份运行!");
                 return;
             }
@@ -575,5 +612,10 @@ namespace OTSSysMgrApp
             ds.AcceptChanges();
             ds.WriteXml(System.Windows.Forms.Application.StartupPath + @"/Resources/XMLData/LanguageDefine.xml");
         }
+
+        private void radioButton_IncA_CheckedChanged(object sender, EventArgs e)
+        {
+            WriteSysType();
+        }
     }
 }

+ 39 - 0
OTSSysMgrApp/XMLOperationClass.cs

@@ -316,5 +316,44 @@ namespace OTSSysMgrApp
             
         }
         #endregion
+
+        public static bool WriteSysType(string xmlpath, string AttributeName, string Value)
+        {
+            try
+            {
+                XmlDocument xmlDocument = new XmlDocument();
+                xmlDocument.Load(xmlpath);
+                XmlNode node = xmlDocument.SelectSingleNode("XMLData");
+
+                XmlElement xe = (XmlElement)node;
+                xe.SetAttribute(AttributeName, Value);
+                xmlDocument.Save(xmlpath);
+            }
+            catch (Exception ex)
+            {
+                //MessageBox.Show(ex.ToString());
+                return false;
+            }
+            return true;
+        }
+
+        public static bool ReadSysType(string xmlpath, string AttributeName,ref string Value)
+        {
+            try
+            {
+                XmlDocument xmlDocument = new XmlDocument();
+                xmlDocument.Load(xmlpath);
+                XmlNode node = xmlDocument.SelectSingleNode("XMLData");
+
+                XmlElement xe = (XmlElement)node;
+                Value=xe.GetAttribute(AttributeName);
+            }
+            catch (Exception ex)
+            {
+                //MessageBox.Show(ex.ToString());
+                return false;
+            }
+            return true;
+        }
     }
 }