diff --git a/MP-Site/MappaStatoSeq.aspx b/MP-Site/MappaStatoSeq.aspx index 5ff0c8b8..c050d95b 100644 --- a/MP-Site/MappaStatoSeq.aspx +++ b/MP-Site/MappaStatoSeq.aspx @@ -1,6 +1,7 @@ <%@ Page Title="Mappa Sequencer" Language="C#" MasterPageFile="~/WebMasterPages/MAPO_refresh30.master" AutoEventWireup="true" CodeBehind="MappaStatoSeq.aspx.cs" Inherits="MoonPro.MappaStatoSeq" Async="true" %> <%@ Register Src="~/WebUserControls/mod_sequencerStati.ascx" TagPrefix="uc1" TagName="mod_sequencerStati" %> +<%@ Register Src="~/WebUserControls/mod_sequencerStatiJS.ascx" TagPrefix="uc1" TagName="mod_sequencerStatiJS" %> <%@ Register Src="~/WebUserControls/mod_mainMap.ascx" TagPrefix="uc1" TagName="mod_mainMap" %> @@ -18,7 +19,9 @@ - + + + <%--
@@ -28,7 +31,7 @@
- + --%>
diff --git a/MP-Site/MappaStatoSeq.aspx.cs b/MP-Site/MappaStatoSeq.aspx.cs index 3e441cb0..cbe67789 100644 --- a/MP-Site/MappaStatoSeq.aspx.cs +++ b/MP-Site/MappaStatoSeq.aspx.cs @@ -7,119 +7,123 @@ using System.Web.UI.WebControls; namespace MoonPro { - public partial class MappaStatoSeq : System.Web.UI.Page + public partial class MappaStatoSeq : System.Web.UI.Page + { + public resoconti _resoconti; + public int numGg { - public resoconti _resoconti; - public int numGg + get + { + int answ = 1; + try { - get - { - int answ = 1; - try - { - answ = Convert.ToInt32(ddlNumgg.SelectedValue); - } - catch - { - answ = 1; - } - return answ; - } + answ = Convert.ToInt32(ddlNumgg.SelectedValue); } - public intervalloDate intervalloAnalisi + catch { - get - { - intervalloDate answ = new intervalloDate(); - answ.fine = DateTime.Now; - answ.inizio = answ.fine.AddDays(-numGg); - return answ; - } - } - protected DS_applicazione.MacchineDataTable tabMacchine; - protected void Page_Load(object sender, EventArgs e) - { - _resoconti = new resoconti(); - tabMacchine = MapoDb.DataLayer.obj.taMacchine.GetData(); - if (!Page.IsPostBack) - { - ddlNumgg.DataBind(); - ddlNumgg.SelectedValue = memLayer.ML.confReadString("seq_gg"); - } - if (memLayer.ML.BoolSessionObj("graphDataRefresh")) - { - repSeq.DataBind(); - } - } - - - protected void repSeq_ItemDataBound(object sender, RepeaterItemEventArgs e) - { - mod_sequencerStati sequencer = (mod_sequencerStati)e.Item.FindControl("seqStato"); - sequencer.larghezza = memLayer.ML.IntSessionObj("WindowWidth") - 100; - sequencer.graphHeight = memLayer.ML.confReadInt("seq_height"); - sequencer.numSplit = memLayer.ML.confReadInt("seq_numSpl"); - try - { - sequencer.datiSequencer = _resoconti.sequenzaDati(sequencer.identificativo, intervalloAnalisi); - sequencer.doUpdate(); - sequencer.Visible = true; - } - catch - { - sequencer.Visible = false; - } - } - - protected void lnkCambiaModo_Click(object sender, EventArgs e) - { - // passa alla pagina richiesta... - LinkButton lb = (LinkButton)sender; - Response.Redirect(lb.CommandArgument); - } - - protected void ddlNumgg_SelectedIndexChanged(object sender, EventArgs e) - { - repSeq.DataBind(); - } - /// - /// recupera nome macchina da idx - /// - /// - /// - public string nomeMacchina(string idxMacchina) - { - string answ = "..."; - answ = tabMacchine.FindByIdxMacchina(idxMacchina).Nome; - return answ; - } - /// - /// recupera stato macchina da idx - /// - /// - /// - public string cssStatoMacchina(string idxMacchina) - { - string answ = "..."; - string codColore = resoconti.mngr.semaforoDaIdxStato(resoconti.mngr.statoMacchina(idxMacchina)); - answ = codColore; - return answ; - } - /// - /// rimanda alla pagina di dettaglio della macchina scelta - /// - /// - /// - protected void lnkMacchina_Click(object sender, EventArgs e) - { - LinkButton lb = (LinkButton)sender; - Session["IdxMacchina"] = lb.CommandArgument; - Response.Redirect("~/DettaglioMacchina.aspx"); - } - - protected void btnReload_Click(object sender, EventArgs e) - { - repSeq.DataBind(); + answ = 1; } + return answ; + } } + public intervalloDate intervalloAnalisi + { + get + { + intervalloDate answ = new intervalloDate(); + answ.fine = DateTime.Now; + answ.inizio = answ.fine.AddDays(-numGg); + return answ; + } + } + protected DS_applicazione.MacchineDataTable tabMacchine; + protected void Page_Load(object sender, EventArgs e) + { + //_resoconti = new resoconti(); + //tabMacchine = MapoDb.DataLayer.obj.taMacchine.GetData(); + if (!Page.IsPostBack) + { + ddlNumgg.DataBind(); + ddlNumgg.SelectedValue = memLayer.ML.confReadString("seq_gg"); + } + //if (memLayer.ML.BoolSessionObj("graphDataRefresh")) + //{ + // repSeq.DataBind(); + //} + } + + + protected void repSeq_ItemDataBound(object sender, RepeaterItemEventArgs e) + { + mod_sequencerStati sequencer = (mod_sequencerStati)e.Item.FindControl("seqStato"); + sequencer.larghezza = memLayer.ML.IntSessionObj("WindowWidth") - 100; + sequencer.graphHeight = memLayer.ML.confReadInt("seq_height"); + sequencer.numSplit = memLayer.ML.confReadInt("seq_numSpl"); + try + { + sequencer.datiSequencer = _resoconti.sequenzaDati(sequencer.identificativo, intervalloAnalisi); + sequencer.doUpdate(); + sequencer.Visible = true; + } + catch + { + sequencer.Visible = false; + } + } + + protected void lnkCambiaModo_Click(object sender, EventArgs e) + { + // passa alla pagina richiesta... + LinkButton lb = (LinkButton)sender; + Response.Redirect(lb.CommandArgument); + } + + protected void ddlNumgg_SelectedIndexChanged(object sender, EventArgs e) + { +#if false + repSeq.DataBind(); +#endif + } + /// + /// recupera nome macchina da idx + /// + /// + /// + public string nomeMacchina(string idxMacchina) + { + string answ = "..."; + answ = tabMacchine.FindByIdxMacchina(idxMacchina).Nome; + return answ; + } + /// + /// recupera stato macchina da idx + /// + /// + /// + public string cssStatoMacchina(string idxMacchina) + { + string answ = "..."; + string codColore = resoconti.mngr.semaforoDaIdxStato(resoconti.mngr.statoMacchina(idxMacchina)); + answ = codColore; + return answ; + } + /// + /// rimanda alla pagina di dettaglio della macchina scelta + /// + /// + /// + protected void lnkMacchina_Click(object sender, EventArgs e) + { + LinkButton lb = (LinkButton)sender; + Session["IdxMacchina"] = lb.CommandArgument; + Response.Redirect("~/DettaglioMacchina.aspx"); + } + + protected void btnReload_Click(object sender, EventArgs e) + { +#if false + repSeq.DataBind(); +#endif + } + } } \ No newline at end of file diff --git a/MP-Site/MappaStatoSeq.aspx.designer.cs b/MP-Site/MappaStatoSeq.aspx.designer.cs index 2906957a..7f149b73 100644 --- a/MP-Site/MappaStatoSeq.aspx.designer.cs +++ b/MP-Site/MappaStatoSeq.aspx.designer.cs @@ -49,22 +49,13 @@ namespace MoonPro { protected global::MoonPro.WebUserControls.mod_mainMap mod_mainMap; /// - /// Controllo repSeq. + /// Controllo mod_sequencerStatiJS2. /// /// /// 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.Repeater repSeq; - - /// - /// Controllo odsMappa. - /// - /// - /// 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.ObjectDataSource odsMappa; + protected global::MoonPro.WebUserControls.mod_sequencerStatiJS mod_sequencerStatiJS2; /// /// Controllo btnReload. diff --git a/MP-Site/WS/MPData.asmx.cs b/MP-Site/WS/MPData.asmx.cs index a3cdbb36..54f66a9a 100644 --- a/MP-Site/WS/MPData.asmx.cs +++ b/MP-Site/WS/MPData.asmx.cs @@ -119,17 +119,28 @@ namespace MoonPro.WS // recupero ITEMS List tlSerie; { - resoconti _resoconti = new resoconti(); + resoconti _resoconti = new resoconti(); intervalloDate intervallo = new intervalloDate(); intervallo.fine = Convert.ToDateTime(dataTo); - intervallo.inizio = Convert.ToDateTime(dataFrom); + intervallo.inizio = Convert.ToDateTime(dataFrom); tlSerie = _resoconti.sequenzaDatiVisJS(idxMacch, intervallo, numSplit); } + // opzioni! + visjsDsOptions opzioni = new visjsDsOptions + { + stack = false, + horizontalScroll = true, + moveable = true, + zoomable = true, + start = dataFrom, + end = dataTo + }; // unisco oggetti timelineVisJs fullData = new timelineVisJs { Groups = tlGroups, - Items = tlSerie + Items = tlSerie, + Options = opzioni }; answ = js.Serialize(fullData); // salvo in sessione l'oggetto... secondo durata impostata in web.config.. diff --git a/MP-Site/WebUserControls/mod_sequencerStatiJS.ascx b/MP-Site/WebUserControls/mod_sequencerStatiJS.ascx index 322a1931..7f249912 100644 --- a/MP-Site/WebUserControls/mod_sequencerStatiJS.ascx +++ b/MP-Site/WebUserControls/mod_sequencerStatiJS.ascx @@ -52,7 +52,7 @@ , end: '2018-05-30' }; // Crea la Timeline - var timeline = new vis.Timeline(container, tlData.Items, tlData.Groups, options); + var timeline = new vis.Timeline(container, tlData.Items, tlData.Groups, tlData.Options); } diff --git a/MP-Site/WebUserControls/mod_sequencerStatiJS.ascx.cs b/MP-Site/WebUserControls/mod_sequencerStatiJS.ascx.cs index f6cd92c8..6a66f13c 100644 --- a/MP-Site/WebUserControls/mod_sequencerStatiJS.ascx.cs +++ b/MP-Site/WebUserControls/mod_sequencerStatiJS.ascx.cs @@ -30,6 +30,26 @@ namespace MoonPro.WebUserControls } } /// + /// Idx macchina da plottare + /// + public intervalloDate periodo + { + get + { + intervalloDate answ = new intervalloDate + { + inizio = Convert.ToDateTime(DataFrom), + fine = Convert.ToDateTime(DataTo) + }; + return answ; + } + set + { + DataFrom = value.inizio.ToString("yyyy-MM-dd"); + DataTo = value.fine.ToString("yyyy-MM-dd"); + } + } + /// /// Num split massimo di segmenti da plottare /// public string numSplit diff --git a/MP-Site/test.aspx b/MP-Site/test.aspx index d65613c9..447a9430 100644 --- a/MP-Site/test.aspx +++ b/MP-Site/test.aspx @@ -9,7 +9,7 @@ <%--
--%> -
+ <%--
- - <%-- - - - --%> + --%> + diff --git a/MapoDb/resoconti.cs b/MapoDb/resoconti.cs index b82944ae..62fb4e69 100644 --- a/MapoDb/resoconti.cs +++ b/MapoDb/resoconti.cs @@ -909,7 +909,36 @@ public class visjsDsGroups ///
public string className; } - +/// +/// Groups Dataset di vis.js +/// +public class visjsDsOptions +{ + /// + /// Indica se debba salvare come stacked i valori (false = in linea x gruppo) + /// + public bool stack; + /// + /// Abilita scroll orizzontale + /// + public bool horizontalScroll; + /// + /// Abilita spostamento + /// + public bool moveable; + /// + /// Abilita zoom + /// + public bool zoomable; + /// + /// Data Start + /// + public string start; + /// + /// Data End + /// + public string end; +} /// /// Oggetto timeline vis.js con gruppi + items /// @@ -920,7 +949,11 @@ public class timelineVisJs /// public List Groups; /// - /// Items + /// Valori /// public List Items; + /// + /// Opzioni + /// + public visjsDsOptions Options; } \ No newline at end of file