From f1f0223e9dad135a1d126106fdeef8e031ecf761 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Thu, 27 Feb 2020 11:35:12 +0100 Subject: [PATCH 1/2] Sistemato init WPS (ora va correttamente...) --- IOB-WIN/DATA/CONF/WPS.ini | 3 ++- IOB-WIN/IobWPS.cs | 52 +++++++++++++++++++++++---------------- 2 files changed, 33 insertions(+), 22 deletions(-) diff --git a/IOB-WIN/DATA/CONF/WPS.ini b/IOB-WIN/DATA/CONF/WPS.ini index b80ac2f4..2a6470b9 100644 --- a/IOB-WIN/DATA/CONF/WPS.ini +++ b/IOB-WIN/DATA/CONF/WPS.ini @@ -14,7 +14,8 @@ IP=10.74.82.253 ;IP=10.82.74.1 [SERVER] -MPIP=http://192.168.1.7 +MPIP=http://10.74.82.218 +;MPIP=http://192.168.1.7 MPURL=/MP/IO CMDBASE=/IOB/input/ CMDFLOG=/IOB/flog/ diff --git a/IOB-WIN/IobWPS.cs b/IOB-WIN/IobWPS.cs index 582dad53..7fbb7539 100644 --- a/IOB-WIN/IobWPS.cs +++ b/IOB-WIN/IobWPS.cs @@ -61,7 +61,7 @@ namespace IOB_WIN public IobWPS(AdapterForm caller, IobConfiguration IOBConf) : base(caller, IOBConf) { lgInfo("INIT IobWPS"); - reloadAdapterConf(); + //reloadAdapterConf(); } /// /// Ricarica conf adapter... @@ -149,7 +149,9 @@ namespace IOB_WIN try { var t = TaskEx.Run(() => startDriver()); - //t.Wait(); + t.Wait(); + + lgInfo("Completato start driver"); // vecchia modalità sincrona //startDriver(); @@ -184,7 +186,7 @@ namespace IOB_WIN else { lgInfo("Starting FIREFOX Driver"); - // preparo opzione headless x CHROME + // preparo opzione headless x FIREFOX var o = new FirefoxOptions(); o.AddArgument("-headless"); o.SetPreference("app.update.auto", false); @@ -282,33 +284,41 @@ namespace IOB_WIN /// public override void readSemafori(ref newDisplayData currDispData) { - base.readSemafori(ref currDispData); // init a zero... B_input = 0; // ciclo! try { - string cKey = ""; - string cVal = ""; - // IPOTESI: un UNICO oggetto decodifica status - if (monitoredItems.Status.Count == 1) + // controllo SE il driver SIA attivo... + if (driver != null) { - var item = monitoredItems.Status[0]; - // cerco elemento indicato - element = driver.FindElement(By.Id(item.val)); - cKey = element.Text; - // verifico se mancasse il mapping... - if (!item.codeMapping.ContainsKey(cKey)) + string cKey = ""; + string cVal = ""; + // IPOTESI: un UNICO oggetto decodifica status + if (monitoredItems.Status.Count == 1) { - processUnknStatus(cKey); - } - else - { - // ora decodifico da variabile status a valore secondo impostazione "codeMapping" - cVal = item.codeMapping[cKey]; - B_input = int.Parse(cVal, System.Globalization.NumberStyles.HexNumber); + var item = monitoredItems.Status[0]; + // cerco elemento indicato + element = driver.FindElement(By.Id(item.val)); + cKey = element.Text; + // verifico se mancasse il mapping... + if (!item.codeMapping.ContainsKey(cKey)) + { + processUnknStatus(cKey); + } + else + { + // ora decodifico da variabile status a valore secondo impostazione "codeMapping" + cVal = item.codeMapping[cKey]; + B_input = int.Parse(cVal, System.Globalization.NumberStyles.HexNumber); + currDispData.semIn = Semaforo.SV; + } } } + else + { + lgError("Errore: driver non pronto (null)"); + } // riporto bitmap... reportRawInput(ref currDispData); } From 898cf22c4a2c62b93c9c50705a7bb069a762761a Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Thu, 27 Feb 2020 11:35:48 +0100 Subject: [PATCH 2/2] update vers numb x testing jetco --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 490efae6..0bce5d71 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,7 +9,7 @@ pipeline { steps { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=676']) { + withEnv(['NEXT_BUILD_NUMBER=677']) { // env.versionNumber = VersionNumber(versionNumberString : '3.0.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '3.0.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'MAPO-IOB-WIN'