update tempi x refresh dati in caso di spegnimento...

This commit is contained in:
Samuele E. Locatelli
2017-11-22 16:14:45 +01:00
parent 0820991f19
commit 780be0c5ef
3 changed files with 5 additions and 75 deletions
+2 -2
View File
@@ -25,8 +25,8 @@
<add key="waitEndCycle" value="0" />
<!-- watchdog, ping, check disconnesso -->
<add key="pingTestSec" value="5" />
<add key="watchdogMaxSec" value="8" />
<add key="disconMaxSec" value="4" />
<add key="watchdogMaxSec" value="90" />
<add key="disconMaxSec" value="60" />
<!--Modalità DEMO: DemoOUT indica che NON invia davvero al server e DemoIN che simula e NON legge da PLC-->
<add key="DemoIn" value="false" />
<add key="DemoInSample" value="false" />
-6
View File
@@ -425,12 +425,6 @@ namespace IOB_WIN
string sVal = string.Format("[CNC_MODE]{0}", descrMode);
// chiamo accodamento...
accodaFLog(sVal, qEncodeFLog("CNC_MODE", descrMode));
#if false
displayOtherData(sVal);
QueueFLog.Enqueue(qEncodeFLog("CNC_MODE", descrMode));
// log nuovo MODE
lg.Info("CNC_MODE: " + descrMode);
#endif
}
}
catch (Exception exc)
+3 -67
View File
@@ -892,34 +892,7 @@ namespace IOB_WIN
string memAddr = string.Format("{0}.{1}", ByteNum + shift * memSize, resto);
return new otherData(valori[0], memAddr, valori[1].Trim(), valori[2].Trim());
}
#if false
/// <summary>
/// Decodifica file MAP (caso LISTA DI BIT...)
/// </summary>
/// <param name="linea"></param>
/// <param name="separator"></param>
/// <param name="memPre">tipo memoria (R/D/...)</param>
/// <param name="baseAddr">indirizzo Byte: indirizzo di partenza memoria</param>
/// <param name="memSize">dimensione singolo slot in byte</param>
/// <param name="numRiga">indirizzo bit: numero riga x calcolo indice bit</param>
/// <returns></returns>
protected otherData decodeBitData(string linea, char separator, string memPre, int baseAddr, int memSize, int numRiga)
{
string[] valori = linea.Split(separator);
int shift = 0;
try
{
shift = (Convert.ToInt32(valori[0]) - 1) / (8 * memSize);
}
catch
{ }
int resto = 0;
Math.DivRem(numRiga, 8 * memSize, out resto);
string memAddr = string.Format("{0}{1}.{2}", memPre, baseAddr + shift, resto);
return new otherData(valori[0], memAddr, valori[1].Trim(), valori[2].Trim());
}
#endif
#endregion
/// <summary>
@@ -1445,16 +1418,6 @@ namespace IOB_WIN
// chiamo accodamento...
accodaFLog(sVal, qEncodeFLog("PROG", currPrgName));
#if false
displayOtherData(sVal);
// --> accodo (valore già formattato)!
QueueFLog.Enqueue(qEncodeFLog("PROG", currPrgName));
// Gestione counter FLog!
counterFLog++;
// se supera 10k resetto...
if (counterFLog > 9999) counterFLog = 0;
#endif
}
}
/// <summary>
@@ -1483,15 +1446,6 @@ namespace IOB_WIN
sVal = string.Format("[SYSINFO]{0}|{1}", item.Key, item.Value);
// chiamo accodamento...
accodaFLog(sVal, qEncodeFLog(item.Key, item.Value));
#if false
displayOtherData(sVal);
// --> accodo (valore già formattato)!
QueueFLog.Enqueue(qEncodeFLog(item.Key, item.Value));
// Gestione counter FLog!
counterFLog++;
// se supera 10k resetto...
if (counterFLog > 9999) counterFLog = 0;
#endif
}
}
}
@@ -1572,15 +1526,6 @@ namespace IOB_WIN
sVal = string.Format("[DYNDATA]{0}|{1}", item.Key, item.Value);
// chiamo accodamento...
accodaFLog(sVal, qEncodeFLog(item.Key, item.Value));
#if false
displayOtherData(sVal);
// --> accodo (valore già formattato)!
QueueFLog.Enqueue(qEncodeFLog(item.Key, item.Value));
// Gestione counter FLog!
counterFLog++;
// se supera 10k resetto...
if (counterFLog > 9999) counterFLog = 0;
#endif
}
}
}
@@ -1614,15 +1559,6 @@ namespace IOB_WIN
sVal = string.Format("[OVERRIDES]{0}|{1}", item.Key, item.Value);
// chiamo accodamento...
accodaFLog(sVal, qEncodeFLog(item.Key, item.Value));
#if false
displayOtherData(sVal);
// --> accodo (valore già formattato)!
QueueFLog.Enqueue(qEncodeFLog(item.Key, item.Value));
// Gestione counter FLog!
counterFLog++;
// se supera 10k resetto...
if (counterFLog > 9999) counterFLog = 0;
#endif
}
}
}
@@ -1692,6 +1628,8 @@ namespace IOB_WIN
/// </summary>
public void accodaSigIN()
{
// mostro dati variati letti...
displayInData();
// --> accodo (valore già formattato)!
QueueIN.Enqueue(qEncodeIN);
// loggo!
@@ -1701,8 +1639,6 @@ namespace IOB_WIN
if (nReadFilt > int.MaxValue - 1) nReadFilt = 0; // per evitare buffer overflow...
counterSigIN++;
if (counterSigIN > 9999) counterSigIN = 0;
// mostro dati variati letti...
displayInData();
}
/// <summary>
/// Accumula in coda i valori Signal IN e logga...