123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- using Aitex.Core.Util;
- using Aitex.Sorter.Common;
- using MECF.Framework.Common.Equipment;
- using MECF.Framework.Common.SubstrateTrackings;
- using MECF.Framework.RT.ModuleLibrary.BufferModules;
- using MECF.Framework.RT.ModuleLibrary.SystemModules;
- namespace EfemDualSchedulerLib.Schedulers
- {
- public class SchedulerBuffer : SchedulerModule
- {
- public override bool IsAvailable
- {
- get { return _buffer.IsReady && _buffer.IsOnline && CheckTaskDone(); }
- }
- public override bool IsOnline
- {
- get
- {
- return _buffer.IsOnline; }
- }
- public override bool IsError
- {
- get { return _buffer.IsError; }
- }
- private BufferModuleBase _buffer = null;
- private DeviceTimer _timerCooling = new DeviceTimer();
- private float _paramCoolingTime = 0;
- public SchedulerBuffer(ModuleName module) : base(module.ToString())
- {
- _buffer = EquipmentManager.Modules[module] as BufferModuleBase;
- }
- public override bool IsReadyForPick(ModuleName robot, Hand hand, int slot)
- {
- return WaferManager.Instance.CheckHasWafer(ModuleHelper.Converter(_module), slot);
- }
- public override bool IsReadyForPlace(ModuleName robot, Hand hand, int slot)
- {
- return WaferManager.Instance.CheckNoWafer(ModuleHelper.Converter(_module), slot);
- }
- public override bool Cooling(int coolingTime)
- {
- _task = TaskType.Cooling;
- LogTaskStart(_task, $"Cooling {coolingTime} seconds" );
- _paramCoolingTime = coolingTime;
- _timerCooling.Start(_paramCoolingTime * 1000);
- return true;
- }
- public bool Monitor()
- {
- return true;
- }
- public bool CheckTaskDone()
- {
- bool ret = false;
- switch (_task)
- {
- case TaskType.None:
- ret = true;
- break;
- case TaskType.Cooling:
- ret = _timerCooling.IsTimeout() && /* _entity.CheckAcked(_token) &&*/ _buffer.IsReady;
- break;
- }
- if (ret && _task != TaskType.None)
- {
- LogTaskDone(_task, "");
- _task = TaskType.None;
- }
- return ret;
- }
- }
- }
|