Selaa lähdekoodia

缓存称量记录

章政 8 vuotta sitten
vanhempi
commit
227731a460

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

@@ -42,14 +42,8 @@
             this.panel4 = new System.Windows.Forms.Panel();
             this.label15 = new System.Windows.Forms.Label();
             this.pr_detail_label = new System.Windows.Forms.Label();
-            this.Temp1 = new System.Windows.Forms.Label();
-            this.panel3 = new System.Windows.Forms.Panel();
-            this.Temp2 = new System.Windows.Forms.Label();
-            this.panel2 = new System.Windows.Forms.Panel();
             this.ma_qty_label = new System.Windows.Forms.Label();
             this.ma_salecode_label = new System.Windows.Forms.Label();
-            this.Temp3 = new System.Windows.Forms.Label();
-            this.panel1 = new System.Windows.Forms.Panel();
             this.ms_makecode_label = new System.Windows.Forms.Label();
             this.PrintLabel = new System.Windows.Forms.ComboBox();
             this.Printer_label = new System.Windows.Forms.Label();
@@ -73,11 +67,13 @@
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             this.BaudRate = new System.Windows.Forms.Label();
             this.ComList = new System.Windows.Forms.Label();
+            this.WeighRecord = new System.Windows.Forms.ListView();
+            this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
+            this.columnHeader4 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
             this.panel6.SuspendLayout();
             this.panel4.SuspendLayout();
-            this.panel3.SuspendLayout();
-            this.panel2.SuspendLayout();
-            this.panel1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).BeginInit();
             this.SuspendLayout();
             // 
@@ -225,47 +221,6 @@
             this.pr_detail_label.TabIndex = 53;
             this.pr_detail_label.Text = "产品型号";
             // 
-            // Temp1
-            // 
-            this.Temp1.AutoSize = true;
-            this.Temp1.Font = new System.Drawing.Font("微软雅黑", 20F);
-            this.Temp1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
-            this.Temp1.Location = new System.Drawing.Point(57, 35);
-            this.Temp1.Name = "Temp1";
-            this.Temp1.Size = new System.Drawing.Size(0, 35);
-            this.Temp1.TabIndex = 38;
-            // 
-            // panel3
-            // 
-            this.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
-            this.panel3.Controls.Add(this.Temp1);
-            this.panel3.Location = new System.Drawing.Point(405, 218);
-            this.panel3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.panel3.Name = "panel3";
-            this.panel3.Size = new System.Drawing.Size(381, 98);
-            this.panel3.TabIndex = 52;
-            // 
-            // Temp2
-            // 
-            this.Temp2.AutoSize = true;
-            this.Temp2.Font = new System.Drawing.Font("微软雅黑", 20F);
-            this.Temp2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
-            this.Temp2.Location = new System.Drawing.Point(57, 32);
-            this.Temp2.Name = "Temp2";
-            this.Temp2.Size = new System.Drawing.Size(0, 35);
-            this.Temp2.TabIndex = 39;
-            // 
-            // panel2
-            // 
-            this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
-            this.panel2.Controls.Add(this.Temp2);
-            this.panel2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
-            this.panel2.Location = new System.Drawing.Point(405, 337);
-            this.panel2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.panel2.Name = "panel2";
-            this.panel2.Size = new System.Drawing.Size(381, 98);
-            this.panel2.TabIndex = 51;
-            // 
             // ma_qty_label
             // 
             this.ma_qty_label.AutoSize = true;
@@ -286,26 +241,6 @@
             this.ma_salecode_label.TabIndex = 54;
             this.ma_salecode_label.Text = "订单编号";
             // 
-            // Temp3
-            // 
-            this.Temp3.AutoSize = true;
-            this.Temp3.Font = new System.Drawing.Font("微软雅黑", 20F);
-            this.Temp3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(192)))), ((int)(((byte)(0)))));
-            this.Temp3.Location = new System.Drawing.Point(57, 33);
-            this.Temp3.Name = "Temp3";
-            this.Temp3.Size = new System.Drawing.Size(0, 35);
-            this.Temp3.TabIndex = 40;
-            // 
-            // panel1
-            // 
-            this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
-            this.panel1.Controls.Add(this.Temp3);
-            this.panel1.Location = new System.Drawing.Point(405, 454);
-            this.panel1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(381, 98);
-            this.panel1.TabIndex = 50;
-            // 
             // ms_makecode_label
             // 
             this.ms_makecode_label.AutoSize = true;
@@ -600,11 +535,46 @@
             this.ComList.Text = "ComList";
             this.ComList.Visible = false;
             // 
