|
@@ -87,6 +87,21 @@ namespace Venus_RT.Modules
|
|
|
cycleCount = (int)objs[1];
|
|
|
}
|
|
|
|
|
|
+ // temp debug
|
|
|
+ {
|
|
|
+ for(int i = 0; i < _sourceSlotNumber; i ++)
|
|
|
+ {
|
|
|
+ WaferManager.Instance.CreateWafer(_sourceModule, i, Aitex.Core.Common.WaferStatus.Normal);
|
|
|
+ WaferManager.Instance.DeleteWafer(_destinationModule, i);
|
|
|
+ }
|
|
|
+
|
|
|
+ WaferManager.Instance.DeleteWafer(ModuleName.TM, 0);
|
|
|
+ WaferManager.Instance.DeleteWafer(ModuleName.TM, 1);
|
|
|
+ WaferManager.Instance.DeleteWafer(ModuleName.PMA, 0);
|
|
|
+ WaferManager.Instance.DeleteWafer(ModuleName.PMB, 0);
|
|
|
+ }
|
|
|
+ // temp debug
|
|
|
+
|
|
|
return Runner.Start(Module, Name);
|
|
|
}
|
|
|
|
|
@@ -134,6 +149,21 @@ namespace Venus_RT.Modules
|
|
|
return slots;
|
|
|
}
|
|
|
|
|
|
+ List<int> GetReadyOutSlot(ModuleName module, int slotCount)
|
|
|
+ {
|
|
|
+ List<int> slots = new List<int>();
|
|
|
+ for (int i = 0; i < slotCount; i++)
|
|
|
+ {
|
|
|
+ if (WaferManager.Instance.CheckHasWafer(module, i))
|
|
|
+ slots.Add(i);
|
|
|
+
|
|
|
+ if (slots.Count >= 2)
|
|
|
+ return slots;
|
|
|
+ }
|
|
|
+
|
|
|
+ return slots;
|
|
|
+ }
|
|
|
+
|
|
|
List<ModuleName> GetReadyOutPMs()
|
|
|
{
|
|
|
List<ModuleName> outpm = new List<ModuleName>();
|
|
@@ -174,29 +204,24 @@ namespace Venus_RT.Modules
|
|
|
|
|
|
private bool ReturnBack()
|
|
|
{
|
|
|
- if (IsModuleAvailable(_sourceModule) && IsModuleAvailable(_destinationModule))
|
|
|
+ if (IsModuleAvailable(_sourceModule) && IsModuleAvailable(_destinationModule) && _TMRobot.IsAvailable)
|
|
|
{
|
|
|
- if (_ReturnWafers.Count == 0)
|
|
|
- return _TMRobot.IsAvailable;
|
|
|
-
|
|
|
|
|
|
var InSlots = GetReadyInSlot(_sourceModule, _sourceSlotNumber);
|
|
|
- foreach (var slot in InSlots)
|
|
|
+ var OutSlots = GetReadyOutSlot(_destinationModule, _destinationSlotNumber);
|
|
|
+ if (InSlots.Count == 0 || OutSlots.Count == 0)
|
|
|
+ return true;
|
|
|
+
|
|
|
+ Queue<MoveItem> items = new Queue<MoveItem>();
|
|
|
+ for(int i = 0; i < Math.Min(InSlots.Count, OutSlots.Count); i++)
|
|
|
{
|
|
|
- if(_ReturnWafers.Count > 0)
|
|
|
- {
|
|
|
- var move = _ReturnWafers.Dequeue();
|
|
|
- move.DestinationSlot = slot;
|
|
|
- _runningItems.Enqueue(move);
|
|
|
- }
|
|
|
+ items.Enqueue(new MoveItem(_destinationModule, OutSlots[i], _sourceModule, InSlots[i], (Hand)i));
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
- if (_TMRobot.IsAvailable && _runningItems.Count > 0)
|
|
|
- {
|
|
|
- if(_TMRobot.PostMoveItems(_runningItems.ToArray()))
|
|
|
- _runningItems.Clear();
|
|
|
+ if(items.Count > 0)
|
|
|
+ {
|
|
|
+ _TMRobot.PostMoveItems(items.ToArray());
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return false;
|