]> jspc29.x-matter.uni-frankfurt.de Git - daqtools.git/commitdiff
added --norepeat option to xmldb2tex.pl, supresses excessive printing of repeated...
authorMichael Wiebusch <m.wiebusch@gsi.de>
Mon, 8 Dec 2014 16:57:58 +0000 (17:57 +0100)
committerMichael Wiebusch <m.wiebusch@gsi.de>
Mon, 8 Dec 2014 16:57:58 +0000 (17:57 +0100)
xml-db/xml-db2tex.pl

index b229bac9ab1fa14e06e58dd2cac96a253b912818..7ac49ee2894c91a16711a4782f9a5dcee0fc7403 100755 (executable)
@@ -31,6 +31,7 @@ GetOptions(
            'standalone'  => \$opt->{standalone},
            'wide|w'      => \$opt->{wideformat},
            'collapse'    => \$opt->{collapse},
+           'norepeat'    => \$opt->{norepeat},
            'dumpItem|d'    => \$opt->{dumpItem}
           );
 
@@ -103,9 +104,12 @@ Options:
                      alternating gray and white boxes
                      (default)
   
-  --collapse       Dont show extra field line, if a register contains
+  --collapse       Don't show extra field line, if a register contains
                    only single field without description
   
+  --norepeat       Summarize repeated registers instead of printing
+                   every slice
+  
   --standalone     generate standalone compilable latex file
   --pdf            compile directly to pdf (compiles twice)
   
@@ -208,15 +212,22 @@ sub produceTable {
     }
     for (my $i=0;$i<$repeat;$i++){
       my $name_ = $name;
-      if ($repeat > 1) {
-        $name_ = $name.".$i";
-      }  
       my $addr_ = $node->{address}+$i*$stepsize;
       my $hexaddr = sprintf("%04x",$addr_ );
+            
+      if ($repeat > 1) {
+        if ($self->{opt}->{norepeat}){
+          $name_ = $name.".0-".($repeat-1);
+          $hexaddr = sprintf("%04x...%04x", $addr_, $addr_ + $stepsize*($repeat-1));
+        } else {
+          $name_ = $name.".$i";
+        } 
+      }  
       my $rw = $node->{mode};
       
       if ($type eq 'register' || $type eq 'registerfield' || $type eq 'memory'){
         #write register names bold
+#         $name_ = '\textbf{'.$name_.'}'.'\\ \hfill('.$rw.')';
         $name_ = '\textbf{'.$name_.'}'.'\hfill('.$rw.')';
       }
       if ($type eq 'field'){
@@ -231,6 +242,9 @@ sub produceTable {
         addr_uint => $addr_,
         description => $description
       });
+      
+      last if $self->{opt}->{norepeat};
+      
     }
   }