Merge branch 'MTC'

This commit is contained in:
Samuele E. Locatelli
2019-12-04 17:53:12 +01:00
9 changed files with 81 additions and 66 deletions
+6 -2
View File
@@ -86,6 +86,10 @@ namespace IOB_WIN
#region utils ed helpers
/// <summary>
/// Log verboso da configurazione (SOLO CHAIVE "verbose"...
/// </summary>
public bool isVerboseLog { get; set; } = utils.CRB("verbose");
/// <summary>
/// Stringa corrente di log...
/// </summary>
@@ -136,7 +140,7 @@ namespace IOB_WIN
catch (Exception exc)
{
lgError($"Errore in esecuzione logWatcher{Environment.NewLine}--> {value}");
if (utils.CRB("verbose"))
if (isVerboseLog)
{
lgError($"{exc}");
}
@@ -162,7 +166,7 @@ namespace IOB_WIN
catch (Exception exc)
{
lgError($"Errore in esecuzione taskWatcher{Environment.NewLine}--> {value}");
if (utils.CRB("verbose"))
if (isVerboseLog)
{
lgError($"{exc}");
}
+11 -11
View File
@@ -203,13 +203,13 @@ namespace IOB_WIN
// aggiungo referenza obj FANUC
FANUC_ref = (FANUC)Runtime.NC;
if (utils.CRB("verbose"))
if (isVerboseLog)
{
lgInfo("FANUC_ref da CncLib");
}
// disconnetto e connetto...
if (utils.CRB("verbose"))
if (isVerboseLog)
{
lgInfo("FANUC: tryDisconnect");
}
@@ -361,7 +361,7 @@ namespace IOB_WIN
{
memAddressFanuc areaCounter = new memAddressFanuc(memAddr);
if (utils.CRB("verbose"))
if (isVerboseLog)
{
lgInfo("[0] area memoria: {0}.{1}.{2}", areaCounter.mType, areaCounter.mPos, areaCounter.vType);
}
@@ -943,7 +943,7 @@ namespace IOB_WIN
{
memAddressFanuc areaCounter = new memAddressFanuc(memAddr);
if (utils.CRB("verbose"))
if (isVerboseLog)
{
lgInfo("[0] area memoria: {0}.{1}.{2}", areaCounter.mType, areaCounter.mPos, areaCounter.vType);
}
@@ -966,13 +966,13 @@ namespace IOB_WIN
case "DW":
uint valDW = 0;
FANUC_ref.F_RW_DWord(false, areaCounter.mType, areaCounter.mPos, ref valDW);
if (utils.CRB("verbose"))
if (isVerboseLog)
{
lgInfo("[1] valDW contapezzi: {0}", valDW);
}
outputVal = valDW;
if (utils.CRB("verbose"))
if (isVerboseLog)
{
lgInfo("[2] outputVal contapezzi: {0}", outputVal);
}
@@ -988,7 +988,7 @@ namespace IOB_WIN
// salvo...
Int32.TryParse(outputVal.ToString(), out lastCountCNC);
if (utils.CRB("verbose"))
if (isVerboseLog)
{
lgInfo("[3] lastCountCNC contapezzi: {0}", lastCountCNC);
}
@@ -1091,7 +1091,7 @@ namespace IOB_WIN
{
memAddressFanuc areaCounter = new memAddressFanuc(memAddr);
if (utils.CRB("verbose"))
if (isVerboseLog)
{
lgInfo("[0] area memoria: {0}.{1}.{2}", areaCounter.mType, areaCounter.mPos, areaCounter.vType);
}
@@ -1114,13 +1114,13 @@ namespace IOB_WIN
case "DW":
uint valDW = 0;
FANUC_ref.F_RW_DWord(false, areaCounter.mType, areaCounter.mPos, ref valDW);
if (utils.CRB("verbose"))
if (isVerboseLog)
{
lgInfo("[1] valDW PAR: {0}", valDW);
}
outputVal = valDW;
if (utils.CRB("verbose"))
if (isVerboseLog)
{
lgInfo("[2] outputVal PAR: {0}", outputVal);
}
@@ -1136,7 +1136,7 @@ namespace IOB_WIN
// salvo...
answ = outputVal.ToString();
if (utils.CRB("verbose"))
if (isVerboseLog)
{
lgInfo("[3] PAR letto: {0} | {1}", varName, answ);
}
+5 -1
View File
@@ -60,6 +60,10 @@ namespace IOB_WIN
/// Indica impianto IN SETUP (fino a quando SMETTE di esserlo...)
/// </summary>
protected bool inSetup = false;
/// <summary>
/// Log verboso da configurazione (SOLO CHAIVE "verbose"...
/// </summary>
public bool isVerboseLog { get; set; } = utils.CRB("verbose");
/// <summary>
/// Indicazione VETO invio a server sino alla data-ora indicata
/// </summary>
@@ -1920,7 +1924,7 @@ namespace IOB_WIN
// ora trimmo vettore al solo numero VERO dei valori caricati...
Array.Resize<otherData>(ref vettoreConf, numRiga);
if (utils.CRB("verbose"))
if (isVerboseLog)
{
lgInfo(string.Format("Fine caricamento vettore di {0} variabili per file {1}", numRiga, nomeFile));
}
+4 -4
View File
@@ -317,7 +317,7 @@ namespace IOB_WIN
KAWASAKI_ref = new KRcc.Commu(connPar);
//KAWASAKI_ref = new KRcc.Commu("TCP 192.168.0.92");
// disconnetto e connetto...
if (utils.CRB("verbose"))
if (isVerboseLog)
{
lgInfo("KAWASAKI: tryDisconnect");
}
@@ -326,7 +326,7 @@ namespace IOB_WIN
//lgInfo("KAWASAKI: tryConnect");
//tryConnect();
lgInfo("End init Adapter KAWASAKI");
if (utils.CRB("verbose"))
if (isVerboseLog)
{
lgInfo("KAWASAKI CONNESSIONE AVVENUTA");
}
@@ -745,7 +745,7 @@ namespace IOB_WIN
{
memAreaSiemens areaCounter = new memAreaSiemens(memAddr);
if (utils.CRB("verbose"))
if (isVerboseLog)
{
lgInfo("[0] area memoria: {1}.{2}.{3}", memAddr, areaCounter.DbNum, areaCounter.indiceMem, areaCounter.tipoMem);
}
@@ -770,7 +770,7 @@ namespace IOB_WIN
}
// salvo...
Int32.TryParse(outputVal.ToString(), out lastCountCNC);
if (utils.CRB("verbose"))
if (isVerboseLog)
{
lgInfo("[2] outputVal contapezzi: {0}", outputVal);
lgInfo("[3] lastCountCNC contapezzi: {0}", lastCountCNC);
+13 -6
View File
@@ -473,7 +473,7 @@ namespace IOB_WIN
if (newValue != null)
{
if (utils.CRB("verbose"))
if (isVerboseLog)
{
lgInfo($"Richiesta checkSaveItem per {newValue} | id: {newValue.DataItemId} | CDATA: {newValue.CDATA}");
}
@@ -538,7 +538,7 @@ namespace IOB_WIN
double newVal = 0;
if (newValue != null)
{
if (utils.CRB("verbose"))
if (isVerboseLog)
{
lgInfo($"Richiesta checkSaveSample per {newValue} | id: {newValue.DataItemId} | CDATA: {newValue.CDATA}");
}
@@ -560,7 +560,7 @@ namespace IOB_WIN
// controllo SE ho DeadBand...
if (dataItemMem[newValue.DataItemId].thresholdDeadBand > 0)
{
if (utils.CRB("verbose"))
if (isVerboseLog)
{
lgInfo($"Test deadband: oldVal: {oldVal} | newVal: {newVal}");
}
@@ -676,6 +676,7 @@ namespace IOB_WIN
descr = itemTranslation("C", dataItem.DataItemId);
locTStamp = dataItem.Timestamp.ToLocalTime();
sVal = $"CONDITION: {locTStamp.ToString()} | descr: {descr} | Id: {dataItem.DataItemId} | | Name: {dataItem.Name} | Val: {dataItem.CDATA}";
// condizion verboso SEMPRE!
lgInfo(sVal);
DateTime tStamp = dataItem.Timestamp;
var time2 = tStamp.ToLocalTime();
@@ -702,7 +703,10 @@ namespace IOB_WIN
descr = itemTranslation("E", dataItem.DataItemId);
locTStamp = dataItem.Timestamp.ToLocalTime();
sVal = $"EVENT: {locTStamp.ToString()} | descr: {descr} | Id: {dataItem.DataItemId} | Name: {dataItem.Name} | Val: {dataItem.CDATA}";
lgInfo(sVal);
if (isVerboseLog)
{
lgInfo(sVal);
}
DateTime tStamp = dataItem.Timestamp;
var time2 = tStamp.ToLocalTime();
// verifico se salvare
@@ -728,7 +732,10 @@ namespace IOB_WIN
descr = itemTranslation("S", dataItem.DataItemId);
locTStamp = dataItem.Timestamp.ToLocalTime();
sVal = $"SAMPLE: {locTStamp.ToString()} | descr: {descr} | Id: {dataItem.DataItemId} | | Name: {dataItem.Name} | Val: {dataItem.CDATA}";
lgInfo(sVal);
if (isVerboseLog)
{
lgInfo(sVal);
}
DateTime tStamp = dataItem.Timestamp;
var time2 = tStamp.ToLocalTime();
// verifico se salvare
@@ -740,7 +747,7 @@ namespace IOB_WIN
}
else
{
if (utils.CRB("verbose"))
if (isVerboseLog)
{
lgInfo($"NON ACCODATO sample poiché verifica variazione SAMPLE ha dato esito negativo", false);
}
+2 -2
View File
@@ -83,13 +83,13 @@ namespace IOB_WIN
}
parentForm.commPlcActive = false;
if (utils.CRB("verbose"))
if (isVerboseLog)
{
lgInfo(string.Format("INIT OSAI_ref da CncLib come {0}", IOBConf.tipoIob));
}
// disconnetto e connetto...
if (utils.CRB("verbose"))
if (isVerboseLog)
{
lgInfo("OSAI: tryDisconnect");
}
+35 -35
View File
@@ -267,8 +267,8 @@ namespace IOB_WIN
parentForm.commPlcActive = true;
short esitoLink = doConnect();
lgInfo($"szStatusConnection OMRON, esitoLink: {esitoLink}");
parentForm.commPlcActive = false;
// imposto i parametri...
parentForm.commPlcActive = false;
// imposto i parametri...
setParamPlc();
connectionOk = true;
// refresh stato allarmi!!!
@@ -712,7 +712,7 @@ namespace IOB_WIN
{
// controllo i parametri... ne gestisco 4...
foreach (var item in updatedPar)
{
{
lgInfo($"Richiesti processing plcWriteParams per {item.name} | valore richiesto {item.reqValue} | valore attuale {item.value}");
string readBackVal = "";
switch (item.uid)
@@ -738,10 +738,10 @@ namespace IOB_WIN
break;
default:
break;
}
// SE non corrispondessero LOGGO ERRORE...
if (item.value != readBackVal)
{
}
// SE non corrispondessero LOGGO ERRORE...
if (item.value != readBackVal)
{
lgError($"Errore in plcWriteParams: uid {item.uid} | Wrote {item.value} | ReadBack {readBackVal}");
}
}
@@ -781,40 +781,40 @@ namespace IOB_WIN
OMRON_ref.ReadWords(OmronFinsTCP.Net.PlcMemory.DM, 0, 8, out memReadDM);
OMRON_ref.ReadWords(OmronFinsTCP.Net.PlcMemory.WR, 0, 8, out memReadWR);
if (utils.CRB("verbose"))
{
lgInfo("Effettuata lettura dati CIO");
foreach (var item in memReadCIO_IN)
{
lgInfo($"Valori: {item} --> {baseUtils.binaryForm(item)}");
}
lgInfo("Effettuata lettura dati DM");
foreach (var item in memReadDM)
{
lgInfo($"Valori: {item} --> {baseUtils.binaryForm(item)}");
}
lgInfo("Effettuata lettura dati WR");
foreach (var item in memReadWR)
{
lgInfo($"Valori: {item} --> {baseUtils.binaryForm(item)}");
if (isVerboseLog)
{
lgInfo("Effettuata lettura dati CIO");
foreach (var item in memReadCIO_IN)
{
lgInfo($"Valori: {item} --> {baseUtils.binaryForm(item)}");
}
lgInfo("Effettuata lettura dati DM");
foreach (var item in memReadDM)
{
lgInfo($"Valori: {item} --> {baseUtils.binaryForm(item)}");
}
lgInfo("Effettuata lettura dati WR");
foreach (var item in memReadWR)
{
lgInfo($"Valori: {item} --> {baseUtils.binaryForm(item)}");
}
}
short[] respDM20;
short[] respDM22;
OMRON_ref.ReadWords(OmronFinsTCP.Net.PlcMemory.DM, 20, 2, out respDM20);
OMRON_ref.ReadWords(OmronFinsTCP.Net.PlcMemory.DM, 22, 2, out respDM22);
if (utils.CRB("verbose"))
{
// legge delle coppie di valori INT, vanno trasformati in HEX e POI accodati, dove il primo è x 1 e il secondo x 10000 (in pratica va in testa)
lgInfo("Effettuata lettura dati respDM20");
foreach (var item in respDM20)
{
lgInfo($"Valori: {item} --> {baseUtils.binaryForm(item)}");
}
lgInfo("Effettuata lettura dati respDM22");
foreach (var item in respDM22)
{
lgInfo($"Valori: {item} --> {baseUtils.binaryForm(item)}");
if (isVerboseLog)
{
// legge delle coppie di valori INT, vanno trasformati in HEX e POI accodati, dove il primo è x 1 e il secondo x 10000 (in pratica va in testa)
lgInfo("Effettuata lettura dati respDM20");
foreach (var item in respDM20)
{
lgInfo($"Valori: {item} --> {baseUtils.binaryForm(item)}");
}
lgInfo("Effettuata lettura dati respDM22");
foreach (var item in respDM22)
{
lgInfo($"Valori: {item} --> {baseUtils.binaryForm(item)}");
}
}
}
+4 -4
View File
@@ -818,7 +818,7 @@ namespace IOB_WIN
{
currPLC = new Plc(parametri.tipoCpu, parametri.ipAdrr, parametri.rack, parametri.slot);
// disconnetto e connetto...
if (utils.CRB("verbose"))
if (isVerboseLog)
{
lgInfo("SIEMENS: tryDisconnect");
}
@@ -829,7 +829,7 @@ namespace IOB_WIN
lgInfo("SIEMENS: tryConnect");
tryConnect();
lgInfo("End init Adapter SIEMENS");
if (utils.CRB("verbose"))
if (isVerboseLog)
{
lgInfo("S7+ CONNESSIONE AVVENUTA");
}
@@ -1048,7 +1048,7 @@ namespace IOB_WIN
{
memAreaSiemens areaCounter = new memAreaSiemens(memAddr);
if (utils.CRB("verbose"))
if (isVerboseLog)
{
lgInfo("[0] area memoria: {1}.{2}.{3}", memAddr, areaCounter.DbNum, areaCounter.indiceMem, areaCounter.tipoMem);
}
@@ -1076,7 +1076,7 @@ namespace IOB_WIN
}
// salvo...
Int32.TryParse(outputVal.ToString(), out lastCountCNC);
if (utils.CRB("verbose"))
if (isVerboseLog)
{
lgInfo("[2] outputVal contapezzi: {0}", outputVal);
lgInfo("[3] lastCountCNC contapezzi: {0}", lastCountCNC);
Vendored
+1 -1
View File
@@ -16,7 +16,7 @@ pipeline {
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
script {
withEnv(['NEXT_BUILD_NUMBER=575']) {
withEnv(['NEXT_BUILD_NUMBER=576']) {
// 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'