Merge branch 'Release/CreateBasePageTab3'

This commit is contained in:
Samuele Locatelli
2024-02-26 20:17:59 +01:00
67 changed files with 637 additions and 1208 deletions
+7 -3
View File
@@ -6,11 +6,15 @@
<div class="d-flex justify-content-center flex-wrap align-items-center">
@if(infosIob.iType == MP.Data.Objects.Enums.IobType.rPi)
{
<img src="/images/linuxLogo.png" style="height: 70px; width: 70px" />
<img src="/images/linuxLogo.png" style="height: 7em; width: 7em;" />
}
else if (infosIob.iType == MP.Data.Objects.Enums.IobType.WIN || infosIob.iType == MP.Data.Objects.Enums.IobType.ND)
else if (infosIob.iType == MP.Data.Objects.Enums.IobType.WIN)
{
<img src="/images/winLogo.png" style="height: 70px; width: 70px" />
<img src="/images/winLogo.png" style="height: 7em; width: 7em;" />
}
else if (infosIob.iType == MP.Data.Objects.Enums.IobType.ND)
{
<img src="/images/pythonLogo.png" style="height: 7em; width: 7em;" />
}
</div>
</div>
+42 -72
View File
@@ -3,10 +3,17 @@
<div class="card text-white mapBlock shadow bg-secondary p-0 m-0">
<div class="card-body">
<div class="placeholder-glow">
<span class="placeholder col-7"></span>
<span class="placeholder col-4"></span>
<span class="placeholder col-4"></span>
<span class="placeholder col-7"></span>
<span class="placeholder col-12 pholderHeight"></span>
<span class="placeholder col-12"></span>
<span class="placeholder col-3"></span>
<span class="placeholder col-8"></span>
<span class="placeholder col-3"></span>
<span class="placeholder col-7"></span>
<span class="placeholder col-3"></span>
<span class="placeholder col-8"></span>
</div>
</div>
</div>
@@ -19,10 +26,16 @@ else
<div class="card-body">
<div class="alert alert-info w-100 fs-3">No data</div>
<div class="placeholder-glow">
<span class="placeholder col-7"></span>
<span class="placeholder col-4"></span>
<span class="placeholder col-4"></span>
<span class="placeholder col-7"></span>
<span class="placeholder col-12 pholderHeight"></span>
<span class="placeholder col-12"></span>
<span class="placeholder col-3"></span>
<span class="placeholder col-8"></span>
<span class="placeholder col-3"></span>
<span class="placeholder col-7"></span>
<span class="placeholder col-3"></span>
<span class="placeholder col-8"></span>
</div>
</div>
</div>
@@ -33,8 +46,8 @@ else
{
if (Width > 640)
{
<div class="card shadow rounded rounded-4 @borderCss @overlayCss" @onclick="ShowDetail">
<img src="@ImgUrlMacc(RecMSE.Url)" class="card-img-top imgFitToSize" alt="@RecMSE.CodMacchina">
<div class="card bg-dark shadow @cssClassBorder @cssClassOverlay rounded-4" @onclick="ShowDetail">
<img src="@ImgUrlMacc(RecMSE.Url)" class="card-img-top imgFitToSize rounded-top-4" alt="@RecMSE.CodMacchina">
<div class="bg-black">
<div class="card-img-overlay p-0 d-flex flex-row-reverse align-items-start">
<div class="labelTop px-2 w-100">
@@ -44,10 +57,15 @@ else
</div>
</div>
</div>
<div class="card-body p-0 bg-dark">
<div class="@RecMSE.Semaforo p-0">
<div class="d-flex justify-content-center fs-5">
<span><b>@RecMSE.DescrizioneStato</b>: &nbsp; @(FormatDurata(RecMSE.Durata))</span>
<div class="card-body rounded-bottom-4 p-0 bg-dark">
<div class="@RecMSE.Semaforo py-0 px-1">
<div class="d-flex justify-content-between fs-5">
<div class="px-0 @cssClassTextDescr">
<span>@RecMSE.DescrizioneStato </span>
</div>
<div class="px-0">
<b>@(FormatDurata(RecMSE.Durata))</b>
</div>
</div>
</div>
<div class="d-flex justify-content-around">
@@ -92,8 +110,8 @@ else
}
else
{
<div class="card shadow rounded rounded-4 @borderCss @overlayCss" @onclick="ShowDetail">
<img src="@ImgUrlMacc(RecMSE.Url)" class="card-img-top imgFitToSize" alt="@RecMSE.CodMacchina">
<div class="card bg-dark shadow @cssClassBorder @cssClassOverlay rounded-4" @onclick="ShowDetail">
<img src="@ImgUrlMacc(RecMSE.Url)" class="card-img-top imgFitToSize rounded-top-4" alt="@RecMSE.CodMacchina">
<div class="bg-black">
<div class="card-img-overlay p-0 d-flex flex-row-reverse align-items-start">
<div class="labelTop px-2 py-0 w-100">
@@ -103,10 +121,10 @@ else
</div>
</div>
</div>
<div class="card-body p-0 bg-dark">
<div class="card-body rounded-bottom-4 p-0 bg-dark">
<div class="@RecMSE.Semaforo py-0 px-1">
<div class="d-flex justify-content-between fs-5">
<div class="px-0 @textDescrCss">
<div class="px-0 @cssClassTextDescr">
<span>@RecMSE.DescrizioneStato</span>
</div>
<div class="px-0">
@@ -156,57 +174,6 @@ else
</div>
</div>
</div>
@* <div class="cardObj shadow" @onclick="ShowDetail">
<div class="card-body p-0">
<div class="@RecMSE.Semaforo borderStd p-1 text-center">
<div class="fs-5" style="line-height: 1.8rem;">
<b>@RecMSE.Nome</b>
<br />
<b>@RecMSE.DescrizioneStato</b>: &nbsp; @(FormatDurata(RecMSE.Durata))
</div>
</div>
@if (showCard)
{
<div class="d-flex justify-content-between w-100">
<div class="px-2">
<div class="d-flex text-success">
<div class="px-0">
<i class="fa-regular fa-circle-check"></i>&nbsp;@($"{RecMSE.PezziConf}")
</div>
@if (datiProdAct != null && datiProdAct.PzConfScarto > 0)
{
<div class="px-1">
<div class="text-danger">
@($"(- {datiProdAct.PzConfScarto})")
</div>
</div>
}
</div>
</div>
<div class="px-2">
<div class="text-end text-warning">
<i class="fa-solid fa-layer-group"></i>&nbsp;@($"{RecMSE.PezziProd}")
</div>
</div>
</div>
<div class="d-flex justify-content-between w-100" style="height: 100px; width: 100px;">
<div class="col-6">
<EgwCoreLib.Razor.CircleGaugeMulti Titolo="@($"{currMaxVal}")" Testo="#pz prod" maxVal="@currMaxVal" ListInner="@innerCircleVals" ListOuter="@outerCircleVals" ShowCircleBtn="true"></EgwCoreLib.Razor.CircleGaugeMulti>
</div>
<div style="font-size: 1rem; flex-direction: column; font-size: 1rem; display: flex; justify-content: center;" class="me-3 col-6">
<div class="text-center text-light d-flex justify-content-between">
<div class="col-4"><span>ART.</span></div>
<div class="col-8">@RecMSE.CodArticolo</div>
</div>
<div class="text-center text-light d-flex justify-content-between small">
<div class="col-4">ORD.</div>
<div class="col-8">@($"ODL{RecMSE.IdxOdl:00000000}")</div>
</div>
</div>
</div>
}
</div>
</div> *@
}
}
else
@@ -286,7 +253,7 @@ else
</div>
</div>
<div class="d-flex justify-content-between mt-1">
<div class="col-10 mb-2 px-2 py-1 @RecMSE.Semaforo statusCard">
<div class="col mb-2 px-2 py-1 @RecMSE.Semaforo rounded">
<div class="d-flex justify-content-center ">
<div class="p-0 mr-auto me-1">
@RecMSE.DescrizioneStato
@@ -296,12 +263,15 @@ else
</div>
</div>
</div>
<div class="col-2">
<div class="px-1 w-100">
@* <a target="_blank" href="@($"disegni/{RecMSE.CodArticolo}.pdf")" class="btn btn-sm btn-secondary w-100"><i class="fa-regular fa-file-pdf"></i></a> *@
<button class="btn btn-sm btn-info w-100" @onclick="ToggleDraw"><i class="fa-regular fa-file-pdf"></i></button>
@if (enableDisegno)
{
<div class="col-2">
<div class="px-1 w-100">
@* <a target="_blank" href="@($"disegni/{RecMSE.CodArticolo}.pdf")" class="btn btn-sm btn-secondary w-100"><i class="fa-regular fa-file-pdf"></i></a> *@
<button class="btn btn-sm btn-info w-100" @onclick="ToggleDraw"><i class="fa-regular fa-file-pdf"></i></button>
</div>
</div>
</div>
}
</div>
</div>
}
@@ -309,7 +279,7 @@ else
}
}
@if (showDraw && RecMSE != null)
@if (enableDisegno && showDraw && RecMSE != null)
{
string docUrl = string.IsNullOrEmpty(RecMSE.Disegno) ? $"disegni/{RecMSE.CodArticolo}.pdf" : $"disegni/{RecMSE.Disegno}.pdf";
<PdfDisplay Width="100%" PdfUrl="@docUrl" HeightList="@heightList"></PdfDisplay>
+44 -39
View File
@@ -81,30 +81,35 @@ namespace MP_TAB3.Components
#endregion Public Methods
/// <summary>
/// CSS Class x overlay (effetto spento x macchina spenta/ sGr)
/// </summary>
protected string overlayCss
{
get
{
string answ = "";
if (RecMSE != null)
{
answ = RecMSE.Semaforo == "sGr" ? "bg-dark opacity-50" : "";
}
return answ;
}
}
#region Protected Fields
protected string baseCss = "sem";
protected int currMaxVal = 1000;
protected List<CircleGaugeMulti.CircSegm> innerCircleVals = new List<CircleGaugeMulti.CircSegm>();
protected int kaFactor = 60 / 2;
protected int maxVal = 1000;
protected List<CircleGaugeMulti.CircSegm> outerCircleVals = new List<CircleGaugeMulti.CircSegm>();
#endregion Protected Fields
#region Protected Properties
[Inject]
protected IConfiguration config { get; set; } = null!;
/// <summary>
/// CSS Class bordo da stato macchina
/// </summary>
protected string borderCss
protected string cssClassBorder
{
get
{
string answ = "border-2";
string answ = "border-3";
if (RecMSE != null)
{
switch (RecMSE.Semaforo)
@@ -117,7 +122,6 @@ namespace MP_TAB3.Components
answ += " border-danger";
break;
case "sGr":
answ += " border-dark";
break;
@@ -140,14 +144,30 @@ namespace MP_TAB3.Components
}
/// <summary>
/// CSS calss x testo (se descr lunga scorre...)
/// CSS Class x overlay (effetto spento x macchina spenta/ sGr)
/// </summary>
protected string textDescrCss
protected string cssClassOverlay
{
get
{
string answ = "";
if (RecMSE != null)
{
answ = RecMSE.Semaforo == "sGr" ? "bg-dark opacity-50" : "";
}
return answ;
}
}
/// <summary>
/// CSS class x testo (se descr lunga scorre...)
/// </summary>
protected string cssClassTextDescr
{
get
{
string answ = "text-nowrap";
if (RecMSE != null && RecMSE.DescrizioneStato.Length > 18)
if (RecMSE != null && RecMSE.DescrizioneStato.Length >= 17)
{
answ = " scroll-left";
}
@@ -155,22 +175,6 @@ namespace MP_TAB3.Components
}
}
#region Protected Fields
protected string baseCss = "sem";
protected int currMaxVal = 1000;
protected List<CircleGaugeMulti.CircSegm> innerCircleVals = new List<CircleGaugeMulti.CircSegm>();
protected int kaFactor = 60 / 2;
protected int maxVal = 1000;
protected List<CircleGaugeMulti.CircSegm> outerCircleVals = new List<CircleGaugeMulti.CircSegm>();
#endregion Protected Fields
#region Protected Properties
[Inject]
protected IConfiguration config { get; set; } = null!;
protected ProdAdvDispl.ProdCounter CurrCount
{
get
@@ -217,18 +221,18 @@ namespace MP_TAB3.Components
{
if (firstRender)
{
//await getWDim();
await InvokeAsync(StateHasChanged);
}
isLoading = RecMSE == null;
isMobile = await JSRuntime.InvokeAsync<bool>("isDevice");
await Task.Delay(1);
//return base.OnAfterRenderAsync(firstRender);
}
protected override async Task OnInitializedAsync()
{
isLoading = true;
// abilitazione disegni...
TabDServ.ConfigGetVal("enableDisegno", ref enableDisegno);
// se configurata uso cartella virtuale... altrimenti cartella processo
var sImgBasePath = config.GetValue<string>("OptConf:ImgBasePath");
if (!string.IsNullOrEmpty(sImgBasePath))
@@ -318,6 +322,7 @@ namespace MP_TAB3.Components
#region Private Fields
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
private bool enableDisegno = false;
private string imgBasePath = "";
private bool isLoading = false;
+8 -27
View File
@@ -1,16 +1,4 @@
/* Bordi */
/*.rCAll {
border-radius: 10px;
}
.rCTop {
border-radius: 10px 10px 0 0;
}
.rCBot {
border-radius: 0 0 10px 10px;
}*/
.mapBlock {
.mapBlock {
font-family: 'Open Sans Condensed', sans-serif;
color: #FFF;
background-image: linear-gradient(#111, #000);
@@ -35,7 +23,6 @@
position: relative;
width: 70%;
white-space: nowrap;
/*display: inline-block;*/
}
.scroll-left span {
/*display: inline-block;*/
@@ -69,9 +56,6 @@
.sVe {
text-align: left;
background: #198754;
/*background: rgba(0,255,80,.6);*/
/*padding: 0px 4px 0px 4px;*/
/*color: Yellow;*/
color: #fff;
}
.sGi {
@@ -79,21 +63,17 @@
background: #ffc107;
background: rgba(255, 220, 0, 0.6);
color: #fff;
/*padding: 0px 4px 0px 4px;*/
}
.sRo {
text-align: left;
background-color: #e2001a;
background: rgba(240, 0, 10, 0.6);
color: #fff;
/*padding: 0px 4px 0px 4px;*/
}
.sBl {
text-align: left;
background: #3690FF;
background: rgba(0, 80, 255, 0.6);
/*padding: 0px 4px 0px 4px;*/
/*color: Yellow;*/
color: #fff;
}
.sGr {
@@ -101,18 +81,19 @@
background-color: #bcbcbc;
background: rgba(180, 180, 180, 0.6);
color: #fff;
/*padding: 0px 4px 0px 4px;*/
}
/*end semafori */
.card-body {
background-color: currentColor;
background-image: linear-gradient(121deg, rgba(255, 255, 255, 0.2) -0.71%, rgba(255, 255, 255, 0.05) 97.66%);
border-radius: 0 0 15px 15px;
}
.imgFitToSize {
height: 11rem;
object-fit: cover;
border-radius: 15px 15px 0 0;
}
.pholderHeight {
height: 6rem;
object-fit: cover;
}
@media (max-width: 640.98px) {
.imgFitToSize {
@@ -121,7 +102,7 @@
.card-body {
background-color: transparent;
}
}
.statusCard {
border-radius: 0.5rem;
.pholderHeight {
height: 4rem;
}
}
+9 -29
View File
@@ -1,16 +1,4 @@
/* Bordi */
/*.rCAll {
border-radius: 10px;
}
.rCTop {
border-radius: 10px 10px 0 0;
}
.rCBot {
border-radius: 0 0 10px 10px;
}*/
.mapBlock {
font-family: 'Open Sans Condensed', sans-serif;
color: #FFF;
@@ -37,7 +25,6 @@
position: relative;
width: 70%;
white-space: nowrap;
/*display: inline-block;*/
}
.scroll-left span {
@@ -72,9 +59,6 @@
.sVe {
text-align: left;
background: #198754;
/*background: rgba(0,255,80,.6);*/
/*padding: 0px 4px 0px 4px;*/
/*color: Yellow;*/
color: #fff;
}
@@ -83,7 +67,6 @@
background: #ffc107;
background: rgba(255,220,0,.6);
color: #fff;
/*padding: 0px 4px 0px 4px;*/
}
.sRo {
@@ -91,15 +74,12 @@
background-color: #e2001a;
background: rgba(240,0,10,.6);
color: #fff;
/*padding: 0px 4px 0px 4px;*/
}
.sBl {
text-align: left;
background: #3690FF;
background: rgba(0,80,255,.6);
/*padding: 0px 4px 0px 4px;*/
/*color: Yellow;*/
color: #fff;
}
@@ -108,19 +88,21 @@
background-color: #bcbcbc;
background: rgba(180,180,180,.6);
color: #fff;
/*padding: 0px 4px 0px 4px;*/
}
/*end semafori */
.card-body {
background-color: currentColor;
background-image: linear-gradient(121deg, rgba(255, 255, 255, 0.20) -0.71%, rgba(255, 255, 255, 0.05) 97.66%);
border-radius: 0 0 15px 15px
}
.imgFitToSize {
height: 11rem;
object-fit: cover;
border-radius: 15px 15px 0 0;
}
.pholderHeight {
height: 6rem;
object-fit: cover;
}
@media (max-width: 640.98px){
@@ -130,11 +112,9 @@
.card-body{
background-color: transparent;
}
.pholderHeight {
height: 4rem;
}
}
.statusCard {
border-radius: 0.5rem;
}
+1 -1
View File
@@ -1 +1 @@
.mapBlock{font-family:'Open Sans Condensed',sans-serif;color:#fff;background-image:linear-gradient(#111,#000);min-width:8em;}.labelTop{padding:.1em;width:auto;min-height:0;top:0;left:auto;bottom:auto;color:#fff;background:#2200de;background:rgba(33,36,39,.75);border-radius:15px 15px 0 0;}.scroll-left{height:1.5em;overflow:hidden;position:relative;width:70%;white-space:nowrap;}.scroll-left span{position:absolute;width:100%;height:100%;margin:0;line-height:1.5em;-moz-transform:translateX(0%);-webkit-transform:translateX(0%);transform:translateX(0%);-moz-animation:scroll-left 8s ease infinite;-webkit-animation:scroll-left 8s ease infinite;animation:scroll-left 8s ease infinite;}@keyframes scroll-left{0%{transform:translateX(0%);}30%{transform:translateX(0%);}80%{transform:translateX(-50%);}}.sVe{text-align:left;background:#198754;color:#fff;}.sGi{text-align:left;background:#ffc107;background:rgba(255,220,0,.6);color:#fff;}.sRo{text-align:left;background-color:#e2001a;background:rgba(240,0,10,.6);color:#fff;}.sBl{text-align:left;background:#3690ff;background:rgba(0,80,255,.6);color:#fff;}.sGr{text-align:left;background-color:#bcbcbc;background:rgba(180,180,180,.6);color:#fff;}.card-body{background-color:currentColor;background-image:linear-gradient(121deg,rgba(255,255,255,.2) -.71%,rgba(255,255,255,.05) 97.66%);border-radius:0 0 15px 15px;}.imgFitToSize{height:11rem;object-fit:cover;border-radius:15px 15px 0 0;}@media(max-width:640.98px){.imgFitToSize{height:8rem;}.card-body{background-color:transparent;}}.statusCard{border-radius:.5rem;}
.mapBlock{font-family:'Open Sans Condensed',sans-serif;color:#fff;background-image:linear-gradient(#111,#000);min-width:8em;}.labelTop{padding:.1em;width:auto;min-height:0;top:0;left:auto;bottom:auto;color:#fff;background:#2200de;background:rgba(33,36,39,.75);border-radius:15px 15px 0 0;}.scroll-left{height:1.5em;overflow:hidden;position:relative;width:70%;white-space:nowrap;}.scroll-left span{position:absolute;width:100%;height:100%;margin:0;line-height:1.5em;-moz-transform:translateX(0%);-webkit-transform:translateX(0%);transform:translateX(0%);-moz-animation:scroll-left 8s ease infinite;-webkit-animation:scroll-left 8s ease infinite;animation:scroll-left 8s ease infinite;}@keyframes scroll-left{0%{transform:translateX(0%);}30%{transform:translateX(0%);}80%{transform:translateX(-50%);}}.sVe{text-align:left;background:#198754;color:#fff;}.sGi{text-align:left;background:#ffc107;background:rgba(255,220,0,.6);color:#fff;}.sRo{text-align:left;background-color:#e2001a;background:rgba(240,0,10,.6);color:#fff;}.sBl{text-align:left;background:#3690ff;background:rgba(0,80,255,.6);color:#fff;}.sGr{text-align:left;background-color:#bcbcbc;background:rgba(180,180,180,.6);color:#fff;}.card-body{background-color:currentColor;background-image:linear-gradient(121deg,rgba(255,255,255,.2) -.71%,rgba(255,255,255,.05) 97.66%);}.imgFitToSize{height:11rem;object-fit:cover;}.pholderHeight{height:6rem;object-fit:cover;}@media(max-width:640.98px){.imgFitToSize{height:8rem;}.card-body{background-color:transparent;}.pholderHeight{height:4rem;}}
-1
View File
@@ -1 +0,0 @@

-162
View File
@@ -1,162 +0,0 @@
using global::Microsoft.AspNetCore.Components;
using MP.Data.DatabaseModels;
using MP.Data.Services;
using NLog;
namespace MP_TAB3.Components
{
public partial class MseSampler : IDisposable
{
#region Public Properties
[Parameter]
public EventCallback<List<MappaStatoExpl>> E_Updated { get; set; }
/// <summary> Moltiplicatore campionamento:
/// HF: se > 1 (mappa)
/// LF: se < 1 (dettaglio) </summary>
[Parameter]
public double SampleMult { get; set; } = 1;
#endregion Public Properties
#region Public Methods
public void Dispose()
{
if (aTimer != null)
{
disposeTimer();
}
}
#endregion Public Methods
#region Protected Fields
protected int fastTimerMSec = 3000;
#endregion Protected Fields
#region Protected Properties
[Inject]
protected IConfiguration config { get; set; } = null!;
protected int fastRefreshMs
{
get
{
// tempo variabile tra +/- 10% del target (SampleMult) della freq standard di update MSE
int answ = ((int)(fastTimerMSec / SampleMult * rnd.Next(900, 1100))) / 1000;
return answ;
}
}
[Inject]
protected MessageService MServ { get; set; } = null!;
[Inject]
protected StatusData SDService { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e)
{
try
{
var pUpd = Task.Run(async () =>
{
numCall++;
// se supero limite --> resetto
if (numCall >= maxCall)
{
StartTimer();
numCall = 0;
}
else
{
aTimer.Interval = fastRefreshMs;
await InvokeAsync(RefreshData);
}
});
pUpd.Wait();
}
catch (Exception exc)
{
Log.Error($"Eccezione durante MseSampler.ElapsedTimer{Environment.NewLine}{exc}");
}
}
protected override void OnInitialized()
{
SetupConf();
StartTimer();
}
protected void StartTimer()
{
if (aTimer != null)
{
disposeTimer();
}
aTimer = new System.Timers.Timer(fastRefreshMs);
aTimer.Elapsed += ElapsedTimer;
aTimer.Enabled = true;
aTimer.Start();
Log.Info("MseSampler Timer started!");
}
#endregion Protected Methods
#region Private Fields
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
private System.Timers.Timer aTimer = null!;
/// <summary>
/// max chimate prima di fare dispose/GC
/// </summary>
private int maxCall = 10;
/// <summary>
/// Numero chiamate al sampler
/// </summary>
private int numCall = 0;
private Random rnd = new Random();
#endregion Private Fields
#region Private Methods
private void disposeTimer()
{
aTimer.Elapsed -= ElapsedTimer;
aTimer.Stop();
aTimer.Dispose();
GC.Collect();
Log.Info("MseSampler Timer Disposed!");
}
private async Task RefreshData()
{
List<MappaStatoExpl> ListMSE = await SDService.MseGetAll();
await MServ.SaveMse(ListMSE);
await E_Updated.InvokeAsync(ListMSE);
}
private void SetupConf()
{
// sistemo i parametri opzionali...
fastTimerMSec = config.GetValue<int>("OptConf:msRefresh");
maxCall = config.GetValue<int>("OptConf:samplerMaxCall");
Log.Trace($"MseSampler setupConf | Effettuato setup parametri | fastRefreshMSec: {fastTimerMSec} | maxCall: {maxCall}");
}
#endregion Private Methods
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
<div class=" col-4 col-sm-4 col-md-4 col-lg-2 flex-fill ">
<div class=" col-4 col-sm-4 col-md-4 col-lg-2 flex-fill2 ">
<div class="p-2 h-100 w-100">
<div class="@objCss text-center card w-100 h-100" @onclick="() => ReportSelected()">
<div class="card-body text-light">
+2 -2
View File
@@ -42,11 +42,11 @@
</div>
<div class="col-12">
<div class="row">
@foreach (var item in ListComplete)
@foreach (var item in listCauScarto)
{
<div class="col-6 col-lg-4 col-xl-3 mt-2">
<button class="btn w-100 btn-lg @($"btn-{item.cssClass}")" @onclick="() => doSave(item)">
<i class="@item.icona"></i> <span style="font-size: 1rem;">@item.label</span>
<i class="@item.icona"></i><span cs="fs-5 ps-2">@item.label</span>
</button>
<asp:LinkButton ID="hlRegistra" runat="server" OnClick="hlRegistra_Click" CommandArgument='<%# Eval("value") %>' CssClass='<%# "btn w-100 btn-lg btn-" + Eval("cssClass")%>'>
+6 -2
View File
@@ -32,7 +32,7 @@ namespace MP_TAB3.Components
}
protected string errMsg { get; set; } = "";
protected List<vSelCauScartoModel> ListComplete { get; set; } = new List<vSelCauScartoModel>();
protected List<vSelCauScartoModel> listCauScarto { get; set; } = new List<vSelCauScartoModel>();
[Inject]
protected MessageService MServ { get; set; } = null!;
@@ -124,7 +124,11 @@ namespace MP_TAB3.Components
protected async Task ReloadData()
{
ListComplete = await TabServ.VSCS_getAll();
var rawData = await TabServ.VSCS_getAll();
listCauScarto = rawData
.Where(x => x.isEnabled)
.OrderBy(x => x.label)
.ToList();
}
protected void resetDate()
+6 -1
View File
@@ -3,13 +3,18 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<Version>6.16.2402.2610</Version>
<Version>6.16.2402.2620</Version>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>MP_TAB3</RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Components\MseSampler.razor.cs" />
</ItemGroup>
<ItemGroup>
<Content Remove="compilerconfig.json" />
<Content Remove="Components\MseSampler.razor" />
</ItemGroup>
<ItemGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
@page "/alarms"
@inherits BasePage
<MseSampler SampleMult="0.5" E_Updated="RefreshData"></MseSampler>
@if (string.IsNullOrEmpty(IdxMacc) || CurrMSE == null)
{
<EgwCoreLib.Razor.LoadingData></EgwCoreLib.Razor.LoadingData>
+2 -61
View File
@@ -1,74 +1,15 @@
using global::Microsoft.AspNetCore.Components;
using MP.Data.DatabaseModels;
using MP.Data.Services;
namespace MP_TAB3.Pages
{
public partial class Alarms : IDisposable
public partial class Alarms
{
#region Public Methods
public void Dispose()
{
IdxMacc = "";
CurrMSE = null;
//GC.Collect();
}
#endregion Public Methods
#region Protected Properties
protected MappaStatoExpl? CurrMSE { get; set; } = null;
protected string IdxMacc { get; set; } = "";
[Inject]
protected MessageService MsgServ { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
await ReloadData();
}
protected async Task RefreshData(List<MappaStatoExpl> newList)
{
var ListMSE = newList;
if (!string.IsNullOrEmpty(IdxMacc))
{
var rawData = ListMSE.Find(x => x.IdxMacchina == IdxMacc);
if (rawData != null)
{
CurrMSE = rawData;
}
else
{
await ReloadData();
}
}
await InvokeAsync(StateHasChanged);
}
#endregion Protected Methods
#region Private Methods
private async Task ReloadData()
{
if (string.IsNullOrEmpty(IdxMacc))
{
IdxMacc = await MsgServ.IdxMaccGet();
// recupero MSE macchina....
if (!string.IsNullOrEmpty(IdxMacc))
{
CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
}
}
}
#endregion Private Methods
}
}
+2
View File
@@ -0,0 +1,2 @@
+160
View File
@@ -0,0 +1,160 @@
using Microsoft.AspNetCore.Components;
using MP.Data.DatabaseModels;
using MP.Data;
using MP.Data.Services;
using Newtonsoft.Json;
using NLog.Fluent;
namespace MP_TAB3.Pages
{
/// <summary>
/// Pagina base da cui ereditare metodi x refresh dati da RedisChannel (MessagePipe)
/// </summary>
public partial class BasePage : IDisposable
{
#region Public Properties
/// <summary>
/// Dato di dettaglio MSE per macchina
/// </summary>
public MappaStatoExpl? CurrMSE { get; set; } = null;
/// <summary>
/// Macchina selezionata
/// </summary>
public string IdxMacc { get; set; } = "";
[Inject]
public MessageService MsgServ { get; set; } = null!;
[Inject]
public TabDataFeeder TDFeeder { get; set; } = null!;
#endregion Public Properties
#region Public Methods
/// <summary>
/// Metodo dispose
/// </summary>
public virtual void Dispose()
{
IdxMacc = "";
CurrMSE = null;
TDFeeder.dataPipe.EA_NewMessage -= DataPipe_EA_NewMessage;
}
#endregion Public Methods
#region Protected Methods
/// <summary>
/// Override Oninit x aggancio evento update da MessagePipe
/// </summary>
/// <returns></returns>
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
await ReloadData();
TDFeeder.dataPipe.EA_NewMessage += DataPipe_EA_NewMessage;
}
/// <summary>
/// Metodo refresh con controllo salvataggio in LocalStorage ogni 5 sec
/// </summary>
/// <param name="ListMSE"></param>
/// <returns></returns>
protected async Task RefreshData(List<MappaStatoExpl> ListMSE)
{
// se vecchio salvo sul browser...
if (DateTime.Now.Subtract(lastSave).TotalSeconds > 5)
{
// salvo in LocalStorage...
await MsgServ.SaveMse(ListMSE);
lastSave = DateTime.Now;
}
if (!string.IsNullOrEmpty(IdxMacc))
{
var rawData = ListMSE.Find(x => x.IdxMacchina == IdxMacc);
if (rawData != null)
{
CurrMSE = rawData;
}
else
{
await RefreshMBlock();
}
}
}
/// <summary>
/// Refresh con rilettura da LocalStorage
/// </summary>
/// <returns></returns>
protected async Task RefreshMBlock()
{
// recupero MSE macchina....
if (!string.IsNullOrEmpty(IdxMacc))
{
CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
}
}
#endregion Protected Methods
#region Private Fields
/// <summary>
/// DateTime ultimo salvataggio in LocalStorage
/// </summary>
private DateTime lastSave = DateTime.Now;
#endregion Private Fields
#region Private Methods
/// <summary>
/// Ricevuto nuovi dati da mostrare!
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <exception cref="NotImplementedException"></exception>
private void DataPipe_EA_NewMessage(object? sender, EventArgs e)
{
PubSubEventArgs currArgs = (PubSubEventArgs)e;
// conversione on-the-fly List<string> --> allarmi
if (!string.IsNullOrEmpty(currArgs.newMessage))
{
try
{
List<MappaStatoExpl>? dataList = JsonConvert.DeserializeObject<List<MappaStatoExpl>>(currArgs.newMessage);
if (dataList != null)
{
InvokeAsync(() => RefreshData(dataList));
}
}
catch
{ }
}
InvokeAsync(() =>
{
StateHasChanged();
});
}
protected virtual async Task ReloadData()
{
if (string.IsNullOrEmpty(IdxMacc))
{
IdxMacc = await MsgServ.IdxMaccGet();
}
// recupero MSE macchina....
if (!string.IsNullOrEmpty(IdxMacc))
{
CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
}
}
#endregion Private Methods
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
@page "/controls"
@inherits BasePage
<MseSampler SampleMult="0.5" E_Updated="RefreshData"></MseSampler>
@if (string.IsNullOrEmpty(IdxMacc) || CurrMSE == null || IsLoading)
{
<EgwCoreLib.Razor.LoadingData></EgwCoreLib.Razor.LoadingData>
+4 -46
View File
@@ -1,29 +1,14 @@
using global::Microsoft.AspNetCore.Components;
using MP.Data.DatabaseModels;
using MP.Data.Services;
namespace MP_TAB3.Pages
{
public partial class Controls : IDisposable
public partial class Controls
{
#region Public Methods
public void Dispose()
{
IdxMacc = "";
CurrMSE = null;
//GC.Collect();
}
#endregion Public Methods
#region Protected Properties
protected MappaStatoExpl? CurrMSE { get; set; } = null;
protected string IdxMacc { get; set; } = "";
[Inject]
protected MessageService MsgServ { get; set; } = null!;
#endregion Protected Properties
@@ -38,27 +23,10 @@ namespace MP_TAB3.Pages
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
await ReloadData();
}
protected async Task RefreshData(List<MappaStatoExpl> newList)
{
var ListMSE = newList;
if (!string.IsNullOrEmpty(IdxMacc))
{
var rawData = ListMSE.Find(x => x.IdxMacchina == IdxMacc);
if (rawData != null)
{
CurrMSE = rawData;
}
else
{
await ReloadData();
}
}
await InvokeAsync(StateHasChanged);
}
protected void SetMacc(string selIdxMacc)
{
IdxMaccSubSel = selIdxMacc;
@@ -69,24 +37,14 @@ namespace MP_TAB3.Pages
#region Private Fields
private string IdxMaccSubSel = "";
private bool IsLoading = false;
#endregion Private Fields
#region Private Methods
private async Task ReloadData()
{
if (string.IsNullOrEmpty(IdxMacc))
{
IdxMacc = await MsgServ.IdxMaccGet();
// recupero MSE macchina....
if (!string.IsNullOrEmpty(IdxMacc))
{
CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
}
}
}
#endregion Private Methods
}
+2 -1
View File
@@ -1,6 +1,7 @@
@page "/declarations"
@inherits BasePage
<MseSampler SampleMult="0.5" E_Updated="RefreshData"></MseSampler>
@if (string.IsNullOrEmpty(IdxMacc) || CurrMSE == null)
{
<EgwCoreLib.Razor.LoadingData></EgwCoreLib.Razor.LoadingData>
+2 -61
View File
@@ -1,57 +1,15 @@
using global::Microsoft.AspNetCore.Components;
using MP.Data.DatabaseModels;
using MP.Data.Services;
namespace MP_TAB3.Pages
{
public partial class Declarations : IDisposable
public partial class Declarations
{
#region Public Methods
public void Dispose()
{
IdxMacc = "";
CurrMSE = null;
//GC.Collect();
}
#endregion Public Methods
#region Protected Properties
protected MappaStatoExpl? CurrMSE { get; set; } = null;
protected string IdxMacc { get; set; } = "";
[Inject]
protected MessageService MsgServ { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
await ReloadData();
}
protected async Task RefreshData(List<MappaStatoExpl> newList)
{
var ListMSE = newList;
if (!string.IsNullOrEmpty(IdxMacc))
{
var rawData = ListMSE.Find(x => x.IdxMacchina == IdxMacc);
if (rawData != null)
{
CurrMSE = rawData;
}
else
{
await ReloadData();
}
}
await InvokeAsync(StateHasChanged);
}
protected void SetMacc(string selIdxMacc)
{
IdxMaccSubSel = selIdxMacc;
@@ -64,22 +22,5 @@ namespace MP_TAB3.Pages
private string IdxMaccSubSel = "";
#endregion Private Fields
#region Private Methods
private async Task ReloadData()
{
if (string.IsNullOrEmpty(IdxMacc))
{
IdxMacc = await MsgServ.IdxMaccGet();
// recupero MSE macchina....
if (!string.IsNullOrEmpty(IdxMacc))
{
CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
}
}
}
#endregion Private Methods
}
}
+8 -10
View File
@@ -1,3 +1,11 @@
using Microsoft.AspNetCore.Components;
using MP.Data.DatabaseModels;
using MP.Data;
using MP.Data.Services;
using MP_TAB3.Shared;
using NLog.Fluent;
using Newtonsoft.Json;
namespace MP_TAB3.Pages
{
public partial class Index : IDisposable
@@ -18,16 +26,6 @@ namespace MP_TAB3.Pages
await Task.Delay(1);
}
protected override async Task OnInitializedAsync()
{
await Task.Delay(1);
}
protected override async Task OnParametersSetAsync()
{
await Task.Delay(1);
}
#endregion Protected Methods
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
@page "/iob-info"
@inherits BasePage
<MseSampler SampleMult="0.5" E_Updated="RefreshData"></MseSampler>
@if (string.IsNullOrEmpty(IdxMacc) || CurrMSE == null)
{
<EgwCoreLib.Razor.LoadingData></EgwCoreLib.Razor.LoadingData>
+2 -61
View File
@@ -1,74 +1,15 @@
using global::Microsoft.AspNetCore.Components;
using MP.Data.DatabaseModels;
using MP.Data.Services;
namespace MP_TAB3.Pages
{
public partial class IobInfo : IDisposable
public partial class IobInfo
{
#region Public Methods
public void Dispose()
{
IdxMacc = "";
CurrMSE = null;
//GC.Collect();
}
#endregion Public Methods
#region Protected Properties
protected MappaStatoExpl? CurrMSE { get; set; } = null;
protected string IdxMacc { get; set; } = "";
[Inject]
protected MessageService MsgServ { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
await ReloadData();
}
protected async Task RefreshData(List<MappaStatoExpl> newList)
{
var ListMSE = newList;
if (!string.IsNullOrEmpty(IdxMacc))
{
var rawData = ListMSE.Find(x => x.IdxMacchina == IdxMacc);
if (rawData != null)
{
CurrMSE = rawData;
}
else
{
await ReloadData();
}
}
await InvokeAsync(StateHasChanged);
}
#endregion Protected Methods
#region Private Methods
private async Task ReloadData()
{
if (string.IsNullOrEmpty(IdxMacc))
{
IdxMacc = await MsgServ.IdxMaccGet();
// recupero MSE macchina....
if (!string.IsNullOrEmpty(IdxMacc))
{
CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
}
}
}
#endregion Private Methods
}
}
+2 -1
View File
@@ -1,6 +1,7 @@
@page "/machine-detail"
<MseSampler SampleMult="0.5" E_Updated="RefreshData"></MseSampler>
@inherits BasePage
@if (string.IsNullOrEmpty(IdxMacc) || CurrMSE == null)
{
<EgwCoreLib.Razor.LoadingData></EgwCoreLib.Razor.LoadingData>
+6 -67
View File
@@ -1,31 +1,13 @@
using Microsoft.AspNetCore.Components;
using MP.Data.DatabaseModels;
using MP.Data.Services;
using NLog;
namespace MP_TAB3.Pages
{
public partial class MachineDetail : IDisposable
public partial class MachineDetail
{
#region Public Methods
public void Dispose()
{
IdxMacc = "";
CurrMSE = null;
//GC.Collect();
}
#endregion Public Methods
#region Protected Properties
protected MappaStatoExpl? CurrMSE { get; set; } = null;
protected string IdxMacc { get; set; } = "";
[Inject]
protected MessageService MsgServ { get; set; } = null!;
[Inject]
protected SharedMemService MStor { get; set; } = null!;
@@ -38,39 +20,15 @@ namespace MP_TAB3.Pages
protected override async Task OnInitializedAsync()
{
await ReloadData();
await base.OnInitializedAsync();
// recupero parametri configurazione...
await setupConf();
if (enableSchedaTecnica)
{
checkLottiOdl();
}
}
protected async Task RefreshData(List<MappaStatoExpl> newList)
{
var ListMSE = newList;
if (!string.IsNullOrEmpty(IdxMacc))
{
var rawData = ListMSE.Find(x => x.IdxMacchina == IdxMacc);
if (rawData != null)
{
CurrMSE = rawData;
}
else
{
await RefreshMBlock();
}
}
}
protected async Task RefreshMBlock()
{
// recupero MSE macchina....
if (!string.IsNullOrEmpty(IdxMacc))
{
CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
}
}
protected void SetMacc(string selIdxMacc)
{
IdxMaccSubSel = selIdxMacc;
@@ -84,6 +42,7 @@ namespace MP_TAB3.Pages
private bool enableMagLotti = false;
private bool enableSchedaTecnica = false;
private string IdxMaccSubSel = "";
private DateTime lastSave = DateTime.Now;
#endregion Private Fields
@@ -113,27 +72,7 @@ namespace MP_TAB3.Pages
#endif
}
private async Task ReloadData()
{
try
{
if (string.IsNullOrEmpty(IdxMacc))
{
IdxMacc = await MsgServ.IdxMaccGet();
}
// recupero MSE macchina....
if (!string.IsNullOrEmpty(IdxMacc))
{
CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
}
}
catch (Exception exc)
{
Log.Error($"Eccezione in ReloadData{Environment.NewLine}{exc}");
}
// recupero parametri configurazione...
await setupConf();
}
private async Task setupConf()
{
+1 -1
View File
@@ -1,6 +1,6 @@
@page "/notes"
@inherits BasePage
<MseSampler SampleMult="0.5" E_Updated="RefreshData"></MseSampler>
@if (string.IsNullOrEmpty(IdxMacc) || CurrMSE == null)
{
<EgwCoreLib.Razor.LoadingData></EgwCoreLib.Razor.LoadingData>
+2 -61
View File
@@ -1,74 +1,15 @@
using global::Microsoft.AspNetCore.Components;
using MP.Data.DatabaseModels;
using MP.Data.Services;
namespace MP_TAB3.Pages
{
public partial class Notes : IDisposable
public partial class Notes
{
#region Public Methods
public void Dispose()
{
IdxMacc = "";
CurrMSE = null;
//GC.Collect();
}
#endregion Public Methods
#region Protected Properties
protected MappaStatoExpl? CurrMSE { get; set; } = null;
protected string IdxMacc { get; set; } = "";
[Inject]
protected MessageService MsgServ { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
await ReloadData();
}
protected async Task RefreshData(List<MappaStatoExpl> newList)
{
var ListMSE = newList;
if (!string.IsNullOrEmpty(IdxMacc))
{
var rawData = ListMSE.Find(x => x.IdxMacchina == IdxMacc);
if (rawData != null)
{
CurrMSE = rawData;
}
else
{
await ReloadData();
}
}
await InvokeAsync(StateHasChanged);
}
#endregion Protected Methods
#region Private Methods
private async Task ReloadData()
{
if (string.IsNullOrEmpty(IdxMacc))
{
IdxMacc = await MsgServ.IdxMaccGet();
// recupero MSE macchina....
if (!string.IsNullOrEmpty(IdxMacc))
{
CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
}
}
}
#endregion Private Methods
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
@page "/odl"
@inherits BasePage
<MseSampler SampleMult="0.5" E_Updated="RefreshData"></MseSampler>
@if (string.IsNullOrEmpty(IdxMacc) || CurrMSE == null)
{
<EgwCoreLib.Razor.LoadingData></EgwCoreLib.Razor.LoadingData>
+2 -79
View File
@@ -1,64 +1,12 @@
using global::Microsoft.AspNetCore.Components;
using MP.Data.DatabaseModels;
using MP.Data.Services;
using NLog;
namespace MP_TAB3.Pages
{
public partial class ODL : IDisposable
public partial class ODL
{
#region Public Methods
public void Dispose()
{
IdxMacc = "";
CurrMSE = null;
//GC.Collect();
}
#endregion Public Methods
#region Protected Properties
protected MappaStatoExpl? CurrMSE { get; set; } = null;
protected string IdxMacc { get; set; } = "";
[Inject]
protected MessageService MsgServ { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected override async Task OnInitializedAsync()
{
await ReloadData();
}
protected async Task RefreshData(List<MappaStatoExpl> newList)
{
var ListMSE = newList;
if (!string.IsNullOrEmpty(IdxMacc))
{
var rawData = ListMSE.Find(x => x.IdxMacchina == IdxMacc);
if (rawData != null)
{
CurrMSE = rawData;
}
else
{
await RefreshMBlock();
}
}
}
protected async Task RefreshMBlock()
{
// recupero MSE macchina....
if (!string.IsNullOrEmpty(IdxMacc))
{
CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
}
await base.OnInitializedAsync();
}
protected void SetMacc(string selIdxMacc)
@@ -70,33 +18,8 @@ namespace MP_TAB3.Pages
#region Private Fields
private static Logger Log = LogManager.GetCurrentClassLogger();
private string IdxMaccSubSel = "";
#endregion Private Fields
#region Private Methods
private async Task ReloadData()
{
try
{
if (string.IsNullOrEmpty(IdxMacc))
{
IdxMacc = await MsgServ.IdxMaccGet();
}
// recupero MSE macchina....
if (!string.IsNullOrEmpty(IdxMacc))
{
CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
}
}
catch (Exception exc)
{
Log.Error($"Eccezione in ReloadData{Environment.NewLine}{exc}");
}
}
#endregion Private Methods
}
}
+1 -2
View File
@@ -1,7 +1,6 @@
@page "/parameters"
@inherits BasePage
<MseSampler SampleMult="0.5" E_Updated="RefreshData"></MseSampler>
@if (string.IsNullOrEmpty(IdxMacc) || CurrMSE == null)
{
<EgwCoreLib.Razor.LoadingData></EgwCoreLib.Razor.LoadingData>
+2 -62
View File
@@ -1,74 +1,14 @@
using global::Microsoft.AspNetCore.Components;
using MP.Data.DatabaseModels;
using MP.Data.Services;
namespace MP_TAB3.Pages
{
public partial class Parameters : IDisposable
public partial class Parameters
{
#region Public Methods
public void Dispose()
{
IdxMacc = "";
CurrMSE = null;
//GC.Collect();
}
#endregion Public Methods
#region Protected Properties
protected MappaStatoExpl? CurrMSE { get; set; } = null;
protected string IdxMacc { get; set; } = "";
[Inject]
protected MessageService MsgServ { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected override async Task OnInitializedAsync()
{
await ReloadData();
}
protected async Task RefreshData(List<MappaStatoExpl> newList)
{
var ListMSE = newList;
if (!string.IsNullOrEmpty(IdxMacc))
{
var rawData = ListMSE.Find(x => x.IdxMacchina == IdxMacc);
if (rawData != null)
{
CurrMSE = rawData;
}
else
{
await ReloadData();
}
}
await InvokeAsync(StateHasChanged);
await base.OnInitializedAsync();
}
#endregion Protected Methods
#region Private Methods
private async Task ReloadData()
{
if (string.IsNullOrEmpty(IdxMacc))
{
IdxMacc = await MsgServ.IdxMaccGet();
// recupero MSE macchina....
if (!string.IsNullOrEmpty(IdxMacc))
{
CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
}
}
}
#endregion Private Methods
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
@page "/prod-plan"
@inherits BasePage
<MseSampler SampleMult="0.5" E_Updated="RefreshData"></MseSampler>
@if (string.IsNullOrEmpty(IdxMacc) || CurrMSE == null)
{
<EgwCoreLib.Razor.LoadingData></EgwCoreLib.Razor.LoadingData>
+2 -75
View File
@@ -1,88 +1,15 @@
using global::Microsoft.AspNetCore.Components;
using MP.Data.DatabaseModels;
using MP.Data.Services;
using NLog;
namespace MP_TAB3.Pages
{
public partial class ProdPlan : IDisposable
public partial class ProdPlan
{
#region Public Methods
public void Dispose()
{
IdxMacc = "";
CurrMSE = null;
//GC.Collect();
}
#endregion Public Methods
#region Protected Properties
protected MappaStatoExpl? CurrMSE { get; set; } = null;
protected string IdxMacc { get; set; } = "";
[Inject]
protected MessageService MsgServ { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
await ReloadData();
}
protected async Task RefreshData(List<MappaStatoExpl> newList)
{
var ListMSE = newList;
if (!string.IsNullOrEmpty(IdxMacc))
{
var rawData = ListMSE.Find(x => x.IdxMacchina == IdxMacc);
if (rawData != null)
{
CurrMSE = rawData;
}
else
{
await ReloadData();
}
}
await InvokeAsync(StateHasChanged);
}
#endregion Protected Methods
#region Private Fields
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
#region Private Methods
private async Task ReloadData()
{
try
{
if (string.IsNullOrEmpty(IdxMacc))
{
IdxMacc = await MsgServ.IdxMaccGet();
// recupero MSE macchina....
if (!string.IsNullOrEmpty(IdxMacc))
{
CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
}
}
}
catch (Exception exc)
{
Log.Error($"Eccerione in ReloadData{Environment.NewLine}{exc}");
}
}
#endregion Private Methods
}
}
+1 -2
View File
@@ -1,7 +1,6 @@
@page "/prod-stop"
@inherits BasePage
<MseSampler SampleMult="0.5" E_Updated="RefreshData"></MseSampler>
@if (string.IsNullOrEmpty(IdxMacc) || CurrMSE == null)
{
<EgwCoreLib.Razor.LoadingData></EgwCoreLib.Razor.LoadingData>
+17 -40
View File
@@ -7,26 +7,24 @@ using NLog;
namespace MP_TAB3.Pages
{
public partial class ProdStop : IDisposable
public partial class ProdStop
{
#region Public Methods
public void Dispose()
{
IdxMacc = "";
CurrMSE = null;
//GC.Collect();
}
#endregion Public Methods
#region Protected Fields
protected int dltMinRealtime = 1;
protected bool isProcessing = false;
protected int minAnticipoRicalcolo = 1;
protected bool rdm_ChkOnly = false;
protected int rdm_nEvCheck = 1;
protected int rdm_nEvStep = 1;
#endregion Protected Fields
@@ -35,13 +33,11 @@ namespace MP_TAB3.Pages
protected string alertCss { get; set; } = "alert-danger";
protected MappaStatoExpl? CurrMSE { get; set; } = null;
protected DateTime DtRif { get; set; } = DateTime.Now;
protected List<vSelEventiBCodeModel> events2show { get; set; } = new List<vSelEventiBCodeModel>();
protected string IdxMacc { get; set; } = "";
/// <summary>
/// Determina se insert sia Realtime o batch con DataOra (in base a diff tra DataOra
@@ -65,9 +61,6 @@ namespace MP_TAB3.Pages
[Inject]
protected StatusData MDataService { get; set; } = null!;
[Inject]
protected MessageService MServ { get; set; } = null!;
[Inject]
protected NavigationManager NavMan { get; set; } = null!;
@@ -209,7 +202,7 @@ namespace MP_TAB3.Pages
if (ListMSE != null)
{
// salvo in LocalStorage...
await MServ.SaveMse(ListMSE);
await MsgServ.SaveMse(ListMSE);
// aggiorno MSE attuale
CurrMSE = ListMSE.Find(x => x.IdxMacchina == IdxMacc);
}
@@ -217,13 +210,14 @@ namespace MP_TAB3.Pages
// se non era realtime --> rimando a commenti
if (needReload)
{
await MServ.LastOpenedPageSet("notes");
await MsgServ.LastOpenedPageSet("notes");
NavMan.NavigateTo("notes");
}
}
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
dltMinRealtime = SMServ.GetConfInt("dltMinRealtime");
minAnticipoRicalcolo = SMServ.GetConfInt("minAnticipoRicalcolo");
rdm_nEvStep = SMServ.GetConfInt("rdm_nEvStep");
@@ -233,22 +227,7 @@ namespace MP_TAB3.Pages
await ReloadData();
}
protected async Task RefreshData(List<MappaStatoExpl> newList)
{
var ListMSE = newList;
if (!string.IsNullOrEmpty(IdxMacc))
{
var rawData = ListMSE.Find(x => x.IdxMacchina == IdxMacc);
if (rawData != null)
{
CurrMSE = rawData;
}
else
{
await ReloadData();
}
}
}
protected void SetDate(DateTime newDate)
{
@@ -267,25 +246,23 @@ namespace MP_TAB3.Pages
private int MatrOpr
{
get => MServ.MatrOpr;
get => MsgServ.MatrOpr;
}
#endregion Private Properties
#region Private Methods
private async Task ReloadData()
protected override async Task ReloadData()
{
if (string.IsNullOrEmpty(IdxMacc))
{
try
{
IdxMacc = await MServ.IdxMaccGet();
// recupero MSE macchina....
if (!string.IsNullOrEmpty(IdxMacc))
{
CurrMSE = await MServ.GetMachineMse(IdxMacc);
}
await base.ReloadData();
// recupero eventi
var eventsAll = await TabDServ.AnagEventiGetByMacch(IdxMacc);
if (eventsAll != null)
{
@@ -295,7 +272,7 @@ namespace MP_TAB3.Pages
catch (Exception exc)
{
Log.Error($"ProdStop: Eccezione in reloadData {Environment.NewLine}{exc}");
await MServ.LastOpenedPageSet("/");
await MsgServ.LastOpenedPageSet("/");
}
}
}
+2 -2
View File
@@ -41,12 +41,12 @@
}
@if (oprsList.Count > 0)
@if (oprList.Count > 0)
{
<div class="mb-1">
<span class="fs-5 fw-bold">Selezionare un operatore</span>
<select class="form-select" @bind="matrOpr">
@foreach (var opr in oprsList)
@foreach (var opr in oprList)
{
<option value="@opr.MatrOpr">@($"{opr.Cognome} {opr.Nome}")</option>
}
+9 -3
View File
@@ -17,7 +17,7 @@ namespace MP_TAB3.Pages
{
txtError = "";
matrOpr = 0;
oprsList = new List<AnagOperatoriModel>();
oprList = new List<AnagOperatoriModel>();
//GC.Collect();
}
@@ -71,7 +71,7 @@ namespace MP_TAB3.Pages
[Inject]
protected NavigationManager NavMan { get; set; } = null!;
protected List<AnagOperatoriModel> oprsList { get; set; } = new List<AnagOperatoriModel>();
protected List<AnagOperatoriModel> oprList { get; set; } = new List<AnagOperatoriModel>();
protected AnagOperatoriModel rigaOpr { get; set; } = null!;
@@ -126,7 +126,13 @@ namespace MP_TAB3.Pages
matrOpr = await MsgServ.GetLastMatrOprAsync();
TDService.ConfigGetVal("cookieDayExpire", ref expDays);
ShowScanBarcode = !SMServ.GetConfBool("TAB_WebCamHide");
oprsList = await TDService.ElencoOperatori();
oprList = await TDService.ElencoOperatori();
// filtro solo abilitati + ordino x nome...
oprList = oprList
.Where(x => x.isEnabled)
.OrderBy(x => x.Cognome)
.ThenBy(x => x.Nome)
.ToList();
}
protected async Task ScanDoneHandler(string value)
+1 -1
View File
@@ -1,6 +1,6 @@
@page "/scrap"
@inherits BasePage
<MseSampler SampleMult="0.25" E_Updated="RefreshData"></MseSampler>
@if (string.IsNullOrEmpty(IdxMacc) || CurrMSE == null)
{
<EgwCoreLib.Razor.LoadingData></EgwCoreLib.Razor.LoadingData>
+2 -61
View File
@@ -1,57 +1,15 @@
using global::Microsoft.AspNetCore.Components;
using MP.Data.DatabaseModels;
using MP.Data.Services;
namespace MP_TAB3.Pages
{
public partial class Scrap : IDisposable
public partial class Scrap
{
#region Public Methods
public void Dispose()
{
IdxMacc = "";
CurrMSE = null;
//GC.Collect();
}
#endregion Public Methods
#region Protected Properties
protected MappaStatoExpl? CurrMSE { get; set; } = null;
protected string IdxMacc { get; set; } = "";
[Inject]
protected MessageService MsgServ { get; set; } = null!;
#endregion Protected Properties
#region Protected Methods
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
await ReloadData();
}
protected async Task RefreshData(List<MappaStatoExpl> newList)
{
var ListMSE = newList;
if (!string.IsNullOrEmpty(IdxMacc))
{
var rawData = ListMSE.Find(x => x.IdxMacchina == IdxMacc);
if (rawData != null)
{
CurrMSE = rawData;
}
else
{
await ReloadData();
}
}
await InvokeAsync(StateHasChanged);
}
protected void SetMacc(string selIdxMacc)
{
IdxMaccSubSel = selIdxMacc;
@@ -64,22 +22,5 @@ namespace MP_TAB3.Pages
private string IdxMaccSubSel = "";
#endregion Private Fields
#region Private Methods
private async Task ReloadData()
{
if (string.IsNullOrEmpty(IdxMacc))
{
IdxMacc = await MsgServ.IdxMaccGet();
// recupero MSE macchina....
if (!string.IsNullOrEmpty(IdxMacc))
{
CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
}
}
}
#endregion Private Methods
}
}
-1
View File
@@ -1,6 +1,5 @@
@page "/status-map"
<MseSampler SampleMult="1.5" E_Updated="SaveData"></MseSampler>
<div class="pe-2">
<div class="row mb-2">
@if (ListMSE == null || ListMSE.Count == 0 || isCalcSize)
+43 -6
View File
@@ -1,9 +1,11 @@
using global::Microsoft.AspNetCore.Components;
using Microsoft.JSInterop;
using MP.Data;
using MP.Data.Conf;
using MP.Data.DatabaseModels;
using MP.Data.Services;
using MP_TAB3.Shared;
using Newtonsoft.Json;
using NLog;
using System.Runtime.ExceptionServices;
@@ -16,6 +18,7 @@ namespace MP_TAB3.Pages
public void Dispose()
{
ListMSE = null;
TDFeeder.dataPipe.EA_NewMessage -= DataPipe_EA_NewMessage;
GC.Collect();
}
@@ -39,8 +42,6 @@ namespace MP_TAB3.Pages
protected bool _showCard = false;
protected int maxCol = 6;
protected string showArt = "";
#endregion Protected Fields
@@ -79,6 +80,9 @@ namespace MP_TAB3.Pages
[Inject]
protected TabDataService TabDServ { get; set; } = null!;
[Inject]
protected TabDataFeeder TDFeeder { get; set; } = null!;
protected int Width { get; set; } = 0;
#endregion Protected Properties
@@ -131,8 +135,11 @@ namespace MP_TAB3.Pages
protected override async Task OnInitializedAsync()
{
setDefaults();
ListMSE = null;
setDefaults();
TDFeeder.dataPipe.EA_NewMessage += DataPipe_EA_NewMessage;
Random rnd = new Random();
await Task.Delay(rnd.Next(1, 50));
SetupConf();
var LastOpenedPage = await MsgServ.LastOpenedPageGet();
var currMacc = await MsgServ.IdxMaccGet();
@@ -143,7 +150,6 @@ namespace MP_TAB3.Pages
{
NavMan.NavigateTo(LastOpenedPage);
}
//NavMan.NavigateTo($"machine-detail");
}
}
@@ -158,11 +164,14 @@ namespace MP_TAB3.Pages
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
private bool doBlink = false;
#endregion Private Fields
#region Private Properties
private string baseLang { get; set; } = "";
private List<MappaStatoExpl>? ListMSE { get; set; } = null;
private string tcMode { get; set; } = "";
@@ -171,6 +180,35 @@ namespace MP_TAB3.Pages
#region Private Methods
/// <summary>
/// Ricevuto nuovi dati da mostrare!
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <exception cref="NotImplementedException"></exception>
private void DataPipe_EA_NewMessage(object? sender, EventArgs e)
{
PubSubEventArgs currArgs = (PubSubEventArgs)e;
// conversione on-the-fly List<string> --> allarmi
if (!string.IsNullOrEmpty(currArgs.newMessage))
{
try
{
List<MappaStatoExpl>? dataList = JsonConvert.DeserializeObject<List<MappaStatoExpl>>(currArgs.newMessage);
if (dataList != null)
{
SaveData(dataList);
}
}
catch
{ }
}
InvokeAsync(() =>
{
StateHasChanged();
});
}
private void setDefaults()
{
string df = MsgServ.UserPrefSetup("DefCardMode", "full");
@@ -183,9 +221,8 @@ namespace MP_TAB3.Pages
private void SetupConf()
{
// sistemo i parametri opzionali...
TabDServ.ConfigGetVal("MON_maxCol", ref maxCol);
TabDServ.ConfigGetVal("sART", ref showArt);
Log.Info($"setupConf | Effettuato setup parametri | MaxCol: {maxCol}");
Log.Info($"setupConf | Effettuato setup parametri | showArt: {showArt}");
}
#endregion Private Methods
+1 -2
View File
@@ -1,7 +1,6 @@
@page "/tech-sheet"
@inherits BasePage
<MseSampler SampleMult="0.5" E_Updated="RefreshData"></MseSampler>
@if (string.IsNullOrEmpty(IdxMacc) || CurrMSE == null)
{
<EgwCoreLib.Razor.LoadingData></EgwCoreLib.Razor.LoadingData>
+4 -49
View File
@@ -1,30 +1,12 @@
using global::Microsoft.AspNetCore.Components;
using MP.Data.DatabaseModels;
using MP.Data.Services;
namespace MP_TAB3.Pages
{
public partial class TechSheet : IDisposable
public partial class TechSheet
{
#region Public Methods
public void Dispose()
{
IdxMacc = "";
CurrMSE = null;
//GC.Collect();
}
#endregion Public Methods
#region Protected Properties
protected MappaStatoExpl? CurrMSE { get; set; } = null;
protected string IdxMacc { get; set; } = "";
[Inject]
protected MessageService MsgServ { get; set; } = null!;
[Inject]
protected TabDataService TabDServ { get; set; } = null!;
@@ -34,31 +16,17 @@ namespace MP_TAB3.Pages
protected override async Task OnInitializedAsync()
{
await ReloadData();
await base.OnInitializedAsync();
SetupConf();
}
protected async Task RefreshData(List<MappaStatoExpl> newList)
{
var ListMSE = newList;
if (!string.IsNullOrEmpty(IdxMacc))
{
var rawData = ListMSE.Find(x => x.IdxMacchina == IdxMacc);
if (rawData != null)
{
CurrMSE = rawData;
}
}
await InvokeAsync(StateHasChanged);
}
#endregion Protected Methods
#region Private Fields
private string disMessage = "Gestione schede tecniche di attrezzaggio, collaudo e verifica procedure di setup. Il modulo opzionale attivabile su richiesta.";
private string disMessage = "Gestione schede tecniche di attrezzaggio, collaudo e verifica procedure di setup. Il modulo opzionale &grave; attivabile su richiesta.";
private string disSubtitle = "Funzionalit disattivata";
private string disSubtitle = "Funzionalit&agrave; disattivata";
private string disTitle = "Scheda Tecnica";
@@ -68,19 +36,6 @@ namespace MP_TAB3.Pages
#region Private Methods
private async Task ReloadData()
{
if (string.IsNullOrEmpty(IdxMacc))
{
IdxMacc = await MsgServ.IdxMaccGet();
// recupero MSE macchina....
if (!string.IsNullOrEmpty(IdxMacc))
{
CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
}
}
}
private void SetupConf()
{
TabDServ.ConfigGetVal("enableSchedaTecnica", ref enableSchedaTecnica);
+1 -1
View File
@@ -1,6 +1,6 @@
@page "/workshift"
@inherits BasePage
<MseSampler SampleMult="0.5" E_Updated="RefreshData"></MseSampler>
@if (string.IsNullOrEmpty(IdxMacc) || CurrMSE == null)
{
<EgwCoreLib.Razor.LoadingData></EgwCoreLib.Razor.LoadingData>
+5 -44
View File
@@ -4,27 +4,11 @@ using MP.Data.Services;
namespace MP_TAB3.Pages
{
public partial class WorkShift : IDisposable
public partial class WorkShift
{
#region Public Methods
public void Dispose()
{
IdxMacc = "";
CurrMSE = null;
currTurni = new TurniMaccModel();
//GC.Collect();
}
#endregion Public Methods
#region Protected Properties
protected MappaStatoExpl? CurrMSE { get; set; } = null;
protected TurniMaccModel currTurni { get; set; } = new TurniMaccModel();
protected string IdxMacc { get; set; } = "";
[Inject]
protected MessageService MsgServ { get; set; } = null!;
protected bool T1
{
@@ -79,46 +63,23 @@ namespace MP_TAB3.Pages
protected override async Task OnInitializedAsync()
{
await base.OnInitializedAsync();
await ReloadData();
}
protected async Task RefreshData(List<MappaStatoExpl> newList)
{
var ListMSE = newList;
if (!string.IsNullOrEmpty(IdxMacc))
{
var rawData = ListMSE.Find(x => x.IdxMacchina == IdxMacc);
if (rawData != null)
{
CurrMSE = rawData;
}
else
{
await ReloadData();
}
}
await InvokeAsync(StateHasChanged);
}
#endregion Protected Methods
#region Private Methods
private async Task ReloadData()
protected override async Task ReloadData()
{
if (string.IsNullOrEmpty(IdxMacc))
{
IdxMacc = await MsgServ.IdxMaccGet();
// recupero MSE macchina....
await base.ReloadData();
if (!string.IsNullOrEmpty(IdxMacc))
{
CurrMSE = await MsgServ.GetMachineMse(IdxMacc);
// recupero turni
currTurni = await TabServ.TurnoMacchinaGet(IdxMacc);
}
}
}
#endregion Private Methods
#endregion Protected Methods
}
}
+12 -5
View File
@@ -26,6 +26,9 @@ builder.Services.AddSingleton<IConnectionMultiplexer>(redisMultiplexer);
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();
builder.Services.AddSingleton<IConnectionMultiplexer>(redisMultiplexer);
builder.Services.AddSingleton<TabDataFeeder>();
builder.Services.AddSingleton<StatusData>();
builder.Services.AddSingleton<ListSelectDataSrv>();
builder.Services.AddSingleton<OrderDataSrv>();
@@ -63,12 +66,16 @@ app.UseStaticFiles();
string BasePathDisegni = configuration.GetValue<string>("OptConf:BasePathDisegni");
if (!string.IsNullOrEmpty(BasePathDisegni))
{
// gestione cartella x PDF
app.UseStaticFiles(new StaticFileOptions
// verifico esista folder disegni
if (Directory.Exists(BasePathDisegni))
{
FileProvider = new PhysicalFileProvider(BasePathDisegni),
RequestPath = "/disegni",
});
// gestione cartella x PDF
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(BasePathDisegni),
RequestPath = "/disegni",
});
}
}
app.UseRouting();
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MAPOSPEC </i>
<h4>Versione: 6.16.2402.2610</h4>
<h4>Versione: 6.16.2402.2620</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2402.2610
6.16.2402.2620
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2402.2610</version>
<version>6.16.2402.2620</version>
<url>https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/MP-TAB3.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-TAB3/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+17 -1
View File
@@ -6,7 +6,23 @@
"Microsoft.AspNetCore": "Warning"
}
},
"ConnectionStrings": {
"Redis": "iis01.egalware.com:6379,DefaultDatabase=1,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false",
"MP.All": "Server=SQL2016DEV;Database=MoonPro; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=MP.TAB3;",
"MP.Mon": "Server=SQL2016DEV;Database=MoonPro; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=MP.TAB3;",
"Mp.IS": "Server=SQL2016DEV;Database=MoonPro_IS_EdilChim; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=MP.INVE;",
"MP.Tab": "Server=SQL2016DEV;Database=MoonPro; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=MP.TAB3;",
"MP.Mag": "Server=SQL2016DEV;Database=MoonPro_MAG; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=MP.TAB3;"
},
"OptConf": {
"msRefresh": "1100",
"BaseAddr": "https://localhost:7295/MP/TAB3/",
"BaseUrl": "/MP/TAB3",
"ImgBasePath": "https://iis01.egalware.com/MP/images/macchine/small/",
"ImgStBasePath": "C:\\Steamware\\images\\ST",
"CodModulo": "MoonPro",
"samplerMaxCall": 15,
"BasePathDisegni": "C:\\Steamware\\disegni"
}
},
"AlarmDest": "samuele.locatelli@egalware.com, ceo@steamware.net",
}
+1 -1
View File
@@ -17,7 +17,7 @@
"MP.Mag": "Server=SQL2016DEV;Database=MoonPro_MAG; User ID=sa;Password=keyhammer16; integrated security=False; MultipleActiveResultSets=True; App=MP.TAB3;"
},
"OptConf": {
"msRefresh": "4000",
"msRefresh": "1100",
"BaseAddr": "https://localhost:7295/MP/TAB3/",
"BaseUrl": "/MP/TAB3",
"ImgBasePath": "https://iis01.egalware.com/MP/images/macchine/small/",
Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

+4 -2
View File
@@ -4,9 +4,11 @@
{
#region Public Fields
public static readonly string ACT_BLINK_KEY = $"{BASE_HASH}:Current:Blink";
public static readonly string MON_ACT_BLINK_KEY = $"{BASE_HASH}:MON:Current:Blink";
public static readonly string MON_ACT_MSE_DATA_KEY = $"{BASE_HASH}:MON:Current:MSE";
public static readonly string ACT_MSE_DATA_KEY = $"{BASE_HASH}:Current:MSE";
public static readonly string TAB_ACT_BLINK_KEY = $"{BASE_HASH}:TAB:Current:Blink";
public static readonly string TAB_ACT_MSE_DATA_KEY = $"{BASE_HASH}:TAB:Current:MSE";
public static readonly string BROADCAST_M_PIPE = $"BroadCastMsg";
public static readonly string BROADCAST_CURR_KEY = $"{BASE_HASH}:Current:BroadCast";
@@ -21,5 +21,6 @@ namespace MP.Data.DatabaseModels
public bool isAdmin { get; set; } = false;
public string authKey { get; set; }
public string CodOprExt { get; set; }
public bool isEnabled { get; set; } = false;
}
}
@@ -16,5 +16,6 @@ namespace MP.Data.DatabaseModels
public string label { get; set; } = "";
public string cssClass { get; set; } = "";
public string icona { get; set; } = "";
public bool isEnabled { get; set; } = false;
}
}
+8 -2
View File
@@ -113,7 +113,10 @@ namespace MP.Data
//Subscribe to the channel named messages
sub.Subscribe(_channel, (channel, message) =>
{
Log.Trace($"req setup ch {channel} | {message}");
if (enableLog)
{
Log.Trace($"req setup ch {channel} | {message}");
}
// messaggio
PubSubEventArgs mea = new PubSubEventArgs(message);
// se qualcuno ascolta sollevo evento nuovo valore...
@@ -122,7 +125,10 @@ namespace MP.Data
EA_NewMessage(this, mea);
}
});
Log.Info($"Subscribed {_channel}");
if (enableLog)
{
Log.Info($"Subscribed {_channel}");
}
}
#endregion Private Methods
+8 -4
View File
@@ -15,8 +15,8 @@ namespace MP.Data.Services
{
// setup canali pub/sub
dataPipe = new MessagePipe(redisConn, Constants.ACT_MSE_DATA_KEY);
blinkPipe = new MessagePipe(redisConn, Constants.ACT_BLINK_KEY);
dataPipe = new MessagePipe(redisConn, Constants.MON_ACT_MSE_DATA_KEY);
blinkPipe = new MessagePipe(redisConn, Constants.MON_ACT_BLINK_KEY);
// avvio timers...
startTimers();
@@ -40,13 +40,15 @@ namespace MP.Data.Services
stopTimers();
}
#if false
/// <summary>
/// Richiesta attivazione --&gt; sposto avanti 1 minuto il periodo limite x fast running
/// </summary>
public void doActivate()
{
fastLimit = DateTime.Now.AddMinutes(1);
}
}
#endif
/// <summary>
/// Impostazione forzata timer refresh
@@ -85,11 +87,13 @@ namespace MP.Data.Services
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
#if false
/// <summary>
/// Limite in formato data-ora per inviare dati rapidamente (incrementato come now + 1 min
/// ad ogni chiamata client)
/// </summary>
private DateTime fastLimit = DateTime.Now;
private DateTime fastLimit = DateTime.Now;
#endif
private int fastRefreshMs = 1000;
+5 -1
View File
@@ -266,7 +266,7 @@ namespace MP.Data.Services
result = await Task.FromResult(dbController.MseGetAll(maxAge));
// serializzp e salvo...
rawData = JsonConvert.SerializeObject(result);
await redisDb.StringSetAsync(Constants.redisMseKey, rawData, FastCache);
await redisDb.StringSetAsync(Constants.redisMseKey, rawData, UltraFastCache);
}
if (result == null)
{
@@ -304,6 +304,10 @@ namespace MP.Data.Services
/// Cache breve durata
/// </summary>
private TimeSpan FastCache = TimeSpan.FromSeconds(5);
/// <summary>
/// Cache brevissima durata
/// </summary>
private TimeSpan UltraFastCache = TimeSpan.FromMilliseconds(1100);
/// <summary>
/// Cache lunga durata
+106
View File
@@ -0,0 +1,106 @@
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
using NLog;
using StackExchange.Redis;
using System;
using System.Threading.Tasks;
namespace MP.Data.Services
{
public class TabDataFeeder : StatusData, IDisposable
{
#region Public Constructors
public TabDataFeeder(IConfiguration configuration) : base(configuration)
{
// setup canali pub/sub
dataPipe = new MessagePipe(redisConn, Constants.TAB_ACT_MSE_DATA_KEY, false);
#if false
blinkPipe = new MessagePipe(redisConn, Constants.TAB_ACT_BLINK_KEY, false);
#endif
// avvio timers...
startTimers();
}
#endregion Public Constructors
#region Public Properties
#if false
public MessagePipe blinkPipe { get; set; } = null!;
#endif
public MessagePipe dataPipe { get; set; } = null!;
#endregion Public Properties
#region Public Methods
public new void Dispose()
{
base.Dispose();
stopTimers();
}
/// <summary>
/// Impostazione forzata timer refresh
/// </summary>
/// <param name="FastTimerMs"></param>
public void setTimers(int FastTimerMs)
{
stopTimers();
fastRefreshMs = FastTimerMs;
// avvio timers...
startTimers();
}
public void startTimers()
{
fastTimer = new System.Timers.Timer(fastRefreshMs);
fastTimer.Elapsed += ElapsedFastTimer;
fastTimer.Enabled = true;
fastTimer.Start();
}
public void stopTimers()
{
// stop timers
fastTimer.Elapsed -= ElapsedFastTimer;
fastTimer.Enabled = false;
fastTimer.Stop();
fastTimer.Dispose();
}
#endregion Public Methods
#region Private Fields
private static System.Timers.Timer fastTimer = new System.Timers.Timer(4000);
private static Logger Log = LogManager.GetCurrentClassLogger();
private int fastRefreshMs = 1000;
#endregion Private Fields
#region Private Methods
private void ElapsedFastTimer(object? source, System.Timers.ElapsedEventArgs e)
{
var pUpd = Task.Run(async () =>
{
var newData = await MseGetAll();
// invio tramite la pipe...
dataPipe.sendMessage(JsonConvert.SerializeObject(newData));
Log.Debug("Elapsed Fast Timer reload");
});
pUpd.Wait();
}
#endregion Private Methods
}
}
+1 -1
View File
@@ -1,4 +1,4 @@
<div class="col machBlock">
<div class="col machBlock ">
@if (CurrRecord == null || !dataLoaded)
{
<LoadingDataSmall></LoadingDataSmall>
+39 -33
View File
@@ -41,39 +41,6 @@ namespace MP.Mon.Components
aTimer.Dispose();
}
/// <summary>
/// CSS Class x overlay (effetto spento x macchina spenta/ sGr)
/// </summary>
protected string overlayCss
{
get
{
string answ = "";
if (CurrRecord != null)
{
answ = CurrRecord.Semaforo == "sGr" ? "bg-light opacity-25" : "";
}
return answ;
}
}
protected string textDescrCss = "";
///// <summary>
///// CSS calss x testo (se descr lunga scorre...)
///// </summary>
//protected string textDescrCss
//{
// get
// {
// string answ = "text-nowrap";
// if (CurrRecord != null && CurrRecord.DescrizioneStato.Length > 7)
// {
// answ = " scroll-left";
// }
// return answ;
// }
//}
public void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e)
{
var pUpd = Task.Run(async () =>
@@ -108,6 +75,21 @@ namespace MP.Mon.Components
pUpd.Wait();
}
///// <summary>
///// CSS class x testo (se descr lunga scorre...)
///// </summary>
//protected string textDescrCss
//{
// get
// {
// string answ = "text-nowrap";
// if (CurrRecord != null && CurrRecord.DescrizioneStato.Length > 7)
// {
// answ = " scroll-left";
// }
// return answ;
// }
//}
public void StartTimer()
{
int tOutPeriod = 1000;
@@ -126,6 +108,8 @@ namespace MP.Mon.Components
protected int kaFactor = 60 / 2;
protected string textDescrCss = "";
#endregion Protected Fields
#region Protected Properties
@@ -145,6 +129,22 @@ namespace MP.Mon.Components
protected bool dataLoaded { get; set; } = false;
/// <summary>
/// CSS Class x overlay (effetto spento x macchina spenta/ sGr)
/// </summary>
protected string overlayCss
{
get
{
string answ = "";
if (CurrRecord != null)
{
answ = CurrRecord.Semaforo == "sGr" ? cssOverlayOff : "";
}
return answ;
}
}
#endregion Protected Properties
#region Protected Methods
@@ -183,15 +183,21 @@ namespace MP.Mon.Components
return answ;
}
[Inject]
protected IConfiguration config { get; set; } = null!;
protected override async Task OnInitializedAsync()
{
//StartTimer();
Random rnd = new Random();
await Task.Delay(rnd.Next(5));
cssOverlayOff = config.GetValue<string>("ServerConf:cssOverlayOff");
setupConf();
dataLoaded = true;
}
private string cssOverlayOff = "bg-dark text-light opacity-100";
/// <summary>
/// Restituisce (se presenti) valori di override per la riga indicata
/// </summary>
+5 -6
View File
@@ -4,11 +4,14 @@
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Version>6.16.2402.2611</Version>
<Version>6.16.2402.2615</Version>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Data\MpDataService.cs" />
<Compile Remove="Data\**" />
<Content Remove="Data\**" />
<EmbeddedResource Remove="Data\**" />
<None Remove="Data\**" />
</ItemGroup>
<ItemGroup>
@@ -58,10 +61,6 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Folder Include="Data\" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\post-build.ps1 -ProjectDir $(ProjectDir) -ProjectPath $(ProjectPath)" />
</Target>
+2
View File
@@ -16,6 +16,8 @@ namespace MP.Mon.Pages
public void Dispose()
{
MMDataService.dataPipe.EA_NewMessage -= DataPipe_EA_NewMessage;
MMDataService.blinkPipe.EA_NewMessage -= BlinkPipe_EA_NewMessage;
disposeTimers();
}
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>Modulo MON MAPO</i>
<h4>Versione: 6.16.2402.2611</h4>
<h4>Versione: 6.16.2402.2615</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
6.16.2402.2611
6.16.2402.2615
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>6.16.2402.2611</version>
<version>6.16.2402.2615</version>
<url>https://nexus.steamware.net/repository/SWS/MP-MON/stable/LAST/MP.Mon.zip</url>
<changelog>https://nexus.steamware.net/repository/SWS/MP-MON/stable/LAST/ChangeLog.html</changelog>
<mandatory>false</mandatory>
+4 -1
View File
@@ -13,6 +13,9 @@
"Redis": "localhost:6379,DefaultDatabase=1,connectTimeout=5000,syncTimeout=5000,asyncTimeout=5000,abortConnect=false,ssl=false"
},
"ServerConf": {
"maxAge": "2000"
"maxAge": "2000",
//"cssOverlayOff": "bg-secondary bg-opacity-75"
//"cssOverlayOff": "bg-dark text-light bg-opacity-50"
"cssOverlayOff": "bg-dark text-light opacity-50"
}
}