浏览代码

Properties新增两个变量保存电子秤调试获得的参数,赋值到称重模块中

Hcsy 8 年之前
父节点
当前提交
3f7a46cfe8

+ 6 - 0
UAS-MES/App.config

@@ -36,6 +36,12 @@
       <setting name="DefaultCollectionValue" serializeAs="String">
         <value>DefaultValue</value>
       </setting>
+      <setting name="PortName" serializeAs="String">
+        <value />
+      </setting>
+      <setting name="BaudRate" serializeAs="String">
+        <value />
+      </setting>
     </UAS_MES.Properties.Settings>
   </userSettings>
   <applicationSettings>

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

@@ -55,6 +55,8 @@ namespace UAS_MES.Make
             asc.controllInitializeSize(this);
             dh = new DataHelper();
             lbl = new ApplicationClass();
+            ComList.Text = Properties.Settings.Default.PortName;
+            BaudRate.Text = Properties.Settings.Default.BaudRate;
         }
 
         private void 卡通箱称重_SizeChanged(object sender, EventArgs e)

+ 15 - 15
UAS-MES/FunctionCode/Make/Make_CollectBTMAC.Designer.cs

@@ -50,7 +50,7 @@
             // 
             this.ms_makecode.AutoSize = true;
             this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode.Location = new System.Drawing.Point(126, 17);
+            this.ms_makecode.Location = new System.Drawing.Point(107, 25);
             this.ms_makecode.Name = "ms_makecode";
             this.ms_makecode.Size = new System.Drawing.Size(0, 27);
             this.ms_makecode.TabIndex = 212;
@@ -59,7 +59,7 @@
             // 
             this.deleteButton1.AllPower = null;
             this.deleteButton1.Image = ((System.Drawing.Image)(resources.GetObject("deleteButton1.Image")));
-            this.deleteButton1.Location = new System.Drawing.Point(498, 547);
+            this.deleteButton1.Location = new System.Drawing.Point(479, 555);
             this.deleteButton1.Name = "deleteButton1";
             this.deleteButton1.Power = null;
             this.deleteButton1.Size = new System.Drawing.Size(75, 23);
@@ -72,7 +72,7 @@
             // 
             this.mcd_remainqty.AutoSize = true;
             this.mcd_remainqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty.Location = new System.Drawing.Point(412, 78);
+            this.mcd_remainqty.Location = new System.Drawing.Point(393, 86);
             this.mcd_remainqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_remainqty.Name = "mcd_remainqty";
             this.mcd_remainqty.Size = new System.Drawing.Size(24, 27);
@@ -83,7 +83,7 @@
             // 
             this.mcd_okqty.AutoSize = true;
             this.mcd_okqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty.Location = new System.Drawing.Point(124, 78);
+            this.mcd_okqty.Location = new System.Drawing.Point(105, 86);
             this.mcd_okqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_okqty.Name = "mcd_okqty";
             this.mcd_okqty.Size = new System.Drawing.Size(24, 27);
@@ -94,7 +94,7 @@
             // 
             this.ma_prodcode.AutoSize = true;
             this.ma_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_prodcode.Location = new System.Drawing.Point(417, 21);
+            this.ma_prodcode.Location = new System.Drawing.Point(398, 29);
             this.ma_prodcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ma_prodcode.Name = "ma_prodcode";
             this.ma_prodcode.Size = new System.Drawing.Size(0, 27);
@@ -104,7 +104,7 @@
             // 
             this.pr_detail.AutoSize = true;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail.Location = new System.Drawing.Point(710, 17);
+            this.pr_detail.Location = new System.Drawing.Point(691, 25);
             this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail.Name = "pr_detail";
             this.pr_detail.Size = new System.Drawing.Size(0, 27);
@@ -114,7 +114,7 @@
             // 
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(597, 17);
+            this.pr_detail_label.Location = new System.Drawing.Point(578, 25);
             this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail_label.Name = "pr_detail_label";
             this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
@@ -127,7 +127,7 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.sncode_label.AutoSize = true;
             this.sncode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sncode_label.Location = new System.Drawing.Point(47, 545);
