|
@@ -2415,11 +2415,65 @@ namespace Venus_RT.Modules
|
|
|
|
|
|
private bool IsMovingActionsDone(List<MoveItem> actions)
|
|
|
{
|
|
|
- foreach(var ac in actions)
|
|
|
+ if(actions.Count == 1)
|
|
|
{
|
|
|
- var task = _lstWaferTasks.Find(wafer => (wafer.currentMod == ac.SourceModule && wafer.currentSlot == ac.SourceSlot) || (wafer.currentMod == ac.DestinationModule && wafer.currentSlot == ac.DestinationSlot));
|
|
|
- if (task != null && task.movingStatus == RState.Running)
|
|
|
- return false; ;
|
|
|
+ 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))
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var slotWafers = new Dictionary<KeyValuePair<ModuleName, int>, bool>();
|
|
|
+ foreach (var ac in actions)
|
|
|
+ {
|
|
|
+ var scrSlot = new KeyValuePair<ModuleName, int>(ac.SourceModule, ac.SourceSlot);
|
|
|
+ var destSlot = new KeyValuePair<ModuleName, int>(ac.DestinationModule, ac.DestinationSlot);
|
|
|
+
|
|
|
+ if (!slotWafers.ContainsKey(scrSlot))
|
|
|
+ {
|
|
|
+ slotWafers[scrSlot] = true;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!slotWafers.ContainsKey(destSlot))
|
|
|
+ {
|
|
|
+ slotWafers[destSlot] = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // simulate moved result
|
|
|
+ foreach (var ac in actions)
|
|
|
+ {
|
|
|
+ var scrSlot = new KeyValuePair<ModuleName, int>(ac.SourceModule, ac.SourceSlot);
|
|
|
+ var destSlot = new KeyValuePair<ModuleName, int>(ac.DestinationModule, ac.DestinationSlot);
|
|
|
+
|
|
|
+ if (!slotWafers[scrSlot])
|
|
|
+ {
|
|
|
+ LOG.Write(eEvent.WARN_ROUTER, ModuleName.System, $"{slotWafers[scrSlot]} do not has a wafer");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ slotWafers[scrSlot] = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (slotWafers[destSlot])
|
|
|
+ {
|
|
|
+ LOG.Write(eEvent.WARN_ROUTER, ModuleName.System, $"{slotWafers[destSlot]} has a wafer");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ slotWafers[destSlot] = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ 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))
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
return true;
|