Sfoglia il codice sorgente

调整清零和检测

yhluo 1 giorno fa
parent
commit
6148d9fb64
2 ha cambiato i file con 120 aggiunte e 109 eliminazioni
  1. 104 107
      FileWatcher/AutoSMTRXY.Designer.cs
  2. 16 2
      FileWatcher/AutoSMTRXY.cs

+ 104 - 107
FileWatcher/AutoSMTRXY.Designer.cs

@@ -74,20 +74,20 @@
             // 
             // 
             // OperateResult
             // OperateResult
             // 
             // 
-            this.OperateResult.Location = new System.Drawing.Point(1208, 23);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.OperateResult.Location = new System.Drawing.Point(906, 17);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.OperateResult.Name = "OperateResult";
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(489, 535);
+            this.OperateResult.Size = new System.Drawing.Size(368, 402);
             this.OperateResult.TabIndex = 7;
             this.OperateResult.TabIndex = 7;
             this.OperateResult.Text = "";
             this.OperateResult.Text = "";
             // 
             // 
             // Clean
             // Clean
             // 
             // 
             this.Clean.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Clean.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Clean.Location = new System.Drawing.Point(1380, 580);
-            this.Clean.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.Clean.Location = new System.Drawing.Point(1035, 435);
+            this.Clean.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Clean.Name = "Clean";
             this.Clean.Name = "Clean";
-            this.Clean.Size = new System.Drawing.Size(112, 48);
+            this.Clean.Size = new System.Drawing.Size(84, 36);
             this.Clean.TabIndex = 8;
             this.Clean.TabIndex = 8;
             this.Clean.Text = "清除";
             this.Clean.Text = "清除";
             this.Clean.UseVisualStyleBackColor = true;
             this.Clean.UseVisualStyleBackColor = true;
@@ -97,10 +97,9 @@
             // 
             // 
             this.MakeCode_lable.AutoSize = true;
             this.MakeCode_lable.AutoSize = true;
             this.MakeCode_lable.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.MakeCode_lable.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.MakeCode_lable.Location = new System.Drawing.Point(51, 120);
-            this.MakeCode_lable.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.MakeCode_lable.Location = new System.Drawing.Point(38, 90);
             this.MakeCode_lable.Name = "MakeCode_lable";
             this.MakeCode_lable.Name = "MakeCode_lable";
-            this.MakeCode_lable.Size = new System.Drawing.Size(104, 38);
+            this.MakeCode_lable.Size = new System.Drawing.Size(79, 30);
             this.MakeCode_lable.TabIndex = 12;
             this.MakeCode_lable.TabIndex = 12;
             this.MakeCode_lable.Text = "工单号";
             this.MakeCode_lable.Text = "工单号";
             // 
             // 
@@ -111,19 +110,19 @@
             this.Type.Items.AddRange(new object[] {
             this.Type.Items.AddRange(new object[] {
             "投入",
             "投入",
             "产出"});
             "产出"});
-            this.Type.Location = new System.Drawing.Point(221, 267);
+            this.Type.Location = new System.Drawing.Point(166, 200);
+            this.Type.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.Type.Name = "Type";
             this.Type.Name = "Type";
-            this.Type.Size = new System.Drawing.Size(436, 32);
+            this.Type.Size = new System.Drawing.Size(328, 26);
             this.Type.TabIndex = 18;
             this.Type.TabIndex = 18;
             // 
             // 
             // label1
             // label1
             // 
             // 
             this.label1.AutoSize = true;
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label1.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(51, 261);
-            this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label1.Location = new System.Drawing.Point(38, 196);
             this.label1.Name = "label1";
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(75, 38);
+            this.label1.Size = new System.Drawing.Size(57, 30);
             this.label1.TabIndex = 19;
             this.label1.TabIndex = 19;
             this.label1.Text = "类型";
             this.label1.Text = "类型";
             // 
             // 
@@ -132,29 +131,29 @@
             this.AutoStart.AutoSize = true;
             this.AutoStart.AutoSize = true;
             this.AutoStart.Checked = true;
             this.AutoStart.Checked = true;
             this.AutoStart.CheckState = System.Windows.Forms.CheckState.Checked;
             this.AutoStart.CheckState = System.Windows.Forms.CheckState.Checked;
