51 lines
1.4 KiB
C#
51 lines
1.4 KiB
C#
using System;
|
|
using System.Collections.Concurrent;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace JSMachine.WMS.Common.Dto.Business
|
|
{
|
|
/// <summary>
|
|
/// agv执行失败报警信息
|
|
/// </summary>
|
|
public class AgvTaskFailedAlarmInfo
|
|
{
|
|
public Guid AgvTaskId { get; set; }
|
|
public string Operation { get; set; }
|
|
}
|
|
|
|
public static class GlobalAgvTaskFailedAlarmInfo
|
|
{
|
|
private static ConcurrentDictionary<Guid, AgvTaskFailedAlarmInfo> AgvTaskFailedAlarmInfoes = new();
|
|
|
|
/// <summary>
|
|
/// 新增告警
|
|
/// </summary>
|
|
/// <param name="alarmInfo"></param>
|
|
public static void AddAlarmInfo(AgvTaskFailedAlarmInfo alarmInfo)
|
|
{
|
|
AgvTaskFailedAlarmInfoes.AddOrUpdate(alarmInfo.AgvTaskId, alarmInfo, (key, value) => alarmInfo);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取所有告警
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public static List<AgvTaskFailedAlarmInfo> GetAlarmInfoes()
|
|
{
|
|
return AgvTaskFailedAlarmInfoes.Select(p => p.Value).ToList();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 删除警告
|
|
/// </summary>
|
|
/// <param name="agvTaskId"></param>
|
|
public static void RemoveAlarmInfo(Guid agvTaskId)
|
|
{
|
|
AgvTaskFailedAlarmInfoes.TryRemove(agvTaskId, out AgvTaskFailedAlarmInfo info);
|
|
}
|
|
}
|
|
}
|