]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
Some renaming and hopefully fixing attribute access over tied hash
authorAndreas Neiser <neiser@kph.uni-mainz.de>
Tue, 2 Jul 2013 12:51:45 +0000 (14:51 +0200)
committerAndreas Neiser <neiser@kph.uni-mainz.de>
Tue, 2 Jul 2013 12:51:45 +0000 (14:51 +0200)
xml-db/database/Hub.xml [moved from xml-db/database/HUB.xml with 100% similarity]
xml-db/database/TrgRdo.xml [moved from xml-db/database/RDO.xml with 100% similarity]
xml-db/setup/trb-setup-default.xml
xml-db/xml-db.pl

index 34c0536f595433140dab8068eee1b16dd3bd40fd..30c2ed7cc5632726007c0d3c65392ead533758f6 100644 (file)
     <external ref="PaDiWa" address="0002" />
   </trb>
 
-
-  <!-- An example how to execute a setting. In general, the entities
-       are identified by their type and address (if specified) -->
-  <trb address="0200">
-    <broadcast address="fe48" />
-    <entity ref="TDC">
-      <!-- this field is a bitmask, so there's a converter to easily
-           set single bits -->
-      <field name="ChannelEnable">
-        0-15 => 1, <!-- enables channels 0-15 -->
-        34 => 1, <!-- enables channel 34 -->
-      </field>
-    </entity>
-  </trb>
-
-
-  <trb address="0200">
-    <broadcast address="fe48" />
-      <!-- this field is a bitmask, so there's a converter to easily
-           set single bits -->
-      <entity ref="TDC">
-      <field name="ReadoutFSM">
-        <enumItem value="0">Bla</enumItem>
-      </field>
-      <field name="ChannelEnable">
-        0-15 => 1, <!-- enables channels 0-15 -->
-        34 => 5, <!-- enables channel 34 -->
-      </field>
-    </entity>
-  </trb>
-  
   <trb address="ffff">
-    <entity ref="TrbNet">
+    <entity ref="TrbNet" />
   </trb>
   
   <trb address="fe48">
-    <entity ref="TDC">
-    <entity ref="RDO">
+    <entity ref="TDC" />
+    <entity ref="TrgRdo" />
   </trb>
 
   <trb address="fffe">
-    <entity ref="HUB">
+    <entity ref="Hub" />
   </trb>
-
-<!--
-  <trb address="ff7f">
-    <entity ref="GBE">
-  </trb>
--->
-
-  
-  
 </TrbNetSetup>
index 70c1ab7e5bfa5eeccdc1624427e4559dd7ea0e32..dee7d6f40747a0f8fc2eb5259236600d97a69540 100755 (executable)
@@ -151,9 +151,9 @@ sub EvaluateTrbNode($$$) {
     # and we can check some more required fields
     foreach my $n ($entity->findnodes('//field | //register | //memory | //fifo | //group')) {
       if ($n->nodeName eq 'field') {
-        PrintMessage($n, 'Fatal Error: "start" attribute is required', 0) unless exists $n->{'start'};
+        PrintMessage($n, 'Fatal Error: "start" attribute is required', 1) unless $n->hasAttribute('start');
       } else {
-        PrintMessage($n, 'Fatal Error: "address" attribute is required', 1) unless exists $n->{'address'};
+        PrintMessage($n, 'Fatal Error: "address" attribute is required', 1) unless $n->hasAttribute('address');
       }
     }
   }
@@ -189,10 +189,11 @@ sub MergeElementIntoEntity($$) {
   PrintMessage($elem, "Merging entity item <$uniquename>") if $verbose;
   PrintMessage($elem, "Before merge:\n".$e_node->toString(2)) if $verbose>2;
 
-  # override the attributes (using nice tied hash functionality)
+  # override the attributes (using tied hash functionality, which
+  # sometimes does not work when reading?)
   foreach my $attr (keys %$elem) {
     next if $attr eq 'name';
-    $e_node->setAttribute($attr, $elem->{$attr});
+    $e_node->setAttribute($attr, $elem->getAttribute($attr));
   }
 
   # appending all additional elements