Seqhour, get values for 24h

Moderator: Mattk

Post Reply
Armond
Fresh Boarder
Fresh Boarder
Posts: 19
Joined: Mon Dec 14, 2015 5:43 pm

Seqhour, get values for 24h

Post by Armond » Fri Jan 19, 2018 1:26 pm

I want to have the total rain for the last 24h, that means 24 values. But how do I continue after the letter z?

[seqhour1_rain0_total_mm#AE], [seqhour1_rain0_total_mm#FJ], [seqhour1_rain0_total_mm#KO], [seqhour1_rain0_total_mm#PT][seqhour1_rain0_total_mm#UY], ????????

seqhour1_rain0_total_mm: 0.00_0.00_0.00_0.00_0.33_0.30_0.69_0.00_0.0
ABCDEFGHIJKLMNOPQRSTUVWXYZ????????????????

User avatar
wvdkuil
Platinum Boarder
Platinum Boarder
Posts: 334
Joined: Sun Jul 24, 2011 8:00 pm
Location: Belgium
Contact:

Re: Seqhour, get values for 24h

Post by wvdkuil » Fri Jan 19, 2018 2:16 pm

Armond wrote:
Fri Jan 19, 2018 1:26 pm
I want to have the total rain for the last 24h, that means 24 values. But how do I continue after the letter z?

[seqhour1_rain0_total_mm#AE], [seqhour1_rain0_total_mm#FJ], [seqhour1_rain0_total_mm#KO], [seqhour1_rain0_total_mm#PT][seqhour1_rain0_total_mm#UY], ????????

seqhour1_rain0_total_mm: 0.00_0.00_0.00_0.00_0.33_0.30_0.69_0.00_0.0
ABCDEFGHIJKLMNOPQRSTUVWXYZ????????????????
You can't do it that way as the numbers can be different length and there are not always at least 24 values

Code: Select all

0.00 0.00 0.00 0.00 0.33 0.30 0.69 0.00 0.0     or
0.00 99.10 0.00 11.00 0.33 
The seq variables are an array and should be used in PHP with an

Code: Select all

$array = explode (' ',$uploaded-value);
Then you can address the values individually with

Code: Select all

        for ($n=0;$n <= 23; $n++)      // first - 23 hours array
             {  if (isset ($arr_rain[$n]) ) 
                     {  $countRain = $countRain + 1.0*$arr_rain[$n]; }}
You have to check if the hour-value exists as after a restart it takes 24+1 hour to fully populate the 24 entries you need.

Wim

Armond
Fresh Boarder
Fresh Boarder
Posts: 19
Joined: Mon Dec 14, 2015 5:43 pm

Re: Seqhour, get values for 24h

Post by Armond » Mon Jan 22, 2018 11:49 am

Thanks for the answer. I use asp.

Post Reply