Ver Fonte

睿德SMT计数扫描

callm há 2 horas atrás
pai
commit
1be6cf0183
2 ficheiros alterados com 46 adições e 8 exclusões
  1. 28 0
      FileWatcher/AutoSMTRXY.Designer.cs
  2. 18 8
      FileWatcher/AutoSMTRXY.cs

+ 28 - 0
FileWatcher/AutoSMTRXY.Designer.cs

@@ -44,6 +44,8 @@
             this.ma_code = new FileWatcher.SearchTextBox();
             this.li_code = new FileWatcher.SearchTextBox();
             this.RemindVoice = new System.Windows.Forms.CheckBox();
+            this.SN = new System.Windows.Forms.RadioButton();
+            this.Counter = new System.Windows.Forms.RadioButton();
             this.SuspendLayout();
             // 
             // OperateResult
@@ -221,11 +223,35 @@
             this.RemindVoice.Text = "开启提示音";
             this.RemindVoice.UseVisualStyleBackColor = true;
             // 
+            // SN
+            // 
+            this.SN.AutoSize = true;
+            this.SN.Location = new System.Drawing.Point(221, 486);
+            this.SN.Name = "SN";
+            this.SN.Size = new System.Drawing.Size(113, 28);
+            this.SN.TabIndex = 37;
+            this.SN.Text = "扫描SN";
+            this.SN.UseVisualStyleBackColor = true;
+            // 
+            // Counter
+            // 
+            this.Counter.AutoSize = true;
+            this.Counter.Checked = true;
+            this.Counter.Location = new System.Drawing.Point(357, 486);
+            this.Counter.Name = "Counter";
+            this.Counter.Size = new System.Drawing.Size(113, 28);
+            this.Counter.TabIndex = 36;
+            this.Counter.TabStop = true;
+            this.Counter.Text = "计数器";
+            this.Counter.UseVisualStyleBackColor = true;
+            // 
             // AutoSMTRXY
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1443, 640);
+            this.Controls.Add(this.SN);
+            this.Controls.Add(this.Counter);
             this.Controls.Add(this.RemindVoice);
             this.Controls.Add(this.label2);
             this.Controls.Add(this.ms_sncode);
@@ -267,6 +293,8 @@
         private System.Windows.Forms.Label label2;
         private System.Windows.Forms.Timer RemindTimer;
         private System.Windows.Forms.CheckBox RemindVoice;
+        private System.Windows.Forms.RadioButton SN;
+        private System.Windows.Forms.RadioButton Counter;
     }
 }
 

+ 18 - 8
FileWatcher/AutoSMTRXY.cs

@@ -62,7 +62,6 @@ namespace FileWatcher
             BaseUtil.SetFormValue(this.Controls, Dbfind);
         }
 
-
         private void Form1_Load(object sender, EventArgs e)
         {
             CheckForIllegalCrossThreadCalls = false;
@@ -88,7 +87,6 @@ namespace FileWatcher
             catch (Exception ex) { MessageBox.Show(ex.Message); }
             RemindTimer.Start();
         }
-
         private void ConnectDB()
         {
             dh = new DataHelper();
@@ -110,16 +108,15 @@ namespace FileWatcher
             li_code.Condition = "";
             li_code.DbChange += nr_rule_DBChange;
         }
+
         SerialPort serialPort1 = new SerialPort();
 
         string nextLine;
 
-
         private void Clean_Click(object sender, EventArgs e)
         {
             OperateResult.Clear();
         }
-
         private void Form1_FormClosing(object sender, FormClosingEventArgs e)
         {
             string ExitConfirm = MessageBox.Show(this, "确认退出?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
@@ -189,10 +186,23 @@ namespace FileWatcher
         {
             if (e.KeyCode == Keys.Enter)
             {
-                BaseUtil.PlaySound("站位SMT240011-1-6 当前物料数量剩余100");
-                BaseUtil.PlaySound("站位SMT240011-2-5 当前物料数量剩余200");
-                BaseUtil.PlaySound("站位SMT240011-3-3 当前物料数量剩余160");
-                BaseUtil.PlaySound("站位SMT240011-5-6 当前物料数量剩余180");
+                if (dh.CheckExist("make", "ma_code='" + ma_code.Text + "'"))
+                {
+                    MessageBox.Show("工单号不存在");
+                    return;
+                }
+                if (dh.CheckExist("line", "li_code='" + li_code.Text + "'"))
+                {
+                    MessageBox.Show("线别不存在");
+                    return;
+                }
+            }
+
+            DataTable dt = (DataTable)dh.ExecuteSql("select MSL_MAINSN from makesnlist where msl_sncode='" + ms_sncode.Text + "'", "select");
+            if (dt.Rows.Count > 0)
+            {
+                string MainSN = dt.Rows[0]["MSL_MAINS"].ToString();
+
             }
         }