Browse Source

测量程序中程序管理修改为checkbox

CXS 3 years ago
parent
commit
225bca179f

+ 15 - 33
OTSIncAMeasureApp/7-OTSProgMgrInfo/ProgMgrInfoForm.cs

@@ -263,19 +263,19 @@ namespace OTSMeasureApp
             if (IDC_COMBO_XRAYSCANMODE.Items.Count > 0)
                 IDC_COMBO_XRAYSCANMODE.SelectedIndex = 0;
             this.IDC_COMBO_XRAYSCANMODE.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_XRAYSCANMODE_SelectedIndexChanged);
-            //是否使用X-ray
-            IDC_COMBO_USINGXRAYS.Items.Clear();
-            foreach (otsdataconst.OTS_USING_X_RAY enum_one in Enum.GetValues(typeof(otsdataconst.OTS_USING_X_RAY)))
-            {
-                ComboBoxItem cbi = new ComboBoxItem();
-                cbi.Text = GetUSINGXRAYSIdString(enum_one);
-                cbi.Value = (int)enum_one;
-                IDC_COMBO_USINGXRAYS.Items.Add(cbi);
-            }
-            this.IDC_COMBO_USINGXRAYS.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_USINGXRAYS_SelectedIndexChanged);
-            if (IDC_COMBO_USINGXRAYS.Items.Count > 0)
-                IDC_COMBO_USINGXRAYS.SelectedIndex = 0;
-            this.IDC_COMBO_USINGXRAYS.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_USINGXRAYS_SelectedIndexChanged);
+            ////是否使用X-ray
+            //IDC_COMBO_USINGXRAYS.Items.Clear();
+            //foreach (otsdataconst.OTS_USING_X_RAY enum_one in Enum.GetValues(typeof(otsdataconst.OTS_USING_X_RAY)))
+            //{
+            //    ComboBoxItem cbi = new ComboBoxItem();
+            //    cbi.Text = GetUSINGXRAYSIdString(enum_one);
+            //    cbi.Value = (int)enum_one;
+            //    IDC_COMBO_USINGXRAYS.Items.Add(cbi);
+            //}
+            //this.IDC_COMBO_USINGXRAYS.SelectedIndexChanged -= new System.EventHandler(this.IDC_COMBO_USINGXRAYS_SelectedIndexChanged);
+            //if (IDC_COMBO_USINGXRAYS.Items.Count > 0)
+            //    IDC_COMBO_USINGXRAYS.SelectedIndex = 0;
+            //this.IDC_COMBO_USINGXRAYS.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_USINGXRAYS_SelectedIndexChanged);
             //分析X-Ray精度
             IDC_COMBO_ANALYXRAYSPEED.Items.Clear();
             foreach (otsdataconst.OTS_IMAGE_SCANSPEED_OPTIONS enum_one in Enum.GetValues(typeof(otsdataconst.OTS_IMAGE_SCANSPEED_OPTIONS)))
@@ -659,15 +659,7 @@ namespace OTSMeasureApp
             }
 
             //是否使用电镜
-            foreach (ComboBoxItem cbi in IDC_COMBO_USINGXRAYS.Items)
-            {
-                if (cbi.Value.ToString() != "")
-                    if (Convert.ToInt32(cbi.Value) == (int)m_cotsxrayprm.GetUsingXray())
-                    {
-                        IDC_COMBO_USINGXRAYS.SelectedItem = cbi;
-                    }
-            }
-
+            IDC_USINGXRAY_LIB.Checked = m_cotsxrayprm.GetUsingXray();
 
             //分析X-ray精度
             foreach (ComboBoxItem cbi in IDC_COMBO_ANALYXRAYSPEED.Items)
@@ -844,9 +836,7 @@ namespace OTSMeasureApp
             m_cotsxrayprm.SetScanMode((otsdataconst.OTS_X_RAY_SCAN_MODE)Convert.ToInt32(enum_xrayscanmode.Value));
 
             //是否使用X-ray
-            ComboBoxItem enum_usingxray = (ComboBoxItem)IDC_COMBO_USINGXRAYS.SelectedItem;
-            bool usingxray = (int)(enum_usingxray.Value) == 0 ? true:false;//the combobox downitem is "True==0,false==1",so make a convertion here.
-            m_cotsxrayprm.SetUsingXray(usingxray);
+            m_cotsxrayprm.SetUsingXray(IDC_USINGXRAY_LIB.Checked);
 
             //分析X-ray精度
             ComboBoxItem enum_analyxrayspeed = (ComboBoxItem)IDC_COMBO_ANALYXRAYSPEED.SelectedItem;
@@ -1269,14 +1259,6 @@ namespace OTSMeasureApp
                 IDC_COMBO_XRAYSCANMODE.SelectAll();
                 return false;
             }
