报警相关代码操作共享集合时有线程安全风险
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user