-            this.AutoStart.Location = new System.Drawing.Point(695, 127);
+            this.AutoStart.Location = new System.Drawing.Point(521, 95);
+            this.AutoStart.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.AutoStart.Name = "AutoStart";
             this.AutoStart.Name = "AutoStart";
-            this.AutoStart.Size = new System.Drawing.Size(186, 28);
+            this.AutoStart.Size = new System.Drawing.Size(142, 22);
             this.AutoStart.TabIndex = 20;
             this.AutoStart.TabIndex = 20;
             this.AutoStart.Text = "开机自动启动";
             this.AutoStart.Text = "开机自动启动";
             this.AutoStart.UseVisualStyleBackColor = true;
             this.AutoStart.UseVisualStyleBackColor = true;
             // 
             // 
             // NowQTY
             // NowQTY
             // 
             // 
-            this.NowQTY.Location = new System.Drawing.Point(221, 346);
-            this.NowQTY.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.NowQTY.Location = new System.Drawing.Point(166, 260);
+            this.NowQTY.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.NowQTY.Name = "NowQTY";
             this.NowQTY.Name = "NowQTY";
-            this.NowQTY.Size = new System.Drawing.Size(146, 35);
+            this.NowQTY.Size = new System.Drawing.Size(110, 28);
             this.NowQTY.TabIndex = 26;
             this.NowQTY.TabIndex = 26;
             // 
             // 
             // label4
             // label4
             // 
             // 
             this.label4.AutoSize = true;
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label4.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(51, 343);
-            this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label4.Location = new System.Drawing.Point(38, 257);
             this.label4.Name = "label4";
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(133, 38);
+            this.label4.Size = new System.Drawing.Size(101, 30);
             this.label4.TabIndex = 25;
             this.label4.TabIndex = 25;
             this.label4.Text = "当前计数";
             this.label4.Text = "当前计数";
             // 
             // 
@@ -162,9 +161,10 @@
             // 
             // 
             this.label5.AutoSize = true;
             this.label5.AutoSize = true;
             this.label5.Font = new System.Drawing.Font("微软雅黑", 12F);
             this.label5.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label5.Location = new System.Drawing.Point(51, 191);
+            this.label5.Location = new System.Drawing.Point(38, 143);
+            this.label5.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
             this.label5.Name = "label5";
             this.label5.Name = "label5";
-            this.label5.Size = new System.Drawing.Size(82, 41);
+            this.label5.Size = new System.Drawing.Size(62, 31);
             this.label5.TabIndex = 27;
             this.label5.TabIndex = 27;
             this.label5.Text = "线别";
             this.label5.Text = "线别";
             // 
             // 
@@ -172,10 +172,9 @@
             // 
             // 
             this.label2.AutoSize = true;
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label2.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(51, 424);
-            this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label2.Location = new System.Drawing.Point(38, 318);
             this.label2.Name = "label2";
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(104, 38);
+            this.label2.Size = new System.Drawing.Size(79, 30);
             this.label2.TabIndex = 34;
             this.label2.TabIndex = 34;
             this.label2.Text = "录入框";
             this.label2.Text = "录入框";
             // 
             // 
@@ -189,9 +188,10 @@
             this.RemindVoice.AutoSize = true;
             this.RemindVoice.AutoSize = true;
             this.RemindVoice.Checked = true;
             this.RemindVoice.Checked = true;
             this.RemindVoice.CheckState = System.Windows.Forms.CheckState.Checked;
             this.RemindVoice.CheckState = System.Windows.Forms.CheckState.Checked;
-            this.RemindVoice.Location = new System.Drawing.Point(695, 191);
+            this.RemindVoice.Location = new System.Drawing.Point(521, 143);
+            this.RemindVoice.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.RemindVoice.Name = "RemindVoice";
             this.RemindVoice.Name = "RemindVoice";
-            this.RemindVoice.Size = new System.Drawing.Size(162, 28);
+            this.RemindVoice.Size = new System.Drawing.Size(124, 22);
             this.RemindVoice.TabIndex = 35;
             this.RemindVoice.TabIndex = 35;
             this.RemindVoice.Text = "开启提示音";
             this.RemindVoice.Text = "开启提示音";
             this.RemindVoice.UseVisualStyleBackColor = true;
             this.RemindVoice.UseVisualStyleBackColor = true;
