461 lines
10 KiB
C#
461 lines
10 KiB
C#
using Newtonsoft.Json;
|
|
using Newtonsoft.Json.Converters;
|
|
|
|
namespace MapoSDK
|
|
{
|
|
public enum DataItemCategory
|
|
{
|
|
CONDITION = 0,
|
|
EVENT = 1,
|
|
SAMPLE = 2
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tipo di esito (generico)
|
|
/// </summary>
|
|
public enum esitoExec
|
|
{
|
|
undone,
|
|
ok,
|
|
error
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tipo di IOB
|
|
/// </summary>
|
|
public enum IobType
|
|
{
|
|
/// <summary>
|
|
/// Non definito
|
|
/// </summary>
|
|
ND,
|
|
|
|
/// <summary>
|
|
/// IOB rPI
|
|
/// </summary>
|
|
rPi,
|
|
|
|
/// <summary>
|
|
/// IOB Windows
|
|
/// </summary>
|
|
WIN
|
|
}
|
|
|
|
public enum modBusAddrType
|
|
{
|
|
/// <summary>
|
|
/// ModBus Coil 0xxxxx (booleano) - OUT R/W
|
|
/// </summary>
|
|
Coil = 0,
|
|
|
|
/// <summary>
|
|
/// ModBus Input discreto 1xxxxx (booleano) - IN R
|
|
/// </summary>
|
|
DiscreteInput = 1,
|
|
|
|
/// <summary>
|
|
/// ModBus Input Register 3xxxxx (int[] convertibile a vari int/real) - IN R
|
|
/// </summary>
|
|
InputRegister = 3,
|
|
|
|
/// <summary>
|
|
/// ModBus Holding Register 4xxxxx (int[] convertibile a vari int/real) - OUT R/W
|
|
/// </summary>
|
|
HoldingRegister = 4
|
|
}
|
|
|
|
/// <summary>
|
|
/// Elenco dei tipi di valore gestiti da PLC (inizialmente SIEMENS)
|
|
/// </summary>
|
|
public enum plcDataType
|
|
{
|
|
/// <summary>
|
|
/// Tipo boolean
|
|
/// </summary>
|
|
Boolean,
|
|
|
|
/// <summary>
|
|
/// Tipo Int16 intero 16bit
|
|
/// </summary>
|
|
Int,
|
|
|
|
/// <summary>
|
|
/// Tipo UInt16 reversed LowHigh
|
|
/// </summary>
|
|
IntLH,
|
|
|
|
/// <summary>
|
|
/// Tipo Int32 intero 32bit
|
|
/// </summary>
|
|
DInt,
|
|
|
|
/// <summary>
|
|
/// Tipo UInt32 reversed LowHigh
|
|
/// </summary>
|
|
DIntLH,
|
|
|
|
/// <summary>
|
|
/// Tipo UInt16, intero 16bit
|
|
/// </summary>
|
|
Word,
|
|
|
|
/// <summary>
|
|
/// Tipo UInt32, intero Unsigned 32bit
|
|
/// </summary>
|
|
DWord,
|
|
|
|
/// <summary>
|
|
/// Tipo REAL 32 bit
|
|
/// </summary>
|
|
Real,
|
|
|
|
/// <summary>
|
|
/// Tipo REAL 32 bit standard (HighLow) - sinonimo di Real, creato x simmetria con caso LH
|
|
/// </summary>
|
|
RealHL,
|
|
|
|
/// <summary>
|
|
/// Tipo REAL 32 bit con swap byte (LowHigh) al posto del normale caso HL (HighLow)
|
|
/// </summary>
|
|
RealLH,
|
|
|
|
/// <summary>
|
|
/// Tipo stringa
|
|
/// </summary>
|
|
String,
|
|
|
|
/// <summary>
|
|
/// Timpo intero da High/Low Bit positivo (high bit va moltiplicato x 32768 = Uint16Max/2)
|
|
/// </summary>
|
|
HLPInt,
|
|
|
|
/// <summary>
|
|
/// Tipo FLOAT 32 bit con endiannes standard (es modbus)
|
|
/// https://www.scadacore.com/tools/programming-calculators/online-hex-converter/ Float -
|
|
/// Big Endian (ABCD)
|
|
/// </summary>
|
|
FloatABCD,
|
|
|
|
/// <summary>
|
|
/// Tipo FLOAT 32 bit con endiannes NON standard (es modbus)
|
|
/// https://www.scadacore.com/tools/programming-calculators/online-hex-converter/ Float -
|
|
/// Mid-Big Endian (BADC)
|
|
/// </summary>
|
|
FloatBADC,
|
|
|
|
/// <summary>
|
|
/// Tipo FLOAT 32 bit con endiannes NON standard (es modbus)
|
|
/// https://www.scadacore.com/tools/programming-calculators/online-hex-converter/ Float -
|
|
/// Mid-Little Endian (CDAB)
|
|
/// </summary>
|
|
FloatCDAB,
|
|
|
|
/// <summary>
|
|
/// Tipo FLOAT 32 bit con endiannes NON standard (es modbus)
|
|
/// https://www.scadacore.com/tools/programming-calculators/online-hex-converter/ Float -
|
|
/// Little Endian (DCBA)
|
|
/// </summary>
|
|
FloatDCBA,
|
|
|
|
/// <summary>
|
|
/// Valore bitmap, inteso come array di bit ognuno da trattare come uno stato on/off
|
|
/// indipendente e sommabile (es allarmi)
|
|
/// </summary>
|
|
BitMap,
|
|
|
|
/// <summary>
|
|
/// Tipo Byte 8 bit equivalente a BitMap
|
|
/// </summary>
|
|
Byte,
|
|
|
|
/// <summary>
|
|
/// Tipo UInt16 intero senza segno 16bit
|
|
/// </summary>
|
|
UInt,
|
|
|
|
/// <summary>
|
|
/// Tipo UInt32 intero senza segno 32bit
|
|
/// </summary>
|
|
UDInt
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tipologia dato Raw Transfer
|
|
/// </summary>
|
|
/// serializzazione Native [JsonConverter(typeof(JsonStringEnumConverter))] serializzazione
|
|
/// Newtonsoft json [JsonConverter(typeof(StringEnumConverter))]
|
|
[JsonConverter(typeof(StringEnumConverter))]
|
|
public enum rawTransfType
|
|
{
|
|
ND = 0,
|
|
|
|
/// <summary>
|
|
/// Icoel: Batch info
|
|
/// </summary>
|
|
IcoelBatch,
|
|
|
|
/// <summary>
|
|
/// Icoel: Variety + layout info relative
|
|
/// </summary>
|
|
IcoelVarInfo,
|
|
|
|
/// <summary>
|
|
/// Info tipo tabella RegGiacenze (MAG)
|
|
/// </summary>
|
|
RegGiacenze
|
|
}
|
|
|
|
/// <summary>
|
|
/// Enumerazione tipi di semaforo
|
|
/// </summary>
|
|
public enum Semaforo
|
|
{
|
|
/// <summary>
|
|
/// Stato non definito
|
|
/// </summary>
|
|
ND,
|
|
|
|
/// <summary>
|
|
/// Verde
|
|
/// </summary>
|
|
SV,
|
|
|
|
/// <summary>
|
|
/// Giallo
|
|
/// </summary>
|
|
SG,
|
|
|
|
/// <summary>
|
|
/// Rosso
|
|
/// </summary>
|
|
SR,
|
|
|
|
/// <summary>
|
|
/// Grigio/Spento
|
|
/// </summary>
|
|
SS
|
|
}
|
|
|
|
/// <summary>
|
|
/// Elenco task ammessi (x IOB-WIN da eseguire...)
|
|
/// </summary>
|
|
public enum taskType
|
|
{
|
|
/// <summary>
|
|
/// Task nullo / fake
|
|
/// </summary>
|
|
nihil,
|
|
|
|
/// <summary>
|
|
/// Rimanda a PLC eventuale segnale NON in setup (MA NON RESETTA)
|
|
/// </summary>
|
|
fixStopSetup,
|
|
|
|
/// <summary>
|
|
/// Indica al PLC di forzare il reset del contapezzi
|
|
/// </summary>
|
|
forceResetPzCount,
|
|
|
|
/// <summary>
|
|
/// Indica al PLC di forzare il NUOVO valore di contapezzi (impostato come value)
|
|
/// </summary>
|
|
forceSetPzCount,
|
|
|
|
/// <summary>
|
|
/// Imposta Articolo su PLC
|
|
/// </summary>
|
|
setArt,
|
|
|
|
/// <summary>
|
|
/// Imposta Articolo IN MODALITA' NUMERICA su PLC
|
|
/// </summary>
|
|
setArtNum,
|
|
|
|
/// <summary>
|
|
/// Imposta Commessa su PLC
|
|
/// </summary>
|
|
setComm,
|
|
|
|
/// <summary>
|
|
/// Imposta Commessa IN MODALITA' NUMERICA su PLC
|
|
/// </summary>
|
|
setCommNum,
|
|
|
|
/// <summary>
|
|
/// Set di un PARAMETRO su PLC (in value avremo un JSON object)
|
|
/// </summary>
|
|
setParameter,
|
|
|
|
/// <summary>
|
|
/// Set Programma CNC su PLC
|
|
/// </summary>
|
|
setProg,
|
|
|
|
/// <summary>
|
|
/// Indica al PLC di impostare il numero di pezzi da produrre per la commessa (impostato
|
|
/// come value)
|
|
/// </summary>
|
|
setPzComm,
|
|
|
|
/// <summary>
|
|
/// Indica al PLC iniziato setup (e secondo casi ferma contapezzi /resetta)
|
|
/// </summary>
|
|
startSetup,
|
|
|
|
/// <summary>
|
|
/// Indica al PLC finito setup (e secondo casi ferma contapezzi /resetta)
|
|
/// </summary>
|
|
stopSetup,
|
|
|
|
/// <summary>
|
|
/// Richiesta invio watchdog a PLC
|
|
/// </summary>
|
|
sendWatchDogMes2Plc,
|
|
|
|
/// <summary>
|
|
/// Indica che è FINITA la produzione (e quindi cancello dati backup)
|
|
/// </summary>
|
|
endProd,
|
|
|
|
/// <summary>
|
|
/// Richiesta esecuzione di un sync dei dati DB di frontiera
|
|
/// </summary>
|
|
syncDbData,
|
|
|
|
/// <summary>
|
|
/// Imposta Fornitore (es grower x ICOEL)
|
|
/// </summary>
|
|
setSupplier,
|
|
|
|
/// <summary>
|
|
/// Effettua processing other info (es ritorno consumi x ricette FIMAT)
|
|
/// </summary>
|
|
processOtherInfo
|
|
}
|
|
|
|
/// <summary>
|
|
/// Finestra temporale di aggregazione dati VC
|
|
/// </summary>
|
|
public enum timeWindow
|
|
{
|
|
free,
|
|
hour,
|
|
day,
|
|
week,
|
|
month
|
|
}
|
|
|
|
public enum tipoBarcode
|
|
{
|
|
/// <summary>
|
|
/// tipo non riconosciuto
|
|
/// </summary>
|
|
nd,
|
|
|
|
/// <summary>
|
|
/// identifica una matricola operatore nel formato OPxxxxx (xxxxx è un intero che
|
|
/// rappresenta la matricola, std fino a 8 cifre)
|
|
/// </summary>
|
|
matrOperatore,
|
|
|
|
/// <summary>
|
|
/// identifica un cartellino di tipo CodArticolo
|
|
/// </summary>
|
|
codArticolo,
|
|
|
|
/// <summary>
|
|
/// identifica un codice per le attività di inizio/fine attrezzaggio e inizio/fine produzione
|
|
/// </summary>
|
|
attrezzaggio,
|
|
|
|
/// <summary>
|
|
/// identifica un codice per le attività di conferma produzione/fermi
|
|
/// </summary>
|
|
confermaProduzione,
|
|
|
|
/// <summary>
|
|
/// identifica un cartellino di dichiarazione fermata nel formato FExxxx dove xxxx è
|
|
/// idxEvento dichiarato...
|
|
/// </summary>
|
|
dichiaraFermata,
|
|
|
|
/// <summary>
|
|
/// indentifica un codice di modifica turno
|
|
/// </summary>
|
|
modificaTurno
|
|
}
|
|
|
|
/// <summary>
|
|
/// tipologia di evento (generico) segnalato
|
|
/// </summary>
|
|
public enum tipoEvento
|
|
{
|
|
/// <summary>
|
|
/// evento di reset
|
|
/// </summary>
|
|
reset,
|
|
|
|
/// <summary>
|
|
/// richiesta editing
|
|
/// </summary>
|
|
edit,
|
|
|
|
/// <summary>
|
|
/// nuova selezione
|
|
/// </summary>
|
|
selection,
|
|
|
|
/// <summary>
|
|
/// eliminazione record(s)
|
|
/// </summary>
|
|
delete
|
|
}
|
|
|
|
/// <summary>
|
|
/// tipologia evento inviato
|
|
/// </summary>
|
|
public enum tipoInputEvento
|
|
{
|
|
barcode,
|
|
hw
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tipologia di selettore
|
|
/// </summary>
|
|
public enum tipoSelettore
|
|
{
|
|
articoli
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tipologia di elaborazione/funzione da applicare a VC
|
|
/// </summary>
|
|
public enum VC_func
|
|
{
|
|
/// <summary>
|
|
/// Valore puntuale
|
|
/// </summary>
|
|
POINT = 0,
|
|
|
|
/// <summary>
|
|
/// Valore medio del periodo
|
|
/// </summary>
|
|
AVG,
|
|
|
|
/// <summary>
|
|
/// Valore massimo del periodo
|
|
/// </summary>
|
|
MAX,
|
|
|
|
/// <summary>
|
|
/// Valore minimo del periodo
|
|
/// </summary>
|
|
MIN,
|
|
|
|
/// <summary>
|
|
/// Calcolo della mediana del periodo
|
|
/// </summary>
|
|
MEDIAN
|
|
}
|
|
} |