Pārlūkot izejas kodu

修改称量BUG

章政 8 gadi atpakaļ
vecāks
revīzija
6a5fd43993

+ 95 - 92
UAS-MES/FunctionCode/Make/Make_CartonBoxWeigh.Designer.cs

@@ -33,8 +33,6 @@
             this.mcd_okqty = new System.Windows.Forms.Label();
             this.mcd_okqty_label = new System.Windows.Forms.Label();
             this.panel6 = new System.Windows.Forms.Panel();
-            this.pr_cartongw = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
-            this.pr_code = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.pr_cartongw_label = new System.Windows.Forms.Label();
             this.pr_code_label = new System.Windows.Forms.Label();
             this.panel4 = new System.Windows.Forms.Panel();
@@ -48,8 +46,9 @@
             this.PrintLabel = new System.Windows.Forms.ComboBox();
             this.Printer_label = new System.Windows.Forms.Label();
             this.label1 = new System.Windows.Forms.Label();
-            this.BaudRate = new UAS_MES.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
-            this.ComList = new UAS_MES.CustomControl.ComBoxWithFocus.SerialPortCombox();
+            this.AutoPrint = new System.Windows.Forms.CheckBox();
+            this.PrintNum = new System.Windows.Forms.NumericUpDown();
+            this.label2 = new System.Windows.Forms.Label();
             this.PrinterList = new UAS_MES.CustomControl.ComBoxWithFocus.PrinterCombox();
             this.StartWeight = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.Confirm = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
@@ -62,10 +61,11 @@
             this.Clean = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.normalButton1 = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.outboxcode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.pr_cartongw = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.pr_code = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
-            this.AutoPrint = new System.Windows.Forms.CheckBox();
-            this.PrintNum = new System.Windows.Forms.NumericUpDown();
-            this.label2 = new System.Windows.Forms.Label();
+            this.BaudRate = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.ComList = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.panel6.SuspendLayout();
             this.panel4.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).BeginInit();
@@ -96,9 +96,9 @@
             this.mcd_okqty_label.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.mcd_okqty_label.Location = new System.Drawing.Point(31, 487);
             this.mcd_okqty_label.Name = "mcd_okqty_label";
-            this.mcd_okqty_label.Size = new System.Drawing.Size(57, 27);
+            this.mcd_okqty_label.Size = new System.Drawing.Size(52, 27);
             this.mcd_okqty_label.TabIndex = 92;
-            this.mcd_okqty_label.Text = "已称:";
+            this.mcd_okqty_label.Text = "已称";
             // 
             // panel6
             // 
@@ -112,31 +112,6 @@
             this.panel6.Size = new System.Drawing.Size(403, 125);
             this.panel6.TabIndex = 90;
             // 
-            // pr_cartongw
-            // 
-            this.pr_cartongw.AutoSize = true;
-            this.pr_cartongw.CutLength = null;
-            this.pr_cartongw.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_cartongw.Location = new System.Drawing.Point(154, 73);
-            this.pr_cartongw.MaximumSize = new System.Drawing.Size(150, 0);
-            this.pr_cartongw.Name = "pr_cartongw";
-            this.pr_cartongw.Size = new System.Drawing.Size(0, 27);
-            this.pr_cartongw.TabIndex = 80;
-            this.pr_cartongw.Tag = "1";
-            // 
-            // pr_code
-            // 
-            this.pr_code.AutoSize = true;
-            this.pr_code.CutLength = null;
-            this.pr_code.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code.Location = new System.Drawing.Point(154, 22);
-            this.pr_code.MaximumSize = new System.Drawing.Size(150, 0);
-            this.pr_code.Name = "pr_code";
-            this.pr_code.Size = new System.Drawing.Size(0, 27);
-            this.pr_code.TabIndex = 79;
-            this.pr_code.Tag = "1";
-            this.pr_code.TextChanged += new System.EventHandler(this.pr_code_TextChanged);
-            // 
             // pr_cartongw_label
             // 
             this.pr_cartongw_label.AutoSize = true;
