From 25b4d111a82c3f21023bd0b5b78cbabbf82d6444 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Thu, 6 Apr 2017 13:55:12 +0200 Subject: [PATCH] =?UTF-8?q?sistemata=20mappa=20byte=20con=20nuovi=20valori?= =?UTF-8?q?=20x=20IOT=5FVAC=5F01..04=20+=20fix=20modalit=C3=A0=20calcolo?= =?UTF-8?q?=20area=20memoria=20(non=20da=20bitNum=20ma=20da=20numero=20val?= =?UTF-8?q?ore=20variabile)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MTC_Adapter/MTC_Adapter/AdapterESA.cs | 19 ++++++++++++++----- .../Resources/SCM/IOT_ByteList.map | 8 ++++---- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/MTC_Adapter/MTC_Adapter/AdapterESA.cs b/MTC_Adapter/MTC_Adapter/AdapterESA.cs index af08d19..3b5f864 100644 --- a/MTC_Adapter/MTC_Adapter/AdapterESA.cs +++ b/MTC_Adapter/MTC_Adapter/AdapterESA.cs @@ -498,12 +498,21 @@ namespace MTC_Adapter } else if (mapIOT_Byte[i].varName.StartsWith("IOT_EXEC_A_")) { - // salvo SOLO SE ha bit = 1.. - if (((StFlag8)currByte).HasFlag((StFlag8)Math.Pow(2, bitNum))) + // recupero NUMERO + try { - // salvo area selezionata! - progAreaSel = bitNum + 1; - currProgName = vettMemArea[bitNum].mMemAreaProgName.Value.ToString(); + numero = Convert.ToInt32(mapIOT_Byte[i].varName.Replace("IOT_VAC_", "")); + // salvo SOLO SE ha bit = 1.. + if (((StFlag8)currByte).HasFlag((StFlag8)Math.Pow(2, bitNum))) + { + // salvo area selezionata! + progAreaSel = numero; + currProgName = vettMemArea[numero - 1].mMemAreaProgName.Value.ToString(); + } + } + catch (Exception exc) + { + lg.Error(exc, "Errore in decodifica " + mapIOT_Byte[i].varName); } } else if (mapIOT_Byte[i].varName.StartsWith("IOT_VAC_")) diff --git a/MTC_Adapter/MTC_Adapter/Resources/SCM/IOT_ByteList.map b/MTC_Adapter/MTC_Adapter/Resources/SCM/IOT_ByteList.map index c8e3ad5..9f804bd 100644 --- a/MTC_Adapter/MTC_Adapter/Resources/SCM/IOT_ByteList.map +++ b/MTC_Adapter/MTC_Adapter/Resources/SCM/IOT_ByteList.map @@ -11,10 +11,10 @@ 1.1|IOT_EXEC_A_02 |BOOL 1.2|IOT_EXEC_A_03 |BOOL 1.3|IOT_EXEC_A_04 |BOOL -1.4|libero |BOOL -1.5|libero |BOOL -1.6|libero |BOOL -1.7|libero |BOOL +1.4|IOT_VAC_01 |BOOL +1.5|IOT_VAC_02 |BOOL +1.6|IOT_VAC_03 |BOOL +1.7|IOT_VAC_04 |BOOL 002|libero |BYTE 003|IOT_MODECN |BYTE 004|IOT_OVRF |BYTE