]> jspc29.x-matter.uni-frankfurt.de Git - mvdsensorcontrol.git/commitdiff
added functionality: settings in CbConf nodes in the setup files are now programmed...
authorwww@jspc55 <www@jspc55>
Tue, 3 Jun 2014 13:48:12 +0000 (15:48 +0200)
committerwww@jspc55 <www@jspc55>
Tue, 3 Jun 2014 13:48:12 +0000 (15:48 +0200)
Environment.pm
layout/styles.css
tools/adcread.pl
tools/plotService.pl
tools/startup.pl

index 5f808e3002363ccc89b545e64012817710e2c718..6b3d9777260eb4bbdf59252450351918cea2ff81 100644 (file)
@@ -25,7 +25,8 @@ use constant SHAREPATH        => JTAGROOTPATH."share/";             #path for ic
 use constant SETUPFILE        => SETUPDIR."testsetup.xml";
 use constant SHMSYMLINK       => JTAGROOTPATH."shm/";
 
-use constant XML_CBCTRL_ENTITY    => JTAGROOTPATH."../daqtools/xml-db/cache/CbController.entity";
+use constant XMLDBPATH        => DAQTOOLSPATH."/xml-db";
+use constant XML_CBCTRL_ENTITY    => DAQTOOLSPATH."/xml-db/cache/CbController.entity";
 
 
 
index ec4b8aabde0c59896c544b23bcfabeb0d3d782b0..3755da288b440881ae69acadbcde2e1afb88708c 100644 (file)
@@ -177,10 +177,10 @@ table.content  tr:hover td.under {
   background:#dfd;
   border-color:#dfd;
 }
-
+/*
 input[type="text"]{
   width:182px;
-}
+}*/
 
 input.small {
   width:90px;
index 35fef3b8083ae9aa9cfca673ca08273fbab4777b..ecac69edf0d31caa7ed7853043f88acaf4a6a8f0 100755 (executable)
@@ -25,8 +25,7 @@ use FindBin;
 use lib "$FindBin::Bin/..";
 
 
-my $entityFile = "../../daqtools/xml-db/cache/CbController.entity";
-my $xmldb = AccessXmlDb->new( entityFile => $entityFile );
+my $xmldb = AccessXmlDb->new( entityFile => XML_CBCTRL_ENTITY );
 
 my $isHttpReq = $ENV{HTTP_USER_AGENT};
 
index 2d01435ed9c0d288a4c812cb03bf4f31e81098e7..f0dd387ee8f13aa9e606470af37eb4125b715278 100755 (executable)
@@ -23,6 +23,7 @@ use PlotScheduler;
 
 use FindBin;
 use lib "$FindBin::Bin/..";
+use Environment;
 
 my $shm = "/dev/null";
 my $timeout = 5;
@@ -41,7 +42,7 @@ GetOptions(
 
 daemonize() if $daemonize;
           
-PlotJob::initXmlDb("../../daqtools/xml-db/cache/CbController.entity");
+PlotJob::initXmlDb(XML_CBCTRL_ENTITY);
 PlotJob::initTrbNet();
 
 
index e28ca227e75572ea1bb159ccffc104eb157cc714..06a1981fc570630bd630398c5f9ac364b77a9ab8 100755 (executable)
@@ -9,10 +9,11 @@ use FileHandle;
 use Pod::Usage;
 $Data::Dumper::Terse = 1;
 $Data::Dumper::Useqq = 0;
-
+use Cwd;
 use FindBin;
 use lib "$FindBin::Bin/..";
 use Environment;
+require Common;
 
 
 my ($help, $man, $verbose, $setup, $dryrun);
@@ -66,6 +67,7 @@ my $db = $parser->parse_file($setupFile);
 my $name = $db->getDocumentElement->getAttribute('name');
 print STDERR "Loading setup $name from file $setupFile\n" if $verbose;
 
+my @CbCommands;
 
 foreach my $curctrl ($db->getDocumentElement->findnodes('controller')) {
   my $ctrlname = $curctrl->getAttribute('name');
@@ -91,16 +93,48 @@ foreach my $curctrl ($db->getDocumentElement->findnodes('controller')) {
       push(@sname,$sensname);
       push(@sfile,$sensfile);
       push(@senable,$sensena);
+      
+      
+      # parse <CbConf> configuration and set settings in converter board
+      my $CbConf = $cursensor->findnodes('CbConf')->shift();
+      if (defined($CbConf)){
+       foreach my $attr ($CbConf->findnodes('@*')){
+#        print $ctrladdr." ".$attr->getName()." ".$attr->getValue()."\n";
+         push(@CbCommands,{
+           addr => "0x".$ctrladdr,
+           name => $attr->getName().".".sprintf("%d",$sensid),
+           # sensor id is used to addres the xml-db data slice
+           value => any2hex($attr->getValue())
+         }); 
+       }
+      }
 
       foreach my $cfg ($cursensor->findnodes('config')) {
         print STDERR "      Found config\n" if $verbose;
         push(@commands,"./ui.pl -b $ctrlname -o ".$cfg->textContent());
         }
       }
+      
+      # parse <CbConf> configuration and set settings in converter board
+      my $CbConf = $curchain->findnodes('CbConf')->shift();
+      if (defined($CbConf)){
+       foreach my $attr ($CbConf->findnodes('@*')){
+#        print $ctrladdr." ".$attr->getName()." ".$attr->getValue()."\n";
+         push(@CbCommands,{
+           addr => "0x".$ctrladdr,
+           name => $attr->getName(),
+           # sensor id is used to addres the xml-db data slice
+           value => any2hex($attr->getValue())
+         }); 
+       }
+      }
+      
+      
     foreach my $cfg ($curchain->findnodes('config')) {
       print STDERR "    Found config\n" if $verbose;
       push(@commands,"./ui.pl -b $ctrlname -c $chainname -o ".$cfg->textContent());
       }
+    
     $chainsini .= proto_chainsini($chainname,$chainid,$ctrladdr,\@sname,\@sfile,\@senable);
     sensorini(\@sfile);
     }
@@ -123,10 +157,26 @@ print $chainsinifile $chainsini;
 $chainsinifile->close();
   
   
+print Dumper @CbCommands;
   
 ###############################
 ## Do whatever has to be done
 ###############################
+
+# configure Converter Boards
+my $here = cwd();
+chdir(XMLDBPATH);
+foreach my $cmd (@CbCommands){
+  my $entity = "CbController";
+  my $addr = $cmd->{addr};
+  my $value = $cmd->{value};
+  my $fieldname = $cmd->{name};
+  execute("./put.pl $entity $addr $fieldname $value");
+
+}
+chdir($here);
+
+
 local $CWD = $ENV{'JTAGPATH'};
 foreach my $cmd (@commands) {
   execute($cmd);