@@ -274,28 +249,40 @@
             this.label1.TabIndex = 161;
             this.label1.Text = "打印标签";
             // 
-            // BaudRate
+            // AutoPrint
             // 
-            this.BaudRate.AllPower = null;
-            this.BaudRate.BackColor = System.Drawing.Color.White;
-            this.BaudRate.ID = null;
-            this.BaudRate.Location = new System.Drawing.Point(937, 29);
-            this.BaudRate.Name = "BaudRate";
-            this.BaudRate.Negative = false;
-            this.BaudRate.Power = null;
-            this.BaudRate.Size = new System.Drawing.Size(120, 21);
-            this.BaudRate.Str = null;
-            this.BaudRate.Str1 = null;
-            this.BaudRate.Str2 = null;
-            this.BaudRate.TabIndex = 168;
+            this.AutoPrint.AutoSize = true;
+            this.AutoPrint.Checked = true;
+            this.AutoPrint.CheckState = System.Windows.Forms.CheckState.Checked;
+            this.AutoPrint.Font = new System.Drawing.Font("微软雅黑", 10.8F);
+            this.AutoPrint.Location = new System.Drawing.Point(843, 42);
+            this.AutoPrint.Name = "AutoPrint";
+            this.AutoPrint.Size = new System.Drawing.Size(88, 24);
+            this.AutoPrint.TabIndex = 169;
+            this.AutoPrint.Text = "自动打印";
+            this.AutoPrint.UseVisualStyleBackColor = true;
             // 
-            // ComList
+            // PrintNum
             // 
-            this.ComList.Location = new System.Drawing.Point(935, 4);
-            this.ComList.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
-            this.ComList.Name = "ComList";
-            this.ComList.Size = new System.Drawing.Size(121, 20);
-            this.ComList.TabIndex = 162;
+            this.PrintNum.Location = new System.Drawing.Point(937, 76);
+            this.PrintNum.Name = "PrintNum";
+            this.PrintNum.Size = new System.Drawing.Size(120, 21);
+            this.PrintNum.TabIndex = 170;
+            this.PrintNum.Value = new decimal(new int[] {
+            1,
+            0,
+            0,
+            0});
+            // 
+            // label2
+            // 
+            this.label2.AutoSize = true;
+            this.label2.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label2.Location = new System.Drawing.Point(839, 77);
+            this.label2.Name = "label2";
+            this.label2.Size = new System.Drawing.Size(69, 20);
+            this.label2.TabIndex = 171;
+            this.label2.Text = "打印张数";
             // 
             // PrinterList
             // 
@@ -312,7 +299,7 @@
             this.StartWeight.DownImage = ((System.Drawing.Image)(resources.GetObject("StartWeight.DownImage")));
             this.StartWeight.Image = ((System.Drawing.Image)(resources.GetObject("StartWeight.Image")));
             this.StartWeight.IsShowBorder = true;
-            this.StartWeight.Location = new System.Drawing.Point(658, 26);
+            this.StartWeight.Location = new System.Drawing.Point(658, 25);
             this.StartWeight.MoveImage = ((System.Drawing.Image)(resources.GetObject("StartWeight.MoveImage")));
             this.StartWeight.Name = "StartWeight";
             this.StartWeight.NormalImage = ((System.Drawing.Image)(resources.GetObject("StartWeight.NormalImage")));
@@ -360,7 +347,7 @@
             this.StopWeight.DownImage = ((System.Drawing.Image)(resources.GetObject("StopWeight.DownImage")));
             this.StopWeight.Image = ((System.Drawing.Image)(resources.GetObject("StopWeight.Image")));
             this.StopWeight.IsShowBorder = true;
-            this.StopWeight.Location = new System.Drawing.Point(753, 26);
+            this.StopWeight.Location = new System.Drawing.Point(753, 25);
             this.StopWeight.MoveImage = ((System.Drawing.Image)(resources.GetObject("StopWeight.MoveImage")));
             this.StopWeight.Name = "StopWeight";
             this.StopWeight.NormalImage = ((System.Drawing.Image)(resources.GetObject("StopWeight.NormalImage")));
