Do post-processing before incremental constraints are evaluated (thanks
to Chris Billson).
This commit is contained in:
parent
f1f2c2f7e8
commit
a338458ec2
|
@ -3309,6 +3309,11 @@ sub process_data ($$$$$$$) {
|
||||||
# If is a number, we need to replace "," for "."
|
# If is a number, we need to replace "," for "."
|
||||||
$data =~ s/\,/\./;
|
$data =~ s/\,/\./;
|
||||||
|
|
||||||
|
# Post process
|
||||||
|
if (is_numeric ($module->{'post_process'}) && $module->{'post_process'} != 0) {
|
||||||
|
$data = $data * $module->{'post_process'};
|
||||||
|
}
|
||||||
|
|
||||||
# Out of bounds
|
# Out of bounds
|
||||||
if (($module->{'max'} != $module->{'min'}) && ($data > $module->{'max'} || $data < $module->{'min'})) {
|
if (($module->{'max'} != $module->{'min'}) && ($data > $module->{'max'} || $data < $module->{'min'})) {
|
||||||
logger($pa_config, "Received invalid data '" . $data_object->{'data'} . "' from agent '" . $agent->{'nombre'} . "' module '" . $module->{'nombre'} . "' agent " . (defined ($agent) ? "'" . $agent->{'nombre'} . "'" : 'ID ' . $module->{'id_agente'}) . ".", 3);
|
logger($pa_config, "Received invalid data '" . $data_object->{'data'} . "' from agent '" . $agent->{'nombre'} . "' module '" . $module->{'nombre'} . "' agent " . (defined ($agent) ? "'" . $agent->{'nombre'} . "'" : 'ID ' . $module->{'id_agente'}) . ".", 3);
|
||||||
|
@ -3323,11 +3328,6 @@ sub process_data ($$$$$$$) {
|
||||||
return undef unless defined ($data);
|
return undef unless defined ($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Post process
|
|
||||||
if (is_numeric ($module->{'post_process'}) && $module->{'post_process'} != 0) {
|
|
||||||
$data = $data * $module->{'post_process'};
|
|
||||||
}
|
|
||||||
|
|
||||||
# TODO: Float precission should be adjusted here in the future with a global
|
# TODO: Float precission should be adjusted here in the future with a global
|
||||||
# config parameter
|
# config parameter
|
||||||
# Format data
|
# Format data
|
||||||
|
|
Loading…
Reference in New Issue