243 lines
7.5 KiB
C#
243 lines
7.5 KiB
C#
using MapoSDK;
|
|
using Newtonsoft.Json;
|
|
using Newtonsoft.Json.Converters;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace IOB_UT_NEXT
|
|
{
|
|
/// <summary>
|
|
/// Classe gestione configurazione parametri di base x configuraizone estesa (es MTConnect, OPC-UA, ...)
|
|
/// </summary>
|
|
public class BaseParamConf
|
|
{
|
|
#region Public Properties
|
|
|
|
/// <summary>
|
|
/// Struttura dati x check condizione LAVORA / Green
|
|
/// </summary>
|
|
public List<diCheckCondition> condWork { get; set; } = new List<diCheckCondition>();
|
|
|
|
/// <summary>
|
|
/// Elenco items FILTRATI da invio come dynData --> FluxLog (events o samples)
|
|
/// </summary>
|
|
public List<string> fluxLogVeto { get; set; } = new List<string>();
|
|
|
|
/// <summary>
|
|
/// Array degli elementi di traduzione item
|
|
/// </summary>
|
|
public Dictionary<string, string> itemTranslation { get; set; } = new Dictionary<string, string>();
|
|
|
|
/// <summary>
|
|
/// Nome variabile x EmergencyStop
|
|
/// </summary>
|
|
public string keyEStop { get; set; } = "";
|
|
|
|
/// <summary>
|
|
/// Nome variabile x pezzi FATTI
|
|
/// </summary>
|
|
public string keyPartCount { get; set; } = "";
|
|
|
|
/// <summary>
|
|
/// Nome variabile x Codice Articolo
|
|
/// </summary>
|
|
public string keyPartId { get; set; } = "";
|
|
|
|
/// <summary>
|
|
/// Nome variabile x pezzi RICHIESTI
|
|
/// </summary>
|
|
public string keyPartReq { get; set; } = "";
|
|
|
|
/// <summary>
|
|
/// Nome variabile x NOME PROGRAMMA
|
|
/// </summary>
|
|
public string keyProgName { get; set; } = "";
|
|
|
|
/// <summary>
|
|
/// Nome variabile x RunMode
|
|
/// </summary>
|
|
public string keyRunMode { get; set; } = "";
|
|
|
|
/// <summary>
|
|
/// Dictionary dei nomi da cercare come "endsWith" a cui applicare la soglia indicata
|
|
/// </summary>
|
|
public Dictionary<string, int> paramsEndThresh { get; set; } = new Dictionary<string, int>();
|
|
|
|
/// <summary>
|
|
/// Indica se il ping sia un criterio valido x determinare powerON impianto
|
|
/// </summary>
|
|
public bool pingAsPowerOn { get; set; } = true;
|
|
|
|
#endregion Public Properties
|
|
}
|
|
/// <summary>
|
|
/// Classe gestione configurazione parametri di base x allarmi
|
|
/// </summary>
|
|
public class BaseAlarmConf
|
|
{
|
|
/// <summary>
|
|
/// Descrizione area allarmi
|
|
/// </summary>
|
|
public string description { get; set; } = "";
|
|
|
|
/// <summary>
|
|
/// Tipo di dato
|
|
/// </summary>
|
|
[JsonConverter(typeof(StringEnumConverter))]
|
|
public plcDataType tipoMem { get; set; } = plcDataType.Boolean;
|
|
|
|
/// <summary>
|
|
/// Nome "assoluto" della posizione nell'area di memoria (anche diverso da indice)
|
|
/// </summary>
|
|
public string memAddr { get; set; } = "";
|
|
|
|
/// <summary>
|
|
/// Indice nell'area di memoria (da valore iniziale = 0)
|
|
/// </summary>
|
|
public int index { get; set; } = 0;
|
|
|
|
/// <summary>
|
|
/// Size in byte
|
|
/// </summary>
|
|
public int size { get; set; } = 0;
|
|
|
|
/// <summary>
|
|
/// Elenco allarmi configurati x la bitmap
|
|
/// </summary>
|
|
public List<string> messages { get; set; } = new List<string>();
|
|
|
|
/// <summary>
|
|
/// Array dei valori allarme correnti
|
|
/// </summary>
|
|
public int[] alarmsState { get; set; }
|
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Classe per rappresentare oggetti chaive/valore target x controlo condizioni multiple
|
|
/// </summary>
|
|
public class diCheckCondition
|
|
{
|
|
#region Public Properties
|
|
|
|
/// <summary>
|
|
/// nome variabile
|
|
/// </summary>
|
|
public string keyName { get; set; } = "";
|
|
|
|
/// <summary>
|
|
/// valore target per esito richeisto
|
|
/// </summary>
|
|
public string targetValue { get; set; } = "";
|
|
|
|
#endregion Public Properties
|
|
}
|
|
|
|
/// <summary>
|
|
/// Classe per rappresentare una lista di oggetti chaive/valore target x controlo condizioni multiple + indicazione modalità di controllo (AND/OR/...)
|
|
/// </summary>
|
|
public class diCheckCondSetup
|
|
{
|
|
#region Public Properties
|
|
|
|
/// <summary>
|
|
/// Elenco condizioni
|
|
/// </summary>
|
|
public List<diCheckCondition> checkList { get; set; } = new List<diCheckCondition>();
|
|
|
|
/// <summary>
|
|
/// Modalità verifica condizioni
|
|
/// </summary>
|
|
public boolCheckMode checkMode { get; set; } = boolCheckMode.AND;
|
|
|
|
#endregion Public Properties
|
|
}
|
|
|
|
/// <summary>
|
|
/// Classe gestione configurazione parametri specifici MTC da BaseParamConf
|
|
/// </summary>
|
|
public class MtcParamConf : BaseParamConf
|
|
{
|
|
#region Public Properties
|
|
|
|
/// <summary>
|
|
/// Struttura dati x check condizione PowerOn
|
|
/// </summary>
|
|
public diCheckCondition condPowerOn { get; set; } = new diCheckCondition();
|
|
|
|
#endregion Public Properties
|
|
}
|
|
|
|
/// <summary>
|
|
/// Classe gestione configurazione parametri specifici OPC-UA da BaseParamConf
|
|
/// </summary>
|
|
public class OpcUaParamConf : BaseParamConf
|
|
{
|
|
#region Public Properties
|
|
|
|
/// <summary>
|
|
/// Identificativo nodo iniziale
|
|
/// </summary>
|
|
public string BrowseFullVal { get; set; } = "ns=2;s=Scalar_Static";
|
|
|
|
/// <summary>
|
|
/// Indice NS da cui fare il browse dei file
|
|
/// </summary>
|
|
public ushort BrowseNSIndex { get; set; } = 4;
|
|
|
|
/// <summary>
|
|
/// ID del nodo da cui partire x il browse di identificazione nodi iniziale
|
|
/// </summary>
|
|
public uint BrowseValue { get; set; } = 5001;
|
|
|
|
/// <summary>
|
|
/// Struttura dati x check condizione Contapezzi Abilitato (se vuoto = sempre abilitato)
|
|
/// </summary>
|
|
public diCheckCondSetup condCountEnabled { get; set; } = new diCheckCondSetup();
|
|
|
|
/// <summary>
|
|
/// Struttura dati x check condizione Errore
|
|
/// </summary>
|
|
public diCheckCondSetup condError { get; set; } = new diCheckCondSetup();
|
|
|
|
/// <summary>
|
|
/// Struttura dati x check condizione Emergenza
|
|
/// </summary>
|
|
public diCheckCondSetup condEStop { get; set; } = new diCheckCondSetup();
|
|
|
|
/// <summary>
|
|
/// Struttura dati x check condizione Manual
|
|
/// </summary>
|
|
public diCheckCondSetup condManual { get; set; } = new diCheckCondSetup();
|
|
|
|
/// <summary>
|
|
/// Struttura dati x check condizione PowerOn
|
|
/// </summary>
|
|
public diCheckCondSetup condPowerOn { get; set; } = new diCheckCondSetup();
|
|
|
|
/// <summary>
|
|
/// Struttura dati x check condizione READY
|
|
/// </summary>
|
|
public diCheckCondSetup condReady { get; set; } = new diCheckCondSetup();
|
|
|
|
/// <summary>
|
|
/// Struttura dati x check condizione WarmUp - CoolDown
|
|
/// </summary>
|
|
public diCheckCondSetup condWarmUpCoolDown { get; set; } = new diCheckCondSetup();
|
|
|
|
/// <summary>
|
|
/// Aree di memoria lettura
|
|
/// </summary>
|
|
public Dictionary<string, dataConfTSVC> mMapRead { get; set; } = new Dictionary<string, dataConfTSVC>();
|
|
|
|
/// <summary>
|
|
/// Aree di memoria scrittura
|
|
/// </summary>
|
|
public Dictionary<string, dataConf> mMapWrite { get; set; } = new Dictionary<string, dataConf>();
|
|
|
|
#endregion Public Properties
|
|
}
|
|
} |