diff --git a/MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj b/MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj index 8dd4e5f..e92956b 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.12206.1919 + 1.12206.1920 diff --git a/MP.MONO.ANALYZER/Resources/ChangeLog.html b/MP.MONO.ANALYZER/Resources/ChangeLog.html index def8c6f..612f023 100644 --- a/MP.MONO.ANALYZER/Resources/ChangeLog.html +++ b/MP.MONO.ANALYZER/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO - Version: 1.12206.1919 + Version: 1.12206.1920 Release Note: diff --git a/MP.MONO.ANALYZER/Resources/VersNum.txt b/MP.MONO.ANALYZER/Resources/VersNum.txt index 53ad82b..d22000f 100644 --- a/MP.MONO.ANALYZER/Resources/VersNum.txt +++ b/MP.MONO.ANALYZER/Resources/VersNum.txt @@ -1 +1 @@ -1.12206.1919 +1.12206.1920 diff --git a/MP.MONO.ANALYZER/Resources/manifest.xml b/MP.MONO.ANALYZER/Resources/manifest.xml index 49e74fc..a4c904f 100644 --- a/MP.MONO.ANALYZER/Resources/manifest.xml +++ b/MP.MONO.ANALYZER/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.12206.1919 + 1.12206.1920 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 798f066..2e81fb6 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.12206.1919 + 1.12206.1920 diff --git a/MP.MONO.DECODER/Resources/ChangeLog.html b/MP.MONO.DECODER/Resources/ChangeLog.html index def8c6f..612f023 100644 --- a/MP.MONO.DECODER/Resources/ChangeLog.html +++ b/MP.MONO.DECODER/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO - Version: 1.12206.1919 + Version: 1.12206.1920 Release Note: diff --git a/MP.MONO.DECODER/Resources/VersNum.txt b/MP.MONO.DECODER/Resources/VersNum.txt index 53ad82b..d22000f 100644 --- a/MP.MONO.DECODER/Resources/VersNum.txt +++ b/MP.MONO.DECODER/Resources/VersNum.txt @@ -1 +1 @@ -1.12206.1919 +1.12206.1920 diff --git a/MP.MONO.DECODER/Resources/manifest.xml b/MP.MONO.DECODER/Resources/manifest.xml index 273a228..a0175fe 100644 --- a/MP.MONO.DECODER/Resources/manifest.xml +++ b/MP.MONO.DECODER/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.12206.1919 + 1.12206.1920 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 f6f3af0..e67c40f 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.12206.1919 + 1.12206.1920 diff --git a/MP.MONO.SIM/Resources/ChangeLog.html b/MP.MONO.SIM/Resources/ChangeLog.html index def8c6f..612f023 100644 --- a/MP.MONO.SIM/Resources/ChangeLog.html +++ b/MP.MONO.SIM/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO - Version: 1.12206.1919 + Version: 1.12206.1920 Release Note: diff --git a/MP.MONO.SIM/Resources/VersNum.txt b/MP.MONO.SIM/Resources/VersNum.txt index 53ad82b..d22000f 100644 --- a/MP.MONO.SIM/Resources/VersNum.txt +++ b/MP.MONO.SIM/Resources/VersNum.txt @@ -1 +1 @@ -1.12206.1919 +1.12206.1920 diff --git a/MP.MONO.SIM/Resources/manifest.xml b/MP.MONO.SIM/Resources/manifest.xml index 52052c8..82b53d8 100644 --- a/MP.MONO.SIM/Resources/manifest.xml +++ b/MP.MONO.SIM/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.12206.1919 + 1.12206.1920 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 5f1c1ae..399250c 100644 --- a/MP.MONO.SIM/appsettings.json +++ b/MP.MONO.SIM/appsettings.json @@ -33,8 +33,8 @@ }, "SimPar": { "AlarmMode": "RawList", - "PercAllarmi": 20, + "PercAllarmi": 10, "MaxAddAllarmi": 3, - "MaxDurationAllarmi": 15 + "MaxDurationAllarmi": 10 } } diff --git a/MP.MONO.UI/Components/AlarmsSetup.razor b/MP.MONO.UI/Components/AlarmsSetup.razor index 1e189fb..ff119d9 100644 --- a/MP.MONO.UI/Components/AlarmsSetup.razor +++ b/MP.MONO.UI/Components/AlarmsSetup.razor @@ -3,79 +3,14 @@ @using MP.MONO.Core.DTO @using MP.MONO.UI.Data -@inject IJSRuntime JSRuntime @inject CurrentDataService MMDataService - - - - - Alarm Messages Setup - - - resetAlarmSetup()" title="Reset Alarm Config"> - - - - - - - @if (ListRecords == null) - { - - } - else if (ListRecords.Count == 0) - { - No record found - } - else - { - Alarm Bank - - @foreach (var item in ListRecords) - { - raiseSelect(item)"> - @item.description - - } - - } - - - @if (AlarmMap == null) - { - Select Bank First - } - else - { - - - - @foreach (var item in AlarmMap.messagesMap) - { - toggleMute(item.Key)"> - @item.Value - - } - - - - click to mute/unmute alarms - - - - Alarm Enabled - Alarm Disabled - - - - } - - - - - - - - +@if (AlarmMode == Core.Enums.AlarmReportingMode.BankBit) +{ + +} +else +{ + +} diff --git a/MP.MONO.UI/Components/AlarmsSetup.razor.cs b/MP.MONO.UI/Components/AlarmsSetup.razor.cs index 69f4018..94e539a 100644 --- a/MP.MONO.UI/Components/AlarmsSetup.razor.cs +++ b/MP.MONO.UI/Components/AlarmsSetup.razor.cs @@ -1,98 +1,30 @@ using Microsoft.AspNetCore.Components; using Microsoft.JSInterop; +using MP.MONO.Core; using MP.MONO.Core.CONF; +using static MP.MONO.Core.Enums; namespace MP.MONO.UI.Components { public partial class AlarmsSetup { - #region Protected Fields - - - protected List? ListRecords = null; - - #endregion Protected Fields - - #region Protected Properties - - protected BaseAlarmBankConf? AlarmMap { get; set; } = null; - - #endregion Protected Properties #region Protected Methods - protected string cssActive(string memAddr) - { - string answ = ""; - if (AlarmMap != null) - { - answ = AlarmMap.memAddr.Equals(memAddr) ? "bg-dark text-light" : ""; - } - return answ; - } - protected string cssSilenced(int messIndex) - { - string answ = ""; - if (AlarmMap != null) - { - answ = AlarmMap.isSilenced(messIndex) ? "bg-secondary text-light" : "bg-primary text-light"; - } - return answ; - } - protected override async Task OnInitializedAsync() { await ReloadData(); } - protected async Task raiseSelect(BaseAlarmBankConf selBank) - { - AlarmMap = selBank; - await Task.Delay(1); - } + protected AlarmReportingMode AlarmMode { get; set; } = AlarmReportingMode.RawList; protected async Task ReloadData() { - ListRecords = null; await Task.Delay(1); - ListRecords = await MMDataService.getAlarmSetup(); + AlarmMode = await MMDataService.getAlarmMode(); await Task.Delay(1); } - protected async Task resetAlarmSetup() - - { - if (!await JSRuntime.InvokeAsync("confirm", "Reset Alarm Config: you are going to reset actual alarm configuration. Are you sure to proceed?")) - return; - await Task.Delay(1); - var baseConf = await MMDataService.getAlarmConfig(); - await MMDataService.setAlarmSetup(baseConf); - AlarmMap = null; - await ReloadData(); - } - - protected async Task toggleMute(int alarmIndex) - { - // base 1 --> base 0 - alarmIndex--; - int bank = alarmIndex / 16; - // calcolo inverso del valore richiesto - if (ListRecords != null && AlarmMap != null) - { - AlarmMap.silenceMask[bank] = AlarmMap.silenceMask[bank] ^ (uint)(1 << alarmIndex); - // sostituisco... - var currObj = ListRecords.FirstOrDefault(x => x.memAddr == AlarmMap.memAddr); - if (currObj != null) - { - currObj.silenceMask = AlarmMap.silenceMask; - // salvo su redis... - await MMDataService.setAlarmSetup(ListRecords); - } - } - await Task.Delay(1); - await ReloadData(); - await Task.Delay(1); - } #endregion Protected Methods } diff --git a/MP.MONO.UI/Components/AlarmsSetupBankBit.razor b/MP.MONO.UI/Components/AlarmsSetupBankBit.razor new file mode 100644 index 0000000..38c402d --- /dev/null +++ b/MP.MONO.UI/Components/AlarmsSetupBankBit.razor @@ -0,0 +1,82 @@ +@using MP.MONO.Data +@using MP.MONO.UI.Components +@using MP.MONO.Core.DTO +@using MP.MONO.UI.Data + +@inject IJSRuntime JSRuntime +@inject CurrentDataService MMDataService + + + + + + Alarm Messages Setup + (BB) + + + resetAlarmSetup()" title="Reset Alarm Config"> + + + + + + + @if (ListRecords == null) + { + + } + else if (ListRecords.Count == 0) + { + No record found + } + else + { + Alarm Bank + + @foreach (var item in ListRecords) + { + raiseSelect(item)"> + @item.description + + } + + } + + + @if (AlarmMap == null) + { + Select Bank First + } + else + { + + + + @foreach (var item in AlarmMap.messagesMap) + { + toggleMute(item.Key)"> + @item.Value + + } + + + + click to mute/unmute alarms + + + + Alarm Enabled + Alarm Disabled + + + + } + + + + + + + + + diff --git a/MP.MONO.UI/Components/AlarmsSetupBankBit.razor.cs b/MP.MONO.UI/Components/AlarmsSetupBankBit.razor.cs new file mode 100644 index 0000000..112bfa6 --- /dev/null +++ b/MP.MONO.UI/Components/AlarmsSetupBankBit.razor.cs @@ -0,0 +1,99 @@ +using Microsoft.AspNetCore.Components; +using Microsoft.JSInterop; +using MP.MONO.Core.CONF; + +namespace MP.MONO.UI.Components +{ + public partial class AlarmsSetupBankBit + { + #region Protected Fields + + + protected List? ListRecords = null; + + #endregion Protected Fields + + #region Protected Properties + + protected BaseAlarmBankConf? AlarmMap { get; set; } = null; + + #endregion Protected Properties + + #region Protected Methods + + protected string cssActive(string memAddr) + { + string answ = ""; + if (AlarmMap != null) + { + answ = AlarmMap.memAddr.Equals(memAddr) ? "bg-dark text-light" : ""; + } + return answ; + } + protected string cssSilenced(int messIndex) + { + string answ = ""; + if (AlarmMap != null) + { + answ = AlarmMap.isSilenced(messIndex) ? "bg-secondary text-light" : "bg-primary text-light"; + } + return answ; + } + + protected override async Task OnInitializedAsync() + { + await ReloadData(); + } + + protected async Task raiseSelect(BaseAlarmBankConf selBank) + { + AlarmMap = selBank; + await Task.Delay(1); + } + + protected async Task ReloadData() + { + ListRecords = null; + await Task.Delay(1); + ListRecords = await MMDataService.getAlarmSetup(); + await Task.Delay(1); + } + + protected async Task resetAlarmSetup() + + { + if (!await JSRuntime.InvokeAsync("confirm", "Reset Alarm Config: you are going to reset actual alarm configuration. Are you sure to proceed?")) + return; + await Task.Delay(1); + var baseConf = await MMDataService.getAlarmConfig(); + await MMDataService.setAlarmSetup(baseConf); + AlarmMap = null; + await ReloadData(); + } + + protected async Task toggleMute(int alarmIndex) + { + // base 1 --> base 0 + alarmIndex--; + int bank = alarmIndex / 16; + // calcolo inverso del valore richiesto + if (ListRecords != null && AlarmMap != null) + { + AlarmMap.silenceMask[bank] = AlarmMap.silenceMask[bank] ^ (uint)(1 << alarmIndex); + // sostituisco... + var currObj = ListRecords.FirstOrDefault(x => x.memAddr == AlarmMap.memAddr); + if (currObj != null) + { + currObj.silenceMask = AlarmMap.silenceMask; + // salvo su redis... + await MMDataService.setAlarmSetup(ListRecords); + } + } + await Task.Delay(1); + await ReloadData(); + await Task.Delay(1); + } + + #endregion Protected Methods + } +} \ No newline at end of file diff --git a/MP.MONO.UI/Components/AlarmsSetupRawList.razor b/MP.MONO.UI/Components/AlarmsSetupRawList.razor new file mode 100644 index 0000000..14ee807 --- /dev/null +++ b/MP.MONO.UI/Components/AlarmsSetupRawList.razor @@ -0,0 +1,3 @@ +AlarmsSetupRawList + + diff --git a/MP.MONO.UI/Components/AlarmsSetupRawList.razor.cs b/MP.MONO.UI/Components/AlarmsSetupRawList.razor.cs new file mode 100644 index 0000000..f7faa88 --- /dev/null +++ b/MP.MONO.UI/Components/AlarmsSetupRawList.razor.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Components; +using System.Net.Http; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Components.Authorization; +using Microsoft.AspNetCore.Components.Forms; +using Microsoft.AspNetCore.Components.Routing; +using Microsoft.AspNetCore.Components.Web; +using Microsoft.AspNetCore.Components.Web.Virtualization; +using Microsoft.JSInterop; +using MP.MONO.UI; +using MP.MONO.UI.Shared; +using MP.MONO.UI.Components; + +namespace MP.MONO.UI.Components +{ + public partial class AlarmsSetupRawList + { + } +} \ No newline at end of file diff --git a/MP.MONO.UI/Data/CurrentDataService.cs b/MP.MONO.UI/Data/CurrentDataService.cs index 44f9f23..712ce09 100644 --- a/MP.MONO.UI/Data/CurrentDataService.cs +++ b/MP.MONO.UI/Data/CurrentDataService.cs @@ -8,6 +8,7 @@ using Newtonsoft.Json; using NLog; using StackExchange.Redis; using System.Diagnostics; +using static MP.MONO.Core.Enums; namespace MP.MONO.UI.Data { @@ -173,17 +174,33 @@ namespace MP.MONO.UI.Data public async Task> getActLog() { - List? dbResult = new List(); + List? answ = new List(); string rawData = await redisDb.StringGetAsync(Constants.ACT_LOG_CURR_KEY); if (!string.IsNullOrEmpty(rawData)) { - dbResult = JsonConvert.DeserializeObject>(rawData); + answ = JsonConvert.DeserializeObject>(rawData); } - if (dbResult == null) + if (answ == null) { - dbResult = new List(); + answ = new List(); } - return await Task.FromResult(dbResult); + return await Task.FromResult(answ); + } + + + public async Task getAlarmMode() + { + AlarmReportingMode answ = AlarmReportingMode.ND; + string rawData = await redisDb.StringGetAsync(Constants.ALARMS_MODE_KEY); + if (!string.IsNullOrEmpty(rawData)) + { + answ = JsonConvert.DeserializeObject(rawData); + } + if (answ == AlarmReportingMode.ND) + { + answ = AlarmReportingMode.RawList; + } + return await Task.FromResult(answ); } /// diff --git a/MP.MONO.UI/MP.MONO.UI.csproj b/MP.MONO.UI/MP.MONO.UI.csproj index e6b23b5..f57a231 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.12206.1919 + 1.12206.1920 diff --git a/MP.MONO.UI/Resources/ChangeLog.html b/MP.MONO.UI/Resources/ChangeLog.html index def8c6f..612f023 100644 --- a/MP.MONO.UI/Resources/ChangeLog.html +++ b/MP.MONO.UI/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO - Version: 1.12206.1919 + Version: 1.12206.1920 Release Note: diff --git a/MP.MONO.UI/Resources/VersNum.txt b/MP.MONO.UI/Resources/VersNum.txt index 53ad82b..d22000f 100644 --- a/MP.MONO.UI/Resources/VersNum.txt +++ b/MP.MONO.UI/Resources/VersNum.txt @@ -1 +1 @@ -1.12206.1919 +1.12206.1920 diff --git a/MP.MONO.UI/Resources/manifest.xml b/MP.MONO.UI/Resources/manifest.xml index 833f528..0e9fe93 100644 --- a/MP.MONO.UI/Resources/manifest.xml +++ b/MP.MONO.UI/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.12206.1919 + 1.12206.1920 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