Ver Fonte

Merge branch 'master' of ssh://10.10.100.21/source/mes-client

Hcsy há 6 anos atrás
pai
commit
82e1fd7f00

+ 1 - 1
UAS-出货标签管理/UAS_出货标签管理.cs

@@ -305,7 +305,7 @@ namespace UAS_LabelMachine
         private void sg_code_UserControlTextChanged(object sender, EventArgs e)
         {
             //取已启用的的按照采集次序排序
-            dt = (DataTable)dh.ExecuteSql("select si_item,si_detno,sg_separator,si_kind,si_expression,si_expressionitem,si_index,si_indexstring,si_length from scanitem left join scangroup on si_sgid=sg_id where sg_code='" + sg_code.Text + "' and si_enable<>0 order by si_detno", "select");
+            dt = (DataTable)dh.ExecuteSql("select si_item,si_detno,sg_separator,si_kind,si_expression,si_expressionitem,si_index,si_indexstring,si_length from scanitem left join scangroup on si_sgid=sg_id where sg_code='" + sg_code.Text + "' and si_enable<>0 order by si_detno,si_innerdetno", "select");
             BaseUtil.FillDgvWithDataTable(Si_ItemDGV, dt);
             if (dt.Rows.Count > 0)
             {

+ 180 - 30
UAS-出货标签管理/采集策略.Designer.cs

@@ -131,6 +131,16 @@
             this.si_expression5 = new UAS_LabelMachine.CustomControl.EnterTextBox();
             this.si_expression5_label = new System.Windows.Forms.Label();
             this.si_type5 = new System.Windows.Forms.CheckBox();
+            this.si_innerdetno4 = new UAS_LabelMachine.CustomControl.EnterTextBox();
+            this.si_innerdetno4_label = new System.Windows.Forms.Label();
+            this.si_innerdetno2 = new UAS_LabelMachine.CustomControl.EnterTextBox();
+            this.si_innerdetno2_label = new System.Windows.Forms.Label();
+            this.si_innerdetno1 = new UAS_LabelMachine.CustomControl.EnterTextBox();
+            this.si_innerdetno1_label = new System.Windows.Forms.Label();
+            this.si_innerdetno3 = new UAS_LabelMachine.CustomControl.EnterTextBox();
+            this.si_innerdetno3_label = new System.Windows.Forms.Label();
+            this.si_innerdetno5 = new UAS_LabelMachine.CustomControl.EnterTextBox();
+            this.si_innerdetno5_label = new System.Windows.Forms.Label();
             this.SuspendLayout();
             // 
             // sg_name_label
@@ -444,7 +454,7 @@
             this.si_index1_label.AutoSize = true;
             this.si_index1_label.BackColor = System.Drawing.Color.Transparent;
             this.si_index1_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.si_index1_label.Location = new System.Drawing.Point(20, 373);
+            this.si_index1_label.Location = new System.Drawing.Point(268, 372);
             this.si_index1_label.Name = "si_index1_label";
             this.si_index1_label.Size = new System.Drawing.Size(74, 21);
             this.si_index1_label.TabIndex = 67;
@@ -455,7 +465,7 @@
             this.si_length1_label.AutoSize = true;
             this.si_length1_label.BackColor = System.Drawing.Color.Transparent;
             this.si_length1_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.si_length1_label.Location = new System.Drawing.Point(518, 373);
+            this.si_length1_label.Location = new System.Drawing.Point(783, 372);
             this.si_length1_label.Name = "si_length1_label";
             this.si_length1_label.Size = new System.Drawing.Size(42, 21);
             this.si_length1_label.TabIndex = 69;
@@ -466,7 +476,7 @@
             this.si_indexstring1_label.AutoSize = true;
             this.si_indexstring1_label.BackColor = System.Drawing.Color.Transparent;
             this.si_indexstring1_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.si_indexstring1_label.Location = new System.Drawing.Point(268, 373);
+            this.si_indexstring1_label.Location = new System.Drawing.Point(518, 372);
             this.si_indexstring1_label.Name = "si_indexstring1_label";
             this.si_indexstring1_label.Size = new System.Drawing.Size(74, 21);
             this.si_indexstring1_label.TabIndex = 71;
@@ -477,7 +487,7 @@
             this.si_indexstring2_label.AutoSize = true;
             this.si_indexstring2_label.BackColor = System.Drawing.Color.Transparent;
             this.si_indexstring2_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.si_indexstring2_label.Location = new System.Drawing.Point(268, 264);
+            this.si_indexstring2_label.Location = new System.Drawing.Point(518, 265);
             this.si_indexstring2_label.Name = "si_indexstring2_label";
             this.si_indexstring2_label.Size = new System.Drawing.Size(74, 21);
             this.si_indexstring2_label.TabIndex = 77;
@@ -488,7 +498,7 @@
             this.si_length2_label.AutoSize = true;
             this.si_length2_label.BackColor = System.Drawing.Color.Transparent;
             this.si_length2_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.si_length2_label.Location = new System.Drawing.Point(518, 264);
+            this.si_length2_label.Location = new System.Drawing.Point(783, 265);
             this.si_length2_label.Name = "si_length2_label";
             this.si_length2_label.Size = new System.Drawing.Size(42, 21);
             this.si_length2_label.TabIndex = 75;
@@ -499,7 +509,7 @@
             this.si_index2_label.AutoSize = true;
             this.si_index2_label.BackColor = System.Drawing.Color.Transparent;
             this.si_index2_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.si_index2_label.Location = new System.Drawing.Point(20, 264);
+            this.si_index2_label.Location = new System.Drawing.Point(268, 265);
             this.si_index2_label.Name = "si_index2_label";
             this.si_index2_label.Size = new System.Drawing.Size(74, 21);
             this.si_index2_label.TabIndex = 73;
@@ -510,7 +520,7 @@
             this.si_indexstring3_label.AutoSize = true;
             this.si_indexstring3_label.BackColor = System.Drawing.Color.Transparent;
             this.si_indexstring3_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.si_indexstring3_label.Location = new System.Drawing.Point(268, 486);
+            this.si_indexstring3_label.Location = new System.Drawing.Point(518, 486);
             this.si_indexstring3_label.Name = "si_indexstring3_label";
             this.si_indexstring3_label.Size = new System.Drawing.Size(74, 21);
             this.si_indexstring3_label.TabIndex = 83;
@@ -521,7 +531,7 @@
             this.si_length3_label.AutoSize = true;
             this.si_length3_label.BackColor = System.Drawing.Color.Transparent;
             this.si_length3_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.si_length3_label.Location = new System.Drawing.Point(518, 486);
+            this.si_length3_label.Location = new System.Drawing.Point(783, 486);
             this.si_length3_label.Name = "si_length3_label";
             this.si_length3_label.Size = new System.Drawing.Size(42, 21);
             this.si_length3_label.TabIndex = 81;
@@ -532,7 +542,7 @@
             this.si_index3_label.AutoSize = true;
             this.si_index3_label.BackColor = System.Drawing.Color.Transparent;
             this.si_index3_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.si_index3_label.Location = new System.Drawing.Point(20, 486);
+            this.si_index3_label.Location = new System.Drawing.Point(268, 486);
             this.si_index3_label.Name = "si_index3_label";
             this.si_index3_label.Size = new System.Drawing.Size(74, 21);
             this.si_index3_label.TabIndex = 79;
@@ -543,7 +553,7 @@
             this.si_indexstring4_label.AutoSize = true;
             this.si_indexstring4_label.BackColor = System.Drawing.Color.Transparent;
             this.si_indexstring4_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.si_indexstring4_label.Location = new System.Drawing.Point(268, 170);
+            this.si_indexstring4_label.Location = new System.Drawing.Point(518, 174);
             this.si_indexstring4_label.Name = "si_indexstring4_label";
             this.si_indexstring4_label.Size = new System.Drawing.Size(74, 21);
             this.si_indexstring4_label.TabIndex = 89;
@@ -554,7 +564,7 @@
             this.si_length4_label.AutoSize = true;
             this.si_length4_label.BackColor = System.Drawing.Color.Transparent;
             this.si_length4_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.si_length4_label.Location = new System.Drawing.Point(518, 170);
+            this.si_length4_label.Location = new System.Drawing.Point(783, 174);
             this.si_length4_label.Name = "si_length4_label";
             this.si_length4_label.Size = new System.Drawing.Size(42, 21);
             this.si_length4_label.TabIndex = 87;
@@ -565,7 +575,7 @@
             this.si_index4_label.AutoSize = true;
             this.si_index4_label.BackColor = System.Drawing.Color.Transparent;
             this.si_index4_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.si_index4_label.Location = new System.Drawing.Point(20, 170);
+            this.si_index4_label.Location = new System.Drawing.Point(268, 174);
             this.si_index4_label.Name = "si_index4_label";
             this.si_index4_label.Size = new System.Drawing.Size(74, 21);
             this.si_index4_label.TabIndex = 85;
@@ -672,16 +682,21 @@
             // 
             // pb_name
             // 
+            this.pb_name.AllPower = null;
             this.pb_name.Caller = null;
             this.pb_name.Condition = null;
+            this.pb_name.DBTitle = null;
             this.pb_name.FormName = null;
             this.pb_name.Location = new System.Drawing.Point(631, 27);
             this.pb_name.Name = "pb_name";
+            this.pb_name.Power = null;
+            this.pb_name.ReturnData = null;
             this.pb_name.SelectField = null;
             this.pb_name.SetValueField = null;
             this.pb_name.Size = new System.Drawing.Size(180, 21);
             this.pb_name.TabIndex = 3;
             this.pb_name.TableName = null;
+            this.pb_name.TextBoxEnable = false;
             // 
             // sg_separator
             // 
@@ -698,7 +713,7 @@
             // 
             this.si_indexstring4.Enabled = false;
             this.si_indexstring4.ID = null;
-            this.si_indexstring4.Location = new System.Drawing.Point(355, 170);
+            this.si_indexstring4.Location = new System.Drawing.Point(616, 174);
             this.si_indexstring4.Name = "si_indexstring4";
             this.si_indexstring4.Size = new System.Drawing.Size(157, 21);
             this.si_indexstring4.Str = null;
@@ -709,7 +724,7 @@
             // si_length4
             // 
             this.si_length4.Enabled = false;
-            this.si_length4.Location = new System.Drawing.Point(616, 170);
+            this.si_length4.Location = new System.Drawing.Point(831, 174);
             this.si_length4.Name = "si_length4";
             this.si_length4.Negative = false;
             this.si_length4.Size = new System.Drawing.Size(157, 21);
@@ -718,7 +733,7 @@
             // si_index4
             // 
             this.si_index4.Enabled = false;
-            this.si_index4.Location = new System.Drawing.Point(100, 170);
+            this.si_index4.Location = new System.Drawing.Point(355, 174);
             this.si_index4.Name = "si_index4";
             this.si_index4.Negative = false;
             this.si_index4.Size = new System.Drawing.Size(157, 21);
@@ -728,7 +743,7 @@
             // 
             this.si_indexstring3.Enabled = false;
             this.si_indexstring3.ID = null;
-            this.si_indexstring3.Location = new System.Drawing.Point(355, 486);
+            this.si_indexstring3.Location = new System.Drawing.Point(616, 486);
             this.si_indexstring3.Name = "si_indexstring3";
             this.si_indexstring3.Size = new System.Drawing.Size(157, 21);
             this.si_indexstring3.Str = null;
@@ -739,7 +754,7 @@
             // si_length3
             // 
             this.si_length3.Enabled = false;
-            this.si_length3.Location = new System.Drawing.Point(616, 486);
+            this.si_length3.Location = new System.Drawing.Point(831, 486);
             this.si_length3.Name = "si_length3";
             this.si_length3.Negative = false;
             this.si_length3.Size = new System.Drawing.Size(157, 21);
@@ -748,7 +763,7 @@
             // si_index3
             // 
             this.si_index3.Enabled = false;
-            this.si_index3.Location = new System.Drawing.Point(100, 486);
+            this.si_index3.Location = new System.Drawing.Point(355, 486);
             this.si_index3.Name = "si_index3";
             this.si_index3.Negative = false;
             this.si_index3.Size = new System.Drawing.Size(157, 21);
@@ -758,7 +773,7 @@
             // 
             this.si_indexstring2.Enabled = false;
             this.si_indexstring2.ID = null;
-            this.si_indexstring2.Location = new System.Drawing.Point(355, 264);
+            this.si_indexstring2.Location = new System.Drawing.Point(616, 265);
             this.si_indexstring2.Name = "si_indexstring2";
             this.si_indexstring2.Size = new System.Drawing.Size(157, 21);
             this.si_indexstring2.Str = null;
@@ -769,7 +784,7 @@
             // si_length2
             // 
             this.si_length2.Enabled = false;
-            this.si_length2.Location = new System.Drawing.Point(616, 264);
+            this.si_length2.Location = new System.Drawing.Point(831, 265);
             this.si_length2.Name = "si_length2";
             this.si_length2.Negative = false;
             this.si_length2.Size = new System.Drawing.Size(157, 21);
@@ -778,7 +793,7 @@
             // si_index2
             // 
             this.si_index2.Enabled = false;
-            this.si_index2.Location = new System.Drawing.Point(100, 264);
+            this.si_index2.Location = new System.Drawing.Point(353, 265);
             this.si_index2.Name = "si_index2";
             this.si_index2.Negative = false;
             this.si_index2.Size = new System.Drawing.Size(157, 21);
@@ -788,7 +803,7 @@
             // 
             this.si_indexstring1.Enabled = false;
             this.si_indexstring1.ID = null;
-            this.si_indexstring1.Location = new System.Drawing.Point(355, 373);
+            this.si_indexstring1.Location = new System.Drawing.Point(616, 372);
             this.si_indexstring1.Name = "si_indexstring1";
             this.si_indexstring1.Size = new System.Drawing.Size(157, 21);
             this.si_indexstring1.Str = null;
@@ -799,7 +814,7 @@
             // si_index1
             // 
             this.si_index1.Enabled = false;
-            this.si_index1.Location = new System.Drawing.Point(100, 373);
+            this.si_index1.Location = new System.Drawing.Point(355, 372);
             this.si_index1.Name = "si_index1";
             this.si_index1.Negative = false;
             this.si_index1.Size = new System.Drawing.Size(157, 21);
@@ -1009,7 +1024,7 @@
             // si_length1
             // 
             this.si_length1.Enabled = false;
-            this.si_length1.Location = new System.Drawing.Point(616, 373);
+            this.si_length1.Location = new System.Drawing.Point(831, 372);
             this.si_length1.Name = "si_length1";
             this.si_length1.Negative = false;
             this.si_length1.Size = new System.Drawing.Size(157, 21);
@@ -1147,7 +1162,7 @@
             // 
             this.si_indexstring5.Enabled = false;
             this.si_indexstring5.ID = null;
-            this.si_indexstring5.Location = new System.Drawing.Point(355, 594);
+            this.si_indexstring5.Location = new System.Drawing.Point(616, 594);
             this.si_indexstring5.Name = "si_indexstring5";
             this.si_indexstring5.Size = new System.Drawing.Size(157, 21);
             this.si_indexstring5.Str = null;
@@ -1160,7 +1175,7 @@
             this.si_indexstring5_label.AutoSize = true;
             this.si_indexstring5_label.BackColor = System.Drawing.Color.Transparent;
             this.si_indexstring5_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.si_indexstring5_label.Location = new System.Drawing.Point(268, 594);
+            this.si_indexstring5_label.Location = new System.Drawing.Point(518, 594);
             this.si_indexstring5_label.Name = "si_indexstring5_label";
             this.si_indexstring5_label.Size = new System.Drawing.Size(74, 21);
             this.si_indexstring5_label.TabIndex = 133;
@@ -1169,7 +1184,7 @@
             // si_length5
             // 
             this.si_length5.Enabled = false;
-            this.si_length5.Location = new System.Drawing.Point(616, 594);
+            this.si_length5.Location = new System.Drawing.Point(831, 594);
             this.si_length5.Name = "si_length5";
             this.si_length5.Negative = false;
             this.si_length5.Size = new System.Drawing.Size(157, 21);
@@ -1180,7 +1195,7 @@
             this.si_length5_label.AutoSize = true;
             this.si_length5_label.BackColor = System.Drawing.Color.Transparent;
             this.si_length5_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.si_length5_label.Location = new System.Drawing.Point(518, 594);
+            this.si_length5_label.Location = new System.Drawing.Point(783, 594);
             this.si_length5_label.Name = "si_length5_label";
             this.si_length5_label.Size = new System.Drawing.Size(42, 21);
             this.si_length5_label.TabIndex = 131;
@@ -1189,7 +1204,7 @@
             // si_index5
             // 
             this.si_index5.Enabled = false;
-            this.si_index5.Location = new System.Drawing.Point(100, 594);
+            this.si_index5.Location = new System.Drawing.Point(355, 594);
             this.si_index5.Name = "si_index5";
             this.si_index5.Negative = false;
             this.si_index5.Size = new System.Drawing.Size(157, 21);
@@ -1200,7 +1215,7 @@
             this.si_index5_label.AutoSize = true;
             this.si_index5_label.BackColor = System.Drawing.Color.Transparent;
             this.si_index5_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.si_index5_label.Location = new System.Drawing.Point(20, 594);
+            this.si_index5_label.Location = new System.Drawing.Point(268, 594);
             this.si_index5_label.Name = "si_index5_label";
             this.si_index5_label.Size = new System.Drawing.Size(74, 21);
             this.si_index5_label.TabIndex = 129;
@@ -1315,11 +1330,136 @@
             this.si_type5.Text = "品牌";
             this.si_type5.UseVisualStyleBackColor = true;
             // 
+            // si_innerdetno4
+            // 
+            this.si_innerdetno4.Enabled = false;
+            this.si_innerdetno4.ID = null;
+            this.si_innerdetno4.Location = new System.Drawing.Point(100, 174);
+            this.si_innerdetno4.Name = "si_innerdetno4";
+            this.si_innerdetno4.Size = new System.Drawing.Size(157, 21);
+            this.si_innerdetno4.Str = null;
+            this.si_innerdetno4.Str1 = null;
+            this.si_innerdetno4.Str2 = null;
+            this.si_innerdetno4.TabIndex = 139;
+            // 
+            // si_innerdetno4_label
+            // 
+            this.si_innerdetno4_label.AutoSize = true;
+            this.si_innerdetno4_label.BackColor = System.Drawing.Color.Transparent;
+            this.si_innerdetno4_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.si_innerdetno4_label.Location = new System.Drawing.Point(20, 174);
+            this.si_innerdetno4_label.Name = "si_innerdetno4_label";
+            this.si_innerdetno4_label.Size = new System.Drawing.Size(74, 21);
+            this.si_innerdetno4_label.TabIndex = 138;
+            this.si_innerdetno4_label.Text = "同项次序";
+            // 
+            // si_innerdetno2
+            // 
+            this.si_innerdetno2.Enabled = false;
+            this.si_innerdetno2.ID = null;
+            this.si_innerdetno2.Location = new System.Drawing.Point(98, 265);
+            this.si_innerdetno2.Name = "si_innerdetno2";
+            this.si_innerdetno2.Size = new System.Drawing.Size(157, 21);
+            this.si_innerdetno2.Str = null;
+            this.si_innerdetno2.Str1 = null;
+            this.si_innerdetno2.Str2 = null;
+            this.si_innerdetno2.TabIndex = 141;
+            // 
+            // si_innerdetno2_label
+            // 
+            this.si_innerdetno2_label.AutoSize = true;
+            this.si_innerdetno2_label.BackColor = System.Drawing.Color.Transparent;
+            this.si_innerdetno2_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.si_innerdetno2_label.Location = new System.Drawing.Point(18, 265);
+            this.si_innerdetno2_label.Name = "si_innerdetno2_label";
+            this.si_innerdetno2_label.Size = new System.Drawing.Size(74, 21);
+            this.si_innerdetno2_label.TabIndex = 140;
+            this.si_innerdetno2_label.Text = "同项次序";
+            // 
+            // si_innerdetno1
+            // 
+            this.si_innerdetno1.Enabled = false;
+            this.si_innerdetno1.ID = null;
+            this.si_innerdetno1.Location = new System.Drawing.Point(100, 372);
+            this.si_innerdetno1.Name = "si_innerdetno1";
+            this.si_innerdetno1.Size = new System.Drawing.Size(157, 21);
+            this.si_innerdetno1.Str = null;
+            this.si_innerdetno1.Str1 = null;
+            this.si_innerdetno1.Str2 = null;
+            this.si_innerdetno1.TabIndex = 143;
+            // 
+            // si_innerdetno1_label
+            // 
+            this.si_innerdetno1_label.AutoSize = true;
+            this.si_innerdetno1_label.BackColor = System.Drawing.Color.Transparent;
+            this.si_innerdetno1_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.si_innerdetno1_label.Location = new System.Drawing.Point(20, 372);
+            this.si_innerdetno1_label.Name = "si_innerdetno1_label";
+            this.si_innerdetno1_label.Size = new System.Drawing.Size(74, 21);
+            this.si_innerdetno1_label.TabIndex = 142;
+            this.si_innerdetno1_label.Text = "同项次序";
+            // 
+            // si_innerdetno3
+            // 
+            this.si_innerdetno3.Enabled = false;
+            this.si_innerdetno3.ID = null;
+            this.si_innerdetno3.Location = new System.Drawing.Point(100, 482);
+            this.si_innerdetno3.Name = "si_innerdetno3";
+            this.si_innerdetno3.Size = new System.Drawing.Size(157, 21);
+            this.si_innerdetno3.Str = null;
+            this.si_innerdetno3.Str1 = null;
+            this.si_innerdetno3.Str2 = null;
+            this.si_innerdetno3.TabIndex = 145;
+            // 
+            // si_innerdetno3_label
+            // 
+            this.si_innerdetno3_label.AutoSize = true;
+            this.si_innerdetno3_label.BackColor = System.Drawing.Color.Transparent;
+            this.si_innerdetno3_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.si_innerdetno3_label.Location = new System.Drawing.Point(20, 482);
+            this.si_innerdetno3_label.Name = "si_innerdetno3_label";
+            this.si_innerdetno3_label.Size = new System.Drawing.Size(74, 21);
+            this.si_innerdetno3_label.TabIndex = 144;
+            this.si_innerdetno3_label.Text = "同项次序";
+            // 
+            // si_innerdetno5
+            // 
+            this.si_innerdetno5.Enabled = false;
+            this.si_innerdetno5.ID = null;
+            this.si_innerdetno5.Location = new System.Drawing.Point(100, 594);
+            this.si_innerdetno5.Name = "si_innerdetno5";
+            this.si_innerdetno5.Size = new System.Drawing.Size(157, 21);
+            this.si_innerdetno5.Str = null;
+            this.si_innerdetno5.Str1 = null;
+            this.si_innerdetno5.Str2 = null;
+            this.si_innerdetno5.TabIndex = 147;
+            // 
+            // si_innerdetno5_label
+            // 
+            this.si_innerdetno5_label.AutoSize = true;
+            this.si_innerdetno5_label.BackColor = System.Drawing.Color.Transparent;
+            this.si_innerdetno5_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.si_innerdetno5_label.Location = new System.Drawing.Point(20, 594);
+            this.si_innerdetno5_label.Name = "si_innerdetno5_label";
+            this.si_innerdetno5_label.Size = new System.Drawing.Size(74, 21);
+            this.si_innerdetno5_label.TabIndex = 146;
+            this.si_innerdetno5_label.Text = "同项次序";
+            // 
             // 采集策略
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1082, 634);
+            this.Controls.Add(this.si_innerdetno5);
+            this.Controls.Add(this.si_innerdetno5_label);
+            this.Controls.Add(this.si_innerdetno3);
+            this.Controls.Add(this.si_innerdetno3_label);
+            this.Controls.Add(this.si_innerdetno1);
+            this.Controls.Add(this.si_innerdetno1_label);
+            this.Controls.Add(this.si_innerdetno2);
+            this.Controls.Add(this.si_innerdetno2_label);
+            this.Controls.Add(this.si_innerdetno4);
+            this.Controls.Add(this.si_innerdetno4_label);
             this.Controls.Add(this.si_expressionitem5_label);
             this.Controls.Add(this.si_expressionitem5);
             this.Controls.Add(this.si_id5);
@@ -1535,5 +1675,15 @@
         private CustomControl.EnterTextBox si_expression5;
         private System.Windows.Forms.Label si_expression5_label;
         private System.Windows.Forms.CheckBox si_type5;
+        private CustomControl.EnterTextBox si_innerdetno4;
+        private System.Windows.Forms.Label si_innerdetno4_label;
+        private CustomControl.EnterTextBox si_innerdetno2;
+        private System.Windows.Forms.Label si_innerdetno2_label;
+        private CustomControl.EnterTextBox si_innerdetno1;
+        private System.Windows.Forms.Label si_innerdetno1_label;
+        private CustomControl.EnterTextBox si_innerdetno3;
+        private System.Windows.Forms.Label si_innerdetno3_label;
+        private CustomControl.EnterTextBox si_innerdetno5;
+        private System.Windows.Forms.Label si_innerdetno5_label;
     }
 }