+            // WeighRecord
+            // 
+            this.WeighRecord.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+            this.columnHeader1,
+            this.columnHeader2,
+            this.columnHeader3,
+            this.columnHeader4});
+            this.WeighRecord.Location = new System.Drawing.Point(412, 218);
+            this.WeighRecord.Name = "WeighRecord";
+            this.WeighRecord.Size = new System.Drawing.Size(380, 334);
+            this.WeighRecord.TabIndex = 173;
+            this.WeighRecord.UseCompatibleStateImageBehavior = false;
+            this.WeighRecord.View = System.Windows.Forms.View.Details;
+            // 
+            // columnHeader1
+            // 
+            this.columnHeader1.Text = "";
+            this.columnHeader1.Width = 23;
+            // 
+            // columnHeader2
+            // 
+            this.columnHeader2.Text = "序列号";
+            this.columnHeader2.Width = 127;
+            // 
+            // columnHeader3
+            // 
+            this.columnHeader3.Text = "重量";
+            this.columnHeader3.Width = 99;
+            // 
+            // columnHeader4
+            // 
+            this.columnHeader4.Text = "时间";
+            this.columnHeader4.Width = 130;
+            // 
             // 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.WeighRecord);
             this.Controls.Add(this.ComList);
             this.Controls.Add(this.BaudRate);
             this.Controls.Add(this.label1);
@@ -633,12 +603,9 @@
             this.Controls.Add(this.panel4);
             this.Controls.Add(this.label15);
             this.Controls.Add(this.pr_detail_label);
-            this.Controls.Add(this.panel3);
-            this.Controls.Add(this.panel2);
             this.Controls.Add(this.ma_qty_label);
             this.Controls.Add(this.ma_salecode_label);
             this.Controls.Add(this.OperateResult);
-            this.Controls.Add(this.panel1);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Name = "Make_ColorBoxWeigh";
@@ -651,12 +618,6 @@
             this.panel6.PerformLayout();
             this.panel4.ResumeLayout(false);
             this.panel4.PerformLayout();
-            this.panel3.ResumeLayout(false);
-            this.panel3.PerformLayout();
-            this.panel2.ResumeLayout(false);
-            this.panel2.PerformLayout();
-            this.panel1.ResumeLayout(false);
-            this.panel1.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
@@ -678,15 +639,9 @@
         private System.Windows.Forms.Panel panel4;
         private System.Windows.Forms.Label label15;
         private System.Windows.Forms.Label pr_detail_label;
-        private System.Windows.Forms.Label Temp1;
-        private System.Windows.Forms.Panel panel3;
-        private System.Windows.Forms.Label Temp2;
-        private System.Windows.Forms.Panel panel2;
         private System.Windows.Forms.Label ma_qty_label;
         private System.Windows.Forms.Label ma_salecode_label;
-        private System.Windows.Forms.Label Temp3;
         private CustomControl.RichText.RichTextAutoBottom OperateResult;
-        private System.Windows.Forms.Panel panel1;
         private System.Windows.Forms.Label ms_makecode_label;
         private CustomControl.ValueLabel.ValueLabel ma_salecode;
         private CustomControl.ValueLabel.ValueLabel pr_detail;
@@ -708,5 +663,10 @@
         private System.Windows.Forms.Label label1;
         private System.Windows.Forms.Label BaudRate;
         private System.Windows.Forms.Label ComList;
+        private System.Windows.Forms.ListView WeighRecord;
+        private System.Windows.Forms.ColumnHeader columnHeader1;
+        private System.Windows.Forms.ColumnHeader columnHeader2;
+        private System.Windows.Forms.ColumnHeader columnHeader3;
+        private System.Windows.Forms.ColumnHeader columnHeader4;
     }
 }

+ 5 - 3
UAS-MES/FunctionCode/Make/Make_ColorBoxWeigh.cs

@@ -117,10 +117,12 @@ namespace UAS_MES.Make
                         int ActualWeight = int.Parse(weight.Text == "" ? "0" : weight.Text);
                         if ((ActualWeight >= MinWeight) && (ActualWeight <= MaxWeight))
                         {
+                            ListViewItem lsi = new ListViewItem();
+                            lsi.SubItems.Add(sncode.Text);
+                            lsi.SubItems.Add(ActualWeight.ToString());
+                            lsi.SubItems.Add(System.DateTime.Now.ToString());
+                            WeighRecord.Items.Add(lsi);
                             //显示最近的三个称量记录
-                            Temp3.Text = Temp2.Text;
-                            Temp2.Text = Temp1.Text;
-                            Temp1.Text = sncode.Text;
                             if (LogicHandler.UpdateMakeMessage(sncode.Text, ms_makecode.Text, "彩盒称量", User.UserSourceCode, User.UserCode, "称量合格", out ErrorMessage))
                             {
                                 OperateResult.AppendText(">>" + sncode.Text + "重量检测检测合格\n", Color.Green);