refactor: 将Framework库和RT、UI放在同一个解决方案中。
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
using Aitex.Core.RT.DataCenter;
|
||||
using Aitex.Core.RT.IOCore;
|
||||
using System.Threading.Tasks;
|
||||
using System.Xml;
|
||||
using Aitex.Core.RT.OperationCenter;
|
||||
|
||||
namespace Aitex.Core.RT.Device.Devices
|
||||
{
|
||||
public class IoPlcProcessAbort : BaseDevice, IDevice
|
||||
{
|
||||
|
||||
|
||||
|
||||
protected readonly DIAccessor _diAbortProcessRun;
|
||||
|
||||
protected readonly DOAccessor _doAbortProcessInterrupt;
|
||||
|
||||
protected readonly DOAccessor _doAbortProcessBuzzerOFF;
|
||||
|
||||
public IoPlcProcessAbort(string module, XmlElement node, string ioModule = "") : base(module, node, ioModule)
|
||||
{
|
||||
|
||||
_diAbortProcessRun = ParseDiNode("diAbortProcessRun", node, ioModule);
|
||||
|
||||
_doAbortProcessInterrupt = ParseDoNode("doAbortProcessInterrupt", node, ioModule);
|
||||
|
||||
_doAbortProcessBuzzerOFF = ParseDoNode("doAbortProcessBuzzerOFF", node, ioModule);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public bool Initialize()
|
||||
{
|
||||
|
||||
DATA.Subscribe($"{Module}.AbortProcessRun", () => _diAbortProcessRun.Value);
|
||||
|
||||
OP.Subscribe($"{Module}.AbortProcessInterrupt", (function, args) =>
|
||||
{
|
||||
_doAbortProcessInterrupt?.SetValue(true, out string reason);
|
||||
Task.Delay(2000).ContinueWith(a =>
|
||||
{
|
||||
_doAbortProcessInterrupt?.SetValue(false, out string reason);
|
||||
});
|
||||
return true;
|
||||
});
|
||||
|
||||
OP.Subscribe($"{Module}.AbortProcessBuzzerOFF", (function, args) =>
|
||||
{
|
||||
_doAbortProcessBuzzerOFF?.SetValue(true, out string reason);
|
||||
Task.Delay(2000).ContinueWith(a =>
|
||||
{
|
||||
_doAbortProcessBuzzerOFF?.SetValue(false, out string reason);
|
||||
});
|
||||
return true;
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Terminate()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user