+ 6 - 3
UAS-出货标签管理/采集策略.cs

@@ -88,7 +88,7 @@ namespace UAS_LabelMachine
                             Enable = 1;
                         }
                         sql.Clear();
-                        sql.Append("update scanitem set si_item='" + Controls["si_item" + i].Text + "',si_detno='" + Controls["si_detno" + i].Text + "',");
+                        sql.Append("update scanitem set si_innerdetno='" + Controls["si_innerdetno" + i].Text + "',si_item='" + Controls["si_item" + i].Text + "',si_detno='" + Controls["si_detno" + i].Text + "',");
                         sql.Append("si_index='" + Controls["si_index" + i].Text + "',si_indexstring='" + Controls["si_indexstring" + i].Text + "',");
                         sql.Append("si_kind='" + Controls["si_kind" + i].Text + "', si_length='" + Controls["si_length" + i].Text + "',si_expressionitem='" + Controls["si_expressionitem" + i].Text + "',");
                         sql.Append("si_expression=:si_expression,si_enable=" + Enable + " where si_id=" + Controls["si_id" + i].Text);
@@ -119,9 +119,9 @@ namespace UAS_LabelMachine
                         }
                         string si_id = dh.GetSEQ("scanitem_seq");
                         sql.Clear();
-                        sql.Append("insert into scanitem(si_id,si_sgid,si_detno,si_item,si_kind,si_indexstring,si_index,si_expressionitem,si_expression,si_enable) values(" + si_id + "," + sg_id1);
+                        sql.Append("insert into scanitem(si_id,si_sgid,si_detno,si_item,si_kind,si_indexstring,si_index,si_expressionitem,si_expression,si_enable,si_innerdetno) values(" + si_id + "," + sg_id1);
                         sql.Append(",'" + Controls["si_detno" + i].Text + "','" + Controls["si_item" + i].Text + "','" + Controls["si_kind" + i].Text + "',");