+            this.sncode_label.Location = new System.Drawing.Point(28, 553);
             this.sncode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.sncode_label.Name = "sncode_label";
             this.sncode_label.Size = new System.Drawing.Size(72, 27);
@@ -141,7 +141,7 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.sncode.BackColor = System.Drawing.Color.White;
             this.sncode.ID = null;
-            this.sncode.Location = new System.Drawing.Point(157, 547);
+            this.sncode.Location = new System.Drawing.Point(138, 555);
             this.sncode.Margin = new System.Windows.Forms.Padding(4);
             this.sncode.Name = "sncode";
             this.sncode.Power = null;
@@ -157,7 +157,7 @@
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OperateResult.Location = new System.Drawing.Point(32, 139);
+            this.OperateResult.Location = new System.Drawing.Point(13, 147);
             this.OperateResult.Margin = new System.Windows.Forms.Padding(4);
             this.OperateResult.Name = "OperateResult";
             this.OperateResult.Size = new System.Drawing.Size(940, 380);
@@ -168,7 +168,7 @@
             // 
             this.mcd_remainqty_label.AutoSize = true;
             this.mcd_remainqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty_label.Location = new System.Drawing.Point(309, 78);
+            this.mcd_remainqty_label.Location = new System.Drawing.Point(290, 86);
             this.mcd_remainqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_remainqty_label.Name = "mcd_remainqty_label";
             this.mcd_remainqty_label.Size = new System.Drawing.Size(72, 27);
@@ -179,7 +179,7 @@
             // 
             this.mcd_okqty_label.AutoSize = true;
             this.mcd_okqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty_label.Location = new System.Drawing.Point(27, 78);
+            this.mcd_okqty_label.Location = new System.Drawing.Point(8, 86);
             this.mcd_okqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_okqty_label.Name = "mcd_okqty_label";
             this.mcd_okqty_label.Size = new System.Drawing.Size(92, 27);
@@ -190,7 +190,7 @@
             // 
             this.pr_code_label.AutoSize = true;
             this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code_label.Location = new System.Drawing.Point(309, 17);
+            this.pr_code_label.Location = new System.Drawing.Point(290, 25);
             this.pr_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_code_label.Name = "pr_code_label";
             this.pr_code_label.Size = new System.Drawing.Size(92, 27);
@@ -201,7 +201,7 @@
             // 
             this.ms_makecode_label.AutoSize = true;
             this.ms_makecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode_label.Location = new System.Drawing.Point(27, 17);
+            this.ms_makecode_label.Location = new System.Drawing.Point(8, 25);
             this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_makecode_label.Name = "ms_makecode_label";
             this.ms_makecode_label.Size = new System.Drawing.Size(92, 27);
@@ -212,7 +212,7 @@
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1249, 602);
+            this.ClientSize = new System.Drawing.Size(1018, 602);
             this.Controls.Add(this.ms_makecode);
             this.Controls.Add(this.deleteButton1);
             this.Controls.Add(this.mcd_remainqty);

+ 15 - 15
UAS-MES/FunctionCode/Make/Make_CollectNetCode.Designer.cs

@@ -50,7 +50,7 @@
             // 
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(632, 37);
+            this.pr_detail_label.Location = new System.Drawing.Point(578, 28);
             this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail_label.Name = "pr_detail_label";
             this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
@@ -63,7 +63,7 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.sncode_label.AutoSize = true;
             this.sncode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sncode_label.Location = new System.Drawing.Point(82, 565);
+            this.sncode_label.Location = new System.Drawing.Point(28, 556);
             this.sncode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.sncode_label.Name = "sncode_label";
             this.sncode_label.Size = new System.Drawing.Size(72, 27);
@@ -74,7 +74,7 @@
             // 
             this.mcd_remainqty_label.AutoSize = true;
             this.mcd_remainqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty_label.Location = new System.Drawing.Point(344, 98);
