|
From: <pf...@us...> - 2015-01-29 23:15:35
|
Revision: 2355
http://sourceforge.net/p/openautomation/code/2355
Author: pfry
Date: 2015-01-29 23:15:32 +0000 (Thu, 29 Jan 2015)
Log Message:
-----------
Bugfix: wenn Logik mit bereits laufendem Delay-Timer als Followup nochmal aufgerufen wird und dann cancel zurueckgibt, wird Delay-Timer nun (korrekt) geloescht; das hat vorher nicht funktioniert
Modified Paths:
--------------
wiregate/plugin/generic/Logikprozessor.pl
Modified: wiregate/plugin/generic/Logikprozessor.pl
===================================================================
--- wiregate/plugin/generic/Logikprozessor.pl 2015-01-27 14:01:34 UTC (rev 2354)
+++ wiregate/plugin/generic/Logikprozessor.pl 2015-01-29 23:15:32 UTC (rev 2355)
@@ -673,6 +673,7 @@
if($logic->{$t}{delay} && defined $plugin_info{$plugname.'__'.$t.'_delay'}) # Laufender Delay?
{
$plugin_info{$plugname.'__'.$t.'_result'}=$prevResult; # altes Resultat wieder aufnehmen
+ $retval.=sprintf("(Logik) -> unveraendert, $prevResult wird in %.0f s gesendet; ", $plugin_info{$plugname.'__'.$t.'_delay'}-time()) if $debug;
}
next;
}
@@ -700,16 +701,8 @@
if($logic->{$t}{delay} && defined $plugin_info{$plugname.'__'.$t.'_delay'})
{
$plugin_info{$plugname.'__'.$t.'_result'}=$prevResult; # altes Resultat wieder aufnehmen
-
- if($result eq 'cancel')
- {
- delete $plugin_info{$plugname.'__'.$t.'_delay'};
- $retval.="(Logik) -> wartender Delay-Timer geloescht; " if $debug;
- }
- else
- {
- $retval.=sprintf("(Logik) -> unveraendert, $prevResult wird in %.0f s gesendet; ", $plugin_info{$plugname.'__'.$t.'_delay'}-time()) if $debug;
- }
+ delete $plugin_info{$plugname.'__'.$t.'_delay'};
+ $retval.="(Logik) -> wartender Delay-Timer geloescht; " if $debug;
}
else
{
@@ -717,7 +710,7 @@
}
# Followup durch andere Logik definiert? Dann in Timer-Liste eintragen
- if($result eq 'cancel' && defined $logic->{$t}{followup})
+ if($logic->{$t}{followup})
{
my $followup=$logic->{$t}{followup};
@@ -849,7 +842,7 @@
set_next_call('timer',$t,$logic->{$t}{timer},$year,$day_of_year,$month,$day_of_month,$calendar_week,$day_of_week_no,
$hour,$minute,$time_of_day,$systemtime,$debug);
}
- elsif($reason eq 'delay' || ($reason eq 'followup' && $plugin_info{$timer}==$scheduled_time)) # kein neus Followup
+ elsif($reason eq 'delay' || ($reason eq 'followup' && $plugin_info{$timer}==$scheduled_time)) # kein neues Followup
{
delete $plugin_info{$timer};
}
@@ -859,7 +852,7 @@
{
my $transmit=groupaddress $logic->{$t}{transmit};
- if($transmit)
+ if($transmit && $result ne 'cancel')
{
$transmit=[$transmit] unless ref $transmit;
@@ -887,26 +880,34 @@
}
# Followup durch andere Logik definiert? Dann in Timer-Liste eintragen
- if(defined $result && defined $logic->{$t}{followup})
+ if($result eq 'cancel')
{
- my $followup=$logic->{$t}{followup};
-
- if($result eq 'cancel')
+ if($logic->{$t}{followup})
{
+ my $followup=$logic->{$t}{followup};
+
for my $q (grep !/^(debug$|_)/, keys %{$followup})
{
plugin_log($plugname, "Followup '$q' storniert.")
- if defined $plugin_info{$plugname.'__'.$q.'_followup'} && ($debug || $logic->{$q}{debug} || $followup->{debug});
-
+ if defined $plugin_info{$plugname.'__'.$q.'_followup'} && ($debug || $logic->{$q}{debug} || $followup->{debug});
delete $plugin_info{$plugname.'__'.$q.'_followup'};
+ $retval.="(Logik) -> wartender Followup-Timer geloescht; " if $debug;
}
}
- else
+
+ if(defined $plugin_info{$plugname.'__'.$t.'_delay'})
{
- set_followup($t,$followup,$year,$day_of_year,$month,$day_of_month,$calendar_week,
- $day_of_week_no,$hour,$minute,$time_of_day,$systemtime,$debug);
+ $plugin_info{$plugname.'__'.$t.'_result'}=$prevResult; # altes Resultat wieder aufnehmen
+ delete $plugin_info{$plugname.'__'.$t.'_delay'};
+ $retval.="(Logik) -> wartender Delay-Timer geloescht; " if $debug;
}
}
+ elsif(defined $result && $logic->{$t}{followup})
+ {
+ my $followup=$logic->{$t}{followup};
+ set_followup($t,$followup,$year,$day_of_year,$month,$day_of_month,$calendar_week,
+ $day_of_week_no,$hour,$minute,$time_of_day,$systemtime,$debug);
+ }
}
}
else # noch nicht faelliger Timer
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|