-                        sql.Append("'" + Controls["si_indexstring" + i].Text + "','" + Controls["si_index" + i].Text + "','" + Controls["si_expressionitem" + i].Text + "',:si_expression," + Enable + ")");
+                        sql.Append("'" + Controls["si_indexstring" + i].Text + "','" + Controls["si_index" + i].Text + "','" + Controls["si_expressionitem" + i].Text + "',:si_expression," + Enable + ",'" + Controls["si_innerdetno" + i].Text + "')");
                         dh.ExecuteSql(sql.ToString(), "insert", new string[] { Controls["si_expression" + i].Text });
                         Controls["si_id" + i].Text = si_id;
                     }
@@ -187,6 +187,7 @@ namespace UAS_LabelMachine
                 Controls["si_index" + i].Enabled = true;
                 Controls["si_indexstring" + i].Enabled = true;
                 Controls["si_length" + i].Enabled = true;
+                Controls["si_innerdetno" + i].Enabled = true;
             }
             else
             {
@@ -198,6 +199,7 @@ namespace UAS_LabelMachine
                 Controls["si_index" + i].Enabled = false;
                 Controls["si_indexstring" + i].Enabled = false;
                 Controls["si_length" + i].Enabled = false;
+                Controls["si_innerdetno" + i].Enabled = false;
             }
         }
 
