diff --git a/IOB-WIN/DATA/CONF/IMI_50.ini b/IOB-WIN/DATA/CONF/IMI_50.ini
index 56521241..bb65e120 100644
--- a/IOB-WIN/DATA/CONF/IMI_50.ini
+++ b/IOB-WIN/DATA/CONF/IMI_50.ini
@@ -58,6 +58,7 @@ PZCOUNT_MODE=STD.DM20.2
DISABLE_PZCOUNT=TRUE
ENABLE_DYN_DATA=FALSE
FORCE_DYN_DATA=TRUE
+ENABLE_DATA_FILTER=FALSE
; conf parametri memoria READ/WRITE
PARAM_CONF=IMI_50.json
diff --git a/IOB-WIN/IobMTC.cs b/IOB-WIN/IobMTC.cs
index ed878c38..ba54a3f1 100644
--- a/IOB-WIN/IobMTC.cs
+++ b/IOB-WIN/IobMTC.cs
@@ -26,6 +26,10 @@ namespace IOB_WIN
///
protected MTConnectClient MTC_ref;
///
+ /// Gestione filtraggio dati
+ ///
+ protected bool enableDataFilter = false;
+ ///
/// URL x salvataggio elenco dataItems MTC
///
protected string urlSaveDataItems
@@ -56,6 +60,11 @@ namespace IOB_WIN
{
// gestione invio ritardato contapezzi
pzCountDelay = utils.CRI("pzCountDelay");
+ // gestione data filtering...
+ if (!string.IsNullOrEmpty(getOptPar("ENABLE_DATA_FILTER")))
+ {
+ bool.TryParse(getOptPar("ENABLE_DATA_FILTER"), out enableDataFilter);
+ }
lastPzCountSend = DateTime.Now;
lastWarnODL = DateTime.Now;
}
@@ -233,10 +242,18 @@ namespace IOB_WIN
break;
case MTConnect.DataItemCategory.SAMPLE:
uuid = $"S_{dataItem.Id}";
- threshDBand = 1;
- if (dataItem.Id.EndsWith("PosAct") || dataItem.Id.EndsWith("PosTgt"))
+ // SOLOS E è abilitato il datafiltering...
+ if (enableDataFilter)
{
- threshDBand = 5;
+ threshDBand = 1;
+ if (dataItem.Id.EndsWith("PosAct") || dataItem.Id.EndsWith("PosTgt"))
+ {
+ threshDBand = 5;
+ }
+ }
+ else
+ {
+ threshDBand = 0;
}
dSamplePeriod = 60;
break;
@@ -321,9 +338,14 @@ namespace IOB_WIN
///
protected bool checkSaveItem(MTConnectStreams.DataItem newValue)
{
- bool answ = false;
+ bool answ = !enableDataFilter;
+
if (newValue != null)
{
+ if (utils.CRB("verbose"))
+ {
+ lgInfo($"Richiesta checkSaveItem per {newValue} | id: {newValue.DataItemId} | CDATA: {newValue.CDATA}");
+ }
// verifico in memoria se ho l'oggetto condition ed il suo valore..
if (dataItemMem.ContainsKey(newValue.DataItemId))
{
@@ -333,6 +355,10 @@ namespace IOB_WIN
answ = true;
}
}
+ else
+ {
+ lgError("Attenzione: checkSaveItem con newValue null!");
+ }
return answ;
}
///
@@ -342,11 +368,15 @@ namespace IOB_WIN
///
protected bool checkSaveSample(MTConnectStreams.Sample newValue)
{
- bool answ = false;
+ bool answ = !enableDataFilter;
double oldVal = 0;
double newVal = 0;
if (newValue != null)
{
+ if (utils.CRB("verbose"))
+ {
+ lgInfo($"Richiesta checkSaveSample per {newValue} | id: {newValue.DataItemId} | CDATA: {newValue.CDATA}");
+ }
// verifico in memoria se ho l'oggetto condition ed il suo valore..
if (dataItemMem.ContainsKey(newValue.DataItemId))
{
@@ -365,6 +395,10 @@ namespace IOB_WIN
// controllo SE ho DeadBand...
if (dataItemMem[newValue.DataItemId].thresholdDeadBand > 0)
{
+ if (utils.CRB("verbose"))
+ {
+ lgInfo($"Test deadband: oldVal: {oldVal} | newVal: {newVal}");
+ }
// recupero i valori e testo DeadBand...
double.TryParse(dataItemMem[newValue.DataItemId].value.Replace(".", ","), out oldVal);
double.TryParse(newValue.CDATA.Replace(".", ","), out newVal);
@@ -385,6 +419,10 @@ namespace IOB_WIN
}
}
}
+ else
+ {
+ lgError("Attenzione: checkSaveItem con newValue null!");
+ }
return answ;
}
@@ -457,6 +495,13 @@ namespace IOB_WIN
{
accodaFLog(sVal, qEncodeFLog(locTStamp, descr, dataItem.CDATA));
}
+ else
+ {
+ if (utils.CRB("verbose"))
+ {
+ lgInfo($"NON ACCODATO sample poiché verifica variazioen ha dato esito negativo");
+ }
+ }
}
}
catch
@@ -752,6 +797,8 @@ namespace IOB_WIN
string currExe = "";
string currRun = "";
string currUnOpStatus = "";
+ string currGettoOn = "";
+ string currAbilAbras = "";
try
{
var exeMode = dataItemMem["Path_01_EXE_MODE"];
@@ -840,6 +887,19 @@ namespace IOB_WIN
lgInfo(string.Format("Trasformazione B_input: {0}", B_input));
}
}
+ ///
+ /// Verifica un DataItem e se il valore corrisponde a quello indicato come "true value" restituisce true
+ ///
+ ///
+ ///
+ ///
+ protected bool checkDataItem(string itemName, string trueVal)
+ {
+ bool answ = false;
+
+ return answ;
+ }
+
///
/// Recupero dati dinamici...
///
diff --git a/Jenkinsfile b/Jenkinsfile
index 82973a6b..c0058760 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -16,7 +16,7 @@ pipeline {
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
script {
- withEnv(['NEXT_BUILD_NUMBER=550']) {
+ withEnv(['NEXT_BUILD_NUMBER=551']) {
// 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'