mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 00:04:37 +02:00
#8114 remove history_data
This commit is contained in:
parent
829ca31e88
commit
bbbbbdd2bc
@ -4467,29 +4467,20 @@ sub on_demand_macro($$$$$$;$) {
|
|||||||
return(defined($field_value)) ? $field_value : '';
|
return(defined($field_value)) ? $field_value : '';
|
||||||
} elsif ($macro =~ /_moduledata_(\S+)_/) {
|
} elsif ($macro =~ /_moduledata_(\S+)_/) {
|
||||||
my $field_number = $1;
|
my $field_number = $1;
|
||||||
|
|
||||||
my $id_mod = get_db_value ($dbh, 'SELECT id_agente_modulo FROM tagente_modulo WHERE id_agente = ? AND nombre = ?', $module->{'id_agente'}, $field_number);
|
my $id_mod = get_db_value ($dbh, 'SELECT id_agente_modulo FROM tagente_modulo WHERE id_agente = ? AND nombre = ?', $module->{'id_agente'}, $field_number);
|
||||||
my $module_data = get_db_single_row ($dbh, 'SELECT id_tipo_modulo, unit, history_data FROM tagente_modulo WHERE id_agente_modulo = ?', $id_mod);
|
my $module_data = get_db_single_row ($dbh, 'SELECT id_tipo_modulo, unit FROM tagente_modulo WHERE id_agente_modulo = ?', $id_mod);
|
||||||
my $type_mod = $module_data->{'id_tipo_modulo'};
|
my $type_mod = $module_data->{'id_tipo_modulo'};
|
||||||
my $unit_mod = $module_data->{'unit'};
|
my $unit_mod = $module_data->{'unit'};
|
||||||
my $history_data = $module_data->{'history_data'};
|
|
||||||
|
|
||||||
my $field_value = "";
|
my $field_value = "";
|
||||||
if (defined($type_mod)
|
if (defined($type_mod)
|
||||||
&& ($type_mod eq 3 || $type_mod eq 10 || $type_mod eq 17 || $type_mod eq 23 || $type_mod eq 33 || $type_mod eq 36)
|
&& ($type_mod eq 3 || $type_mod eq 10 || $type_mod eq 17 || $type_mod eq 23 || $type_mod eq 33 || $type_mod eq 36)
|
||||||
) {
|
) {
|
||||||
if (defined($history_data) && $history_data eq 0 ) {
|
$field_value = get_db_value($dbh, 'SELECT datos FROM tagente_estado WHERE id_agente_modulo = ?', $id_mod);
|
||||||
$field_value = get_db_value($dbh, 'SELECT datos FROM tagente_estado WHERE id_agente_modulo = ?', $id_mod);
|
|
||||||
} else {
|
|
||||||
$field_value = get_db_value($dbh, 'SELECT datos FROM tagente_datos_string WHERE id_agente_modulo = ? order by utimestamp desc limit 1', $id_mod);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if (defined($history_data) && $history_data eq 0 ) {
|
$field_value = get_db_value($dbh, 'SELECT datos FROM tagente_estado WHERE id_agente_modulo = ?', $id_mod);
|
||||||
$field_value = get_db_value($dbh, 'SELECT datos FROM tagente_estado WHERE id_agente_modulo = ?', $id_mod);
|
|
||||||
} else {
|
|
||||||
$field_value = get_db_value($dbh, 'SELECT datos FROM tagente_datos WHERE id_agente_modulo = ? order by utimestamp desc limit 1', $id_mod);
|
|
||||||
}
|
|
||||||
|
|
||||||
my $data_precision = $pa_config->{'graph_precision'};
|
my $data_precision = $pa_config->{'graph_precision'};
|
||||||
$field_value = sprintf("%.$data_precision" . "f", $field_value);
|
$field_value = sprintf("%.$data_precision" . "f", $field_value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user