From dc9ee2cc35c9884651184b5e955ea9477c8d237c Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Tue, 18 Sep 2018 18:11:49 +0200 Subject: [PATCH] =?UTF-8?q?fix=20modalit=C3=A0=20ciclo=20ricerca...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile | 2 +- MTC_Adapter/OPC-UA-REDIS/AdapterRed.cs | 65 ++++++++++++++------------ 2 files changed, 35 insertions(+), 32 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c712e34..7cd93e6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,7 +15,7 @@ pipeline { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=309']) { + withEnv(['NEXT_BUILD_NUMBER=311']) { // env.versionNumber = VersionNumber(versionNumberString : '2.0.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '2.0.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'SCMA' diff --git a/MTC_Adapter/OPC-UA-REDIS/AdapterRed.cs b/MTC_Adapter/OPC-UA-REDIS/AdapterRed.cs index c1214d8..ff4a3fd 100644 --- a/MTC_Adapter/OPC-UA-REDIS/AdapterRed.cs +++ b/MTC_Adapter/OPC-UA-REDIS/AdapterRed.cs @@ -330,45 +330,48 @@ namespace OPC_UA_REDIS else { bool trovato = false; - bool escludi = false; + bool keyExcluded = false; string txt2find = ""; // se NON HO un MATCH processo il replace e se trovo corrispondenza processo foreach (var item in nameRepRoles) { - // cerco se escluso o aggiunto... - escludi = item.Value.modo == subsMode.X; - // parto da non trovato - trovato = false; - txt2find = item.Key; - // B --> cerco inizio - if (item.Value.search == substSearch.B) + // SE NON trovato procedo... + if (!trovato) { - trovato = answ.StartsWith(txt2find); - } - // E --> cerco fine - else if (item.Value.search == substSearch.E) - { - trovato = answ.EndsWith(txt2find); - } - // I --> cerco IDENTICO - else if (item.Value.search == substSearch.I) - { - trovato = (answ == txt2find); - } - // C --> cerco OVUNQUE contenuto - else if (item.Value.search == substSearch.C) - { - trovato = answ.IndexOf(txt2find) >= 0; - } - // se trovato SOSTITUISCO... - if (trovato) - { - // effetuo sostituzione chiave/valore - answ = answ.Replace(txt2find, item.Value.tradz); + // cerco se escluso o aggiunto... + keyExcluded = item.Value.modo == subsMode.X; + // testo cercato + txt2find = item.Key; + // B --> cerco inizio + if (item.Value.search == substSearch.B) + { + trovato = answ.StartsWith(txt2find); + } + // E --> cerco fine + else if (item.Value.search == substSearch.E) + { + trovato = answ.EndsWith(txt2find); + } + // I --> cerco IDENTICO + else if (item.Value.search == substSearch.I) + { + trovato = (answ == txt2find); + } + // C --> cerco OVUNQUE contenuto + else if (item.Value.search == substSearch.C) + { + trovato = answ.IndexOf(txt2find) >= 0; + } + // se trovato SOSTITUISCO... + if (trovato) + { + // effetuo sostituzione chiave/valore + answ = answ.Replace(txt2find, item.Value.tradz); + } } } // se รจ escluso --> salvo in escluso e restituisco NONE - if (escludi) + if (keyExcluded) { answ = "NONE"; // salvo in dizionario