123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- using Aitex.Core.RT.Device;
- using Aitex.Core.Util;
- using Aitex.Sorter.Common;
- using Aitex.Sorter.RT.EFEMs.Servers;
- using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robot;
- namespace Aitex.Sorter.RT.EFEMs.Tasks
- {
- public class HoldTask : CheckImp, ITask
- {
- public HoldTask()
- {
- }
- public bool Execute(out string result, params string[] args)
- {
- string device = DeviceName.Robot;
- 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<EMSPolicy>(device, out result))
- {
- return false;
- }
- if (!Check<ErrorPolicy>(device, out result))
- {
- return false;
- }
- if (!Check<NoMovingPolicy>(device, out result))
- {
- return false;
- }
- if (!Check<HoldPolicy>(device, out result))
- {
- return false;
- }
- if (!Check<MaintenancePolicy>(device, out result))
- {
- return false;
- }
- if (!Check<PowerDownPolicy>(device, out result))
- {
- return false;
- }
-
- Robot robot = DEVICE.GetDevice<Robot>(device);
- if (!robot.Busy)
- {
- result = "NOTINMOTION";
- return false;
- }
- if (!robot.Stop(false, out result))
- {
- return false;
- }
- Singleton<EfemEntity>.Instance.SetSystemHold();
- return true;
- }
- public bool? Monitor(out string result, params string[] args)
- {
- result = string.Empty;
- string device = DeviceName.Robot;
- Robot robot = DEVICE.GetDevice<Robot>(device);
-
- if (robot.Error)
- {
- return false;
- }
- if (!robot.Moving)
- {
- return true;
- }
- return null;
- }
- }
- }
|