"Some" improvements
This commit is contained in:
+10
-18
@@ -1,34 +1,22 @@
|
||||
|
||||
package weerstation1;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class InsideHum extends Grootheid{
|
||||
public ArrayList<Double> list;
|
||||
|
||||
//constructor
|
||||
public InsideHum(Measurement measurement1, ArrayList<Measurement> measurement2){
|
||||
list = new ArrayList<Double>();
|
||||
updateRecent(measurement1);
|
||||
setName("Luchtv. Binnen");
|
||||
updateRecent(measurement1);
|
||||
updatePeriod(measurement2);
|
||||
}
|
||||
|
||||
|
||||
public void updateRecent(Measurement measurement1){
|
||||
setCurrent(measurement1.getInsideHum());
|
||||
}
|
||||
public void updatePeriod(ArrayList<Measurement> measurement2){
|
||||
createList(measurement2);
|
||||
calculateMaxMin(list);
|
||||
setAvg(StatisticsCalculator.avg(list));
|
||||
}
|
||||
|
||||
public void display(){
|
||||
super.display();
|
||||
GUIboard.writePageToMatrix("Luchtv. Binnen", "Gemiddelde: " + getAvg(), "");
|
||||
}
|
||||
|
||||
public void displayGraph()
|
||||
{
|
||||
GUIboard.writeGraphToMatrix(list, getMin(), getMax());
|
||||
maxMin();
|
||||
avg();
|
||||
}
|
||||
|
||||
private void createList(ArrayList<Measurement> measurement2)
|
||||
@@ -40,7 +28,11 @@ public class InsideHum extends Grootheid{
|
||||
|
||||
for(Measurement ms : measurement2)
|
||||
{
|
||||
list.add(ms.getInsideHum());
|
||||
list.add((double)ms.getRawInsideHum());
|
||||
}
|
||||
}
|
||||
|
||||
public double calculate(double value){
|
||||
return Calculator.luchtVochtigheid((short)value);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user