From 7a14b315c62e88b63a17a6efa64399fb7aaf0c38 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 27 Jun 2022 08:43:40 +0200 Subject: [PATCH 1/3] Aggiunta gestione memorie Bitmap - nuovo enum - array x decodifica stati --- MapoSDK/Enums.cs | 4 ++++ MapoSDK/dataConf.cs | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/MapoSDK/Enums.cs b/MapoSDK/Enums.cs index d86d92a6..2018cc1e 100644 --- a/MapoSDK/Enums.cs +++ b/MapoSDK/Enums.cs @@ -158,6 +158,10 @@ namespace MapoSDK /// FloatDCBA, + /// + /// Valore bitmap, inteso come array di bit ognuno da trattare come uno stato on/off indipendente e sommabile (es allarmi) + /// + BitMap } /// diff --git a/MapoSDK/dataConf.cs b/MapoSDK/dataConf.cs index 9c4e22fa..f1af6e6b 100644 --- a/MapoSDK/dataConf.cs +++ b/MapoSDK/dataConf.cs @@ -1,5 +1,6 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; +using System.Collections.Generic; namespace MapoSDK { @@ -66,6 +67,13 @@ namespace MapoSDK /// public string value { get; set; } = ""; + + /// + /// Decodifica per tipoMem = BitMap: + /// Array di valori assegnati ai singoli bit + /// + public List decodeMap { get; set; } = new List(); + #endregion Public Properties } From 1f466bcf1577c62dddf9067cd5808ac0fcab454a Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 27 Jun 2022 18:58:43 +0200 Subject: [PATCH 2/3] Aggiunta task - aggiunto set Supplier (es grower x ICOEL) --- MapoSDK/Enums.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/MapoSDK/Enums.cs b/MapoSDK/Enums.cs index 2018cc1e..309f4c95 100644 --- a/MapoSDK/Enums.cs +++ b/MapoSDK/Enums.cs @@ -268,7 +268,12 @@ namespace MapoSDK /// /// Richiesta esecuzione di un sync dei dati DB di frontiera /// - syncDbData + syncDbData, + + /// + /// Imposta Fornitore (es grower x ICOEL) + /// + setSupplier, } /// From 6713644c79dc17450c2d277de5620c7e1778cd0b Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 29 Jun 2022 11:46:15 +0200 Subject: [PATCH 3/3] Update filtraggio fluxLog da DB --- MP-Site/WebUserControls/mod_logFluxData.ascx | 91 +++++++------------ .../WebUserControls/mod_logFluxData.ascx.cs | 57 +++++++----- .../mod_logFluxData.ascx.designer.cs | 54 +++++++---- MapoDb/AlarmsArchive.cs | 2 +- MapoDb/DS_applicazione.Designer.cs | 27 +++++- MapoDb/DS_applicazione.xsd | 3 + MapoDb/DS_applicazione.xss | 34 +++---- MapoDb/FluxArchive.cs | 2 +- 8 files changed, 152 insertions(+), 118 deletions(-) diff --git a/MP-Site/WebUserControls/mod_logFluxData.ascx b/MP-Site/WebUserControls/mod_logFluxData.ascx index 14aadb23..4a265b0d 100644 --- a/MP-Site/WebUserControls/mod_logFluxData.ascx +++ b/MP-Site/WebUserControls/mod_logFluxData.ascx @@ -1,63 +1,42 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="mod_logFluxData.ascx.cs" Inherits="MP_SITE.WebUserControls.mod_logFluxData" %> - - - - - - - Nessun record trovato - - - <%----%> - - - - - <%-- - -
-
-
- Art: - +
+
+ Filtro +
+
+
+ +
+
-
- <%# Eval("Descrizione") %>' -
-
-
- - <%# Eval("Qta") %> - pz -
-
-
- - -
-
- - - -
-
-
- Nota: - - -
- - --%> - +
+
+ + + + + + + + Nessun record trovato + + + <%----%> + + + + + - <%--EnableCaching="true" CacheDuration="60"--%> +<%--EnableCaching="true" CacheDuration="60"--%> - - - - - - + + + + + + + diff --git a/MP-Site/WebUserControls/mod_logFluxData.ascx.cs b/MP-Site/WebUserControls/mod_logFluxData.ascx.cs index f244d4e5..2cf1f971 100644 --- a/MP-Site/WebUserControls/mod_logFluxData.ascx.cs +++ b/MP-Site/WebUserControls/mod_logFluxData.ascx.cs @@ -1,34 +1,11 @@ using SteamWare; using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; using System.Web.UI; -using System.Web.UI.WebControls; namespace MP_SITE.WebUserControls { public partial class mod_logFluxData : baseProdControl { - #region Private Methods - - private void fixMacchina() - { - string IdxMacc = memLayer.ML.StringSessionObj("IdxMacchina"); - int idx = 0; - if (isMulti(IdxMacc)) - { - idx = IdxMacc.IndexOf("#", StringComparison.OrdinalIgnoreCase); - if (idx > 0) - { - IdxMacc = IdxMacc.Substring(0, IdxMacc.IndexOf("#", StringComparison.OrdinalIgnoreCase)); - } - } - memLayer.ML.setSessionVal("IdxMacchinaFluxFlog", IdxMacc); - } - - #endregion Private Methods - #region Public Methods public override void aggiornamento() @@ -55,5 +32,39 @@ namespace MP_SITE.WebUserControls } #endregion Public Methods + + #region Protected Methods + + protected void lbtReset_Click(object sender, EventArgs e) + { + txtSearch.Text = ""; + //grView.DataBind(); + } + + protected void txtSearch_TextChanged(object sender, EventArgs e) + { + grView.DataBind(); + } + + #endregion Protected Methods + + #region Private Methods + + private void fixMacchina() + { + string IdxMacc = memLayer.ML.StringSessionObj("IdxMacchina"); + int idx = 0; + if (isMulti(IdxMacc)) + { + idx = IdxMacc.IndexOf("#", StringComparison.OrdinalIgnoreCase); + if (idx > 0) + { + IdxMacc = IdxMacc.Substring(0, IdxMacc.IndexOf("#", StringComparison.OrdinalIgnoreCase)); + } + } + memLayer.ML.setSessionVal("IdxMacchinaFluxFlog", IdxMacc); + } + + #endregion Private Methods } } \ No newline at end of file diff --git a/MP-Site/WebUserControls/mod_logFluxData.ascx.designer.cs b/MP-Site/WebUserControls/mod_logFluxData.ascx.designer.cs index 354f75d6..43737d91 100644 --- a/MP-Site/WebUserControls/mod_logFluxData.ascx.designer.cs +++ b/MP-Site/WebUserControls/mod_logFluxData.ascx.designer.cs @@ -1,32 +1,52 @@ //------------------------------------------------------------------------------ -// -// Codice generato da uno strumento. +// +// This code was generated by a tool. // -// Le modifiche a questo file possono causare un comportamento non corretto e verranno perse se -// il codice viene rigenerato. -// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// //------------------------------------------------------------------------------ -namespace MP_SITE.WebUserControls { - - - public partial class mod_logFluxData { - +namespace MP_SITE.WebUserControls +{ + + + public partial class mod_logFluxData + { + /// - /// Controllo grView. + /// txtSearch control. /// /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtSearch; + + /// + /// lbtReset control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton lbtReset; + + /// + /// grView control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.GridView grView; - + /// - /// Controllo ods. + /// ods control. /// /// - /// Campo generato automaticamente. - /// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind. + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.ObjectDataSource ods; } diff --git a/MapoDb/AlarmsArchive.cs b/MapoDb/AlarmsArchive.cs index 0dafddce..9e46c401 100644 --- a/MapoDb/AlarmsArchive.cs +++ b/MapoDb/AlarmsArchive.cs @@ -59,7 +59,7 @@ namespace MapoDb var collAlarmEvents = database.GetCollection("AlarmEvents"); List lastFluxLog = new List(); - DS_applicazione.FluxLogDataTable tabDati = DataLayerObj.taFL.getFiltOrd(idxMacchina, adesso.AddMinutes(-lastMinutes), adesso, true); + DS_applicazione.FluxLogDataTable tabDati = DataLayerObj.taFL.getFiltOrd(idxMacchina, adesso.AddMinutes(-lastMinutes), adesso, true, ""); if (tabDati.Count > 0) { // chiamo procedura x conversione diff --git a/MapoDb/DS_applicazione.Designer.cs b/MapoDb/DS_applicazione.Designer.cs index f8af281c..e3d8b781 100644 --- a/MapoDb/DS_applicazione.Designer.cs +++ b/MapoDb/DS_applicazione.Designer.cs @@ -28634,6 +28634,7 @@ SELECT IdxMacchina, dtEvento, CodFlux, Valore, Cnt FROM FluxLog WHERE (CodFlux = this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@dtFrom", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@dtTo", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@showMulti", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[2].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@searchVal", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[3] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[3].Connection = this.Connection; this._commandCollection[3].CommandText = "dbo.stp_FL_getFiltOrdered"; @@ -28643,6 +28644,7 @@ SELECT IdxMacchina, dtEvento, CodFlux, Valore, Cnt FROM FluxLog WHERE (CodFlux = this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@dtFrom", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@dtTo", global::System.Data.SqlDbType.DateTime, 8, global::System.Data.ParameterDirection.Input, 23, 3, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@showMulti", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[3].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@searchVal", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[4] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[4].Connection = this.Connection; this._commandCollection[4].CommandText = "dbo.stp_FL_getFiltPaged"; @@ -28654,6 +28656,7 @@ SELECT IdxMacchina, dtEvento, CodFlux, Valore, Cnt FROM FluxLog WHERE (CodFlux = this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@showMulti", global::System.Data.SqlDbType.Bit, 1, global::System.Data.ParameterDirection.Input, 1, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@maximumRows", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@startRowIndex", global::System.Data.SqlDbType.Int, 4, global::System.Data.ParameterDirection.Input, 10, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); + this._commandCollection[4].Parameters.Add(new global::System.Data.SqlClient.SqlParameter("@searchVal", global::System.Data.SqlDbType.NVarChar, 50, global::System.Data.ParameterDirection.Input, 0, 0, null, global::System.Data.DataRowVersion.Current, false, null, "", "", "")); this._commandCollection[5] = new global::System.Data.SqlClient.SqlCommand(); this._commandCollection[5].Connection = this.Connection; this._commandCollection[5].CommandText = "dbo.stp_FL_InsNew"; @@ -28729,7 +28732,7 @@ SELECT IdxMacchina, dtEvento, CodFlux, Valore, Cnt FROM FluxLog WHERE (CodFlux = [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] - public virtual DS_applicazione.FluxLogDataTable getFiltOrd(string IdxMacchina, global::System.Nullable dtFrom, global::System.Nullable dtTo, global::System.Nullable showMulti) { + public virtual DS_applicazione.FluxLogDataTable getFiltOrd(string IdxMacchina, global::System.Nullable dtFrom, global::System.Nullable dtTo, global::System.Nullable showMulti, string searchVal) { this.Adapter.SelectCommand = this.CommandCollection[3]; if ((IdxMacchina == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; @@ -28755,6 +28758,12 @@ SELECT IdxMacchina, dtEvento, CodFlux, Valore, Cnt FROM FluxLog WHERE (CodFlux = else { this.Adapter.SelectCommand.Parameters[4].Value = global::System.DBNull.Value; } + if ((searchVal == null)) { + this.Adapter.SelectCommand.Parameters[5].Value = global::System.DBNull.Value; + } + else { + this.Adapter.SelectCommand.Parameters[5].Value = ((string)(searchVal)); + } DS_applicazione.FluxLogDataTable dataTable = new DS_applicazione.FluxLogDataTable(); this.Adapter.Fill(dataTable); return dataTable; @@ -28764,7 +28773,7 @@ SELECT IdxMacchina, dtEvento, CodFlux, Valore, Cnt FROM FluxLog WHERE (CodFlux = [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] - public virtual DS_applicazione.FluxLogDataTable getFiltPaged(string IdxMacchina, global::System.Nullable dtFrom, global::System.Nullable dtTo, global::System.Nullable showMulti, global::System.Nullable maximumRows, global::System.Nullable startRowIndex) { + public virtual DS_applicazione.FluxLogDataTable getFiltPaged(string IdxMacchina, global::System.Nullable dtFrom, global::System.Nullable dtTo, global::System.Nullable showMulti, global::System.Nullable maximumRows, global::System.Nullable startRowIndex, string searchVal) { this.Adapter.SelectCommand = this.CommandCollection[4]; if ((IdxMacchina == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; @@ -28802,6 +28811,12 @@ SELECT IdxMacchina, dtEvento, CodFlux, Valore, Cnt FROM FluxLog WHERE (CodFlux = else { this.Adapter.SelectCommand.Parameters[6].Value = global::System.DBNull.Value; } + if ((searchVal == null)) { + this.Adapter.SelectCommand.Parameters[7].Value = global::System.DBNull.Value; + } + else { + this.Adapter.SelectCommand.Parameters[7].Value = ((string)(searchVal)); + } DS_applicazione.FluxLogDataTable dataTable = new DS_applicazione.FluxLogDataTable(); this.Adapter.Fill(dataTable); return dataTable; @@ -28990,7 +29005,7 @@ SELECT IdxMacchina, dtEvento, CodFlux, Valore, Cnt FROM FluxLog WHERE (CodFlux = [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] - public virtual object getFiltCount(string IdxMacchina, global::System.Nullable dtFrom, global::System.Nullable dtTo, global::System.Nullable showMulti) { + public virtual object getFiltCount(string IdxMacchina, global::System.Nullable dtFrom, global::System.Nullable dtTo, global::System.Nullable showMulti, string searchVal) { global::System.Data.SqlClient.SqlCommand command = this.CommandCollection[2]; if ((IdxMacchina == null)) { command.Parameters[1].Value = global::System.DBNull.Value; @@ -29016,6 +29031,12 @@ SELECT IdxMacchina, dtEvento, CodFlux, Valore, Cnt FROM FluxLog WHERE (CodFlux = else { command.Parameters[4].Value = global::System.DBNull.Value; } + if ((searchVal == null)) { + command.Parameters[5].Value = global::System.DBNull.Value; + } + else { + command.Parameters[5].Value = ((string)(searchVal)); + } global::System.Data.ConnectionState previousConnectionState = command.Connection.State; if (((command.Connection.State & global::System.Data.ConnectionState.Open) != global::System.Data.ConnectionState.Open)) { diff --git a/MapoDb/DS_applicazione.xsd b/MapoDb/DS_applicazione.xsd index b1406fe3..3e2166a4 100644 --- a/MapoDb/DS_applicazione.xsd +++ b/MapoDb/DS_applicazione.xsd @@ -2559,6 +2559,7 @@ SELECT IdxMacchina, dtEvento, CodFlux, Valore, Cnt FROM FluxLog WHERE (CodFlux = + @@ -2573,6 +2574,7 @@ SELECT IdxMacchina, dtEvento, CodFlux, Valore, Cnt FROM FluxLog WHERE (CodFlux = + @@ -2589,6 +2591,7 @@ SELECT IdxMacchina, dtEvento, CodFlux, Valore, Cnt FROM FluxLog WHERE (CodFlux = + diff --git a/MapoDb/DS_applicazione.xss b/MapoDb/DS_applicazione.xss index 1f648b92..59a65d4e 100644 --- a/MapoDb/DS_applicazione.xss +++ b/MapoDb/DS_applicazione.xss @@ -4,21 +4,21 @@ Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. --> - + - + - + - - + + @@ -30,15 +30,15 @@ - + - - - - + + + + - + 456 @@ -141,7 +141,7 @@ - 896 + 879 359 @@ -238,15 +238,15 @@ 897 - 1181 + 1216 - 834 - 1181 + 896 + 1216 - + 1285 @@ -266,7 +266,7 @@ - + 933 diff --git a/MapoDb/FluxArchive.cs b/MapoDb/FluxArchive.cs index a55c2122..d190747a 100644 --- a/MapoDb/FluxArchive.cs +++ b/MapoDb/FluxArchive.cs @@ -276,7 +276,7 @@ namespace MapoDb currDateStr = tStamp.ToString("yyyyMMdd"); int.TryParse(currDateStr, out currYMD); // leggo da DB i records... - DS_applicazione.FluxLogDataTable tabDati = DataLayerObj.taFL.getFiltOrd(macchina.IdxMacchina, tStamp, tStamp.AddDays(1), true); + DS_applicazione.FluxLogDataTable tabDati = DataLayerObj.taFL.getFiltOrd(macchina.IdxMacchina, tStamp, tStamp.AddDays(1), true, ""); // solo se ho dati... if (tabDati.Count > 0) {