@@ -231,6 +233,7 @@ namespace UAS_LabelMachine
                                 Controls["si_item" + j].Text = dt.Rows[i]["si_item"].ToString();
                                 Controls["si_kind" + j].Text = dt.Rows[i]["si_kind"].ToString();
                                 Controls["si_length" + j].Text = dt.Rows[i]["si_length"].ToString();
+                                Controls["si_innerdetno" + j].Text = dt.Rows[i]["si_innerdetno"].ToString();
                                 Controls["si_expression" + j].Text = dt.Rows[i]["si_expression"].ToString();
                                 Controls["si_expressionitem" + j].Text = dt.Rows[i]["si_expressionitem"].ToString();
                             }

+ 5 - 0
UAS_DeviceMonitor/CustomerControl/AutoDataGridControl/AutoDataGridControl.cs

@@ -14,6 +14,10 @@ namespace UAS_DeviceMonitor.CustomerControl.AutoDataGridControl
         //记录初始化的SQL,防止条件重复拼接
         string firstsql;
 
+        public delegate void OnDataRefresh(object sender, EventArgs e);
+
+        public event OnDataRefresh DataRefresh;
+
         DataHelper dh = new DataHelper();
         //获取数据的SQL
         public string GetDataSQL
@@ -129,6 +133,7 @@ namespace UAS_DeviceMonitor.CustomerControl.AutoDataGridControl
                 DataSource = dt;
                 getDataSQL = firstsql;
             }
