reloadevery = setTimeout('reload()',$.($delay*1000).qq$);
delete xmlhttp;
delete saveScrollTop;
+
+ heatmapRegister();
}
};
if(document.getElementById('logbox')) {
blinkcnt++;
}
+ function heatmapRegister() {
+ if (!document.getElementById('heatmap-img')) return;
+
+ if (typeof HeatmapDef === 'undefined') {
+ var js = document.createElement("script");
+ js.type = "text/javascript";
+ js.src = '../HeatmapRichDefs.js';
+ document.body.appendChild(js);
+ }
+
+ document.getElementById('heatmap-img').onmousemove = document.getElementById('heatmap-img').onmouseover = function(e) {
+ var cx = e.clientX;
+ var cy = e.clientY;
+
+ if (!cx || !cy) return;
+
+ var ix = parseInt((cx - HeatmapDef.x) / HeatmapDef.w);
+ var iy = 32- parseInt((cy - HeatmapDef.y) / HeatmapDef.h);
+ if (ix < 0 || ix > 31 || iy < 0 || iy > 31) return;
+
+ document.getElementById('heatmap-caption').innerHTML = HeatmapDef.labels[ix][iy];
+ }
+ }
+
</script>$;
}
$out .= qq$
$plot2->{xmax} = 32.5;
$plot2->{ymin} = 0.5;
$plot2->{ymax} = 32.5;
+$plot2->{cbmin} = "0";
+$plot2->{cbmax} = "100<*<1000000";
$plot2->{showvalues} = 0;
$plot2->{xlabel} = "column";
$plot2->{ylabel} = "row";
-$plot2->{addCmd} = "set lmargin at screen 0.07\nset rmargin at screen 0.85\nset bmargin at screen 0.07\nset tmargin at screen 0.95";
+$plot2->{addCmd} = "set lmargin at screen 0.07\nset rmargin at screen 0.80\nset bmargin at screen 0.07\nset tmargin at screen 0.95";
HPlot::PlotInit($plot2);
my $str = Dmon::MakeTitle(9,14,"HeatmapRich",0);
- $str .= qq@<img src="%ADDPNG HeatmapRich.png%" type="image/png">@;
+ $str .= qq@<img src="%ADDPNG HeatmapRich.png%" type="image/png" id="heatmap-img"><div id="heatmap-caption" style="margin-top: -5px;"></div>@;
$str .= Dmon::MakeFooter();
Dmon::WriteFile("HeatmapRich",$str);
+sub generateDef {
+ my $x = 55; my $y = 50; my $w = (566-$x) / 32.0; my $h = (619-$y) / 32.0;
+
+ $str = qq@
+ var HeatmapDef = {
+ 'x': $x, 'y': $y, 'w': $w, 'h': $h,
+ 'labels': [
+ @;
+
+ for my $ix (1..32) {
+ $str .= '[';
+ for my $iy (1..32) {
+ my $fpga = $ChannelMapping::chanmap->{fpga}->[$ix]->[$iy];
+ my $channel = ($ChannelMapping::chanmap->{chan}->[$ix]->[$iy]-1) / 2;
+
+ $str .= sprintf("'0x%04x CH: %d'", $fpga, $channel) . ($iy == 32 ? '' : ',');
+ }
+ $str .= ']' . ($ix == 32 ? '' : ',') . "\n";
+ }
+
+ $str .= ']};';
+ return $str;
+}
+
+open FH, ">", Dmon::DMONDIR . '/HeatmapRichDefs.js';
+print FH generateDef;
+close FH;
my $old;
my $oldtime = time();