DewPoint Toegevoegt
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class DewPoint extends Grootheid
|
||||
{
|
||||
public ArrayList<Double> list;
|
||||
|
||||
//constructor
|
||||
public DewPoint(Measurement measurement1, ArrayList<Measurement> measurement2){
|
||||
list = new ArrayList<Double>();
|
||||
updateRecent(measurement1);
|
||||
update24Hour(measurement2);
|
||||
}
|
||||
|
||||
|
||||
public void updateRecent(Measurement measurement1){
|
||||
setCurrent(measurement1.getDewPoint());
|
||||
}
|
||||
public void update24Hour(ArrayList<Measurement> measurement2){
|
||||
createList(measurement2);
|
||||
calculateMaxMinAvg(list);
|
||||
}
|
||||
|
||||
public void display(){
|
||||
GUIboard.writeUpperDigits(current);
|
||||
GUIboard.writePageToMatrix("Douwpunt", "Gemiddelde: " + getAvg(), "");
|
||||
}
|
||||
|
||||
public void displayGraph()
|
||||
{
|
||||
GUIboard.writeGraphToMatrix(list, getMin(), getMax());
|
||||
}
|
||||
|
||||
private void createList(ArrayList<Measurement> measurement2)
|
||||
{
|
||||
if(!list.isEmpty())
|
||||
{
|
||||
list.clear();
|
||||
}
|
||||
|
||||
for(Measurement ms : measurement2)
|
||||
{
|
||||
list.add(ms.getDewPoint());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user