+            DataRefresh?.Invoke(new object(), new EventArgs());
         }
     }
 }

+ 5 - 7
UAS_DeviceMonitor/CustomerControl/Button/ButtonDeleteRow.cs

@@ -39,20 +39,18 @@ namespace UAS_DeviceMonitor.CustomerControl.Button
         {
             if (grid != null)
             {
-                List<string> DeleteID = new List<string>();
                 GridView view = grid.MainView as GridView;
-                for (int i = 0; i < grid.RowCount; i++)
+                int[] DeleteID = view.GetSelectedRows();
+                for (int i = 0; i < DeleteID.Length; i++)
                 {
-                    string Checked = view.GetRowCellValue(i, view.Name.ToUpper() + "CHOOSE").ToString().ToUpper();
-                    if (Checked != "0")
-                        DeleteID.Add(view.GetRowCellValue(i, grid.ID.ToUpper()).ToString());
+                    DeleteID[i] = int.Parse(view.GetRowCellValue(i, grid.ID.ToUpper()).ToString());
                 }
-                if (DeleteID.Count > 0)
+                if (DeleteID.Length > 0)
                 {
                     DialogResult result = XtraMessageBox.Show("确认删除", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
                     if (result.ToString() == "Yes")
                     {
-                        SystemInf.dh.DeleteDataByID(grid.TableName, grid.ID, DeleteID.ToArray());
+                        SystemInf.dh.DeleteDataByID(grid.TableName, grid.ID, DeleteID);
                         grid.RefreshData();
                     }
                 }

+ 2 - 2
UAS_DeviceMonitor/CustomerControl/PagingControl/PageControl.cs

@@ -58,7 +58,7 @@ namespace UAS_DeviceMonitor.CustomerControl.PagingControl
                 case "GoFormerPage":
                     if (currentpage == 1)
                     {
-                        MessageBox.Show("当前已经是第一页");
+                        XtraMessageBox.Show("当前已经是第一页", "提示");
                         return;
                     }
                     CurrentPage.Text = (currentpage - 1).ToString();
@@ -67,7 +67,7 @@ namespace UAS_DeviceMonitor.CustomerControl.PagingControl
                 case "GoNextPage":
                     if (currentpage.ToString() == PageCount.Text)
                     {
-                        MessageBox.Show("当前已经是最后一页");
+                        XtraMessageBox.Show("当前已经是最后一页", "提示");
                         return;
                     }
                     CurrentPage.Text = (currentpage + 1).ToString();

+ 27 - 28
UAS_DeviceMonitor/Main.Designer.cs

@@ -33,7 +33,6 @@ namespace UAS_DeviceMonitor
         /// </summary>
         private void InitializeComponent()
         {
-            this.components = new System.ComponentModel.Container();
             System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Main));
             this.RibbonNav = new DevExpress.XtraBars.Ribbon.RibbonControl();
             this.ButtonDeviceList = new DevExpress.XtraBars.BarButtonItem();
@@ -69,7 +68,6 @@ namespace UAS_DeviceMonitor
             this.ButtonSaveCommand = new UAS_DeviceMonitor.CustomerControl.Button.ButtonSaveGrid();
             this.GridCommandSetting = new UAS_DeviceMonitor.CustomerControl.AutoDataGridControl.AutoDataGridControl();
             this.GridViewCommandSet = new UAS_DeviceMonitor.CustomerControl.GridViewWithSerialNum.GridViewWithSerialNum();
-            this.GRIDVIEWCOMMANDSETCHOOSE = new DevExpress.XtraGrid.Columns.GridColumn();
             this.CheckEditCommandSet = new DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit();
             this.dc_id = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dc_code = new DevExpress.XtraGrid.Columns.GridColumn();
@@ -85,7 +83,6 @@ namespace UAS_DeviceMonitor
             this.ButtonStartPolling = new DevExpress.XtraEditors.SimpleButton();
             this.GridPollingSetting = new UAS_DeviceMonitor.CustomerControl.AutoDataGridControl.AutoDataGridControl();
             this.GridViewPollSetting = new UAS_DeviceMonitor.CustomerControl.GridViewWithSerialNum.GridViewWithSerialNum();
-            this.GRIDVIEWPOLLSETTINGCHOOSE = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dpc_enableCheckEdit = new DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit();
             this.dpc_id = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dpc_decode = new DevExpress.XtraGrid.Columns.GridColumn();
@@ -98,6 +95,7 @@ namespace UAS_DeviceMonitor
             this.dpc_enable = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dpc_status = new DevExpress.XtraGrid.Columns.GridColumn();
             this.dpc_remark = new DevExpress.XtraGrid.Columns.GridColumn();
+            this.POLLSETTINGSTATUSCOLUMN = new DevExpress.XtraGrid.Columns.GridColumn();
             this.PagePolling = new DevExpress.XtraTab.XtraTabPage();
             this.ButtonAddPolling = new UAS_DeviceMonitor.CustomerControl.Button.ButtonAddRow();
             this.ButtonDeletePolling = new UAS_DeviceMonitor.CustomerControl.Button.ButtonDeleteRow();
@@ -110,7 +108,6 @@ namespace UAS_DeviceMonitor
             this.pl_type = new DevExpress.XtraGrid.Columns.GridColumn();
             this.pl_dccode = new DevExpress.XtraGrid.Columns.GridColumn();
             this.pl_remark = new DevExpress.XtraGrid.Columns.GridColumn();
-            this.PollingTimer = new System.Windows.Forms.Timer(this.components);
             ((System.ComponentModel.ISupportInitialize)(this.RibbonNav)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.MainTabControl)).BeginInit();
             this.MainTabControl.SuspendLayout();
@@ -489,7 +486,6 @@ namespace UAS_DeviceMonitor
             // GridViewCommandSet
             // 
             this.GridViewCommandSet.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
-            this.GRIDVIEWCOMMANDSETCHOOSE,
             this.dc_id,
             this.dc_code,
             this.dc_name,
@@ -498,15 +494,7 @@ namespace UAS_DeviceMonitor
             this.GridViewCommandSet.IndicatorWidth = 30;
             this.GridViewCommandSet.Name = "GridViewCommandSet";
             this.GridViewCommandSet.OptionsSelection.MultiSelect = true;
-            // 
-            // GRIDVIEWCOMMANDSETCHOOSE
-            // 
-            this.GRIDVIEWCOMMANDSETCHOOSE.Caption = "勾选";
-            this.GRIDVIEWCOMMANDSETCHOOSE.ColumnEdit = this.CheckEditCommandSet;
-            this.GRIDVIEWCOMMANDSETCHOOSE.FieldName = "GRIDVIEWCOMMANDSETCHOOSE";
-            this.GRIDVIEWCOMMANDSETCHOOSE.Name = "GRIDVIEWCOMMANDSETCHOOSE";
-            this.GRIDVIEWCOMMANDSETCHOOSE.Visible = true;
-            this.GRIDVIEWCOMMANDSETCHOOSE.VisibleIndex = 0;
+            this.GridViewCommandSet.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CheckBoxRowSelect;
             // 
             // CheckEditCommandSet
             // 
@@ -607,6 +595,7 @@ namespace UAS_DeviceMonitor
             // 
             // ButtonPausePolling
             // 
+            this.ButtonPausePolling.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
             this.ButtonPausePolling.Location = new System.Drawing.Point(734, 549);
             this.ButtonPausePolling.Name = "ButtonPausePolling";
             this.ButtonPausePolling.Size = new System.Drawing.Size(75, 23);
@@ -616,6 +605,7 @@ namespace UAS_DeviceMonitor
             // 
             // ButtonStartPolling
             // 
+            this.ButtonStartPolling.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
             this.ButtonStartPolling.Location = new System.Drawing.Point(653, 549);
             this.ButtonStartPolling.Name = "ButtonStartPolling";
             this.ButtonStartPolling.Size = new System.Drawing.Size(75, 23);
@@ -649,7 +639,6 @@ namespace UAS_DeviceMonitor
             // GridViewPollSetting
             // 
             this.GridViewPollSetting.Columns.AddRange(new DevExpress.XtraGrid.Columns.GridColumn[] {
-            this.GRIDVIEWPOLLSETTINGCHOOSE,
             this.dpc_id,
             this.dpc_decode,
             this.dpc_plcode,
@@ -659,22 +648,15 @@ namespace UAS_DeviceMonitor
             this.dpc_function,
             this.dpc_enable,
             this.dpc_status,
-            this.dpc_remark});
+            this.dpc_remark,
+            this.POLLSETTINGSTATUSCOLUMN});
             this.GridViewPollSetting.GridControl = this.GridPollingSetting;
             this.GridViewPollSetting.IndicatorWidth = 30;
             this.GridViewPollSetting.Name = "GridViewPollSetting";
             this.GridViewPollSetting.OptionsSelection.MultiSelect = true;