@@ -376,7 +363,7 @@
             this.ma_code.AutoSize = true;
             this.ma_code.CutLength = null;
             this.ma_code.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_code.Location = new System.Drawing.Point(141, 249);
+            this.ma_code.Location = new System.Drawing.Point(141, 242);
             this.ma_code.MaximumSize = new System.Drawing.Size(150, 0);
             this.ma_code.Name = "ma_code";
             this.ma_code.Size = new System.Drawing.Size(0, 27);
@@ -388,7 +375,7 @@
             this.ma_qty.AutoSize = true;
             this.ma_qty.CutLength = null;
             this.ma_qty.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_qty.Location = new System.Drawing.Point(141, 437);
+            this.ma_qty.Location = new System.Drawing.Point(141, 430);
             this.ma_qty.MaximumSize = new System.Drawing.Size(150, 0);
             this.ma_qty.Name = "ma_qty";
             this.ma_qty.Size = new System.Drawing.Size(0, 27);
@@ -399,7 +386,7 @@
             this.pr_detail.AutoSize = true;
             this.pr_detail.CutLength = null;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail.Location = new System.Drawing.Point(141, 373);
+            this.pr_detail.Location = new System.Drawing.Point(141, 367);
             this.pr_detail.MaximumSize = new System.Drawing.Size(150, 0);
             this.pr_detail.Name = "pr_detail";
             this.pr_detail.Size = new System.Drawing.Size(0, 27);
@@ -410,7 +397,7 @@
             this.ma_salecode.AutoSize = true;
             this.ma_salecode.CutLength = null;
             this.ma_salecode.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_salecode.Location = new System.Drawing.Point(141, 308);
+            this.ma_salecode.Location = new System.Drawing.Point(141, 301);
             this.ma_salecode.MaximumSize = new System.Drawing.Size(150, 0);
             this.ma_salecode.Name = "ma_salecode";
             this.ma_salecode.Size = new System.Drawing.Size(0, 27);
@@ -466,6 +453,31 @@
             this.outboxcode.TabIndex = 86;
             this.outboxcode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.sncode_KeyDown);
             // 
+            // pr_cartongw
+            // 
+            this.pr_cartongw.AutoSize = true;
+            this.pr_cartongw.CutLength = null;
+            this.pr_cartongw.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_cartongw.Location = new System.Drawing.Point(154, 73);
+            this.pr_cartongw.MaximumSize = new System.Drawing.Size(150, 0);
+            this.pr_cartongw.Name = "pr_cartongw";
+            this.pr_cartongw.Size = new System.Drawing.Size(0, 27);
+            this.pr_cartongw.TabIndex = 80;
+            this.pr_cartongw.Tag = "1";
+            // 
+            // pr_code
+            // 
+            this.pr_code.AutoSize = true;
+            this.pr_code.CutLength = null;
+            this.pr_code.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_code.Location = new System.Drawing.Point(154, 22);
+            this.pr_code.MaximumSize = new System.Drawing.Size(150, 0);
+            this.pr_code.Name = "pr_code";
+            this.pr_code.Size = new System.Drawing.Size(0, 27);
+            this.pr_code.TabIndex = 79;
+            this.pr_code.Tag = "1";
+            this.pr_code.TextChanged += new System.EventHandler(this.pr_code_TextChanged);
+            // 
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@@ -475,49 +487,40 @@
             this.OperateResult.TabIndex = 87;
             this.OperateResult.Text = "";
             // 
-            // AutoPrint
-            // 
-            this.AutoPrint.AutoSize = true;
-            this.AutoPrint.Font = new System.Drawing.Font("微软雅黑", 10.8F);
-            this.AutoPrint.Location = new System.Drawing.Point(839, 46);
-            this.AutoPrint.Name = "AutoPrint";
-            this.AutoPrint.Size = new System.Drawing.Size(88, 24);
-            this.AutoPrint.TabIndex = 169;
-            this.AutoPrint.Text = "自动打印";
-            this.AutoPrint.UseVisualStyleBackColor = true;
-            // 
-            // PrintNum
+            // BaudRate
             // 
