"Some" improvements
This commit is contained in:
+6
-22
@@ -1,36 +1,20 @@
|
||||
|
||||
package weerstation1;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class CloudHeight extends Grootheid{
|
||||
public ArrayList<Double> list;
|
||||
|
||||
//constructor
|
||||
//constructor
|
||||
public CloudHeight(Measurement measurement1, ArrayList<Measurement> measurement2){
|
||||
list = new ArrayList<Double>();
|
||||
updateRecent(measurement1);
|
||||
setName("Wolkhoogte");
|
||||
updateRecent(measurement1);
|
||||
updatePeriod(measurement2);
|
||||
}
|
||||
|
||||
|
||||
public void updateRecent(Measurement measurement1){
|
||||
setCurrent(measurement1.getCloudHeight());
|
||||
}
|
||||
public void updatePeriod(ArrayList<Measurement> measurement2){
|
||||
createList(measurement2);
|
||||
calculateMaxMin(list);
|
||||
setAvg(StatisticsCalculator.avg(list));
|
||||
}
|
||||
|
||||
public void display(){
|
||||
super.display();
|
||||
GUIboard.clearLeft();
|
||||
GUIboard.clearRight();
|
||||
GUIboard.writePageToMatrix("Wolkhoogte", "Gemiddelde: " + getAvg(), "");
|
||||
}
|
||||
|
||||
public void displayGraph()
|
||||
{
|
||||
GUIboard.writeGraphToMatrix(list, getMin(), getMax());
|
||||
modus();
|
||||
}
|
||||
|
||||
private void createList(ArrayList<Measurement> measurement2)
|
||||
@@ -42,7 +26,7 @@ public class CloudHeight extends Grootheid{
|
||||
|
||||
for(Measurement ms : measurement2)
|
||||
{
|
||||
list.add(ms.getCloudHeight());
|
||||
list.add((double)ms.getCloudHeight());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user