Tom Remeeus hace 11 años
padre
commit
e7164b82b9
Se han modificado 3 ficheros con 79 adiciones y 0 borrados
  1. 34 0
      Calculator.ctxt
  2. 1 0
      Weerstation.java
  3. 44 0
      Zonsterkte.java

+ 34 - 0
Calculator.ctxt

@@ -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 - 0
Weerstation.java

@@ -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 - 0
Zonsterkte.java

@@ -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());
+        }
+    }
+}