+            this.mcd_remainqty_label.Location = new System.Drawing.Point(290, 89);
             this.mcd_remainqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_remainqty_label.Name = "mcd_remainqty_label";
             this.mcd_remainqty_label.Size = new System.Drawing.Size(72, 27);
@@ -85,7 +85,7 @@
             // 
             this.mcd_okqty_label.AutoSize = true;
             this.mcd_okqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty_label.Location = new System.Drawing.Point(62, 98);
+            this.mcd_okqty_label.Location = new System.Drawing.Point(8, 89);
             this.mcd_okqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_okqty_label.Name = "mcd_okqty_label";
             this.mcd_okqty_label.Size = new System.Drawing.Size(92, 27);
@@ -96,7 +96,7 @@
             // 
             this.pr_code_label.AutoSize = true;
             this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code_label.Location = new System.Drawing.Point(344, 37);
+            this.pr_code_label.Location = new System.Drawing.Point(290, 28);
             this.pr_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_code_label.Name = "pr_code_label";
             this.pr_code_label.Size = new System.Drawing.Size(92, 27);
@@ -107,7 +107,7 @@
             // 
             this.ms_makecode_label.AutoSize = true;
             this.ms_makecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode_label.Location = new System.Drawing.Point(62, 37);
+            this.ms_makecode_label.Location = new System.Drawing.Point(8, 28);
             this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_makecode_label.Name = "ms_makecode_label";
             this.ms_makecode_label.Size = new System.Drawing.Size(92, 27);
@@ -118,7 +118,7 @@
             // 
             this.ms_makecode.AutoSize = true;
             this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode.Location = new System.Drawing.Point(161, 37);
+            this.ms_makecode.Location = new System.Drawing.Point(107, 28);
             this.ms_makecode.Name = "ms_makecode";
             this.ms_makecode.Size = new System.Drawing.Size(0, 27);
             this.ms_makecode.TabIndex = 198;
@@ -127,7 +127,7 @@
             // 
             this.deleteButton1.AllPower = null;
             this.deleteButton1.Image = ((System.Drawing.Image)(resources.GetObject("deleteButton1.Image")));
-            this.deleteButton1.Location = new System.Drawing.Point(533, 567);
+            this.deleteButton1.Location = new System.Drawing.Point(479, 558);
             this.deleteButton1.Name = "deleteButton1";
             this.deleteButton1.Power = null;
             this.deleteButton1.Size = new System.Drawing.Size(75, 23);
@@ -140,7 +140,7 @@
             // 
             this.mcd_remainqty.AutoSize = true;
             this.mcd_remainqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty.Location = new System.Drawing.Point(447, 98);
+            this.mcd_remainqty.Location = new System.Drawing.Point(393, 89);
             this.mcd_remainqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_remainqty.Name = "mcd_remainqty";
             this.mcd_remainqty.Size = new System.Drawing.Size(24, 27);
@@ -151,7 +151,7 @@
             // 
             this.mcd_okqty.AutoSize = true;
             this.mcd_okqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty.Location = new System.Drawing.Point(159, 98);
+            this.mcd_okqty.Location = new System.Drawing.Point(105, 89);
             this.mcd_okqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_okqty.Name = "mcd_okqty";
             this.mcd_okqty.Size = new System.Drawing.Size(24, 27);
@@ -162,7 +162,7 @@
             // 
             this.ma_prodcode.AutoSize = true;
             this.ma_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_prodcode.Location = new System.Drawing.Point(452, 41);
+            this.ma_prodcode.Location = new System.Drawing.Point(398, 32);
             this.ma_prodcode.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ma_prodcode.Name = "ma_prodcode";
             this.ma_prodcode.Size = new System.Drawing.Size(0, 27);
@@ -172,7 +172,7 @@
             // 
             this.pr_detail.AutoSize = true;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail.Location = new System.Drawing.Point(745, 37);
+            this.pr_detail.Location = new System.Drawing.Point(691, 28);
             this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail.Name = "pr_detail";
             this.pr_detail.Size = new System.Drawing.Size(0, 27);
@@ -185,7 +185,7 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.sncode.BackColor = System.Drawing.Color.White;
             this.sncode.ID = null;
