using Newtonsoft.Json; using Newtonsoft.Json.Converters; using static MP.Core.Objects.Enums; namespace MP.Core.DTO { /// /// Struttura conf tipo dati /// public class DataConfDto { #region Public Properties /// /// Struttura Valore composto a partire da altre variabili read/write esistenti /// public string ComposedVal { get; set; } = ""; /// /// Decodifica per tipoMem = BitMap: /// Array di valori assegnati ai singoli bit /// public List decodeMap { get; set; } = new List(); /// /// DESCRIZIONE parametro /// public string description { get; set; } = ""; /// /// Valore per determinare Display Ordinal /// public int displOrdinal { get; set; } = 0; /// /// Fattore di MOLTIPLICA per eventuale scalatura /// es: leggo 1'234 con factor=0.01 --> 12.34, con factor=100 --> 123'400 /// public double factor { get; set; } = 1; /// /// Indice nell'area di memoria (da valore iniziale = 0) /// public int index { get; set; } = 0; /// /// Valore massimo ammesso (ove usato, es simulazione) /// public double maxVal { get; set; } = 9999; /// /// Nome "assoluto" della posizione nell'area di memoria (anche diverso da indice) /// public string memAddr { get; set; } = ""; /// /// Valore minimo ammesso (ove usato, es simulazione) /// public double minVal { get; set; } = 0; /// /// NOME parametro /// public string name { get; set; } = "none"; /// /// Size in byte /// public int size { get; set; } = 0; /// /// Tipo di dato /// [JsonConverter(typeof(StringEnumConverter))] public plcDataType tipoMem { get; set; } = plcDataType.Int; /// /// Unità di misura del parametro /// public string unit { get; set; } = ""; /// /// Valore parametro (come stringa, decimali con ",", default VUOTO), poi LETTO da PLC (o appena scritto) /// public string value { get; set; } = ""; #endregion Public Properties } }