Sic.Framework/MECF.Framework.RT.Equipment.../Devices/IoCassette.cs

101 lines
2.7 KiB
C#

using Aitex.Core.Common.DeviceData;
using Aitex.Core.RT.DataCenter;
using Aitex.Core.RT.Device;
using Aitex.Core.RT.Event;
using Aitex.Core.RT.IOCore;
using Aitex.Core.RT.Log;
using Aitex.Core.RT.OperationCenter;
using Aitex.Core.RT.SCCore;
using Aitex.Core.Util;
using System;
using System.Xml;
namespace Aitex.Core.RT.Device.Devices
{
public class IoCassette : BaseDevice, IDevice
{
private DIAccessor _di = null;
public DIAccessor SensorDI => _di;
private R_TRIG _trigDelete = new R_TRIG();
public bool Value
{
get
{
if (_di != null)
return _di.Value;
return false;
}
}
public IoCassette(string module, XmlElement node, string ioModule = "")
{
var attrModule = node.GetAttribute("module");
base.Module = string.IsNullOrEmpty(attrModule) ? module : attrModule;
base.Name = node.GetAttribute("id");
base.Display = node.GetAttribute("display");
base.DeviceID = node.GetAttribute("schematicId");
if (SC.GetStringValue($"System.InchType") == "Inch6")
{
_di = ParseDiNode("di6", node, ioModule);
}
else
{
_di = ParseDiNode("di8", node, ioModule);
}
}
public bool Initialize()
{
return true;
}
public void Terminate()
{
}
public void Monitor()
{
try
{
_trigDelete.CLK = !_di.Value;
if (_trigDelete.Q)
{
if(Module == "CassAL")
{
OP.DoOperation($"{Module}.DeleteAll", 1, 25);
EV.PostWarningLog(Module, "detected no signal DI_WaferCassetLeftInch6 Sensor,delete CassAL 1-25 Wafer ");
}
else if (Module == "CassAR")
{
OP.DoOperation($"{Module}.DeleteAll", 1, 25);
EV.PostWarningLog(Module, "detected no signal DI_WaferCassetRightInch6 Sensor,delete CassAR 1-25 Wafer ");
}
else if (Module == "CassBL")
{
OP.DoOperation($"{Module}.DeleteAll", 1, 8);
EV.PostWarningLog(Module, "detected no signal DI_TrayCassetInch6 Sensor,delete CassBL 1-8 Tray ");
}
}
}
catch (Exception ex)
{
LOG.Write(ex);
}
}
public void Reset()
{
_trigDelete.RST = true;
}
}
}