-            this.sncode.Location = new System.Drawing.Point(192, 567);
+            this.sncode.Location = new System.Drawing.Point(138, 558);
             this.sncode.Margin = new System.Windows.Forms.Padding(4);
             this.sncode.Name = "sncode";
             this.sncode.Power = null;
@@ -200,7 +200,7 @@
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OperateResult.Location = new System.Drawing.Point(67, 159);
+            this.OperateResult.Location = new System.Drawing.Point(13, 150);
             this.OperateResult.Margin = new System.Windows.Forms.Padding(4);
             this.OperateResult.Name = "OperateResult";
             this.OperateResult.Size = new System.Drawing.Size(940, 380);
@@ -211,7 +211,7 @@
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1249, 602);
+            this.ClientSize = new System.Drawing.Size(1026, 602);
             this.Controls.Add(this.ms_makecode);
             this.Controls.Add(this.deleteButton1);
             this.Controls.Add(this.mcd_remainqty);

+ 2 - 1
UAS-MES/FunctionCode/Make/Make_CollectNetCode.cs

@@ -41,7 +41,6 @@ namespace UAS_MES.Make
             sncode.Focus();
             dh = new DataHelper();
             asc.controllInitializeSize(this);
-
         }
 
         private void sncode_KeyDown(object sender, KeyEventArgs e)
@@ -78,11 +77,13 @@ namespace UAS_MES.Make
                         }
                         else
                         {
+                            sncode.Text = "";
                             OperateResult.AppendText(">>序列号" + sncode.Text + "没有对应工序\n", Color.Red);
                         }
                     }
                     else
                     {
+                        sncode.Text = "";
                         OperateResult.AppendText("错误" + ErrorMessage2 + "\n", Color.Red);
                     }
                 }

+ 20 - 20
UAS-MES/FunctionCode/Make/Make_ColorBoxLabelPrint.Designer.cs

@@ -54,7 +54,7 @@
             // 
             this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.PrintLabel.FormattingEnabled = true;
-            this.PrintLabel.Location = new System.Drawing.Point(1116, 113);
+            this.PrintLabel.Location = new System.Drawing.Point(1065, 111);
             this.PrintLabel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.PrintLabel.Name = "PrintLabel";
             this.PrintLabel.Size = new System.Drawing.Size(201, 23);
@@ -64,7 +64,7 @@
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(1013, 50);
+            this.label2.Location = new System.Drawing.Point(962, 48);
             this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label2.Name = "label2";
             this.label2.Size = new System.Drawing.Size(72, 27);
@@ -75,7 +75,7 @@
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(1013, 113);
+            this.label1.Location = new System.Drawing.Point(962, 111);
             this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(52, 27);
@@ -86,7 +86,7 @@
             // 
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(648, 52);
+            this.pr_detail_label.Location = new System.Drawing.Point(597, 50);
             this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail_label.Name = "pr_detail_label";
             this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
@@ -99,7 +99,7 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.sncode_label.AutoSize = true;
             this.sncode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.sncode_label.Location = new System.Drawing.Point(64, 561);
+            this.sncode_label.Location = new System.Drawing.Point(13, 559);
             this.sncode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.sncode_label.Name = "sncode_label";
             this.sncode_label.Size = new System.Drawing.Size(72, 27);
@@ -110,7 +110,7 @@
             // 
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(648, 113);
+            this.label4.Location = new System.Drawing.Point(597, 111);
             this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(92, 27);
@@ -121,7 +121,7 @@
             // 
             this.mcd_remainqty_label.AutoSize = true;
             this.mcd_remainqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty_label.Location = new System.Drawing.Point(356, 113);
+            this.mcd_remainqty_label.Location = new System.Drawing.Point(305, 111);
             this.mcd_remainqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_remainqty_label.Name = "mcd_remainqty_label";
             this.mcd_remainqty_label.Size = new System.Drawing.Size(72, 27);
@@ -132,7 +132,7 @@
             // 
             this.mcd_okqty_label.AutoSize = true;
             this.mcd_okqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty_label.Location = new System.Drawing.Point(64, 113);