@@ -199,9 +199,10 @@
             // SN
             // SN
             // 
             // 
             this.SN.AutoSize = true;
             this.SN.AutoSize = true;
-            this.SN.Location = new System.Drawing.Point(221, 486);
+            this.SN.Location = new System.Drawing.Point(166, 364);
+            this.SN.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.SN.Name = "SN";
             this.SN.Name = "SN";
-            this.SN.Size = new System.Drawing.Size(113, 28);
+            this.SN.Size = new System.Drawing.Size(87, 22);
             this.SN.TabIndex = 37;
             this.SN.TabIndex = 37;
             this.SN.Text = "扫描SN";
             this.SN.Text = "扫描SN";
             this.SN.UseVisualStyleBackColor = true;
             this.SN.UseVisualStyleBackColor = true;
@@ -211,9 +212,10 @@
             // 
             // 
             this.Counter.AutoSize = true;
             this.Counter.AutoSize = true;
             this.Counter.Checked = true;
             this.Counter.Checked = true;
-            this.Counter.Location = new System.Drawing.Point(357, 486);
+            this.Counter.Location = new System.Drawing.Point(268, 364);
+            this.Counter.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.Counter.Name = "Counter";
             this.Counter.Name = "Counter";
-            this.Counter.Size = new System.Drawing.Size(113, 28);
+            this.Counter.Size = new System.Drawing.Size(87, 22);
             this.Counter.TabIndex = 36;
             this.Counter.TabIndex = 36;
             this.Counter.TabStop = true;
             this.Counter.TabStop = true;
             this.Counter.Text = "计数器";
             this.Counter.Text = "计数器";
@@ -224,10 +226,10 @@
             // 
             // 
             this.StopWatch.Enabled = false;
             this.StopWatch.Enabled = false;
             this.StopWatch.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.StopWatch.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.StopWatch.Location = new System.Drawing.Point(402, 552);
-            this.StopWatch.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.StopWatch.Location = new System.Drawing.Point(302, 414);
+            this.StopWatch.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.StopWatch.Name = "StopWatch";
             this.StopWatch.Name = "StopWatch";
-            this.StopWatch.Size = new System.Drawing.Size(128, 56);
+            this.StopWatch.Size = new System.Drawing.Size(96, 42);
             this.StopWatch.TabIndex = 39;
             this.StopWatch.TabIndex = 39;
             this.StopWatch.Text = "停止监控";
             this.StopWatch.Text = "停止监控";
             this.StopWatch.UseVisualStyleBackColor = true;
             this.StopWatch.UseVisualStyleBackColor = true;
@@ -236,10 +238,10 @@
             // StartWatch
             // StartWatch
             // 
             // 
             this.StartWatch.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.StartWatch.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.StartWatch.Location = new System.Drawing.Point(206, 552);
-            this.StartWatch.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.StartWatch.Location = new System.Drawing.Point(154, 414);
+            this.StartWatch.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.StartWatch.Name = "StartWatch";
             this.StartWatch.Name = "StartWatch";
-            this.StartWatch.Size = new System.Drawing.Size(128, 56);
+            this.StartWatch.Size = new System.Drawing.Size(96, 42);
             this.StartWatch.TabIndex = 38;
             this.StartWatch.TabIndex = 38;
             this.StartWatch.Text = "开始监控";
             this.StartWatch.Text = "开始监控";
             this.StartWatch.UseVisualStyleBackColor = true;
             this.StartWatch.UseVisualStyleBackColor = true;
@@ -248,10 +250,10 @@
             // BaudRate
             // BaudRate
             // 
             // 
             this.BaudRate.Enabled = false;
             this.BaudRate.Enabled = false;
-            this.BaudRate.Location = new System.Drawing.Point(1020, 229);
-            this.BaudRate.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.BaudRate.Location = new System.Drawing.Point(765, 172);
+            this.BaudRate.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.BaudRate.Name = "BaudRate";
             this.BaudRate.Name = "BaudRate";
-            this.BaudRate.Size = new System.Drawing.Size(146, 35);
+            this.BaudRate.Size = new System.Drawing.Size(110, 28);
             this.BaudRate.TabIndex = 43;
             this.BaudRate.TabIndex = 43;
             this.BaudRate.Text = "9600";
             this.BaudRate.Text = "9600";
             // 
             // 
