fix max wind
authorDirk Koopman <djk@tobit.co.uk>
Thu, 29 Sep 2016 23:03:38 +0000 (00:03 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Thu, 29 Sep 2016 23:03:38 +0000 (00:03 +0100)
loop.pl
templates/index.html.ep

diff --git a/loop.pl b/loop.pl
index d5f69a5a4cb5230a6346781e1c040f92f450d61d..86a0935904817a080119301a0869525c527e3601 100755 (executable)
--- a/loop.pl
+++ b/loop.pl
@@ -425,7 +425,8 @@ sub process
                my $cycledata;
                
                if ($dayno > $ld->{last_day}) {
-                       $ld->{Temp_Out_Max} = $ld->{Temp_Out_Min} = $ld->{Wind_Max} = $temp;
+                       $ld->{Wind_Max} = $wind->{w};
+                       $ld->{Temp_Out_Max} = $ld->{Temp_Out_Min} = $temp;
                        $ld->{Temp_Out_Max_T} = $ld->{Temp_Out_Min_T} = $ld->{Wind_Max_T} = clocktime($ts, 0);
                        $ld->{last_day} = $dayno;
                        ++$writeld;
@@ -448,8 +449,6 @@ sub process
                        ++$writeld;
                }
 
-               my $wkph = $wind->{w} * 3.6;
-               $h{WindChill} = nearest(0.1, $wind->{w} >= 1.2 ? 13.12 + 0.6215 * $temp - 11.37 * $wkph ** 0.16 + 0.3965 * $temp * $wkph ** 0.16 : $temp); 
 
                if ($ts >= $ld->{last_hour} + 1800) {
                        $h{Pressure_Trend}    = unpack("C", substr $blk,3,1);
@@ -512,6 +511,9 @@ sub process
                                $h{Wind_1m} = nearest(0.1, $a->{w});
                                $h{Dir_1m} = nearest(1, $a->{d});
                                ($h{Rain_1m}, $h{Rain_1h}, $h{Rain_24h}) = calc_rain($rain);
+
+                               my $wkph = $a->{w} * 3.6;
+                               $h{WindChill} = nearest(0.1, $a->{w} >= 1.2 ? 13.12 + 0.6215 * $temp - 11.37 * $wkph ** 0.16 + 0.3965 * $temp * $wkph ** 0.16 : $temp); 
                        }
                        $ld->{last_rain_min} = $rain;
                        $h{Temp_Out_Max} = $ld->{Temp_Out_Max};
index 1cbb94914967bc115f586934944e9ec2f6e1c852..d7ec7130122470d6106b0a0c27b91002aec9602c 100644 (file)
                        </div>
                </div>
 
-
                <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
                <script src="js/jquery.min.js"></script>
                <!-- Latest compiled and minified JavaScript -->