98 lines
2.1 KiB
C#
98 lines
2.1 KiB
C#
using Newtonsoft.Json;
|
|
using Newtonsoft.Json.Converters;
|
|
using static IOB_MAN.Core.SDK.Enums;
|
|
|
|
namespace IOB_MAN.Core.SDK
|
|
{
|
|
public class dataConf
|
|
{
|
|
public string name { get; set; } = "none";
|
|
|
|
|
|
public string description { get; set; } = "";
|
|
|
|
|
|
public string memAddr { get; set; } = "";
|
|
|
|
|
|
[JsonConverter(typeof(StringEnumConverter))]
|
|
public plcDataType tipoMem { get; set; } = plcDataType.Int;
|
|
|
|
|
|
public int index { get; set; } = 0;
|
|
|
|
|
|
public int size { get; set; } = 0;
|
|
|
|
|
|
public double factor { get; set; } = 1.0;
|
|
|
|
|
|
public double maxVal { get; set; } = 9999.0;
|
|
|
|
|
|
public double minVal { get; set; } = 0.0;
|
|
|
|
|
|
public string unit { get; set; } = "";
|
|
|
|
|
|
public string value { get; set; } = "";
|
|
|
|
|
|
public List<string> decodeMap { get; set; } = new List<string>();
|
|
|
|
|
|
public int displOrdinal { get; set; } = 0;
|
|
|
|
|
|
public virtual bool IsEqual(dataConf refObj)
|
|
{
|
|
if (refObj == null)
|
|
return false;
|
|
|
|
if (this.name != refObj.name)
|
|
return false;
|
|
|
|
if (this.description != refObj.description)
|
|
return false;
|
|
|
|
if (this.memAddr != refObj.memAddr)
|
|
return false;
|
|
|
|
if (this.tipoMem != refObj.tipoMem)
|
|
return false;
|
|
|
|
if (this.index != refObj.index)
|
|
return false;
|
|
|
|
if (this.size != refObj.size)
|
|
return false;
|
|
|
|
if (this.factor != refObj.factor)
|
|
return false;
|
|
|
|
if (this.maxVal != refObj.maxVal)
|
|
return false;
|
|
|
|
if (this.minVal != refObj.minVal)
|
|
return false;
|
|
|
|
if (this.unit != refObj.unit)
|
|
return false;
|
|
|
|
if (this.value != refObj.value)
|
|
return false;
|
|
|
|
if (this.displOrdinal != refObj.displOrdinal)
|
|
return false;
|
|
|
|
if (!this.decodeMap.Equals(refObj.decodeMap))
|
|
return false;
|
|
|
|
|
|
return true;
|
|
}
|
|
}
|
|
}
|