visibilità da sel macchina x LOAD/UNLOAD

This commit is contained in:
Samuele Locatelli
2021-06-30 13:04:25 +02:00
parent 07cbd9f029
commit d80691ac0c
8 changed files with 87 additions and 46 deletions
+1 -1
View File
@@ -16,7 +16,7 @@
<div class="row" runat="server" id="divRuntime">
<div class="col-3">
<asp:LinkButton runat="server" ID="lbtReset" class="btn btn-info btn-block text-center" OnClick="lbtReset_Click"><i class="fa fa-microchip" aria-hidden="true"></i>&nbsp;<%: hfMachine.Value %></asp:LinkButton>
<asp:LinkButton runat="server" ID="lbtReset" class="btn btn-info btn-block text-center" OnClick="lbtReset_Click"><i class="fa fa-refresh" aria-hidden="true"></i>&nbsp;<%: hfMachine.Value %></asp:LinkButton>
</div>
<div class="col-9">
<div class="d-flex text-center">
+3 -7
View File
@@ -24,12 +24,7 @@ namespace NKC_WF.WebUserControls
{
if (!string.IsNullOrEmpty(value))
{
string url = HttpContext.Current.Request.Url.AbsoluteUri;
if (url.Contains("?mach="))
{
url = url.Substring(0, url.IndexOf("?mach="));
}
url += $"?mach={value}";
string url = $"{currPage}?mach={value}";
Response.Redirect(url);
}
}
@@ -39,7 +34,7 @@ namespace NKC_WF.WebUserControls
{
get
{
string url = HttpContext.Current.Request.Url.AbsoluteUri;
string url = HttpContext.Current.Request.Url.PathAndQuery;
if (url.Contains("?mach="))
{
url = url.Substring(0, url.IndexOf("?mach="));
@@ -64,6 +59,7 @@ namespace NKC_WF.WebUserControls
{
divSelect.Visible = !machSelected;
divRuntime.Visible = machSelected;
hfMachClass.Value = currMachine == "NE01" ? "dark" : "light";
lbtReset.Attributes.Remove("class");
lbtReset.Attributes.Add("class", $"btn btn-block text-center btn-{hfMachClass.Value}");
}
+2 -2
View File
@@ -17,9 +17,9 @@
<div class="col-5 text-right">
</div>
</div>
<div class="card-body py-1 textBig">
<div class="card-body py-1 textBig" id="divMain" runat="server">
<asp:Timer ID="timerLong" runat="server" Interval="30000" OnTick="timerLong_Tick"></asp:Timer>
<asp:UpdatePanel runat="server" ID="upnlBCode" UpdateMode="Conditional" ChildrenAsTriggers="true">
<asp:UpdatePanel runat="server" ID="upnlMain" UpdateMode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
<asp:Timer ID="timerLoad" runat="server" Interval="2000" OnTick="timerLoad_Tick"></asp:Timer>
<div class="row">
+36 -18
View File
@@ -5,6 +5,39 @@ namespace NKC_WF
{
public partial class MachineLoad : BasePage
{
#region Private Methods
private void Cmp_stackLoading_eh_doRefresh(object sender, EventArgs e)
{
forceRefresh();
}
private void forceRefresh()
{
// verifico CI SIA la macchina...
if (string.IsNullOrEmpty(cmp_MachSem.currMachine))
{
divMain.Visible = false;
}
else
{
divMain.Visible = true;
cmp_stackLoading.doUpdate();
cmp_ML_ShDet.BatchId = cmp_stackLoading.BatchIdCurr;
cmp_ML_ShDet1.BatchId = cmp_stackLoading.BatchIdCurr;
cmp_ML_ShDet2.BatchId = cmp_stackLoading.BatchIdCurr;
cmp_ML_ShDet3.BatchId = cmp_stackLoading.BatchIdCurr;
cmp_ML_ShDet.doUpdate();
cmp_ML_ShDet1.doUpdate();
cmp_ML_ShDet2.doUpdate();
cmp_ML_ShDet3.doUpdate();
}
}
#endregion Private Methods
#region Protected Methods
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
@@ -15,31 +48,16 @@ namespace NKC_WF
cmp_stackLoading.eh_doRefresh += Cmp_stackLoading_eh_doRefresh;
}
private void Cmp_stackLoading_eh_doRefresh(object sender, EventArgs e)
{
forceRefresh();
}
private void forceRefresh()
{
cmp_stackLoading.doUpdate();
cmp_ML_ShDet.BatchId = cmp_stackLoading.BatchIdCurr;
cmp_ML_ShDet1.BatchId = cmp_stackLoading.BatchIdCurr;
cmp_ML_ShDet2.BatchId = cmp_stackLoading.BatchIdCurr;
cmp_ML_ShDet3.BatchId = cmp_stackLoading.BatchIdCurr;
cmp_ML_ShDet.doUpdate();
cmp_ML_ShDet1.doUpdate();
cmp_ML_ShDet2.doUpdate();
cmp_ML_ShDet3.doUpdate();
}
protected void timerLoad_Tick(object sender, EventArgs e)
{
forceRefresh();
}
protected void timerLong_Tick(object sender, EventArgs e)
{
Response.Redirect(Request.RawUrl);
}
#endregion Protected Methods
}
}
+11 -2
View File
@@ -23,6 +23,15 @@ namespace NKC_WF
/// </remarks>
protected global::NKC_WF.WebUserControls.cmp_MachSem cmp_MachSem;
/// <summary>
/// divMain control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divMain;
/// <summary>
/// timerLong control.
/// </summary>
@@ -33,13 +42,13 @@ namespace NKC_WF
protected global::System.Web.UI.Timer timerLong;
/// <summary>
/// upnlBCode control.
/// upnlMain control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.UpdatePanel upnlBCode;
protected global::System.Web.UI.UpdatePanel upnlMain;
/// <summary>
/// timerLoad control.
+1 -1
View File
@@ -24,7 +24,7 @@
</div>
</ContentTemplate>
</asp:UpdatePanel>
<div class="card-body py-1 bg-dark">
<div class="card-body py-1 bg-dark" id="divMain" runat="server">
<asp:UpdatePanel runat="server" ID="upnlStats" UpdateMode="Conditional">
<ContentTemplate>
<asp:HiddenField ID="hfBatchID" runat="server" />
+24 -15
View File
@@ -123,23 +123,32 @@ namespace NKC_WF
/// </summary>
private void doUpdate()
{
// imposto dati correnti
bool doUpdate = setCurrData();
// aggiorno child
cmp_MU_stats.BatchId = BatchId;
cmp_MU_bins.BatchId = BatchId;
cmp_MU_carts.BatchId = BatchId;
cmp_MU_svgViewer.BatchId = BatchId;
cmp_MU_svgViewer.SheetId = SheetId;
if (doUpdate)
// verifico CI SIA la macchina...
if (string.IsNullOrEmpty(cmp_MachSem.currMachine))
{
cmp_MU_svgViewer.doUpdate();
upnlDrawings.DataBind();
upnlDrawings.Update();
upnlTitle.Update();
divMain.Visible = false;
}
else
{
divMain.Visible = true;
// imposto dati correnti
bool doUpdate = setCurrData();
// aggiorno child
cmp_MU_stats.BatchId = BatchId;
cmp_MU_bins.BatchId = BatchId;
cmp_MU_carts.BatchId = BatchId;
cmp_MU_svgViewer.BatchId = BatchId;
cmp_MU_svgViewer.SheetId = SheetId;
if (doUpdate)
{
cmp_MU_svgViewer.doUpdate();
upnlDrawings.DataBind();
upnlDrawings.Update();
upnlTitle.Update();
}
// definisco se mostrare PartMIA
hlPartMIA.Visible = showPartMIA;
}
// definisco se mostrare PartMIA
hlPartMIA.Visible = showPartMIA;
}
/// <summary>
+9
View File
@@ -41,6 +41,15 @@ namespace NKC_WF
/// </remarks>
protected global::System.Web.UI.WebControls.HyperLink hlPartMIA;
/// <summary>
/// divMain control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl divMain;
/// <summary>
/// upnlStats control.
/// </summary>