-            this.PrintNum.Location = new System.Drawing.Point(937, 76);
-            this.PrintNum.Name = "PrintNum";
-            this.PrintNum.Size = new System.Drawing.Size(120, 21);
-            this.PrintNum.TabIndex = 170;
-            this.PrintNum.Value = new decimal(new int[] {
-            1,
-            0,
-            0,
-            0});
+            this.BaudRate.AutoSize = true;
+            this.BaudRate.CutLength = null;
+            this.BaudRate.Location = new System.Drawing.Point(937, 39);
+            this.BaudRate.MaximumSize = new System.Drawing.Size(150, 0);
+            this.BaudRate.Name = "BaudRate";
+            this.BaudRate.Size = new System.Drawing.Size(53, 12);
+            this.BaudRate.TabIndex = 172;
+            this.BaudRate.Text = "BaudRate";
+            this.BaudRate.Visible = false;
             // 
-            // label2
+            // ComList
             // 
-            this.label2.AutoSize = true;
-            this.label2.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(839, 77);
-            this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(84, 20);
-            this.label2.TabIndex = 171;
-            this.label2.Text = "打印机列表";
+            this.ComList.AutoSize = true;
+            this.ComList.CutLength = null;
+            this.ComList.Location = new System.Drawing.Point(937, 55);
+            this.ComList.MaximumSize = new System.Drawing.Size(150, 0);
+            this.ComList.Name = "ComList";
+            this.ComList.Size = new System.Drawing.Size(47, 12);
+            this.ComList.TabIndex = 173;
+            this.ComList.Text = "ComList";
+            this.ComList.Visible = false;
             // 
             // Make_CartonBoxWeigh
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1072, 608);
+            this.Controls.Add(this.ComList);
+            this.Controls.Add(this.BaudRate);
             this.Controls.Add(this.label2);
             this.Controls.Add(this.PrintNum);
             this.Controls.Add(this.AutoPrint);
-            this.Controls.Add(this.BaudRate);
-            this.Controls.Add(this.ComList);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.Printer_label);
             this.Controls.Add(this.PrinterList);
@@ -594,10 +597,10 @@
         private CustomControl.ComBoxWithFocus.PrinterCombox PrinterList;
         private System.Windows.Forms.Label Printer_label;
         private System.Windows.Forms.Label label1;
-        private CustomControl.ComBoxWithFocus.SerialPortCombox ComList;
-        private CustomControl.TextBoxWithIcon.NumOnlyTextBox BaudRate;
         private System.Windows.Forms.CheckBox AutoPrint;
         private System.Windows.Forms.NumericUpDown PrintNum;
         private System.Windows.Forms.Label label2;
+        private CustomControl.ValueLabel.ValueLabel BaudRate;
+        private CustomControl.ValueLabel.ValueLabel ComList;
     }
 }

+ 16 - 2
UAS-MES/FunctionCode/Make/Make_CartonBoxWeigh.cs

@@ -11,6 +11,7 @@ using System.Threading;
 using System.Windows.Forms;
 using UAS_MES.DataOperate;
 using UAS_MES.Entity;
+using UAS_MES.PublicForm;
 using UAS_MES.PublicMethod;
 
 namespace UAS_MES.Make
@@ -43,6 +44,9 @@ namespace UAS_MES.Make
         int MinWeight;
 
         DataTable ListC = new DataTable();
+
+        Thread InitPrint;
+
         private System.DateTime[] indate;
 
         public Make_CartonBoxWeigh()
@@ -54,10 +58,19 @@ namespace UAS_MES.Make
         {
             CheckForIllegalCrossThreadCalls = false;
             asc.controllInitializeSize(this);
-            dh = new DataHelper();
-            lbl = new ApplicationClass();
             ComList.Text = Properties.Settings.Default.PortName;
             BaudRate.Text = Properties.Settings.Default.BaudRate;
+            InitPrint = new Thread(InPrint);
+            SetLoadingWindow stw = new SetLoadingWindow(InitPrint, "初始化打印程序");
+            BaseUtil.SetFormCenter(stw);
+            stw.ShowDialog();
+            StartWeight.PerformClick();
+            dh = new DataHelper();
+        }
+
+        private void InPrint()
+        {
+            lbl = new ApplicationClass();
         }
 
         private void 卡通箱称重_SizeChanged(object sender, EventArgs e)
