Selaa lähdekoodia

调整Grid值显示渲染

章政 6 vuotta sitten
vanhempi
commit
e2a13212f2

+ 19 - 15
UAS-出货标签管理(吉利通)/UAS_出货标签管理.Designer.cs

@@ -91,6 +91,7 @@
             this.PageNum = new System.Windows.Forms.Label();
             this.LogMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
             this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
+            this.UploadData = new System.Windows.Forms.Button();
             this.front_sg_separator = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.FrontCollect = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.CollectionProcess = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
@@ -228,7 +229,6 @@
             this.BackendCheck = new UAS_LabelMachine.CustomControl.SerialPortWithTag();
             this.FrontendCheck = new UAS_LabelMachine.CustomControl.SerialPortWithTag();
             this.PLC1 = new UAS_LabelMachine.CustomControl.SerialPortWithTag();
-            this.UploadData = new System.Windows.Forms.Button();
             this.LogMenu.SuspendLayout();
             this.CollectionProcess.SuspendLayout();
             this.groupBox2.SuspendLayout();
@@ -808,6 +808,18 @@
             this.toolStripMenuItem1.Size = new System.Drawing.Size(124, 22);
             this.toolStripMenuItem1.Text = "导出日志";
             // 
+            // UploadData
+            // 
+            this.UploadData.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.UploadData.Location = new System.Drawing.Point(234, 214);
+            this.UploadData.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
+            this.UploadData.Name = "UploadData";
+            this.UploadData.Size = new System.Drawing.Size(68, 26);
+            this.UploadData.TabIndex = 103;
+            this.UploadData.Text = "上传数据";
+            this.UploadData.UseVisualStyleBackColor = true;
+            this.UploadData.Click += new System.EventHandler(this.UploadData_Click);
+            // 
             // front_sg_separator
             // 
             this.front_sg_separator.Enabled = false;
@@ -1325,8 +1337,8 @@
             // LabelInf
             // 
             this.LabelInf.AllowUserToAddRows = false;
-            this.LabelInf.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
-            this.LabelInf.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
+            this.LabelInf.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells;
+            this.LabelInf.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.DisplayedCells;
             this.LabelInf.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
             this.LabelInf.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
             this.Choose,
@@ -1773,6 +1785,8 @@
             // SingleLabelAutoPrint
             // 
             this.SingleLabelAutoPrint.AutoSize = true;
+            this.SingleLabelAutoPrint.Checked = true;
+            this.SingleLabelAutoPrint.CheckState = System.Windows.Forms.CheckState.Checked;
             this.SingleLabelAutoPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.SingleLabelAutoPrint.Location = new System.Drawing.Point(9, 89);
             this.SingleLabelAutoPrint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
@@ -2102,6 +2116,8 @@
             // MidLabelAutoPrint
             // 
             this.MidLabelAutoPrint.AutoSize = true;
+            this.MidLabelAutoPrint.Checked = true;
+            this.MidLabelAutoPrint.CheckState = System.Windows.Forms.CheckState.Checked;
             this.MidLabelAutoPrint.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.MidLabelAutoPrint.Location = new System.Drawing.Point(9, 90);
             this.MidLabelAutoPrint.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
@@ -2360,18 +2376,6 @@
             // 
             this.PLC1.Tag = "PLC1";
             // 
-            // UploadData
-            // 
-            this.UploadData.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.UploadData.Location = new System.Drawing.Point(234, 214);
-            this.UploadData.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.UploadData.Name = "UploadData";
-            this.UploadData.Size = new System.Drawing.Size(68, 26);
-            this.UploadData.TabIndex = 103;
-            this.UploadData.Text = "上传数据";
-            this.UploadData.UseVisualStyleBackColor = true;
-            this.UploadData.Click += new System.EventHandler(this.UploadData_Click);
-            // 
             // UAS_出货标签打印
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);

+ 4 - 15
UAS-出货标签管理(吉利通)/UAS_出货标签管理.cs

@@ -229,7 +229,7 @@ namespace UAS_LabelMachine
                             //接收到的数据和指令的对应则
                             if (item.Value == msg)
                             {
-                                Console.WriteLine(item.Key);
+
                             }
                         }
                         break;
@@ -263,7 +263,7 @@ namespace UAS_LabelMachine
                             if (MidLabelAutoPrint.Checked)
                                 AutoPrintMidLabel();
                             LogicHandler.SendDataToPLC(PLC1, PLCInstruct.FrontDataPass);
-                            LabelInf.Refresh();
+                            LabelInf.Invalidate();
                         }
                         break;
                     case "BackendCheck":
@@ -594,7 +594,6 @@ namespace UAS_LabelMachine
                     LogicHandler.GetBarCode(PI_ID, pd_id, 1, out OutBoxBarCode);
                     LabelInf.Rows[CurrentRowIndex].Cells["pib_custoutboxcode"].Value = OutBoxBarCode;
                 }
-
                 LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode1"].Value = outboxcode1;
                 LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode2"].Value = outboxcode2;
                 string pib_id = LabelInf.Rows[CurrentRowIndex].Cells["pib_id1"].Value.ToString();
@@ -1619,18 +1618,7 @@ namespace UAS_LabelMachine
 
         private void AutoPrintMidLabel()
         {
-            bool FullBox = true;
-            //判断所有盒号未该盒的是否勾选已采集
-            for (int i = 0; i < LabelInf.RowCount; i++)
-            {
-                if (LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString() == LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode1"].Value.ToString())
-                {
-                    if (LabelInf.Rows[i].Cells["pib_ifpick"].FormattedValue.ToString() != "True")
-                        FullBox = false;
-                }
-            }
-            //如果当前箱号已经装满了
-            if (FullBox)
+            if (adh.getRowCount("prodiobarcode", "pib_inoutno='" + pi_inoutno.Text + "' and pib_outboxcode1=" + LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode1"].Value) == MidBoxCapacity.Value)
             {
                 if (MidLabelCombox.SelectedValue != null)
                 {
@@ -2050,6 +2038,7 @@ namespace UAS_LabelMachine
                         dtt.Rows[i]["pib_ifupload"] = -1;
                     }
                 }
+                MessageLog.AppendText(">>上传数据成功\n", Color.Green);
             }
         }
     }