+            this.GridViewPollSetting.OptionsSelection.MultiSelectMode = DevExpress.XtraGrid.Views.Grid.GridMultiSelectMode.CheckBoxRowSelect;
             this.GridViewPollSetting.CellValueChanging += new DevExpress.XtraGrid.Views.Base.CellValueChangedEventHandler(this.GridViewPollSetting_CellValueChanging);
             // 
-            // GRIDVIEWPOLLSETTINGCHOOSE
-            // 
-            this.GRIDVIEWPOLLSETTINGCHOOSE.Caption = "选择";
-            this.GRIDVIEWPOLLSETTINGCHOOSE.ColumnEdit = this.dpc_enableCheckEdit;
-            this.GRIDVIEWPOLLSETTINGCHOOSE.FieldName = "GRIDVIEWPOLLSETTINGCHOOSE";
-            this.GRIDVIEWPOLLSETTINGCHOOSE.Name = "GRIDVIEWPOLLSETTINGCHOOSE";
-            this.GRIDVIEWPOLLSETTINGCHOOSE.Visible = true;
-            this.GRIDVIEWPOLLSETTINGCHOOSE.VisibleIndex = 0;
-            // 
             // dpc_enableCheckEdit
             // 
             this.dpc_enableCheckEdit.AutoHeight = false;
@@ -698,6 +680,7 @@ namespace UAS_DeviceMonitor
             this.dpc_decode.Name = "dpc_decode";
             this.dpc_decode.Visible = true;
             this.dpc_decode.VisibleIndex = 1;
+            this.dpc_decode.Width = 90;
             // 
             // dpc_plcode
             // 
@@ -706,6 +689,7 @@ namespace UAS_DeviceMonitor
             this.dpc_plcode.Name = "dpc_plcode";
             this.dpc_plcode.Visible = true;
             this.dpc_plcode.VisibleIndex = 2;
+            this.dpc_plcode.Width = 90;
             // 
             // dpc_plname
             // 
@@ -714,6 +698,7 @@ namespace UAS_DeviceMonitor
             this.dpc_plname.Name = "dpc_plname";
             this.dpc_plname.Visible = true;
             this.dpc_plname.VisibleIndex = 3;
+            this.dpc_plname.Width = 90;
             // 
             // dpc_interval
             // 
@@ -722,6 +707,7 @@ namespace UAS_DeviceMonitor
             this.dpc_interval.Name = "dpc_interval";
             this.dpc_interval.Visible = true;
             this.dpc_interval.VisibleIndex = 4;
+            this.dpc_interval.Width = 90;
             // 
             // dpc_dccode
             // 
@@ -731,6 +717,7 @@ namespace UAS_DeviceMonitor
             this.dpc_dccode.Name = "dpc_dccode";
             this.dpc_dccode.Visible = true;
             this.dpc_dccode.VisibleIndex = 5;
+            this.dpc_dccode.Width = 90;
             // 
             // PollingSetItemLookUpEdit
             // 
@@ -749,6 +736,7 @@ namespace UAS_DeviceMonitor
             this.dpc_function.Name = "dpc_function";
             this.dpc_function.Visible = true;
             this.dpc_function.VisibleIndex = 6;
+            this.dpc_function.Width = 90;
             // 
             // dpc_enable
             // 
@@ -758,6 +746,7 @@ namespace UAS_DeviceMonitor
             this.dpc_enable.Name = "dpc_enable";
             this.dpc_enable.Visible = true;
             this.dpc_enable.VisibleIndex = 7;
+            this.dpc_enable.Width = 90;
             // 
             // dpc_status
             // 
@@ -766,6 +755,7 @@ namespace UAS_DeviceMonitor
             this.dpc_status.Name = "dpc_status";
             this.dpc_status.Visible = true;
             this.dpc_status.VisibleIndex = 8;
+            this.dpc_status.Width = 90;
             // 
             // dpc_remark
             // 
@@ -774,6 +764,17 @@ namespace UAS_DeviceMonitor
             this.dpc_remark.Name = "dpc_remark";
             this.dpc_remark.Visible = true;
             this.dpc_remark.VisibleIndex = 9;
