diff --git a/Rs.SkyLine/Flow/SubFlow/NgTrayToInputTrayFlow.cs b/Rs.SkyLine/Flow/SubFlow/NgTrayToInputTrayFlow.cs new file mode 100644 index 0000000..0a500c2 --- /dev/null +++ b/Rs.SkyLine/Flow/SubFlow/NgTrayToInputTrayFlow.cs @@ -0,0 +1,66 @@ +using Rs.AutoDischarge.V3.Flow; +using Rs.MotionPlat.Commom; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Rs.MotionPlat.Flow.SubFlow +{ + + enum ENgTrayToInputTrayFlowStep + { + + } + + /// + /// 重测NG时把Ng料盘搬运到Input料仓 + /// + public class NgTrayToInputTrayFlow + { + private NgTrayToInputTrayFlow() { } + + private static NgTrayToInputTrayFlow instance; + public static NgTrayToInputTrayFlow Instance + { + get + { + if(instance==null) + instance = new NgTrayToInputTrayFlow(); + return instance; + } + } + + public void MoveToInput() + { + if (Ops.IsOn("2号料仓料盘到位光电检测")) + { + TakeTrayFlow.Instance.Take(ETrayType.Input, ETrayType.Empty1, null, null, () => { + Task.Run(() => { + StockManager.Instance.GetStock(ETrayType.Empty1).Unload(EStockTrayUnLoadMode.Whole, null); + }); + }); + } + while (true) + { + + if(Ops.IsOff("4号料仓料盘到位光电检测"))//如果ng料仓处没有料盘 + { + if(Ops.IsOn("4号料仓缺盘光电检测"))//如果还有需要搬运的料盘 + { + StockManager.Instance.GetStock(ETrayType.Ng).Load(EStockTrayLoadMode.Whole, null); + } + else + { + //没有料盘需要搬运了 + break; + } + } + TakeTrayFlow.Instance.Take(ETrayType.Ng, ETrayType.Input, null, null, () =>{ + StockManager.Instance.GetStock(ETrayType.Input).Unload(EStockTrayUnLoadMode.Whole, null); + }); + } + } + } +} diff --git a/Rs.SkyLine/Rs.SkyLine.csproj b/Rs.SkyLine/Rs.SkyLine.csproj index 2835ad3..52ee3d6 100644 --- a/Rs.SkyLine/Rs.SkyLine.csproj +++ b/Rs.SkyLine/Rs.SkyLine.csproj @@ -212,6 +212,7 @@ + diff --git a/Rs.SkyLine/TestFrm.Designer.cs b/Rs.SkyLine/TestFrm.Designer.cs index bb3194a..76a9b76 100644 --- a/Rs.SkyLine/TestFrm.Designer.cs +++ b/Rs.SkyLine/TestFrm.Designer.cs @@ -56,6 +56,7 @@ this.button20 = new System.Windows.Forms.Button(); this.button21 = new System.Windows.Forms.Button(); this.button22 = new System.Windows.Forms.Button(); + this.button23 = new System.Windows.Forms.Button(); this.SuspendLayout(); // // btnTurnoverSlotException @@ -338,11 +339,22 @@ this.button22.UseVisualStyleBackColor = true; this.button22.Click += new System.EventHandler(this.button22_Click); // + // button23 + // + this.button23.Location = new System.Drawing.Point(202, 96); + this.button23.Name = "button23"; + this.button23.Size = new System.Drawing.Size(152, 37); + this.button23.TabIndex = 2; + this.button23.Text = "NgToInput"; + this.button23.UseVisualStyleBackColor = true; + this.button23.Click += new System.EventHandler(this.button23_Click); + // // TestFrm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1336, 854); + this.Controls.Add(this.button23); this.Controls.Add(this.button14); this.Controls.Add(this.button12); this.Controls.Add(this.button11); @@ -407,5 +419,6 @@ private System.Windows.Forms.Button button20; private System.Windows.Forms.Button button21; private System.Windows.Forms.Button button22; + private System.Windows.Forms.Button button23; } } \ No newline at end of file diff --git a/Rs.SkyLine/TestFrm.cs b/Rs.SkyLine/TestFrm.cs index 1fb6259..de83089 100644 --- a/Rs.SkyLine/TestFrm.cs +++ b/Rs.SkyLine/TestFrm.cs @@ -203,5 +203,12 @@ namespace Rs.MotionPlat string alarminfo = string.Format(AlarmCollection.GetAlarm(AlarmConstID.扫码失败), "3"); MsgBox.ShowDialog(AlarmConstID.扫码失败, alarminfo, ETipButton.Retry| ETipButton.Cancel); } + + private void button23_Click(object sender, EventArgs e) + { + Task.Run(() => { + NgTrayToInputTrayFlow.Instance.MoveToInput(); + }); + } } }