diff --git a/IOB-WIN/App.config b/IOB-WIN/App.config index eae52a4c..2e06110c 100644 --- a/IOB-WIN/App.config +++ b/IOB-WIN/App.config @@ -20,9 +20,9 @@ - - - + + + @@ -68,7 +68,6 @@ - diff --git a/IOB-WIN/IobFanuc.cs b/IOB-WIN/IobFanuc.cs index e86c921e..e225a07e 100644 --- a/IOB-WIN/IobFanuc.cs +++ b/IOB-WIN/IobFanuc.cs @@ -138,10 +138,16 @@ namespace IOB_WIN hasBigEndian = false; lg.Info("Start init Adapter FANUC all'IP {0}:{1} per IOB {2}", IOBConf.cncIpAddr, IOBConf.cncPort, IOBConf.codIOB); - - // !!!FARE!!! deve leggere da DB centrale ULTIMO valore CONTPEZZI al riavvio... se gestione con contapezzi STD... x ora leggo valore tmp da app.config - contapezzi = utils.CRI("tmpPzCount"); - + // legge da IO server ULTIMO valore CONTPEZZI al riavvio... + string currServerCount = utils.callUrl(urlGetPzCount); + if (currServerCount != "") + { + int.TryParse(currServerCount, out contapezzi); + } + else + { + contapezzi = 0; + } // Creo oggetto connessione NC parentForm.commPlcActive = true; @@ -462,6 +468,8 @@ namespace IOB_WIN { contapezzi = lastCount; } + // invio a server contapezzi (aggiornato) + utils.callUrl(urlSetPzCount + contapezzi.ToString()); } } else // area "normale" byte.bit diff --git a/IOB-WIN/IobGeneric.cs b/IOB-WIN/IobGeneric.cs index daac93c2..ca75e041 100644 --- a/IOB-WIN/IobGeneric.cs +++ b/IOB-WIN/IobGeneric.cs @@ -1043,6 +1043,44 @@ namespace IOB_WIN return answ; } } + /// + /// URL per salvataggio contapezzi... + /// + public string urlSetPzCount + { + get + { + string answ = ""; + try + { + answ = string.Format(@"{0}{1}{2}/setCounter/{3}?counter=", currIobConf.serverData.MPIP, currIobConf.serverData.MPURL, currIobConf.serverData.CMDALIVE, currIobConf.codIOB); + } + catch (Exception exc) + { + lg.Error(exc, "Errore in composizione urlSetPzCount"); + } + return answ; + } + } + /// + /// URL per recupero contapezzi... + /// + public string urlGetPzCount + { + get + { + string answ = ""; + try + { + answ = string.Format(@"{0}{1}{2}/getCounter/{3}", currIobConf.serverData.MPIP, currIobConf.serverData.MPURL, currIobConf.serverData.CMDALIVE, currIobConf.codIOB); + } + catch (Exception exc) + { + lg.Error(exc, "Errore in composizione urlGetPzCount"); + } + return answ; + } + } public string GetMACAddress() { NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces(); diff --git a/Jenkinsfile b/Jenkinsfile index a62bd1e0..1d54bd8e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -14,7 +14,7 @@ pipeline { /* calcolo numero versione... diverso x branch MASTER/DEVELOP */ script { - withEnv(['NEXT_BUILD_NUMBER=224']) { + withEnv(['NEXT_BUILD_NUMBER=225']) { // env.versionNumber = VersionNumber(versionNumberString : '1.17.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true) env.versionNumber = VersionNumber(versionNumberString : '1.17.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}') env.APP_NAME = 'MAPO-IOB-WIN'