@@ -157,6 +170,7 @@ namespace UAS_MES.Make
         private void 卡通箱称重_FormClosing(object sender, FormClosingEventArgs e)
         {
             lbl.Quit();
+            StopWeight.PerformClick();
             if (serialPort1.IsOpen)
             {
                 GetData = false;

+ 85 - 87
UAS-MES/FunctionCode/Make/Make_ColorBoxWeigh.Designer.cs

@@ -35,8 +35,6 @@
             this.pr_code_label = new System.Windows.Forms.Label();
             this.pr_colorboxunit = new System.Windows.Forms.Label();
             this.panel6 = new System.Windows.Forms.Panel();
-            this.pr_colorboxgw = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
-            this.pr_code = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.label22 = new System.Windows.Forms.Label();
             this.weight = new System.Windows.Forms.Label();
             this.panel4 = new System.Windows.Forms.Panel();
@@ -54,8 +52,9 @@
             this.PrintLabel = new System.Windows.Forms.ComboBox();
             this.Printer_label = new System.Windows.Forms.Label();
             this.PrintLabel_label = new System.Windows.Forms.Label();
-            this.ComList = new UAS_MES.CustomControl.ComBoxWithFocus.SerialPortCombox();
-            this.BaudRate = new UAS_MES.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
+            this.AutoPrint = new System.Windows.Forms.CheckBox();
+            this.PrintNum = new System.Windows.Forms.NumericUpDown();
+            this.label1 = new System.Windows.Forms.Label();
             this.PrinterList = new UAS_MES.CustomControl.ComBoxWithFocus.PrinterCombox();
             this.StopWeight = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.StartWeight = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
@@ -69,10 +68,11 @@
             this.Clean = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.normalButton1 = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.sncode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.pr_colorboxgw = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.pr_code = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
-            this.AutoPrint = new System.Windows.Forms.CheckBox();
-            this.PrintNum = new System.Windows.Forms.NumericUpDown();
-            this.label1 = new System.Windows.Forms.Label();
+            this.BaudRate = new System.Windows.Forms.Label();
+            this.ComList = new System.Windows.Forms.Label();
             this.panel6.SuspendLayout();
             this.panel4.SuspendLayout();
             this.panel3.SuspendLayout();
@@ -146,31 +146,6 @@
             this.panel6.Size = new System.Drawing.Size(381, 124);
             this.panel6.TabIndex = 62;
             // 
-            // pr_colorboxgw
-            // 
-            this.pr_colorboxgw.AutoSize = true;
-            this.pr_colorboxgw.CutLength = null;
-            this.pr_colorboxgw.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_colorboxgw.Location = new System.Drawing.Point(141, 77);
-            this.pr_colorboxgw.MaximumSize = new System.Drawing.Size(150, 0);
-            this.pr_colorboxgw.Name = "pr_colorboxgw";
-            this.pr_colorboxgw.Size = new System.Drawing.Size(0, 27);
-            this.pr_colorboxgw.TabIndex = 80;
-            this.pr_colorboxgw.Tag = "1";
-            // 
-            // pr_code
-            // 
-            this.pr_code.AutoSize = true;
-            this.pr_code.CutLength = null;
-            this.pr_code.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code.Location = new System.Drawing.Point(141, 26);
-            this.pr_code.MaximumSize = new System.Drawing.Size(150, 0);
-            this.pr_code.Name = "pr_code";
-            this.pr_code.Size = new System.Drawing.Size(0, 27);
-            this.pr_code.TabIndex = 79;
-            this.pr_code.Tag = "1";
-            this.pr_code.TextChanged += new System.EventHandler(this.pr_code_TextChanged);
-            // 
             // label22
             // 
             this.label22.AutoSize = true;
@@ -346,29 +321,40 @@
             this.PrintLabel_label.TabIndex = 163;
             this.PrintLabel_label.Text = "打印标签";
             // 
-            // ComList
+            // AutoPrint
             // 
-            this.ComList.Location = new System.Drawing.Point(908, 2);
-            this.ComList.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
-            this.ComList.Name = "ComList";
-            this.ComList.Size = new System.Drawing.Size(119, 20);
-            this.ComList.TabIndex = 167;
+            this.AutoPrint.AutoSize = true;
+            this.AutoPrint.Checked = true;
+            this.AutoPrint.CheckState = System.Windows.Forms.CheckState.Checked;
+            this.AutoPrint.Font = new System.Drawing.Font("微软雅黑", 10.8F);
+            this.AutoPrint.Location = new System.Drawing.Point(804, 23);
+            this.AutoPrint.Name = "AutoPrint";
+            this.AutoPrint.Size = new System.Drawing.Size(88, 24);
+            this.AutoPrint.TabIndex = 168;
+            this.AutoPrint.Text = "自动打印";
+            this.AutoPrint.UseVisualStyleBackColor = true;
             // 
-            // BaudRate
+            // PrintNum
             // 
-            this.BaudRate.AllPower = null;
-            this.BaudRate.BackColor = System.Drawing.Color.White;
-            this.BaudRate.ID = null;
-            this.BaudRate.Location = new System.Drawing.Point(908, 26);
-            this.BaudRate.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.BaudRate.Name = "BaudRate";
-            this.BaudRate.Negative = false;
-            this.BaudRate.Power = null;
-            this.BaudRate.Size = new System.Drawing.Size(120, 21);
-            this.BaudRate.Str = null;
-            this.BaudRate.Str1 = null;
-            this.BaudRate.Str2 = null;
-            this.BaudRate.TabIndex = 166;
+            this.PrintNum.Location = new System.Drawing.Point(908, 56);
+            this.PrintNum.Name = "PrintNum";
+            this.PrintNum.Size = new System.Drawing.Size(120, 21);
+            this.PrintNum.TabIndex = 169;
+            this.PrintNum.Value = new decimal(new int[] {
+            1,
+            0,
+            0,
+            0});
+            // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label1.Location = new System.Drawing.Point(800, 57);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(69, 20);
+            this.label1.TabIndex = 170;
+            this.label1.Text = "打印张数";
             // 
             // PrinterList
             // 
@@ -557,6 +543,31 @@
             this.sncode.TabIndex = 57;
             this.sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.sncode_KeyDown);
             // 
+            // pr_colorboxgw
+            // 
+            this.pr_colorboxgw.AutoSize = true;
+            this.pr_colorboxgw.CutLength = null;
+            this.pr_colorboxgw.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_colorboxgw.Location = new System.Drawing.Point(141, 77);
+            this.pr_colorboxgw.MaximumSize = new System.Drawing.Size(150, 0);
+            this.pr_colorboxgw.Name = "pr_colorboxgw";
+            this.pr_colorboxgw.Size = new System.Drawing.Size(0, 27);
+            this.pr_colorboxgw.TabIndex = 80;
+            this.pr_colorboxgw.Tag = "1";
+            // 
+            // pr_code
+            // 
+            this.pr_code.AutoSize = true;
+            this.pr_code.CutLength = null;
+            this.pr_code.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.pr_code.Location = new System.Drawing.Point(141, 26);
+            this.pr_code.MaximumSize = new System.Drawing.Size(150, 0);
+            this.pr_code.Name = "pr_code";
+            this.pr_code.Size = new System.Drawing.Size(0, 27);
+            this.pr_code.TabIndex = 79;
+            this.pr_code.Tag = "1";
+            this.pr_code.TextChanged += new System.EventHandler(this.pr_code_TextChanged);
+            // 
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@@ -567,51 +578,38 @@
             this.OperateResult.TabIndex = 58;
             this.OperateResult.Text = "";
             // 
-            // AutoPrint
-            // 
-            this.AutoPrint.AutoSize = true;
-            this.AutoPrint.Checked = true;
-            this.AutoPrint.CheckState = System.Windows.Forms.CheckState.Checked;
-            this.AutoPrint.Font = new System.Drawing.Font("微软雅黑", 10.8F);
-            this.AutoPrint.Location = new System.Drawing.Point(804, 23);
-            this.AutoPrint.Name = "AutoPrint";
-            this.AutoPrint.Size = new System.Drawing.Size(88, 24);
-            this.AutoPrint.TabIndex = 168;
-            this.AutoPrint.Text = "自动打印";
-            this.AutoPrint.UseVisualStyleBackColor = true;
-            // 
-            // PrintNum
+            // BaudRate
             // 
-            this.PrintNum.Location = new System.Drawing.Point(908, 56);
-            this.PrintNum.Name = "PrintNum";
-            this.PrintNum.Size = new System.Drawing.Size(120, 21);
-            this.PrintNum.TabIndex = 169;
-            this.PrintNum.Value = new decimal(new int[] {
-            1,
-            0,
-            0,
-            0});
+            this.BaudRate.AutoSize = true;
+            this.BaudRate.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.BaudRate.Location = new System.Drawing.Point(913, 32);
+            this.BaudRate.Name = "BaudRate";
+            this.BaudRate.Size = new System.Drawing.Size(78, 20);
+            this.BaudRate.TabIndex = 171;
+            this.BaudRate.Text = "BaudRate";
+            this.BaudRate.Visible = false;
             // 
-            // label1
+            // ComList
             // 
-            this.label1.AutoSize = true;
-            this.label1.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(800, 57);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(69, 20);
-            this.label1.TabIndex = 170;
-            this.label1.Text = "打印张数";
+            this.ComList.AutoSize = true;
+            this.ComList.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ComList.Location = new System.Drawing.Point(913, 7);
+            this.ComList.Name = "ComList";
+            this.ComList.Size = new System.Drawing.Size(68, 20);
+            this.ComList.TabIndex = 172;
+            this.ComList.Text = "ComList";
+            this.ComList.Visible = false;
             // 
             // Make_ColorBoxWeigh
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1042, 584);
+            this.Controls.Add(this.ComList);
+            this.Controls.Add(this.BaudRate);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.PrintNum);
             this.Controls.Add(this.AutoPrint);
