From 016c328e237f1c0e3da81aaa470606c018b6f1b3 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Fri, 23 Sep 2022 08:48:58 +0200 Subject: [PATCH 01/16] pagina alarmanalysis --- MP.MONO.UI/MP.MONO.UI.csproj | 2 +- MP.MONO.UI/Pages/AlarmsAnalysis.razor | 21 ++------------------- MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs | 8 ++++---- MP.MONO.UI/Resources/ChangeLog.html | 2 +- MP.MONO.UI/Resources/VersNum.txt | 2 +- MP.MONO.UI/Resources/manifest.xml | 2 +- 6 files changed, 10 insertions(+), 27 deletions(-) diff --git a/MP.MONO.UI/MP.MONO.UI.csproj b/MP.MONO.UI/MP.MONO.UI.csproj index f66ce53..1c4d274 100644 --- a/MP.MONO.UI/MP.MONO.UI.csproj +++ b/MP.MONO.UI/MP.MONO.UI.csproj @@ -5,7 +5,7 @@ enable enable AnyCPU;x86;x64 - 1.2.2209.2217 + 1.2.2209.2308 diff --git a/MP.MONO.UI/Pages/AlarmsAnalysis.razor b/MP.MONO.UI/Pages/AlarmsAnalysis.razor index 95392f3..2734e62 100644 --- a/MP.MONO.UI/Pages/AlarmsAnalysis.razor +++ b/MP.MONO.UI/Pages/AlarmsAnalysis.razor @@ -1,7 +1,7 @@ @page "/AlarmsAnalysis" @*@page "/controlli/{IdxMacchina}"*@ -@using MP.Stats.Components +@using MP.MONO.UI.Components
@@ -35,7 +35,7 @@ - @foreach (var record in ListRecordsREC) + @foreach (var record in ListRecords) { @@ -53,23 +53,6 @@ } - else - { - - - @record.DtStart.ToString("yyyy.MM.dd HH:mm:ss") - - -
@record.AlarmListNav.FullValue
- - -
FIXED
- - -
@TimeSpan.FromMinutes(@record.Duration)
- - - }
diff --git a/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs b/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs index a202b20..134f9e3 100644 --- a/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs +++ b/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs @@ -26,8 +26,8 @@ namespace MP.MONO.UI.Pages private AlarmRecModel currRecord = null; private string fileName = "Controlli.csv"; - private List ListRecords; - private List SearchRecords; + private List? ListRecords = null!; + private List? SearchRecords = null!; #endregion Private Fields @@ -85,7 +85,7 @@ namespace MP.MONO.UI.Pages return answ; } } - protected int machine { get; set; } = ListRecords.Select(x => x.MachineId).FirstOrDefault(); + //protected int machine { get; set; } = ListRecords.Select(x => x.MachineId).FirstOrDefault(); #endregion Protected Properties @@ -98,7 +98,7 @@ namespace MP.MONO.UI.Pages private async Task reloadData() { isLoading = true; - SearchRecords = await MP.MONO.UI.Data.CurrentDataService.dbController.AlarmRecGetParetoFreq(); + SearchRecords = MP.MONO.UI.Data.CurrentDataService.dbController.AlarmRecGetFilt(int.Parse(ListRecords.Select(x=>x.MachineId)), 0, 200); ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); isLoading = false; } diff --git a/MP.MONO.UI/Resources/ChangeLog.html b/MP.MONO.UI/Resources/ChangeLog.html index b65c149..720cb4e 100644 --- a/MP.MONO.UI/Resources/ChangeLog.html +++ b/MP.MONO.UI/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

Version: 1.2.2209.2217

+

Version: 1.2.2209.2308


