Update gestione track dati (riduzione num tracciamenti attivi)
This commit is contained in:
@@ -96,7 +96,7 @@ namespace IOB_UT_NEXT.Config.Base
|
||||
/// <summary>
|
||||
/// Valore soglia x registrare eventi FluxLog TrackData
|
||||
/// </summary>
|
||||
public int TrackDataThreshold { get; set; } = 10;
|
||||
public int TrackDataThreshold { get; set; } = 20;
|
||||
|
||||
/// <summary>
|
||||
/// Durata (in secondi) del veto ad invio snapshot (per evitare doppi click e doppio snapshot/dossier)
|
||||
|
||||
@@ -18,11 +18,12 @@ namespace IOB_UT_NEXT
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public DataQueue(string codIOB, string qName, bool useRedis)
|
||||
public DataQueue(string codIOB, string qName, bool useRedis, RedisIobCache redisCacheMan)
|
||||
{
|
||||
UseRedis = useRedis;
|
||||
CodIOB = codIOB;
|
||||
QueueName = qName;
|
||||
redisMan = redisCacheMan;
|
||||
KeyName = redisMan.redHash($"IOB:QUEUE:{CodIOB}:{QueueName}");
|
||||
}
|
||||
|
||||
@@ -131,7 +132,7 @@ namespace IOB_UT_NEXT
|
||||
/// <summary>
|
||||
/// Oggetto connessione REDIS
|
||||
/// </summary>
|
||||
private RedisIobCache redisMan { get; set; } = new RedisIobCache();
|
||||
private RedisIobCache redisMan; // { get; set; } = new RedisIobCache();
|
||||
|
||||
#endregion Private Properties
|
||||
}
|
||||
|
||||
+56
-30
@@ -55,11 +55,6 @@ namespace IOB_UT_NEXT.Iob
|
||||
public IobConfiguration cIobConf;
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Configurazione gerarchica completa (v 4.x.x.x)
|
||||
/// </summary>
|
||||
public IobConfTree IOBConfFull;
|
||||
|
||||
/// <summary>
|
||||
/// Conteggio ATTUALE ore macchina IN LAVORO
|
||||
/// </summary>
|
||||
@@ -135,6 +130,11 @@ namespace IOB_UT_NEXT.Iob
|
||||
/// </summary>
|
||||
public bool hasBigEndian = false;
|
||||
|
||||
/// <summary>
|
||||
/// Configurazione gerarchica completa (v 4.x.x.x)
|
||||
/// </summary>
|
||||
public IobConfTree IOBConfFull;
|
||||
|
||||
/// <summary>
|
||||
/// dataOra ultima verifica CNC disconnesso...
|
||||
/// </summary>
|
||||
@@ -200,6 +200,11 @@ namespace IOB_UT_NEXT.Iob
|
||||
/// </summary>
|
||||
public bool needRefreshPzCount = true;
|
||||
|
||||
/// <summary>
|
||||
/// Coda degli esiti di ping x calcolo stato macchina
|
||||
/// </summary>
|
||||
public DataQueue PingQueue;
|
||||
|
||||
/// <summary>
|
||||
/// Determina se utilizzare blocchi di memoria IOT contigui (e quindi processing
|
||||
/// "monoblocco" semplificato"=
|
||||
@@ -209,33 +214,33 @@ namespace IOB_UT_NEXT.Iob
|
||||
/// <summary>
|
||||
/// Coda valori ALLARMI ove gestiti...
|
||||
/// </summary>
|
||||
public DataQueue QueueAlarm = new DataQueue("000", "QueueAlarm", false);
|
||||
public DataQueue QueueAlarm;// = new DataQueue("000", "QueueAlarm", false);
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto della coda degli elementi letti di tipo FluxLog (e non ancora trasmessi)
|
||||
/// </summary>
|
||||
public DataQueue QueueFLog = new DataQueue("000", "QueueFLog", false);
|
||||
public DataQueue QueueFLog;// = new DataQueue("000", "QueueFLog", false);
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto della coda degli elementi letti (e non ancora trasmessi)
|
||||
/// </summary>
|
||||
public DataQueue QueueIN = new DataQueue("000", "QueueIN", false);
|
||||
public DataQueue QueueIN;// = new DataQueue("000", "QueueIN", false);
|
||||
|
||||
/// <summary>
|
||||
/// Coda valori MESSAGGI/EVENTI (da non sottocampionare come samples)...
|
||||
/// </summary>
|
||||
public DataQueue QueueMessages = new DataQueue("000", "QueueMessages", false);
|
||||
public DataQueue QueueMessages;// = new DataQueue("000", "QueueMessages", false);
|
||||
|
||||
/// <summary>
|
||||
/// Oggetto della coda degli elementi di tipo RawTransf (e non ancora trasmessi)
|
||||
/// NB: sono salvati serializzati come stringhe
|
||||
/// </summary>
|
||||
public DataQueue QueueRawTransf = new DataQueue("000", "QueueRawTransf", false);
|
||||
public DataQueue QueueRawTransf;// = new DataQueue("000", "QueueRawTransf", false);
|
||||
|
||||
/// <summary>
|
||||
/// Coda valori LOG UTENTE (da non sottocampionare come samples)...
|
||||
/// </summary>
|
||||
public DataQueue QueueULog = new DataQueue("000", "QueueULog", false);
|
||||
public DataQueue QueueULog;// = new DataQueue("000", "QueueULog", false);
|
||||
|
||||
/// <summary>
|
||||
/// alias booleano false = R
|
||||
@@ -493,43 +498,42 @@ namespace IOB_UT_NEXT.Iob
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
/// <summary>
|
||||
/// wrapper di log
|
||||
/// </summary>
|
||||
private static readonly Logger lg = LogManager.GetCurrentClassLogger();
|
||||
|
||||
//protected static Logger lg = LogManager.GetCurrentClassLogger();
|
||||
|
||||
/// <summary>
|
||||
/// Valore di attesa (random) dopo ogni invio x evitare congestione send...
|
||||
/// </summary>
|
||||
protected static int urlRandWait = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Abilitazione invio conf macchine
|
||||
/// </summary>
|
||||
protected bool enabSendMachineConf = true;
|
||||
|
||||
/// <summary>
|
||||
/// Indica se resettare allarmi all'avvio e inviare il reset appena parte adapter
|
||||
/// </summary>
|
||||
protected bool resetAlarmOnStart = false;
|
||||
|
||||
/// <summary>
|
||||
/// Disabilitazione gestione ODL (lettura e gestione)
|
||||
/// </summary>
|
||||
protected bool disableOdl = false;
|
||||
|
||||
//protected static Logger lg = LogManager.GetCurrentClassLogger();
|
||||
/// <summary>
|
||||
/// Abilitazione invio conf macchine
|
||||
/// </summary>
|
||||
protected bool enabSendMachineConf = true;
|
||||
|
||||
/// <summary>
|
||||
/// Ultimo LOG registrazione avvio (x ridurre log notturni...)
|
||||
/// </summary>
|
||||
protected DateTime lastLogStartup = DateTime.Today.AddHours(-1);
|
||||
|
||||
/// <summary>
|
||||
/// Dimensione coda di ping x valutazione
|
||||
/// </summary>
|
||||
protected int maxQueuePing = 11;
|
||||
|
||||
/// <summary>
|
||||
/// Tempo minimo ammissibile di risposta (es x errori ModBus che risponde troppo in fretta) in millisec
|
||||
/// </summary>
|
||||
protected int minRespTimeMs = 5;
|
||||
|
||||
/// <summary>
|
||||
/// Indica se resettare allarmi all'avvio e inviare il reset appena parte adapter
|
||||
/// </summary>
|
||||
protected bool resetAlarmOnStart = false;
|
||||
|
||||
/// <summary>
|
||||
/// Veto per registrazione completa log di startup (minuti)
|
||||
/// </summary>
|
||||
@@ -616,12 +620,34 @@ namespace IOB_UT_NEXT.Iob
|
||||
return doVeto;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Setup di tutti gli oggetti Queue, ma solo alcuni hanno coda REDIS (quelli senza sono "sacrificabili"
|
||||
/// </summary>
|
||||
protected void SetupQueue()
|
||||
{
|
||||
string codIob = IOBConfFull.General.FilenameIOB;
|
||||
bool useRedis = IOBConfFull.General.EnabRedisQue;
|
||||
QueueAlarm = new DataQueue(codIob, "QueueAlarm", false, redisMan);
|
||||
// valutare se portare di nuovo in redis...
|
||||
QueueIN = new DataQueue(codIob, "QueueIN", useRedis, redisMan);
|
||||
QueueFLog = new DataQueue(codIob, "QueueFLog", useRedis, redisMan);
|
||||
QueueMessages = new DataQueue(codIob, "QueueMessages", false, redisMan);
|
||||
QueueRawTransf = new DataQueue(codIob, "QueueRawTransf", false, redisMan);
|
||||
QueueULog = new DataQueue(codIob, "QueueULog", false, redisMan);
|
||||
PingQueue = new DataQueue(codIob, "PingQueue", false, redisMan);
|
||||
}
|
||||
|
||||
#endregion Protected Methods
|
||||
|
||||
#region Private Properties
|
||||
#region Private Fields
|
||||
|
||||
/// <summary>
|
||||
/// wrapper di log
|
||||
/// </summary>
|
||||
private static readonly Logger lg = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private static Random rnd = new Random();
|
||||
|
||||
#endregion Private Properties
|
||||
#endregion Private Fields
|
||||
}
|
||||
}
|
||||
@@ -58,7 +58,7 @@ namespace IOB_UT_NEXT
|
||||
/// <summary>
|
||||
/// Valore minimo da considerare come delta secondi x indicare variazione sui dati temporali
|
||||
/// </summary>
|
||||
public int minDeltaSec { get; set; } = 5;
|
||||
public int minDeltaSec { get; set; } = 15;
|
||||
|
||||
/// <summary>
|
||||
/// Status del SINGOLO IOB
|
||||
@@ -126,13 +126,13 @@ namespace IOB_UT_NEXT
|
||||
|
||||
if (online != item.online)
|
||||
return false;
|
||||
// controllo se sia ALMENO 10 sec...
|
||||
// controllo se sia ALMENO 15 sec...
|
||||
if (lastUpdate != item.lastUpdate)
|
||||
{
|
||||
if (lastUpdate.Subtract(item.lastUpdate).TotalSeconds > minDeltaSec)
|
||||
return false;
|
||||
}
|
||||
// controllo se sia ALMENO 3 sec...
|
||||
// controllo se sia ALMENO 15 sec...
|
||||
if (lastDataIn != item.lastDataIn)
|
||||
{
|
||||
if (lastDataIn.Subtract(item.lastDataIn).TotalSeconds > minDeltaSec)
|
||||
@@ -141,7 +141,7 @@ namespace IOB_UT_NEXT
|
||||
// controllo se sia ALMENO 5 sec...
|
||||
if (lastDataOut != item.lastDataOut)
|
||||
{
|
||||
if (lastDataOut.Subtract(item.lastDataOut).TotalSeconds > minDeltaSec)
|
||||
if (lastDataOut.Subtract(item.lastDataOut).TotalSeconds > minDeltaSec / 3)
|
||||
return false;
|
||||
}
|
||||
if (semIn != item.semIn)
|
||||
|
||||
@@ -3633,7 +3633,7 @@ namespace IOB_WIN_FORM.Iob
|
||||
/// </summary>
|
||||
/// <param name="byteSize">Dim pacchetto (numero byte scambiati/ricevuti)</param>
|
||||
/// <param name="val2rec">Dim minima x registrare info</param>
|
||||
protected void trackExchData(long byteSize, long val2rec = 256)
|
||||
protected void trackExchData(long byteSize, long val2rec = 512)
|
||||
{
|
||||
// accumulo counter byte
|
||||
currByteCount += byteSize;
|
||||
@@ -3652,7 +3652,7 @@ namespace IOB_WIN_FORM.Iob
|
||||
/// Track dati ricevuti generici (serializzando)
|
||||
/// </summary>
|
||||
/// <param name="genObj"></param>
|
||||
protected void trackExchDataRaw(object genObj, long val2rec = 256)
|
||||
protected void trackExchDataRaw(object genObj, long val2rec = 512)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -4531,7 +4531,7 @@ namespace IOB_WIN_FORM.Iob
|
||||
TrackDayStatsCount.Add(key, 1);
|
||||
}
|
||||
// dettaglio è insieme key_val
|
||||
string detKey = $"{key}|{value}";
|
||||
string detKey = $"{key}:{value}";
|
||||
if (TrackDayStatsCount.ContainsKey(detKey))
|
||||
{
|
||||
TrackDayStatsCount[detKey]++;
|
||||
@@ -4568,6 +4568,7 @@ namespace IOB_WIN_FORM.Iob
|
||||
// se ho --> processo!
|
||||
if (numOver > 0)
|
||||
{
|
||||
// scadenza: 1 mese
|
||||
DateTime scadHash = DateTime.Today.AddMonths(1);
|
||||
// salvo statistiche Day
|
||||
rKey = $"{redisMan.redIobTrackKey}:DayStats:{LastDayCurr}";
|
||||
@@ -4576,20 +4577,20 @@ namespace IOB_WIN_FORM.Iob
|
||||
// traccio con scadenza 1 mese da oggi pareto chiamate giornaliere
|
||||
redisMan.redIncrHashCount(rKey, item.Key, scadHash, item.Value);
|
||||
}
|
||||
// salvo statistiche Detail, scadenza 15 gg
|
||||
scadHash = DateTime.Today.AddDays(15);
|
||||
// salvo statistiche Detail, scadenza 10 gg
|
||||
scadHash = DateTime.Today.AddDays(10);
|
||||
foreach (var item in TrackDetStatsCount)
|
||||
{
|
||||
// separo statistiche...
|
||||
var kvp = item.Key.Split('|');
|
||||
var kvp = item.Key.Split(':');
|
||||
if (kvp.Count() > 1)
|
||||
{
|
||||
rKey = $"{redisMan.redIobTrackKey}:DetailStats:{LastDayCurr}:{kvp[0]}";
|
||||
redisMan.redIncrHashCount(rKey, kvp[1], scadHash, item.Value);
|
||||
}
|
||||
}
|
||||
// salvo dizionario valori dettaglio... scadenza 5 gg
|
||||
scadHash = DateTime.Today.AddDays(5);
|
||||
// salvo dizionario valori dettaglio... scadenza 3 gg
|
||||
scadHash = DateTime.Today.AddDays(3);
|
||||
foreach (var item in TrackDetValsCount)
|
||||
{
|
||||
rKey = $"{redisMan.redIobTrackKey}:DataLog:{LastDayCurr}:{item.Key}";
|
||||
@@ -5147,18 +5148,15 @@ namespace IOB_WIN_FORM.Iob
|
||||
// svuoto code se richiesto
|
||||
if (resetQueue)
|
||||
{
|
||||
QueueAlarm = new DataQueue(IOBConfFull.General.CodIOB, "QueueAlarm", IOBConfFull.General.EnabRedisQue);
|
||||
//QueueAlarm = new ConcurrentQueue<string>();
|
||||
QueueIN = new DataQueue(IOBConfFull.General.CodIOB, "QueueIN", IOBConfFull.General.EnabRedisQue);
|
||||
//QueueIN = new ConcurrentQueue<string>();
|
||||
QueueFLog = new DataQueue(IOBConfFull.General.CodIOB, "QueueFLog", IOBConfFull.General.EnabRedisQue);
|
||||
//QueueFLog = new ConcurrentQueue<string>();
|
||||
QueueMessages = new DataQueue(IOBConfFull.General.CodIOB, "QueueMessages", IOBConfFull.General.EnabRedisQue);
|
||||
//QueueMessages = new ConcurrentQueue<string>();
|
||||
QueueRawTransf = new DataQueue(IOBConfFull.General.CodIOB, "QueueRawTransf", IOBConfFull.General.EnabRedisQue);
|
||||
//QueueRawTransf = new ConcurrentQueue<string>();
|
||||
QueueULog = new DataQueue(IOBConfFull.General.CodIOB, "QueueULog", IOBConfFull.General.EnabRedisQue);
|
||||
//QueueULog = new ConcurrentQueue<string>();
|
||||
string codIob = IOBConfFull.General.FilenameIOB;
|
||||
bool useRedis = IOBConfFull.General.EnabRedisQue;
|
||||
QueueAlarm = new DataQueue(codIob, "QueueAlarm", false, redisMan);
|
||||
QueueIN = new DataQueue(codIob, "QueueIN", useRedis, redisMan);
|
||||
QueueFLog = new DataQueue(codIob, "QueueFLog", useRedis, redisMan);
|
||||
QueueMessages = new DataQueue(codIob, "QueueMessages", false, redisMan);
|
||||
QueueRawTransf = new DataQueue(codIob, "QueueRawTransf", false, redisMan);
|
||||
QueueULog = new DataQueue(codIob, "QueueULog", false, redisMan);
|
||||
PingQueue = new DataQueue(codIob, "PingQueue", false, redisMan);
|
||||
}
|
||||
// imposto contatori blink a zero...
|
||||
i_counters = new int[32];
|
||||
@@ -5291,8 +5289,7 @@ namespace IOB_WIN_FORM.Iob
|
||||
// invio
|
||||
sendDataBlock(urlType.FLog, listaValori);
|
||||
// svuoto!
|
||||
QueueFLog = new DataQueue(IOBConfFull.General.CodIOB, "QueueFLog", IOBConfFull.General.EnabRedisQue);
|
||||
//QueueFLog = new ConcurrentQueue<string>();
|
||||
QueueFLog = new DataQueue(IOBConfFull.General.FilenameIOB, "QueueFLog", IOBConfFull.General.EnabRedisQue, redisMan);
|
||||
lastWatchDog = DateTime.Now;
|
||||
}
|
||||
}
|
||||
@@ -5363,8 +5360,7 @@ namespace IOB_WIN_FORM.Iob
|
||||
if (fatto)
|
||||
{
|
||||
// svuoto se ha okReport!
|
||||
QueueRawTransf = new DataQueue(IOBConfFull.General.CodIOB, "QueueRawTransf", IOBConfFull.General.EnabRedisQue);
|
||||
//QueueRawTransf = new ConcurrentQueue<string>();
|
||||
QueueRawTransf = new DataQueue(IOBConfFull.General.FilenameIOB, "QueueRawTransf", false, redisMan);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5425,7 +5421,7 @@ namespace IOB_WIN_FORM.Iob
|
||||
// invio
|
||||
sendDataBlock(urlType.ULog, listaValori);
|
||||
// svuoto!
|
||||
QueueULog = new DataQueue(IOBConfFull.General.CodIOB, "QueueULog", IOBConfFull.General.EnabRedisQue);
|
||||
QueueULog = new DataQueue(IOBConfFull.General.FilenameIOB, "QueueULog", false, redisMan);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -50,7 +50,9 @@ namespace IOB_WIN_FORM.Iob
|
||||
|
||||
// init oggetto redis...
|
||||
redisMan = new RedisIobCache(IobConfNew.MapoMes.IpAddr, IobConfNew.General.FilenameIOB, $"{IobConfNew.General.IobType}", IobConfNew.General.MinDeltaSec);
|
||||
//redisMan = new RedisIobCache(IOBConf.serverData.MPIP, IOBConf.codIOB, $"{IOBConf.tipoIob}", IOBConf.minDeltaSec);
|
||||
|
||||
// init code
|
||||
SetupQueue();
|
||||
|
||||
// initi oggetto TCMan
|
||||
tcMan = new TCMan(IobConfNew.TCDataConf.Lambda, IobConfNew.TCDataConf.MaxDelayFactor, IobConfNew.TCDataConf.MaxIncrPz);
|
||||
@@ -58,9 +60,6 @@ namespace IOB_WIN_FORM.Iob
|
||||
// salvo il form chiamante
|
||||
parentForm = caller;
|
||||
|
||||
// imposto le code!
|
||||
QueueIN = new DataQueue(IOBConfFull.General.FilenameIOB, "QueueIN", IOBConfFull.General.EnabRedisQue);
|
||||
|
||||
lastConnectTry = DateTime.Now;
|
||||
|
||||
lgInfo("Avvio preliminare AdapterGeneric");
|
||||
@@ -3317,8 +3316,7 @@ namespace IOB_WIN_FORM.Iob
|
||||
// invio
|
||||
sendDataBlock(urlType.FLog, listaValori);
|
||||
// svuoto!
|
||||
QueueFLog = new DataQueue(IOBConfFull.General.CodIOB, "QueueFLog", IOBConfFull.General.EnabRedisQue);
|
||||
//QueueFLog = new ConcurrentQueue<string>();
|
||||
QueueFLog = new DataQueue(IOBConfFull.General.FilenameIOB, "QueueFLog", IOBConfFull.General.EnabRedisQue, redisMan);
|
||||
}
|
||||
}
|
||||
// HO FINITO invio di FLog...
|
||||
@@ -3357,7 +3355,7 @@ namespace IOB_WIN_FORM.Iob
|
||||
// invio
|
||||
sendDataBlock(urlType.ULog, listaValori);
|
||||
// svuoto!
|
||||
QueueULog = new DataQueue(IOBConfFull.General.CodIOB, "QueueULog", IOBConfFull.General.EnabRedisQue);
|
||||
QueueULog = new DataQueue(IOBConfFull.General.FilenameIOB, "QueueULog", false, redisMan);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3420,8 +3418,7 @@ namespace IOB_WIN_FORM.Iob
|
||||
// invio
|
||||
sendDataBlock(urlType.SignIN, listaValori);
|
||||
// svuoto!
|
||||
QueueIN = new DataQueue(IOBConfFull.General.CodIOB, "QueueIN", IOBConfFull.General.EnabRedisQue);
|
||||
//QueueIN = new ConcurrentQueue<string>();
|
||||
QueueIN = new DataQueue(IOBConfFull.General.FilenameIOB, "QueueIN", IOBConfFull.General.EnabRedisQue, redisMan);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace IOB_WIN_FORM.Iob
|
||||
bInOn = IOBConfFull.Special.PingConf.B_PowerOn;
|
||||
vetoCheckSec = IOBConfFull.Special.PingConf.VetoCheckSec;
|
||||
// fix coda ping
|
||||
PingQueue = new DataQueue("000", "PingQueue", false);
|
||||
PingQueue = new DataQueue(IOBConfFull.General.FilenameIOB, "PingQueue", false, redisMan);
|
||||
lgDebug($"L'adapter effettuera' PING di controllo all'indirizzo {IOBConfFull.Device.Connect.IpAddr} per forzare stato poweroff dopo {PoweroffTimeoutSec} sec");
|
||||
}
|
||||
|
||||
@@ -210,16 +210,6 @@ namespace IOB_WIN_FORM.Iob
|
||||
|
||||
#region Protected Fields
|
||||
|
||||
/// <summary>
|
||||
/// Dimensione coda di ping x valutazione
|
||||
/// </summary>
|
||||
protected int maxQueuePing = 11;
|
||||
|
||||
/// <summary>
|
||||
/// Coda degli esiti di ping x calcolo stato macchina
|
||||
/// </summary>
|
||||
protected DataQueue PingQueue = new DataQueue("000", "PingQueue", false);
|
||||
|
||||
protected int PoweroffTimeoutSec = 100;
|
||||
|
||||
/// <summary>
|
||||
@@ -238,7 +228,7 @@ namespace IOB_WIN_FORM.Iob
|
||||
if (B_input == 0 && pingOk)
|
||||
{
|
||||
B_input = 1;
|
||||
PingQueue = new DataQueue("000", "PingQueue", false);
|
||||
PingQueue = new DataQueue(IOBConfFull.General.FilenameIOB, "PingQueue", false, redisMan);
|
||||
lgTrace($"PingQueue resetted on addTest");
|
||||
}
|
||||
PingQueue.Enqueue($"{score}");
|
||||
|
||||
@@ -35,6 +35,8 @@ namespace IOB_WIN_SHELLY.Iob
|
||||
public ShellyClient(AdapterFormNext caller, IobConfTree IobConfFull) : base(caller, IobConfFull)
|
||||
{
|
||||
lgInfo("Init Iob.ShellyClient");
|
||||
// imposto ping a 3
|
||||
maxQueuePing = 3;
|
||||
// imposto
|
||||
B_input = 0;
|
||||
// init datetime counters
|
||||
@@ -55,8 +57,6 @@ namespace IOB_WIN_SHELLY.Iob
|
||||
{
|
||||
int.TryParse(POWEROFF_TIMEOUT_SEC, out PoweroffTimeoutSec);
|
||||
}
|
||||
// fix coda ping
|
||||
PingQueue = new DataQueue("000", "PingQueue", false);
|
||||
|
||||
var devData = IobConfFull.Device.Connect;
|
||||
Shelly1PmOptions options = new Shelly1PmOptions()
|
||||
@@ -97,7 +97,7 @@ namespace IOB_WIN_SHELLY.Iob
|
||||
switch (item.Value.memAddr)
|
||||
{
|
||||
case "ActEnergy":
|
||||
outValDbl=lastShellyResp.Value.ActEnergy.Total;
|
||||
outValDbl = lastShellyResp.Value.ActEnergy.Total;
|
||||
//outVal = lastShellyResp.Value.ActEnergy.Total.ToString("F3", CultureInfo.InvariantCulture);
|
||||
break;
|
||||
|
||||
@@ -229,16 +229,6 @@ namespace IOB_WIN_SHELLY.Iob
|
||||
/// </summary>
|
||||
private ShellyResult<EgwProxy.Shelly.DTO.Shelly1PM.SwitchDto> lastShellyResp;
|
||||
|
||||
/// <summary>
|
||||
/// Dimensione coda di ping x valutazione
|
||||
/// </summary>
|
||||
private int maxQueuePing = 3;
|
||||
|
||||
/// <summary>
|
||||
/// Coda degli esiti di ping x calcolo stato macchina
|
||||
/// </summary>
|
||||
private DataQueue PingQueue = new DataQueue("000", "PingQueue", false);
|
||||
|
||||
private int PoweroffTimeoutSec = 100;
|
||||
|
||||
/// <summary>
|
||||
@@ -267,7 +257,7 @@ namespace IOB_WIN_SHELLY.Iob
|
||||
if (B_input == 0 && pingOk)
|
||||
{
|
||||
B_input = 1;
|
||||
PingQueue = new DataQueue("000", "PingQueue", false);
|
||||
PingQueue = new DataQueue(IOBConfFull.General.FilenameIOB, "PingQueue", false, redisMan);
|
||||
lgTrace($"PingQueue resetted on addTest");
|
||||
}
|
||||
PingQueue.Enqueue($"{score}");
|
||||
|
||||
Reference in New Issue
Block a user