1.Gem添加Alarm报警处理

This commit is contained in:
HCL 2024-05-17 09:28:56 +08:00
parent de7c9f50eb
commit 8254719463
1 changed files with 21 additions and 4 deletions

View File

@ -13,6 +13,7 @@ using Aitex.Core.WCF;
using MECF.Framework.Common.Equipment;
using MECF.Framework.Common.Event;
using MECF.Framework.Common.FAServices;
using MECF.Framework.Common.Gem;
namespace Aitex.Core.RT.Event
{
@ -552,10 +553,26 @@ namespace Aitex.Core.RT.Event
WriteEvent(module, WARNING_EVENT, message);
}
public void PostAlarmLog(string module, string message)
{
WriteEvent(module, ALARM_EVENT, message);
}
public void PostAlarmLog(string module, string message)
{
try
{
WriteEvent(module, ALARM_EVENT, message);
if (Enum.TryParse(module, out ModuleName moduleName))
{
if (GemManager.Instance.Equipment != null)
{
ulong alarmID = GemManager.Instance.Equipment.GetAlarm(module + "Alarm").ALID;
GemManager.Instance.Equipment?.SetAlarm(alarmID, "", new string[] { module + ".AlarmInfo" }, new object[] { message });
}
}
}
catch (Exception ex)
{
LOG.Error(ex.Message, ex);
}
}
#endregion
}