This commit is contained in:
HCL 2024-03-29 15:26:58 +08:00
parent 790d923aeb
commit 449a5216b2
1 changed files with 38 additions and 53 deletions

View File

@ -55,8 +55,8 @@ namespace SicRT.Modules
public bool CassetteFromAToB => SC.GetValue<bool>("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<bool>("System.IsCycleMode");
_cycleSetPoint = _isCycleMode ? SC.GetValue<int>("System.CycleCount") : 0;
_cycleCount = _isCycleMode ? SC.GetValue<int>("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,6 +1232,8 @@ namespace SicRT.Modules
int unprocessed_cj = 0;
int aborted_cj = 0;
if(!_isCycleMode)
{
foreach (var pj in _lstProcessJobs)
{
if (pj.ControlJobName == cj.Name)
@ -1252,6 +1254,7 @@ namespace SicRT.Modules
JobDataRecorder.EndPJ(pj.InnerId.ToString(), aborted, unprocessed);
}
}
}
JobDataRecorder.EndCJ(cj.InnerId.ToString(), aborted_cj, unprocessed_cj);
_dbCallback.LotFinished(cj);
@ -1266,34 +1269,17 @@ 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)
{
foreach (var pjSlotWafer in pj.SlotWafers)
{
countPerCycle++;
WaferInfoRt wafer = GetModule(pjSlotWafer.Item1).GetWaferInfo(pjSlotWafer.Item2);
if (!wafer.IsWaferEmpty && !GetModule(pjSlotWafer.Item1).CheckWaferNeedProcess(pjSlotWafer.Item2))
countProcessed++;
}
}
_cycledTime++;
_cycledWafer = _cycledCount * countPerCycle + countProcessed;
//StatsDataManager.Instance.SetValue(StatsNameTotalRunningWafer, _totalWaferWhenStart + _cycledWafer);
if (allControlJobComplete)
{
_cycledCount++;
if (_cycledCount < _cycleSetPoint)
if (_cycledTime < _cycleCount)
{
foreach (var cj in _lstControlJobs)
{
cj.SetState(EnumControlJobState.Executing);
}
foreach (var pj in _lstProcessJobs)
{
pj.SetState(EnumProcessJobState.Queued);
@ -1302,14 +1288,13 @@ namespace SicRT.Modules
{
WaferInfoRt wafer = GetModule(pjSlotWafer.Item1).GetWaferInfo(pjSlotWafer.Item2);
wafer.ProcessJob = null;
//wafer.ProcessJob = null;
wafer.NextSequenceStep = 0;
wafer.ProcessState = WaferProcessStatus.Idle;
}
}
}
}
}
foreach (var cj in cjRemoveList)
{