From 813ee7e59163cbca65f0994e2b0e58456688dc59 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 19 Mar 2025 11:04:07 +0100 Subject: [PATCH 1/3] Rimozione componenti da area server x riportare WASM x orologio --- MP.MON/Components/Compo/CmpFooter.razor | 14 - MP.MON/Components/Compo/CmpFooter.razor.cs | 113 ------ MP.MON/Components/Compo/CmpHeader.razor | 20 -- MP.MON/Components/Compo/CmpHeader.razor.cs | 53 --- MP.MON/Components/Compo/DetailMSE.razor | 145 -------- MP.MON/Components/Compo/DetailMSE.razor.cs | 322 ------------------ .../Components/Compo/DetailMapSelector.razor | 44 --- MP.MON/Components/Compo/DetailViewMSE.razor | 154 --------- .../Components/Compo/DetailViewMSE.razor.cs | 303 ---------------- MP.MON/Components/Compo/LoadingData.razor | 10 - .../Components/Compo/LoadingDataSmall.razor | 6 - 11 files changed, 1184 deletions(-) delete mode 100644 MP.MON/Components/Compo/CmpFooter.razor delete mode 100644 MP.MON/Components/Compo/CmpFooter.razor.cs delete mode 100644 MP.MON/Components/Compo/CmpHeader.razor delete mode 100644 MP.MON/Components/Compo/CmpHeader.razor.cs delete mode 100644 MP.MON/Components/Compo/DetailMSE.razor delete mode 100644 MP.MON/Components/Compo/DetailMSE.razor.cs delete mode 100644 MP.MON/Components/Compo/DetailMapSelector.razor delete mode 100644 MP.MON/Components/Compo/DetailViewMSE.razor delete mode 100644 MP.MON/Components/Compo/DetailViewMSE.razor.cs delete mode 100644 MP.MON/Components/Compo/LoadingData.razor delete mode 100644 MP.MON/Components/Compo/LoadingDataSmall.razor diff --git a/MP.MON/Components/Compo/CmpFooter.razor b/MP.MON/Components/Compo/CmpFooter.razor deleted file mode 100644 index 0307f939..00000000 --- a/MP.MON/Components/Compo/CmpFooter.razor +++ /dev/null @@ -1,14 +0,0 @@ -
-
- Mapo MON @(DateTime.Today.Year) | v.@version -
-
- @if (Width > 0) - { - - } - @Width x @Height | - @(OperatingSystem.IsBrowser() ? "WASM" : "Server") - | Egalware -
-
\ No newline at end of file diff --git a/MP.MON/Components/Compo/CmpFooter.razor.cs b/MP.MON/Components/Compo/CmpFooter.razor.cs deleted file mode 100644 index a8acd68c..00000000 --- a/MP.MON/Components/Compo/CmpFooter.razor.cs +++ /dev/null @@ -1,113 +0,0 @@ -using Microsoft.AspNetCore.Components; -using Microsoft.JSInterop; -using System; - -namespace MP.MON.Components.Compo -{ - public partial class CmpFooter : ComponentBase //, IDisposable - { - #region Public Properties - - [Parameter] - public Version version { get; set; } = null!; - - #endregion Public Properties - - #region Public Methods - -#if false - public void Dispose() - { - aTimer.Stop(); - aTimer.Dispose(); - } - - public void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e) - { - var pUpd = Task.Run(async () => - { - await Task.Delay(1); - //Console.WriteLine($"{DateTime.Now} | Elapsed Timer Footer"); - await InvokeAsync(() => StateHasChanged()); - }); - pUpd.Wait(); - } - - public void StartTimer() - { - int tOutPeriod = 1000; - aTimer = new System.Timers.Timer(tOutPeriod); - aTimer.Elapsed += ElapsedTimer; - aTimer.Enabled = true; - aTimer.Start(); - } -#endif - - #endregion Public Methods - - #region Public Classes - - public class WindowDimension - { - #region Public Properties - - public int Height { get; set; } - public int Width { get; set; } - - #endregion Public Properties - } - - #endregion Public Classes - - #region Protected Properties - - [Inject] - protected IJSRuntime JSRuntime { get; set; } = null!; - - #endregion Protected Properties - - #region Protected Methods - - protected async Task getWDim() - { - var dimension = await JSRuntime.InvokeAsync("getWindowDimensions"); - Height = dimension.Height; - Width = dimension.Width; - } - - protected override async Task OnAfterRenderAsync(bool firstRender) - { - if (firstRender) - { - await getWDim(); - StateHasChanged(); - Console.WriteLine($"Dimensioni schermo: {Width}x{Height}"); - } - //Console.WriteLine($"OnAfterRenderAsync completato"); - } - - protected override void OnInitialized() - { -#if false - StartTimer(); -#endif - Console.WriteLine($"OnInitialized Footer completato"); - } - - #endregion Protected Methods - - #region Private Fields - - private static System.Timers.Timer aTimer = null!; - - #endregion Private Fields - - #region Private Properties - - private int Height { get; set; } = 0; - - private int Width { get; set; } = 0; - - #endregion Private Properties - } -} \ No newline at end of file diff --git a/MP.MON/Components/Compo/CmpHeader.razor b/MP.MON/Components/Compo/CmpHeader.razor deleted file mode 100644 index 28357073..00000000 --- a/MP.MON/Components/Compo/CmpHeader.razor +++ /dev/null @@ -1,20 +0,0 @@ -
- -   -
-
- - Mapo MONitor - -
-
- - @($"{DateTime.Now:yyyy.MM.dd}") - - - @($"{DateTime.Now:HH:mm:ss}") - - @* - EgalWare *@ -
- diff --git a/MP.MON/Components/Compo/CmpHeader.razor.cs b/MP.MON/Components/Compo/CmpHeader.razor.cs deleted file mode 100644 index 6574b2db..00000000 --- a/MP.MON/Components/Compo/CmpHeader.razor.cs +++ /dev/null @@ -1,53 +0,0 @@ -using Microsoft.AspNetCore.Components; - -namespace MP.MON.Components.Compo -{ - public partial class CmpHeader : ComponentBase, IDisposable - { - #region Public Methods - - public void Dispose() - { - aTimer.Stop(); - aTimer.Dispose(); - } - - public void ElapsedTimer(Object source, System.Timers.ElapsedEventArgs e) - { - var pUpd = Task.Run(async () => - { - await Task.Delay(1); - //Console.WriteLine($"{DateTime.Now} | Elapsed Timer Footer"); - await InvokeAsync(() => StateHasChanged()); - }); - pUpd.Wait(); - } - - public void StartTimer() - { - int tOutPeriod = 1000; - aTimer = new System.Timers.Timer(tOutPeriod); - aTimer.Elapsed += ElapsedTimer; - aTimer.Enabled = true; - aTimer.Start(); - } - - #endregion Public Methods - - #region Protected Methods - - protected override void OnInitialized() - { - StartTimer(); - Console.WriteLine($"OnInitialized Header completato"); - } - - #endregion Protected Methods - - #region Private Fields - - private static System.Timers.Timer aTimer = null!; - - #endregion Private Fields - } -} \ No newline at end of file diff --git a/MP.MON/Components/Compo/DetailMSE.razor b/MP.MON/Components/Compo/DetailMSE.razor deleted file mode 100644 index 2a30e66f..00000000 --- a/MP.MON/Components/Compo/DetailMSE.razor +++ /dev/null @@ -1,145 +0,0 @@ -
- @if (CurrRecord == null || !dataLoaded) - { - - } - else - { -
-
-
- @CurrRecord.Nome -
-
- @if (hasRow(1)) - { -
- @foreach (var item in rowValues(1)) - { -
@item.TagName: @currVal(item.TagLocation)
- } -
- } - else - { -
-
Art
-
- @if (showArt == "CodArticolo") - { - @CurrRecord.CodArticolo - } - else - { - if (string.IsNullOrEmpty(CurrRecord.Disegno)) - { - [@CurrRecord.CodArticolo] - } - else - { - @CurrRecord.Disegno - } - } -
-
- } - @if (hasRow(2)) - { -
- @foreach (var item in rowValues(2)) - { -
@item.TagName: @currVal(item.TagLocation)
- } -
- } - else - { -
-
PODL
-
@(CurrRecord.IdxPOdl > 0 ? $"{CurrRecord.IdxPOdl:00000000}" : "-")
-
-
-
ODL
-
@(CurrRecord.IdxOdl > 0 ? $"{CurrRecord.IdxOdl:00000000}" : "-")
-
- } - @if (hasRow(3)) - { -
- @foreach (var item in rowValues(3)) - { -
@item.TagName: @currVal(item.TagLocation)
- } -
- } - else - { -
-
@CurrRecord.DescrizioneStato
-
@getMinSec(getDecimal(@CurrRecord.Durata))
-
- } - @if (hasRow(4)) - { -
- @foreach (var item in rowValues(4)) - { -
@item.TagName: @currVal(item.TagLocation)
- } -
- } - else - { -
-
TC. Act
- @*
std @getMinSec(@CurrRecord.TCAssegnato)
*@ -
@getMinSec(@CurrRecord.TCLavRT) [@getMinSec(@CurrRecord.TCAssegnato)]
-
- } - @if (hasRow(5)) - { -
- @foreach (var item in rowValues(5)) - { -
@item.TagName: @currVal(item.TagLocation)
- } -
- } - else - { -
-
Pezzip/o
-
@CurrRecord.PezziProd / @CurrRecord.NumPezzi
-
- } - @if (hasRow(6)) - { -
- @foreach (var item in rowValues(6)) - { -
@item.TagName: @currVal(item.TagLocation)
- } -
- } -
-
-
-
- -
-
-
- } -
\ No newline at end of file diff --git a/MP.MON/Components/Compo/DetailMSE.razor.cs b/MP.MON/Components/Compo/DetailMSE.razor.cs deleted file mode 100644 index aab7900c..00000000 --- a/MP.MON/Components/Compo/DetailMSE.razor.cs +++ /dev/null @@ -1,322 +0,0 @@ -using Microsoft.AspNetCore.Components; -using MP.Core.Conf; -using MP.Core.DTO; - -namespace MP.MON.Components.Compo -{ - public partial class DetailMSE : ComponentBase - { - #region Public Properties - - [Parameter] - public string cssOverlayOff { get; set; } = ""; - - [Parameter] - public MappaStatoExplDTO? CurrRecord { get; set; } = null; - - [Parameter] - public List? currTagConf { get; set; } = null; - - [Parameter] - public Dictionary currTagVal { get; set; } = new Dictionary(); - - [Parameter] - public bool doAnimate { get; set; } = true; - - [Parameter] - public bool doBlink { get; set; } = false; - - [Parameter] - public int keepAliveMin { get; set; } = 5; - - [Parameter] - public int maxChar4Scroll { get; set; } = 20; - - [Parameter] - public string showArt { get; set; } = ""; - - #endregion Public Properties - - #region Public Methods - - public void Dispose() - { - aTimer.Elapsed -= ElapsedTimer; - aTimer.Stop(); - aTimer.Dispose(); - } - - public void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e) - { - var pUpd = Task.Run(async () => - { - await Task.Delay(1); - // verifica variazione x blink... - bool needUpdate = false; - if (CurrRecord == null) - { - needUpdate = true; - } - else - { - if (OldRecord == null) - { - needUpdate = true; - } - else - { - if (!CurrRecord.Semaforo.Equals(OldRecord.Semaforo) || CurrRecord.Semaforo != "sVe") - { - needUpdate = true; - } - } - } - if (needUpdate) - { - await InvokeAsync(() => StateHasChanged()); - } - OldRecord = CurrRecord; - }); - pUpd.Wait(); - } - - public void StartTimer() - { - int tOutPeriod = 1000; - //int.TryParse(Configuration["ReloadStatusTimer"], out tOutPeriod); - aTimer = new System.Timers.Timer(tOutPeriod); - aTimer.Elapsed += ElapsedTimer; - aTimer.Enabled = true; - aTimer.Start(); - } - - #endregion Public Methods - - #region Protected Fields - - protected string baseCss = "sem"; - - protected int kaFactor = 60 / 2; - - #endregion Protected Fields - - #region Protected Properties - - protected string codIOB - { - get - { - string answ = ""; - if (CurrRecord != null) - { - answ = CurrRecord.IdxMacchina; - } - return answ; - } - } - - protected bool dataLoaded { get; set; } = false; - - /// - /// CSS Class x overlay (effetto spento x macchina spenta/ sGr) - /// - protected string overlayCss - { - get - { - string answ = ""; - if (CurrRecord != null) - { - answ = CurrRecord.Semaforo == "sGr" ? cssOverlayOff : ""; - } - return answ; - } - } - - #endregion Protected Properties - - #region Protected Methods - - /// - /// restituisce il valore data la tagLocation - /// - /// - /// - protected string currVal(string tagLocation) - { - string answ = ""; - if (currTagVal.ContainsKey(tagLocation)) - { - answ = currTagVal[tagLocation]; - } - return answ; - } - - /// - /// Verifica se ci sia un override per la riga indicata - /// - /// - /// - protected bool hasRow(int numRow) - { - bool answ = false; - if (currTagConf != null) - { - if (currTagConf.Count > 0) - { - var currVals = rowValues(numRow); - answ = currVals.Count > 0; - } - } - return answ; - } - - protected override async Task OnInitializedAsync() - { - //StartTimer(); - Random rnd = new Random(); - await Task.Delay(rnd.Next(5)); - setupConf(); - dataLoaded = true; - } - - /// - /// Restituisce (se presenti) valori di override per la riga indicata - /// - /// - /// - protected List rowValues(int numRow) - { - List? rowVals = null; - if (currTagConf != null) - { - if (currTagConf.Count > 0) - { - //cerco solo la riga corrente... - rowVals = currTagConf.Where(x => x.RowNum == numRow).ToList(); - } - } - if (rowVals == null) - { - rowVals = new List(); - } - return rowVals; - } - - /// - /// CSS class x testo (se descr lunga scorre...) - /// - protected string textDescrCss(string currText, int maxChar) - { - string answ = "text-nowrap"; - if (currText.Length > maxChar) - { - answ = " scroll-left"; - } - return answ; - } - - #endregion Protected Methods - - #region Private Properties - - private static System.Timers.Timer aTimer { get; set; } = null!; - - /// - /// Valore precedente x calcolo variazione - /// - private MappaStatoExplDTO? OldRecord { get; set; } = null; - - #endregion Private Properties - - #region Private Methods - - private string cssComStatus(string semaforo, DateTime? lastUpdateN) - { - DateTime lastUpdate = lastUpdateN.HasValue ? (DateTime)lastUpdateN : DateTime.Now.AddHours(-1); - string answ = cssStatus(semaforo); - if (DateTime.Now.Subtract(lastUpdate).TotalSeconds > (keepAliveMin * kaFactor)) - { - answ = $"{baseCss}Ro"; - // blink se secondo pari... - DateTime adesso = DateTime.Now; - int resto = 0; - Math.DivRem(adesso.Second, 2, out resto); - if (resto == 0) - { - answ += "_b"; - } - } - return answ; - } - - private string cssStatus(string codSemaforo) - { - // se vuoto --> mostra nero! - if (string.IsNullOrEmpty(codSemaforo)) - { - codSemaforo = "sNe"; - } - string codColore = codSemaforo.Substring(1, 2); - string answ = $"{baseCss}{codColore}"; - if (doAnimate && codColore != "Ve") - { - if (doBlink) - { - answ += "_b"; - } - } - return answ; - } - - private decimal getDecimal(object? rawData) - { - decimal answ = 0; - if (rawData != null) - { - decimal.TryParse($"{rawData}", out answ); - } - return answ; - } - - private string getMinSec(decimal? currTimeMin) - { - string answ = "nd"; - TimeSpan tSpan = new TimeSpan(0); - try - { - double cTimeMin = currTimeMin != null ? (double)currTimeMin : 0; - tSpan = TimeSpan.FromMinutes(cTimeMin); - if (tSpan.TotalHours < 1) - { - answ = $"{tSpan:mm}:{tSpan:ss}"; - } - else - { - answ = $"{tSpan.TotalHours:N0}h {tSpan:mm}:{tSpan:ss}"; - } - } - catch - { } - return answ; - } - - private void setupConf() - { - //baseCss = doAnimate ? "semBlink" : "sem"; - } - - private bool showComErr(DateTime? lastUpdateN) - { - DateTime lastUpdate = lastUpdateN.HasValue ? (DateTime)lastUpdateN : DateTime.Now.AddHours(-1); - bool answ = false; - if (DateTime.Now.Subtract(lastUpdate).TotalSeconds > (keepAliveMin * kaFactor)) - { - answ = true; - } - return answ; - } - - #endregion Private Methods - } -} \ No newline at end of file diff --git a/MP.MON/Components/Compo/DetailMapSelector.razor b/MP.MON/Components/Compo/DetailMapSelector.razor deleted file mode 100644 index a6911977..00000000 --- a/MP.MON/Components/Compo/DetailMapSelector.razor +++ /dev/null @@ -1,44 +0,0 @@ -@using MP.Core.Conf -@using MP.Core.DTO; - -@if (useNewDisplay) -{ - -} -else -{ - -} - -@code { - - [Parameter] - public MappaStatoExplDTO? currRecord { get; set; } = null; - - [Parameter] - public List? currTagConf { get; set; } = null; - - [Parameter] - public Dictionary currTagVal { get; set; } = new Dictionary(); - - [Parameter] - public bool doAnimate { get; set; } = true; - - [Parameter] - public bool doBlink { get; set; } = false; - - [Parameter] - public int keepAliveMin { get; set; } = 5; - - [Parameter] - public int maxChar4Scroll { get; set; } = 20; - - [Parameter] - public string showArt { get; set; } = ""; - [Parameter] - public bool useNewDisplay { get; set; } = true; - - - [Parameter] - public string cssOverlayOff { get; set; } = ""; -} diff --git a/MP.MON/Components/Compo/DetailViewMSE.razor b/MP.MON/Components/Compo/DetailViewMSE.razor deleted file mode 100644 index 6ec1ca9c..00000000 --- a/MP.MON/Components/Compo/DetailViewMSE.razor +++ /dev/null @@ -1,154 +0,0 @@ -@if (CurrRecord == null || !dataLoaded) -{ - -} -else -{ -
-
-
-
- @CurrRecord.Nome -
-
- @if (hasRow(1)) - { -
- @foreach (var item in rowValues(1)) - { -
@item.TagName: @currVal(item.TagLocation)
- } -
- } - else - { -
-
- ART: -
-
- @if (showArt == "CodArticolo") - { - @CurrRecord.CodArticolo - } - else - { - if (string.IsNullOrEmpty(CurrRecord.Disegno)) - { - [@CurrRecord.CodArticolo] - } - else - { - @CurrRecord.Disegno - } - } -
-
- } - @if (hasRow(2)) - { -
- @foreach (var item in rowValues(2)) - { -
@item.TagName: @currVal(item.TagLocation)
- } -
- } - else - { -
-
- PODL: -
-
- @(CurrRecord.IdxPOdl > 0 ? $"{CurrRecord.IdxPOdl:000000}" : "-") -
-
-
-
- ODL: -
-
- @(CurrRecord.IdxOdl > 0 ? $"{CurrRecord.IdxOdl:000000}" : "-") -
-
- } - @if (showTC) - { - @if (hasRow(3)) - { -
- @foreach (var item in rowValues(4)) - { -
@item.TagName: @currVal(item.TagLocation)
- } -
- } - else - { -
-
TC. Act
-
@getMinSec(@CurrRecord.TCLavRT) [@getMinSec(@CurrRecord.TCAssegnato)]
-
- } - } -
-
-
- @if (hasRow(4)) - { -
- @foreach (var item in rowValues(3)) - { -
@item.TagName: @currVal(item.TagLocation)
- } -
- } - else - { -
-
- @CurrRecord.DescrizioneStato -
-
@getMinSec(getDecimal(@CurrRecord.Durata))
-
- } - @if (hasRow(5)) - { -
- @foreach (var item in rowValues(5)) - { -
@item.TagName: @currVal(item.TagLocation)
- } -
- } - else - { -
-
- @CurrRecord.PezziProd / @CurrRecord.NumPezzi -
-
- } -
-
- -
-} - diff --git a/MP.MON/Components/Compo/DetailViewMSE.razor.cs b/MP.MON/Components/Compo/DetailViewMSE.razor.cs deleted file mode 100644 index 692da79e..00000000 --- a/MP.MON/Components/Compo/DetailViewMSE.razor.cs +++ /dev/null @@ -1,303 +0,0 @@ -using Microsoft.AspNetCore.Components; -using MP.Core.DTO; -using MP.Core.Conf; - -namespace MP.MON.Components.Compo -{ - public partial class DetailViewMSE : ComponentBase - { - #region Public Properties - - [Parameter] - public MappaStatoExplDTO? CurrRecord { get; set; } = null; - - [Parameter] - public List? currTagConf { get; set; } = null; - - [Parameter] - public Dictionary currTagVal { get; set; } = new Dictionary(); - - [Parameter] - public bool doAnimate { get; set; } = true; - - [Parameter] - public bool doBlink { get; set; } = false; - - [Parameter] - public int keepAliveMin { get; set; } = 5; - - [Parameter] - public int maxChar4Scroll { get; set; } = 20; - - [Parameter] - public string showArt { get; set; } = ""; - - [Parameter] - public bool scrollText { get; set; } = false; - - [Parameter] - public string brightCss { get; set; } = ""; - - [Parameter] - public string titleMult { get; set; } = ""; - - [Parameter] - public bool showTC { get; set; } = false; - -#if false - protected override void OnParametersSet() - { - base.OnParametersSet(); - Console.WriteLine($"{DateTime.Now} | {CurrRecord.IdxMacchina} params received!"); - } -#endif - - #endregion Public Properties - - #region Protected Fields - - protected int kaFactor = 60 / 2; - - #endregion Protected Fields - - #region Protected Properties - - protected bool dataLoaded { get; set; } = true; - - #endregion Protected Properties - - #region Protected Methods - - /// - /// restituisce il valore data la tagLocation - /// - /// - /// - protected string currVal(string tagLocation) - { - string answ = ""; - if (currTagVal.ContainsKey(tagLocation)) - { - answ = currTagVal[tagLocation]; - } - return answ; - } - - /// - /// Verifica se ci sia un override per la riga indicata - /// - /// - /// - protected bool hasRow(int numRow) - { - bool answ = false; - if (currTagConf != null) - { - if (currTagConf.Count > 0) - { - var currVals = rowValues(numRow); - answ = currVals.Count > 0; - } - } - return answ; - } - - /// - /// Restituisce (se presenti) valori di override per la riga indicata - /// - /// - /// - protected List rowValues(int numRow) - { - List? rowVals = null; - if (currTagConf != null) - { - if (currTagConf.Count > 0) - { - //cerco solo la riga corrente... - rowVals = currTagConf.Where(x => x.RowNum == numRow).ToList(); - } - } - if (rowVals == null) - { - rowVals = new List(); - } - return rowVals; - } - - /// - /// CSS class x testo (se descr lunga scorre...) - /// - protected string textCss(string currText) - { - string answ = "text-truncate"; - if (currText.Length > maxChar4Scroll) - { - answ = scrollText ? "scroll-left" : "text-reduced"; - // calcolo delta... a-b-c con 5-10-oltre - int delta = currText.Length - maxChar4Scroll; - if (delta < 5) - { - answ += "-a"; - } - else if (delta < 10) - { - answ += "-b"; - } - else - { - answ += "-c"; - } - } - return answ; - } - - #endregion Protected Methods - - #region Private Methods - - private string cssComStatus(string semaforo, DateTime? lastUpdateN) - { - DateTime lastUpdate = lastUpdateN.HasValue ? (DateTime)lastUpdateN : DateTime.Now.AddHours(-1); - string answ = "bg-dark opacity-75"; cssStatus(semaforo, false); - if (DateTime.Now.Subtract(lastUpdate).TotalSeconds > (keepAliveMin * kaFactor)) - { - answ = $"bg-danger"; - // blink se secondo pari... -#if false - DateTime adesso = DateTime.Now; - int resto = 0; - Math.DivRem(adesso.Second, 2, out resto); - if (resto == 0) - { - answ += " opacity-100"; - } -#endif - } - return answ; - } - - private string cssStatus(string codSemaforo, bool animate) - { - string answ = ""; - // se vuoto --> mostra nero! - if (string.IsNullOrEmpty(codSemaforo)) - { - codSemaforo = "sNe"; - } - string codColore = codSemaforo.Substring(1, 2); - switch (codSemaforo) - { - case "sVe": - answ = "bg-success"; - animate = false; - break; - - case "sGi": - answ = "bg-warning"; - break; - - case "sGr": - answ = "bg-dark opacity-50"; - animate = false; - break; - - case "sRo": - answ = "bg-danger"; - break; - - case "sBl": - answ = "bg-primary"; - break; - - case "sNe": - answ = "bg-dark"; - break; - - default: - break; - } - if (animate) - { - if (doBlink) - { - answ += " opacity-50"; - } - else - { - //answ += " bright100"; - textBlinkBright = brightCss; - } - } - return answ; - } - - /// - /// Valore brightness solo x elementi testuali durante lampeggio - /// - protected string textBlinkBright = "bright100"; - - private decimal getDecimal(object? rawData) - { - decimal answ = 0; - if (rawData != null) - { - decimal.TryParse($"{rawData}", out answ); - } - return answ; - } - - private string getMinSec(decimal? currTimeMin) - { - string answ = "nd"; - TimeSpan tSpan = new TimeSpan(0); - try - { - double cTimeMin = currTimeMin != null ? (double)currTimeMin : 0; - tSpan = TimeSpan.FromMinutes(cTimeMin); - if (tSpan.TotalHours < 1) - { - answ = $"{tSpan:mm}:{tSpan:ss}"; - } - else - { - answ = $"{tSpan.TotalHours:00}:{tSpan:mm}:{tSpan:ss}"; - } - } - catch - { } - return answ; - } - - private bool showComErr(DateTime? lastUpdateN) - { - DateTime lastUpdate = lastUpdateN.HasValue ? (DateTime)lastUpdateN : DateTime.Now.AddHours(-1); - bool answ = false; - if (DateTime.Now.Subtract(lastUpdate).TotalSeconds > (keepAliveMin * kaFactor)) - { - answ = true; - } - return answ; - } - - private string textC101(DateTime? lastUpdateN) - { - DateTime lastUpdate = lastUpdateN.HasValue ? (DateTime)lastUpdateN : DateTime.Now.AddHours(-1); - string answ = "text-light"; - if (DateTime.Now.Subtract(lastUpdate).TotalSeconds > (keepAliveMin * kaFactor)) - { - // blink se secondo pari... - DateTime adesso = DateTime.Now; - int resto = 0; - Math.DivRem(adesso.Second, 2, out resto); - if (resto == 1) - { - answ = $"text-danger"; - } - } - return answ; - } - - #endregion Private Methods - } -} \ No newline at end of file diff --git a/MP.MON/Components/Compo/LoadingData.razor b/MP.MON/Components/Compo/LoadingData.razor deleted file mode 100644 index e0b7f563..00000000 --- a/MP.MON/Components/Compo/LoadingData.razor +++ /dev/null @@ -1,10 +0,0 @@ -
-
-

MAPO MON

- EgalWare MES suite -
-
-

loading data | @(OperatingSystem.IsBrowser() ? "WASM" : "Server") mode

- -
-
\ No newline at end of file diff --git a/MP.MON/Components/Compo/LoadingDataSmall.razor b/MP.MON/Components/Compo/LoadingDataSmall.razor deleted file mode 100644 index 196dafc7..00000000 --- a/MP.MON/Components/Compo/LoadingDataSmall.razor +++ /dev/null @@ -1,6 +0,0 @@ -
-
- loading data - -
-
\ No newline at end of file From 4cc77d52e0cc98e489468b411fbd6bde57c62d46 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 19 Mar 2025 11:04:20 +0100 Subject: [PATCH 2/3] =?UTF-8?q?Reorg=20componenti=20in=20modalit=C3=A0=20s?= =?UTF-8?q?erver/client?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MP-MON.sln | 6 ++++++ MP.MON.Client/Components/CmpFooter.razor | 4 ++-- MP.MON.Client/Components/CmpFooter.razor.cs | 2 +- MP.MON/Components/Layout/MainLayout.razor | 4 ++-- MP.MON/Components/Pages/Index.razor | 8 ++++---- MP.MON/Components/Routes.razor | 2 +- MP.MON/Components/_Imports.razor | 3 ++- MP.MON/MP.MON.csproj | 6 ++---- MP.MON/Program.cs | 13 ++++++++----- MP.MON/Resources/ChangeLog.html | 2 +- MP.MON/Resources/VersNum.txt | 2 +- MP.MON/Resources/manifest.xml | 2 +- MP.MON/wwwroot/lib/WindowSize.js | 6 ------ 13 files changed, 31 insertions(+), 29 deletions(-) delete mode 100644 MP.MON/wwwroot/lib/WindowSize.js diff --git a/MP-MON.sln b/MP-MON.sln index ba4b9224..c1a0710f 100644 --- a/MP-MON.sln +++ b/MP-MON.sln @@ -11,6 +11,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MP.Core", "MP.Core\MP.Core. EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MP.TaskMan", "MP.TaskMan\MP.TaskMan.csproj", "{3447D4AF-13C2-47BB-8C5F-74299A46D063}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MP.MON.Client", "MP.MON.Client\MP.MON.Client.csproj", "{7038E415-3F9B-A8C6-C92F-32185AD31DBC}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -33,6 +35,10 @@ Global {3447D4AF-13C2-47BB-8C5F-74299A46D063}.Debug|Any CPU.Build.0 = Debug|Any CPU {3447D4AF-13C2-47BB-8C5F-74299A46D063}.Release|Any CPU.ActiveCfg = Release|Any CPU {3447D4AF-13C2-47BB-8C5F-74299A46D063}.Release|Any CPU.Build.0 = Release|Any CPU + {7038E415-3F9B-A8C6-C92F-32185AD31DBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7038E415-3F9B-A8C6-C92F-32185AD31DBC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7038E415-3F9B-A8C6-C92F-32185AD31DBC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7038E415-3F9B-A8C6-C92F-32185AD31DBC}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/MP.MON.Client/Components/CmpFooter.razor b/MP.MON.Client/Components/CmpFooter.razor index a785d642..a8c632d1 100644 --- a/MP.MON.Client/Components/CmpFooter.razor +++ b/MP.MON.Client/Components/CmpFooter.razor @@ -9,9 +9,9 @@ } @(OperatingSystem.IsBrowser() ? "WASM" : "Server") - @* + @($"{DateTime.Now:HH:mm:ss}") - *@ + | Egalware \ No newline at end of file diff --git a/MP.MON.Client/Components/CmpFooter.razor.cs b/MP.MON.Client/Components/CmpFooter.razor.cs index 55ef358e..eb59c864 100644 --- a/MP.MON.Client/Components/CmpFooter.razor.cs +++ b/MP.MON.Client/Components/CmpFooter.razor.cs @@ -34,7 +34,7 @@ namespace MP.MON.Client.Components public void StartTimer() { - int tOutPeriod = 1000; + int tOutPeriod = 5000; aTimer = new System.Timers.Timer(tOutPeriod); aTimer.Elapsed += ElapsedTimer; aTimer.Enabled = true; diff --git a/MP.MON/Components/Layout/MainLayout.razor b/MP.MON/Components/Layout/MainLayout.razor index 64d59551..db14a94e 100644 --- a/MP.MON/Components/Layout/MainLayout.razor +++ b/MP.MON/Components/Layout/MainLayout.razor @@ -5,14 +5,14 @@
- +
@Body
- +
diff --git a/MP.MON/Components/Pages/Index.razor b/MP.MON/Components/Pages/Index.razor index 91144663..6896740c 100644 --- a/MP.MON/Components/Pages/Index.razor +++ b/MP.MON/Components/Pages/Index.razor @@ -12,7 +12,7 @@ {
- +
} @@ -40,14 +40,14 @@ else if (currMse != null) {
- @* *@ + @* *@ @if (newDisplay) { - + } else { - + }
} diff --git a/MP.MON/Components/Routes.razor b/MP.MON/Components/Routes.razor index f756e19d..d39c7e89 100644 --- a/MP.MON/Components/Routes.razor +++ b/MP.MON/Components/Routes.razor @@ -1,4 +1,4 @@ - + diff --git a/MP.MON/Components/_Imports.razor b/MP.MON/Components/_Imports.razor index 35eb0aae..bc90b348 100644 --- a/MP.MON/Components/_Imports.razor +++ b/MP.MON/Components/_Imports.razor @@ -16,6 +16,7 @@ @using MP.Data.DTO @using MP.Data.Services @using MP.MON +@using MP.MON.Client +@using MP.MON.Client.Components @using MP.MON.Components -@using MP.MON.Components.Compo @using MP.MON.Components.Pages diff --git a/MP.MON/MP.MON.csproj b/MP.MON/MP.MON.csproj index 2f428095..c2c431c0 100644 --- a/MP.MON/MP.MON.csproj +++ b/MP.MON/MP.MON.csproj @@ -6,7 +6,7 @@ enable MP.MON $(AssemblyName.Replace(' ', '_')) - 6.16.2503.1908 + 6.16.2503.1911 @@ -34,10 +34,8 @@ - - + - diff --git a/MP.MON/Program.cs b/MP.MON/Program.cs index 863bf6f1..960ac3aa 100644 --- a/MP.MON/Program.cs +++ b/MP.MON/Program.cs @@ -1,5 +1,8 @@ +using MP.MON.Client.Components; using MP.Data.Services; using MP.MON.Components; +using MP.MON.Components.Layout; +using MP.MON.Components.Pages; using NLog; using NLog.Web; using StackExchange.Redis; @@ -8,8 +11,8 @@ var builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddRazorComponents() - .AddInteractiveServerComponents(); - //.AddInteractiveWebAssemblyComponents(); + .AddInteractiveServerComponents() + .AddInteractiveWebAssemblyComponents(); var logger = LogManager.Setup() @@ -57,9 +60,9 @@ app.UseStaticFiles(); app.UseAntiforgery(); app.MapRazorComponents() - .AddInteractiveServerRenderMode(); - //.AddInteractiveWebAssemblyRenderMode() - //.AddAdditionalAssemblies(typeof(MP.MON.Client._Imports).Assembly); + .AddInteractiveServerRenderMode() + .AddInteractiveWebAssemblyRenderMode() + .AddAdditionalAssemblies(typeof(MP.MON.Client._Imports).Assembly); logger.Info("App: Run stage"); app.Run(); diff --git a/MP.MON/Resources/ChangeLog.html b/MP.MON/Resources/ChangeLog.html index 75221a14..1df1e4ae 100644 --- a/MP.MON/Resources/ChangeLog.html +++ b/MP.MON/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC -

Versione: 6.16.2503.1908

+

Versione: 6.16.2503.1911


Note di rilascio:
  • diff --git a/MP.MON/Resources/VersNum.txt b/MP.MON/Resources/VersNum.txt index 30111418..78a7bce2 100644 --- a/MP.MON/Resources/VersNum.txt +++ b/MP.MON/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2503.1908 +6.16.2503.1911 diff --git a/MP.MON/Resources/manifest.xml b/MP.MON/Resources/manifest.xml index 40f69597..5b41dde9 100644 --- a/MP.MON/Resources/manifest.xml +++ b/MP.MON/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2503.1908 + 6.16.2503.1911 https://nexus.steamware.net/repository/SWS/MP-MON/stable/LAST/MP.MON.zip https://nexus.steamware.net/repository/SWS/MP-MON/stable/LAST/ChangeLog.html false diff --git a/MP.MON/wwwroot/lib/WindowSize.js b/MP.MON/wwwroot/lib/WindowSize.js deleted file mode 100644 index a8d2d770..00000000 --- a/MP.MON/wwwroot/lib/WindowSize.js +++ /dev/null @@ -1,6 +0,0 @@ -window.getWindowDimensions = function () { - return { - width: window.innerWidth, - height: window.innerHeight - }; -}; \ No newline at end of file From 361858195531b0aa1c359315bcf9e55d961f282f Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Wed, 19 Mar 2025 11:11:32 +0100 Subject: [PATCH 3/3] Test MON di nuovo WASM --- MP.MON.Client/Components/CmpFooter.razor | 4 ++-- MP.MON.Client/Components/CmpFooter.razor.cs | 2 +- MP.MON/Components/App.razor | 2 +- MP.MON/Program.cs | 3 --- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/MP.MON.Client/Components/CmpFooter.razor b/MP.MON.Client/Components/CmpFooter.razor index a8c632d1..a785d642 100644 --- a/MP.MON.Client/Components/CmpFooter.razor +++ b/MP.MON.Client/Components/CmpFooter.razor @@ -9,9 +9,9 @@ } @(OperatingSystem.IsBrowser() ? "WASM" : "Server") - + @* @($"{DateTime.Now:HH:mm:ss}") - + *@ | Egalware \ No newline at end of file diff --git a/MP.MON.Client/Components/CmpFooter.razor.cs b/MP.MON.Client/Components/CmpFooter.razor.cs index eb59c864..102981c7 100644 --- a/MP.MON.Client/Components/CmpFooter.razor.cs +++ b/MP.MON.Client/Components/CmpFooter.razor.cs @@ -34,7 +34,7 @@ namespace MP.MON.Client.Components public void StartTimer() { - int tOutPeriod = 5000; + int tOutPeriod = 60000; aTimer = new System.Timers.Timer(tOutPeriod); aTimer.Elapsed += ElapsedTimer; aTimer.Enabled = true; diff --git a/MP.MON/Components/App.razor b/MP.MON/Components/App.razor index fd62d99c..a74296d3 100644 --- a/MP.MON/Components/App.razor +++ b/MP.MON/Components/App.razor @@ -18,7 +18,7 @@ @* *@ - +