diff --git a/MP.Data/MP.Data.csproj b/MP.Data/MP.Data.csproj index 41f08fa6..4f1b7c7e 100644 --- a/MP.Data/MP.Data.csproj +++ b/MP.Data/MP.Data.csproj @@ -12,14 +12,14 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + \ No newline at end of file diff --git a/MP.Mon/Components/CmpFooter.razor b/MP.Mon/Components/CmpFooter.razor index 507af4e6..e0e57471 100644 --- a/MP.Mon/Components/CmpFooter.razor +++ b/MP.Mon/Components/CmpFooter.razor @@ -7,41 +7,3 @@ -@code { - - Version version = typeof(Program).Assembly.GetName().Version; - - protected override async Task OnInitializedAsync() - { - StartTimer(); - } - - public void Dispose() - { - aTimer.Stop(); - aTimer.Dispose(); - } - - private static System.Timers.Timer aTimer; - - 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(); - } - - public void ElapsedTimer(Object source, System.Timers.ElapsedEventArgs e) - { - var pUpd = Task.Run(async () => - { - //await ReloadData(); - await Task.Delay(1); - await InvokeAsync(StateHasChanged); - }); - pUpd.Wait(); - } -} \ No newline at end of file diff --git a/MP.Mon/Components/CmpFooter.razor.cs b/MP.Mon/Components/CmpFooter.razor.cs new file mode 100644 index 00000000..71252e09 --- /dev/null +++ b/MP.Mon/Components/CmpFooter.razor.cs @@ -0,0 +1,55 @@ +namespace MP.Mon.Components +{ + public partial class CmpFooter + { + #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 ReloadData(); + await Task.Delay(1); + await InvokeAsync(StateHasChanged); + }); + 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 Methods + + protected override async Task OnInitializedAsync() + { + var currAssembly = typeof(Program).Assembly.GetName(); + version = currAssembly.Version != null ? currAssembly.Version : new Version(); + StartTimer(); + await Task.Delay(1); + } + + #endregion Protected Methods + + #region Private Fields + + private static System.Timers.Timer aTimer = null!; + private Version version = null!; + + #endregion Private Fields + } +} \ No newline at end of file diff --git a/MP.Mon/Components/DetailMSE.razor b/MP.Mon/Components/DetailMSE.razor index 0700a123..f8e39dad 100644 --- a/MP.Mon/Components/DetailMSE.razor +++ b/MP.Mon/Components/DetailMSE.razor @@ -54,7 +54,7 @@ {
@CurrRecord.DescrizioneStato
-
@getMinSec((decimal)CurrRecord.Durata)
+
@getMinSec(getDecimal(@CurrRecord.Durata))
} @if (hasRow(3)) diff --git a/MP.Mon/Components/DetailMSE.razor.cs b/MP.Mon/Components/DetailMSE.razor.cs index 60202343..c9e91dd1 100644 --- a/MP.Mon/Components/DetailMSE.razor.cs +++ b/MP.Mon/Components/DetailMSE.razor.cs @@ -140,7 +140,7 @@ namespace MP.Mon.Components aTimer.Dispose(); } - public void ElapsedTimer(Object source, System.Timers.ElapsedEventArgs e) + public void ElapsedTimer(object? source, System.Timers.ElapsedEventArgs e) { var pUpd = Task.Run(async () => { @@ -168,7 +168,7 @@ namespace MP.Mon.Components { StartTimer(); Random rnd = new Random(); - //await Task.Delay(rnd.Next(500)); + await Task.Delay(rnd.Next(5)); dataLoaded = true; setupConf(); } @@ -219,13 +219,24 @@ namespace MP.Mon.Components 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 { - tSpan = TimeSpan.FromMinutes((double)currTimeMin); + double cTimeMin = currTimeMin != null ? (double)currTimeMin : 0; + tSpan = TimeSpan.FromMinutes(cTimeMin); answ = $"{tSpan:mm}:{tSpan:ss}"; } catch diff --git a/MP.Mon/Conf/iobTagsConf.json b/MP.Mon/Conf/iobTagsConf.json index f216a4d6..b39524e7 100644 --- a/MP.Mon/Conf/iobTagsConf.json +++ b/MP.Mon/Conf/iobTagsConf.json @@ -1,90 +1,5 @@ { "IobSetup": { - "***": [ - { - "ColNum": 1, - "RowNum": 5, - "TagCss": "fontSmall", - "TagName": "Feed Over", - "TagLocation": "MoonPro:SQL2016DEV:MoonPro:FLOG:***:FEED_OVER" - }, - { - "ColNum": 2, - "RowNum": 5, - "TagCss": "fontSmall", - "TagName": "Rapid Over", - "TagLocation": "MoonPro:SQL2016DEV:MoonPro:FLOG:***:RAPID_OVER" - } - ], - "SIMUL_01": [ - { - "ColNum": 1, - "RowNum": 6, - "TagCss": "fontSmall", - "TagName": "Power", - "TagLocation": "MoonPro:SQL2016DEV:MoonPro:FLOG:SIMUL_01:POWER_01" - } - ], - "SIMUL_02": [ - { - "ColNum": 1, - "RowNum": 6, - "TagCss": "fontSmall", - "TagName": "Power", - "TagLocation": "MoonPro:SQL2016DEV:MoonPro:FLOG:SIMUL_02:POWER_01" - } - ], - "GIACO_ICOEL_001": [ - { - "ColNum": 1, - "RowNum": 1, - "TagName": "Vel", - "TagLocation": "FluxData:TonnOra" - }, - { - "ColNum": 2, - "RowNum": 1, - "TagName": "Vel", - "TagLocation": "FluxData:PezziMin" - }, - { - "ColNum": 1, - "RowNum": 2, - "TagName": "Batch SX", - "TagLocation": "FluxData:BatchL1" - }, - { - "ColNum": 2, - "RowNum": 2, - "TagName": "Batch DX", - "TagLocation": "FluxData:BatchL2" - } - ], - "GIACO_ICOEL_002": [ - { - "ColNum": 1, - "RowNum": 1, - "TagName": "Vel", - "TagLocation": "FluxData:TonnOra" - }, - { - "ColNum": 2, - "RowNum": 1, - "TagName": "Vel", - "TagLocation": "FluxData:PezziMin" - }, - { - "ColNum": 1, - "RowNum": 2, - "TagName": "Batch SX", - "TagLocation": "FluxData:BatchL1" - }, - { - "ColNum": 2, - "RowNum": 2, - "TagName": "Batch DX", - "TagLocation": "FluxData:BatchL2" - } - ] + "***": [] } } \ No newline at end of file diff --git a/MP.Mon/Conf/iobTagsConf.office.json b/MP.Mon/Conf/iobTagsConf.office.json new file mode 100644 index 00000000..f216a4d6 --- /dev/null +++ b/MP.Mon/Conf/iobTagsConf.office.json @@ -0,0 +1,90 @@ +{ + "IobSetup": { + "***": [ + { + "ColNum": 1, + "RowNum": 5, + "TagCss": "fontSmall", + "TagName": "Feed Over", + "TagLocation": "MoonPro:SQL2016DEV:MoonPro:FLOG:***:FEED_OVER" + }, + { + "ColNum": 2, + "RowNum": 5, + "TagCss": "fontSmall", + "TagName": "Rapid Over", + "TagLocation": "MoonPro:SQL2016DEV:MoonPro:FLOG:***:RAPID_OVER" + } + ], + "SIMUL_01": [ + { + "ColNum": 1, + "RowNum": 6, + "TagCss": "fontSmall", + "TagName": "Power", + "TagLocation": "MoonPro:SQL2016DEV:MoonPro:FLOG:SIMUL_01:POWER_01" + } + ], + "SIMUL_02": [ + { + "ColNum": 1, + "RowNum": 6, + "TagCss": "fontSmall", + "TagName": "Power", + "TagLocation": "MoonPro:SQL2016DEV:MoonPro:FLOG:SIMUL_02:POWER_01" + } + ], + "GIACO_ICOEL_001": [ + { + "ColNum": 1, + "RowNum": 1, + "TagName": "Vel", + "TagLocation": "FluxData:TonnOra" + }, + { + "ColNum": 2, + "RowNum": 1, + "TagName": "Vel", + "TagLocation": "FluxData:PezziMin" + }, + { + "ColNum": 1, + "RowNum": 2, + "TagName": "Batch SX", + "TagLocation": "FluxData:BatchL1" + }, + { + "ColNum": 2, + "RowNum": 2, + "TagName": "Batch DX", + "TagLocation": "FluxData:BatchL2" + } + ], + "GIACO_ICOEL_002": [ + { + "ColNum": 1, + "RowNum": 1, + "TagName": "Vel", + "TagLocation": "FluxData:TonnOra" + }, + { + "ColNum": 2, + "RowNum": 1, + "TagName": "Vel", + "TagLocation": "FluxData:PezziMin" + }, + { + "ColNum": 1, + "RowNum": 2, + "TagName": "Batch SX", + "TagLocation": "FluxData:BatchL1" + }, + { + "ColNum": 2, + "RowNum": 2, + "TagName": "Batch DX", + "TagLocation": "FluxData:BatchL2" + } + ] + } +} \ No newline at end of file diff --git a/MP.Mon/Data/MpDataService.cs b/MP.Mon/Data/MpDataService.cs index b95602c0..cda398cd 100644 --- a/MP.Mon/Data/MpDataService.cs +++ b/MP.Mon/Data/MpDataService.cs @@ -11,14 +11,14 @@ namespace MP.Mon.Data { #region Public Fields - public static MP.Data.Controllers.MpMonController dbController; + public static MP.Data.Controllers.MpMonController dbController { get; set; } = null!; #endregion Public Fields #region Private Fields - private static IConfiguration _configuration; - private static ILogger _logger; + private static IConfiguration _configuration = null!; + private static ILogger _logger = null!; private static NLog.Logger Log = LogManager.GetCurrentClassLogger(); @@ -100,10 +100,10 @@ namespace MP.Mon.Data { string outVal = ""; // cerco in REDIS la conf x l'IOB - string rawData = redisDb.StringGet(redKey); + var rawData = redisDb.StringGet(redKey); if (!string.IsNullOrEmpty(rawData)) { - outVal = rawData; + outVal = $"{rawData}"; } return outVal; } diff --git a/MP.Mon/MP.Mon.csproj b/MP.Mon/MP.Mon.csproj index a99e600f..b9c8a139 100644 --- a/MP.Mon/MP.Mon.csproj +++ b/MP.Mon/MP.Mon.csproj @@ -4,7 +4,7 @@ net6.0 enable enable - 6.15.2206.616 + 6.15.2207.718 @@ -30,14 +30,20 @@ - - + + + + + Never + + + Always diff --git a/MP.Mon/Pages/Index.razor.cs b/MP.Mon/Pages/Index.razor.cs index 3d4b2548..e612fb93 100644 --- a/MP.Mon/Pages/Index.razor.cs +++ b/MP.Mon/Pages/Index.razor.cs @@ -59,7 +59,7 @@ namespace MP.Mon.Pages slowTimer.Dispose(); } - public void ElapsedFastTimer(Object source, System.Timers.ElapsedEventArgs e) + public void ElapsedFastTimer(object? source, System.Timers.ElapsedEventArgs e) { var pUpd = Task.Run(async () => { @@ -70,9 +70,10 @@ namespace MP.Mon.Pages pUpd.Wait(); } - public async void ElapsedSlowTimer(Object source, System.Timers.ElapsedEventArgs e) + public async void ElapsedSlowTimer(object? source, System.Timers.ElapsedEventArgs e) { ListMSE = null; + await Task.Delay(1); NavManager.NavigateTo(NavManager.Uri); } diff --git a/MP.Mon/Pages/_Layout.cshtml b/MP.Mon/Pages/_Layout.cshtml index fa03e554..49d12f15 100644 --- a/MP.Mon/Pages/_Layout.cshtml +++ b/MP.Mon/Pages/_Layout.cshtml @@ -28,11 +28,30 @@ 🗙 - @* Riconnessione server app: https://www.syncfusion.com/faq/how-do-i-reconnect-blazor-server-side-automatically *@ + @*Gestione autoriconnessione: https://github.com/dotnet/aspnetcore/issues/38305 (vedere anche https://docs.microsoft.com/it-it/aspnet/core/blazor/fundamentals/signalr?view=aspnetcore-6.0#modify-the-reconnection-handler-blazor-server)*@ diff --git a/MP.Mon/Resources/ChangeLog.html b/MP.Mon/Resources/ChangeLog.html index 0c9933fe..650bbc24 100644 --- a/MP.Mon/Resources/ChangeLog.html +++ b/MP.Mon/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MON MAPO -

Versione: 6.15.2206.616

+

Versione: 6.15.2207.718


Note di rilascio:
  • diff --git a/MP.Mon/Resources/VersNum.txt b/MP.Mon/Resources/VersNum.txt index 76e00419..7db13b1c 100644 --- a/MP.Mon/Resources/VersNum.txt +++ b/MP.Mon/Resources/VersNum.txt @@ -1 +1 @@ -6.15.2206.616 +6.15.2207.718 diff --git a/MP.Mon/Resources/manifest.xml b/MP.Mon/Resources/manifest.xml index 3e2bab2f..78d96058 100644 --- a/MP.Mon/Resources/manifest.xml +++ b/MP.Mon/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.15.2206.616 + 6.15.2207.718 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