diff --git a/SicRT/Equipments/AutoTransfer.cs b/SicRT/Equipments/AutoTransfer.cs index b73bf675..cff6d043 100644 --- a/SicRT/Equipments/AutoTransfer.cs +++ b/SicRT/Equipments/AutoTransfer.cs @@ -55,8 +55,8 @@ namespace SicRT.Modules public bool CassetteFromAToB => SC.GetValue("System.Scheduler.CassetteFromAToB"); private bool _isCycleMode; - private int _cycleSetPoint = 0; - private int _cycledCount = 0; + private int _cycleCount = 0; + private int _cycledTime = 0; private int _cycledWafer = 0; private readonly string _curRecipeName = ""; private readonly string _curSequenceName = ""; @@ -79,8 +79,8 @@ namespace SicRT.Modules _dbCallback = new SchedulerDBCallback(); DATA.Subscribe("Scheduler.IsCycleMode", () => _isCycleMode); - DATA.Subscribe("Scheduler.CycledCount", () => _cycledCount); - DATA.Subscribe("Scheduler.CycleSetPoint", () => _cycleSetPoint); + DATA.Subscribe("Scheduler.CycledCount", () => _cycledTime); + DATA.Subscribe("Scheduler.CycleSetPoint", () => _cycleCount); DATA.Subscribe("Scheduler.RecipeName", () => _curRecipeName); DATA.Subscribe("Scheduler.SequenceName", () => _curSequenceName); @@ -256,10 +256,10 @@ namespace SicRT.Modules public void GetConfig() { - _cycledCount = 0; + _cycledTime = 0; _isCycleMode = SC.GetValue("System.IsCycleMode"); - _cycleSetPoint = _isCycleMode ? SC.GetValue("System.CycleCount") : 0; + _cycleCount = _isCycleMode ? SC.GetValue("System.CycleCount") : 0; _maxTrayCount = _lstPms.Count * 2; @@ -797,9 +797,9 @@ namespace SicRT.Modules } } - if (_cycleSetPoint > 0) + if (_cycleCount > 0) { - _cycleSetPoint = _cycledCount; + _cycleCount = _cycledTime; } } } @@ -1010,7 +1010,7 @@ namespace SicRT.Modules { GetConfig(); _cycledWafer = 0; - _cycledCount = 0; + _cycledTime = 0; bool hasPmOnline = false; @@ -1232,24 +1232,27 @@ namespace SicRT.Modules int unprocessed_cj = 0; int aborted_cj = 0; - foreach (var pj in _lstProcessJobs) + if(!_isCycleMode) { - if (pj.ControlJobName == cj.Name) + foreach (var pj in _lstProcessJobs) { - int unprocessed = 0; - int aborted = 0; - var wafers = WaferManager.Instance.GetWaferByProcessJob(pj.Name); - foreach (var waferInfo in wafers) + if (pj.ControlJobName == cj.Name) { - waferInfo.ProcessJob = null; - waferInfo.NextSequenceStep = 0; - if (waferInfo.ProcessState != WaferProcessStatus.Completed) + int unprocessed = 0; + int aborted = 0; + var wafers = WaferManager.Instance.GetWaferByProcessJob(pj.Name); + foreach (var waferInfo in wafers) { - unprocessed++; - unprocessed_cj++; + waferInfo.ProcessJob = null; + waferInfo.NextSequenceStep = 0; + if (waferInfo.ProcessState != WaferProcessStatus.Completed) + { + unprocessed++; + unprocessed_cj++; + } } + JobDataRecorder.EndPJ(pj.InnerId.ToString(), aborted, unprocessed); } - JobDataRecorder.EndPJ(pj.InnerId.ToString(), aborted, unprocessed); } } @@ -1266,46 +1269,28 @@ namespace SicRT.Modules allControlJobComplete = allControlJobComplete && cj.State == EnumControlJobState.Completed; } - if (_isCycleMode && _cycledCount < _cycleSetPoint) + if (allControlJobComplete && _isCycleMode) { - int countPerCycle = 0; - int countProcessed = 0; - foreach (var pj in _lstProcessJobs) + _cycledTime++; + + if (_cycledTime < _cycleCount) { - foreach (var pjSlotWafer in pj.SlotWafers) + foreach (var cj in _lstControlJobs) { - countPerCycle++; - WaferInfoRt wafer = GetModule(pjSlotWafer.Item1).GetWaferInfo(pjSlotWafer.Item2); - if (!wafer.IsWaferEmpty && !GetModule(pjSlotWafer.Item1).CheckWaferNeedProcess(pjSlotWafer.Item2)) - countProcessed++; + cj.SetState(EnumControlJobState.Executing); } - } - _cycledWafer = _cycledCount * countPerCycle + countProcessed; - //StatsDataManager.Instance.SetValue(StatsNameTotalRunningWafer, _totalWaferWhenStart + _cycledWafer); - - if (allControlJobComplete) - { - _cycledCount++; - - if (_cycledCount < _cycleSetPoint) + foreach (var pj in _lstProcessJobs) { - foreach (var cj in _lstControlJobs) + pj.SetState(EnumProcessJobState.Queued); + pj.InnerId = Guid.NewGuid(); + foreach (var pjSlotWafer in pj.SlotWafers) { - cj.SetState(EnumControlJobState.Executing); - } - foreach (var pj in _lstProcessJobs) - { - pj.SetState(EnumProcessJobState.Queued); - pj.InnerId = Guid.NewGuid(); - foreach (var pjSlotWafer in pj.SlotWafers) - { - WaferInfoRt wafer = GetModule(pjSlotWafer.Item1).GetWaferInfo(pjSlotWafer.Item2); + WaferInfoRt wafer = GetModule(pjSlotWafer.Item1).GetWaferInfo(pjSlotWafer.Item2); - wafer.ProcessJob = null; - wafer.NextSequenceStep = 0; - wafer.ProcessState = WaferProcessStatus.Idle; - } + //wafer.ProcessJob = null; + wafer.NextSequenceStep = 0; + wafer.ProcessState = WaferProcessStatus.Idle; } } }