Release Note:
  • diff --git a/MP.MONO.UI/Resources/VersNum.txt b/MP.MONO.UI/Resources/VersNum.txt index bf8f280..db808ef 100644 --- a/MP.MONO.UI/Resources/VersNum.txt +++ b/MP.MONO.UI/Resources/VersNum.txt @@ -1 +1 @@ -1.2.2209.2217 +1.2.2209.2308 diff --git a/MP.MONO.UI/Resources/manifest.xml b/MP.MONO.UI/Resources/manifest.xml index f2191c4..e9f0889 100644 --- a/MP.MONO.UI/Resources/manifest.xml +++ b/MP.MONO.UI/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.2.2209.2217 + 1.2.2209.2308 http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/MP.Mon.zip http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/ChangeLog.html false From fb7edefcb081bbd24c2175f3214aea003b098a0c Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Fri, 23 Sep 2022 09:28:30 +0200 Subject: [PATCH 02/16] fix controllo allarmi attivi --- MP.MONO.UI/Pages/Alarms.razor | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/MP.MONO.UI/Pages/Alarms.razor b/MP.MONO.UI/Pages/Alarms.razor index 9658305..6c71389 100644 --- a/MP.MONO.UI/Pages/Alarms.razor +++ b/MP.MONO.UI/Pages/Alarms.razor @@ -178,12 +178,15 @@ @foreach (var record in ListRecordsREC) { - @if (record.DtEnd == record.DtStart) + @if (record.DtEnd < record.DtStart) { @record.DtStart.ToString("yyyy.MM.dd HH:mm:ss") + + @record.DtEnd.ToString("yyyy.MM.dd HH:mm:ss") +
    @record.AlarmListNav.FullValue
    @@ -202,6 +205,9 @@ @record.DtStart.ToString("yyyy.MM.dd HH:mm:ss") + + @record.DtEnd.ToString("yyyy.MM.dd HH:mm:ss") +
    @record.AlarmListNav.FullValue
    From 1b368c63a8cb35a3511881d47a83b584b6010394 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 23 Sep 2022 09:39:06 +0200 Subject: [PATCH 03/16] Update decoder: - log info insert allarmi su DB - refresh --- MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj | 2 +- MP.MONO.ANALYZER/Resources/ChangeLog.html | 2 +- MP.MONO.ANALYZER/Resources/VersNum.txt | 2 +- MP.MONO.ANALYZER/Resources/manifest.xml | 2 +- MP.MONO.DECODER/MP.MONO.DECODER.csproj | 2 +- MP.MONO.DECODER/Resources/ChangeLog.html | 2 +- MP.MONO.DECODER/Resources/VersNum.txt | 2 +- MP.MONO.DECODER/Resources/manifest.xml | 2 +- MP.MONO.Data/Controllers/MpDbController.cs | 15 +++++++++++++-- MP.MONO.SIM/MP.MONO.SIM.csproj | 2 +- MP.MONO.SIM/Resources/ChangeLog.html | 2 +- MP.MONO.SIM/Resources/VersNum.txt | 2 +- MP.MONO.SIM/Resources/manifest.xml | 2 +- MP.MONO.SIM/appsettings.json | 2 +- 14 files changed, 26 insertions(+), 15 deletions(-) diff --git a/MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj b/MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj index ea936e3..f17e902 100644 --- a/MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj +++ b/MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj @@ -6,7 +6,7 @@ enable enable AnyCPU;x86;x64 - 1.2.2209.2212 + 1.2.2209.2309 diff --git a/MP.MONO.ANALYZER/Resources/ChangeLog.html b/MP.MONO.ANALYZER/Resources/ChangeLog.html index 3ce4f6b..c52d9bb 100644 --- a/MP.MONO.ANALYZER/Resources/ChangeLog.html +++ b/MP.MONO.ANALYZER/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

    Version: 1.2.2209.2212

    +

    Version: 1.2.2209.2309


    Release Note:
    • diff --git a/MP.MONO.ANALYZER/Resources/VersNum.txt b/MP.MONO.ANALYZER/Resources/VersNum.txt index 5989629..5d367a7 100644 --- a/MP.MONO.ANALYZER/Resources/VersNum.txt +++ b/MP.MONO.ANALYZER/Resources/VersNum.txt @@ -1 +1 @@ -1.2.2209.2212 +1.2.2209.2309 diff --git a/MP.MONO.ANALYZER/Resources/manifest.xml b/MP.MONO.ANALYZER/Resources/manifest.xml index c24beb0..089ddb0 100644 --- a/MP.MONO.ANALYZER/Resources/manifest.xml +++ b/MP.MONO.ANALYZER/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.2.2209.2212 + 1.2.2209.2309 http://nexus.steamware.net/repository/SWS/MP.MONO.ANALYZER/stable/LAST/MP.Mon.zip http://nexus.steamware.net/repository/SWS/MP.MONO.ANALYZER/stable/LAST/ChangeLog.html false diff --git a/MP.MONO.DECODER/MP.MONO.DECODER.csproj b/MP.MONO.DECODER/MP.MONO.DECODER.csproj index 86f7041..84279f3 100644 --- a/MP.MONO.DECODER/MP.MONO.DECODER.csproj +++ b/MP.MONO.DECODER/MP.MONO.DECODER.csproj @@ -6,7 +6,7 @@ enable enable AnyCPU;x86;x64 - 1.2.2209.2212 + 1.2.2209.2309 diff --git a/MP.MONO.DECODER/Resources/ChangeLog.html b/MP.MONO.DECODER/Resources/ChangeLog.html index 3ce4f6b..c52d9bb 100644 --- a/MP.MONO.DECODER/Resources/ChangeLog.html +++ b/MP.MONO.DECODER/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

      Version: 1.2.2209.2212

      +

      Version: 1.2.2209.2309


      Release Note:
      • diff --git a/MP.MONO.DECODER/Resources/VersNum.txt b/MP.MONO.DECODER/Resources/VersNum.txt index 5989629..5d367a7 100644 --- a/MP.MONO.DECODER/Resources/VersNum.txt +++ b/MP.MONO.DECODER/Resources/VersNum.txt @@ -1 +1 @@ -1.2.2209.2212 +1.2.2209.2309 diff --git a/MP.MONO.DECODER/Resources/manifest.xml b/MP.MONO.DECODER/Resources/manifest.xml index 32677ba..989f74d 100644 --- a/MP.MONO.DECODER/Resources/manifest.xml +++ b/MP.MONO.DECODER/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.2.2209.2212 + 1.2.2209.2309 http://nexus.steamware.net/repository/SWS/MP.MONO.DECODER/stable/LAST/MP.Mon.zip http://nexus.steamware.net/repository/SWS/MP.MONO.DECODER/stable/LAST/ChangeLog.html false diff --git a/MP.MONO.Data/Controllers/MpDbController.cs b/MP.MONO.Data/Controllers/MpDbController.cs index c25b0e9..7e27520 100644 --- a/MP.MONO.Data/Controllers/MpDbController.cs +++ b/MP.MONO.Data/Controllers/MpDbController.cs @@ -3,6 +3,7 @@ using MP.MONO.Core.DTO; using MP.MONO.Data.DbModels; using MP.MONO.Data.DTO; using NLog; +using System.Diagnostics; namespace MP.MONO.Data.Controllers { @@ -177,11 +178,16 @@ namespace MP.MONO.Data.Controllers { try { + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); await localDbCtx - .DbSetAlarmLog - .AddRangeAsync(newItems); + .DbSetAlarmLog + .AddRangeAsync(newItems); await localDbCtx.SaveChangesAsync(); fatto = true; + stopWatch.Stop(); + TimeSpan ts = stopWatch.Elapsed; + Log.Info($"AlarmLogInsertMany: completato salvataggio dati | {newItems.Count} rec | {ts.TotalMilliseconds} ms"); } catch (Exception exc) { @@ -390,11 +396,16 @@ namespace MP.MONO.Data.Controllers { try { + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); await localDbCtx .DbSetAlarmRec .AddRangeAsync(newItems); await localDbCtx.SaveChangesAsync(); fatto = true; + stopWatch.Stop(); + TimeSpan ts = stopWatch.Elapsed; + Log.Info($"AlarmRecInsertMany: completato salvataggio dati | {newItems.Count} rec | {ts.TotalMilliseconds} ms"); } catch (Exception exc) { diff --git a/MP.MONO.SIM/MP.MONO.SIM.csproj b/MP.MONO.SIM/MP.MONO.SIM.csproj index 3ac9672..e67cfa6 100644 --- a/MP.MONO.SIM/MP.MONO.SIM.csproj +++ b/MP.MONO.SIM/MP.MONO.SIM.csproj @@ -6,7 +6,7 @@ enable enable AnyCPU;x86;x64 - 1.2.2209.2212 + 1.2.2209.2309 diff --git a/MP.MONO.SIM/Resources/ChangeLog.html b/MP.MONO.SIM/Resources/ChangeLog.html index 3ce4f6b..c52d9bb 100644 --- a/MP.MONO.SIM/Resources/ChangeLog.html +++ b/MP.MONO.SIM/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

        Version: 1.2.2209.2212

        +

        Version: 1.2.2209.2309


        Release Note:
        • diff --git a/MP.MONO.SIM/Resources/VersNum.txt b/MP.MONO.SIM/Resources/VersNum.txt index 5989629..5d367a7 100644 --- a/MP.MONO.SIM/Resources/VersNum.txt +++ b/MP.MONO.SIM/Resources/VersNum.txt @@ -1 +1 @@ -1.2.2209.2212 +1.2.2209.2309 diff --git a/MP.MONO.SIM/Resources/manifest.xml b/MP.MONO.SIM/Resources/manifest.xml index 1b03930..1e26558 100644 --- a/MP.MONO.SIM/Resources/manifest.xml +++ b/MP.MONO.SIM/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.2.2209.2212 + 1.2.2209.2309 http://nexus.steamware.net/repository/SWS/MP.MONO.SIM/stable/LAST/MP.Mon.zip http://nexus.steamware.net/repository/SWS/MP.MONO.SIM/stable/LAST/ChangeLog.html false diff --git a/MP.MONO.SIM/appsettings.json b/MP.MONO.SIM/appsettings.json index 4fb6ea8..802b708 100644 --- a/MP.MONO.SIM/appsettings.json +++ b/MP.MONO.SIM/appsettings.json @@ -44,7 +44,7 @@ "SimPar": { "MinSaveIntSec": 5, "PercAllarmi": 10, - "MaxAddAllarmi": 5, + "MaxAddAllarmi": 4, "MaxDurationAllarmi": 10 } } From 65852999bd8f79e1b84804435d9f534c797853a9 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 23 Sep 2022 10:24:40 +0200 Subject: [PATCH 04/16] Log invio redis x debug picchi --- MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj | 2 +- MP.MONO.ANALYZER/Resources/ChangeLog.html | 2 +- MP.MONO.ANALYZER/Resources/VersNum.txt | 2 +- MP.MONO.ANALYZER/Resources/manifest.xml | 2 +- MP.MONO.DECODER/MP.MONO.DECODER.csproj | 2 +- MP.MONO.DECODER/Resources/ChangeLog.html | 2 +- MP.MONO.DECODER/Resources/VersNum.txt | 2 +- MP.MONO.DECODER/Resources/manifest.xml | 2 +- MP.MONO.Data/Controllers/MpDbController.cs | 4 ++-- MP.MONO.Data/MessagePipe.cs | 26 ++++++++++++++++++---- MP.MONO.SIM/MP.MONO.SIM.csproj | 2 +- MP.MONO.SIM/Resources/ChangeLog.html | 2 +- MP.MONO.SIM/Resources/VersNum.txt | 2 +- MP.MONO.SIM/Resources/manifest.xml | 2 +- 14 files changed, 36 insertions(+), 18 deletions(-) diff --git a/MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj b/MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj index f17e902..4640b32 100644 --- a/MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj +++ b/MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj @@ -6,7 +6,7 @@ enable enable AnyCPU;x86;x64 - 1.2.2209.2309 + 1.2.2209.2310 diff --git a/MP.MONO.ANALYZER/Resources/ChangeLog.html b/MP.MONO.ANALYZER/Resources/ChangeLog.html index c52d9bb..a7cdb01 100644 --- a/MP.MONO.ANALYZER/Resources/ChangeLog.html +++ b/MP.MONO.ANALYZER/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

          Version: 1.2.2209.2309

          +

          Version: 1.2.2209.2310


          Release Note:
          • diff --git a/MP.MONO.ANALYZER/Resources/VersNum.txt b/MP.MONO.ANALYZER/Resources/VersNum.txt index 5d367a7..d7b2b08 100644 --- a/MP.MONO.ANALYZER/Resources/VersNum.txt +++ b/MP.MONO.ANALYZER/Resources/VersNum.txt @@ -1 +1 @@ -1.2.2209.2309 +1.2.2209.2310 diff --git a/MP.MONO.ANALYZER/Resources/manifest.xml b/MP.MONO.ANALYZER/Resources/manifest.xml index 089ddb0..790bcf8 100644 --- a/MP.MONO.ANALYZER/Resources/manifest.xml +++ b/MP.MONO.ANALYZER/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.2.2209.2309 + 1.2.2209.2310 http://nexus.steamware.net/repository/SWS/MP.MONO.ANALYZER/stable/LAST/MP.Mon.zip http://nexus.steamware.net/repository/SWS/MP.MONO.ANALYZER/stable/LAST/ChangeLog.html false diff --git a/MP.MONO.DECODER/MP.MONO.DECODER.csproj b/MP.MONO.DECODER/MP.MONO.DECODER.csproj index 84279f3..57e3e48 100644 --- a/MP.MONO.DECODER/MP.MONO.DECODER.csproj +++ b/MP.MONO.DECODER/MP.MONO.DECODER.csproj @@ -6,7 +6,7 @@ enable enable AnyCPU;x86;x64 - 1.2.2209.2309 + 1.2.2209.2310 diff --git a/MP.MONO.DECODER/Resources/ChangeLog.html b/MP.MONO.DECODER/Resources/ChangeLog.html index c52d9bb..a7cdb01 100644 --- a/MP.MONO.DECODER/Resources/ChangeLog.html +++ b/MP.MONO.DECODER/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

            Version: 1.2.2209.2309

            +

            Version: 1.2.2209.2310


            Release Note:
            • diff --git a/MP.MONO.DECODER/Resources/VersNum.txt b/MP.MONO.DECODER/Resources/VersNum.txt index 5d367a7..d7b2b08 100644 --- a/MP.MONO.DECODER/Resources/VersNum.txt +++ b/MP.MONO.DECODER/Resources/VersNum.txt @@ -1 +1 @@ -1.2.2209.2309 +1.2.2209.2310 diff --git a/MP.MONO.DECODER/Resources/manifest.xml b/MP.MONO.DECODER/Resources/manifest.xml index 989f74d..b46695f 100644 --- a/MP.MONO.DECODER/Resources/manifest.xml +++ b/MP.MONO.DECODER/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.2.2209.2309 + 1.2.2209.2310 http://nexus.steamware.net/repository/SWS/MP.MONO.DECODER/stable/LAST/MP.Mon.zip http://nexus.steamware.net/repository/SWS/MP.MONO.DECODER/stable/LAST/ChangeLog.html false diff --git a/MP.MONO.Data/Controllers/MpDbController.cs b/MP.MONO.Data/Controllers/MpDbController.cs index 7e27520..7781d5a 100644 --- a/MP.MONO.Data/Controllers/MpDbController.cs +++ b/MP.MONO.Data/Controllers/MpDbController.cs @@ -187,7 +187,7 @@ namespace MP.MONO.Data.Controllers fatto = true; stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; - Log.Info($"AlarmLogInsertMany: completato salvataggio dati | {newItems.Count} rec | {ts.TotalMilliseconds} ms"); + Log.Info($"AlarmLogInsertMany| DB insert | {newItems.Count} rec | {ts.TotalMilliseconds} ms"); } catch (Exception exc) { @@ -405,7 +405,7 @@ namespace MP.MONO.Data.Controllers fatto = true; stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; - Log.Info($"AlarmRecInsertMany: completato salvataggio dati | {newItems.Count} rec | {ts.TotalMilliseconds} ms"); + Log.Info($"AlarmRecInsertMany| DB insert | {newItems.Count} rec | {ts.TotalMilliseconds} ms"); } catch (Exception exc) { diff --git a/MP.MONO.Data/MessagePipe.cs b/MP.MONO.Data/MessagePipe.cs index e59626a..72ceaad 100644 --- a/MP.MONO.Data/MessagePipe.cs +++ b/MP.MONO.Data/MessagePipe.cs @@ -1,5 +1,6 @@ using NLog; using StackExchange.Redis; +using System.Diagnostics; namespace MP.MONO.Data { @@ -46,6 +47,8 @@ namespace MP.MONO.Data /// private string _channel { get; set; } = ""; + private Dictionary numSent = new Dictionary(); + #endregion Private Properties #region Private Methods @@ -75,15 +78,30 @@ namespace MP.MONO.Data public bool saveAndSendMessage(string memKey, string message) { bool answ = false; + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); + // invio notifica tramite il canale richiesto answ = sendMessage(message); if (redisDb != null) { redisDb.StringSetAsync(memKey, message); - if (enableLog) - { - Log.Info($"Redis Cache Key: {memKey}"); - } + } + stopWatch.Stop(); + TimeSpan ts = stopWatch.Elapsed; + if (numSent.ContainsKey(memKey)) + { + numSent[memKey]++; + } + else + { + numSent.Add(memKey, 1); + } + if (enableLog || numSent[memKey] > 30) + { + Log.Info($"saveAndSendMessage| mKey {memKey} x {numSent[memKey]} | {message.Length} size | {ts.TotalMilliseconds} ms"); + + numSent[memKey] = 0; } return answ; } diff --git a/MP.MONO.SIM/MP.MONO.SIM.csproj b/MP.MONO.SIM/MP.MONO.SIM.csproj index e67cfa6..5ffa401 100644 --- a/MP.MONO.SIM/MP.MONO.SIM.csproj +++ b/MP.MONO.SIM/MP.MONO.SIM.csproj @@ -6,7 +6,7 @@ enable enable AnyCPU;x86;x64 - 1.2.2209.2309 + 1.2.2209.2310 diff --git a/MP.MONO.SIM/Resources/ChangeLog.html b/MP.MONO.SIM/Resources/ChangeLog.html index c52d9bb..a7cdb01 100644 --- a/MP.MONO.SIM/Resources/ChangeLog.html +++ b/MP.MONO.SIM/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

              Version: 1.2.2209.2309

              +

              Version: 1.2.2209.2310


              Release Note:
              • diff --git a/MP.MONO.SIM/Resources/VersNum.txt b/MP.MONO.SIM/Resources/VersNum.txt index 5d367a7..d7b2b08 100644 --- a/MP.MONO.SIM/Resources/VersNum.txt +++ b/MP.MONO.SIM/Resources/VersNum.txt @@ -1 +1 @@ -1.2.2209.2309 +1.2.2209.2310 diff --git a/MP.MONO.SIM/Resources/manifest.xml b/MP.MONO.SIM/Resources/manifest.xml index 1e26558..767ec15 100644 --- a/MP.MONO.SIM/Resources/manifest.xml +++ b/MP.MONO.SIM/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.2.2209.2309 + 1.2.2209.2310 http://nexus.steamware.net/repository/SWS/MP.MONO.SIM/stable/LAST/MP.Mon.zip http://nexus.steamware.net/repository/SWS/MP.MONO.SIM/stable/LAST/ChangeLog.html false From b8bc8a4854ad30d097df81b0a8786cab8f88dfd9 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Fri, 23 Sep 2022 10:27:19 +0200 Subject: [PATCH 05/16] Demo grafico allarmi --- MP.MONO.UI/Components/Chart/Line.razor | 2 - MP.MONO.UI/Components/Chart/Line.razor.cs | 174 ----------------- MP.MONO.UI/Components/ChartAlarms.razor | 31 +++ MP.MONO.UI/Components/ChartAlarms.razor.cs | 184 ++++++++++++++++++ MP.MONO.UI/Components/ChartController.razor | 2 +- .../{Chart => ChartJS}/BarPlot.razor | 1 - MP.MONO.UI/MP - Backup (1).MONO.UI.csproj | 72 +++++++ MP.MONO.UI/MP - Backup.MONO.UI.csproj | 66 +++++++ MP.MONO.UI/MP.MONO.UI.csproj | 8 +- MP.MONO.UI/Pages/Alarms.razor | 6 - MP.MONO.UI/Pages/AlarmsAnalysis.razor | 33 ++-- MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs | 122 ++++++++++-- MP.MONO.UI/Resources/ChangeLog.html | 2 +- MP.MONO.UI/Resources/VersNum.txt | 2 +- MP.MONO.UI/Resources/manifest.xml | 2 +- 15 files changed, 480 insertions(+), 227 deletions(-) delete mode 100644 MP.MONO.UI/Components/Chart/Line.razor delete mode 100644 MP.MONO.UI/Components/Chart/Line.razor.cs create mode 100644 MP.MONO.UI/Components/ChartAlarms.razor create mode 100644 MP.MONO.UI/Components/ChartAlarms.razor.cs rename MP.MONO.UI/Components/{Chart => ChartJS}/BarPlot.razor (99%) create mode 100644 MP.MONO.UI/MP - Backup (1).MONO.UI.csproj create mode 100644 MP.MONO.UI/MP - Backup.MONO.UI.csproj diff --git a/MP.MONO.UI/Components/Chart/Line.razor b/MP.MONO.UI/Components/Chart/Line.razor deleted file mode 100644 index 7da6d7e..0000000 --- a/MP.MONO.UI/Components/Chart/Line.razor +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/MP.MONO.UI/Components/Chart/Line.razor.cs b/MP.MONO.UI/Components/Chart/Line.razor.cs deleted file mode 100644 index 100baa8..0000000 --- a/MP.MONO.UI/Components/Chart/Line.razor.cs +++ /dev/null @@ -1,174 +0,0 @@ -using Microsoft.AspNetCore.Components; -using Microsoft.JSInterop; -using MP.MONO.Data; - -namespace MP.MONO.UI.Components.Chart -{ - public partial class Line - { - #region Private Properties - - private List _DataTS { get; set; } = null!; - - [Inject] - private IJSRuntime JSRuntime { get; set; } = null!; - - #endregion Private Properties - - #region Public Properties - - [Parameter] - public double AspRatio { get; set; } = 0; - - [Parameter] - public List backColor { get; set; } = new List(); - - [Parameter] - public List DataTS - { - get - { - return _DataTS; - } - - set - { - _DataTS = value; - //var pUpd = Task.Run(async () => await renderChart()); - //pUpd.Wait(); - } - } - - protected string Id { get; set; } = "CurrId"; - - [Parameter] - public string ChartId - { - get - { - return Id; - } - set - { - Id = value; - } - } - - [Parameter] - public List Labels { get; set; } = new List(); - - [Parameter] - public List lineColor { get; set; } = new List(); - - [Parameter] - public int lTens { get; set; } = 0; - - [Parameter] - public string MaxValue { get; set; } = "0"; - - [Parameter] - public string MinValue { get; set; } = "0"; - - [Parameter] - public List pointColor { get; set; } = new List(); - - [Parameter] - public string Title { get; set; } = "Demo Line"; - - #endregion Public Properties - - #region Protected Methods - - /// - /// Inizializzazione rendering componente - /// - /// partendo da qui: - /// https://www.williamleme.com/posts/2020/003-chartjs-blazor/ - /// https://www.puresourcecode.com/dotnet/blazor/using-chart-js-with-blazor/ - /// https://www.tutorialsteacher.com/csharp/csharp-anonymous-type - /// - /// - /// - protected override async Task OnAfterRenderAsync(bool firstRender) - { - await renderChart(); - } - - /// - /// Inizializzazione rendering componente - /// - /// partendo da qui: - /// https://www.williamleme.com/posts/2020/003-chartjs-blazor/ - /// https://www.puresourcecode.com/dotnet/blazor/using-chart-js-with-blazor/ - /// https://www.tutorialsteacher.com/csharp/csharp-anonymous-type - /// - /// - /// - protected async Task renderChart() - { - // creazione di un oggetto anonymous type con tutte le opzioni da passare a chart.js - var config = new - { - type = "line", - options = new - { - responsive = true, - scales = new - { - yAxes = new - { - display = true, - position = "right", - ticks = new - { - maxTicksLimit = 10 - } - - , - suggestedMin = MinValue != MaxValue ? MinValue : "auto", - suggestedMax = MinValue != MaxValue ? MaxValue : "auto" - } - - , - xAxes = new - { - type = "time", - distribution = "linear", - } - } - - , - plugins = new - { - legend = new - { - display = false - } - - , - } - - , - Animation = false, - AspectRatio = AspRatio == 0 ? "auto" : $"{AspRatio}" - } - - , - data = new - { - labels = Labels, - datasets = new[]{new - { - data = DataTS, pointBorderColor = backColor, borderColor = lineColor, backgroundColor = backColor, fill = true, PointRadius = 2, BorderWidth = 1, lineTension = lTens, stepped = false, label = Title - } - } - } - } - - ; - await JSRuntime.InvokeVoidAsync("setup", Id, config); - } - - #endregion Protected Methods - } -} \ No newline at end of file diff --git a/MP.MONO.UI/Components/ChartAlarms.razor b/MP.MONO.UI/Components/ChartAlarms.razor new file mode 100644 index 0000000..dcffcd7 --- /dev/null +++ b/MP.MONO.UI/Components/ChartAlarms.razor @@ -0,0 +1,31 @@ +@using MP.MONO.UI.Components.ChartJS + +
                + @if (RawData == null || RawData.Count == 0) + { +
                +
                No Chart Data
                +
                + } + else + { +
                +
                  + @foreach (var item in @ParetoData) + { +
                • + @item.label + @item.value.ToString("N2")% +
                • + } +
                +
                +
                +
                +
                + +
                +
                +
                + } +
                diff --git a/MP.MONO.UI/Components/ChartAlarms.razor.cs b/MP.MONO.UI/Components/ChartAlarms.razor.cs new file mode 100644 index 0000000..7caa80c --- /dev/null +++ b/MP.MONO.UI/Components/ChartAlarms.razor.cs @@ -0,0 +1,184 @@ +using Microsoft.AspNetCore.Components; +using MP.MONO.Data; +using MP.MONO.UI.Data; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace MP.MONO.UI.Components +{ + public partial class ChartAlarms + { + #region Private Properties + + private List DatiParetoOee + { + get => ParetoData.Select(x => x.value).ToList(); + } + + private List DatiTrs + { + get => TSData; + } + + private List LabelParetoOee + { + get => ParetoData.Select(x => x.label).ToList(); + } + + private List LabelTrs + { + get => TSData.Select(r => $"{r.x:yyyy-MM-dd}").ToList(); + } + + #endregion Private Properties + + #region Protected Properties + + //protected SelectData _currFilter { get; set; } = new SelectData(); + + protected List _rawData { get; set; } = new List(); + + /// + /// Genera colori sfondo 33% rosso / arancione / giallo + /// + /// + /// + protected List bgColors + { + get => semaphColors(ParetoData.Count, "0.3"); + } + +#if false + /// + /// Genera colori sfondo 33% rosso / arancione / giallo + /// + /// + /// + protected List lineColor + { + get => solidColors("1"); + } +#endif + + /// + /// Genera colori sfondo 33% rosso / arancione / giallo + /// + /// + /// + protected List lineColors + { + get => semaphColors(ParetoData.Count, "1"); + } + + //[Inject] + //protected MessageService MessageService { get; set; } + + protected List ParetoData { get; set; } = new List(); + + //[Inject] + //protected MpStatsService StatService { get; set; } + + protected List TSData { get; set; } = new List(); + + #endregion Protected Properties + + #region Public Properties + + [Parameter] + public List RawData + { + get => _rawData; + set + { + // salvo valori + _rawData = value; + if (value != null) + { + // ricalcolo charting data + recalcData(); + } + } + } + + #endregion Public Properties + + #region Private Methods + + private Dictionary calcTSData(DateTime inizio, List yData) + { + Dictionary answ = new Dictionary(); + // usando i dati ricevuti aggiunge variabile x = tempo crescente + int idx = 0; + foreach (var item in yData) + { + answ.Add(inizio.AddHours(idx), item); + idx++; + } + // restituisco! + return answ; + } + + private void recalcData() + { + if (RawData != null) + { + ParetoData = RawData + .GroupBy(x => x.MachineId) + .Select(y => new ChartKV() { label = y.First().MachineId.ToString(), value = Math.Round(y.Average(c => c.EventCount) * 100, 2) }) + .OrderByDescending(x => x.value) + .ToList(); + + TSData = RawData + .GroupBy(x => x.MachineId) + .Select(r => new chartJsData.chartJsTSerie() { x = DateTime.Now, y = Math.Round(r.Average(c => c.EventCount) * 100, 2) }) + .OrderBy(o => o.x) + .ToList(); + } + } + + #endregion Private Methods + + #region Protected Methods + + /// + /// Genera colori sfondo 33% rosso / arancione / giallo + /// + /// + /// + protected List semaphColors(int numRecords, string alpha) + { + List answ = new List(); + // verde... + for (int i = 0; i < numRecords / 3; i++) + { + answ.Add($"rgba(54, 235, 82, {alpha})"); + } + // arancione + for (int i = 0; i < numRecords / 3; i++) + { + answ.Add($"rgba(255, 206, 86, {alpha})"); + } + while (answ.Count < numRecords) + { + answ.Add($"rgba(255, 99, 132, {alpha}"); + } + + return answ; + } + + /// + /// Genera colori sfondo 33% rosso / arancione / giallo + /// + /// + /// + protected List solidColors(string alpha) + { + List answ = new List(); + answ.Add($"rgba(54, 162, 235, {alpha})"); + return answ; + } + + #endregion Protected Methods + } +} diff --git a/MP.MONO.UI/Components/ChartController.razor b/MP.MONO.UI/Components/ChartController.razor index a8e34d4..9ff139b 100644 --- a/MP.MONO.UI/Components/ChartController.razor +++ b/MP.MONO.UI/Components/ChartController.razor @@ -26,7 +26,7 @@
- +
diff --git a/MP.MONO.UI/Components/Chart/BarPlot.razor b/MP.MONO.UI/Components/ChartJS/BarPlot.razor similarity index 99% rename from MP.MONO.UI/Components/Chart/BarPlot.razor rename to MP.MONO.UI/Components/ChartJS/BarPlot.razor index 9596bab..62aa0fc 100644 --- a/MP.MONO.UI/Components/Chart/BarPlot.razor +++ b/MP.MONO.UI/Components/ChartJS/BarPlot.razor @@ -131,4 +131,3 @@ } } } - diff --git a/MP.MONO.UI/MP - Backup (1).MONO.UI.csproj b/MP.MONO.UI/MP - Backup (1).MONO.UI.csproj new file mode 100644 index 0000000..d612949 --- /dev/null +++ b/MP.MONO.UI/MP - Backup (1).MONO.UI.csproj @@ -0,0 +1,72 @@ + + + + net6.0 + enable + enable + AnyCPU;x86;x64 + 1.2.2209.2309 + + + + + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + Never + + + Never + + + + + + Never + + + Never + + + Never + + + PreserveNewest + + + Always + + + PreserveNewest + + + + + + + diff --git a/MP.MONO.UI/MP - Backup.MONO.UI.csproj b/MP.MONO.UI/MP - Backup.MONO.UI.csproj new file mode 100644 index 0000000..90a1ae4 --- /dev/null +++ b/MP.MONO.UI/MP - Backup.MONO.UI.csproj @@ -0,0 +1,66 @@ + + + + net6.0 + enable + enable + AnyCPU;x86;x64 + 1.2.2209.2309 + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + + + + Never + + + Never + + + + + + Never + + + Never + + + Never + + + PreserveNewest + + + Always + + + PreserveNewest + + + + + + + diff --git a/MP.MONO.UI/MP.MONO.UI.csproj b/MP.MONO.UI/MP.MONO.UI.csproj index 7b18968..c9b2b23 100644 --- a/MP.MONO.UI/MP.MONO.UI.csproj +++ b/MP.MONO.UI/MP.MONO.UI.csproj @@ -5,11 +5,17 @@ enable enable AnyCPU;x86;x64 - 1.2.2209.2216 + 1.2.2209.2310 + + + + + + diff --git a/MP.MONO.UI/Pages/Alarms.razor b/MP.MONO.UI/Pages/Alarms.razor index 6c71389..1918967 100644 --- a/MP.MONO.UI/Pages/Alarms.razor +++ b/MP.MONO.UI/Pages/Alarms.razor @@ -184,9 +184,6 @@ @record.DtStart.ToString("yyyy.MM.dd HH:mm:ss") - - @record.DtEnd.ToString("yyyy.MM.dd HH:mm:ss") -
@record.AlarmListNav.FullValue
@@ -205,9 +202,6 @@ @record.DtStart.ToString("yyyy.MM.dd HH:mm:ss") - - @record.DtEnd.ToString("yyyy.MM.dd HH:mm:ss") -
@record.AlarmListNav.FullValue
diff --git a/MP.MONO.UI/Pages/AlarmsAnalysis.razor b/MP.MONO.UI/Pages/AlarmsAnalysis.razor index 2734e62..c42ac01 100644 --- a/MP.MONO.UI/Pages/AlarmsAnalysis.razor +++ b/MP.MONO.UI/Pages/AlarmsAnalysis.razor @@ -11,8 +11,12 @@
@if (ShowCharts == true) { - - } + + }@* + @if (currRecord != null) + { + + }*@ @if (ListRecords == null) { @@ -25,31 +29,20 @@ {
- +
- - - - + + @foreach (var record in ListRecords) { - - + - - - } @@ -60,7 +53,7 @@ } diff --git a/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs b/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs index 134f9e3..cb61719 100644 --- a/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs +++ b/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs @@ -16,6 +16,8 @@ using MP.MONO.UI.Shared; using MP.MONO.UI.Components; using MP.MONO.Data.DbModels; using MP.MONO.UI.Data; +using MP.MONO.Data.DTO; +using System.Diagnostics.Tracing; namespace MP.MONO.UI.Pages { @@ -23,11 +25,12 @@ namespace MP.MONO.UI.Pages { #region Private Fields - private AlarmRecModel currRecord = null; + private AlarmFreqDTO currRecord = null; - private string fileName = "Controlli.csv"; - private List? ListRecords = null!; - private List? SearchRecords = null!; + private string fileName = "OEE.csv"; + private List ListRecords; + + private List SearchRecords; #endregion Private Fields @@ -37,6 +40,18 @@ namespace MP.MONO.UI.Pages private int _numRecord { get; set; } = 10; + //private SelectData currFilter + //{ + // get + // { + // return MessageService.OEE_Filter; + // } + // set + // { + // MessageService.OEE_Filter = value; + // } + //} + private int currPage { get => _currPage; @@ -45,12 +60,17 @@ namespace MP.MONO.UI.Pages if (_currPage != value) { _currPage = value; - var pUpd = Task.Run(async () => await reloadData()); + var pUpd = Task.Run(async () => await ReloadData()); pUpd.Wait(); } } } + //private string fullPath + //{ + // get => $"{Directory.GetCurrentDirectory()}\\temp\\{fileName}"; + //} + private bool isLoading { get; set; } = false; private int numRecord @@ -61,18 +81,30 @@ namespace MP.MONO.UI.Pages if (_numRecord != value) { _numRecord = value; - var pUpd = Task.Run(async () => await reloadData()); + var pUpd = Task.Run(async () => await ReloadData()); pUpd.Wait(); } } } - private bool ShowCharts { get; set; } = false; + private bool ShowCharts { get; set; } = true; #endregion Private Properties #region Protected Properties + [Inject] + protected IJSRuntime JSRuntime { get; set; } + + //[Inject] + //protected MessageService MessageService { get; set; } + + [Inject] + protected NavigationManager NavManager { get; set; } + + //[Inject] + //protected MpStatsService StatService { get; set; } + protected int totalCount { get @@ -85,20 +117,29 @@ namespace MP.MONO.UI.Pages return answ; } } - //protected int machine { get; set; } = ListRecords.Select(x => x.MachineId).FirstOrDefault(); #endregion Protected Properties - #region Public Properties - - #endregion Public Properties - #region Private Methods - private async Task reloadData() + //private async void clearFile() + //{ + // await Task.Run(() => File.Delete(fullPath)); + //} + + //private async Task ExportCsv() + //{ + // isLoading = true; + // // calcolo nome file + // // salvo davvero! + // await MP.Data.Utils.SaveToCsv(SearchRecords, fullPath); + // isLoading = false; + //} + + private async Task ReloadData() { isLoading = true; - SearchRecords = MP.MONO.UI.Data.CurrentDataService.dbController.AlarmRecGetFilt(int.Parse(ListRecords.Select(x=>x.MachineId)), 0, 200); + SearchRecords = MP.MONO.UI.Data.CurrentDataService.dbController.AlarmRecGetParetoFreq(1, DateTime.Now.AddDays(-1), DateTime.Now); ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); isLoading = false; } @@ -107,6 +148,16 @@ namespace MP.MONO.UI.Pages #region Protected Methods + //protected async Task DoFilter(SelectData newFilter) + //{ + // clearFile(); + // currRecord = null; + // SearchRecords = null; + // ListRecords = null; + // currFilter = newFilter; + // await ReloadData(); + //} + protected void ForceReload(int newNum) { numRecord = newNum; @@ -119,42 +170,67 @@ namespace MP.MONO.UI.Pages protected override async Task OnInitializedAsync() { + //clearFile(); numRecord = 10; - await reloadData(); + //MessageService.ShowSearch = false; + //MessageService.PageName = "TRS/OEE %"; + //MessageService.PageIcon = "oi oi-monitor"; + //MessageService.EA_SearchUpdated += OnSeachUpdated; + SearchRecords = MP.MONO.UI.Data.CurrentDataService.dbController.AlarmRecGetParetoFreq(1, DateTime.Now.AddDays(-1), DateTime.Now); + ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); + await ReloadData(); } protected void ResetData() { + //clearFile(); + //StatService.rollBackEdit(currRecord); currRecord = null; } + //protected async Task ResetFilter(SelectData newFilter) + //{ + // clearFile(); + // currRecord = null; + // SearchRecords = null; + // ListRecords = null; + // currFilter = SelectData.Init(5, 7); + // await ReloadData(); + //} + + protected void Select(AlarmFreqDTO selRecord) + { + // applico filtro da selezione + currRecord = selRecord; + } + protected async Task ToggleChart(bool doShow) { ShowCharts = !ShowCharts; if (ShowCharts) { - await reloadData(); + await ReloadData(); } } protected async Task UpdateData() { currRecord = null; - await reloadData(); + await ReloadData(); } #endregion Protected Methods #region Public Methods - public string checkSelect(int IdxMacchina) + public string checkSelect(DateTime DtStart, double EventCount, int IdxMacchina) { string answ = ""; if (currRecord != null) { try { - answ = (currRecord.MachineId == IdxMacchina) ? "table-info" : ""; + answ = (currRecord.MachineId == IdxMacchina && currRecord.EventCount == EventCount) ? "table-info" : ""; } catch { } @@ -167,6 +243,14 @@ namespace MP.MONO.UI.Pages //MessageService.EA_SearchUpdated -= OnSeachUpdated; } + // public void OnSeachUpdated() + // { + // InvokeAsync(() => + // { + // UpdateData(); + // StateHasChanged(); + // }); + // } public async void OnSeachUpdated() { await InvokeAsync(() => diff --git a/MP.MONO.UI/Resources/ChangeLog.html b/MP.MONO.UI/Resources/ChangeLog.html index 4541d50..a7cdb01 100644 --- a/MP.MONO.UI/Resources/ChangeLog.html +++ b/MP.MONO.UI/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

Version: 1.2.2209.2216

+

Version: 1.2.2209.2310


Release Note:
  • diff --git a/MP.MONO.UI/Resources/VersNum.txt b/MP.MONO.UI/Resources/VersNum.txt index e5ec7b6..d7b2b08 100644 --- a/MP.MONO.UI/Resources/VersNum.txt +++ b/MP.MONO.UI/Resources/VersNum.txt @@ -1 +1 @@ -1.2.2209.2216 +1.2.2209.2310 diff --git a/MP.MONO.UI/Resources/manifest.xml b/MP.MONO.UI/Resources/manifest.xml index d4e91b6..a80e3c0 100644 --- a/MP.MONO.UI/Resources/manifest.xml +++ b/MP.MONO.UI/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.2.2209.2216 + 1.2.2209.2310 http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/MP.Mon.zip http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/ChangeLog.html false From 513e4a6dd616df3ba544668af6e96187a4461c29 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 23 Sep 2022 11:52:58 +0200 Subject: [PATCH 06/16] Ancora minor fix x decoder --- MP.MONO.DECODER/MP.MONO.DECODER.csproj | 2 +- MP.MONO.DECODER/Program.cs | 64 +++++++++++++----------- MP.MONO.DECODER/Resources/ChangeLog.html | 2 +- MP.MONO.DECODER/Resources/VersNum.txt | 2 +- MP.MONO.DECODER/Resources/manifest.xml | 2 +- 5 files changed, 39 insertions(+), 33 deletions(-) diff --git a/MP.MONO.DECODER/MP.MONO.DECODER.csproj b/MP.MONO.DECODER/MP.MONO.DECODER.csproj index 57e3e48..acbddbf 100644 --- a/MP.MONO.DECODER/MP.MONO.DECODER.csproj +++ b/MP.MONO.DECODER/MP.MONO.DECODER.csproj @@ -6,7 +6,7 @@ enable enable AnyCPU;x86;x64 - 1.2.2209.2310 + 1.2.2209.2311 diff --git a/MP.MONO.DECODER/Program.cs b/MP.MONO.DECODER/Program.cs index 00a03a6..75ad3aa 100644 --- a/MP.MONO.DECODER/Program.cs +++ b/MP.MONO.DECODER/Program.cs @@ -38,6 +38,11 @@ Console.WriteLine("Running - press CTRL-C to stop"); Console.WriteLine(lineSep); Console.WriteLine(""); +Log.Info(lineSep); +Log.Info("Start DECODER with LUA integration!"); +Log.Info($"vers.{Assembly.GetExecutingAssembly().GetName().Version}"); +Log.Info(lineSep); + // init DB // init info x DB string dbServerAddr = config["DbConfig:Server"]; @@ -91,33 +96,23 @@ string AlarmCleanPost = ""; int DbSampleInt = 60; setupConf(); -/* -------------------------------- - * Setup Gestione ALLARMI - * --------------------------------*/ -// init classe gestione allarmi con LUA -AlarmsManager alarmsMan = new AlarmsManager(); -// inizializzo gestione messagePipe da Redis x allarmi -MessagePipe alarmsSendPipe = new MessagePipe(redisConn, Constants.ALARM_M_QUEUE); -MessagePipe alarmsRecvPipe = new MessagePipe(redisConn, Constants.ALARM_RAW_QUEUE); -// datetime dell'inizio esecuzione task... x usare un semaforo di veto doppia esecuzione entro 30 sec -DateTime lastExecAlarms = DateTime.Now.AddHours(-1); -// registro gestione eventi -alarmsRecvPipe.EA_NewMessage += AlarmsValPipe_EA_NewMessage; - -/* -------------------------------- - * Setup Gestione Parametri - * --------------------------------*/ -ParamsManager paramMan = new ParamsManager(); -// inizializzo gestione messagePipe da Redis x allarmi -MessagePipe paramsSendPipe = new MessagePipe(redisConn, Constants.PARAMS_M_QUEUE); -MessagePipe paramsRecvPipe = new MessagePipe(redisConn, Constants.PARAMS_RAW_QUEUE); // datetime dell'inizio esecuzione task... x usare un semaforo di veto doppia esecuzione entro 30 sec DateTime lastExecParams = DateTime.Now.AddHours(-1); DateTime lastLogDetail = DateTime.Now.AddHours(-1); int numSendParam = 1; int numSendMStatus = 1; + +/* -------------------------------- + * Setup Gestione Counters + * --------------------------------*/ +CounterManager counterMan = new CounterManager(); +// inizializzo gestione messagePipe da Redis x allarmi +MessagePipe counterSendPipe = new MessagePipe(redisConn, Constants.COUNT_M_QUEUE); +MessagePipe counterRecvPipe = new MessagePipe(redisConn, Constants.COUNT_RAW_QUEUE); +// datetime dell'inizio esecuzione task... x usare un semaforo di veto doppia esecuzione entro 30 sec +DateTime lastExecCounters = DateTime.Now.AddHours(-1); // registro gestione eventi -paramsRecvPipe.EA_NewMessage += ParamsValPipe_EA_NewMessage; +counterRecvPipe.EA_NewMessage += CounterRecvPipe_EA_NewMessage; /* -------------------------------- * Setup Gestione MachineStatus @@ -132,16 +127,27 @@ DateTime lastExecStatus = DateTime.Now.AddHours(-1); mpStatusRecvPipe.EA_NewMessage += MpStatusRecvPipe_EA_NewMessage; /* -------------------------------- - * Setup Gestione Counters + * Setup Gestione Parametri * --------------------------------*/ -CounterManager counterMan = new CounterManager(); +ParamsManager paramMan = new ParamsManager(); // inizializzo gestione messagePipe da Redis x allarmi -MessagePipe counterSendPipe = new MessagePipe(redisConn, Constants.COUNT_M_QUEUE); -MessagePipe counterRecvPipe = new MessagePipe(redisConn, Constants.COUNT_RAW_QUEUE); -// datetime dell'inizio esecuzione task... x usare un semaforo di veto doppia esecuzione entro 30 sec -DateTime lastExecCounters = DateTime.Now.AddHours(-1); +MessagePipe paramsSendPipe = new MessagePipe(redisConn, Constants.PARAMS_M_QUEUE); +MessagePipe paramsRecvPipe = new MessagePipe(redisConn, Constants.PARAMS_RAW_QUEUE); // registro gestione eventi -counterRecvPipe.EA_NewMessage += CounterRecvPipe_EA_NewMessage; +paramsRecvPipe.EA_NewMessage += ParamsValPipe_EA_NewMessage; + +/* -------------------------------- + * Setup Gestione ALLARMI + * --------------------------------*/ +// init classe gestione allarmi con LUA +AlarmsManager alarmsMan = new AlarmsManager(); +// inizializzo gestione messagePipe da Redis x allarmi +MessagePipe alarmsSendPipe = new MessagePipe(redisConn, Constants.ALARM_M_QUEUE); +MessagePipe alarmsRecvPipe = new MessagePipe(redisConn, Constants.ALARM_RAW_QUEUE); +// datetime dell'inizio esecuzione task... x usare un semaforo di veto doppia esecuzione entro 30 sec +DateTime lastExecAlarms = DateTime.Now.AddHours(-1); +// registro gestione eventi +alarmsRecvPipe.EA_NewMessage += AlarmsValPipe_EA_NewMessage; /* -------------------------------- * Funzioni / metodi accessori @@ -798,7 +804,7 @@ void MpStatusRecvPipe_EA_NewMessage(object? sender, EventArgs e) // invio sulla message pipeline corretta TUTTI i parametri aggiornati serializzati string updRawVal = JsonConvert.SerializeObject(machinePlate); - paramsSendPipe.saveAndSendMessage(Constants.STATUS_CURR_KEY, updRawVal); + mpStatusSendPipe.saveAndSendMessage(Constants.STATUS_CURR_KEY, updRawVal); } } catch (Exception exc) diff --git a/MP.MONO.DECODER/Resources/ChangeLog.html b/MP.MONO.DECODER/Resources/ChangeLog.html index a7cdb01..782c347 100644 --- a/MP.MONO.DECODER/Resources/ChangeLog.html +++ b/MP.MONO.DECODER/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

    Version: 1.2.2209.2310

    +

    Version: 1.2.2209.2311


    Release Note:
    • diff --git a/MP.MONO.DECODER/Resources/VersNum.txt b/MP.MONO.DECODER/Resources/VersNum.txt index d7b2b08..0cfc30c 100644 --- a/MP.MONO.DECODER/Resources/VersNum.txt +++ b/MP.MONO.DECODER/Resources/VersNum.txt @@ -1 +1 @@ -1.2.2209.2310 +1.2.2209.2311 diff --git a/MP.MONO.DECODER/Resources/manifest.xml b/MP.MONO.DECODER/Resources/manifest.xml index b46695f..e018109 100644 --- a/MP.MONO.DECODER/Resources/manifest.xml +++ b/MP.MONO.DECODER/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.2.2209.2310 + 1.2.2209.2311 http://nexus.steamware.net/repository/SWS/MP.MONO.DECODER/stable/LAST/MP.Mon.zip http://nexus.steamware.net/repository/SWS/MP.MONO.DECODER/stable/LAST/ChangeLog.html false From 4315091e9d57eb27dde4d48415f7fd228af05f57 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 23 Sep 2022 12:10:06 +0200 Subject: [PATCH 07/16] Update pag test x mostrare num ore parametrico --- MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj | 2 +- MP.MONO.ANALYZER/Resources/ChangeLog.html | 2 +- MP.MONO.ANALYZER/Resources/VersNum.txt | 2 +- MP.MONO.ANALYZER/Resources/manifest.xml | 2 +- MP.MONO.DECODER/MP.MONO.DECODER.csproj | 2 +- MP.MONO.DECODER/Resources/ChangeLog.html | 2 +- MP.MONO.DECODER/Resources/VersNum.txt | 2 +- MP.MONO.DECODER/Resources/manifest.xml | 2 +- MP.MONO.SIM/MP.MONO.SIM.csproj | 2 +- MP.MONO.SIM/Resources/ChangeLog.html | 2 +- MP.MONO.SIM/Resources/VersNum.txt | 2 +- MP.MONO.SIM/Resources/manifest.xml | 2 +- MP.MONO.UI/MP.MONO.UI.csproj | 2 +- MP.MONO.UI/Pages/Test.razor | 16 ++++++++++------ MP.MONO.UI/Pages/Test.razor.cs | 22 ++++++++++++++++++++-- MP.MONO.UI/Resources/ChangeLog.html | 2 +- MP.MONO.UI/Resources/VersNum.txt | 2 +- MP.MONO.UI/Resources/manifest.xml | 2 +- 18 files changed, 46 insertions(+), 24 deletions(-) diff --git a/MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj b/MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj index 4640b32..fec781b 100644 --- a/MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj +++ b/MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj @@ -6,7 +6,7 @@ enable enable AnyCPU;x86;x64 - 1.2.2209.2310 + 1.2.2209.2312 diff --git a/MP.MONO.ANALYZER/Resources/ChangeLog.html b/MP.MONO.ANALYZER/Resources/ChangeLog.html index a7cdb01..b4d3370 100644 --- a/MP.MONO.ANALYZER/Resources/ChangeLog.html +++ b/MP.MONO.ANALYZER/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

      Version: 1.2.2209.2310

      +

      Version: 1.2.2209.2312


      Release Note:
      • diff --git a/MP.MONO.ANALYZER/Resources/VersNum.txt b/MP.MONO.ANALYZER/Resources/VersNum.txt index d7b2b08..5e804cc 100644 --- a/MP.MONO.ANALYZER/Resources/VersNum.txt +++ b/MP.MONO.ANALYZER/Resources/VersNum.txt @@ -1 +1 @@ -1.2.2209.2310 +1.2.2209.2312 diff --git a/MP.MONO.ANALYZER/Resources/manifest.xml b/MP.MONO.ANALYZER/Resources/manifest.xml index 790bcf8..aac10f9 100644 --- a/MP.MONO.ANALYZER/Resources/manifest.xml +++ b/MP.MONO.ANALYZER/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.2.2209.2310 + 1.2.2209.2312 http://nexus.steamware.net/repository/SWS/MP.MONO.ANALYZER/stable/LAST/MP.Mon.zip http://nexus.steamware.net/repository/SWS/MP.MONO.ANALYZER/stable/LAST/ChangeLog.html false diff --git a/MP.MONO.DECODER/MP.MONO.DECODER.csproj b/MP.MONO.DECODER/MP.MONO.DECODER.csproj index acbddbf..c171791 100644 --- a/MP.MONO.DECODER/MP.MONO.DECODER.csproj +++ b/MP.MONO.DECODER/MP.MONO.DECODER.csproj @@ -6,7 +6,7 @@ enable enable AnyCPU;x86;x64 - 1.2.2209.2311 + 1.2.2209.2312 diff --git a/MP.MONO.DECODER/Resources/ChangeLog.html b/MP.MONO.DECODER/Resources/ChangeLog.html index 782c347..b4d3370 100644 --- a/MP.MONO.DECODER/Resources/ChangeLog.html +++ b/MP.MONO.DECODER/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

        Version: 1.2.2209.2311

        +

        Version: 1.2.2209.2312


        Release Note:
        • diff --git a/MP.MONO.DECODER/Resources/VersNum.txt b/MP.MONO.DECODER/Resources/VersNum.txt index 0cfc30c..5e804cc 100644 --- a/MP.MONO.DECODER/Resources/VersNum.txt +++ b/MP.MONO.DECODER/Resources/VersNum.txt @@ -1 +1 @@ -1.2.2209.2311 +1.2.2209.2312 diff --git a/MP.MONO.DECODER/Resources/manifest.xml b/MP.MONO.DECODER/Resources/manifest.xml index e018109..6f9d86c 100644 --- a/MP.MONO.DECODER/Resources/manifest.xml +++ b/MP.MONO.DECODER/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.2.2209.2311 + 1.2.2209.2312 http://nexus.steamware.net/repository/SWS/MP.MONO.DECODER/stable/LAST/MP.Mon.zip http://nexus.steamware.net/repository/SWS/MP.MONO.DECODER/stable/LAST/ChangeLog.html false diff --git a/MP.MONO.SIM/MP.MONO.SIM.csproj b/MP.MONO.SIM/MP.MONO.SIM.csproj index 5ffa401..28d1ab9 100644 --- a/MP.MONO.SIM/MP.MONO.SIM.csproj +++ b/MP.MONO.SIM/MP.MONO.SIM.csproj @@ -6,7 +6,7 @@ enable enable AnyCPU;x86;x64 - 1.2.2209.2310 + 1.2.2209.2312 diff --git a/MP.MONO.SIM/Resources/ChangeLog.html b/MP.MONO.SIM/Resources/ChangeLog.html index a7cdb01..b4d3370 100644 --- a/MP.MONO.SIM/Resources/ChangeLog.html +++ b/MP.MONO.SIM/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

          Version: 1.2.2209.2310

          +

          Version: 1.2.2209.2312


          Release Note:
          • diff --git a/MP.MONO.SIM/Resources/VersNum.txt b/MP.MONO.SIM/Resources/VersNum.txt index d7b2b08..5e804cc 100644 --- a/MP.MONO.SIM/Resources/VersNum.txt +++ b/MP.MONO.SIM/Resources/VersNum.txt @@ -1 +1 @@ -1.2.2209.2310 +1.2.2209.2312 diff --git a/MP.MONO.SIM/Resources/manifest.xml b/MP.MONO.SIM/Resources/manifest.xml index 767ec15..b08d9b5 100644 --- a/MP.MONO.SIM/Resources/manifest.xml +++ b/MP.MONO.SIM/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.2.2209.2310 + 1.2.2209.2312 http://nexus.steamware.net/repository/SWS/MP.MONO.SIM/stable/LAST/MP.Mon.zip http://nexus.steamware.net/repository/SWS/MP.MONO.SIM/stable/LAST/ChangeLog.html false diff --git a/MP.MONO.UI/MP.MONO.UI.csproj b/MP.MONO.UI/MP.MONO.UI.csproj index c9b2b23..82ce63f 100644 --- a/MP.MONO.UI/MP.MONO.UI.csproj +++ b/MP.MONO.UI/MP.MONO.UI.csproj @@ -5,7 +5,7 @@ enable enable AnyCPU;x86;x64 - 1.2.2209.2310 + 1.2.2209.2312 diff --git a/MP.MONO.UI/Pages/Test.razor b/MP.MONO.UI/Pages/Test.razor index b4d5ab2..af70158 100644 --- a/MP.MONO.UI/Pages/Test.razor +++ b/MP.MONO.UI/Pages/Test.razor @@ -6,17 +6,21 @@
            -

            Test

            +
            +
            +

            Test

            +
            +
            + h prec: + +
            +
            @if (ListRecords == null) { } - @*else if (totalCount == 0) - { -
            No record found
            - }*@ else {
DateTime start
Error
Status
Duration
MacchinaDurata
- @record.DtStart.ToString("yyyy.MM.dd HH:mm:ss") -
-
@record.AlarmListNav.FullValue
-
-
Fixing...
-
-
@TimeSpan.FromMinutes(@record.Duration)
+
@record.MachineId
+
@record.EventCount
@@ -41,7 +45,7 @@
- @if (totalEvents!= 0) + @if (totalEvents != 0) { @($"{(double)record.EventCount/totalEvents:P2}") } diff --git a/MP.MONO.UI/Pages/Test.razor.cs b/MP.MONO.UI/Pages/Test.razor.cs index fcc5536..ecc0ae3 100644 --- a/MP.MONO.UI/Pages/Test.razor.cs +++ b/MP.MONO.UI/Pages/Test.razor.cs @@ -20,18 +20,36 @@ namespace MP.MONO.UI.Pages { public partial class Test { + protected int _numHourPrev = 24; + protected int numHourPrev + { + get => _numHourPrev; + set + { + _numHourPrev = value; + var pUpd = Task.Run(async () => + { + await ReloadData(); + }); + pUpd.Wait(); + } + } protected int totalCount = 0; protected int totalEvents = 0; protected List ListRecords = new List(); protected override async Task OnInitializedAsync() + { + await ReloadData(); + } + + private async Task ReloadData() { await Task.Delay(1); DateTime adesso = DateTime.Now; - ListRecords = await MMDataService.AlarmRecGetParetoFreq(1, adesso.AddDays(-1), adesso); + ListRecords = await MMDataService.AlarmRecGetParetoFreq(1, adesso.AddHours(-numHourPrev), adesso); totalCount = ListRecords.Count; totalEvents = ListRecords.Sum(x => x.EventCount); } - } } \ No newline at end of file diff --git a/MP.MONO.UI/Resources/ChangeLog.html b/MP.MONO.UI/Resources/ChangeLog.html index a7cdb01..b4d3370 100644 --- a/MP.MONO.UI/Resources/ChangeLog.html +++ b/MP.MONO.UI/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

Version: 1.2.2209.2310

+

Version: 1.2.2209.2312


Release Note:
  • diff --git a/MP.MONO.UI/Resources/VersNum.txt b/MP.MONO.UI/Resources/VersNum.txt index d7b2b08..5e804cc 100644 --- a/MP.MONO.UI/Resources/VersNum.txt +++ b/MP.MONO.UI/Resources/VersNum.txt @@ -1 +1 @@ -1.2.2209.2310 +1.2.2209.2312 diff --git a/MP.MONO.UI/Resources/manifest.xml b/MP.MONO.UI/Resources/manifest.xml index a80e3c0..906d9ca 100644 --- a/MP.MONO.UI/Resources/manifest.xml +++ b/MP.MONO.UI/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.2.2209.2310 + 1.2.2209.2312 http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/MP.Mon.zip http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/ChangeLog.html false From 8f843ffc9b737bc38ec3932d4a76bd8b40a3ad6a Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Fri, 23 Sep 2022 12:11:21 +0200 Subject: [PATCH 08/16] Aggiunta grafici --- MP.MONO.UI/Components/ChartAlarms.razor | 19 ++++++++++-------- MP.MONO.UI/Components/ChartAlarms.razor.cs | 17 ++++++++-------- MP.MONO.UI/Components/ChartJS/BarPlot.razor | 1 + MP.MONO.UI/MP.MONO.UI.csproj | 2 +- MP.MONO.UI/Pages/AlarmsAnalysis.razor | 22 +++++++++++++++++---- MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs | 3 +++ MP.MONO.UI/Resources/ChangeLog.html | 2 +- MP.MONO.UI/Resources/VersNum.txt | 2 +- MP.MONO.UI/Resources/manifest.xml | 2 +- 9 files changed, 46 insertions(+), 24 deletions(-) diff --git a/MP.MONO.UI/Components/ChartAlarms.razor b/MP.MONO.UI/Components/ChartAlarms.razor index dcffcd7..ed04be5 100644 --- a/MP.MONO.UI/Components/ChartAlarms.razor +++ b/MP.MONO.UI/Components/ChartAlarms.razor @@ -9,21 +9,24 @@ } else { -
    + @*
      - @foreach (var item in @ParetoData) + @foreach (var item in RawData) { -
    • - @item.label - @item.value.ToString("N2")% -
    • +
    • + @item.AlarmDescription + @if(totalEvents != 0) + { + + } +
    • }
    -
    +
    *@
    - +
    diff --git a/MP.MONO.UI/Components/ChartAlarms.razor.cs b/MP.MONO.UI/Components/ChartAlarms.razor.cs index 7caa80c..ccf836c 100644 --- a/MP.MONO.UI/Components/ChartAlarms.razor.cs +++ b/MP.MONO.UI/Components/ChartAlarms.razor.cs @@ -118,22 +118,23 @@ namespace MP.MONO.UI.Components // restituisco! return answ; } - + protected int totalEvents = 0; private void recalcData() { if (RawData != null) { ParetoData = RawData - .GroupBy(x => x.MachineId) - .Select(y => new ChartKV() { label = y.First().MachineId.ToString(), value = Math.Round(y.Average(c => c.EventCount) * 100, 2) }) + .GroupBy(x => x.AlarmId) + .Select(y => new ChartKV() { label = y.First().AlarmDescription.ToString(), value = Math.Round(y.Average(c => c.EventCount), 2) }) .OrderByDescending(x => x.value) .ToList(); TSData = RawData - .GroupBy(x => x.MachineId) - .Select(r => new chartJsData.chartJsTSerie() { x = DateTime.Now, y = Math.Round(r.Average(c => c.EventCount) * 100, 2) }) + .GroupBy(x => x.AlarmId) + .Select(r => new chartJsData.chartJsTSerie() { x = DateTime.Now, y = Math.Round(r.Average(c => c.EventCount), 2) }) .OrderBy(o => o.x) .ToList(); + totalEvents = RawData.Sum(x => x.EventCount); } } @@ -152,7 +153,7 @@ namespace MP.MONO.UI.Components // verde... for (int i = 0; i < numRecords / 3; i++) { - answ.Add($"rgba(54, 235, 82, {alpha})"); + answ.Add($"rgba(255, 99, 132, {alpha}"); } // arancione for (int i = 0; i < numRecords / 3; i++) @@ -160,8 +161,8 @@ namespace MP.MONO.UI.Components answ.Add($"rgba(255, 206, 86, {alpha})"); } while (answ.Count < numRecords) - { - answ.Add($"rgba(255, 99, 132, {alpha}"); + { + answ.Add($"rgba(54, 235, 82, {alpha})"); } return answ; diff --git a/MP.MONO.UI/Components/ChartJS/BarPlot.razor b/MP.MONO.UI/Components/ChartJS/BarPlot.razor index 62aa0fc..1313d9c 100644 --- a/MP.MONO.UI/Components/ChartJS/BarPlot.razor +++ b/MP.MONO.UI/Components/ChartJS/BarPlot.razor @@ -83,6 +83,7 @@ labels = Labels } }; + // creazione di un oggetto anonymous type con tutte le opzioni da passare a chart.js, tipo verticale var configHor = new { diff --git a/MP.MONO.UI/MP.MONO.UI.csproj b/MP.MONO.UI/MP.MONO.UI.csproj index c9b2b23..82ce63f 100644 --- a/MP.MONO.UI/MP.MONO.UI.csproj +++ b/MP.MONO.UI/MP.MONO.UI.csproj @@ -5,7 +5,7 @@ enable enable AnyCPU;x86;x64 - 1.2.2209.2310 + 1.2.2209.2312 diff --git a/MP.MONO.UI/Pages/AlarmsAnalysis.razor b/MP.MONO.UI/Pages/AlarmsAnalysis.razor index c42ac01..f818ffb 100644 --- a/MP.MONO.UI/Pages/AlarmsAnalysis.razor +++ b/MP.MONO.UI/Pages/AlarmsAnalysis.razor @@ -32,8 +32,9 @@ - - + + + @@ -41,8 +42,21 @@ { + + } diff --git a/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs b/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs index cb61719..b209cbd 100644 --- a/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs +++ b/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs @@ -39,6 +39,7 @@ namespace MP.MONO.UI.Pages private int _currPage { get; set; } = 1; private int _numRecord { get; set; } = 10; + protected int totalEvents = 0; //private SelectData currFilter //{ @@ -141,6 +142,7 @@ namespace MP.MONO.UI.Pages isLoading = true; SearchRecords = MP.MONO.UI.Data.CurrentDataService.dbController.AlarmRecGetParetoFreq(1, DateTime.Now.AddDays(-1), DateTime.Now); ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); + totalEvents = ListRecords.Sum(x => x.EventCount); isLoading = false; } @@ -178,6 +180,7 @@ namespace MP.MONO.UI.Pages //MessageService.EA_SearchUpdated += OnSeachUpdated; SearchRecords = MP.MONO.UI.Data.CurrentDataService.dbController.AlarmRecGetParetoFreq(1, DateTime.Now.AddDays(-1), DateTime.Now); ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); + totalEvents = ListRecords.Sum(x => x.EventCount); await ReloadData(); } diff --git a/MP.MONO.UI/Resources/ChangeLog.html b/MP.MONO.UI/Resources/ChangeLog.html index a7cdb01..b4d3370 100644 --- a/MP.MONO.UI/Resources/ChangeLog.html +++ b/MP.MONO.UI/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

    Version: 1.2.2209.2310

    +

    Version: 1.2.2209.2312


    Release Note:
    • diff --git a/MP.MONO.UI/Resources/VersNum.txt b/MP.MONO.UI/Resources/VersNum.txt index d7b2b08..5e804cc 100644 --- a/MP.MONO.UI/Resources/VersNum.txt +++ b/MP.MONO.UI/Resources/VersNum.txt @@ -1 +1 @@ -1.2.2209.2310 +1.2.2209.2312 diff --git a/MP.MONO.UI/Resources/manifest.xml b/MP.MONO.UI/Resources/manifest.xml index a80e3c0..906d9ca 100644 --- a/MP.MONO.UI/Resources/manifest.xml +++ b/MP.MONO.UI/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.2.2209.2310 + 1.2.2209.2312 http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/MP.Mon.zip http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/ChangeLog.html false From b351936996d5976904db728b13e448b8189debc5 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Fri, 23 Sep 2022 12:56:11 +0200 Subject: [PATCH 09/16] continuo pagina alarmanalysis --- MP.MONO.UI/Pages/AlarmsAnalysis.razor | 10 ++++++---- MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs | 24 ++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/MP.MONO.UI/Pages/AlarmsAnalysis.razor b/MP.MONO.UI/Pages/AlarmsAnalysis.razor index f818ffb..15421bd 100644 --- a/MP.MONO.UI/Pages/AlarmsAnalysis.razor +++ b/MP.MONO.UI/Pages/AlarmsAnalysis.razor @@ -5,8 +5,10 @@
      - @* - *@ +
      + h prec: + +
      @if (ShowCharts == true) @@ -51,11 +53,11 @@
      @if (totalEvents != 0) { - @($"{(double)record.EventCount / totalEvents:P2}") + @calcPerc((double)record.EventCount) }
      -
      +
      diff --git a/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs b/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs index b209cbd..77fccfa 100644 --- a/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs +++ b/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs @@ -27,7 +27,6 @@ namespace MP.MONO.UI.Pages private AlarmFreqDTO currRecord = null; - private string fileName = "OEE.csv"; private List ListRecords; private List SearchRecords; @@ -40,6 +39,7 @@ namespace MP.MONO.UI.Pages private int _numRecord { get; set; } = 10; protected int totalEvents = 0; + protected string percEvents = ""; //private SelectData currFilter //{ @@ -66,6 +66,20 @@ namespace MP.MONO.UI.Pages } } } + protected int _numHourPrev = 24; + protected int numHourPrev + { + get => _numHourPrev; + set + { + _numHourPrev = value; + var pUpd = Task.Run(async () => + { + await ReloadData(); + }); + pUpd.Wait(); + } + } //private string fullPath //{ @@ -140,7 +154,7 @@ namespace MP.MONO.UI.Pages private async Task ReloadData() { isLoading = true; - SearchRecords = MP.MONO.UI.Data.CurrentDataService.dbController.AlarmRecGetParetoFreq(1, DateTime.Now.AddDays(-1), DateTime.Now); + SearchRecords = MP.MONO.UI.Data.CurrentDataService.dbController.AlarmRecGetParetoFreq(1, DateTime.Now.AddDays(-numHourPrev), DateTime.Now); ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); totalEvents = ListRecords.Sum(x => x.EventCount); isLoading = false; @@ -190,6 +204,12 @@ namespace MP.MONO.UI.Pages //StatService.rollBackEdit(currRecord); currRecord = null; } + protected string calcPerc(double numEvent) + { + string ans = $"{numEvent / totalEvents:P2}"; + + return ans; + } //protected async Task ResetFilter(SelectData newFilter) //{ From 294896905e7c980fb358993506f0e79dde2b32bb Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 23 Sep 2022 15:28:40 +0200 Subject: [PATCH 10/16] Restore Line chartJS --- MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj | 2 +- MP.MONO.ANALYZER/Resources/ChangeLog.html | 2 +- MP.MONO.ANALYZER/Resources/VersNum.txt | 2 +- MP.MONO.ANALYZER/Resources/manifest.xml | 2 +- MP.MONO.DECODER/MP.MONO.DECODER.csproj | 2 +- MP.MONO.DECODER/Resources/ChangeLog.html | 2 +- MP.MONO.DECODER/Resources/VersNum.txt | 2 +- MP.MONO.DECODER/Resources/manifest.xml | 2 +- MP.MONO.SIM/MP.MONO.SIM.csproj | 2 +- MP.MONO.SIM/Resources/ChangeLog.html | 2 +- MP.MONO.SIM/Resources/VersNum.txt | 2 +- MP.MONO.SIM/Resources/manifest.xml | 2 +- MP.MONO.UI/Components/Chart/Line.razor | 1 + MP.MONO.UI/Components/Chart/Line.razor.cs | 162 ++++++++++++++++++++++ MP.MONO.UI/Conf/lic.file | 2 +- MP.MONO.UI/MP.MONO.UI.csproj | 3 +- MP.MONO.UI/Resources/ChangeLog.html | 2 +- MP.MONO.UI/Resources/VersNum.txt | 2 +- MP.MONO.UI/Resources/manifest.xml | 2 +- MP.MONO.UI/temp/InfoData.json | 66 ++++----- 20 files changed, 213 insertions(+), 51 deletions(-) create mode 100644 MP.MONO.UI/Components/Chart/Line.razor create mode 100644 MP.MONO.UI/Components/Chart/Line.razor.cs diff --git a/MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj b/MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj index fec781b..f614fee 100644 --- a/MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj +++ b/MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj @@ -6,7 +6,7 @@ enable enable AnyCPU;x86;x64 - 1.2.2209.2312 + 1.2.2209.2315 diff --git a/MP.MONO.ANALYZER/Resources/ChangeLog.html b/MP.MONO.ANALYZER/Resources/ChangeLog.html index b4d3370..1e6c37f 100644 --- a/MP.MONO.ANALYZER/Resources/ChangeLog.html +++ b/MP.MONO.ANALYZER/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

      Version: 1.2.2209.2312

      +

      Version: 1.2.2209.2315


      Release Note:
      • diff --git a/MP.MONO.ANALYZER/Resources/VersNum.txt b/MP.MONO.ANALYZER/Resources/VersNum.txt index 5e804cc..034afe4 100644 --- a/MP.MONO.ANALYZER/Resources/VersNum.txt +++ b/MP.MONO.ANALYZER/Resources/VersNum.txt @@ -1 +1 @@ -1.2.2209.2312 +1.2.2209.2315 diff --git a/MP.MONO.ANALYZER/Resources/manifest.xml b/MP.MONO.ANALYZER/Resources/manifest.xml index aac10f9..d5470c9 100644 --- a/MP.MONO.ANALYZER/Resources/manifest.xml +++ b/MP.MONO.ANALYZER/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.2.2209.2312 + 1.2.2209.2315 http://nexus.steamware.net/repository/SWS/MP.MONO.ANALYZER/stable/LAST/MP.Mon.zip http://nexus.steamware.net/repository/SWS/MP.MONO.ANALYZER/stable/LAST/ChangeLog.html false diff --git a/MP.MONO.DECODER/MP.MONO.DECODER.csproj b/MP.MONO.DECODER/MP.MONO.DECODER.csproj index c171791..a59544b 100644 --- a/MP.MONO.DECODER/MP.MONO.DECODER.csproj +++ b/MP.MONO.DECODER/MP.MONO.DECODER.csproj @@ -6,7 +6,7 @@ enable enable AnyCPU;x86;x64 - 1.2.2209.2312 + 1.2.2209.2315 diff --git a/MP.MONO.DECODER/Resources/ChangeLog.html b/MP.MONO.DECODER/Resources/ChangeLog.html index b4d3370..1e6c37f 100644 --- a/MP.MONO.DECODER/Resources/ChangeLog.html +++ b/MP.MONO.DECODER/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

        Version: 1.2.2209.2312

        +

        Version: 1.2.2209.2315


        Release Note:
        • diff --git a/MP.MONO.DECODER/Resources/VersNum.txt b/MP.MONO.DECODER/Resources/VersNum.txt index 5e804cc..034afe4 100644 --- a/MP.MONO.DECODER/Resources/VersNum.txt +++ b/MP.MONO.DECODER/Resources/VersNum.txt @@ -1 +1 @@ -1.2.2209.2312 +1.2.2209.2315 diff --git a/MP.MONO.DECODER/Resources/manifest.xml b/MP.MONO.DECODER/Resources/manifest.xml index 6f9d86c..3109123 100644 --- a/MP.MONO.DECODER/Resources/manifest.xml +++ b/MP.MONO.DECODER/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.2.2209.2312 + 1.2.2209.2315 http://nexus.steamware.net/repository/SWS/MP.MONO.DECODER/stable/LAST/MP.Mon.zip http://nexus.steamware.net/repository/SWS/MP.MONO.DECODER/stable/LAST/ChangeLog.html false diff --git a/MP.MONO.SIM/MP.MONO.SIM.csproj b/MP.MONO.SIM/MP.MONO.SIM.csproj index 28d1ab9..a0290b0 100644 --- a/MP.MONO.SIM/MP.MONO.SIM.csproj +++ b/MP.MONO.SIM/MP.MONO.SIM.csproj @@ -6,7 +6,7 @@ enable enable AnyCPU;x86;x64 - 1.2.2209.2312 + 1.2.2209.2315 diff --git a/MP.MONO.SIM/Resources/ChangeLog.html b/MP.MONO.SIM/Resources/ChangeLog.html index b4d3370..1e6c37f 100644 --- a/MP.MONO.SIM/Resources/ChangeLog.html +++ b/MP.MONO.SIM/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

          Version: 1.2.2209.2312

          +

          Version: 1.2.2209.2315


          Release Note:
          • diff --git a/MP.MONO.SIM/Resources/VersNum.txt b/MP.MONO.SIM/Resources/VersNum.txt index 5e804cc..034afe4 100644 --- a/MP.MONO.SIM/Resources/VersNum.txt +++ b/MP.MONO.SIM/Resources/VersNum.txt @@ -1 +1 @@ -1.2.2209.2312 +1.2.2209.2315 diff --git a/MP.MONO.SIM/Resources/manifest.xml b/MP.MONO.SIM/Resources/manifest.xml index b08d9b5..e0223e9 100644 --- a/MP.MONO.SIM/Resources/manifest.xml +++ b/MP.MONO.SIM/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.2.2209.2312 + 1.2.2209.2315 http://nexus.steamware.net/repository/SWS/MP.MONO.SIM/stable/LAST/MP.Mon.zip http://nexus.steamware.net/repository/SWS/MP.MONO.SIM/stable/LAST/ChangeLog.html false diff --git a/MP.MONO.UI/Components/Chart/Line.razor b/MP.MONO.UI/Components/Chart/Line.razor new file mode 100644 index 0000000..7eddca2 --- /dev/null +++ b/MP.MONO.UI/Components/Chart/Line.razor @@ -0,0 +1 @@ + diff --git a/MP.MONO.UI/Components/Chart/Line.razor.cs b/MP.MONO.UI/Components/Chart/Line.razor.cs new file mode 100644 index 0000000..82ea686 --- /dev/null +++ b/MP.MONO.UI/Components/Chart/Line.razor.cs @@ -0,0 +1,162 @@ +using Microsoft.AspNetCore.Components; +using Microsoft.JSInterop; +using MP.MONO.Data; + +namespace MP.MONO.UI.Components.Chart +{ + public partial class Line + { + #region Public Properties + + [Parameter] + public double AspRatio { get; set; } = 0; + + [Parameter] + public List backColor { get; set; } = new List(); + + [Parameter] + public string ChartId + { + get + { + return Id; + } + set + { + Id = value; + } + } + + [Parameter] + public List DataTS + { + get + { + return _DataTS; + } + + set + { + _DataTS = value; + //var pUpd = Task.Run(async () => await renderChart()); + //pUpd.Wait(); + } + } + + [Parameter] + public List Labels { get; set; } = new List(); + + [Parameter] + public List lineColor { get; set; } = new List(); + + [Parameter] + public int lTens { get; set; } = 0; + + [Parameter] + public string MaxValue { get; set; } = "0"; + + [Parameter] + public string MinValue { get; set; } = "0"; + + [Parameter] + public List pointColor { get; set; } = new List(); + + [Parameter] + public string Title { get; set; } = "Demo Line"; + + #endregion Public Properties + + #region Protected Properties + + protected string Id { get; set; } = "CurrId"; + + #endregion Protected Properties + + #region Protected Methods + + /// + /// Inizializzazione rendering componente + /// + /// partendo da qui: https://www.williamleme.com/posts/2020/003-chartjs-blazor/ + /// https://www.puresourcecode.com/dotnet/blazor/using-chart-js-with-blazor/ https://www.tutorialsteacher.com/csharp/csharp-anonymous-type + /// + /// + /// + protected override async Task OnAfterRenderAsync(bool firstRender) + { + await renderChart(); + } + + /// + /// Inizializzazione rendering componente + /// + /// partendo da qui: https://www.williamleme.com/posts/2020/003-chartjs-blazor/ + /// https://www.puresourcecode.com/dotnet/blazor/using-chart-js-with-blazor/ https://www.tutorialsteacher.com/csharp/csharp-anonymous-type + /// + /// + /// + protected async Task renderChart() + { + // creazione di un oggetto anonymous type con tutte le opzioni da passare a chart.js + var config = new + { + type = "line", + options = new + { + responsive = true, + scales = new + { + yAxes = new + { + display = true, + position = "right", + ticks = new + { + maxTicksLimit = 10 + }, + suggestedMin = MinValue != MaxValue ? MinValue : "auto", + suggestedMax = MinValue != MaxValue ? MaxValue : "auto" + }, + xAxes = new + { + type = "time", + distribution = "linear", + } + }, + plugins = new + { + legend = new + { + display = false + }, + }, + Animation = false, + AspectRatio = AspRatio == 0 ? "auto" : $"{AspRatio}" + }, + data = new + { + labels = Labels, + datasets = new[]{new + { + data = DataTS, pointBorderColor = backColor, borderColor = lineColor, backgroundColor = backColor, fill = true, PointRadius = 2, BorderWidth = 1, lineTension = lTens, stepped = false, label = Title + } + } + } + } + + ; + await JSRuntime.InvokeVoidAsync("setup", Id, config); + } + + #endregion Protected Methods + + #region Private Properties + + private List _DataTS { get; set; } = null!; + + [Inject] + private IJSRuntime JSRuntime { get; set; } = null!; + + #endregion Private Properties + } +} \ No newline at end of file diff --git a/MP.MONO.UI/Conf/lic.file b/MP.MONO.UI/Conf/lic.file index 69f59a3..9540e9d 100644 --- a/MP.MONO.UI/Conf/lic.file +++ b/MP.MONO.UI/Conf/lic.file @@ -1 +1 @@ -467e4b24bc3fe9d237169aa274ae589b64f072fb1cd91f4d79aaee76c64afbfced7fb51536b62cf612dedfb304202a1e653778b7cc8c758f83bb058984460301 \ No newline at end of file +31e9cc1c2e8f30a1b4098cb157d712f11f3f2e60fb74169a354c3fa646d6d0e28518b4e3139f844b25824fbcc4340051fc507d22c1c2d2786d3786c777c31cc3 \ No newline at end of file diff --git a/MP.MONO.UI/MP.MONO.UI.csproj b/MP.MONO.UI/MP.MONO.UI.csproj index 82ce63f..868f6da 100644 --- a/MP.MONO.UI/MP.MONO.UI.csproj +++ b/MP.MONO.UI/MP.MONO.UI.csproj @@ -5,7 +5,7 @@ enable enable AnyCPU;x86;x64 - 1.2.2209.2312 + 1.2.2209.2315 @@ -15,7 +15,6 @@ - diff --git a/MP.MONO.UI/Resources/ChangeLog.html b/MP.MONO.UI/Resources/ChangeLog.html index b4d3370..1e6c37f 100644 --- a/MP.MONO.UI/Resources/ChangeLog.html +++ b/MP.MONO.UI/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

            Version: 1.2.2209.2312

            +

            Version: 1.2.2209.2315


            Release Note:
            • diff --git a/MP.MONO.UI/Resources/VersNum.txt b/MP.MONO.UI/Resources/VersNum.txt index 5e804cc..034afe4 100644 --- a/MP.MONO.UI/Resources/VersNum.txt +++ b/MP.MONO.UI/Resources/VersNum.txt @@ -1 +1 @@ -1.2.2209.2312 +1.2.2209.2315 diff --git a/MP.MONO.UI/Resources/manifest.xml b/MP.MONO.UI/Resources/manifest.xml index 906d9ca..c9679ac 100644 --- a/MP.MONO.UI/Resources/manifest.xml +++ b/MP.MONO.UI/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.2.2209.2312 + 1.2.2209.2315 http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/MP.Mon.zip http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/ChangeLog.html false diff --git a/MP.MONO.UI/temp/InfoData.json b/MP.MONO.UI/temp/InfoData.json index 962a618..5073c18 100644 --- a/MP.MONO.UI/temp/InfoData.json +++ b/MP.MONO.UI/temp/InfoData.json @@ -2,55 +2,55 @@ "AdapterType": "Ethernet 802.3", "AddressWidth": "64", "Architecture": "9", - "BiosVersion": "_ASUS_ - 1072009", - "BuildNumber": "19043", - "Caption": "Microsoft Windows 10 Pro", - "ConfiguredClockSpeed": "2400", + "BiosVersion": "ALASKA - 1072009", + "BuildNumber": "19044", + "Caption": "Microsoft Windows 10 Pro N", + "ConfiguredClockSpeed": "3600", "ConfiguredVoltage": "1200", "CpuVersion": "Modello 1, Stepping 0", - "CurrentClockSpeed": "2200", - "CurrentVoltage": "12", + "CurrentClockSpeed": "3501", + "CurrentVoltage": "11", "DataWidth": "64", - "Description": "AMD64 Family 23 Model 17 Stepping 0", - "DeviceLocator": "ChannelA-DIMM0", + "Description": "AMD64 Family 23 Model 113 Stepping 0", + "DeviceLocator": "DIMM 1", "ExtClock": "100", "Family": "107", - "FormFactor": "12", - "GUID": "{7F313732-DBA3-46E5-9FA7-BEF235B0682E}", - "L2CacheSize": "2048", - "L3CacheSize": "4096", + "FormFactor": "8", + "GUID": "{E76995C4-F180-406E-B9C3-E491C65A8FCF}", + "L2CacheSize": "8192", + "L3CacheSize": "65536", "Level": "23", - "LoadPercentage": "23", - "MACAddress": "4C:ED:FB:D9:78:83", - "Manufacturer": "American Megatrends Inc.", + "LoadPercentage": "77", + "MACAddress": "0C:9D:92:B8:FD:E8", + "Manufacturer": "American Megatrends International, LLC.", "MaxNumberOfProcesses": "4294967295", "MaxProcessMemorySize": "137438953344", "MaxVoltage": "1200", "MinVoltage": "1200", - "Name": "Realtek PCIe GbE Family Controller", - "NumberOfCores": "4", - "NumberOfLogicalProcessors": "8", + "Name": "ASUS XG-C100C 10G PCI-E Network Adapter", + "NumberOfCores": "16", + "NumberOfLogicalProcessors": "32", "OSArchitecture": "64 bit", - "PartNumber": "8ATF1G64HZ-2G3E1 ", + "PartNumber": "CMK64GX4M2D3600C18", "PhysicalAdapter": "True", - "ProcessorId": "178BFBFF00810F10", + "ProcessorId": "178BFBFF00870F10", "ProcessorType": "3", - "ProductName": "Realtek PCIe GbE Family Controller", - "ReleaseDate": "20190521000000.000000+000", - "Revision": "4352", + "ProductName": "ASUS XG-C100C 10G PCI-E Network Adapter", + "ReleaseDate": "20210521000000.000000+000", + "Revision": "28928", "Role": "CPU", - "SerialNumber": "00330-80951-85780-AA242", - "ServiceName": "rt640x64", - "SMBIOSBIOSVersion": "X505ZA.311", + "SerialNumber": "00332-00332-17209-AA940", + "ServiceName": "aqnic650", + "SMBIOSBIOSVersion": "F33", "SMBIOSMajorVersion": "3", "SMBIOSMemoryType": "26", - "SMBIOSMinorVersion": "1", - "SocketDesignation": "FP5", - "SoftwareElementID": "X505ZA.311", + "SMBIOSMinorVersion": "3", + "SocketDesignation": "AM4", + "SoftwareElementID": "F33", "SoftwareElementState": "3", - "Speed": "2400", + "Speed": "3600", "SystemBiosMajorVersion": "5", - "SystemBiosMinorVersion": "13", - "SystemName": "EGALW-NB-004", - "Version": "10.0.19043" + "SystemBiosMinorVersion": "17", + "SystemName": "WRKST-R9-SAM", + "Version": "10.0.19044" } \ No newline at end of file From 7b6a24cb2ad80675988472c1ced3b866f0ddaf4d Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Fri, 23 Sep 2022 16:58:33 +0200 Subject: [PATCH 11/16] fix pagina errori con charts --- MP.MONO.UI/MP.MONO.UI.csproj | 2 +- MP.MONO.UI/Pages/AlarmsAnalysis.razor | 15 ++- MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs | 133 +++++++++-------------- MP.MONO.UI/Resources/ChangeLog.html | 2 +- MP.MONO.UI/Resources/VersNum.txt | 2 +- MP.MONO.UI/Resources/manifest.xml | 2 +- 6 files changed, 66 insertions(+), 90 deletions(-) diff --git a/MP.MONO.UI/MP.MONO.UI.csproj b/MP.MONO.UI/MP.MONO.UI.csproj index 82ce63f..572f639 100644 --- a/MP.MONO.UI/MP.MONO.UI.csproj +++ b/MP.MONO.UI/MP.MONO.UI.csproj @@ -5,7 +5,7 @@ enable enable AnyCPU;x86;x64 - 1.2.2209.2312 + 1.2.2209.2316 diff --git a/MP.MONO.UI/Pages/AlarmsAnalysis.razor b/MP.MONO.UI/Pages/AlarmsAnalysis.razor index 15421bd..272a917 100644 --- a/MP.MONO.UI/Pages/AlarmsAnalysis.razor +++ b/MP.MONO.UI/Pages/AlarmsAnalysis.razor @@ -5,15 +5,17 @@
              -
              - h prec: - +
              +
              + + +
              @if (ShowCharts == true) { - + @**@ }@* @if (currRecord != null) { @@ -37,6 +39,7 @@
    + @@ -56,8 +59,10 @@ @calcPerc((double)record.EventCount) } + + diff --git a/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs b/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs index 77fccfa..9756f97 100644 --- a/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs +++ b/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs @@ -18,6 +18,7 @@ using MP.MONO.Data.DbModels; using MP.MONO.UI.Data; using MP.MONO.Data.DTO; using System.Diagnostics.Tracing; +using System.Security.Cryptography.X509Certificates; namespace MP.MONO.UI.Pages { @@ -41,18 +42,6 @@ namespace MP.MONO.UI.Pages protected int totalEvents = 0; protected string percEvents = ""; - //private SelectData currFilter - //{ - // get - // { - // return MessageService.OEE_Filter; - // } - // set - // { - // MessageService.OEE_Filter = value; - // } - //} - private int currPage { get => _currPage; @@ -81,11 +70,6 @@ namespace MP.MONO.UI.Pages } } - //private string fullPath - //{ - // get => $"{Directory.GetCurrentDirectory()}\\temp\\{fileName}"; - //} - private bool isLoading { get; set; } = false; private int numRecord @@ -111,15 +95,9 @@ namespace MP.MONO.UI.Pages [Inject] protected IJSRuntime JSRuntime { get; set; } - //[Inject] - //protected MessageService MessageService { get; set; } - [Inject] protected NavigationManager NavManager { get; set; } - //[Inject] - //protected MpStatsService StatService { get; set; } - protected int totalCount { get @@ -135,20 +113,7 @@ namespace MP.MONO.UI.Pages #endregion Protected Properties - #region Private Methods - - //private async void clearFile() - //{ - // await Task.Run(() => File.Delete(fullPath)); - //} - - //private async Task ExportCsv() - //{ - // isLoading = true; - // // calcolo nome file - // // salvo davvero! - // await MP.Data.Utils.SaveToCsv(SearchRecords, fullPath); - // isLoading = false; + #region Private Methods isLoading = false; //} private async Task ReloadData() @@ -156,7 +121,6 @@ namespace MP.MONO.UI.Pages isLoading = true; SearchRecords = MP.MONO.UI.Data.CurrentDataService.dbController.AlarmRecGetParetoFreq(1, DateTime.Now.AddDays(-numHourPrev), DateTime.Now); ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); - totalEvents = ListRecords.Sum(x => x.EventCount); isLoading = false; } @@ -164,16 +128,6 @@ namespace MP.MONO.UI.Pages #region Protected Methods - //protected async Task DoFilter(SelectData newFilter) - //{ - // clearFile(); - // currRecord = null; - // SearchRecords = null; - // ListRecords = null; - // currFilter = newFilter; - // await ReloadData(); - //} - protected void ForceReload(int newNum) { numRecord = newNum; @@ -186,22 +140,32 @@ namespace MP.MONO.UI.Pages protected override async Task OnInitializedAsync() { - //clearFile(); numRecord = 10; - //MessageService.ShowSearch = false; - //MessageService.PageName = "TRS/OEE %"; - //MessageService.PageIcon = "oi oi-monitor"; - //MessageService.EA_SearchUpdated += OnSeachUpdated; - SearchRecords = MP.MONO.UI.Data.CurrentDataService.dbController.AlarmRecGetParetoFreq(1, DateTime.Now.AddDays(-1), DateTime.Now); + SearchRecords = MP.MONO.UI.Data.CurrentDataService.dbController.AlarmRecGetParetoFreq(1, DateTime.Now.AddDays(-numHourPrev), DateTime.Now); ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); - totalEvents = ListRecords.Sum(x => x.EventCount); + totalEvents = SearchRecords.Sum(x => x.EventCount); + calcolaSoglie(); await ReloadData(); } + private double sogliaGreen = 0; + private double sogliaRed = 1; + private void calcolaSoglie() + { + int numRecord = SearchRecords.Count; + var firstRecord = SearchRecords.Skip((int)(numRecord * 0.2)).FirstOrDefault(); + var lastRecord = SearchRecords.Skip((int)(numRecord * 0.8)).FirstOrDefault(); + if (firstRecord != null) + { + sogliaGreen = (double)firstRecord.EventCount / totalEvents; + } + if (lastRecord != null) + { + sogliaRed = (double)lastRecord.EventCount / totalEvents; + } + } protected void ResetData() { - //clearFile(); - //StatService.rollBackEdit(currRecord); currRecord = null; } protected string calcPerc(double numEvent) @@ -210,16 +174,37 @@ namespace MP.MONO.UI.Pages return ans; } + protected string calcPercStyle(double numEvent) + { + string perc = $"{numEvent / totalEvents:P2}"; + string percs = perc.Substring(0, perc.Length - 1); + string ans = $"width: {@Math.Round(double.Parse(percs), 0)}%"; - //protected async Task ResetFilter(SelectData newFilter) - //{ - // clearFile(); - // currRecord = null; - // SearchRecords = null; - // ListRecords = null; - // currFilter = SelectData.Init(5, 7); - // await ReloadData(); - //} + return ans; + } + protected string styleColourPBar(double eventFreq) + { + string ans = ""; + var source = ListRecords; + + calcolaSoglie(); + + if (eventFreq >= sogliaGreen) + { + ans = "bg-danger"; + } + else if (eventFreq <= sogliaRed) + { + ans = "bg-success"; + } + else + { + ans = "bg-warning"; + } + + + return ans; + } protected void Select(AlarmFreqDTO selRecord) { @@ -243,7 +228,7 @@ namespace MP.MONO.UI.Pages } #endregion Protected Methods - + #region Public Methods public string checkSelect(DateTime DtStart, double EventCount, int IdxMacchina) @@ -260,20 +245,6 @@ namespace MP.MONO.UI.Pages } return answ; } - - public void Dispose() - { - //MessageService.EA_SearchUpdated -= OnSeachUpdated; - } - - // public void OnSeachUpdated() - // { - // InvokeAsync(() => - // { - // UpdateData(); - // StateHasChanged(); - // }); - // } public async void OnSeachUpdated() { await InvokeAsync(() => diff --git a/MP.MONO.UI/Resources/ChangeLog.html b/MP.MONO.UI/Resources/ChangeLog.html index b4d3370..d770b32 100644 --- a/MP.MONO.UI/Resources/ChangeLog.html +++ b/MP.MONO.UI/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

    Version: 1.2.2209.2312

    +

    Version: 1.2.2209.2316


    Release Note:
    • diff --git a/MP.MONO.UI/Resources/VersNum.txt b/MP.MONO.UI/Resources/VersNum.txt index 5e804cc..bcd183e 100644 --- a/MP.MONO.UI/Resources/VersNum.txt +++ b/MP.MONO.UI/Resources/VersNum.txt @@ -1 +1 @@ -1.2.2209.2312 +1.2.2209.2316 diff --git a/MP.MONO.UI/Resources/manifest.xml b/MP.MONO.UI/Resources/manifest.xml index 906d9ca..c74de39 100644 --- a/MP.MONO.UI/Resources/manifest.xml +++ b/MP.MONO.UI/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.2.2209.2312 + 1.2.2209.2316 http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/MP.Mon.zip http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/ChangeLog.html false From 948675e24c91a52247e5fdce506013202d63b366 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 23 Sep 2022 17:05:06 +0200 Subject: [PATCH 12/16] Tentativo cache HistPlot (non si vede +...) --- MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj | 2 +- MP.MONO.ANALYZER/Resources/ChangeLog.html | 2 +- MP.MONO.ANALYZER/Resources/VersNum.txt | 2 +- MP.MONO.ANALYZER/Resources/manifest.xml | 2 +- MP.MONO.Core/Constants.cs | 4 ++ MP.MONO.DECODER/MP.MONO.DECODER.csproj | 2 +- MP.MONO.DECODER/Resources/ChangeLog.html | 2 +- MP.MONO.DECODER/Resources/VersNum.txt | 2 +- MP.MONO.DECODER/Resources/manifest.xml | 2 +- MP.MONO.SIM/MP.MONO.SIM.csproj | 2 +- MP.MONO.SIM/Resources/ChangeLog.html | 2 +- MP.MONO.SIM/Resources/VersNum.txt | 2 +- MP.MONO.SIM/Resources/manifest.xml | 2 +- MP.MONO.UI/Components/ParamPlot.razor | 6 +- MP.MONO.UI/Components/ParamPlot.razor.cs | 67 ++++++++++------------- MP.MONO.UI/Data/CurrentDataService.cs | 23 +++++++- MP.MONO.UI/Data/DataFilter.cs | 28 ++++++++++ MP.MONO.UI/MP.MONO.UI.csproj | 6 +- MP.MONO.UI/NLog.config | 58 ++++++++++++++++++++ MP.MONO.UI/Pages/Parameters.razor | 25 +++++---- MP.MONO.UI/Pages/Parameters.razor.cs | 17 +++++- MP.MONO.UI/Pages/Test.razor.cs | 1 + MP.MONO.UI/Resources/ChangeLog.html | 2 +- MP.MONO.UI/Resources/VersNum.txt | 2 +- MP.MONO.UI/Resources/manifest.xml | 2 +- 25 files changed, 196 insertions(+), 69 deletions(-) create mode 100644 MP.MONO.UI/Data/DataFilter.cs create mode 100644 MP.MONO.UI/NLog.config diff --git a/MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj b/MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj index f614fee..1952755 100644 --- a/MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj +++ b/MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj @@ -6,7 +6,7 @@ enable enable AnyCPU;x86;x64 - 1.2.2209.2315 + 1.2.2209.2317 diff --git a/MP.MONO.ANALYZER/Resources/ChangeLog.html b/MP.MONO.ANALYZER/Resources/ChangeLog.html index 1e6c37f..8974d39 100644 --- a/MP.MONO.ANALYZER/Resources/ChangeLog.html +++ b/MP.MONO.ANALYZER/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

      Version: 1.2.2209.2315

      +

      Version: 1.2.2209.2317


      Release Note:
      • diff --git a/MP.MONO.ANALYZER/Resources/VersNum.txt b/MP.MONO.ANALYZER/Resources/VersNum.txt index 034afe4..3d3fa4b 100644 --- a/MP.MONO.ANALYZER/Resources/VersNum.txt +++ b/MP.MONO.ANALYZER/Resources/VersNum.txt @@ -1 +1 @@ -1.2.2209.2315 +1.2.2209.2317 diff --git a/MP.MONO.ANALYZER/Resources/manifest.xml b/MP.MONO.ANALYZER/Resources/manifest.xml index d5470c9..26a14a8 100644 --- a/MP.MONO.ANALYZER/Resources/manifest.xml +++ b/MP.MONO.ANALYZER/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.2.2209.2315 + 1.2.2209.2317 http://nexus.steamware.net/repository/SWS/MP.MONO.ANALYZER/stable/LAST/MP.Mon.zip http://nexus.steamware.net/repository/SWS/MP.MONO.ANALYZER/stable/LAST/ChangeLog.html false diff --git a/MP.MONO.Core/Constants.cs b/MP.MONO.Core/Constants.cs index f65e3d5..69e26df 100644 --- a/MP.MONO.Core/Constants.cs +++ b/MP.MONO.Core/Constants.cs @@ -55,6 +55,10 @@ namespace MP.MONO.Core public static readonly string TOOLS_CURR_KEY = $"{BASE_HASH}:Current:Tools"; public static readonly string COUNT_CURR_KEY = $"{BASE_HASH}:Current:Counters"; + + // REDIS KEY Dati cache + public static readonly string DATA_LOG_KEY = $"{BASE_HASH}:Cache:DataLog"; + // REDIS Channels messaggi (verso UI) public static readonly string ACT_LOG_M_QUEUE = $"ActivityLog"; public static readonly string ALARM_M_QUEUE = $"Alarms"; diff --git a/MP.MONO.DECODER/MP.MONO.DECODER.csproj b/MP.MONO.DECODER/MP.MONO.DECODER.csproj index a59544b..3e1fb07 100644 --- a/MP.MONO.DECODER/MP.MONO.DECODER.csproj +++ b/MP.MONO.DECODER/MP.MONO.DECODER.csproj @@ -6,7 +6,7 @@ enable enable AnyCPU;x86;x64 - 1.2.2209.2315 + 1.2.2209.2317 diff --git a/MP.MONO.DECODER/Resources/ChangeLog.html b/MP.MONO.DECODER/Resources/ChangeLog.html index 1e6c37f..8974d39 100644 --- a/MP.MONO.DECODER/Resources/ChangeLog.html +++ b/MP.MONO.DECODER/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

        Version: 1.2.2209.2315

        +

        Version: 1.2.2209.2317


        Release Note:
        • diff --git a/MP.MONO.DECODER/Resources/VersNum.txt b/MP.MONO.DECODER/Resources/VersNum.txt index 034afe4..3d3fa4b 100644 --- a/MP.MONO.DECODER/Resources/VersNum.txt +++ b/MP.MONO.DECODER/Resources/VersNum.txt @@ -1 +1 @@ -1.2.2209.2315 +1.2.2209.2317 diff --git a/MP.MONO.DECODER/Resources/manifest.xml b/MP.MONO.DECODER/Resources/manifest.xml index 3109123..872753a 100644 --- a/MP.MONO.DECODER/Resources/manifest.xml +++ b/MP.MONO.DECODER/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.2.2209.2315 + 1.2.2209.2317 http://nexus.steamware.net/repository/SWS/MP.MONO.DECODER/stable/LAST/MP.Mon.zip http://nexus.steamware.net/repository/SWS/MP.MONO.DECODER/stable/LAST/ChangeLog.html false diff --git a/MP.MONO.SIM/MP.MONO.SIM.csproj b/MP.MONO.SIM/MP.MONO.SIM.csproj index a0290b0..3f1cf24 100644 --- a/MP.MONO.SIM/MP.MONO.SIM.csproj +++ b/MP.MONO.SIM/MP.MONO.SIM.csproj @@ -6,7 +6,7 @@ enable enable AnyCPU;x86;x64 - 1.2.2209.2315 + 1.2.2209.2317 diff --git a/MP.MONO.SIM/Resources/ChangeLog.html b/MP.MONO.SIM/Resources/ChangeLog.html index 1e6c37f..8974d39 100644 --- a/MP.MONO.SIM/Resources/ChangeLog.html +++ b/MP.MONO.SIM/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

          Version: 1.2.2209.2315

          +

          Version: 1.2.2209.2317


          Release Note:
          • diff --git a/MP.MONO.SIM/Resources/VersNum.txt b/MP.MONO.SIM/Resources/VersNum.txt index 034afe4..3d3fa4b 100644 --- a/MP.MONO.SIM/Resources/VersNum.txt +++ b/MP.MONO.SIM/Resources/VersNum.txt @@ -1 +1 @@ -1.2.2209.2315 +1.2.2209.2317 diff --git a/MP.MONO.SIM/Resources/manifest.xml b/MP.MONO.SIM/Resources/manifest.xml index e0223e9..eb3e64d 100644 --- a/MP.MONO.SIM/Resources/manifest.xml +++ b/MP.MONO.SIM/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.2.2209.2315 + 1.2.2209.2317 http://nexus.steamware.net/repository/SWS/MP.MONO.SIM/stable/LAST/MP.Mon.zip http://nexus.steamware.net/repository/SWS/MP.MONO.SIM/stable/LAST/ChangeLog.html false diff --git a/MP.MONO.UI/Components/ParamPlot.razor b/MP.MONO.UI/Components/ParamPlot.razor index 5232ec4..33538a7 100644 --- a/MP.MONO.UI/Components/ParamPlot.razor +++ b/MP.MONO.UI/Components/ParamPlot.razor @@ -27,4 +27,8 @@ } - +@*else +{ + +} +*@ diff --git a/MP.MONO.UI/Components/ParamPlot.razor.cs b/MP.MONO.UI/Components/ParamPlot.razor.cs index a8502aa..88a99d2 100644 --- a/MP.MONO.UI/Components/ParamPlot.razor.cs +++ b/MP.MONO.UI/Components/ParamPlot.razor.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Components; using MP.MONO.Data; +using MP.MONO.UI.Data; using MP.MONO.Data.DbModels; namespace MP.MONO.UI.Components @@ -31,8 +32,7 @@ namespace MP.MONO.UI.Components #region Protected Properties protected string _selParam { get; set; } = ""; - protected DateTime DateFrom { get; set; } = DateTime.Today.AddDays(-1); - protected DateTime DateTo { get; set; } = DateTime.Today.AddDays(1); + protected string? MaxVal { @@ -65,22 +65,32 @@ namespace MP.MONO.UI.Components #endregion Protected Properties #region Public Properties + protected DataLogFilter _SelFilter { get; set; } = new DataLogFilter(); + [Parameter] - public DateTime EndDate + public DataLogFilter SelFilter { - get - { - return DateTo; - } + get => _SelFilter; set { - DateTo = value; - var pUpd = Task.Run(async () => await ReloadData()); - pUpd.Wait(); + if (!_SelFilter.Equals(value)) + { + _SelFilter = value; + var pUpd = Task.Run(async () => await ReloadData()); + pUpd.Wait(); + } } } + //[Parameter] + //public DateTime EndDate + private DateTime EndDate + { + get => _SelFilter.DtEnd; + //set => _SelFilter.DtEnd = value; + } + [Parameter] public int MachineId { get; set; } = 1; @@ -92,36 +102,16 @@ namespace MP.MONO.UI.Components [Parameter] public string SelectedParam { - get - { - return _selParam; - } - set - { - // controllo se è variato - if (_selParam != value) - { - // salvo - _selParam = value; - var pUpd = Task.Run(async () => await ReloadData()); - pUpd.Wait(); - } - } + get => _selParam; + set => _selParam = value; } - [Parameter] - public DateTime StartDate + //[Parameter] + //public DateTime StartDate + private DateTime StartDate { - get - { - return DateFrom; - } - set - { - DateFrom = value; - var pUpd = Task.Run(async () => await ReloadData()); - pUpd.Wait(); - } + get => _SelFilter.DtStart; + //set => _SelFilter.DtStart = value; } #endregion Public Properties @@ -151,6 +141,9 @@ namespace MP.MONO.UI.Components protected override async Task OnInitializedAsync() { + //isLoading = true; + //ListRecords = null; + //await Task.Delay(1); await ReloadData(); await Task.Delay(1); } diff --git a/MP.MONO.UI/Data/CurrentDataService.cs b/MP.MONO.UI/Data/CurrentDataService.cs index 756167c..763cde7 100644 --- a/MP.MONO.UI/Data/CurrentDataService.cs +++ b/MP.MONO.UI/Data/CurrentDataService.cs @@ -193,13 +193,30 @@ namespace MP.MONO.UI.Data public async Task> DataLogGetFilt(int machineId, string fluxType, DateTime inizio, DateTime fine) { + string source = "DB"; + List dbResult = new List(); + string currKey = $"{Constants.DATA_LOG_KEY}:{machineId}:{fluxType.Replace(" ", "_")}:{inizio:yyyyMMdd}:{fine:yyyyMMdd}"; Stopwatch stopWatch = new Stopwatch(); stopWatch.Start(); - var dbResult = dbController.DataLogGetFilt(machineId, fluxType, inizio, fine); + string rawData = await redisDb.StringGetAsync(currKey); + if (!string.IsNullOrEmpty(rawData)) + { + source = "REDIS"; + var redisRes = JsonConvert.DeserializeObject>(rawData); + dbResult = redisRes != null ? dbResult : new List(); + } + else + { + dbResult = dbController.DataLogGetFilt(machineId, fluxType, inizio, fine); + // salvo per 1 minuto... + rawData=JsonConvert.SerializeObject(dbResult); + // test!!! + await redisDb.StringSetAsync(currKey, rawData, TimeSpan.FromSeconds(60)); + } stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; - Log.Trace($"Effettuata lettura da DB ParamLogGetFilt: {ts.TotalMilliseconds} ms"); - return await Task.FromResult(dbResult); + Log.Info($"DataLogGetFilt | {machineId} | {fluxType} | {inizio:yyyyMMdd}-{fine:yyyyMMdd} | {source} | {ts.TotalMilliseconds} ms"); + return dbResult; } public void Dispose() diff --git a/MP.MONO.UI/Data/DataFilter.cs b/MP.MONO.UI/Data/DataFilter.cs new file mode 100644 index 0000000..dae75cb --- /dev/null +++ b/MP.MONO.UI/Data/DataFilter.cs @@ -0,0 +1,28 @@ +namespace MP.MONO.UI.Data +{ + public class DataLogFilter + { + + public DateTime DtStart { get; set; } = DateTime.Today; + public DateTime DtEnd { get; set; } = DateTime.Today; + + public override bool Equals(object obj) + { + if (!(obj is DataLogFilter item)) + return false; + + if (DtStart != item.DtStart) + return false; + + if (DtEnd != item.DtEnd) + return false; + + return true; + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } + } +} diff --git a/MP.MONO.UI/MP.MONO.UI.csproj b/MP.MONO.UI/MP.MONO.UI.csproj index 868f6da..5a03f3d 100644 --- a/MP.MONO.UI/MP.MONO.UI.csproj +++ b/MP.MONO.UI/MP.MONO.UI.csproj @@ -5,7 +5,7 @@ enable enable AnyCPU;x86;x64 - 1.2.2209.2315 + 1.2.2209.2317 @@ -15,10 +15,14 @@ + + + Always + diff --git a/MP.MONO.UI/NLog.config b/MP.MONO.UI/NLog.config new file mode 100644 index 0000000..af929e1 --- /dev/null +++ b/MP.MONO.UI/NLog.config @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MP.MONO.UI/Pages/Parameters.razor b/MP.MONO.UI/Pages/Parameters.razor index 3f8cfbd..92d09f5 100644 --- a/MP.MONO.UI/Pages/Parameters.razor +++ b/MP.MONO.UI/Pages/Parameters.razor @@ -73,18 +73,23 @@ {
            - @foreach (var item in selParams) + @if (isRT) { -
            - @if (isRT) - { + @foreach (var item in selParams) + { +
            - } - else - { - - } -
            +
            + } + } + else + { + @foreach (var item in selParams) + { +
            + +
            + } }
            } diff --git a/MP.MONO.UI/Pages/Parameters.razor.cs b/MP.MONO.UI/Pages/Parameters.razor.cs index 709b692..91fce93 100644 --- a/MP.MONO.UI/Pages/Parameters.razor.cs +++ b/MP.MONO.UI/Pages/Parameters.razor.cs @@ -1,3 +1,6 @@ +using MP.MONO.UI.Data; + + namespace MP.MONO.UI.Pages { public partial class Parameters @@ -7,8 +10,18 @@ namespace MP.MONO.UI.Pages private int maxRecord = 120; private bool showParam = false; - private DateTime DateFrom = DateTime.Today.AddDays(-2); - private DateTime DateTo = DateTime.Today.AddDays(1); + private DateTime DateFrom + { + get => SelFilter.DtStart; + set => SelFilter.DtStart = value; + } + private DateTime DateTo + { + get => SelFilter.DtEnd; + set => SelFilter.DtEnd = value; + } + + protected DataLogFilter SelFilter { get; set; } = new DataLogFilter(); #endregion Private Fields diff --git a/MP.MONO.UI/Pages/Test.razor.cs b/MP.MONO.UI/Pages/Test.razor.cs index ecc0ae3..9d5434a 100644 --- a/MP.MONO.UI/Pages/Test.razor.cs +++ b/MP.MONO.UI/Pages/Test.razor.cs @@ -50,6 +50,7 @@ namespace MP.MONO.UI.Pages ListRecords = await MMDataService.AlarmRecGetParetoFreq(1, adesso.AddHours(-numHourPrev), adesso); totalCount = ListRecords.Count; totalEvents = ListRecords.Sum(x => x.EventCount); + await Task.Delay(1); } } } \ No newline at end of file diff --git a/MP.MONO.UI/Resources/ChangeLog.html b/MP.MONO.UI/Resources/ChangeLog.html index 1e6c37f..8974d39 100644 --- a/MP.MONO.UI/Resources/ChangeLog.html +++ b/MP.MONO.UI/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

            Version: 1.2.2209.2315

            +

            Version: 1.2.2209.2317


            Release Note:
            • diff --git a/MP.MONO.UI/Resources/VersNum.txt b/MP.MONO.UI/Resources/VersNum.txt index 034afe4..3d3fa4b 100644 --- a/MP.MONO.UI/Resources/VersNum.txt +++ b/MP.MONO.UI/Resources/VersNum.txt @@ -1 +1 @@ -1.2.2209.2315 +1.2.2209.2317 diff --git a/MP.MONO.UI/Resources/manifest.xml b/MP.MONO.UI/Resources/manifest.xml index c9679ac..ef6d269 100644 --- a/MP.MONO.UI/Resources/manifest.xml +++ b/MP.MONO.UI/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.2.2209.2315 + 1.2.2209.2317 http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/MP.Mon.zip http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/ChangeLog.html false From 432694fc7d63581ebe5b22a15e125bc25cf260ef Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 23 Sep 2022 17:14:39 +0200 Subject: [PATCH 13/16] Fix calcolo orario + perc --- MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs b/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs index 9756f97..db5d900 100644 --- a/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs +++ b/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs @@ -119,8 +119,11 @@ namespace MP.MONO.UI.Pages private async Task ReloadData() { isLoading = true; - SearchRecords = MP.MONO.UI.Data.CurrentDataService.dbController.AlarmRecGetParetoFreq(1, DateTime.Now.AddDays(-numHourPrev), DateTime.Now); + DateTime adesso = DateTime.Now; + SearchRecords = CurrentDataService.dbController.AlarmRecGetParetoFreq(1, adesso.AddHours(-numHourPrev), adesso); ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); + totalEvents = SearchRecords.Sum(x => x.EventCount); + calcolaSoglie(); isLoading = false; } @@ -143,8 +146,6 @@ namespace MP.MONO.UI.Pages numRecord = 10; SearchRecords = MP.MONO.UI.Data.CurrentDataService.dbController.AlarmRecGetParetoFreq(1, DateTime.Now.AddDays(-numHourPrev), DateTime.Now); ListRecords = SearchRecords.Skip(numRecord * (currPage - 1)).Take(numRecord).ToList(); - totalEvents = SearchRecords.Sum(x => x.EventCount); - calcolaSoglie(); await ReloadData(); } private double sogliaGreen = 0; From 91aa971693f05efa295e3885b352f30ca27fed50 Mon Sep 17 00:00:00 2001 From: "zaccaria.majid" Date: Fri, 23 Sep 2022 17:28:04 +0200 Subject: [PATCH 14/16] fix chart alarms --- MP.MONO.UI/Conf/lic.file | 2 +- MP.MONO.UI/Pages/AlarmsAnalysis.razor | 2 +- MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs | 12 +++++ MP.MONO.UI/temp/InfoData.json | 66 ++++++++++++------------ 4 files changed, 47 insertions(+), 35 deletions(-) diff --git a/MP.MONO.UI/Conf/lic.file b/MP.MONO.UI/Conf/lic.file index 9540e9d..69f59a3 100644 --- a/MP.MONO.UI/Conf/lic.file +++ b/MP.MONO.UI/Conf/lic.file @@ -1 +1 @@ -31e9cc1c2e8f30a1b4098cb157d712f11f3f2e60fb74169a354c3fa646d6d0e28518b4e3139f844b25824fbcc4340051fc507d22c1c2d2786d3786c777c31cc3 \ No newline at end of file +467e4b24bc3fe9d237169aa274ae589b64f072fb1cd91f4d79aaee76c64afbfced7fb51536b62cf612dedfb304202a1e653778b7cc8c758f83bb058984460301 \ No newline at end of file diff --git a/MP.MONO.UI/Pages/AlarmsAnalysis.razor b/MP.MONO.UI/Pages/AlarmsAnalysis.razor index 272a917..42a9a9a 100644 --- a/MP.MONO.UI/Pages/AlarmsAnalysis.razor +++ b/MP.MONO.UI/Pages/AlarmsAnalysis.razor @@ -62,7 +62,7 @@
    diff --git a/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs b/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs index db5d900..e7527a4 100644 --- a/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs +++ b/MP.MONO.UI/Pages/AlarmsAnalysis.razor.cs @@ -19,6 +19,8 @@ using MP.MONO.UI.Data; using MP.MONO.Data.DTO; using System.Diagnostics.Tracing; using System.Security.Cryptography.X509Certificates; +using System.DirectoryServices.Protocols; +using System.Security; namespace MP.MONO.UI.Pages { @@ -183,6 +185,16 @@ namespace MP.MONO.UI.Pages return ans; } + + protected string val(int eventCount) + { + int max = SearchRecords.Max(a => a.EventCount); + + string ans = $"{eventCount/max}"; + + return ans; + } + protected string styleColourPBar(double eventFreq) { string ans = ""; diff --git a/MP.MONO.UI/temp/InfoData.json b/MP.MONO.UI/temp/InfoData.json index 5073c18..3249b8e 100644 --- a/MP.MONO.UI/temp/InfoData.json +++ b/MP.MONO.UI/temp/InfoData.json @@ -2,55 +2,55 @@ "AdapterType": "Ethernet 802.3", "AddressWidth": "64", "Architecture": "9", - "BiosVersion": "ALASKA - 1072009", - "BuildNumber": "19044", - "Caption": "Microsoft Windows 10 Pro N", - "ConfiguredClockSpeed": "3600", + "BiosVersion": "_ASUS_ - 1072009", + "BuildNumber": "19043", + "Caption": "Microsoft Windows 10 Pro", + "ConfiguredClockSpeed": "2400", "ConfiguredVoltage": "1200", "CpuVersion": "Modello 1, Stepping 0", - "CurrentClockSpeed": "3501", - "CurrentVoltage": "11", + "CurrentClockSpeed": "2200", + "CurrentVoltage": "12", "DataWidth": "64", - "Description": "AMD64 Family 23 Model 113 Stepping 0", - "DeviceLocator": "DIMM 1", + "Description": "AMD64 Family 23 Model 17 Stepping 0", + "DeviceLocator": "ChannelA-DIMM0", "ExtClock": "100", "Family": "107", - "FormFactor": "8", - "GUID": "{E76995C4-F180-406E-B9C3-E491C65A8FCF}", - "L2CacheSize": "8192", - "L3CacheSize": "65536", + "FormFactor": "12", + "GUID": "{7F313732-DBA3-46E5-9FA7-BEF235B0682E}", + "L2CacheSize": "2048", + "L3CacheSize": "4096", "Level": "23", - "LoadPercentage": "77", - "MACAddress": "0C:9D:92:B8:FD:E8", - "Manufacturer": "American Megatrends International, LLC.", + "LoadPercentage": "18", + "MACAddress": "4C:ED:FB:D9:78:83", + "Manufacturer": "American Megatrends Inc.", "MaxNumberOfProcesses": "4294967295", "MaxProcessMemorySize": "137438953344", "MaxVoltage": "1200", "MinVoltage": "1200", - "Name": "ASUS XG-C100C 10G PCI-E Network Adapter", - "NumberOfCores": "16", - "NumberOfLogicalProcessors": "32", + "Name": "Realtek PCIe GbE Family Controller", + "NumberOfCores": "4", + "NumberOfLogicalProcessors": "8", "OSArchitecture": "64 bit", - "PartNumber": "CMK64GX4M2D3600C18", + "PartNumber": "8ATF1G64HZ-2G3E1 ", "PhysicalAdapter": "True", - "ProcessorId": "178BFBFF00870F10", + "ProcessorId": "178BFBFF00810F10", "ProcessorType": "3", - "ProductName": "ASUS XG-C100C 10G PCI-E Network Adapter", - "ReleaseDate": "20210521000000.000000+000", - "Revision": "28928", + "ProductName": "Realtek PCIe GbE Family Controller", + "ReleaseDate": "20190521000000.000000+000", + "Revision": "4352", "Role": "CPU", - "SerialNumber": "00332-00332-17209-AA940", - "ServiceName": "aqnic650", - "SMBIOSBIOSVersion": "F33", + "SerialNumber": "00330-80951-85780-AA242", + "ServiceName": "rt640x64", + "SMBIOSBIOSVersion": "X505ZA.311", "SMBIOSMajorVersion": "3", "SMBIOSMemoryType": "26", - "SMBIOSMinorVersion": "3", - "SocketDesignation": "AM4", - "SoftwareElementID": "F33", + "SMBIOSMinorVersion": "1", + "SocketDesignation": "FP5", + "SoftwareElementID": "X505ZA.311", "SoftwareElementState": "3", - "Speed": "3600", + "Speed": "2400", "SystemBiosMajorVersion": "5", - "SystemBiosMinorVersion": "17", - "SystemName": "WRKST-R9-SAM", - "Version": "10.0.19044" + "SystemBiosMinorVersion": "13", + "SystemName": "EGALW-NB-004", + "Version": "10.0.19043" } \ No newline at end of file From 1be45ac9095b7e585ba12e41ea3bd48a633a9958 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 23 Sep 2022 17:48:36 +0200 Subject: [PATCH 15/16] Cache dati OK x parametri DTO! --- MP.MONO.Core/Constants.cs | 1 + MP.MONO.Data/Controllers/MpDbController.cs | 30 ++++++++++++ MP.MONO.Data/DTO/DataLogDTO.cs | 27 +++++++++++ MP.MONO.UI/Components/ParamPlot.razor.cs | 24 ++++------ MP.MONO.UI/Data/CurrentDataService.cs | 53 +++++++++++++++++++--- MP.MONO.UI/Data/DataFilter.cs | 4 +- 6 files changed, 116 insertions(+), 23 deletions(-) create mode 100644 MP.MONO.Data/DTO/DataLogDTO.cs diff --git a/MP.MONO.Core/Constants.cs b/MP.MONO.Core/Constants.cs index 69e26df..0941556 100644 --- a/MP.MONO.Core/Constants.cs +++ b/MP.MONO.Core/Constants.cs @@ -58,6 +58,7 @@ namespace MP.MONO.Core // REDIS KEY Dati cache public static readonly string DATA_LOG_KEY = $"{BASE_HASH}:Cache:DataLog"; + public static readonly string DATA_LOG_DTO_KEY = $"{BASE_HASH}:Cache:DataLogDto"; // REDIS Channels messaggi (verso UI) public static readonly string ACT_LOG_M_QUEUE = $"ActivityLog"; diff --git a/MP.MONO.Data/Controllers/MpDbController.cs b/MP.MONO.Data/Controllers/MpDbController.cs index 7781d5a..3b0cccb 100644 --- a/MP.MONO.Data/Controllers/MpDbController.cs +++ b/MP.MONO.Data/Controllers/MpDbController.cs @@ -445,6 +445,36 @@ namespace MP.MONO.Data.Controllers return dbResult; } + /// + /// Recupero DataLogDTO data condizione filtro + /// + /// + /// + /// + /// + /// + public List DataLogDtoGetFilt(int machineId, string fluxType, DateTime inizio, DateTime fine) + { + List dbResult = new List(); + using (MapoMonoContext localDbCtx = new MapoMonoContext()) + { + try + { + dbResult = localDbCtx + .DbSetDataLog + .Where(x => x.MachineId == machineId && x.FluxType == fluxType && x.DtRif >= inizio && x.DtRif <= fine) + .Select(r => new DataLogDTO() { DataLogId=r.DataLogId, DtRif=r.DtRif, ValNum=r.ValNum }) + .OrderByDescending(x => x.DataLogId) + .ToList(); + } + catch (Exception exc) + { + Log.Error($"Eccezione durante DataLogDtoGetFilt{Environment.NewLine}{exc}"); + } + } + return dbResult; + } + /// /// Inserimento di un SET di record DataLog (post aggregazione base VC) /// diff --git a/MP.MONO.Data/DTO/DataLogDTO.cs b/MP.MONO.Data/DTO/DataLogDTO.cs new file mode 100644 index 0000000..15b2b9f --- /dev/null +++ b/MP.MONO.Data/DTO/DataLogDTO.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +// +// This is here so CodeMaid doesn't reorganize this document +// +namespace MP.MONO.Data.DTO +{ + public class DataLogDTO + { + public int DataLogId { get; set; } + + /// + /// DataOra evento registrato + /// + public DateTime DtRif { get; set; } = DateTime.Now; + + /// + /// Valore formato numerico (0 se non numerico) + /// + public double ValNum { get; set; } = 0; + + } +} diff --git a/MP.MONO.UI/Components/ParamPlot.razor.cs b/MP.MONO.UI/Components/ParamPlot.razor.cs index 88a99d2..ea9f347 100644 --- a/MP.MONO.UI/Components/ParamPlot.razor.cs +++ b/MP.MONO.UI/Components/ParamPlot.razor.cs @@ -2,6 +2,7 @@ using MP.MONO.Data; using MP.MONO.UI.Data; using MP.MONO.Data.DbModels; +using MP.MONO.Data.DTO; namespace MP.MONO.UI.Components { @@ -9,7 +10,7 @@ namespace MP.MONO.UI.Components { #region Private Fields - private List? ListRecords = null; + private List? ListRecords = null; #endregion Private Fields @@ -74,21 +75,18 @@ namespace MP.MONO.UI.Components get => _SelFilter; set { - if (!_SelFilter.Equals(value)) - { - _SelFilter = value; - var pUpd = Task.Run(async () => await ReloadData()); - pUpd.Wait(); - } + // if (!_SelFilter.Equals(value)) + // { + _SelFilter = value; + var pUpd = Task.Run(async () => await ReloadData()); + pUpd.Wait(); + //} } } - //[Parameter] - //public DateTime EndDate private DateTime EndDate { get => _SelFilter.DtEnd; - //set => _SelFilter.DtEnd = value; } [Parameter] @@ -106,12 +104,9 @@ namespace MP.MONO.UI.Components set => _selParam = value; } - //[Parameter] - //public DateTime StartDate private DateTime StartDate { get => _SelFilter.DtStart; - //set => _SelFilter.DtStart = value; } #endregion Public Properties @@ -153,7 +148,8 @@ namespace MP.MONO.UI.Components isLoading = true; ListRecords = null; await Task.Delay(1); - ListRecords = await MMDataService.DataLogGetFilt(MachineId, SelectedParam, StartDate, EndDate); + ListRecords = await MMDataService.DataLogDtoGetFilt(MachineId, SelectedParam, StartDate, EndDate); + await Task.Delay(1); // converto in plotdata LevelVal = ListRecords.Select(l => new chartJsData.chartJsTSerie() { x = l.DtRif, y = l.ValNum }).ToList(); await Task.Delay(1); diff --git a/MP.MONO.UI/Data/CurrentDataService.cs b/MP.MONO.UI/Data/CurrentDataService.cs index 763cde7..ab53f8d 100644 --- a/MP.MONO.UI/Data/CurrentDataService.cs +++ b/MP.MONO.UI/Data/CurrentDataService.cs @@ -202,20 +202,59 @@ namespace MP.MONO.UI.Data if (!string.IsNullOrEmpty(rawData)) { source = "REDIS"; - var redisRes = JsonConvert.DeserializeObject>(rawData); - dbResult = redisRes != null ? dbResult : new List(); + var tempResult = JsonConvert.DeserializeObject>(rawData); + if (tempResult == null) + { + dbResult = new List(); + } + else + { + dbResult = tempResult; + } } else { dbResult = dbController.DataLogGetFilt(machineId, fluxType, inizio, fine); - // salvo per 1 minuto... - rawData=JsonConvert.SerializeObject(dbResult); - // test!!! - await redisDb.StringSetAsync(currKey, rawData, TimeSpan.FromSeconds(60)); + // salvo per 2 min... + rawData = JsonConvert.SerializeObject(dbResult); + await redisDb.StringSetAsync(currKey, rawData, TimeSpan.FromSeconds(120)); } stopWatch.Stop(); TimeSpan ts = stopWatch.Elapsed; - Log.Info($"DataLogGetFilt | {machineId} | {fluxType} | {inizio:yyyyMMdd}-{fine:yyyyMMdd} | {source} | {ts.TotalMilliseconds} ms"); + Log.Info($"DataLogGetFilt | {machineId} | {fluxType} | {inizio:yyyyMMdd}-{fine:yyyyMMdd} | {source} | {ts.TotalMilliseconds} ms | {rawData.Length / 1024} kb"); + return dbResult; + } + public async Task> DataLogDtoGetFilt(int machineId, string fluxType, DateTime inizio, DateTime fine) + { + string source = "DB"; + List dbResult = new List(); + string currKey = $"{Constants.DATA_LOG_DTO_KEY}:{machineId}:{fluxType.Replace(" ", "_")}:{inizio:yyyyMMdd}:{fine:yyyyMMdd}"; + Stopwatch stopWatch = new Stopwatch(); + stopWatch.Start(); + string rawData = await redisDb.StringGetAsync(currKey); + if (!string.IsNullOrEmpty(rawData)) + { + source = "REDIS"; + var tempResult = JsonConvert.DeserializeObject>(rawData); + if (tempResult == null) + { + dbResult = new List(); + } + else + { + dbResult = tempResult; + } + } + else + { + dbResult = dbController.DataLogDtoGetFilt(machineId, fluxType, inizio, fine); + // salvo per 2 min... + rawData = JsonConvert.SerializeObject(dbResult); + await redisDb.StringSetAsync(currKey, rawData, TimeSpan.FromSeconds(120)); + } + stopWatch.Stop(); + TimeSpan ts = stopWatch.Elapsed; + Log.Info($"DataLogDtoGetFilt | {machineId} | {fluxType} | {inizio:yyyyMMdd}-{fine:yyyyMMdd} | {source} | {ts.TotalMilliseconds} ms | {rawData.Length / 1024} kb"); return dbResult; } diff --git a/MP.MONO.UI/Data/DataFilter.cs b/MP.MONO.UI/Data/DataFilter.cs index dae75cb..d8039d2 100644 --- a/MP.MONO.UI/Data/DataFilter.cs +++ b/MP.MONO.UI/Data/DataFilter.cs @@ -3,8 +3,8 @@ public class DataLogFilter { - public DateTime DtStart { get; set; } = DateTime.Today; - public DateTime DtEnd { get; set; } = DateTime.Today; + public DateTime DtStart { get; set; } = DateTime.Today.AddDays(-1); + public DateTime DtEnd { get; set; } = DateTime.Today.AddDays(1); public override bool Equals(object obj) { From d470f435d32aeba4eca10e9fb15a890e037a2007 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 23 Sep 2022 18:29:02 +0200 Subject: [PATCH 16/16] Fix comportamento reload: - valutare implementazione OnParametersSetAsync() globale - testare comportamento altri componenti --- MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj | 2 +- MP.MONO.ANALYZER/Resources/ChangeLog.html | 2 +- MP.MONO.ANALYZER/Resources/VersNum.txt | 2 +- MP.MONO.ANALYZER/Resources/manifest.xml | 2 +- MP.MONO.DECODER/MP.MONO.DECODER.csproj | 2 +- MP.MONO.DECODER/Resources/ChangeLog.html | 2 +- MP.MONO.DECODER/Resources/VersNum.txt | 2 +- MP.MONO.DECODER/Resources/manifest.xml | 2 +- MP.MONO.SIM/MP.MONO.SIM.csproj | 2 +- MP.MONO.SIM/Resources/ChangeLog.html | 2 +- MP.MONO.SIM/Resources/VersNum.txt | 2 +- MP.MONO.SIM/Resources/manifest.xml | 2 +- MP.MONO.UI/Components/ParamPlot.razor | 3 +- MP.MONO.UI/Components/ParamPlot.razor.cs | 116 ++++++++++------------ MP.MONO.UI/Conf/lic.file | 2 +- MP.MONO.UI/MP.MONO.UI.csproj | 2 +- MP.MONO.UI/Resources/ChangeLog.html | 2 +- MP.MONO.UI/Resources/VersNum.txt | 2 +- MP.MONO.UI/Resources/manifest.xml | 2 +- MP.MONO.UI/temp/InfoData.json | 66 ++++++------ 20 files changed, 106 insertions(+), 113 deletions(-) diff --git a/MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj b/MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj index 1952755..a95a8a4 100644 --- a/MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj +++ b/MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj @@ -6,7 +6,7 @@ enable enable AnyCPU;x86;x64 - 1.2.2209.2317 + 1.2.2209.2318 diff --git a/MP.MONO.ANALYZER/Resources/ChangeLog.html b/MP.MONO.ANALYZER/Resources/ChangeLog.html index 8974d39..39c315b 100644 --- a/MP.MONO.ANALYZER/Resources/ChangeLog.html +++ b/MP.MONO.ANALYZER/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

    Version: 1.2.2209.2317

    +

    Version: 1.2.2209.2318


    Release Note:
    • diff --git a/MP.MONO.ANALYZER/Resources/VersNum.txt b/MP.MONO.ANALYZER/Resources/VersNum.txt index 3d3fa4b..f67a0bd 100644 --- a/MP.MONO.ANALYZER/Resources/VersNum.txt +++ b/MP.MONO.ANALYZER/Resources/VersNum.txt @@ -1 +1 @@ -1.2.2209.2317 +1.2.2209.2318 diff --git a/MP.MONO.ANALYZER/Resources/manifest.xml b/MP.MONO.ANALYZER/Resources/manifest.xml index 26a14a8..a460ba7 100644 --- a/MP.MONO.ANALYZER/Resources/manifest.xml +++ b/MP.MONO.ANALYZER/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.2.2209.2317 + 1.2.2209.2318 http://nexus.steamware.net/repository/SWS/MP.MONO.ANALYZER/stable/LAST/MP.Mon.zip http://nexus.steamware.net/repository/SWS/MP.MONO.ANALYZER/stable/LAST/ChangeLog.html false diff --git a/MP.MONO.DECODER/MP.MONO.DECODER.csproj b/MP.MONO.DECODER/MP.MONO.DECODER.csproj index 3e1fb07..f4d9ecc 100644 --- a/MP.MONO.DECODER/MP.MONO.DECODER.csproj +++ b/MP.MONO.DECODER/MP.MONO.DECODER.csproj @@ -6,7 +6,7 @@ enable enable AnyCPU;x86;x64 - 1.2.2209.2317 + 1.2.2209.2318 diff --git a/MP.MONO.DECODER/Resources/ChangeLog.html b/MP.MONO.DECODER/Resources/ChangeLog.html index 8974d39..39c315b 100644 --- a/MP.MONO.DECODER/Resources/ChangeLog.html +++ b/MP.MONO.DECODER/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

      Version: 1.2.2209.2317

      +

      Version: 1.2.2209.2318


      Release Note:
      • diff --git a/MP.MONO.DECODER/Resources/VersNum.txt b/MP.MONO.DECODER/Resources/VersNum.txt index 3d3fa4b..f67a0bd 100644 --- a/MP.MONO.DECODER/Resources/VersNum.txt +++ b/MP.MONO.DECODER/Resources/VersNum.txt @@ -1 +1 @@ -1.2.2209.2317 +1.2.2209.2318 diff --git a/MP.MONO.DECODER/Resources/manifest.xml b/MP.MONO.DECODER/Resources/manifest.xml index 872753a..6329a57 100644 --- a/MP.MONO.DECODER/Resources/manifest.xml +++ b/MP.MONO.DECODER/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.2.2209.2317 + 1.2.2209.2318 http://nexus.steamware.net/repository/SWS/MP.MONO.DECODER/stable/LAST/MP.Mon.zip http://nexus.steamware.net/repository/SWS/MP.MONO.DECODER/stable/LAST/ChangeLog.html false diff --git a/MP.MONO.SIM/MP.MONO.SIM.csproj b/MP.MONO.SIM/MP.MONO.SIM.csproj index 3f1cf24..e9ac43b 100644 --- a/MP.MONO.SIM/MP.MONO.SIM.csproj +++ b/MP.MONO.SIM/MP.MONO.SIM.csproj @@ -6,7 +6,7 @@ enable enable AnyCPU;x86;x64 - 1.2.2209.2317 + 1.2.2209.2318 diff --git a/MP.MONO.SIM/Resources/ChangeLog.html b/MP.MONO.SIM/Resources/ChangeLog.html index 8974d39..39c315b 100644 --- a/MP.MONO.SIM/Resources/ChangeLog.html +++ b/MP.MONO.SIM/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

        Version: 1.2.2209.2317

        +

        Version: 1.2.2209.2318


        Release Note:
        • diff --git a/MP.MONO.SIM/Resources/VersNum.txt b/MP.MONO.SIM/Resources/VersNum.txt index 3d3fa4b..f67a0bd 100644 --- a/MP.MONO.SIM/Resources/VersNum.txt +++ b/MP.MONO.SIM/Resources/VersNum.txt @@ -1 +1 @@ -1.2.2209.2317 +1.2.2209.2318 diff --git a/MP.MONO.SIM/Resources/manifest.xml b/MP.MONO.SIM/Resources/manifest.xml index eb3e64d..821d25a 100644 --- a/MP.MONO.SIM/Resources/manifest.xml +++ b/MP.MONO.SIM/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.2.2209.2317 + 1.2.2209.2318 http://nexus.steamware.net/repository/SWS/MP.MONO.SIM/stable/LAST/MP.Mon.zip http://nexus.steamware.net/repository/SWS/MP.MONO.SIM/stable/LAST/ChangeLog.html false diff --git a/MP.MONO.UI/Components/ParamPlot.razor b/MP.MONO.UI/Components/ParamPlot.razor index 33538a7..158c475 100644 --- a/MP.MONO.UI/Components/ParamPlot.razor +++ b/MP.MONO.UI/Components/ParamPlot.razor @@ -16,7 +16,8 @@
          - @if (isLoading || LevelVal == null || LevelVal.Count == 0) + @if (isLoading) + @*@if (isLoading || LevelVal == null || LevelVal.Count == 0)*@ { } diff --git a/MP.MONO.UI/Components/ParamPlot.razor.cs b/MP.MONO.UI/Components/ParamPlot.razor.cs index ea9f347..aa3a28f 100644 --- a/MP.MONO.UI/Components/ParamPlot.razor.cs +++ b/MP.MONO.UI/Components/ParamPlot.razor.cs @@ -1,40 +1,52 @@ using Microsoft.AspNetCore.Components; using MP.MONO.Data; -using MP.MONO.UI.Data; -using MP.MONO.Data.DbModels; using MP.MONO.Data.DTO; +using MP.MONO.UI.Data; namespace MP.MONO.UI.Components { public partial class ParamPlot { - #region Private Fields + #region Public Properties - private List? ListRecords = null; + [Parameter] + public int MachineId { get; set; } = 1; - #endregion Private Fields + public string ParamId + { + get => _selParam.Replace(" ", "_"); + } + + [Parameter] + public string SelectedParam + { + get => _selParam; + set => _selParam = value; + } + + [Parameter] + public DataLogFilter SelFilter + { + get => _SelFilter; + set { _SelFilter = value; } + } + + #endregion Public Properties #region Protected Fields protected DateTime lastRec = DateTime.Now.AddMinutes(-1); - protected List LevelVal = new List(); protected Dictionary listMaxVal = new Dictionary(); protected Dictionary listMinVal = new Dictionary(); #endregion Protected Fields - #region Private Properties - - private bool isLoading { get; set; } = false; - - #endregion Private Properties - #region Protected Properties + protected DataLogFilter _SelFilter { get; set; } = new DataLogFilter(); protected string _selParam { get; set; } = ""; - protected string? MaxVal { get @@ -65,52 +77,6 @@ namespace MP.MONO.UI.Components #endregion Protected Properties - #region Public Properties - protected DataLogFilter _SelFilter { get; set; } = new DataLogFilter(); - - - [Parameter] - public DataLogFilter SelFilter - { - get => _SelFilter; - set - { - // if (!_SelFilter.Equals(value)) - // { - _SelFilter = value; - var pUpd = Task.Run(async () => await ReloadData()); - pUpd.Wait(); - //} - } - } - - private DateTime EndDate - { - get => _SelFilter.DtEnd; - } - - [Parameter] - public int MachineId { get; set; } = 1; - - public string ParamId - { - get => _selParam.Replace(" ", "_"); - } - - [Parameter] - public string SelectedParam - { - get => _selParam; - set => _selParam = value; - } - - private DateTime StartDate - { - get => _SelFilter.DtStart; - } - - #endregion Public Properties - #region Protected Methods protected List getFillColors(string alpha) @@ -136,9 +102,13 @@ namespace MP.MONO.UI.Components protected override async Task OnInitializedAsync() { - //isLoading = true; - //ListRecords = null; - //await Task.Delay(1); + await ReloadData(); + await Task.Delay(1); + } + + protected override async Task OnParametersSetAsync() + { + isLoading = true; await ReloadData(); await Task.Delay(1); } @@ -157,5 +127,27 @@ namespace MP.MONO.UI.Components } #endregion Protected Methods + + #region Private Fields + + private List? ListRecords = null; + + #endregion Private Fields + + #region Private Properties + + private DateTime EndDate + { + get => _SelFilter.DtEnd; + } + + private bool isLoading { get; set; } = false; + + private DateTime StartDate + { + get => _SelFilter.DtStart; + } + + #endregion Private Properties } } \ No newline at end of file diff --git a/MP.MONO.UI/Conf/lic.file b/MP.MONO.UI/Conf/lic.file index 69f59a3..9540e9d 100644 --- a/MP.MONO.UI/Conf/lic.file +++ b/MP.MONO.UI/Conf/lic.file @@ -1 +1 @@ -467e4b24bc3fe9d237169aa274ae589b64f072fb1cd91f4d79aaee76c64afbfced7fb51536b62cf612dedfb304202a1e653778b7cc8c758f83bb058984460301 \ No newline at end of file +31e9cc1c2e8f30a1b4098cb157d712f11f3f2e60fb74169a354c3fa646d6d0e28518b4e3139f844b25824fbcc4340051fc507d22c1c2d2786d3786c777c31cc3 \ No newline at end of file diff --git a/MP.MONO.UI/MP.MONO.UI.csproj b/MP.MONO.UI/MP.MONO.UI.csproj index 5a03f3d..ea3aa75 100644 --- a/MP.MONO.UI/MP.MONO.UI.csproj +++ b/MP.MONO.UI/MP.MONO.UI.csproj @@ -5,7 +5,7 @@ enable enable AnyCPU;x86;x64 - 1.2.2209.2317 + 1.2.2209.2318 diff --git a/MP.MONO.UI/Resources/ChangeLog.html b/MP.MONO.UI/Resources/ChangeLog.html index 8974d39..39c315b 100644 --- a/MP.MONO.UI/Resources/ChangeLog.html +++ b/MP.MONO.UI/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

          Version: 1.2.2209.2317

          +

          Version: 1.2.2209.2318


          Release Note:
          • diff --git a/MP.MONO.UI/Resources/VersNum.txt b/MP.MONO.UI/Resources/VersNum.txt index 3d3fa4b..f67a0bd 100644 --- a/MP.MONO.UI/Resources/VersNum.txt +++ b/MP.MONO.UI/Resources/VersNum.txt @@ -1 +1 @@ -1.2.2209.2317 +1.2.2209.2318 diff --git a/MP.MONO.UI/Resources/manifest.xml b/MP.MONO.UI/Resources/manifest.xml index ef6d269..ccaedc1 100644 --- a/MP.MONO.UI/Resources/manifest.xml +++ b/MP.MONO.UI/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.2.2209.2317 + 1.2.2209.2318 http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/MP.Mon.zip http://nexus.steamware.net/repository/SWS/MP.MONO.UI/stable/LAST/ChangeLog.html false diff --git a/MP.MONO.UI/temp/InfoData.json b/MP.MONO.UI/temp/InfoData.json index 3249b8e..356169e 100644 --- a/MP.MONO.UI/temp/InfoData.json +++ b/MP.MONO.UI/temp/InfoData.json @@ -2,55 +2,55 @@ "AdapterType": "Ethernet 802.3", "AddressWidth": "64", "Architecture": "9", - "BiosVersion": "_ASUS_ - 1072009", - "BuildNumber": "19043", - "Caption": "Microsoft Windows 10 Pro", - "ConfiguredClockSpeed": "2400", + "BiosVersion": "ALASKA - 1072009", + "BuildNumber": "19044", + "Caption": "Microsoft Windows 10 Pro N", + "ConfiguredClockSpeed": "3600", "ConfiguredVoltage": "1200", "CpuVersion": "Modello 1, Stepping 0", - "CurrentClockSpeed": "2200", - "CurrentVoltage": "12", + "CurrentClockSpeed": "3501", + "CurrentVoltage": "11", "DataWidth": "64", - "Description": "AMD64 Family 23 Model 17 Stepping 0", - "DeviceLocator": "ChannelA-DIMM0", + "Description": "AMD64 Family 23 Model 113 Stepping 0", + "DeviceLocator": "DIMM 1", "ExtClock": "100", "Family": "107", - "FormFactor": "12", - "GUID": "{7F313732-DBA3-46E5-9FA7-BEF235B0682E}", - "L2CacheSize": "2048", - "L3CacheSize": "4096", + "FormFactor": "8", + "GUID": "{E76995C4-F180-406E-B9C3-E491C65A8FCF}", + "L2CacheSize": "8192", + "L3CacheSize": "65536", "Level": "23", - "LoadPercentage": "18", - "MACAddress": "4C:ED:FB:D9:78:83", - "Manufacturer": "American Megatrends Inc.", + "LoadPercentage": "14", + "MACAddress": "0C:9D:92:B8:FD:E8", + "Manufacturer": "American Megatrends International, LLC.", "MaxNumberOfProcesses": "4294967295", "MaxProcessMemorySize": "137438953344", "MaxVoltage": "1200", "MinVoltage": "1200", - "Name": "Realtek PCIe GbE Family Controller", - "NumberOfCores": "4", - "NumberOfLogicalProcessors": "8", + "Name": "ASUS XG-C100C 10G PCI-E Network Adapter", + "NumberOfCores": "16", + "NumberOfLogicalProcessors": "32", "OSArchitecture": "64 bit", - "PartNumber": "8ATF1G64HZ-2G3E1 ", + "PartNumber": "CMK64GX4M2D3600C18", "PhysicalAdapter": "True", - "ProcessorId": "178BFBFF00810F10", + "ProcessorId": "178BFBFF00870F10", "ProcessorType": "3", - "ProductName": "Realtek PCIe GbE Family Controller", - "ReleaseDate": "20190521000000.000000+000", - "Revision": "4352", + "ProductName": "ASUS XG-C100C 10G PCI-E Network Adapter", + "ReleaseDate": "20210521000000.000000+000", + "Revision": "28928", "Role": "CPU", - "SerialNumber": "00330-80951-85780-AA242", - "ServiceName": "rt640x64", - "SMBIOSBIOSVersion": "X505ZA.311", + "SerialNumber": "00332-00332-17209-AA940", + "ServiceName": "aqnic650", + "SMBIOSBIOSVersion": "F33", "SMBIOSMajorVersion": "3", "SMBIOSMemoryType": "26", - "SMBIOSMinorVersion": "1", - "SocketDesignation": "FP5", - "SoftwareElementID": "X505ZA.311", + "SMBIOSMinorVersion": "3", + "SocketDesignation": "AM4", + "SoftwareElementID": "F33", "SoftwareElementState": "3", - "Speed": "2400", + "Speed": "3600", "SystemBiosMajorVersion": "5", - "SystemBiosMinorVersion": "13", - "SystemName": "EGALW-NB-004", - "Version": "10.0.19043" + "SystemBiosMinorVersion": "17", + "SystemName": "WRKST-R9-SAM", + "Version": "10.0.19044" } \ No newline at end of file
    MacchinaDurataAlarm DescriptionAlarm Event CountEvent Frequence
    -
    @record.MachineId
    -
    @record.EventCount
    +
    @record.AlarmDescription
    +
    +
    @record.EventCount
    +
    +
    + @if (totalEvents != 0) + { + @($"{(double)record.EventCount / totalEvents:P2}") + } +
    +
    +
    +
    Alarm Description Alarm Event Count Event FrequenceEvent Frequence Chart
    -
    +
    -
    +