-            this.Controls.Add(this.ComList);
-            this.Controls.Add(this.BaudRate);
             this.Controls.Add(this.PrintLabel_label);
             this.Controls.Add(this.Printer_label);
             this.Controls.Add(this.PrinterList);
@@ -705,10 +703,10 @@
         private CustomControl.ComBoxWithFocus.PrinterCombox PrinterList;
         private System.Windows.Forms.Label Printer_label;
         private System.Windows.Forms.Label PrintLabel_label;
-        private CustomControl.TextBoxWithIcon.NumOnlyTextBox BaudRate;
-        private CustomControl.ComBoxWithFocus.SerialPortCombox ComList;
         private System.Windows.Forms.CheckBox AutoPrint;
         private System.Windows.Forms.NumericUpDown PrintNum;
         private System.Windows.Forms.Label label1;
+        private System.Windows.Forms.Label BaudRate;
+        private System.Windows.Forms.Label ComList;
     }
 }

+ 3 - 0
UAS-MES/FunctionCode/SystemSetting/SystemSetting_ScaleTest.cs

@@ -33,6 +33,8 @@ namespace UAS_MES.SystemSetting
         private void 电子秤调试_Load(object sender, EventArgs e)
         {
             CheckForIllegalCrossThreadCalls = false;
+            ComList.Text = Properties.Settings.Default.PortName;
+            BaudRate.Text = Properties.Settings.Default.BaudRate;
         }
 
         private void StartTest_Click(object sender, EventArgs e)
@@ -82,6 +84,7 @@ namespace UAS_MES.SystemSetting
 
         private void 电子秤调试_FormClosing(object sender, FormClosingEventArgs e)
         {
+            StopTest.PerformClick();
             try { ReadData = false; }
             catch (Exception) { }
         }