@@ -259,10 +261,9 @@
             // 
             // 
             this.BaudRate_label.AutoSize = true;
             this.BaudRate_label.AutoSize = true;
             this.BaudRate_label.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.BaudRate_label.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.BaudRate_label.Location = new System.Drawing.Point(896, 229);
-            this.BaudRate_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.BaudRate_label.Location = new System.Drawing.Point(672, 172);
             this.BaudRate_label.Name = "BaudRate_label";
             this.BaudRate_label.Name = "BaudRate_label";
-            this.BaudRate_label.Size = new System.Drawing.Size(104, 38);
+            this.BaudRate_label.Size = new System.Drawing.Size(79, 30);
             this.BaudRate_label.TabIndex = 42;
             this.BaudRate_label.TabIndex = 42;
             this.BaudRate_label.Text = "波特率";
             this.BaudRate_label.Text = "波特率";
             // 
             // 
@@ -270,10 +271,9 @@
             // 
             // 
             this.ComPort_label.AutoSize = true;
             this.ComPort_label.AutoSize = true;
             this.ComPort_label.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.ComPort_label.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ComPort_label.Location = new System.Drawing.Point(925, 177);
-            this.ComPort_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ComPort_label.Location = new System.Drawing.Point(694, 133);
             this.ComPort_label.Name = "ComPort_label";
             this.ComPort_label.Name = "ComPort_label";
-            this.ComPort_label.Size = new System.Drawing.Size(75, 38);
+            this.ComPort_label.Size = new System.Drawing.Size(57, 30);
             this.ComPort_label.TabIndex = 41;
             this.ComPort_label.TabIndex = 41;
             this.ComPort_label.Text = "串口";
             this.ComPort_label.Text = "串口";
             // 
             // 
@@ -284,9 +284,10 @@
             // 
             // 
             // pr_pcbacount
             // pr_pcbacount
             // 
             // 
-            this.pr_pcbacount.Location = new System.Drawing.Point(537, 346);
+            this.pr_pcbacount.Location = new System.Drawing.Point(403, 260);
+            this.pr_pcbacount.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.pr_pcbacount.Name = "pr_pcbacount";
             this.pr_pcbacount.Name = "pr_pcbacount";
