setCookie("address"+currentpage,document.getElementById("address").value);
}
document.getElementById("permalink").href=permaLink();
+ document.getElementById("dump").href= GETCOMMAND+'?'+command.substring(0, command.length - 1) + "dump";
}
function eatCookies() {
link += "&inline="+document.getElementById("inline").checked;
return link;
}
-
+
+
+function dumpLink() {
+ var link = location.origin + location.pathname + location.search + "#";
+
+ if(document.getElementById("address")) {
+ link += "&address="+document.getElementById("address").value;
+ }
+ if(document.getElementById("period")) {
+ link += "&period="+document.getElementById("period").value;
+ }
+ if(document.getElementById("target")) {
+ link += "&target="+document.getElementById("target").value;
+ }
+ link += "&cache="+document.getElementById("cache").checked;
+ link += "&rate="+document.getElementById("rate").checked;
+ link += "&inline="+document.getElementById("inline").checked;
+ return link;
+ }
+
/*From w3schools.com*/
function getCookie(cname,pagename) {
//URI
my $help = 0;
my $verbose = 0;
my $isbrowser = 0;
+my $StyleDump = 0;
my $server = $ENV{'SERVER_SOFTWARE'} || "";
my @request;
+my @RegisterDump;
+
my ($file,$entity,$netaddr,@spi_chains,$name, $style, $storefile, $rates, $cache, $isInline, $olddata);
my $lastboards;
$verbose = ($style =~ /verbose/i) ||$verbose;
$rates = $style =~ /rate/i;
$cache = $style =~ /cache/i;
+ $StyleDump =$style =~ /dump/i;
+
+
###############################
#### Check arguments for validity
}
$cstr = "" unless $cstr;
- my $ret, my $cl;
+ my $ret, my $cl = '';
if (defined $cont) {
my $isflag = 1;
$isflag = 0 if $obj->{noflag};
sub generateoutput {
my ($obj,$name,$slice,$once) = @_;
my $t = "";
+ @RegisterDump = ();
$slice = 0 unless defined $slice;
if ($obj->{type} eq "group") {
generateoutput($db->{$c},$c,$slice,$once);
}
} elsif (($obj->{type} eq "register" || $obj->{type} eq "registerfield" || $obj->{type} eq "field")) {
-
+ #for every register
my $stepsize = $obj->{stepsize} || 1;
my $addr = $obj->{address};
my $tarrhead;
my $tarrcont;
my $line = 0;
- do {
+ do { #for every repeat
my $addr = $obj->{address}+$slice*$stepsize;
#### Prepare table header line
if ($obj->{mode} =~ /r/) {
$lastboards = $data->{$addr}; #Store list of responding boards as guess for write-only registers.
}
- foreach my $b (sort keys %{$lastboards}) {
+ foreach my $b (sort keys %{$lastboards}) { #for every board
my $ttmp = ""; #"Line Header" part
my $ttmp2 = ""; #"Line Content" part
- my $sl;
+ my $sl = "";
my $slicename = "";
$slicename = " - ".$obj->{sliceName}->{$slice} if (exists $obj->{sliceName}->{$slice});
next unless defined $data->{$addr}->{$b} || !($obj->{mode} =~ /r/);
+ if ($StyleDump) {
+ my $iswriteable = $obj->{mode} =~ /w/;
+ foreach my $c (@{$obj->{children}}) {
+ $iswriteable = $iswriteable || ($db->{$c}->{mode} =~ /w/);
+ }
+ if($iswriteable) {
+ my $s = sprintf("w 0x%s 0x%04x 0x%08x \t#%s %i%s",$b,$addr,$data->{$addr}->{$b},$name,$slice,$slicename);
+ push(@RegisterDump,$s);
+ }
+ }
$sl = sprintf("<td class=\"slice\"><div>%i%s<span class=\"tooltip\"><b>$name.$slice</b> (0x%04x)</span></div>",$slice,$slicename,$addr) if ($once != 1 && defined $obj->{repeat});
my $endslice = '';
}
$t .= "</table>";
}
- print $t;
+
+ if($StyleDump) {
+ print join("\n",@RegisterDump);
+ print("\n");
+ }
+ else {
+ print $t;
+ }
}
sub makerate {