Browse Source

bug:参数保存问题

HaoShuang 4 years ago
parent
commit
18ae0d58bd

+ 19 - 1
HOZProject/UserControls/UControl_Init.Designer.cs

@@ -77,6 +77,7 @@
             this.label3 = new System.Windows.Forms.Label();
             this.cbbYDZZDX = new System.Windows.Forms.TextBox();
             this.btOK = new System.Windows.Forms.Button();
+            this.pbDelWFIB = new System.Windows.Forms.PictureBox();
             this.panel1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.pbClose)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pbDelWLZ)).BeginInit();
@@ -90,6 +91,7 @@
             ((System.ComponentModel.ISupportInitialize)(this.pbFIBTemplateFile)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pbPTTemplateFile)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.pbCutHoleFile)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.pbDelWFIB)).BeginInit();
             this.SuspendLayout();
             // 
             // label1
@@ -713,13 +715,26 @@
             this.btOK.Visible = false;
             this.btOK.Click += new System.EventHandler(this.button1_Click);
             // 
+            // pbDelWFIB
+            // 
+            this.pbDelWFIB.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
+            this.pbDelWFIB.BackgroundImage = global::HOZProject.Properties.Resources.exit_Gray;
+            this.pbDelWFIB.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
+            this.pbDelWFIB.Cursor = System.Windows.Forms.Cursors.Hand;
+            this.pbDelWFIB.Location = new System.Drawing.Point(268, 391);
+            this.pbDelWFIB.Name = "pbDelWFIB";
+            this.pbDelWFIB.Size = new System.Drawing.Size(25, 21);
+            this.pbDelWFIB.TabIndex = 119;
+            this.pbDelWFIB.TabStop = false;
+            this.pbDelWFIB.Click += new System.EventHandler(this.DelComboBoxItem_Click);
+            // 
             // UControl_Init
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 20F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.Black;
             this.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
-            this.Controls.Add(this.btOK);
+            this.Controls.Add(this.pbDelWFIB);
             this.Controls.Add(this.cbbYDZZDX);
             this.Controls.Add(this.label3);
             this.Controls.Add(this.chkWqxkc);
@@ -765,6 +780,7 @@
             this.Controls.Add(this.tbCutHoleFilePath);
             this.Controls.Add(this.pbCutHoleFile);
             this.Controls.Add(this.panel1);
+            this.Controls.Add(this.btOK);
             this.Font = new System.Drawing.Font("宋体", 10F);
             this.ForeColor = System.Drawing.SystemColors.WindowText;
             this.Name = "UControl_Init";
@@ -784,6 +800,7 @@
             ((System.ComponentModel.ISupportInitialize)(this.pbFIBTemplateFile)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pbPTTemplateFile)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.pbCutHoleFile)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.pbDelWFIB)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -838,5 +855,6 @@
         private System.Windows.Forms.Label label3;
         private System.Windows.Forms.TextBox cbbYDZZDX;
         private System.Windows.Forms.Button btOK;
+        private System.Windows.Forms.PictureBox pbDelWFIB;
     }
 }

+ 21 - 9
HOZProject/UserControls/UControl_Init.cs

@@ -83,6 +83,7 @@ namespace HOZProject
         private void UControl_Init_Load(object sender, EventArgs e)
         {
             //从配置文件中读取一系列的信息
+            //ReloadConfig();
         } 
         #endregion
 
@@ -472,7 +473,8 @@ namespace HOZProject
                 //设置数据源信息
                 //样品类型
                 List<String> _sT = sT.ToList();
-                if (_sT.IndexOf(cbbWYP.Text) < 0)
+                if ((_sT.IndexOf(cbbWYP.Text) < 0)
+                     || (!_sT.Contains(cbbWYP.Text)))
                 {
                     _sT.Add(cbbWYP.Text);
                     string wsT = string.Join(",", _sT.ToArray());
@@ -480,7 +482,8 @@ namespace HOZProject
                 }
                 //厂商
                 List<String> _firms = firms.ToList();
-                if (_firms.IndexOf(cbbWCS.Text) < 0)
+                if( (_firms.IndexOf(cbbWCS.Text) < 0)
+                     || (!_firms.Contains(cbbWCS.Text)))
                 {
                     _firms.Add(cbbWCS.Text);
                     string wFirms = string.Join(",", _firms.ToArray());
@@ -488,7 +491,8 @@ namespace HOZProject
                 }
                 //拍照电压
                 List<String> _WPZD = WPZD.ToList();
