Modifica x versione doppio plot su unica riga

This commit is contained in:
Samuele E. Locatelli
2019-12-12 11:38:30 +01:00
parent 054330e519
commit d57ef3cef7
3 changed files with 109 additions and 17 deletions
+24 -7
View File
@@ -7,19 +7,24 @@
<div class="col-12 col-md-3 col-lg-2">
<h2>Plot page</h2>
<div class="my-2">
Plot Type
<asp:CheckBox ID="chkShowSingle" runat="server" Text="Show Single Plot" AutoPostBack="true" OnCheckedChanged="chkShowSingle_CheckedChanged" />
</div>
<div class="my-2" runat="server" id="divSelPlot">
Single Plot Type
<asp:DropDownList runat="server" ID="ddlType" CssClass="form-control form-control-sm" AutoPostBack="true" OnSelectedIndexChanged="ddlType_SelectedIndexChanged">
<asp:ListItem Text="Scatter Plot" Value="ScatterPlots"></asp:ListItem>
<asp:ListItem Text="Density Plot" Value="DensityPlots"></asp:ListItem>
</asp:DropDownList>
</div>
<div class="my-2">
<div class="my-2" runat="server" id="divSelCol">
Num Columns
<asp:DropDownList runat="server" ID="ddlNumCol" CssClass="form-control form-control-sm" AutoPostBack="true" OnSelectedIndexChanged="ddlNumCol_SelectedIndexChanged">
<asp:ListItem Text="1" Value="col-12" Selected="True"></asp:ListItem>
<asp:ListItem Text="2" Value="col-6"></asp:ListItem>
<asp:ListItem Text="3" Value="col-4" Selected="True"></asp:ListItem>
<asp:ListItem Text="4" Value="col-3"></asp:ListItem>
<asp:ListItem Text="6" Value="col-2"></asp:ListItem>
<asp:ListItem Text="3" Value="col-4"></asp:ListItem>
<%--<asp:ListItem Text="4" Value="col-3"></asp:ListItem>
<asp:ListItem Text="6" Value="col-2"></asp:ListItem>--%>
</asp:DropDownList>
</div>
<div style="font-size: .6em">
@@ -43,15 +48,27 @@
<asp:Image ID="Image4" runat="server" CssClass="img-fluid" ImageUrl="~/results/J000000043/DensityPlots_Un-adjusted.svg" />
</div>
</div>--%>
<asp:ObjectDataSource ID="odsPlotSelected" runat="server" SelectMethod="getSelectedJobs" TypeName="WebLCP.dataLayer"></asp:ObjectDataSource>
<div class="row">
<asp:Repeater ID="repPlots" runat="server" DataSourceID="odsPlotSelected">
<asp:Repeater ID="repPlotSingle" runat="server" DataSourceID="odsPlotSelected">
<ItemTemplate>
<div runat="server" class='<%# ddlNumCol.SelectedValue %>'>
<asp:Image ID="svgImage" runat="server" CssClass="img-fluid" ImageUrl='<%# $"~/results/{Eval("jobCode")}/{ddlType.SelectedValue}_Un-adjusted.svg" %>' />
</div>
</ItemTemplate>
</asp:Repeater>
<asp:ObjectDataSource ID="odsPlotSelected" runat="server" SelectMethod="getSelectedJobs" TypeName="WebLCP.dataLayer"></asp:ObjectDataSource>
</div>
<div class="row">
<asp:Repeater ID="repPlotAll" runat="server" DataSourceID="odsPlotSelected">
<ItemTemplate>
<div runat="server" class="col-6">
<asp:Image ID="svgImage1" runat="server" CssClass="img-fluid" ImageUrl='<%# $"~/results/{Eval("jobCode")}/DensityPlots_Un-adjusted.svg" %>' />
</div>
<div runat="server" class="col-6">
<asp:Image ID="svgImage2" runat="server" CssClass="img-fluid" ImageUrl='<%# $"~/results/{Eval("jobCode")}/ScatterPlots_Un-adjusted.svg" %>' />
</div>
</ItemTemplate>
</asp:Repeater>
</div>
</div>
</div>
+40 -1
View File
@@ -7,16 +7,49 @@ namespace WebLCP.WUC
protected void Page_Load(object sender, EventArgs e)
{
mod_jobsList.eh_doRefresh += Mod_jobsList_eh_doRefresh;
doUpdate();
}
private void Mod_jobsList_eh_doRefresh(object sender, EventArgs e)
{
doUpdate();
}
/// <summary>
/// Mostra entrambi i grafici o 1 alla volta
/// </summary>
protected bool showSingle
{
get
{
return chkShowSingle.Checked;
}
set
{
chkShowSingle.Checked = value;
}
}
private void doUpdate()
{
repPlots.DataBind();
// in base allos tato di check del selettore scelgo cosa mostrare...
repPlotSingle.Visible = false;
repPlotAll.Visible = false;
if (showSingle)
{
chkShowSingle.Text = "Show Single Plots";
divSelPlot.Visible = true;
divSelCol.Visible = true;
repPlotSingle.Visible = true;
repPlotSingle.DataBind();
}
else
{
chkShowSingle.Text = "Show All Plots";
divSelPlot.Visible = false;
divSelCol.Visible = false;
repPlotAll.Visible = true;
repPlotAll.DataBind();
}
}
protected void ddlNumCol_SelectedIndexChanged(object sender, EventArgs e)
@@ -28,5 +61,11 @@ namespace WebLCP.WUC
{
doUpdate();
}
protected void chkShowSingle_CheckedChanged(object sender, EventArgs e)
{
// se selezionato abilito repeatre a due, atlrimenti repeater singolo!
doUpdate();
}
}
}
+45 -9
View File
@@ -14,6 +14,24 @@ namespace WebLCP.WUC
public partial class mod_showSvgList
{
/// <summary>
/// Controllo chkShowSingle.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBox chkShowSingle;
/// <summary>
/// Controllo divSelPlot.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divSelPlot;
/// <summary>
/// Controllo ddlType.
/// </summary>
@@ -23,6 +41,15 @@ namespace WebLCP.WUC
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlType;
/// <summary>
/// Controllo divSelCol.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divSelCol;
/// <summary>
/// Controllo ddlNumCol.
/// </summary>
@@ -41,15 +68,6 @@ namespace WebLCP.WUC
/// </remarks>
protected global::WebLCP.WUC.mod_jobsList mod_jobsList;
/// <summary>
/// Controllo repPlots.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.Repeater repPlots;
/// <summary>
/// Controllo odsPlotSelected.
/// </summary>
@@ -58,5 +76,23 @@ namespace WebLCP.WUC
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource odsPlotSelected;
/// <summary>
/// Controllo repPlotSingle.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.Repeater repPlotSingle;
/// <summary>
/// Controllo repPlotAll.
/// </summary>
/// <remarks>
/// Campo generato automaticamente.
/// Per la modifica, spostare la dichiarazione di campo dal file di progettazione al file code-behind.
/// </remarks>
protected global::System.Web.UI.WebControls.Repeater repPlotAll;
}
}