Fix broker historic manager
This commit is contained in:
@@ -57,20 +57,23 @@ namespace PlantBox.Broker
|
|||||||
if (_minutesHistoric.Count % 12 == 0)
|
if (_minutesHistoric.Count % 12 == 0)
|
||||||
{
|
{
|
||||||
_hoursHistoric.Add(new CaptorsValue(GetAverage(_minutesHistoric.TakeFromEnd(12))));
|
_hoursHistoric.Add(new CaptorsValue(GetAverage(_minutesHistoric.TakeFromEnd(12))));
|
||||||
}
|
|
||||||
if (_hoursHistoric.Count % 24 == 0)
|
if (_hoursHistoric.Count % 24 == 0)
|
||||||
{
|
{
|
||||||
_daysHistoric.Add(new CaptorsValue(GetAverage(_hoursHistoric.TakeFromEnd(24))));
|
_daysHistoric.Add(new CaptorsValue(GetAverage(_hoursHistoric.TakeFromEnd(24))));
|
||||||
}
|
|
||||||
if (_daysHistoric.Count % 7 == 0)
|
if (_daysHistoric.Count % 7 == 0)
|
||||||
{
|
{
|
||||||
_weeksHistoric.Add(new CaptorsValue(GetAverage(_daysHistoric.TakeFromEnd(7))));
|
_weeksHistoric.Add(new CaptorsValue(GetAverage(_daysHistoric.TakeFromEnd(7))));
|
||||||
}
|
|
||||||
if (_daysHistoric.Count % 31 == 0)
|
if (_daysHistoric.Count % 31 == 0)
|
||||||
{
|
{
|
||||||
_monthsHistoric.Add(new CaptorsValue(GetAverage(_daysHistoric.TakeFromEnd(31))));
|
_monthsHistoric.Add(new CaptorsValue(GetAverage(_daysHistoric.TakeFromEnd(31))));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void Clear()
|
public void Clear()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user