"Some" improvements
This commit is contained in:
+11
-20
@@ -1,34 +1,21 @@
|
||||
|
||||
package weerstation1;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class AvgWindSpeed extends Grootheid{
|
||||
public ArrayList<Double> list;
|
||||
|
||||
//constructor
|
||||
//constructor
|
||||
public AvgWindSpeed(Measurement measurement1, ArrayList<Measurement> measurement2){
|
||||
list = new ArrayList<Double>();
|
||||
updateRecent(measurement1);
|
||||
setName("Gem. Windsnelheid");
|
||||
updateRecent(measurement1);
|
||||
updatePeriod(measurement2);
|
||||
}
|
||||
|
||||
|
||||
public void updateRecent(Measurement measurement1){
|
||||
setCurrent(measurement1.getAvgWindSpeed());
|
||||
}
|
||||
public void updatePeriod(ArrayList<Measurement> measurement2){
|
||||
createList(measurement2);
|
||||
calculateMaxMin(list);
|
||||
setDeviation(StatisticsCalculator.afwijking(list));
|
||||
}
|
||||
|
||||
public void display(){
|
||||
super.display();
|
||||
GUIboard.writePageToMatrix("Gem. Windsnelheid", "Afwijking: " + getDeviation(), "");
|
||||
}
|
||||
|
||||
public void displayGraph()
|
||||
{
|
||||
GUIboard.writeGraphToMatrix(list, getMin(), getMax());
|
||||
maxMin();
|
||||
afwijking();
|
||||
}
|
||||
|
||||
private void createList(ArrayList<Measurement> measurement2)
|
||||
@@ -40,7 +27,11 @@ public class AvgWindSpeed extends Grootheid{
|
||||
|
||||
for(Measurement ms : measurement2)
|
||||
{
|
||||
list.add(ms.getAvgWindSpeed());
|
||||
list.add((double)ms.getRawAvgWindSpeed());
|
||||
}
|
||||
}
|
||||
|
||||
public double calculate(double value){
|
||||
return Calculator.windSnelheid((short)value);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user