Speed optimalisation and fixed the damn thing!
This commit is contained in:
+6
-4
@@ -1,3 +1,4 @@
|
||||
package weerstation;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class AvgWindSpeed extends Grootheid{
|
||||
@@ -7,21 +8,22 @@ public class AvgWindSpeed extends Grootheid{
|
||||
public AvgWindSpeed(Measurement measurement1, ArrayList<Measurement> measurement2){
|
||||
list = new ArrayList<Double>();
|
||||
updateRecent(measurement1);
|
||||
update24Hour(measurement2);
|
||||
updatePeriod(measurement2);
|
||||
}
|
||||
|
||||
|
||||
public void updateRecent(Measurement measurement1){
|
||||
setCurrent(measurement1.getAvgWindSpeed());
|
||||
}
|
||||
public void update24Hour(ArrayList<Measurement> measurement2){
|
||||
public void updatePeriod(ArrayList<Measurement> measurement2){
|
||||
createList(measurement2);
|
||||
calculateMaxMinAvg(list);
|
||||
calculateMaxMin(list);
|
||||
setDeviation(StatisticsCalculator.afwijking(list));
|
||||
}
|
||||
|
||||
public void display(){
|
||||
super.display();
|
||||
GUIboard.writePageToMatrix("Gem. Windsnelheid", "Gemiddelde: " + getAvg(), "");
|
||||
GUIboard.writePageToMatrix("Gem. Windsnelheid", "Afwijking: " + getDeviation(), "");
|
||||
}
|
||||
|
||||
public void displayGraph()
|
||||
|
||||
Reference in New Issue
Block a user