|
@@ -2415,15 +2415,20 @@ namespace Venus_RT.Modules
|
|
|
|
|
|
private bool IsMovingActionsDone(List<MoveItem> actions)
|
|
|
{
|
|
|
+ bool CheckWaferExistence(ModuleName mod, int slot)
|
|
|
+ {
|
|
|
+ return ModuleHelper.IsLoadPort(mod) ? WaferManager.Instance.CheckHasWafer(mod, slot) : _lstWaferTasks.Exists(wt => wt.currentMod == mod && wt.currentSlot == slot);
|
|
|
+ }
|
|
|
+
|
|
|
if(actions.Count == 1)
|
|
|
{
|
|
|
- if (_lstWaferTasks.Exists(wt => wt.currentMod == actions.First().SourceModule && wt.currentSlot == actions.First().SourceSlot) ||
|
|
|
- !_lstWaferTasks.Exists(wt => wt.currentMod == actions.First().DestinationModule && wt.currentSlot == actions.First().DestinationSlot) &&
|
|
|
- !ModuleHelper.IsLoadPort(actions.First().DestinationModule))
|
|
|
+ if ( CheckWaferExistence(actions.First().SourceModule, actions.First().SourceSlot) ||
|
|
|
+ !CheckWaferExistence(actions.First().DestinationModule, actions.First().DestinationSlot) )
|
|
|
return false;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ // initialize all the wafer existance before move
|
|
|
var slotWafers = new Dictionary<KeyValuePair<ModuleName, int>, bool>();
|
|
|
foreach (var ac in actions)
|
|
|
{
|
|
@@ -2468,10 +2473,7 @@ namespace Venus_RT.Modules
|
|
|
|
|
|
foreach (var slot in slotWafers)
|
|
|
{
|
|
|
- if (ModuleHelper.IsLoadPort(slot.Key.Key) && slot.Value)
|
|
|
- continue;
|
|
|
-
|
|
|
- if (slot.Value != _lstWaferTasks.Exists(wt => wt.currentMod == slot.Key.Key && wt.currentSlot == slot.Key.Value))
|
|
|
+ if (slot.Value != CheckWaferExistence(slot.Key.Key, slot.Key.Value))
|
|
|
return false;
|
|
|
}
|
|
|
}
|