Reorg codice CodeMaid x IobSiemens

This commit is contained in:
Samuele Locatelli
2023-04-27 14:42:57 +02:00
parent 305af5c74d
commit 5828994ee3
5 changed files with 80 additions and 81 deletions
+52 -53
View File
@@ -31,45 +31,6 @@ namespace IOB_WIN_NEXT.IobSiemens
#endregion Public Fields
#region Protected Fields
/// <summary>
/// Oggetto PLC da ri-utilizzare...
/// </summary>
protected Plc currPLC;
/// <summary>
/// Ultimo controllo ping x evitare ping flood...
/// </summary>
protected DateTime lastPingConn = DateTime.Now.AddMinutes(-10);
/// <summary>
/// Esito ultimo ping
/// </summary>
protected bool lastPingOk = false;
/// <summary>
/// Lungh massima stringhe
/// </summary>
protected int maxStrChar = 20;
/// <summary>
/// parametri di connessione
/// </summary>
protected connParamS7 parametri;
/// <summary>
/// Oggetto cronometro x test vari...
/// </summary>
protected Stopwatch sw = new Stopwatch();
/// <summary>
/// indica se scrivere i primi byte x string siemens x indicare lung max e corrente
/// </summary>
protected bool writePre = true;
#endregion Protected Fields
#region Public Constructors
/// <summary>
@@ -126,16 +87,6 @@ namespace IOB_WIN_NEXT.IobSiemens
#endregion Public Constructors
#region Protected Properties
/// <summary>
/// Dizionario delle ultime operazioni di scrittura per OGNI memoria (in modo che fa log
/// ogni x sec...)
/// </summary>
protected Dictionary<string, DateTime> lastMemWrite { get; set; } = new Dictionary<string, DateTime>();
#endregion Protected Properties
#region Public Methods
/// <summary>
@@ -1167,6 +1118,55 @@ namespace IOB_WIN_NEXT.IobSiemens
#endregion Public Methods
#region Protected Fields
/// <summary>
/// Oggetto PLC da ri-utilizzare...
/// </summary>
protected Plc currPLC;
/// <summary>
/// Ultimo controllo ping x evitare ping flood...
/// </summary>
protected DateTime lastPingConn = DateTime.Now.AddMinutes(-10);
/// <summary>
/// Esito ultimo ping
/// </summary>
protected bool lastPingOk = false;
/// <summary>
/// Lungh massima stringhe
/// </summary>
protected int maxStrChar = 20;
/// <summary>
/// parametri di connessione
/// </summary>
protected connParamS7 parametri;
/// <summary>
/// Oggetto cronometro x test vari...
/// </summary>
protected Stopwatch sw = new Stopwatch();
/// <summary>
/// indica se scrivere i primi byte x string siemens x indicare lung max e corrente
/// </summary>
protected bool writePre = true;
#endregion Protected Fields
#region Protected Properties
/// <summary>
/// Dizionario delle ultime operazioni di scrittura per OGNI memoria (in modo che fa log
/// ogni x sec...)
/// </summary>
protected Dictionary<string, DateTime> lastMemWrite { get; set; } = new Dictionary<string, DateTime>();
#endregion Protected Properties
#region Protected Methods
/// <summary>
@@ -1289,11 +1289,10 @@ namespace IOB_WIN_NEXT.IobSiemens
// verifica e decremento blink...
item.checkBlinkCounter(i, (uint)currStatus);
// verifico SE sia variato... confronto allarmi filtrato stile blink per
// bit status:
// verifico SE sia variato... confronto allarmi filtrato stile blink per bit status:
// - allarmi che iniziano per # IGNORATI
// - altri allarmi con un countdown da MAX_COUNTER_BLINK a 0 per il
// fronte di discesa
// - altri allarmi con un countdown da MAX_COUNTER_BLINK a 0 per il fronte
// di discesa
if (item.isChanged(i, currStatus))
{
if (currStatus > 0)
+1 -1
View File
@@ -172,7 +172,7 @@ namespace IOB_WIN_NEXT.IobSiemens
// bit status:
// - allarmi che iniziano per # IGNORATI
// - altri allarmi con un countdown da MAX_COUNTER_BLINK a 0 per il
// fronte di discesa
// fronte di discesa
if (item.isChanged(i, currStatus))
{
if (currStatus > 0)
+2 -2
View File
@@ -234,8 +234,8 @@ namespace IOB_WIN_NEXT.IobSiemens
}
if (!string.IsNullOrWhiteSpace(currODL) && currODL != "0")
{
// ora processo il contapezzi...
// controllo se è passato intervallo minimo tra 2 controlli/elaborazioni x distanziare invio e ridurre letture
// ora processo il contapezzi... controllo se è passato intervallo minimo tra 2
// controlli/elaborazioni x distanziare invio e ridurre letture
if (DateTime.Now >= lastPzCountSend.AddMilliseconds(pzCountDelay))
{
// se sono differenti MOSTRO...
+10 -10
View File
@@ -58,16 +58,6 @@ namespace IOB_WIN_NEXT.IobSiemens
*
* -------------------------------------------------------------------------------- */
#region Protected Fields
protected int counterMes2Plc = 0;
protected int counterPlc2Mes = 0;
protected DateTime lastPLCWatchDog;
#endregion Protected Fields
#region Public Constructors
/// <summary>
@@ -230,6 +220,16 @@ namespace IOB_WIN_NEXT.IobSiemens
#endregion Public Methods
#region Protected Fields
protected int counterMes2Plc = 0;
protected int counterPlc2Mes = 0;
protected DateTime lastPLCWatchDog;
#endregion Protected Fields
#region Protected Methods
/// <summary>
+15 -15
View File
@@ -23,20 +23,6 @@ namespace IOB_WIN_NEXT.IobSiemens
* -------------------------------------------------------------------------------- */
#region Protected Fields
protected int counterMes2Plc = 0;
protected int counterPlc2Mes = 0;
protected int counterPlc2MesWrote = 0;
protected DateTime lastPLCWatchDog;
protected bool useNewSend = false;
#endregion Protected Fields
#region Public Constructors
/// <summary>
@@ -126,7 +112,7 @@ namespace IOB_WIN_NEXT.IobSiemens
foreach (var item in task2exe)
{
taskOk = false;
taskVal = "";
taskVal = "";
int valore = 0;
// converto richiesta in enum...
taskType tName = taskType.nihil;
@@ -523,6 +509,20 @@ namespace IOB_WIN_NEXT.IobSiemens
#endregion Public Methods
#region Protected Fields
protected int counterMes2Plc = 0;
protected int counterPlc2Mes = 0;
protected int counterPlc2MesWrote = 0;
protected DateTime lastPLCWatchDog;
protected bool useNewSend = false;
#endregion Protected Fields
#region Protected Methods
/// <summary>