diff --git a/MP-TAB/MP-TAB.csproj b/MP-TAB/MP-TAB.csproj
index 1d3fb3a6..eefe0e0c 100644
--- a/MP-TAB/MP-TAB.csproj
+++ b/MP-TAB/MP-TAB.csproj
@@ -707,6 +707,7 @@
+
@@ -1012,6 +1013,13 @@
cmp_disabled.ascx
+
+ cmp_displNumPzProd.ascx
+ ASPXCodeBehind
+
+
+ cmp_displNumPzProd.ascx
+
cmp_HwSwInfo.ascx
ASPXCodeBehind
diff --git a/MP-TAB/WebUserControls/cmp_displNumPzProd.ascx b/MP-TAB/WebUserControls/cmp_displNumPzProd.ascx
new file mode 100644
index 00000000..767fce48
--- /dev/null
+++ b/MP-TAB/WebUserControls/cmp_displNumPzProd.ascx
@@ -0,0 +1,17 @@
+<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="cmp_displNumPzProd.ascx.cs" Inherits="MoonProTablet.WebUserControls.cmp_displNumPzProd" %>
+
+
+
\ No newline at end of file
diff --git a/MP-TAB/WebUserControls/cmp_displNumPzProd.ascx.cs b/MP-TAB/WebUserControls/cmp_displNumPzProd.ascx.cs
new file mode 100644
index 00000000..ab3ce4fa
--- /dev/null
+++ b/MP-TAB/WebUserControls/cmp_displNumPzProd.ascx.cs
@@ -0,0 +1,122 @@
+using MapoSDK;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+
+namespace MoonProTablet.WebUserControls
+{
+ public partial class cmp_displNumPzProd : System.Web.UI.UserControl
+ {
+ #region Protected Fields
+
+ protected int nBlue = 0;
+ protected int nGray = 0;
+ protected int nGreen = 0;
+ protected int nYellow = 0;
+
+ #endregion Protected Fields
+
+ #region Public Properties
+
+ public prodCounter datiProd
+ {
+ set
+ {
+ // chiamo refresh e calcoli
+ updateDisplay(value);
+ }
+ }
+
+ public int numBlue
+ {
+ set
+ {
+ divBlue.Style.Remove("width");
+ divBlue.Style.Add("width", $"{value}%");
+ lblBlue.Text = $"{value}%";
+ }
+ }
+
+ public int numGray
+ {
+ set
+ {
+ divGray.Style.Remove("width");
+ divGray.Style.Add("width", $"{value}%");
+ lblGray.Text = $"{value}%";
+ }
+ }
+
+ public int numGreen
+ {
+ set
+ {
+ divGreen.Style.Remove("width");
+ divGreen.Style.Add("width", $"{value}%");
+ lblGreen.Text = $"{value}%";
+ }
+ }
+
+ public int numYellow
+ {
+ set
+ {
+ divYellow.Style.Remove("width");
+ divYellow.Style.Add("width", $"{value}%");
+ lblYellow.Text = $"{value}%";
+ }
+ }
+
+ #endregion Public Properties
+
+ #region Private Methods
+
+ private void updateDisplay(prodCounter countData)
+ {
+ decimal denom = countData.numPzProd > countData.numPzOrd ? (decimal)countData.numPzProd / 100 : (decimal)countData.numPzOrd / 100;
+ // calcolo se sono nel caso prod < ordinati o se sono andato OVER
+ if (countData.numPzProd < countData.numPzOrd)
+ {
+ nGreen = (int)Math.Floor((decimal)countData.numPzConf / denom);
+ nYellow = (int)Math.Floor((decimal)(countData.numPzProd - countData.numPzConf) / denom);
+ nGray = 100 - (nGreen + nYellow);
+ nBlue = 0;
+ }
+ else
+ {
+ // devo verificare SE ne ho confermati meno che ordinati o meno...
+ if (countData.numPzConf < countData.numPzOrd)
+ {
+ nGreen = (int)Math.Floor((decimal)countData.numPzConf / denom);
+ nBlue = (int)Math.Floor((decimal)(countData.numPzProd - countData.numPzConf) / denom);
+ }
+ else
+ {
+ nGreen = (int)Math.Floor((decimal)countData.numPzOrd / denom);
+ nBlue = (int)Math.Floor((decimal)(countData.numPzProd - countData.numPzOrd) / denom);
+ }
+ nYellow = 0;
+ nGray = 0;
+ }
+ // disegno!
+ numGreen = nGreen;
+ numYellow = nYellow;
+ numGray = nGray;
+ numBlue = nBlue;
+ }
+
+ #endregion Private Methods
+
+ #region Protected Methods
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ }
+
+ #endregion Protected Methods
+ }
+}
\ No newline at end of file
diff --git a/MP-TAB/WebUserControls/cmp_displNumPzProd.ascx.designer.cs b/MP-TAB/WebUserControls/cmp_displNumPzProd.ascx.designer.cs
new file mode 100644
index 00000000..33f5101d
--- /dev/null
+++ b/MP-TAB/WebUserControls/cmp_displNumPzProd.ascx.designer.cs
@@ -0,0 +1,98 @@
+//------------------------------------------------------------------------------
+//
+// Codice generato da uno strumento.
+//
+// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se
+// il codice viene rigenerato.
+//
+//------------------------------------------------------------------------------
+
+namespace MoonProTablet.WebUserControls
+{
+
+
+ public partial class cmp_displNumPzProd
+ {
+
+ ///
+ /// Controllo divGreen.
+ ///
+ ///
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlGenericControl divGreen;
+
+ ///
+ /// Controllo lblGreen.
+ ///
+ ///
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
+ ///
+ protected global::System.Web.UI.WebControls.Label lblGreen;
+
+ ///
+ /// Controllo divYellow.
+ ///
+ ///
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlGenericControl divYellow;
+
+ ///
+ /// Controllo lblYellow.
+ ///
+ ///
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
+ ///
+ protected global::System.Web.UI.WebControls.Label lblYellow;
+
+ ///
+ /// Controllo divGray.
+ ///
+ ///
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlGenericControl divGray;
+
+ ///
+ /// Controllo lblGray.
+ ///
+ ///
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
+ ///
+ protected global::System.Web.UI.WebControls.Label lblGray;
+
+ ///
+ /// Controllo divBlue.
+ ///
+ ///
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlGenericControl divBlue;
+
+ ///
+ /// Controllo lblBlue.
+ ///
+ ///
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
+ ///
+ protected global::System.Web.UI.WebControls.Label lblBlue;
+
+ ///
+ /// Controllo hfProdCount.
+ ///
+ ///
+ /// Campo generato automaticamente.
+ /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
+ ///
+ protected global::System.Web.UI.WebControls.HiddenField hfProdCount;
+ }
+}
diff --git a/MP-TAB/WebUserControls/mod_mappaStato.ascx b/MP-TAB/WebUserControls/mod_mappaStato.ascx
index f7cc7595..6281bf8b 100644
--- a/MP-TAB/WebUserControls/mod_mappaStato.ascx
+++ b/MP-TAB/WebUserControls/mod_mappaStato.ascx
@@ -1,67 +1,82 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_mappaStato.ascx.cs" Inherits="MoonProTablet.WebUserControls.mod_mappaStato" %>
+<%@ Register Src="~/WebUserControls/cmp_displNumPzProd.ascx" TagPrefix="uc1" TagName="cmp_displNumPzProd" %>
+
-
-
-
-
-
-
-
-
) %>)
-
-
-
-
-
+
+
+
+
+
+
+
+
) %>)
+
+
+
+
+
+
+
+
+
+ Confermati
+
+
+ Prodotti
+
+
+ Ordinati
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MP-TAB/WebUserControls/mod_mappaStato.ascx.cs b/MP-TAB/WebUserControls/mod_mappaStato.ascx.cs
index 58663968..ea4591b5 100644
--- a/MP-TAB/WebUserControls/mod_mappaStato.ascx.cs
+++ b/MP-TAB/WebUserControls/mod_mappaStato.ascx.cs
@@ -1,4 +1,5 @@
-using SteamWare;
+using MapoSDK;
+using SteamWare;
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
@@ -50,6 +51,23 @@ namespace MoonProTablet.WebUserControls
repLI.DataBind();
}
+ public prodCounter setData(object _numConf, object _numProd, object _numOrd)
+ {
+ int numConf = 0;
+ int numProd = 0;
+ int numOrd = 0;
+ int.TryParse(_numConf.ToString(), out numConf);
+ int.TryParse(_numProd.ToString(), out numProd);
+ int.TryParse(_numOrd.ToString(), out numOrd);
+ prodCounter countData = new prodCounter()
+ {
+ numPzConf = numConf,
+ numPzOrd = numOrd,
+ numPzProd = numProd
+ };
+ return countData;
+ }
+
#endregion Public Methods
}
}
\ No newline at end of file
diff --git a/MapoSDK/Objects.cs b/MapoSDK/Objects.cs
index c32e796a..d6385e15 100644
--- a/MapoSDK/Objects.cs
+++ b/MapoSDK/Objects.cs
@@ -5,97 +5,180 @@ using System.Collections.Generic;
namespace MapoSDK
{
- #region oggetti per scambio dati IO - IOB
-
- public class fileEmbed
+ ///
+ /// nuovo stato ingressi e eventuale evento da inviare
+ ///
+ public struct hwMachineState
{
- ///
- /// Array di file da inviare
- ///
- public List fileList { get; set; } = new List();
+ #region Public Fields
+
+ public int IdxTipoEvento;
+ public int next_IdxMicroStato;
+
+ #endregion Public Fields
}
///
- /// Classe x definire un file (corto) inviato come Json tramite httpost
+ /// Struttura gestione comandi di input
///
- public class smallFile
+ public struct inputComandoMapo
{
- public string fileName { get; set; } = "";
- public string content { get; set; } = "";
- }
-
- ///
- /// Array elementi tipo KeyValuePair inviati come JSon che indicano lo stato LIVE dell'IOB
- ///
- public class liveIOB
- {
- public List> dataList { get; set; }
- }
-
- ///
- /// Array valori tipo flogData inviati come JSon
- ///
- public class flogJsonPayload
- {
- public List fluxData { get; set; }
- }
-
- ///
- /// Tracciato FluxLog in formato JSON valido
- ///
- public class flogData : evData
- {
- ///
- /// nome del flusso
- ///
- public string flux { get; set; } = "ND";
- }
-
- ///
- /// Array valori tipo evData inviati come JSon
- ///
- public class evJsonPayload
- {
- public List eventList { get; set; }
- }
-
- ///
- /// Tracciato InputEvents in formato JSON valido
- /// Derivato da input realtime valore=3&dtEve=20181206180600000&dtCurr=20181206180600000&cnt=999
- ///
- public class evData
- {
- ///
- /// Valore del dato di flusso registrato
- ///
- public string valore { get; set; } = "-";
+ #region Public Fields
///
- /// DataOra evento
+ /// descrizione comando
///
- public DateTime dtEve { get; set; } = DateTime.Now;
+ public string descrComando;
///
- /// DataOra corrente della trasmissione
+ /// idx evento associato al comando
///
- public DateTime dtCurr { get; set; } = DateTime.Now;
+ public int idxTipoEvento;
///
- /// Contatore incrementale x riordino invio (opzionale)
+ /// input comando valido si/no
///
- public int cnt { get; set; } = 0;
+ public bool isValid;
+
+ ///
+ /// refresh stato macchina encessario si/no
+ ///
+ public bool needStatusRefresh;
+
+ ///
+ /// valore di output dal comando
+ ///
+ public string outValue;
+
+ ///
+ /// input precedente
+ ///
+ public string precInput;
+
+ ///
+ /// testo da mostrare all'utente
+ ///
+ public string text2show;
+
+ ///
+ /// lista del nome dei WebBrowserBox e delle relative url, nel formato {0}##{1} {0}=nome WebBrowserBox (es. box01), {1}=url relativo (es. http://server/MoonPro/Produzione.aspx?idxMacchina=99)
+ ///
+ public string[] wBrowsBoxUrls;
+
+ #endregion Public Fields
}
///
- /// Dati resoconto IOB
+ /// Definizione allarme
///
- public class IOB_data
+ public class alarmData
{
- public string name;
- public string IP;
- public IobType iType;
- public string typeCss;
- public bool CNC_Counter;
+ #region Public Properties
+
+ ///
+ /// Codice univoco
+ ///
+ public string code { get; set; } = "";
+
+ ///
+ /// Descrizione
+ ///
+ public string description { get; set; } = "";
+
+ ///
+ /// Severity (0....1000, minimo...massimo)
+ ///
+ public int severity { get; set; } = 0;
+
+ #endregion Public Properties
+ }
+
+ ///
+ /// Definizione classe evento allarme
+ ///
+ public class alarmEvent
+ {
+ #region Public Properties
+
+ ///
+ /// Lista delle condizioni di allarme attive ad inizio evento
+ ///
+ public List activeConditions { get; set; } = null;
+
+ ///
+ /// Elenco dei dati di tipo FluxLog nei minuti antecedenti l'evento
+ ///
+ public List blackBoxData { get; set; } = null;
+
+ ///
+ /// Data riferimento campione in formato YMD = yyyyMMdd
+ ///
+ public int dateYMD { get; set; } = 0;
+
+ ///
+ /// Data-Ora inizio evento
+ ///
+ public DateTime ended { get; set; } = DateTime.Now;
+
+ ///
+ /// Data-Ora inizio evento
+ ///
+ public DateTime started { get; set; } = DateTime.Now;
+
+ ///
+ /// Contatore incrementale univoco annuale (per chiave yyyy.n)
+ ///
+ public int yCounter { get; set; } = 0;
+
+ ///
+ /// Anno di riferimento allarme (per chiave yyyy.n)
+ ///
+ public int yCurr { get; set; } = 0;
+
+ #endregion Public Properties
+ }
+
+ ///
+ /// Definizione classe evento allarme
+ ///
+ public class alarmStats
+ {
+ #region Public Properties
+
+ ///
+ /// Durata media annuale allarmi
+ ///
+ public double avgDuration
+ {
+ get
+ {
+ double answ = 0;
+ try
+ {
+ answ = totalDuration / yCounter;
+ }
+ catch
+ { }
+ return answ;
+ }
+ }
+
+ ///
+ /// Valore cumulato complessivo degli allarmi registrati
+ ///
+ public double totalDuration { get; set; } = 0;
+
+ ///
+ /// Valore Contatore univoco annuale raggiunto yyyy.n
+ ///
+ public int yCounter { get; set; } = 1;
+
+ ///
+ /// Anno riferimento
+ ///
+ public int year { get; set; } = 0;
+
+ #endregion Public Properties
}
///
@@ -103,15 +186,47 @@ namespace MapoSDK
///
public class dataConf
{
+ #region Public Properties
+
+ ///
+ /// DESCRIZIONE parametro
+ ///
+ public string description { get; set; } = "";
+
+ ///
+ /// Fattore per eventuale divisione (es leggo 1234 --> 12,34 con factor=100)
+ ///
+ public int 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";
///
- /// DESCRIZIONE parametro
+ /// Size in byte
///
- public string description { get; set; } = "";
+ public int size { get; set; } = 0;
///
/// Tipo di dato
@@ -119,40 +234,343 @@ namespace MapoSDK
[JsonConverter(typeof(StringEnumConverter))]
public plcDataType tipoMem { get; set; } = plcDataType.Int;
- ///
- /// Indice nell'area di memoria (da valore iniziale = 0)
- ///
- public int index { get; set; } = 0;
-
- ///
- /// Nome "assoluto" della posizione nell'area di memoria (anche diverso da indice)
- ///
- public string memAddr { get; set; } = "";
-
- ///
- /// Size in byte
- ///
- public int size { get; set; } = 0;
-
- ///
- /// Fattore per eventuale divisione (es leggo 1234 --> 12,34 con factor=100)
- ///
- public int factor { get; set; } = 1;
-
///
/// Valore parametro (come stringa, decimali con ",", default VUOTO), poi LETTO da PLC (o appena scritto)
///
public string value { get; set; } = "";
- ///
- /// Valore minimo ammesso (ove usato, es simulazione)
- ///
- public int minVal { get; set; } = 0;
+ #endregion Public Properties
+ }
+
+ ///
+ /// Struttura conf tipo dati
+ ///
+ public class dataConfTSVC : dataConf
+ {
+ #region Public Properties
///
- /// Valore massimo ammesso (ove usato, es simulazione)
+ /// Tipo di funzione da applicare al dato
///
- public int maxVal { get; set; } = 9999;
+ [JsonConverter(typeof(StringEnumConverter))]
+ public VC_func func { get; set; } = VC_func.MAX;
+
+ ///
+ /// Periodo campionamento
+ ///
+ public int period { get; set; } = 60;
+
+ #endregion Public Properties
+ }
+
+ ///
+ /// Tracciato InputEvents in formato JSON valido
+ /// Derivato da input realtime valore=3&dtEve=20181206180600000&dtCurr=20181206180600000&cnt=999
+ ///
+ public class evData
+ {
+ #region Public Properties
+
+ ///
+ /// Contatore incrementale x riordino invio (opzionale)
+ ///
+ public int cnt { get; set; } = 0;
+
+ ///
+ /// DataOra corrente della trasmissione
+ ///
+ public DateTime dtCurr { get; set; } = DateTime.Now;
+
+ ///
+ /// DataOra evento
+ ///
+ public DateTime dtEve { get; set; } = DateTime.Now;
+
+ ///
+ /// Valore del dato di flusso registrato
+ ///
+ public string valore { get; set; } = "-";
+
+ #endregion Public Properties
+ }
+
+ ///
+ /// Singolo dettaglio evento
+ ///
+ public class EventDetail
+ {
+ #region Public Properties
+
+ ///
+ /// Nome evento
+ ///
+ public string what { get; set; } = "";
+
+ ///
+ /// Data di riferimento
+ ///
+ public DateTime when { get; set; }
+
+ #endregion Public Properties
+ }
+
+ ///
+ /// Array valori tipo evData inviati come JSon
+ ///
+ public class evJsonPayload
+ {
+ #region Public Properties
+
+ public List eventList { get; set; }
+
+ #endregion Public Properties
+ }
+
+ ///
+ /// Classe x inviare messaggi di tipo esecuzione di una generica esecuzione
+ ///
+ public class exeResult
+ {
+ #region Public Properties
+
+ ///
+ /// Esito del risultato
+ ///
+ [JsonConverter(typeof(StringEnumConverter))]
+ public esitoExec esito { get; set; } = esitoExec.undone;
+
+ ///
+ /// Messaggio associato
+ ///
+ public string message { get; set; } = "";
+
+ #endregion Public Properties
+ }
+
+ public class fileEmbed
+ {
+ #region Public Properties
+
+ ///
+ /// Array di file da inviare
+ ///
+ public List fileList { get; set; } = new List();
+
+ #endregion Public Properties
+ }
+
+ ///
+ /// Tracciato FluxLog in formato JSON valido
+ ///
+ public class flogData : evData
+ {
+ #region Public Properties
+
+ ///
+ /// nome del flusso
+ ///
+ public string flux { get; set; } = "ND";
+
+ #endregion Public Properties
+ }
+
+ ///
+ /// Array valori tipo flogData inviati come JSon
+ ///
+ public class flogJsonPayload
+ {
+ #region Public Properties
+
+ public List fluxData { get; set; }
+
+ #endregion Public Properties
+ }
+
+ ///
+ /// Raccolta dati di storici sintetici per Macchina e Variabile
+ ///
+ public class histData
+ {
+ #region Public Properties
+
+ ///
+ /// Data riferimento campione in formato YMD = yyyyMMdd
+ ///
+ public int dateYMD { get; set; } = 0;
+
+ ///
+ /// Macchina
+ ///
+ public string macName { get; set; } = "";
+
+ ///
+ /// Periodo di aggregazione di riferimento
+ ///
+ //[JsonConverter(typeof(StringEnumConverter))]
+ public timeWindow period { get; set; } = timeWindow.day;
+
+ ///
+ /// Statistiche raccolte nel periodo
+ ///
+ public List stats { get; set; } = null;
+
+ ///
+ /// Tipo di valore registrato (internamente è string)
+ ///
+ //[JsonConverter(typeof(StringEnumConverter))]
+ public plcDataType varType { get; set; } = plcDataType.Int;
+
+ #endregion Public Properties
+ }
+
+ ///
+ /// Dati resoconto IOB
+ ///
+ public class IOB_data
+ {
+ #region Public Fields
+
+ public bool CNC_Counter;
+ public string IP;
+ public IobType iType;
+ public string name;
+ public string typeCss;
+
+ #endregion Public Fields
+ }
+
+ ///
+ /// Rappresentazione dello stato corrente dell'IOB
+ ///
+ public class IobWinCurrentState
+ {
+ #region Public Properties
+
+ ///
+ /// Contatore IOB
+ ///
+ public float counterIOB { get; set; } = 0;
+
+ ///
+ /// Contatore Macchina
+ ///
+ public float counterMAC { get; set; } = 0;
+
+ ///
+ /// Ultimo stato noto dei parametri in memoria letti da PLC
+ ///
+ public Dictionary currParams { get; set; } = null;
+
+ ///
+ /// DataOra ultima comunicazione IN (con PLC)
+ ///
+ public DateTime lastDataIn { get; set; } = DateTime.Now.AddYears(-1);
+
+ ///
+ /// DataOra ultima comunicazione OUT (con MP Server)
+ ///
+ public DateTime lastDataOut { get; set; } = DateTime.Now.AddYears(-1);
+
+ ///
+ /// Lunghezza coda EVENTI in uscita
+ ///
+ public int queueEvLen { get; set; } = 0;
+
+ ///
+ /// Lunghezza coda FluxLog in uscita
+ ///
+ public int queueFLogLen { get; set; } = 0;
+
+ ///
+ /// Semaforo IN (IOB-PLC)
+ ///
+ public Semaforo SemIn { get; set; } = Semaforo.ND;
+
+ ///
+ /// Semaforo OUT (IOB-MPserver)
+ ///
+ public Semaforo SemOut { get; set; } = Semaforo.ND;
+
+ #endregion Public Properties
+ }
+
+ ///
+ /// Array elementi tipo KeyValuePair inviati come JSon che indicano lo stato LIVE dell'IOB
+ ///
+ public class liveIOB
+ {
+ #region Public Properties
+
+ public List> dataList { get; set; }
+
+ #endregion Public Properties
+ }
+
+ ///
+ /// Descrittore oggetto DataItem generico
+ ///
+ public class machDataItem
+ {
+ #region Public Constructors
+
+ public machDataItem()
+ { }
+
+ #endregion Public Constructors
+
+ #region Public Properties
+
+ ///
+ /// Categoria oggetto
+ ///
+ public DataItemCategory Category { get; set; }
+
+ ///
+ /// Nome / descrizione
+ ///
+ public string Name { get; set; }
+
+ ///
+ /// Tipologia specifica
+ ///
+ public string SubType { get; set; }
+
+ ///
+ /// Tipologia principale
+ ///
+ public string Type { get; set; }
+
+ ///
+ /// Unità di misura
+ ///
+ public string Units { get; set; }
+
+ ///
+ /// ID generico
+ ///
+ public string uuid { get; set; }
+
+ #endregion Public Properties
+ }
+
+ ///
+ /// Configurazione delle macchine MTC
+ ///
+ public class MtcSetup
+ {
+ #region Public Properties
+
+ ///
+ /// Setup della macchina
+ ///
+ public List dataItems { get; set; }
+
+ ///
+ /// IdxMacchina cui ci riferiamo
+ ///
+ public string idxMacchina { get; set; } = "";
+
+ #endregion Public Properties
}
///
@@ -160,20 +578,12 @@ namespace MapoSDK
///
public class objItem
{
- ///
- /// UID univoco
- ///
- public string uid { get; set; } = "";
+ #region Public Properties
///
- /// NOME item
+ /// Ultimo messaggio associato (conferma scrittura, errore, ...)
///
- public string name { get; set; } = "";
-
- ///
- /// Valore parametro (come stringa, decimali con ",", default VUOTO), sul CNC/PLC
- ///
- public string value { get; set; } = "";
+ public string lastMessage { get; set; } = "";
///
/// DataOra ultima lettura
@@ -181,9 +591,14 @@ namespace MapoSDK
public DateTime lastRead { get; set; } = DateTime.Now.AddHours(-1);
///
- /// Indica se sia abilitato in scrittura (WRITE)
+ /// DataOra ultima richiesta scrittura
///
- public bool writable { get; set; } = false;
+ public DateTime lastRequest { get; set; } = DateTime.Now.AddDays(-1);
+
+ ///
+ /// NOME item
+ ///
+ public string name { get; set; } = "";
///
/// Indica il NUOVO valore richiesto x l'item
@@ -191,14 +606,21 @@ namespace MapoSDK
public string reqValue { get; set; } = "";
///
- /// DataOra ultima richiesta scrittura
+ /// UID univoco
///
- public DateTime lastRequest { get; set; } = DateTime.Now.AddDays(-1);
+ public string uid { get; set; } = "";
///
- /// Ultimo messaggio associato (conferma scrittura, errore, ...)
+ /// Valore parametro (come stringa, decimali con ",", default VUOTO), sul CNC/PLC
///
- public string lastMessage { get; set; } = "";
+ public string value { get; set; } = "";
+
+ ///
+ /// Indica se sia abilitato in scrittura (WRITE)
+ ///
+ public bool writable { get; set; } = false;
+
+ #endregion Public Properties
#if false
///
@@ -217,53 +639,99 @@ namespace MapoSDK
#endif
}
- ///
- /// Struttura conf tipo dati
- ///
- public class dataConfTSVC : dataConf
- {
- ///
- /// 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;
- }
-
///
/// Struttura conf memorie PLC (inizialmente SIEMENS)
///
public class plcMemMap
{
- ///
- /// Parametri ammessi per IOB x scrittura
- ///
- public Dictionary mMapWrite = new Dictionary();
+ #region Public Fields
///
/// Parametri ammessi per IOB x lettura
///
public Dictionary mMapRead = new Dictionary();
+
+ ///
+ /// Parametri ammessi per IOB x scrittura
+ ///
+ public Dictionary mMapWrite = new Dictionary();
+
+ #endregion Public Fields
+ }
+
+ ///
+ /// Classe gesitone conteggi produzione
+ ///
+ public class prodCounter
+ {
+ #region Public Properties
+
+ ///
+ /// NUmero pezzi CONFERMATI
+ ///
+ public int numPzConf { get; set; } = 0;
+
+ ///
+ /// Numero pezzi ORDINATI
+ ///
+ public int numPzOrd { get; set; } = 0;
+
+ ///
+ /// Numero pezzi PRODOTTI
+ ///
+ public int numPzProd { get; set; } = 0;
+
+ #endregion Public Properties
+ }
+
+ ///
+ /// Raccolta dati di storici raw per Macchina e Variabile
+ ///
+ public class rawData
+ {
+ #region Public Properties
+
+ ///
+ /// Data riferimento campione in formato YMD = yyyyMMdd
+ ///
+ public int dateYMD { get; set; } = 0;
+
+ ///
+ /// Macchina
+ ///
+ public string macName { get; set; } = "";
+
+ ///
+ /// Periodo di aggregazione di riferimento
+ ///
+ //[JsonConverter(typeof(StringEnumConverter))]
+ public timeWindow period { get; set; } = timeWindow.day;
+
+ ///
+ /// Dati raw registrati nel periodo
+ ///
+ public List samples { get; set; } = null;
+
+ ///
+ /// Nome della Variabile tracciata
+ ///
+ public string varName { get; set; } = "";
+
+ ///
+ /// Tipo di valore registrato (internamente è string)
+ ///
+ //[JsonConverter(typeof(StringEnumConverter))]
+ public plcDataType varType { get; set; } = plcDataType.Int;
+
+ #endregion Public Properties
}
///
/// Classe oggetto base TimeSeries
///
- public class tsData
+ public class rawSample
{
- ///
- /// Nome Macchina
- ///
- public string vcMachine { get; set; } = "";
-
- ///
- /// Nome della Var Casuale
- ///
- public string vcName { get; set; } = "";
+ #region Public Properties
///
/// Data-Ora riferimento campione
@@ -271,15 +739,32 @@ namespace MapoSDK
public DateTime timeStamp { get; set; } = DateTime.Now;
///
- /// Tipo di valore gestito
+ /// Valore in formato stringa
///
- [JsonConverter(typeof(StringEnumConverter))]
- public plcDataType vcType { get; set; } = plcDataType.Int;
+ public string value { get; set; } = "";
- ///
- /// Valore in formato stringa (che può venire customizzato)
- ///
- public string strValue { get; set; } = "";
+ #endregion Public Properties
+ }
+
+ ///
+ /// Classe x definire un file (corto) inviato come Json tramite httpost
+ ///
+ public class smallFile
+ {
+ #region Public Properties
+
+ public string content { get; set; } = "";
+ public string fileName { get; set; } = "";
+
+ #endregion Public Properties
+ }
+
+ ///
+ /// Classe oggetto base TimeSeries
+ ///
+ public class tsData
+ {
+ #region Public Properties
///
/// In base al tipo di oggetto restituisce il valore cona deguata conversione......
@@ -319,22 +804,26 @@ namespace MapoSDK
}
}
+ ///
+ /// Valore float
+ ///
+ public float floatVal { get; set; } = 0;
+
///
/// Valore intero
///
public int intVal { get; set; } = 0;
///
- /// Valore float
+ /// Valore in formato stringa (che può venire customizzato)
///
- public float floatVal { get; set; } = 0;
- }
+ public string strValue { get; set; } = "";
+
+ ///
+ /// Data-Ora riferimento campione
+ ///
+ public DateTime timeStamp { get; set; } = DateTime.Now;
- ///
- /// Aggregazione dati VC
- ///
- public class tsGrouped
- {
///
/// Nome Macchina
///
@@ -346,14 +835,20 @@ namespace MapoSDK
public string vcName { get; set; } = "";
///
- /// Unità di Misura
+ /// Tipo di valore gestito
///
- public string UM { get; set; } = "#";
+ [JsonConverter(typeof(StringEnumConverter))]
+ public plcDataType vcType { get; set; } = plcDataType.Int;
- ///
- /// Data-Ora riferimento campione
- ///
- public DateTime timeStamp { get; set; } = DateTime.Now;
+ #endregion Public Properties
+ }
+
+ ///
+ /// Aggregazione dati VC
+ ///
+ public class tsGrouped
+ {
+ #region Public Properties
///
/// Valore medio (NON definito)
@@ -369,24 +864,36 @@ namespace MapoSDK
/// Campioni effettivi nel periodo
///
public List samples { get; set; }
- }
- #region gestione dati FluxLog
+ ///
+ /// Data-Ora riferimento campione
+ ///
+ public DateTime timeStamp { get; set; } = DateTime.Now;
+
+ ///
+ /// Unità di Misura
+ ///
+ public string UM { get; set; } = "#";
+
+ ///
+ /// Nome Macchina
+ ///
+ public string vcMachine { get; set; } = "";
+
+ ///
+ /// Nome della Var Casuale
+ ///
+ public string vcName { get; set; } = "";
+
+ #endregion Public Properties
+ }
///
/// Classe oggetto statistiche sui dati
///
public class varStats
{
- ///
- /// Nome della Variabile tracciata
- ///
- public string varName { get; set; } = "";
-
- ///
- /// Num record
- ///
- public int numRec { get; set; } = 0;
+ #region Public Properties
///
/// Valore medio/mediano
@@ -402,329 +909,18 @@ namespace MapoSDK
/// Valore min
///
public float min { get; set; } = 0;
- }
-
- ///
- /// Classe oggetto base TimeSeries
- ///
- public class rawSample
- {
- ///
- /// Data-Ora riferimento campione
- ///
- public DateTime timeStamp { get; set; } = DateTime.Now;
///
- /// Valore in formato stringa
+ /// Num record
///
- public string value { get; set; } = "";
- }
-
- ///
- /// Raccolta dati di storici sintetici per Macchina e Variabile
- ///
- public class histData
- {
- ///
- /// Macchina
- ///
- public string macName { get; set; } = "";
-
- ///
- /// Tipo di valore registrato (internamente è string)
- ///
- //[JsonConverter(typeof(StringEnumConverter))]
- public plcDataType varType { get; set; } = plcDataType.Int;
-
- ///
- /// Data riferimento campione in formato YMD = yyyyMMdd
- ///
- public int dateYMD { get; set; } = 0;
-
- ///
- /// Periodo di aggregazione di riferimento
- ///
- //[JsonConverter(typeof(StringEnumConverter))]
- public timeWindow period { get; set; } = timeWindow.day;
-
- ///
- /// Statistiche raccolte nel periodo
- ///
- public List stats { get; set; } = null;
- }
-
- ///
- /// Raccolta dati di storici raw per Macchina e Variabile
- ///
- public class rawData
- {
- ///
- /// Macchina
- ///
- public string macName { get; set; } = "";
+ public int numRec { get; set; } = 0;
///
/// Nome della Variabile tracciata
///
public string varName { get; set; } = "";
- ///
- /// Tipo di valore registrato (internamente è string)
- ///
- //[JsonConverter(typeof(StringEnumConverter))]
- public plcDataType varType { get; set; } = plcDataType.Int;
-
- ///
- /// Data riferimento campione in formato YMD = yyyyMMdd
- ///
- public int dateYMD { get; set; } = 0;
-
- ///
- /// Periodo di aggregazione di riferimento
- ///
- //[JsonConverter(typeof(StringEnumConverter))]
- public timeWindow period { get; set; } = timeWindow.day;
-
- ///
- /// Dati raw registrati nel periodo
- ///
- public List samples { get; set; } = null;
- }
-
- ///
- /// Classe x inviare messaggi di tipo esecuzione di una generica esecuzione
- ///
- public class exeResult
- {
- ///
- /// Esito del risultato
- ///
- [JsonConverter(typeof(StringEnumConverter))]
- public esitoExec esito { get; set; } = esitoExec.undone;
-
- ///
- /// Messaggio associato
- ///
- public string message { get; set; } = "";
- }
-
- #endregion gestione dati FluxLog
-
- #region gestione ALARMS / CONDITIONS
-
- ///
- /// Definizione classe evento allarme
- ///
- public class alarmEvent
- {
- ///
- /// Anno di riferimento allarme (per chiave yyyy.n)
- ///
- public int yCurr { get; set; } = 0;
-
- ///
- /// Contatore incrementale univoco annuale (per chiave yyyy.n)
- ///
- public int yCounter { get; set; } = 0;
-
- ///
- /// Data riferimento campione in formato YMD = yyyyMMdd
- ///
- public int dateYMD { get; set; } = 0;
-
- ///
- /// Data-Ora inizio evento
- ///
- public DateTime started { get; set; } = DateTime.Now;
-
- ///
- /// Data-Ora inizio evento
- ///
- public DateTime ended { get; set; } = DateTime.Now;
-
- ///
- /// Lista delle condizioni di allarme attive ad inizio evento
- ///
- public List activeConditions { get; set; } = null;
-
- ///
- /// Elenco dei dati di tipo FluxLog nei minuti antecedenti l'evento
- ///
- public List blackBoxData { get; set; } = null;
- }
-
- ///
- /// Definizione classe evento allarme
- ///
- public class alarmStats
- {
- ///
- /// Anno riferimento
- ///
- public int year { get; set; } = 0;
-
- ///
- /// Valore Contatore univoco annuale raggiunto yyyy.n
- ///
- public int yCounter { get; set; } = 1;
-
- ///
- /// Valore cumulato complessivo degli allarmi registrati
- ///
- public double totalDuration { get; set; } = 0;
-
- ///
- /// Durata media annuale allarmi
- ///
- public double avgDuration
- {
- get
- {
- double answ = 0;
- try
- {
- answ = totalDuration / yCounter;
- }
- catch
- { }
- return answ;
- }
- }
- }
-
- ///
- /// Definizione allarme
- ///
- public class alarmData
- {
- ///
- /// Codice univoco
- ///
- public string code { get; set; } = "";
-
- ///
- /// Descrizione
- ///
- public string description { get; set; } = "";
-
- ///
- /// Severity (0....1000, minimo...massimo)
- ///
- public int severity { get; set; } = 0;
- }
-
- #endregion gestione ALARMS / CONDITIONS
-
- #region gestione oggetti conf MTConnect
-
- ///
- /// Configurazione delle macchine MTC
- ///
- public class MtcSetup
- {
- ///
- /// IdxMacchina cui ci riferiamo
- ///
- public string idxMacchina { get; set; } = "";
-
- ///
- /// Setup della macchina
- ///
- public List dataItems { get; set; }
- }
-
- ///
- /// Descrittore oggetto DataItem generico
- ///
- public class machDataItem
- {
- public machDataItem()
- { }
-
- ///
- /// ID generico
- ///
- public string uuid { get; set; }
-
- ///
- /// Categoria oggetto
- ///
- public DataItemCategory Category { get; set; }
-
- ///
- /// Nome / descrizione
- ///
- public string Name { get; set; }
-
- ///
- /// Tipologia principale
- ///
- public string Type { get; set; }
-
- ///
- /// Tipologia specifica
- ///
- public string SubType { get; set; }
-
- ///
- /// Unità di misura
- ///
- public string Units { get; set; }
- }
-
- #endregion gestione oggetti conf MTConnect
-
- #region gestione oggetti stato IOB scambiati tra IOB-MAN e IOB-WIN
-
- ///
- /// Rappresentazione dello stato corrente dell'IOB
- ///
- public class IobWinCurrentState
- {
- ///
- /// Semaforo IN (IOB-PLC)
- ///
- public Semaforo SemIn { get; set; } = Semaforo.ND;
-
- ///
- /// Semaforo OUT (IOB-MPserver)
- ///
- public Semaforo SemOut { get; set; } = Semaforo.ND;
-
- ///
- /// Contatore IOB
- ///
- public float counterIOB { get; set; } = 0;
-
- ///
- /// Contatore Macchina
- ///
- public float counterMAC { get; set; } = 0;
-
- ///
- /// Lunghezza coda EVENTI in uscita
- ///
- public int queueEvLen { get; set; } = 0;
-
- ///
- /// Lunghezza coda FluxLog in uscita
- ///
- public int queueFLogLen { get; set; } = 0;
-
- ///
- /// DataOra ultima comunicazione IN (con PLC)
- ///
- public DateTime lastDataIn { get; set; } = DateTime.Now.AddYears(-1);
-
- ///
- /// DataOra ultima comunicazione OUT (con MP Server)
- ///
- public DateTime lastDataOut { get; set; } = DateTime.Now.AddYears(-1);
-
- ///
- /// Ultimo stato noto dei parametri in memoria letti da PLC
- ///
- public Dictionary currParams { get; set; } = null;
+ #endregion Public Properties
}
#if false
@@ -739,86 +935,6 @@ namespace MapoSDK
public List EventsList { get; set; }
}
#endif
-
- ///
- /// Singolo dettaglio evento
- ///
- public class EventDetail
- {
- ///
- /// Data di riferimento
- ///
- public DateTime when { get; set; }
-
- ///
- /// Nome evento
- ///
- public string what { get; set; } = "";
- }
-
- #endregion gestione oggetti stato IOB scambiati tra IOB-MAN e IOB-WIN
-
- #endregion oggetti per scambio dati IO - IOB
-
- #region oggetti provenienti da MapoDb
-
- ///
- /// nuovo stato ingressi e eventuale evento da inviare
- ///
- public struct hwMachineState
- {
- public int next_IdxMicroStato;
- public int IdxTipoEvento;
- }
-
- ///
- /// Struttura gestione comandi di input
- ///
- public struct inputComandoMapo
- {
- ///
- /// input comando valido si/no
- ///
- public bool isValid;
-
- ///
- /// testo da mostrare all'utente
- ///
- public string text2show;
-
- ///
- /// idx evento associato al comando
- ///
- public int idxTipoEvento;
-
- ///
- /// input precedente
- ///
- public string precInput;
-
- ///
- /// descrizione comando
- ///
- public string descrComando;
-
- ///
- /// refresh stato macchina encessario si/no
- ///
- public bool needStatusRefresh;
-
- ///
- /// lista del nome dei WebBrowserBox e delle relative url, nel formato {0}##{1} {0}=nome WebBrowserBox (es. box01), {1}=url relativo (es. http://server/MoonPro/Produzione.aspx?idxMacchina=99)
- ///
- public string[] wBrowsBoxUrls;
-
- ///
- /// valore di output dal comando
- ///
- public string outValue;
- }
-
- #endregion oggetti provenienti da MapoDb
-
#if false
///
/// Classe definizione parametri singolo ordine produzione