X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;ds=inline;f=loop.pl;h=2e9549120f84faee71707dd079360d97d9bd9e59;hb=1b7ccfa8837f5ec3fb2c43741b85fa4658c7b1b9;hp=4046ca9b95b42dd95f00a8313a4fc588b433563b;hpb=104d1371435741ced5e3fe8f78f352865505133c;p=dweather.git diff --git a/loop.pl b/loop.pl index 4046ca9..2e95491 100755 --- a/loop.pl +++ b/loop.pl @@ -145,6 +145,8 @@ dbg '***'; dbg "*** starting $0"; dbg '***'; +read_ld(); + our $dlog = SMGLog->new("day"); dbg "before next tick"; Mojo::IOLoop->next_tick(sub { loop() }); @@ -168,8 +170,6 @@ exit 0; sub loop { - read_ld(); - dbg "last_min: " . scalar gmtime($ld->{last_min}); dbg "last_hour: " . scalar gmtime($ld->{last_hour}); @@ -419,6 +419,7 @@ sub process @{$ld->{wind_hour}} = (); @{$ld->{wind_min}} = (); + output_str($s, 1) if $s; write_ld(); } elsif ($ts >= $ld->{last_min} + 60) { @@ -446,6 +447,7 @@ sub process $ld->{last_min} = int($ts/60)*60; @{$ld->{wind_min}} = (); + output_str($s, 1) if $s; write_ld(); } else { @@ -456,8 +458,8 @@ sub process else { dbg "loop rec not changed" if isdbg 'chan'; } + output_str($s, 0) if $s; } - output_str($s) if $s; $ld->{last_h} = \%h; ++$loop_count; } else { @@ -482,9 +484,11 @@ sub genstr sub output_str { my $s = shift; + my $logit = shift; + dbg $s; # say $s; - $dlog->writenow($s); + $dlog->writenow($s) if $logit; foreach my $ws (keys $WS) { my $tx = $WS->{$ws}; if ($tx) { @@ -681,21 +685,34 @@ __DATA__ % my $url = url_for 'weather'; - DWeather + + DWeather + + + + + + + + + + + -

DWeather

+

High View Weather

+ +
+


- +
Time: Sunrise: @@ -761,5 +785,13 @@ __DATA__ Month: Year:
+
+
+
+
+ + + +