From fc36b427c4d8201995f31fe636c8ecf4e65a2191 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Tue, 21 Jun 2022 14:15:01 +0200 Subject: [PATCH] Update x conflitto allarmi SIM/ADAPTER - fix alalrmi vuoti - fix abilitazione SIM se no allarmi da simulare - fix conf redis allarmi --- MP.MONO.ADAPTER.OPC/IobOpcUa.cs | 19 ++-------- 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/Program.cs | 8 ++--- 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 | 5 ++- MP.MONO.SIM/Program.cs | 9 +---- MP.MONO.SIM/Resources/ChangeLog.html | 2 +- MP.MONO.SIM/Resources/VersNum.txt | 2 +- MP.MONO.SIM/Resources/manifest.xml | 2 +- MP.MONO.SIM/conf/AlarmRawList.json | 42 ---------------------- MP.MONO.SIM/conf/SimAlarmRawList.json | 44 +++++++++++++++++++++++ MP.MONO.UI/Data/CurrentDataService.cs | 26 +------------- 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 +- 22 files changed, 69 insertions(+), 114 deletions(-) create mode 100644 MP.MONO.SIM/conf/SimAlarmRawList.json diff --git a/MP.MONO.ADAPTER.OPC/IobOpcUa.cs b/MP.MONO.ADAPTER.OPC/IobOpcUa.cs index 6c92445..fa2baec 100644 --- a/MP.MONO.ADAPTER.OPC/IobOpcUa.cs +++ b/MP.MONO.ADAPTER.OPC/IobOpcUa.cs @@ -439,22 +439,6 @@ namespace MP.MONO.ADAPTER.OPC { // prendo il valore bonificato dei caratteri che vogliamo ignorare currVal = stringCleanup($"{e.CurrNotify.Value}"); -#if false - // se è abilitato filt/split... - if (!string.IsNullOrEmpty(FiltSplitChar)) - { - var dataArray = rawVar.Split(FiltSplitChar); - if (dataArray.Length > 0) - { - currVal = dataArray[0]; - } - } - if (string.IsNullOrEmpty(currVal)) - { - currVal = rawVar; - //currVal = $"{e.CurrNotify.Value}"; - } -#endif checkAndSend(e.CurrMonitoredItem, currVal, false); } // aggiorno ultima lettura @@ -816,7 +800,8 @@ namespace MP.MONO.ADAPTER.OPC // salvo in redis! redisDb.StringSet(Constants.ALARMS_ADAP_CONF_KEY, JsonConvert.SerializeObject(AlarmsStatus)); // genero elenco allarmi attivi - List adpActiveAlarm = AlarmsStatus.Select(x => x.Value).OrderBy(x => x).ToList(); + List adpActiveAlarm = AlarmsStatus.Select(x => x.Value).Where(x => !string.IsNullOrEmpty(x)).OrderBy(x => x).ToList(); + var payloadAlarms = JsonConvert.SerializeObject(adpActiveAlarm); // invio saveAndSendMessage(Constants.ALARM_ACT_KEY, Constants.ALARM_ACT_QUEUE, payloadAlarms); diff --git a/MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj b/MP.MONO.ANALYZER/MP.MONO.ANALYZER.csproj index 6b646ba..02622d5 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.2111 + 1.12206.2114 diff --git a/MP.MONO.ANALYZER/Resources/ChangeLog.html b/MP.MONO.ANALYZER/Resources/ChangeLog.html index f8379ee..0b5591f 100644 --- a/MP.MONO.ANALYZER/Resources/ChangeLog.html +++ b/MP.MONO.ANALYZER/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

Version: 1.12206.2111

+

Version: 1.12206.2114


Release Note:
  • diff --git a/MP.MONO.ANALYZER/Resources/VersNum.txt b/MP.MONO.ANALYZER/Resources/VersNum.txt index 964c0e8..37f1157 100644 --- a/MP.MONO.ANALYZER/Resources/VersNum.txt +++ b/MP.MONO.ANALYZER/Resources/VersNum.txt @@ -1 +1 @@ -1.12206.2111 +1.12206.2114 diff --git a/MP.MONO.ANALYZER/Resources/manifest.xml b/MP.MONO.ANALYZER/Resources/manifest.xml index 1792e63..8a56c83 100644 --- a/MP.MONO.ANALYZER/Resources/manifest.xml +++ b/MP.MONO.ANALYZER/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.12206.2111 + 1.12206.2114 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 a1410db..3212077 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.2111 + 1.12206.2114 diff --git a/MP.MONO.DECODER/Program.cs b/MP.MONO.DECODER/Program.cs index 32f0c0f..0e21604 100644 --- a/MP.MONO.DECODER/Program.cs +++ b/MP.MONO.DECODER/Program.cs @@ -135,7 +135,7 @@ void setupConf() rawData = redisDb.StringGet(Constants.ALARMS_MODE_KEY); alarmMode = JsonConvert.DeserializeObject(rawData); // elenco allarmi già registrati (cache DB) - rawData = redisDb.StringGet(Constants.ALARMS_CONF_RLIST_KEY); + rawData = redisDb.StringGet(Constants.ALARMS_SETT_RLIST_KEY); if (!string.IsNullOrEmpty(rawData)) { alarmsRecorded = JsonConvert.DeserializeObject>(rawData); @@ -177,17 +177,13 @@ void AlarmsValPipe_EA_NewMessage(object? sender, EventArgs e) List? mutedAlarmsList = new List(); string rawData = redisDb.StringGet(Constants.ALARMS_SETT_RLIST_KEY); - if (string.IsNullOrEmpty(rawData)) - { - rawData = redisDb.StringGet(Constants.ALARMS_CONF_RLIST_KEY); - } if (!string.IsNullOrEmpty(rawData)) { mutedAlarmsList = JsonConvert.DeserializeObject>(rawData); } if (mutedAlarmsList == null) { - mutedAlarmsList = new List(); + mutedAlarmsList = dbController.AlarmListGetAll(); } // rileggo da REDIS la conf attuale allarmi già attivi da area ALARM_CURR_KEY diff --git a/MP.MONO.DECODER/Resources/ChangeLog.html b/MP.MONO.DECODER/Resources/ChangeLog.html index f8379ee..0b5591f 100644 --- a/MP.MONO.DECODER/Resources/ChangeLog.html +++ b/MP.MONO.DECODER/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

    Version: 1.12206.2111

    +

    Version: 1.12206.2114


    Release Note:
    • diff --git a/MP.MONO.DECODER/Resources/VersNum.txt b/MP.MONO.DECODER/Resources/VersNum.txt index 964c0e8..37f1157 100644 --- a/MP.MONO.DECODER/Resources/VersNum.txt +++ b/MP.MONO.DECODER/Resources/VersNum.txt @@ -1 +1 @@ -1.12206.2111 +1.12206.2114 diff --git a/MP.MONO.DECODER/Resources/manifest.xml b/MP.MONO.DECODER/Resources/manifest.xml index af14fba..7d12f90 100644 --- a/MP.MONO.DECODER/Resources/manifest.xml +++ b/MP.MONO.DECODER/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.12206.2111 + 1.12206.2114 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 71157fe..36702d3 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.2111 + 1.12206.2114 @@ -45,6 +45,9 @@ + + Always + Always diff --git a/MP.MONO.SIM/Program.cs b/MP.MONO.SIM/Program.cs index 293ecc7..17e3434 100644 --- a/MP.MONO.SIM/Program.cs +++ b/MP.MONO.SIM/Program.cs @@ -233,7 +233,7 @@ void simAlarms() if (alarmMode == AlarmReportingMode.RawList) { // controllo se devo fare (se ho valori da simulare...) - if (alarmsRawConf.Count > 0) + if (alarmsRawConf.Count > 0 && alarmsRawConf[0].messages.Count > 0) { DateTime lastOk = DateTime.Now; // Dict allarmi attivi (e da quando) @@ -332,13 +332,6 @@ void simParameters() { do { -#if false - // da eliminare quando gestita da decoder - var newParams = currSimGen.getParameters(); - string rawData = JsonConvert.SerializeObject(newParams); - saveAndSendMessage(Constants.PARAMS_CURR_KEY, Constants.PARAMS_M_QUEUE, rawData); -#endif - // gestione SIM dictionary var paramDict = currSimGen.getParamsVal(); string rawData = JsonConvert.SerializeObject(paramDict); diff --git a/MP.MONO.SIM/Resources/ChangeLog.html b/MP.MONO.SIM/Resources/ChangeLog.html index f8379ee..0b5591f 100644 --- a/MP.MONO.SIM/Resources/ChangeLog.html +++ b/MP.MONO.SIM/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

      Version: 1.12206.2111

      +

      Version: 1.12206.2114


      Release Note:
      • diff --git a/MP.MONO.SIM/Resources/VersNum.txt b/MP.MONO.SIM/Resources/VersNum.txt index 964c0e8..37f1157 100644 --- a/MP.MONO.SIM/Resources/VersNum.txt +++ b/MP.MONO.SIM/Resources/VersNum.txt @@ -1 +1 @@ -1.12206.2111 +1.12206.2114 diff --git a/MP.MONO.SIM/Resources/manifest.xml b/MP.MONO.SIM/Resources/manifest.xml index 8c414a2..715ffad 100644 --- a/MP.MONO.SIM/Resources/manifest.xml +++ b/MP.MONO.SIM/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.12206.2111 + 1.12206.2114 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/conf/AlarmRawList.json b/MP.MONO.SIM/conf/AlarmRawList.json index 0e94fe5..32960f8 100644 --- a/MP.MONO.SIM/conf/AlarmRawList.json +++ b/MP.MONO.SIM/conf/AlarmRawList.json @@ -1,44 +1,2 @@ [ - { - "source": "NC Alarm", - "messages": [ - "NC Alarm 001", - "NC Alarm 002", - "NC Alarm 003", - "NC Alarm 004", - "NC Alarm 005", - "NC Alarm 006", - "NC Alarm 007", - "NC Alarm 008", - "NC Alarm 009", - "NC Alarm 010", - "NC Alarm 011", - "NC Alarm 012", - "NC Alarm 013", - "NC Alarm 014", - "NC Alarm 015", - "NC Alarm 016" - ] - }, - { - "source": "PLC Alarm", - "messages": [ - "PLC Warning 001", - "PLC Warning 002", - "PLC Warning 003", - "PLC Warning 004", - "PLC Warning 005", - "PLC Warning 006", - "PLC Warning 007", - "PLC Warning 008", - "PLC Warning 009", - "PLC Warning 010", - "PLC Warning 011", - "PLC Warning 012", - "PLC Warning 013", - "PLC Warning 014", - "PLC Warning 015", - "PLC Warning 016" - ] - } ] \ No newline at end of file diff --git a/MP.MONO.SIM/conf/SimAlarmRawList.json b/MP.MONO.SIM/conf/SimAlarmRawList.json new file mode 100644 index 0000000..0e94fe5 --- /dev/null +++ b/MP.MONO.SIM/conf/SimAlarmRawList.json @@ -0,0 +1,44 @@ +[ + { + "source": "NC Alarm", + "messages": [ + "NC Alarm 001", + "NC Alarm 002", + "NC Alarm 003", + "NC Alarm 004", + "NC Alarm 005", + "NC Alarm 006", + "NC Alarm 007", + "NC Alarm 008", + "NC Alarm 009", + "NC Alarm 010", + "NC Alarm 011", + "NC Alarm 012", + "NC Alarm 013", + "NC Alarm 014", + "NC Alarm 015", + "NC Alarm 016" + ] + }, + { + "source": "PLC Alarm", + "messages": [ + "PLC Warning 001", + "PLC Warning 002", + "PLC Warning 003", + "PLC Warning 004", + "PLC Warning 005", + "PLC Warning 006", + "PLC Warning 007", + "PLC Warning 008", + "PLC Warning 009", + "PLC Warning 010", + "PLC Warning 011", + "PLC Warning 012", + "PLC Warning 013", + "PLC Warning 014", + "PLC Warning 015", + "PLC Warning 016" + ] + } +] \ No newline at end of file diff --git a/MP.MONO.UI/Data/CurrentDataService.cs b/MP.MONO.UI/Data/CurrentDataService.cs index 0fd7e69..99cc8fa 100644 --- a/MP.MONO.UI/Data/CurrentDataService.cs +++ b/MP.MONO.UI/Data/CurrentDataService.cs @@ -241,25 +241,6 @@ namespace MP.MONO.UI.Data return await Task.FromResult(redResult); } - /// - /// Conf allarmi corrente (area settings) - /// - /// - public async Task> getAlarmRLSettings() - { - List? redResult = new List(); - string rawData = await redisDb.StringGetAsync(Constants.ALARMS_SETT_RLIST_KEY); - if (!string.IsNullOrEmpty(rawData)) - { - redResult = JsonConvert.DeserializeObject>(rawData); - } - if (redResult == null) - { - redResult = await getAlarmRLConfig(); - } - return await Task.FromResult(redResult); - } - public async Task> getAlarms() { List? dbResult = new List(); @@ -343,11 +324,6 @@ namespace MP.MONO.UI.Data { List mutedList = new List(); string rawData = await redisDb.StringGetAsync(Constants.ALARMS_SETT_RLIST_KEY); - //se non avessi trovato valori cerco quelli di setup... - if (string.IsNullOrEmpty(rawData)) - { - rawData = await redisDb.StringGetAsync(Constants.ALARMS_CONF_RLIST_KEY); - } // ora provo a deserializzare if (!string.IsNullOrEmpty(rawData)) { @@ -356,7 +332,7 @@ namespace MP.MONO.UI.Data // altrimenti imposto vuoto if (mutedList == null) { - mutedList = new List(); + mutedList = dbController.AlarmListGetAll(); } return await Task.FromResult(mutedList); } diff --git a/MP.MONO.UI/MP.MONO.UI.csproj b/MP.MONO.UI/MP.MONO.UI.csproj index 023bf58..949b245 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.2111 + 1.12206.2114 diff --git a/MP.MONO.UI/Resources/ChangeLog.html b/MP.MONO.UI/Resources/ChangeLog.html index f8379ee..0b5591f 100644 --- a/MP.MONO.UI/Resources/ChangeLog.html +++ b/MP.MONO.UI/Resources/ChangeLog.html @@ -1,6 +1,6 @@ MAPO-MONO -

        Version: 1.12206.2111

        +

        Version: 1.12206.2114


        Release Note:
        • diff --git a/MP.MONO.UI/Resources/VersNum.txt b/MP.MONO.UI/Resources/VersNum.txt index 964c0e8..37f1157 100644 --- a/MP.MONO.UI/Resources/VersNum.txt +++ b/MP.MONO.UI/Resources/VersNum.txt @@ -1 +1 @@ -1.12206.2111 +1.12206.2114 diff --git a/MP.MONO.UI/Resources/manifest.xml b/MP.MONO.UI/Resources/manifest.xml index a8c30d5..6269838 100644 --- a/MP.MONO.UI/Resources/manifest.xml +++ b/MP.MONO.UI/Resources/manifest.xml @@ -1,6 +1,6 @@ - 1.12206.2111 + 1.12206.2114 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