12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- using Aitex.Core.RT.Device;
- using Aitex.Core.Util;
- using EFEM.RT.Modules;
- using Aitex.Sorter.Common;
- using Efem;
- using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robot;
- using MECF.Framework.RT.EquipmentLibrary.HardwareUnits.Robots.RobotBase;
- namespace EFEM.RT.Tasks
- {
- public class EmsTask : CheckImp, ITask
- {
- public EmsTask()
- {
- }
- public bool Execute(out string result, params string[] args)
- {
- string device = DeviceName.Robot;
- if (!Check<NoReadyPolicy>(device, out result))
- {
- return false;
- }
- if (!Check<EMSPolicy>(device, out result))
- {
- return false;
- }
- if (!Check<ErrorPolicy>(device, out result))
- {
- return false;
- }
- if (!Check<HoldPolicy>(device, out result))
- {
- return false;
- }
- if (!Check<MaintenancePolicy>(device, out result))
- {
- return false;
- }
- if (!Check<NoReadyPolicy>(device, out result))
- {
- return false;
- }
- RobotBaseDevice robot = DEVICE.GetDevice<RobotBaseDevice>(device);
- Singleton<RouteManager>.Instance.IsEMSStop = false;
- if (!robot.Stop( ))
- {
- return false;
- }
- return true;
- }
- public bool? Monitor(out string result, params string[] args)
- {
- result = string.Empty;
- string device = DeviceName.Robot;
- RobotBaseDevice robot = DEVICE.GetDevice<RobotBaseDevice>(device);
- if (robot.IsError)
- {
- return false;
- }
- if (robot.IsReady())
- {
- Singleton<RouteManager>.Instance.IsEMSStop = true;
- return true;
- }
- return null;
- }
- }
- }
|