-                if (_WPZD.IndexOf(cbbWPZD.Text) < 0)
+                if((_WPZD.IndexOf(cbbWPZD.Text) < 0)
+                     || (!_WPZD.Contains(cbbWPZD.Text)))
                 {
                     _WPZD.Add(cbbWPZD.Text);
                     string wWPZD = string.Join(",", _WPZD.ToArray());
@@ -496,7 +500,8 @@ namespace HOZProject
                 }
                 //拍照放大位数
                 List<String> _WPZF = WPZF.ToList();
-                if (_WPZF.IndexOf(cbbWPZF.Text) < 0)
+                if ((_WPZF.IndexOf(cbbWPZF.Text) < 0)
+                     || (!_WPZF.Contains(cbbWPZF.Text)))
                 {
                     _WPZF.Add(cbbWPZF.Text);
                     string wWPZF = string.Join(",", _WPZF.ToArray());
@@ -504,7 +509,8 @@ namespace HOZProject
                 }
                 //定位切割电压
                 List<String> _WQGD = WQGD.ToList();
-                if (_WQGD.IndexOf(cbbWQGD.Text) < 0)
+                if ((_WQGD.IndexOf(cbbWQGD.Text) < 0)
+                     || (!_WQGD.Contains(cbbWQGD.Text)))
                 {
                     _WQGD.Add(cbbWQGD.Text);
                     string wWQGD = string.Join(",", _WQGD.ToArray());
@@ -512,7 +518,8 @@ namespace HOZProject
                 }
                 //定位切割放大位数
                 List<String> _WQGF = WQGF.ToList();
-                if (_WQGF.IndexOf(cbbWQGF.Text) < 0)
+                if ((_WQGF.IndexOf(cbbWQGF.Text) < 0)
+                    || (!_WQGF.Contains(cbbWQGF.Text)))
                 {
                     _WQGF.Add(cbbWQGF.Text);
                     string wWQGF = string.Join(",", _WQGF.ToArray());
@@ -520,7 +527,8 @@ namespace HOZProject
                 }
                 //拉直操作放大位数
                 List<String> _WLZ = WLZ.ToList();
-                if (_WLZ.IndexOf(cbbWLZ.Text) < 0)
+                if ((_WLZ.IndexOf(cbbWLZ.Text) < 0)
+                     || (!_WLZ.Contains(cbbWLZ.Text)))
                 {
                     _WLZ.Add(cbbWLZ.Text);
                     string wWLZ = string.Join(",", _WLZ.ToArray());
@@ -528,12 +536,13 @@ namespace HOZProject
                 }
                 //FIB放大位数
                 List<String> _WFIB = WFIB.ToList();
-                if (_WFIB.IndexOf(cbbWFIB.Text) < 0)
+                if ((_WFIB.IndexOf(cbbWFIB.Text) < 0) 
+                    ||(!_WFIB.Contains(cbbWFIB.Text)))
                 {
                     _WFIB.Add(cbbWFIB.Text);
                     string wWFIB = string.Join(",", _WFIB.ToArray());
                     config.AppSettings.Settings["WFIB"].Value = wWFIB;
-                }
+                }               
 
                 MeasureParam cfm = new MeasureParam();
                 cfm = FormHOZMainObject.m_MeasureFile.MParam;
@@ -891,6 +900,7 @@ namespace HOZProject
                 cbbWXZ.Visible = false;
                 label2.Visible = false;
                 cbbWFIB.Visible = false;
+                pbDelWFIB.Visible = false;
                 FormHOZMainObject.m_MeasureType = (int)MeasureMsgManage.measureType.Photo;
             }
             else
@@ -906,6 +916,7 @@ namespace HOZProject
                 cbbWXZ.Visible = true;
                 label2.Visible = true;
                 cbbWFIB.Visible = true;
+                pbDelWFIB.Visible = true;
                 if (!chkWPT.Checked)
                 {
                     FormHOZMainObject.m_MeasureType = (int)MeasureMsgManage.measureType.FIB;
@@ -1193,5 +1204,6 @@ namespace HOZProject
             SaveMeasureFile();
         }
         #endregion
+        
     }
 }