+            this.dpc_remark.Width = 87;
+            // 
+            // POLLSETTINGSTATUSCOLUMN
+            // 
+            this.POLLSETTINGSTATUSCOLUMN.Caption = "运行状态";
+            this.POLLSETTINGSTATUSCOLUMN.FieldName = "POLLSETTINGSTATUSCOLUMN";
+            this.POLLSETTINGSTATUSCOLUMN.Name = "POLLSETTINGSTATUSCOLUMN";
+            this.POLLSETTINGSTATUSCOLUMN.OptionsColumn.ReadOnly = true;
+            this.POLLSETTINGSTATUSCOLUMN.Visible = true;
+            this.POLLSETTINGSTATUSCOLUMN.VisibleIndex = 10;
+            this.POLLSETTINGSTATUSCOLUMN.Width = 98;
             // 
             // PagePolling
             // 
@@ -1000,7 +1001,6 @@ namespace UAS_DeviceMonitor
         private GridViewWithSerialNum GridViewPollSetting;
         private LabelControl Brand_label;
         private ComboBoxEdit Brand;
-        private DevExpress.XtraGrid.Columns.GridColumn GRIDVIEWCOMMANDSETCHOOSE;
         private DevExpress.XtraEditors.Repository.RepositoryItemCheckEdit CheckEditCommandSet;
         private CustomerControl.Button.ButtonDeleteRow ButtonDeleteCommand;
         private CustomerControl.Button.ButtonDeleteRow ButtonDeletePolling;
@@ -1012,7 +1012,6 @@ namespace UAS_DeviceMonitor
         private CustomerControl.Button.ButtonAddRow ButtonNewCommandSet;
         private CustomerControl.Button.ButtonSaveGrid ButtonSaveCommandSet;
         private DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit PollingSetItemLookUpEdit;
-        private System.Windows.Forms.Timer PollingTimer;
-        private DevExpress.XtraGrid.Columns.GridColumn GRIDVIEWPOLLSETTINGCHOOSE;
+        private DevExpress.XtraGrid.Columns.GridColumn POLLSETTINGSTATUSCOLUMN;
     }
 }

+ 58 - 11
UAS_DeviceMonitor/Main.cs

@@ -6,13 +6,9 @@ using System.Text;
 using UAS_DeviceMonitor.Entity;
 using UAS_DeviceMonitor.Device.Command;
 using UAS_DeviceMonitor.PublicMethod;
-using DevExpress.XtraEditors;
-using DevExpress.XtraGrid;
 using DevExpress.XtraGrid.Views.Grid;
-using System.Timers;
-using System.Threading;
-using System.Threading.Tasks;
 using System.Collections.Generic;
+using System.Drawing;
 
 namespace UAS_DeviceMonitor
 {
@@ -21,12 +17,14 @@ namespace UAS_DeviceMonitor
 
         StringBuilder sql = new StringBuilder();
 
+
         public Main()
         {
             SystemInf.dh = new DataHelper();
             InitializeComponent();
             dpc_enableCheckEdit.QueryCheckStateByValue += CheckedEdit_QueryCheckStateByValue;
             CheckEditCommandSet.QueryCheckStateByValue += CheckedEdit_QueryCheckStateByValue;
+            GridViewPollSetting.RowCellStyle += GridViewPollSetting_RowCellStyle;
         }
 
         private void Main_Load(object sender, EventArgs e)
@@ -43,10 +41,11 @@ namespace UAS_DeviceMonitor
             ButtonSavePolling.Grid = GridPolling;
             ButtonAddPolling.Grid = GridPolling;
             //轮询配置界面
-            GridPollingSetting.GetDataSQL = "SELECT 0 GRIDVIEWPOLLSETTINGCHOOSE,DPC_ID,DPC_DECODE ,DPC_PLCODE ,DPC_PLNAME ,DPC_INTERVAL ,DPC_DCCODE ,DPC_FUNCTION , DPC_ENABLE,DPC_STATUS ,DPC_REMARK FROM DEVICEPOLLINGCONFIG";
+            GridPollingSetting.GetDataSQL = "SELECT '' POLLSETTINGSTATUSCOLUMN,DPC_ID,DPC_DECODE ,DPC_PLCODE ,DPC_PLNAME ,DPC_INTERVAL ,DPC_DCCODE ,DPC_FUNCTION , DPC_ENABLE,DPC_STATUS ,DPC_REMARK FROM DEVICEPOLLINGCONFIG";
             GridPollingSetting.ID = "DPC_ID";
             GridPollingSetting.TableName = "DEVICEPOLLINGCONFIG";
             GridPollingSetting.InsertSQL = "insert into DEVICEPOLLINGCONFIG(DPC_ID,DPC_DECODE ,DPC_PLCODE ,DPC_PLNAME ,DPC_INTERVAL ,DPC_DCCODE ,DPC_FUNCTION , DPC_ENABLE,DPC_STATUS ,DPC_REMARK) values(DEVICEPOLLINGCONFIG_seq.nextval,:DPC_DECODE ,:DPC_PLCODE ,:DPC_PLNAME ,:DPC_INTERVAL ,:DPC_DCCODE ,:DPC_FUNCTION , :DPC_ENABLE,:DPC_STATUS ,:DPC_REMARK)";
+        
             ButtonSaveCommandSet.Grid = GridPollingSetting;
             ButtonNewCommandSet.Grid = GridPollingSetting;
             ButtonDeleteCommandSet.Grid = GridPollingSetting;
@@ -58,6 +57,8 @@ namespace UAS_DeviceMonitor
             GridCommandSetting.InsertSQL = "insert into devicecommand(dc_id,dc_code,dc_name,dc_command) values(devicecommand_seq.nextval,:dc_code,:dc_name,:dc_command)";
             ButtonSaveCommand.Grid = GridCommandSetting;
             ButtonDeleteCommand.Grid = GridCommandSetting;
+
+            Ptime = new Dictionary<int, PollingTimer>();
         }
 
         #region 界面通用事件
@@ -171,6 +172,11 @@ namespace UAS_DeviceMonitor
         #region PagePollingSetting业务代码
 
         PollingTask pt = new PollingTask();
+        /// <summary>
+        /// 绘制轮询配置状态栏
+        /// </summary>
+        List<int> PollSettingPaintRowIndex = new List<int>();
+
         private void ButtonStartPolling_Click(object sender, EventArgs e)
         {
             GridView grid = GridViewPollSetting;
@@ -183,23 +189,55 @@ namespace UAS_DeviceMonitor
                 pl.Enable = GridViewPollSetting.GetRowCellValue(i, "DPC_ENABLE").ToString() != "0";
                 pl.Code = GridViewPollSetting.GetRowCellValue(i, "DPC_PLCODE").ToString();
                 if (pl.Enable)
+                {
                     pt.AddTask(RunTask, pl);
+                    //添加到状态为运行的行
+                    PollSettingPaintRowIndex.Add(i);
+                    GridPollingSetting.Focus();
+                }
+            }
+        }
+
+        /// <summary>
+        /// 绘制轮询状态
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void GridViewPollSetting_RowCellStyle(object sender, RowCellStyleEventArgs e)
+        {
+            if (e.Column.Name.ToUpper() == "POLLSETTINGSTATUSCOLUMN" && PollSettingPaintRowIndex.Contains(e.RowHandle))
+            {
+                e.Appearance.BackColor = Color.Green;
             }
         }
 
