From 16deba684f5fc48ced2e1cde76ddbc9625c7c2b6 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Sat, 15 Sep 2018 08:44:46 +0200 Subject: [PATCH] popolato tabelle elenco codici allarme --- MTC_Adapter/SCMA/AdapterCom/GatewaySOURS.cs | 31 ++++++++++++++------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/MTC_Adapter/SCMA/AdapterCom/GatewaySOURS.cs b/MTC_Adapter/SCMA/AdapterCom/GatewaySOURS.cs index 552145f..3b8cbd0 100644 --- a/MTC_Adapter/SCMA/AdapterCom/GatewaySOURS.cs +++ b/MTC_Adapter/SCMA/AdapterCom/GatewaySOURS.cs @@ -846,27 +846,38 @@ namespace SCMA.AdapterCom mAdapter.Start(); #endif + // var accessorie string hashKey = ""; string hashVal = ""; - + var list = new List>(); + string nLevel = ""; // Imposto CONF hashKey = confHash("VersAdp"); hashVal = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); setRSV(hashKey, hashVal); - //hashKey = confHash("CNC"); - //hashVal = "lettura AlarmListCNC.map"; - //setRSV(hashKey, hashVal); - hashKey = confHash("PLC"); - var list = new List>(); - //= new KeyValuePair(); + // allarmi CNC + hashKey = confHash("CNC"); + foreach (var item in elencoAllarmi) + { + // se è PLC aggiungo + if (item.gruppo == "CNC") + { + nLevel = item.livello == "FAULT" ? "900" : "500"; + list.Add(new KeyValuePair(item.codNum, nLevel + "|" + item.descrizione)); + } + } + redSaveHashList(hashKey, list); + // allarmi PLC + hashKey = confHash("PLC"); foreach (var item in elencoAllarmi) { // se è PLC aggiungo if (item.gruppo == "PLC") { - list.Add(new KeyValuePair(item.codNum, item.livello + "|" + item.descrizione)); + nLevel = item.livello == "FAULT" ? "900" : "500"; + list.Add(new KeyValuePair(item.codNum, nLevel + "|" + item.descrizione)); } - } + } redSaveHashList(hashKey, list); //hashKey = confHash("DataModel"); //hashVal = ""; @@ -884,7 +895,7 @@ namespace SCMA.AdapterCom foreach (var item in itemNodes) { hashKey = machineHash(item.Key); - hashVal = item.Value.cObject.ToString(); + hashVal = availStatus.UNAVAILABLE.ToString(); // item.Value.cObject.ToString(); setRSV(hashKey, hashVal); } }