using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static MP.MONO.Core.Enums;
namespace MP.MONO.Core
{
///
/// Struttura conf tipo dati
///
public class dataConf
{
#region Public Properties
///
/// DESCRIZIONE parametro
///
public string description { get; set; } = "";
///
/// Fattore per eventuale scalatura (es leggo 1234 --> 12,34 con factor=0.01, 123'400 con factor=100)
///
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 int 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 int 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
}
///
/// Struttura conf tipo dati
///
public class dataConfTSVC : dataConf
{
#region Public Properties
///
/// Tipo di funzione da applicare al dato
///
[JsonConverter(typeof(StringEnumConverter))]
public VC_func func { get; set; } = VC_func.MAX;
///
/// Periodo campionamento
///
public int period { get; set; } = 60;
#endregion Public Properties
}
}