12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- using Aitex.Core.RT.Device;
- using Aitex.Core.RT.Log;
- using Aitex.Core.RT.Routine;
- using Aitex.Core.RT.SCCore;
- using CyberX8_Core;
- using MECF.Framework.Common.Beckhoff.ModuleIO;
- using MECF.Framework.Common.IOCore;
- using MECF.Framework.Common.Routine;
- namespace CyberX8_RT.Devices.SRD
- {
- public class SrdCommonChuckATMRoutine : RoutineBase, IRoutine
- {
- #region 常量
- private const string CHUCK_ATM_ON = "ChuckATMOn";
- #endregion
- private enum ChuckATMStep
- {
- ChuckATMOn,
- Delay,
- ChuckATMOff,
- End
- }
- #region 内部变量
- /// <summary>
- /// Srd Device
- /// </summary>
- private SrdCommonDevice _srdCommon;
- /// <summary>
- /// 破真空持续时间
- /// </summary>
- private int _duration= 100;
- #endregion
- /// <summary>
- /// 构造函数
- /// </summary>
- /// <param name="module"></param>
- public SrdCommonChuckATMRoutine(string module) : base(module)
- {
- }
- public void Abort()
- {
- Runner.Stop("Manual Abort");
- }
- public RState Monitor()
- {
- Runner.Run(ChuckATMStep.ChuckATMOn, ChuckATMOn, _delay_1ms)
- .Delay(ChuckATMStep.Delay, _duration)
- .Run(ChuckATMStep.ChuckATMOff, ChuckATMOff, _delay_1ms)
- .End(ChuckATMStep.End, NullFun, 100);
- return Runner.Status;
- }
- public RState Start(params object[] objs)
- {
- _srdCommon = DEVICE.GetDevice<SrdCommonDevice>($"{Module}.Common");
- return Runner.Start(Module, "Chuck ATM Click");
- }
- /// <summary>
- /// Chuck ATM On
- /// </summary>
- /// <returns></returns>
- private bool ChuckATMOn()
- {
- return _srdCommon.ChuckATMOnAction("", null);
- }
- /// <summary>
- /// Chuck ATM Off
- /// </summary>
- /// <returns></returns>
- private bool ChuckATMOff()
- {
- return _srdCommon.ChuckATMOffAction("", null);
- }
-
- }
- }
|