123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- using Aitex.Core.RT.Device;
- using Aitex.Sorter.Common;
- using Efem;
- using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts;
- using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.LoadPorts.LoadPortBase;
- namespace EFEM.RT.Tasks
- {
- public class SetModeTask : CheckImp, ITask
- {
- public SetModeTask()
- {
- }
- public bool Execute(out string result, params string[] args)
- {
- string device = Args2Unit(args.Length > 0 ?args[0]:string.Empty);
- IServerModule entity = GetEntity(device);
- if (entity == null || !(entity is LoadPortServerModule))
- {
- result = PARAM_NG;
- return false;
- }
- if (!Check<NoReadyPolicy>(device, out result))
- {
- return false;
- }
- if (!Check<NoInitCompletedPolicy>(device, out result))
- {
- return false;
- }
- if (!Check<NoOriginCompletedPolicy>(device, out result))
- {
- return false;
- }
- if (!Check<ErrorPolicy>(device, out result))
- {
- return false;
- }
- if (!Check<BusyPolicy>(device, out result))
- {
- return false;
- }
- if (!Check<RemovePolicy>(device, out result))
- {
- return false;
- }
- if (!Check<MaintenancePolicy>(device, out result))
- {
- return false;
- }
- if (!Check<LinkPolicy>(device, out result))
- {
- return false;
- }
- if (!Check<ArmExtendPolicy>(device, out result))
- {
- return false;
- }
- if (!Check<NoPosPolicy>(device, out result))
- {
- return false;
- }
- if (!Check<NoPodPolicy>(device, out result))
- {
- return false;
- }
- if (!Check<NoFuncPolicy>(device, out result))
- {
- return false;
- }
- //TODO
- //LoadPort _device = DEVICE.GetDevice<LoadPort>(device);
- //_device.Clamp(out result);
- return true;
- }
- public bool? Monitor(out string result, params string[] args)
- {
- result = string.Empty;
- string device = Args2Unit(args.Length > 0 ?args[0]:string.Empty);
- LoadPortBaseDevice _device = DEVICE.GetDevice<LoadPortBaseDevice>(device);
- if (_device.IsError)
- {
-
- return false;
- }
- if (!_device.IsBusy && _device.ClampState == FoupClampState.Close)
- return true;
- return null;
- }
- }
- public class QueryModeTask : CheckImp, ITask
- {
- public QueryModeTask()
- {
- }
- public bool Execute(out string result, params string[] args)
- {
- string device = DeviceName.System;
- //EfemEventType type;
- //if (!Enum.TryParse(args[0], out type))
- //{
- // result = PARAM_NG;
- // return false;
- //}
- //EfemEventValue value;
- //if (!Enum.TryParse(args[1], out value))
- //{
- // result = PARAM_NG;
- // return false;
- //}
- if (!Check<NoReadyPolicy>(device, out result))
- {
- return false;
- }
- return true;
- }
- public bool? Monitor(out string result, params string[] args)
- {
- result = string.Empty;
- result = "AUTO";
- return true;
- }
- }
- }
|