+            this.mcd_okqty_label.Location = new System.Drawing.Point(13, 111);
             this.mcd_okqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_okqty_label.Name = "mcd_okqty_label";
             this.mcd_okqty_label.Size = new System.Drawing.Size(92, 27);
@@ -143,7 +143,7 @@
             // 
             this.pr_code_label.AutoSize = true;
             this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code_label.Location = new System.Drawing.Point(356, 52);
+            this.pr_code_label.Location = new System.Drawing.Point(305, 50);
             this.pr_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_code_label.Name = "pr_code_label";
             this.pr_code_label.Size = new System.Drawing.Size(92, 27);
@@ -154,7 +154,7 @@
             // 
             this.ms_makecode_label.AutoSize = true;
             this.ms_makecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode_label.Location = new System.Drawing.Point(64, 52);
+            this.ms_makecode_label.Location = new System.Drawing.Point(13, 50);
             this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_makecode_label.Name = "ms_makecode_label";
             this.ms_makecode_label.Size = new System.Drawing.Size(92, 27);
@@ -163,7 +163,7 @@
             // 
             // Printer
             // 
-            this.Printer.Location = new System.Drawing.Point(1116, 50);
+            this.Printer.Location = new System.Drawing.Point(1065, 48);
             this.Printer.Margin = new System.Windows.Forms.Padding(5);
             this.Printer.Name = "Printer";
             this.Printer.Size = new System.Drawing.Size(203, 31);
@@ -173,7 +173,7 @@
             // 
             this.mcd_remainqty.AutoSize = true;
             this.mcd_remainqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty.Location = new System.Drawing.Point(483, 113);
+            this.mcd_remainqty.Location = new System.Drawing.Point(432, 111);
             this.mcd_remainqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_remainqty.Name = "mcd_remainqty";
             this.mcd_remainqty.Size = new System.Drawing.Size(24, 27);
@@ -184,7 +184,7 @@
             // 
             this.mcd_okqty.AutoSize = true;
             this.mcd_okqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty.Location = new System.Drawing.Point(189, 113);
+            this.mcd_okqty.Location = new System.Drawing.Point(138, 111);
             this.mcd_okqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_okqty.Name = "mcd_okqty";
             this.mcd_okqty.Size = new System.Drawing.Size(24, 27);
@@ -195,7 +195,7 @@
             // 
             this.pr_code.AutoSize = true;
             this.pr_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code.Location = new System.Drawing.Point(465, 52);
+            this.pr_code.Location = new System.Drawing.Point(414, 50);
             this.pr_code.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_code.Name = "pr_code";
             this.pr_code.Size = new System.Drawing.Size(0, 27);
@@ -206,7 +206,7 @@
             // 
             this.pr_detail.AutoSize = true;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail.Location = new System.Drawing.Point(748, 54);
+            this.pr_detail.Location = new System.Drawing.Point(697, 52);
             this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail.Name = "pr_detail";
             this.pr_detail.Size = new System.Drawing.Size(0, 27);
@@ -217,7 +217,7 @@
             this.PrintNum.AllPower = null;
             this.PrintNum.BackColor = System.Drawing.Color.White;
             this.PrintNum.ID = null;
-            this.PrintNum.Location = new System.Drawing.Point(775, 113);
+            this.PrintNum.Location = new System.Drawing.Point(724, 111);
             this.PrintNum.Margin = new System.Windows.Forms.Padding(4);
             this.PrintNum.Name = "PrintNum";
             this.PrintNum.Negative = false;
@@ -235,7 +235,7 @@
             | System.Windows.Forms.AnchorStyles.Left)));
             this.sncode.BackColor = System.Drawing.Color.White;
             this.sncode.ID = null;
-            this.sncode.Location = new System.Drawing.Point(183, 562);
+            this.sncode.Location = new System.Drawing.Point(132, 560);
             this.sncode.Margin = new System.Windows.Forms.Padding(4);
             this.sncode.Name = "sncode";
             this.sncode.Power = null;
