Aggiunta gestione LastTCicloNetto ( denom. % tempo cerchio)
This commit is contained in:
@@ -17,6 +17,7 @@ namespace Thermo.Active.Model.DTOModels.ThProd
|
||||
public string NomeRicetta { get; set; } = "";
|
||||
public double LastCadenza { get; set; } = 0;
|
||||
public double LastTCiclo { get; set; } = 0;
|
||||
public double LastTCicloNetto { get; set; } = 0;
|
||||
public Dictionary<int, double> TS_Cadenza { get; set; } = new Dictionary<int, double>();
|
||||
public Dictionary<int, double> TS_TCiclo { get; set; } = new Dictionary<int, double>();
|
||||
|
||||
@@ -45,6 +46,8 @@ namespace Thermo.Active.Model.DTOModels.ThProd
|
||||
return false;
|
||||
if (Math.Round(Math.Abs(LastTCiclo - item.LastTCiclo), 1) >= Constants.EPSILON)
|
||||
return false;
|
||||
if (Math.Round(Math.Abs(LastTCicloNetto - item.LastTCicloNetto), 1) >= Constants.EPSILON)
|
||||
return false;
|
||||
if (!Enumerable.SequenceEqual(TS_Cadenza, item.TS_Cadenza))
|
||||
return false;
|
||||
if (!Enumerable.SequenceEqual(TS_TCiclo, item.TS_TCiclo))
|
||||
|
||||
@@ -48,10 +48,14 @@ namespace Thermo.Active.NC
|
||||
/// </summary>
|
||||
protected DateTime lastProdEnd;
|
||||
/// <summary>
|
||||
/// Ultimo ciclo registrato(secondi)
|
||||
/// Ultimo ciclo registrato (secondi)
|
||||
/// </summary>
|
||||
protected double lastCycle = 9999;
|
||||
/// <summary>
|
||||
/// Ultimo ciclo NETTO registrato (secondi)
|
||||
/// </summary>
|
||||
protected double lastCycleNet = 9999;
|
||||
/// <summary>
|
||||
/// Indica che per i dati del prodPanel è necessario rileggere il DB (modificato)
|
||||
/// </summary>
|
||||
protected static bool forceProdPanelDbReload = false;
|
||||
@@ -1579,22 +1583,31 @@ namespace Thermo.Active.NC
|
||||
{
|
||||
currentProdPanel.LastCadenza = Math.Round((double)3600000 / lastProdInfoData.TimeCycleGross, 2);
|
||||
}
|
||||
// 2020.10.19 aggiungo TCicloNetto
|
||||
currentProdPanel.LastTCicloNetto = Math.Round((double)lastProdInfoData.TimeCycleNet / 1000, 2);
|
||||
|
||||
// se NON HO un last value...
|
||||
if (lastCycle == 0)
|
||||
{
|
||||
lastCycle = currentProdPanel.LastTCiclo;
|
||||
lastCycleNet = currentProdPanel.LastTCicloNetto;
|
||||
}
|
||||
// se il valore SALVATO è > 3 * valore rilevato --> uso SOLO ultimo
|
||||
else if (lastCycle > 3 * currentProdPanel.LastTCiclo)
|
||||
{
|
||||
lastCycle = currentProdPanel.LastTCiclo;
|
||||
lastCycleNet = currentProdPanel.LastTCicloNetto;
|
||||
}
|
||||
// altrimenti EWMA da parametro calcolato standard, default 50%
|
||||
else
|
||||
{
|
||||
//lastCycle = 0.5 * lastCycle + 0.5 * lastDuration;
|
||||
lastCycle = ewmaLambda * currentProdPanel.LastTCiclo + (1 - ewmaLambda) * lastCycle;
|
||||
lastCycleNet = ewmaLambda * currentProdPanel.LastTCicloNetto + (1 - ewmaLambda) * lastCycleNet;
|
||||
// sistemo ponderato il ciclo netto rilevato
|
||||
currentProdPanel.LastTCicloNetto = lastCycleNet;
|
||||
}
|
||||
|
||||
// salvo anche nei live data della ricetta...
|
||||
RecipeLiveData.TC_last = lastCycle;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user