-        Dictionary<int, PollingTimer> Ptime = new Dictionary<int, PollingTimer>();
+        Dictionary<int, PollingTimer> Ptime;
 
         private void RunTask(object i)
         {
             PollingTimer timer = new PollingTimer();
             Polling pl = (Polling)i;
             timer.Polling = i;
-            timer.Interval = pl.Interval * 1000;
+            timer.Interval = pl.Interval * 5000;
             timer.Elapsed += Timer_Tick;
-            Ptime.Add(pl.Id, timer);
             timer.Start();
+            try
+            {
+                if (!Ptime.ContainsKey(pl.Id))
+                    Ptime.Add(pl.Id, timer);
+            }
+            catch (Exception)
+            {
+                if (!Ptime.ContainsKey(pl.Id))
+                    Ptime.Add(pl.Id, timer);
+            }
         }
 
+        /// <summary>
+        /// 轮询执行的业务
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
         private void Timer_Tick(object sender, EventArgs e)
         {
             PollingTimer timer = (PollingTimer)sender;
@@ -208,20 +246,27 @@ namespace UAS_DeviceMonitor
             Console.WriteLine(Decode);
         }
 
+        /// <summary>
+        /// 停止全部轮询
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
         private void ButtonPausePolling_Click(object sender, EventArgs e)
         {
             foreach (var item in Ptime)
             {
                 item.Value.Stop();
             }
+            PollSettingPaintRowIndex.Clear();
+            GridPollingSetting.Focus();
+            Ptime.Clear();
         }
 
         private void GridViewPollSetting_CellValueChanging(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
         {
+            GridViewPollSetting.SetRowCellValue(e.RowHandle, e.Column, e.Value);
             if (e.Column.Name.ToUpper() == "DPC_ENABLE")
             {
-                GridViewPollSetting.SetRowCellValue(e.RowHandle, e.Column, e.Value);
-                Console.WriteLine(GridViewPollSetting.GetRowCellValue(e.RowHandle, "DPC_ENABLE").ToString());
                 if (GridViewPollSetting.GetRowCellValue(e.RowHandle, "DPC_ENABLE").ToString() == "0")
                 {
                     int id = int.Parse(GridViewPollSetting.GetRowCellValue(e.RowHandle, "DPC_ID").ToString());
@@ -229,6 +274,7 @@ namespace UAS_DeviceMonitor
                     {
                         Ptime[id].Stop();
                         Ptime.Remove(id);
+                        PollSettingPaintRowIndex.Remove(e.RowHandle);
                     }
                 }
                 else
@@ -241,6 +287,7 @@ namespace UAS_DeviceMonitor
                     pl.Code = GridViewPollSetting.GetRowCellValue(e.RowHandle, "DPC_PLCODE").ToString();
                     if (pl.Enable)
                         pt.AddTask(RunTask, pl);
+                    PollSettingPaintRowIndex.Add(e.RowHandle);
                 }
             }
         }

+ 0 - 3
UAS_DeviceMonitor/Main.resx

@@ -453,9 +453,6 @@
         geLKUTtl+f8gY//Axjn6F8f+AXtHGV3GT+qTmOL/wFqMAAAAAElFTkSuQmCC
 </value>
   </data>
-  <metadata name="PollingTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>17, 17</value>
-  </metadata>
   <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         AAABAAEAQEAAAAEAIAAoQgAAFgAAACgAAABAAAAAgAAAAAEAIAAAAAAAAEAAABMLAAATCwAAAAAAAAAA

+ 0 - 3
UAS_DeviceMonitor/Program.cs

@@ -54,9 +54,6 @@ namespace UAS_DeviceMonitor
                     doc.AppendChild(xeRoot);
                     doc.Save(SystemInf.CacheFilePath);
                 }
-                //创建记录打印进程的文件
-                FileStream fas = new FileStream(SystemInf.CacheFolder + "lblprocess.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite);
-                fas.Close();
                 DevExpress.Skins.SkinManager.EnableFormSkins();
                 if (principal.IsInRole(WindowsBuiltInRole.Administrator))
                     Application.Run(new Main());

+ 20 - 0
UAS_DeviceMonitor/Properties/Resources.Designer.cs

@@ -60,6 +60,26 @@ namespace UAS_DeviceMonitor.Properties {
             }
         }
         
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap check_16px_1137507_easyicon_net {
+            get {
+                object obj = ResourceManager.GetObject("check_16px_1137507_easyicon_net", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
+        /// <summary>
+        ///   查找 System.Drawing.Bitmap 类型的本地化资源。
+        /// </summary>
+        internal static System.Drawing.Bitmap close_24px_1069872_easyicon_net {
+            get {
+                object obj = ResourceManager.GetObject("close_24px_1069872_easyicon_net", resourceCulture);
+                return ((System.Drawing.Bitmap)(obj));
+            }
+        }
+        
         /// <summary>
         ///   查找 System.Drawing.Bitmap 类型的本地化资源。
         /// </summary>

+ 6 - 0
UAS_DeviceMonitor/Properties/Resources.resx

@@ -136,4 +136,10 @@
   <data name="U_Letter_64px_1121581_easyicon_net" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>..\Resources\U_Letter_64px_1121581_easyicon.net.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
   </data>
+  <data name="check_16px_1137507_easyicon_net" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\check_16px_1137507_easyicon.net.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
+  <data name="close_24px_1069872_easyicon_net" type="System.Resources.ResXFileRef, System.Windows.Forms">
+    <value>..\Resources\close_24px_1069872_easyicon.net.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
+  </data>
 </root>

+ 6 - 5
UAS_DeviceMonitor/PublicMethod/PollingTask.cs

@@ -40,11 +40,12 @@ namespace UAS_DeviceMonitor.PublicMethod
         /// <returns></returns>
         public void AddTask(Action<object> action, object obj)
         {
-            Polling pl = (Polling)obj;
-            if (!InTask.ContainsKey(pl.Code))
-            {
-                InTask.Add(pl.Code, Task.Factory.StartNew(action, obj));
-            }
+            Task.Factory.StartNew(action, obj);
+            //Polling pl = (Polling)obj;
+            //if (!InTask.ContainsKey(pl.Code))
+            //{
+            //    InTask.Add(pl.Code, Task.Factory.StartNew(action, obj));
+            //}
         }
 
         /// 添加一系列任务

BIN
UAS_DeviceMonitor/Resources/check_16px_1137507_easyicon.net.png


BIN
UAS_DeviceMonitor/Resources/close_24px_1069872_easyicon.net.png


+ 2 - 0
UAS_DeviceMonitor/UAS_DeviceMonitor.csproj

@@ -175,6 +175,8 @@
     <None Include="Resources\U_Letter_72px_1121581_easyicon.net.png" />
     <None Include="Resources\netstatus_tx_64px_18991_easyicon.net.png" />
     <None Include="Resources\U_Letter_64px_1121581_easyicon.net.ico" />
+    <None Include="Resources\close_24px_1069872_easyicon.net.png" />
+    <None Include="Resources\check_16px_1137507_easyicon.net.png" />
     <Content Include="Tool\Oracle.ManagedDataAccess.dll" />
   </ItemGroup>
   <ItemGroup>