diff --git a/IOB-WIN/IobMTC.cs b/IOB-WIN/IobMTC.cs
index 99b69dc9..3752a611 100644
--- a/IOB-WIN/IobMTC.cs
+++ b/IOB-WIN/IobMTC.cs
@@ -235,7 +235,7 @@ namespace IOB_WIN
MTC_ref = new MTConnectClient($"http://{cIobConf.cncIpAddr}:{port}");
// Subscribe to the Event handlers to receive the MTConnect documents
MTC_ref.ProbeReceived += DevicesSuccessful;
- MTC_ref.CurrentReceived += StreamsSuccessful;
+ MTC_ref.CurrentReceived += CurrentSuccessful;
MTC_ref.SampleReceived += StreamsSuccessful;
// attendo 1 sec...
@@ -624,8 +624,41 @@ namespace IOB_WIN
}
return answ;
}
-
+ ///
+ /// Effettuata discovery iniziale
+ ///
+ ///
+ ///
+ protected void CurrentSuccessful(MTConnectStreams.Document document)
+ {
+ if (document != null)
+ {
+ lgInfo($"DiscoverySuccessful: discovery per {document.Url}");
+ if (document.DeviceStreams != null)
+ {
+ lgInfo($"DiscoverySuccessful: trovati {document.DeviceStreams.Count} streams");
+ }
+ checkAndSend(document, true);
+ }
+ else
+ {
+ lgError("StreamsSuccessful ERROR: document è null");
+ }
+ }
+ ///
+ /// Ricevuta modifica come stream
+ ///
+ ///
protected void StreamsSuccessful(MTConnectStreams.Document document)
+ {
+ checkAndSend(document, false);
+ }
+ ///
+ /// Verifica ed invia variazioni
+ ///
+ ///
+ ///
+ private void checkAndSend(MTConnectStreams.Document document, bool forceSend)
{
if (document != null)
{
@@ -648,7 +681,7 @@ namespace IOB_WIN
var time2 = tStamp.ToLocalTime();
// verifico se salvare
bool changed = checkSaveItem(dataItem);
- if (changed)
+ if (changed || forceSend)
{
// accodare ed invia nella coda ALARMS (che POI salva in document MongoDB anche ultimi x minuti di FluxLog...)
accodaAlarmLog(sVal, qEncodeFLog(time2, descr, dataItem.CDATA));
@@ -656,8 +689,10 @@ namespace IOB_WIN
}
}
}
- catch
- { }
+ catch (Exception exc)
+ {
+ lgError($"Eccezione in decodifica Conditions x StreamSuccesfull{Environment.NewLine}{exc}");
+ }
// check su events
try
{
@@ -672,15 +707,17 @@ namespace IOB_WIN
var time2 = tStamp.ToLocalTime();
// verifico se salvare
bool changed = checkSaveItem(dataItem);
- if (changed)
+ if (changed || forceSend)
{
accodaFLog(sVal, qEncodeFLog(time2, descr, dataItem.CDATA));
//accodaFLog(sVal, qEncodeFLog(locTStamp, descr, dataItem.CDATA));
}
}
}
- catch
- { }
+ catch (Exception exc)
+ {
+ lgError($"Eccezione in decodifica Events x StreamSuccesfull{Environment.NewLine}{exc}");
+ }
// check su samples
try
@@ -696,7 +733,7 @@ namespace IOB_WIN
var time2 = tStamp.ToLocalTime();
// verifico se salvare
bool changed = checkSaveSample(dataItem);
- if (changed)
+ if (changed || forceSend)
{
accodaFLog(sVal, qEncodeFLog(time2, descr, dataItem.CDATA));
//accodaFLog(sVal, qEncodeFLog(locTStamp, descr, dataItem.CDATA));
@@ -705,16 +742,22 @@ namespace IOB_WIN
{
if (utils.CRB("verbose"))
{
- lgInfo($"NON ACCODATO sample poiché verifica variazioen ha dato esito negativo");
+ lgInfo($"NON ACCODATO sample poiché verifica variazione SAMPLE ha dato esito negativo");
}
}
}
}
- catch
- { }
+ catch (Exception exc)
+ {
+ lgError($"Eccezione in decodifica Samples x StreamSuccesfull{Environment.NewLine}{exc}");
+ }
}
}
+ else
+ {
+ lgError("StreamsSuccessful ERROR: document è null");
+ }
}
///
diff --git a/Jenkinsfile b/Jenkinsfile
index 1603ca05..89d4d617 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -16,7 +16,7 @@ pipeline {
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
script {
- withEnv(['NEXT_BUILD_NUMBER=570']) {
+ withEnv(['NEXT_BUILD_NUMBER=571']) {
// env.versionNumber = VersionNumber(versionNumberString : '2.6.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true)
env.versionNumber = VersionNumber(versionNumberString : '2.6.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2006-01-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
env.APP_NAME = 'MAPO-IOB-WIN'