]> jspc29.x-matter.uni-frankfurt.de Git - mvdsensorcontrol.git/commitdiff
fixed bug with double fields inherited from specFile in the testgui
authorMichael Wiebusch <stratomaster@gmx.net>
Mon, 25 Nov 2013 13:02:59 +0000 (14:02 +0100)
committerMichael Wiebusch <stratomaster@gmx.net>
Mon, 25 Nov 2013 13:02:59 +0000 (14:02 +0100)
tools/xmlRendering.pm

index 0c7761e5d28c5895c443231c67bf05d814b61c70..dc291259da38e0fc30fbbb9ec1d6fcd0ac22be8d 100644 (file)
@@ -71,23 +71,16 @@ sub print_registers {
 
     print "<tr>";
 
-    print <<EOF;
-<td onClick='toggleVis("$flistid",this)' class='regheader'>&nbsp;+&nbsp;</td>
-EOF
+    print qq%<td onClick='toggleVis("$flistid",this)' class='regheader'>&nbsp;+&nbsp;</td>%;
     print "<td title=\"$registerDescr\">$registerName</td>";
 
     #print "<td>$registerId</td>";
 
     if ( $xmlfile eq $configFile ) {  # we are printing the Specifications Tree
-      print <<EOF;
-<td class='button_move' onclick='deleteSettings("$configFileName","$registerName","");$editorRefreshCommand'>&nbsp;X&nbsp;</td>
-EOF
+      print qq%<td class='button_move' onclick='deleteSettings("$configFileName","$registerName","");$editorRefreshCommand'>&nbsp;X&nbsp;</td>%;
     }
     if ( $xmlfile eq $specFile ) {    # we are printing the Settings Tree
-
-      print <<EOF;
-<td class='button_move' onclick='copyDefaultRegister("$configFileName","$registerName");$editorRefreshCommand'>&nbsp;&rarr;&nbsp;</td>
-EOF
+      print qq%<td class='button_move' onclick='copyDefaultRegister("$configFileName","$registerName");$editorRefreshCommand'>&nbsp;&rarr;&nbsp;</td>%;
     }
 
     print "</tr>";
@@ -105,24 +98,6 @@ EOF
 }
 
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 
 
 sub print_fields {
@@ -134,8 +109,8 @@ sub print_fields {
   my $configTree = getConfigTree();
   my $specTree = getSpecTree();
 
-  my $register     = $_[1];
-  my $xmlfile      = $_[0];
+  my $register     = $_[1]; # register might come from quickEditMaskTree
+  my $xmlfile      = $_[0]; # xmlfile can be specFile or configFile but not quickEditMaskFile
   my $registerName = $register->findvalue("./\@name");
   my $xmltree;
   
@@ -156,15 +131,20 @@ sub print_fields {
     my $field = $xmltree->findnodes("/MAPS/register[\@name='".
     $registerName."']/field[\@name='".$fieldName."']")->shift();
 
-    unless(defined($field)){
+    unless(defined($field)){ # is the field we want to print in the config/specTree?
       # check if the mask field is defined in the config tree
       # if not get the default value from the specification
       # this feature should be only important for the testgui,
       # not for the JTAG editor, because there
       # the quickEditMaskTree == configTree
+      
+      # 
+      
+      
       my $specField = $specTree->findnodes("/MAPS/register[\@name='".
       $registerName."']/field[\@name='".$fieldName."']")->shift();
-      $field=$register->addNewChild("","field");
+#       $field=$register->addNewChild("","field"); # this is the place where the double fields are coming from
+      $field = $maskField;
       $field->setAttribute("name",$fieldName);
       $field->setAttribute("value",$specField->findvalue("./\@defaultValue"));
       $field->setAttribute( "isHeritageFrom", $specFileName );