Fixed wrong calculations

This commit is contained in:
Kenneth van Ewijk
2014-10-22 16:40:23 +02:00
parent 7f1f9d3373
commit 52c1a1e62d
+18 -2
View File
@@ -219,11 +219,27 @@ public class StatisticsCalculator {
public static short maximaleRegenPeriode(ArrayList<Short> array) public static short maximaleRegenPeriode(ArrayList<Short> array)
{ {
short regen = 0;
ArrayList<Short> regenPerUur = new ArrayList<Short>();
for(int i=0; i<array.size();i++)
{
if(i%60==0)
{
regen /= 60;
regenPerUur.add(regen);
regen = 0;
}
regen += array.get(i);
}
short totaleRegen = 0; short totaleRegen = 0;
for(short db : array) for(short sh : regenPerUur)
{ {
totaleRegen += db; totaleRegen += sh;
} }
return totaleRegen; return totaleRegen;