mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-20 19:36:02 +00:00
92_FileLog.pm: SVG/FileLog_Get: fix delta-d problem on rescan
98_SVG.pn: Add "Show preprocessed input" button git-svn-id: https://svn.fhem.de/fhem/trunk@6997 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
7c162277fd
commit
6612e8da50
@ -669,6 +669,8 @@ RESCAN:
|
|||||||
|
|
||||||
} elsif($t == 2) { # delta-h or delta-d
|
} elsif($t == 2) { # delta-h or delta-d
|
||||||
|
|
||||||
|
next if($rescan);
|
||||||
|
|
||||||
my $hd = $h->{didx}; # TimeStamp-Length
|
my $hd = $h->{didx}; # TimeStamp-Length
|
||||||
my $ld = substr($fld[0],0,$hd); # TimeStamp-Part (hour or date)
|
my $ld = substr($fld[0],0,$hd); # TimeStamp-Part (hour or date)
|
||||||
if(!defined($h->{last1}) || $h->{last3} ne $ld) {
|
if(!defined($h->{last1}) || $h->{last3} ne $ld) {
|
||||||
|
@ -281,6 +281,9 @@ SVG_PEdit($$$$)
|
|||||||
$ret .= FW_hidden("detail", $d); # go to detail after save
|
$ret .= FW_hidden("detail", $d); # go to detail after save
|
||||||
$ret .= FW_hidden("gplotName", $gp);
|
$ret .= FW_hidden("gplotName", $gp);
|
||||||
$ret .= FW_hidden("logdevicetype", $ldt);
|
$ret .= FW_hidden("logdevicetype", $ldt);
|
||||||
|
if(defined($FW_pos{zoom}) && defined($FW_pos{off})) { # for showData
|
||||||
|
$ret .= FW_hidden("pos", "zoom=$FW_pos{zoom};off=$FW_pos{off}");
|
||||||
|
}
|
||||||
$ret .= "<table class=\"block wide plotEditor\">";
|
$ret .= "<table class=\"block wide plotEditor\">";
|
||||||
$ret .= "<tr class=\"even\">";
|
$ret .= "<tr class=\"even\">";
|
||||||
$ret .= "<td>Plot title</td>";
|
$ret .= "<td>Plot title</td>";
|
||||||
@ -331,7 +334,7 @@ SVG_PEdit($$$$)
|
|||||||
my @lineStyles;
|
my @lineStyles;
|
||||||
if(SVG_openFile($FW_cssdir,
|
if(SVG_openFile($FW_cssdir,
|
||||||
AttrVal($FW_wname,"stylesheetPrefix",""), "svg_style.css")) {
|
AttrVal($FW_wname,"stylesheetPrefix",""), "svg_style.css")) {
|
||||||
map { push(@lineStyles,$1) if($_ =~ m/^\.(l[^{ ]*)/) } <FH>;
|
map { push(@lineStyles,$1) if($_ =~ m/^\.(l[^{ ]*)/) } <FH>; # } vim help
|
||||||
close(FH);
|
close(FH);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -366,7 +369,9 @@ SVG_PEdit($$$$)
|
|||||||
$ret .= "Example lines for input:<br>$example</td></tr>";
|
$ret .= "Example lines for input:<br>$example</td></tr>";
|
||||||
|
|
||||||
$ret .= "<tr class=\"".(($r++&1)?"odd":"even")."\"><td colspan=\"3\">";
|
$ret .= "<tr class=\"".(($r++&1)?"odd":"even")."\"><td colspan=\"3\">";
|
||||||
$ret .= FW_submit("submit", "Write .gplot file")."</td></tr>";
|
$ret .= FW_submit("submit", "Write .gplot file")." ".
|
||||||
|
FW_submit("showFileLogData", "Show preprocessed input").
|
||||||
|
"</td></tr>";
|
||||||
|
|
||||||
$ret .= "</table></form>";
|
$ret .= "</table></form>";
|
||||||
}
|
}
|
||||||
@ -434,14 +439,37 @@ SVG_zoomLink($$$)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub
|
||||||
|
SVG_showData()
|
||||||
|
{
|
||||||
|
my $wl = $FW_webArgs{detail};
|
||||||
|
my $hash = $defs{$wl};
|
||||||
|
my ($d, $gplotfile, $file) = split(":", $hash->{DEF});
|
||||||
|
$gplotfile = "$FW_gplotdir/$gplotfile.gplot";
|
||||||
|
my ($err, $cfg, $plot, $flog) = SVG_readgplotfile($wl, $gplotfile);
|
||||||
|
if($err) {
|
||||||
|
$FW_RET=$err;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
SVG_calcOffsets($d, $wl);
|
||||||
|
my ($f,$t)=($SVG_devs{$d}{from}, $SVG_devs{$d}{to});
|
||||||
|
my $cmd = "get $d $file - $f $t " . join(" ", @{$flog});
|
||||||
|
my $ret = FW_fC($cmd, 1);
|
||||||
|
$ret =~ s/\n/<br>/gs;
|
||||||
|
$FW_RET = "$cmd<br><br>$ret";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
sub
|
sub
|
||||||
SVG_WriteGplot($)
|
SVG_WriteGplot($)
|
||||||
{
|
{
|
||||||
my ($arg) = @_;
|
my ($arg) = @_;
|
||||||
FW_digestCgi($arg);
|
FW_digestCgi($arg);
|
||||||
|
|
||||||
|
return SVG_showData() if($FW_webArgs{showFileLogData});
|
||||||
|
|
||||||
if(!defined($FW_webArgs{par_0_0})) {
|
if(!defined($FW_webArgs{par_0_0})) {
|
||||||
FW_pO "missing data in logfile: won't write incomplete .gplot definition";
|
$FW_RET="missing data in logfile: won't write incomplete .gplot definition";
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -502,7 +530,7 @@ SVG_WriteGplot($)
|
|||||||
}
|
}
|
||||||
|
|
||||||
my $err = FileWrite($fName, @rows);
|
my $err = FileWrite($fName, @rows);
|
||||||
FW_pO "SVG_WriteGplot: $err" if($err);
|
$FW_RET="SVG_WriteGplot: $err" if($err);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user