From: Jan Michel Date: Mon, 21 Oct 2013 11:41:32 +0000 (+0200) Subject: added generic xml-webpage, option to change address X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=63dbc7518363f3dcf73b853a768a13793f6910b2;p=daqtools.git added generic xml-webpage, option to change address --- diff --git a/users/frankfurt_test/evtbuilder_start.sh b/users/frankfurt_test/evtbuilder_start.sh index 4272187..23cb362 100755 --- a/users/frankfurt_test/evtbuilder_start.sh +++ b/users/frankfurt_test/evtbuilder_start.sh @@ -47,13 +47,13 @@ extraopts="--online" cd $tmpdir -exec uxterm -bg khaki -geometry 120x20+0+45 -e "/home/hadaq/bin/daq_evtbuild -m 1 -o ${dest} -x ${pref} -I 1 --ebnum 1 -q 32 -S test -d file ${extraopts}; read; bash" & +exec uxterm -bg khaki -geometry 120x20+0+45 -e "/d/jspc22/trb/git/daqdata/hadaq/daq_evtbuild -m 1 -o ${dest} -x ${pref} -I 1 --ebnum 1 -q 32 -S test -d file ${extraopts}; read; bash" & pid=$! echo $pid > $tmpdir/.daq_evtbuild.pid sleep 1 -exec uxterm -bg tan -geometry 120x20+0+345 -e "/home/hadaq/bin/daq_netmem -m 1 -i UDP:0.0.0.0:50000 -q 32 -d 1 -S test ; " & +exec uxterm -bg tan -geometry 120x20+0+345 -e "/d/jspc22/trb/git/daqdata/hadaq/daq_netmem -m 1 -i UDP:0.0.0.0:50000 -q 32 -d 1 -S test ; " & pid=$! echo $pid > $tmpdir/.daq_netmem.pid diff --git a/web/htdocs/commands/xmlpage.pm b/web/htdocs/commands/xmlpage.pm index 3421cbd..f64b9dd 100644 --- a/web/htdocs/commands/xmlpage.pm +++ b/web/htdocs/commands/xmlpage.pm @@ -20,6 +20,12 @@ sub initPage { } } + my $cmd = $setup[$active]->{cmd}; + my $period = $setup[$active]->{period}; + my $name = $setup[$active]->{name}; + my ($cmdMod,$cmdAddr,$cmdReg) = split('-',$setup[$active]->{cmd}); + + print < @@ -36,22 +42,34 @@ EOF
); for ( my $s = 0; $s < scalar @setup; $s++) { - print qq||.$setup[$s]->{name}.qq||; + print qq|$setup[$s]->{name}|; } print qq(
); -if ($active!=-1) { - - if($setup[$active]->{refresh}) { - print qq||; - } - print qq|
|; - print qq||; +print '
'; +if($setup[$active]->{generic} == 1) { + print qq| + + |; } +if($setup[$active]->{address} == 1) { + print qq| + + |; + } + +print qq| + + +
+
|; + print < @@ -74,24 +92,21 @@ sub printJavaScripts { print qq| - + |; diff --git a/web/htdocs/index.html b/web/htdocs/index.html index 0d3ac52..6f668d6 100755 --- a/web/htdocs/index.html +++ b/web/htdocs/index.html @@ -73,6 +73,7 @@ The main documentation of the network can be found in these two documents:
  • TDC (xml-based)
  • Nxyter Read-out
  • MVD Jtag Controller +
  • Everything else diff --git a/web/htdocs/jtag/index.pl b/web/htdocs/jtag/index.pl index 599e7a3..0b8477a 100755 --- a/web/htdocs/jtag/index.pl +++ b/web/htdocs/jtag/index.pl @@ -15,23 +15,18 @@ my $page; $page->{title} = "Jtag Controller Register"; $page->{link} = "../"; -#address should be 0xfe4d - my @setup; $setup[0]->{name} = "Status"; -$setup[0]->{cmd} = "JtagController-0xf308-JtagStatus"; -$setup[0]->{refresh} = 1; -$setup[0]->{period} = 0; +$setup[0]->{cmd} = "JtagController-0xfe4d-JtagStatus"; +$setup[0]->{period} = 5000; $setup[1]->{name} = "CommonCtrl"; -$setup[1]->{cmd} = "JtagController-0xf308-JtagCommonControl"; -$setup[1]->{refresh} = 1; -$setup[1]->{period} = 0; +$setup[1]->{cmd} = "JtagController-0xfe4d-JtagCommonControl"; +$setup[1]->{period} = -1; $setup[2]->{name} = "Control"; -$setup[2]->{cmd} = "JtagController-0xf308-JtagControl"; -$setup[2]->{refresh} = 1; -$setup[2]->{period} = 0; +$setup[2]->{cmd} = "JtagController-0xfe4d-JtagControl"; +$setup[2]->{period} = -1; xmlpage::initPage(\@setup,$page); diff --git a/web/htdocs/network/generic.pl b/web/htdocs/network/generic.pl new file mode 100755 index 0000000..8bf0587 --- /dev/null +++ b/web/htdocs/network/generic.pl @@ -0,0 +1,33 @@ +&htsponse(200, "OK"); +print "Content-type: text/html\r\n\r\n"; + + +use CGI ':standard'; +use XML::LibXML; +use POSIX; +use CGI::Carp qw(fatalsToBrowser); + +use lib qw|../commands htdocs/commands|; +use xmlpage; + +my $page; + +$page->{title} = "Generic Register Display"; +$page->{link} = "../"; + + +my @setup; +$setup[0]->{name} = "AnyReg"; +$setup[0]->{cmd} = "TrbNet-0xffff-CompileTime"; +$setup[0]->{period} = -1; +$setup[0]->{generic} = 1; + + +xmlpage::initPage(\@setup,$page); + + + + +1; + + diff --git a/web/htdocs/network/trbnet.pl b/web/htdocs/network/trbnet.pl index 62754b1..cc95c1b 100755 --- a/web/htdocs/network/trbnet.pl +++ b/web/htdocs/network/trbnet.pl @@ -18,13 +18,13 @@ $page->{link} = "../"; my @setup; $setup[0]->{name} = "StatusRegisters"; $setup[0]->{cmd} = "TrbNet-0xffff-StatusRegisters"; -$setup[0]->{refresh} = 1; -$setup[0]->{period} = 10000; +$setup[0]->{period} = 2000; +$setup[0]->{address} = 1; $setup[1]->{name} = "BoardInfo"; $setup[1]->{cmd} = "TrbNet-0xffff-BoardInformation"; -$setup[1]->{refresh} = 1; -$setup[1]->{period} = 0; +$setup[1]->{period} = -1; +$setup[1]->{address} = 1; xmlpage::initPage(\@setup,$page); diff --git a/web/htdocs/nxyter/index.pl b/web/htdocs/nxyter/index.pl index dc3a415..2f16532 100755 --- a/web/htdocs/nxyter/index.pl +++ b/web/htdocs/nxyter/index.pl @@ -10,21 +10,27 @@ use CGI::Carp qw(fatalsToBrowser); use lib qw|../commands htdocs/commands|; use xmlpage; - my $page; + $page->{title} = "Nxyter Register"; $page->{link} = "../"; my @setup; $setup[0]->{name} = "DataValid"; $setup[0]->{cmd} = "Nxyter-0x3800-DataValidate"; -$setup[0]->{refresh} = 1; -$setup[0]->{period} = 0; +$setup[0]->{period} = -1; +$setup[0]->{address} = 1; + $setup[1]->{name} = "TrigValid"; $setup[1]->{cmd} = "Nxyter-0x3800-TriggerValidate"; -$setup[1]->{refresh} = 1; -$setup[1]->{period} = 0; +$setup[1]->{period} = -1; +$setup[1]->{address} = 1; + +$setup[2]->{name} = "OtherStuff"; +$setup[2]->{cmd} = "Nxyter-0x3800-TriggerValidate"; +$setup[2]->{period} = -1; +$setup[2]->{generic} = 1; xmlpage::initPage(\@setup,$page); diff --git a/web/htdocs/scripts/scriptsnew.js b/web/htdocs/scripts/scriptsnew.js index ae2e084..680fa4c 100644 --- a/web/htdocs/scripts/scriptsnew.js +++ b/web/htdocs/scripts/scriptsnew.js @@ -40,10 +40,7 @@ function getdataprint(command,dId,async,time,callback) { document.getElementById(destId).innerHTML = xmlhttp.responseText; } if(cb) { - cb(); - } - if(time) { - setTimeout("getdataprint('"+cmd+"','"+destId+"','"+asynci+"','"+timei+"')",timei); + cb(time); } //cb(xmlhttp.responseText); //document.getElementById(destId).innerHTML = xmlhttp.responseText; diff --git a/web/htdocs/scripts/xmlpage.js b/web/htdocs/scripts/xmlpage.js new file mode 100644 index 0000000..44075d9 --- /dev/null +++ b/web/htdocs/scripts/xmlpage.js @@ -0,0 +1,52 @@ + function editsetting(e) { + if(e.target.getAttribute("class") && e.target.getAttribute("class").indexOf("editable")!=-1) { + var text = e.target.getAttribute("cstr"); + text += "\\nCurrent Value: "+e.target.innerHTML+" ("+e.target.getAttribute("raw")+")\\n "; + var newval = prompt(text,e.target.getAttribute("raw")); + if (newval != null) { + getdataprint('../xml-db/put.pl?'+e.target.getAttribute("cstr")+'-'+newval,'returntext',false,-1,refresh); + } + } + } + + function refresh(time = 0) { + if(time == -1) { //call immediately and only once + getdataprint('../xml-db/get.pl?'+command,'content',false,0); + } + else if (time > 0) { //call with timeout + clearTimeout(Timeoutvar); + Timeoutvar = setTimeout("getdataprint('../xml-db/get.pl?'+command,'content',false,"+period+",refresh)",period); + } + else { //call immediately, then with timeout + clearTimeout(Timeoutvar); + getdataprint('../xml-db/get.pl?'+command,'content',false,period,refresh); + } + } + + function setperiod(e) { + period = document.getElementById("period").value; + if (period == -1) { + clearTimeout(Timeoutvar); + } + else if (period < 100) { + period = 1000; + document.getElementById("period").value = period; + refresh(period); + } + else { + refresh(period); + } + } + + + function settarget(e) { + command=document.getElementById("target").value; + refresh(period); + } + + function setaddress(e) { + address=document.getElementById("address").value; + var part = command.split('-'); + command=part[0]+"-"+address+"-"+part[2]; + refresh(period); + } \ No newline at end of file