;

PDA

Click to See Complete Forum and Search --> : Weather project


hansverst
12-20-2006, 09:32 AM
Hello,
i try to make a nice online weather report for my weatherstation min, max, and normall temperature, just like the picture below.
So what i like to do is, add a value for the normall temperature for this day (let's say 4,5c) this is value that will not change till the next day, and in the color box the current temperature, so when the ActionScript is get a value from my station, the color is going up or down. (update every 5 min)
I think this is posable in KoolMoves, but don't know where to start.
Hope some one can help me.
Thank you.
Gr Hans

blanius
12-20-2006, 10:49 AM
If the data is retrievable I'm sure it can be done in KM.

What format is the data in? How are you getting the data.

hansverst
12-20-2006, 11:20 AM
Hi Blanius,
the data is text/plain the values are true values, like 10,1 for 10,1 celecius
and for rain, 0,7mm etc
So i use special weather software (that updates the weather station and get the current data) and that software make a text file report.ws from all data like wind, rain, sun, temp, etc.
Gr Hans

This is how it looks.

--------------------- sorry in dutch only

Weergegevens - Report: 2 m boven zeeniveau
woensdag 20 december 2006 - 16:27

Temperatuur Buiten 1.25cm
huidig 4,2 °C
Gemiddelde 0,7 °C
min. -1,8 °C 03:47
max. 4,2 °C 16:07

Temperatuur Buiten 0.20cm
huidig 4,4 °C
Gemiddelde 1,1 °C
min. -1,4 °C 03:42
max. 4,4 °C 16:27

UV X
huidig 0,0 UV-I
Gemiddelde 0,0 UV-I
min. 0,0 UV-I 23:12
max. 0,3 UV-I 11:02

Vochtigheid Buiten
huidig 95 %
Gemiddelde 93 %
min. 91 % 23:12
max. 95 % 11:42

Windsnelheid
huidig 2,9 km/h
Gemiddelde 0,2 km/h
max. 3,5 km/h - W-ZW 16:17

Neerslag
laatste uur 0,0 mm
huidige dag 0,0 mm
laatste 24 uur 0,0 mm
huidige week 0,0 mm
huidige maand 0,7 mm
huidig jaar 0,7 mm
Regen / Jaar 1 dagen

Luchtdruk
huidig 1038,8 hPa
Gemiddelde 1038,1 hPa
min. 1036,3 hPa 13:12
max. 1039,2 hPa 10:52

Weersvoorspelling: zonnig

--------

i think to get the data is not that hard, but to change the graphics if the value is change.
I think there have to be a min and a max default value. For rain it would be like 0,0 mm for min and max like 20 mm (that would be 100%) and if the data shows 1,7mm the graphic must go up from 0% to X%

blanius
12-20-2006, 01:20 PM
those commas are a problem..... Flash doesn't see 1,2 as a number..... So you'll have to deal with that..

Ok here's a start

blanius
12-20-2006, 01:22 PM
Basically I used onData then replaced all the , with . and then serached looking for min. and max. then grab the temp after those and scaled a movieclip using the tempurature

hansverst
12-20-2006, 01:47 PM
Well this look nice, i think i can with your code make a good working weather control for my webpage.
I will let it know if it's done, or not :)
Thanks for all the help!
Gr Hans

hansverst
12-22-2006, 11:53 AM
hi blanius,
i did make a good working temp meter. (thanks again for that)
But only one question, now i want to update the data every time a vistor is loading the temp meter.

I try the next code but is still not working proper.

'int' is the time in sec for a new update equally to the real update from the weatherstation.
After that the fun file have to update data every 5 min (equally to the real update from the weatherstation.)
The first time the fun file is loaded, it have to update directly, so the last update from the weatherstation is showing


weatherdat= function (){

_root.loadVariables("http://82.134.247.103/cgi-bin/weer/get.pl", "POST");

temp = searchandreplace(temp,",",".");
p=((Number(temp)+0)/maxTemp)*100
tmpbar._yscale=p
txt1.text=temp+"°C";

setInterval(weatherdat, int);
}
weatherdat(int=1000);


I know i ask a lot, but realy try to learn
Gr, Hans

blanius
12-22-2006, 01:55 PM
don't think thats the right way to use set interval

try this
weatherdat= function (){

_root.loadVariables("http://82.134.247.103/cgi-bin/weer/get.pl", "POST");

temp = searchandreplace(temp,",",".");
p=((Number(temp)+0)/maxTemp)*100
tmpbar._yscale=p
txt1.text=temp+"°C";

}
int=1000

setInterval(weatherdat, int);