报警相关代码操作共享集合时有线程安全风险

This commit is contained in:
Administrator
2026-07-08 11:16:16 +08:00
parent a47253ecca
commit 7ddb519051
2 changed files with 103 additions and 79 deletions
+17 -1
View File
@@ -1,11 +1,12 @@
using CsvHelper.Configuration.Attributes;
using System;
namespace JinYuan.Models
{
/// <summary>
/// 工位报警数据
/// </summary>
public class AlarmData
public class AlarmData : ICloneable
{
/// <summary>
/// 报警唯一标识符
@@ -56,6 +57,21 @@ namespace JinYuan.Models
/// 更新状态
/// </summary>
public int Flag { get; set; }
public object Clone()
{
return new AlarmData() {
AlarmGuid = this.AlarmGuid,
PLCAdress = this.PLCAdress,
AlarmContent = this.AlarmContent,
AlarmCode = this.AlarmCode,
AlarmType = this.AlarmType,
StartTime = this.StartTime,
EndTime = this.EndTime,
AlarmDesc = this.AlarmDesc,
AlarmState = this.AlarmState,
Flag = this.Flag
};
}
}
public class AlarmCSVData