Speed optimalisation and fixed the damn thing!

This commit is contained in:
jancoow
2014-10-20 21:01:45 +02:00
parent 38e5715cd6
commit 7cdb4b6fe2
16 changed files with 99 additions and 70 deletions
+7 -3
View File
@@ -1,3 +1,4 @@
package weerstation;
import java.util.ArrayList;
public class CloudHeight extends Grootheid{
@@ -7,20 +8,23 @@ public class CloudHeight extends Grootheid{
public CloudHeight(Measurement measurement1, ArrayList<Measurement> measurement2){
list = new ArrayList<Double>();
updateRecent(measurement1);
update24Hour(measurement2);
updatePeriod(measurement2);
}
public void updateRecent(Measurement measurement1){
setCurrent(measurement1.getCloudHeight());
}
public void update24Hour(ArrayList<Measurement> measurement2){
public void updatePeriod(ArrayList<Measurement> measurement2){
createList(measurement2);
calculateMaxMinAvg(list);
calculateMaxMin(list);
setAvg(StatisticsCalculator.avg(list));
}
public void display(){
super.display();
GUIboard.clearLeft();
GUIboard.clearRight();
GUIboard.writePageToMatrix("Wolkhoogte", "Gemiddelde: " + getAvg(), "");
}