xmlhttp.open("GET",command,true);
xmlhttp.send(null);
}
+
+
+function getdataprint(command,dId,async) {
+ //async==true : do what you can when you can do it :D
+ //async==false : do the task after you finished the previous task!
+
+ // super duper debug line!
+// alert("caller is " + arguments.callee.caller.toString());
+
+ var xmlhttp = null;
+ //var cb = null;
+ xmlhttp=new XMLHttpRequest();
+ //cb = callback;
+ var destId = dId;
+
+ xmlhttp.onreadystatechange = function() {
+ if(xmlhttp.readyState == 4 && xmlhttp.status==200) {
+ //if(cb)
+ if(document.getElementById(destId)){
+ document.getElementById(destId).innerHTML = xmlhttp.responseText;
+ }
+ //cb(xmlhttp.responseText);
+ //document.getElementById(destId).innerHTML = xmlhttp.responseText;
+ }
+ }
+
+ xmlhttp.open("GET",command,async);
+ xmlhttp.send(null);
+ }
function SciNotation(v) {
my $configFile = SETUPFILE;
-
+my $setup;
my ($command,$style) = split("-",$ENV{'QUERY_STRING'});
my $isErrors = $command eq "errors";
-if($isSetup && $style eq "only") {readConfig($configFile,1);}
-else {initPage();}
+if($isSetup && $style eq "only") {readConfig($configFile,1);}
+elsif($isStatus && $style eq "only") {readConfig($configFile,0);
+ getStatus();}
+else {initPage();}
my $ctrlname = $curctrl->getAttribute('name');
my $ctrlid = $curctrl->getAttribute('id');
my $ctrladdr = $curctrl->getAttribute('address');
-
+ $setup->{$ctrlname}->{addr} = $ctrladdr;
printf("<li>Controller %i ($ctrlname) 0x%s\n",$ctrlid,$ctrladdr) if $write;
print("<ul>") if $write;
foreach my $curchain ($curctrl->findnodes('chain')) {
my $chainid = $curchain->getAttribute('id');
my $chainname = $curchain->getAttribute('name');
+ $setup->{$ctrlname}->{chains}->{$chainname}->{addr} = $chainid;
printf("<li>Chain %i ($chainname)",$chainid) if $write;
print("<ul>") if $write;
foreach my $cursensor ($curchain->findnodes('sensor')) {
my $sensname = $cursensor->getAttribute('name');
my $sensfile = $cursensor->getAttribute('config');
my $sensena = $cursensor->getAttribute('enabled');
+ $setup->{$ctrlname}->{chains}->{$chainname}->{sensors}->{$sensname} = $sensid;
printf("<li>Sensor $sensid ($sensname) $sensfile %s",($sensena?"active":"disabled")) if $write;
}
print("</ul>") if $write;
}
+sub getStatus {
+print <<EOF;
+ <input type="button" class="stdbutton" onClick="getdataprint('../../daqtools/xml-db/get.pl?JtagController-0xf308-JtagStatus','content',false);" value="Refresh">
+ <div id="content"></div>
+EOF
+
+ }
+
+
sub initPage {
<span class=").($isStatus?"selected":"inactive").qq("><a href="?status">Status</a></span>
<span class=").($isErrors?"selected":"inactive").qq("><a href="?errors">Errors</a></span>
</div>
-<div class="content">
+
);
-readConfig($configFile,($command eq "setup"?1:0));
+if($isSetup) {
+ print '<div class="content">';
+ readConfig($configFile,1);
+ print '</div>';
+ }
+if ($isStatus) {
+ readConfig($configFile,0);
+ getStatus();
+ }
print <<EOF ;
-</div>
+
</div>
<div id="debugpane">
<div class="header">Debug Output</div>
####### javascript function land ################
print <<EOF;
+<script language="javascript" src="../scripts/scripts.js"></script>
<script language="javascript">