Zonsterkte

This commit is contained in:
Tom Remeeus
2014-10-13 20:56:17 +02:00
parent 6a65ed5359
commit e7164b82b9
3 changed files with 79 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
#BlueJ class context
comment0.params=mval
comment0.target=double\ luchtdruk(short)
comment1.params=mval
comment1.target=double\ temperatuur(short)
comment10.params=sunRaw
comment10.target=java.lang.String\ sun(short)
comment11.params=mval
comment11.target=double\ solarRad(short)
comment12.params=grdnFh\ mph
comment12.target=double\ windChill(short,\ short)
comment13.params=RH\ T
comment13.target=double\ heatIndex(double,\ double)
comment14.params=omgevingsTemp\ luchtVochtigheid
comment14.target=double\ dewPoint(double,\ short)
comment15.params=temp\ luchtVochtigheid
comment15.target=double\ cloudHeight(double,\ short)
comment2.params=mval
comment2.target=double\ luchtVochtigheid(short)
comment3.params=mval
comment3.target=double\ windSnelheid(short)
comment4.params=mval
comment4.target=java.lang.String\ windRichting(short)
comment5.params=mval
comment5.target=double\ regenmeter(short)
comment6.params=mval
comment6.target=double\ uvIndex(short)
comment7.params=mval
comment7.target=double\ batterySpanning(short)
comment8.params=mval
comment8.target=java.lang.String\ sunRise(short)
comment9.params=mval
comment9.target=java.lang.String\ sunSet(short)
numComments=16
+1
View File
@@ -36,6 +36,7 @@ public class Weerstation {
lstScreens.add(new InsideHum(meting1, meting2));
lstScreens.add(new CloudHeight(meting1, meting2));
lstScreens.add(new UVLevel(meting1, meting2));
lstScreens.add(new Zonsterkte(meting1, meting2));
lstScreens.add(new DewPoint(meting1, meting2));
+44
View File
@@ -0,0 +1,44 @@
import java.util.ArrayList;
public class Zonsterkte extends Grootheid{
public ArrayList<Double> list;
//constructor
public Zonsterkte(Measurement measurement1, ArrayList<Measurement> measurement2){
list = new ArrayList<Double>();
updateRecent(measurement1);
update24Hour(measurement2);
}
public void updateRecent(Measurement measurement1){
setCurrent(measurement1.getSolarRad());
}
public void update24Hour(ArrayList<Measurement> measurement2){
createList(measurement2);
calculateMaxMinAvg(list);
}
public void display(){
super.display();
GUIboard.writePageToMatrix("Zonsterkte", "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.getSolarRad());
}
}
}