Fixed the fucked up shit
This commit is contained in:
+14
-8
@@ -4,10 +4,13 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
import java.util.Calendar;
|
||||
|
||||
public class Weerstation {
|
||||
WeerstationConnector weerstation1;
|
||||
Calendar now;
|
||||
Measurement meting1;
|
||||
Periode periodeDag;
|
||||
ArrayList<Measurement> meting2;
|
||||
Timer starter;
|
||||
int currentScreen;
|
||||
@@ -17,13 +20,16 @@ public class Weerstation {
|
||||
|
||||
public Weerstation(){
|
||||
weerstation1 = new WeerstationConnector();
|
||||
now = Calendar.getInstance();
|
||||
|
||||
periodeDag = new Periode(Calendar.YEAR,Calendar.MONTH,Calendar.DAY_OF_MONTH,Calendar.YEAR,Calendar.MONTH,Calendar.DAY_OF_MONTH);
|
||||
|
||||
GUIboard.init();
|
||||
starter = new Timer();
|
||||
startAnimatie();
|
||||
|
||||
meting1 = weerstation1.getMostRecentMeasurement();
|
||||
meting2 = weerstation1.getAllMeasurementsLast24h();
|
||||
meting2 = weerstation1.getAllMeasurementsBetween(periodeDag.getBeginPeriode(), periodeDag.getEindePeriode());
|
||||
|
||||
stopAnimatie();
|
||||
while(startup)
|
||||
@@ -46,14 +52,12 @@ public class Weerstation {
|
||||
|
||||
//All the different screen classes
|
||||
|
||||
final List<Grootheid> lstScreens = new ArrayList<Grootheid>();
|
||||
|
||||
final List<Grootheid> lstScreens = new ArrayList<Grootheid>();
|
||||
lstScreens.add(new WindDirection(meting1, meting2));
|
||||
lstScreens.add(new OutsideTemp(meting1, meting2));
|
||||
lstScreens.add(new WindChill(meting1, meting2));
|
||||
lstScreens.add(new HeatIndex(meting1, meting2));
|
||||
lstScreens.add(new OutsideHum(meting1, meting2));
|
||||
lstScreens.add(new Barometer(meting1, meting2));
|
||||
lstScreens.add(new Voorspellingen(meting1));
|
||||
lstScreens.add(new AvgWindSpeed(meting1, meting2));
|
||||
lstScreens.add(new RainRate(meting1, meting2));
|
||||
lstScreens.add(new InsideTemp(meting1, meting2));
|
||||
@@ -62,6 +66,7 @@ public class Weerstation {
|
||||
lstScreens.add(new UVLevel(meting1, meting2));
|
||||
lstScreens.add(new Zonsterkte(meting1, meting2));
|
||||
lstScreens.add(new DewPoint(meting1, meting2));
|
||||
lstScreens.add(new Sun(meting1));
|
||||
|
||||
|
||||
|
||||
@@ -93,7 +98,7 @@ public class Weerstation {
|
||||
|
||||
meting1 = weerstation1.getMostRecentMeasurement();
|
||||
for(Grootheid obj : lstScreens){
|
||||
obj.updateRecent(meting1);
|
||||
obj.updateRecent(meting1);
|
||||
}
|
||||
}
|
||||
}, 60*1000, 60*1000);
|
||||
@@ -162,10 +167,11 @@ public class Weerstation {
|
||||
|
||||
GUIboard.clearBottom();
|
||||
|
||||
for(int i=0; i<128;i++)
|
||||
for(int i=1; i<128;i+=2)
|
||||
{
|
||||
for(int n=0; n<32;n++)
|
||||
{
|
||||
IO.writeShort(0x42, 1 << 12 | i-1 << 5 | n);
|
||||
IO.writeShort(0x42, 1 << 12 | i << 5 | n);
|
||||
IO.delay(1);
|
||||
}
|
||||
@@ -173,7 +179,7 @@ public class Weerstation {
|
||||
|
||||
startup = false;
|
||||
}
|
||||
}, 0, 64*2);
|
||||
}, 0, 128*32);
|
||||
}
|
||||
|
||||
public void stopAnimatie()
|
||||
|
||||
Reference in New Issue
Block a user