-            if ("" == IDC_COMBO_USINGXRAYS.Text)
-            {
-                string message = table["message61"].ToString();
-                MessageBox.Show(message, "Tip", MessageBoxButtons.OK, MessageBoxIcon.Information);
-                IDC_COMBO_USINGXRAYS.Focus();
-                IDC_COMBO_USINGXRAYS.SelectAll();
-                return false;
-            }
             if ("" == IDC_COMBO_ANALYXRAYSPEED.Text)
             {
                 string message = table["message21"].ToString();

+ 12 - 14
OTSIncAMeasureApp/7-OTSProgMgrInfo/ProgMgrInfoForm.designer.cs

@@ -120,7 +120,6 @@
             this.IDC_BACK_MAX_SWITCH = new System.Windows.Forms.CheckBox();
             this.IDC_PART_MAX_SWITCH = new System.Windows.Forms.CheckBox();
             this.groupBox6 = new System.Windows.Forms.GroupBox();
-            this.IDC_COMBO_USINGXRAYS = new System.Windows.Forms.ComboBox();
             this.label44 = new System.Windows.Forms.Label();
             this.IDC_TEXTBOX_SEARCHXRAYSPEED_TIME = new System.Windows.Forms.TextBox();
             this.label38 = new System.Windows.Forms.Label();
@@ -145,6 +144,7 @@
             this.lbModelSel = new System.Windows.Forms.Label();
             this.IDC_COMBO_Model = new System.Windows.Forms.ComboBox();
             this.groupBox7 = new System.Windows.Forms.GroupBox();
+            this.IDC_USINGXRAY_LIB = new System.Windows.Forms.CheckBox();
             this.groupBox1.SuspendLayout();
             this.groupBox2.SuspendLayout();
             this.groupBox3.SuspendLayout();
@@ -1079,7 +1079,7 @@
             // 
             // groupBox6
             // 
-            this.groupBox6.Controls.Add(this.IDC_COMBO_USINGXRAYS);
+            this.groupBox6.Controls.Add(this.IDC_USINGXRAY_LIB);
             this.groupBox6.Controls.Add(this.label44);
             this.groupBox6.Controls.Add(this.IDC_TEXTBOX_SEARCHXRAYSPEED_TIME);
             this.groupBox6.Controls.Add(this.label38);
@@ -1103,17 +1103,6 @@
             this.groupBox6.TabStop = false;
             this.groupBox6.Text = "X-ray参数";
             // 
-            // IDC_COMBO_USINGXRAYS
-            // 
-            this.IDC_COMBO_USINGXRAYS.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
-            this.IDC_COMBO_USINGXRAYS.FormattingEnabled = true;
-            this.IDC_COMBO_USINGXRAYS.Location = new System.Drawing.Point(208, 132);
-            this.IDC_COMBO_USINGXRAYS.Margin = new System.Windows.Forms.Padding(4);
-            this.IDC_COMBO_USINGXRAYS.Name = "IDC_COMBO_USINGXRAYS";
-            this.IDC_COMBO_USINGXRAYS.Size = new System.Drawing.Size(223, 26);
-            this.IDC_COMBO_USINGXRAYS.TabIndex = 826;
-            this.IDC_COMBO_USINGXRAYS.SelectedIndexChanged += new System.EventHandler(this.IDC_COMBO_USINGXRAYS_SelectedIndexChanged);
-            // 
             // label44
             // 
             this.label44.AutoSize = true;
@@ -1345,6 +1334,15 @@
             this.groupBox7.TabStop = false;
             this.groupBox7.Text = "模式选择";
             // 
+            // IDC_USINGXRAY_LIB
+            // 
+            this.IDC_USINGXRAY_LIB.AutoSize = true;
+            this.IDC_USINGXRAY_LIB.Location = new System.Drawing.Point(408, 135);
+            this.IDC_USINGXRAY_LIB.Name = "IDC_USINGXRAY_LIB";
+            this.IDC_USINGXRAY_LIB.Size = new System.Drawing.Size(22, 21);
+            this.IDC_USINGXRAY_LIB.TabIndex = 826;
+            this.IDC_USINGXRAY_LIB.UseVisualStyleBackColor = true;
+            // 
             // ProgMgrInfoForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
@@ -1512,7 +1510,6 @@
         public System.Windows.Forms.CheckBox IDC_SYS_LIB;
         private System.Windows.Forms.Label label17;
         public System.Windows.Forms.ComboBox IDC_COMBO_STDSelect;
-        public System.Windows.Forms.ComboBox IDC_COMBO_USINGXRAYS;
         private System.Windows.Forms.Label label44;
         public System.Windows.Forms.ComboBox IDC_COMBO_AUTOBGREMOVETYP;
         private System.Windows.Forms.Label label_Auto;
@@ -1521,5 +1518,6 @@
         private System.Windows.Forms.Label lbModelSel;
         public System.Windows.Forms.ComboBox IDC_COMBO_Model;
         private System.Windows.Forms.GroupBox groupBox7;
+        public System.Windows.Forms.CheckBox IDC_USINGXRAY_LIB;
     }
 }