@@ -250,7 +250,7 @@
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OperateResult.Location = new System.Drawing.Point(69, 163);
+            this.OperateResult.Location = new System.Drawing.Point(18, 161);
             this.OperateResult.Margin = new System.Windows.Forms.Padding(4);
             this.OperateResult.Name = "OperateResult";
             this.OperateResult.Size = new System.Drawing.Size(940, 380);
@@ -261,7 +261,7 @@
             // 
             this.ma_code.AutoSize = true;
             this.ma_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_code.Location = new System.Drawing.Point(163, 54);
+            this.ma_code.Location = new System.Drawing.Point(112, 52);
             this.ma_code.Name = "ma_code";
             this.ma_code.Size = new System.Drawing.Size(0, 27);
             this.ma_code.TabIndex = 183;
@@ -270,7 +270,7 @@
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1344, 651);
+            this.ClientSize = new System.Drawing.Size(1288, 651);
             this.Controls.Add(this.ma_code);
             this.Controls.Add(this.PrintLabel);
             this.Controls.Add(this.label2);

+ 3 - 2
UAS-MES/FunctionCode/Make/Make_ColorBoxLabelPrint.cs

@@ -75,6 +75,7 @@ namespace UAS_MES.Make
                     }
                     else
                     {
+                        sncode.Text = "";
                         OperateResult.AppendText(">>序列号" + sncode.Text + "没有对应工序\n", Color.Red);
 
                     }
@@ -116,12 +117,12 @@ namespace UAS_MES.Make
                             OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                             return;
                         }
-                        ErrorMessage = ">>>请输入SN";
-                        OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Green);
+                        OperateResult.AppendText(">>请输入SN\n", Color.Green);
                     }
                 }
                 else
                 {
+                    sncode.Text = "";
                     OperateResult.AppendText(ErrorMessage2 + "\n", Color.Red);
                 }
             }

+ 2 - 0
UAS-MES/FunctionCode/Make/Make_ColorBoxWeigh.cs

@@ -45,6 +45,8 @@ namespace UAS_MES.Make
             CheckForIllegalCrossThreadCalls = false;
             dh = new DataHelper();
             asc.controllInitializeSize(this);
+            ComList.Text = Properties.Settings.Default.PortName;
+            BaudRate.Text = Properties.Settings.Default.BaudRate;
         }
 
         private void sncode_KeyDown(object sender, KeyEventArgs e)

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

@@ -43,6 +43,9 @@ namespace UAS_MES.SystemSetting
                 ReadData = true;
                 serialPort1.PortName = this.ComList.Text;
                 serialPort1.BaudRate = int.Parse(BaudRate.Text);
+                Properties.Settings.Default.PortName = this.ComList.Text;
+                Properties.Settings.Default.BaudRate = BaudRate.Text;
+                Properties.Settings.Default.Save();
                 serialPort1.Open();
                 thread.Start();
             }

+ 24 - 0
UAS-MES/Properties/Settings.Designer.cs

@@ -105,5 +105,29 @@ namespace UAS_MES.Properties {
                 this["DefaultCollectionValue"] = value;
             }
         }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("")]
+        public string PortName {
+            get {
+                return ((string)(this["PortName"]));
+            }
+            set {
+                this["PortName"] = value;
+            }
+        }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.DefaultSettingValueAttribute("")]
+        public string BaudRate {
+            get {
+                return ((string)(this["BaudRate"]));
+            }
+            set {
+                this["BaudRate"] = value;
+            }
+        }
     }
 }

+ 6 - 0
UAS-MES/Properties/Settings.settings

@@ -23,5 +23,11 @@
     <Setting Name="DefaultCollectionValue" Type="System.String" Scope="User">
       <Value Profile="(Default)">DefaultValue</Value>
     </Setting>
+    <Setting Name="PortName" Type="System.String" Scope="User">
+      <Value Profile="(Default)" />
+    </Setting>
+    <Setting Name="BaudRate" Type="System.String" Scope="User">
+      <Value Profile="(Default)" />
+    </Setting>
   </Settings>
 </SettingsFile>