-            this.pr_pcbacount.Size = new System.Drawing.Size(120, 35);
+            this.pr_pcbacount.Size = new System.Drawing.Size(90, 28);
             this.pr_pcbacount.TabIndex = 45;
             this.pr_pcbacount.TabIndex = 45;
             this.pr_pcbacount.Value = new decimal(new int[] {
             this.pr_pcbacount.Value = new decimal(new int[] {
             1,
             1,
@@ -298,81 +299,76 @@
             // 
             // 
             this.label7.AutoSize = true;
             this.label7.AutoSize = true;
             this.label7.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label7.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label7.Location = new System.Drawing.Point(409, 343);
-            this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label7.Location = new System.Drawing.Point(307, 257);
             this.label7.Name = "label7";
             this.label7.Name = "label7";
-            this.label7.Size = new System.Drawing.Size(104, 38);
+            this.label7.Size = new System.Drawing.Size(79, 30);
             this.label7.TabIndex = 44;
             this.label7.TabIndex = 44;
             this.label7.Text = "拼版数";
             this.label7.Text = "拼版数";
             // 
             // 
             // Read
             // Read
             // 
             // 
             this.Read.Enabled = false;
             this.Read.Enabled = false;
-            this.Read.Location = new System.Drawing.Point(1018, 286);
-            this.Read.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.Read.Location = new System.Drawing.Point(764, 214);
+            this.Read.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Read.Name = "Read";
             this.Read.Name = "Read";
-            this.Read.Size = new System.Drawing.Size(146, 35);
+            this.Read.Size = new System.Drawing.Size(110, 28);
             this.Read.TabIndex = 47;
             this.Read.TabIndex = 47;
             // 
             // 
             // Read_label
             // Read_label
             // 
             // 
             this.Read_label.AutoSize = true;
             this.Read_label.AutoSize = true;
             this.Read_label.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Read_label.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Read_label.Location = new System.Drawing.Point(935, 280);
-            this.Read_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.Read_label.Location = new System.Drawing.Point(701, 210);
             this.Read_label.Name = "Read_label";
             this.Read_label.Name = "Read_label";
-            this.Read_label.Size = new System.Drawing.Size(75, 38);
+            this.Read_label.Size = new System.Drawing.Size(57, 30);
             this.Read_label.TabIndex = 46;
             this.Read_label.TabIndex = 46;
             this.Read_label.Text = "读取";
             this.Read_label.Text = "读取";
             // 
             // 
             // Write
             // Write
             // 
             // 
             this.Write.Enabled = false;
             this.Write.Enabled = false;
-            this.Write.Location = new System.Drawing.Point(1018, 338);
-            this.Write.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.Write.Location = new System.Drawing.Point(764, 254);
+            this.Write.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Write.Name = "Write";
             this.Write.Name = "Write";
-            this.Write.Size = new System.Drawing.Size(146, 35);
+            this.Write.Size = new System.Drawing.Size(110, 28);
             this.Write.TabIndex = 49;
             this.Write.TabIndex = 49;
             // 
             // 
             // Write_label
             // Write_label
             // 
             // 
             this.Write_label.AutoSize = true;
             this.Write_label.AutoSize = true;
             this.Write_label.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Write_label.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Write_label.Location = new System.Drawing.Point(935, 335);
-            this.Write_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.Write_label.Location = new System.Drawing.Point(701, 251);
             this.Write_label.Name = "Write_label";
             this.Write_label.Name = "Write_label";
-            this.Write_label.Size = new System.Drawing.Size(75, 38);
+            this.Write_label.Size = new System.Drawing.Size(57, 30);
             this.Write_label.TabIndex = 48;
             this.Write_label.TabIndex = 48;
             this.Write_label.Text = "回写";
             this.Write_label.Text = "回写";
             // 
             // 
             // ToZero
             // ToZero
             // 
             // 
             this.ToZero.Enabled = false;
             this.ToZero.Enabled = false;
-            this.ToZero.Location = new System.Drawing.Point(1018, 394);
-            this.ToZero.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.ToZero.Location = new System.Drawing.Point(764, 296);
+            this.ToZero.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.ToZero.Name = "ToZero";
             this.ToZero.Name = "ToZero";
-            this.ToZero.Size = new System.Drawing.Size(146, 35);
+            this.ToZero.Size = new System.Drawing.Size(110, 28);
             this.ToZero.TabIndex = 51;
             this.ToZero.TabIndex = 51;
             // 
             // 
             // ToZero_label
             // ToZero_label
             // 
             // 
             this.ToZero_label.AutoSize = true;
             this.ToZero_label.AutoSize = true;
             this.ToZero_label.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.ToZero_label.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ToZero_label.Location = new System.Drawing.Point(935, 391);
-            this.ToZero_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ToZero_label.Location = new System.Drawing.Point(701, 293);
             this.ToZero_label.Name = "ToZero_label";
             this.ToZero_label.Name = "ToZero_label";
-            this.ToZero_label.Size = new System.Drawing.Size(75, 38);
+            this.ToZero_label.Size = new System.Drawing.Size(57, 30);
             this.ToZero_label.TabIndex = 50;
             this.ToZero_label.TabIndex = 50;
             this.ToZero_label.Text = "清零";
             this.ToZero_label.Text = "清零";
             // 
             // 
             // CleanData
             // CleanData
             // 
             // 
-            this.CleanData.Enabled = false;
             this.CleanData.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.CleanData.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.CleanData.Location = new System.Drawing.Point(595, 552);
-            this.CleanData.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.CleanData.Location = new System.Drawing.Point(446, 414);
+            this.CleanData.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.CleanData.Name = "CleanData";
             this.CleanData.Name = "CleanData";
-            this.CleanData.Size = new System.Drawing.Size(128, 56);
+            this.CleanData.Size = new System.Drawing.Size(96, 42);
             this.CleanData.TabIndex = 52;
             this.CleanData.TabIndex = 52;
             this.CleanData.Text = "计数清零";
             this.CleanData.Text = "计数清零";
             this.CleanData.UseVisualStyleBackColor = true;
             this.CleanData.UseVisualStyleBackColor = true;
@@ -381,10 +377,10 @@
             // Setting
             // Setting
             // 
             // 
             this.Setting.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.Setting.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.Setting.Location = new System.Drawing.Point(973, 23);
-            this.Setting.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.Setting.Location = new System.Drawing.Point(730, 17);
+            this.Setting.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Setting.Name = "Setting";
             this.Setting.Name = "Setting";
-            this.Setting.Size = new System.Drawing.Size(128, 56);
+            this.Setting.Size = new System.Drawing.Size(96, 42);
             this.Setting.TabIndex = 53;
             this.Setting.TabIndex = 53;
             this.Setting.Text = "设置参数";
             this.Setting.Text = "设置参数";
             this.Setting.UseVisualStyleBackColor = true;
             this.Setting.UseVisualStyleBackColor = true;
@@ -394,10 +390,9 @@
             // 
             // 
             this.CountType_label.AutoSize = true;
             this.CountType_label.AutoSize = true;
             this.CountType_label.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.CountType_label.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.CountType_label.Location = new System.Drawing.Point(880, 491);
-            this.CountType_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.CountType_label.Location = new System.Drawing.Point(660, 368);
             this.CountType_label.Name = "CountType_label";
             this.CountType_label.Name = "CountType_label";
-            this.CountType_label.Size = new System.Drawing.Size(133, 38);
+            this.CountType_label.Size = new System.Drawing.Size(101, 30);
             this.CountType_label.TabIndex = 55;
             this.CountType_label.TabIndex = 55;
             this.CountType_label.Text = "计数方式";
             this.CountType_label.Text = "计数方式";
             // 
             // 
@@ -409,58 +404,57 @@
             this.CountType.Items.AddRange(new object[] {
             this.CountType.Items.AddRange(new object[] {
             "PLC",
             "PLC",
             "计数器"});
             "计数器"});
-            this.CountType.Location = new System.Drawing.Point(1020, 497);
+            this.CountType.Location = new System.Drawing.Point(765, 373);
+            this.CountType.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
             this.CountType.Name = "CountType";
             this.CountType.Name = "CountType";
-            this.CountType.Size = new System.Drawing.Size(137, 32);
+            this.CountType.Size = new System.Drawing.Size(104, 26);
             this.CountType.TabIndex = 54;
             this.CountType.TabIndex = 54;
             // 
             // 
             // UseScan
             // UseScan
             // 
             // 
             this.UseScan.Enabled = false;
             this.UseScan.Enabled = false;
-            this.UseScan.Location = new System.Drawing.Point(1018, 445);
-            this.UseScan.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.UseScan.Location = new System.Drawing.Point(764, 334);
+            this.UseScan.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.UseScan.Name = "UseScan";
             this.UseScan.Name = "UseScan";
-            this.UseScan.Size = new System.Drawing.Size(146, 35);
+            this.UseScan.Size = new System.Drawing.Size(110, 28);
             this.UseScan.TabIndex = 57;
             this.UseScan.TabIndex = 57;
             // 
             // 
             // UseScan_label
             // UseScan_label
             // 
             // 
             this.UseScan_label.AutoSize = true;
             this.UseScan_label.AutoSize = true;
             this.UseScan_label.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.UseScan_label.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.UseScan_label.Location = new System.Drawing.Point(877, 442);
-            this.UseScan_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.UseScan_label.Location = new System.Drawing.Point(658, 332);
             this.UseScan_label.Name = "UseScan_label";
             this.UseScan_label.Name = "UseScan_label";
-            this.UseScan_label.Size = new System.Drawing.Size(133, 38);
+            this.UseScan_label.Size = new System.Drawing.Size(101, 30);
             this.UseScan_label.TabIndex = 56;
             this.UseScan_label.TabIndex = 56;
             this.UseScan_label.Text = "启用扫描";
             this.UseScan_label.Text = "启用扫描";
             // 
             // 
             // Password
             // Password
             // 
             // 
-            this.Password.Location = new System.Drawing.Point(1018, 127);
-            this.Password.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.Password.Location = new System.Drawing.Point(764, 95);
+            this.Password.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Password.Name = "Password";
             this.Password.Name = "Password";
             this.Password.PasswordChar = '*';
             this.Password.PasswordChar = '*';
-            this.Password.Size = new System.Drawing.Size(146, 35);
+            this.Password.Size = new System.Drawing.Size(110, 28);
             this.Password.TabIndex = 59;
             this.Password.TabIndex = 59;
             // 
             // 
             // label3
             // label3
             // 
             // 
             this.label3.AutoSize = true;
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.label3.Font = new System.Drawing.Font("微软雅黑", 10.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label3.Location = new System.Drawing.Point(923, 124);
-            this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.label3.Location = new System.Drawing.Point(692, 93);
             this.label3.Name = "label3";
             this.label3.Name = "label3";
-            this.label3.Size = new System.Drawing.Size(75, 38);
+            this.label3.Size = new System.Drawing.Size(57, 30);
             this.label3.TabIndex = 58;
             this.label3.TabIndex = 58;
             this.label3.Text = "密码";
             this.label3.Text = "密码";
             // 
             // 
             // ComPort
             // ComPort
             // 
             // 
             this.ComPort.Enabled = false;
             this.ComPort.Enabled = false;
-            this.ComPort.Location = new System.Drawing.Point(1018, 181);
-            this.ComPort.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.ComPort.Location = new System.Drawing.Point(764, 136);
+            this.ComPort.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
             this.ComPort.Name = "ComPort";
             this.ComPort.Name = "ComPort";
-            this.ComPort.Size = new System.Drawing.Size(148, 40);
+            this.ComPort.Size = new System.Drawing.Size(111, 30);
             this.ComPort.TabIndex = 40;
             this.ComPort.TabIndex = 40;
             // 
             // 
             // ms_sncode
             // ms_sncode
@@ -468,10 +462,11 @@
             this.ms_sncode.AllPower = null;
             this.ms_sncode.AllPower = null;
             this.ms_sncode.BackColor = System.Drawing.Color.White;
             this.ms_sncode.BackColor = System.Drawing.Color.White;
             this.ms_sncode.ID = null;
             this.ms_sncode.ID = null;
-            this.ms_sncode.Location = new System.Drawing.Point(221, 430);
+            this.ms_sncode.Location = new System.Drawing.Point(166, 322);
+            this.ms_sncode.Margin = new System.Windows.Forms.Padding(2);
             this.ms_sncode.Name = "ms_sncode";
             this.ms_sncode.Name = "ms_sncode";
             this.ms_sncode.Power = null;
             this.ms_sncode.Power = null;
-            this.ms_sncode.Size = new System.Drawing.Size(333, 35);
+            this.ms_sncode.Size = new System.Drawing.Size(251, 28);
             this.ms_sncode.Str = null;
             this.ms_sncode.Str = null;
             this.ms_sncode.Str1 = null;
             this.ms_sncode.Str1 = null;
             this.ms_sncode.Str2 = null;
             this.ms_sncode.Str2 = null;
@@ -485,13 +480,14 @@
             this.ma_code.Condition = null;
             this.ma_code.Condition = null;
             this.ma_code.DBTitle = null;
             this.ma_code.DBTitle = null;
             this.ma_code.FormName = null;
             this.ma_code.FormName = null;
-            this.ma_code.Location = new System.Drawing.Point(221, 114);
+            this.ma_code.Location = new System.Drawing.Point(166, 86);
+            this.ma_code.Margin = new System.Windows.Forms.Padding(2);
             this.ma_code.Name = "ma_code";
             this.ma_code.Name = "ma_code";
             this.ma_code.Power = null;
             this.ma_code.Power = null;
             this.ma_code.ReturnData = null;
             this.ma_code.ReturnData = null;
             this.ma_code.SelectField = null;
             this.ma_code.SelectField = null;
             this.ma_code.SetValueField = null;
             this.ma_code.SetValueField = null;
-            this.ma_code.Size = new System.Drawing.Size(436, 41);
+            this.ma_code.Size = new System.Drawing.Size(327, 31);
             this.ma_code.TabIndex = 29;
             this.ma_code.TabIndex = 29;
             this.ma_code.TableName = null;
             this.ma_code.TableName = null;
             this.ma_code.TextBoxEnable = false;
             this.ma_code.TextBoxEnable = false;
@@ -503,22 +499,23 @@
             this.li_code.Condition = null;
             this.li_code.Condition = null;
             this.li_code.DBTitle = null;
             this.li_code.DBTitle = null;
             this.li_code.FormName = null;
             this.li_code.FormName = null;
-            this.li_code.Location = new System.Drawing.Point(221, 191);
+            this.li_code.Location = new System.Drawing.Point(166, 143);
+            this.li_code.Margin = new System.Windows.Forms.Padding(2);
             this.li_code.Name = "li_code";
             this.li_code.Name = "li_code";
             this.li_code.Power = null;
             this.li_code.Power = null;
             this.li_code.ReturnData = null;
             this.li_code.ReturnData = null;
             this.li_code.SelectField = null;
             this.li_code.SelectField = null;
             this.li_code.SetValueField = null;
             this.li_code.SetValueField = null;
-            this.li_code.Size = new System.Drawing.Size(436, 41);
+            this.li_code.Size = new System.Drawing.Size(327, 31);
             this.li_code.TabIndex = 28;
             this.li_code.TabIndex = 28;
             this.li_code.TableName = null;
             this.li_code.TableName = null;
             this.li_code.TextBoxEnable = false;
             this.li_code.TextBoxEnable = false;
             // 
             // 
             // AutoSMTRXY
             // AutoSMTRXY
             // 
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1710, 640);
+            this.ClientSize = new System.Drawing.Size(1282, 480);
             this.Controls.Add(this.Password);
             this.Controls.Add(this.Password);
             this.Controls.Add(this.label3);
             this.Controls.Add(this.label3);
             this.Controls.Add(this.UseScan);
             this.Controls.Add(this.UseScan);
@@ -557,7 +554,7 @@
             this.Controls.Add(this.MakeCode_lable);
             this.Controls.Add(this.MakeCode_lable);
             this.Controls.Add(this.Clean);
             this.Controls.Add(this.Clean);
             this.Controls.Add(this.OperateResult);
             this.Controls.Add(this.OperateResult);
-            this.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
+            this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.MaximizeBox = false;
             this.MaximizeBox = false;
             this.Name = "AutoSMTRXY";
             this.Name = "AutoSMTRXY";
             this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
             this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;

+ 16 - 2
FileWatcher/AutoSMTRXY.cs

@@ -399,6 +399,7 @@ namespace FileWatcher
             StartWatch.Enabled = true;
             StartWatch.Enabled = true;
             ma_code.Enabled = true;
             ma_code.Enabled = true;
             StopWatch.Enabled = false;
             StopWatch.Enabled = false;
+            serialPort1.Close();
             OperateResult.AppendText("停止执行监控\n");
             OperateResult.AppendText("停止执行监控\n");
         }
         }
 
 
@@ -500,9 +501,17 @@ namespace FileWatcher
         private void CleanData_Click(object sender, EventArgs e)
         private void CleanData_Click(object sender, EventArgs e)
         {
         {
             string ExitConfirm = MessageBox.Show(this, "确认计数器是否置为0?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
             string ExitConfirm = MessageBox.Show(this, "确认计数器是否置为0?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
-            if (ExitConfirm != "Yes")
+            if (ExitConfirm == "Yes")
             {
             {
-                plc.Write(ToZero.Text, 1);
+                OperateResult write = plc.Write(ToZero.Text, 0);
+                if (write.IsSuccess)
+                {
+                    OperateResult.AppendText("通过,发送指令" + ToZero.Text + "写入0\n");
+                }
+                else
+                {
+                    OperateResult.AppendText("写入失败\n");
+                }
             }
             }
         }
         }
 
 
@@ -560,6 +569,11 @@ namespace FileWatcher
                 string ExitConfirm = MessageBox.Show(this, "确认切换为扫码?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
                 string ExitConfirm = MessageBox.Show(this, "确认切换为扫码?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
                 if (ExitConfirm == "Yes")
                 if (ExitConfirm == "Yes")
                 {
                 {
+                    if(plc == null)
+                    {
+                        OperateResult.AppendText("请先开始监控\n");
+                        return;
+                    }
                     OperateResult write = plc.Write(UseScan.Text, 2);
                     OperateResult write = plc.Write(UseScan.Text, 2);
                     if (write.IsSuccess)
                     if (write.IsSuccess)
                     {
                     {