From 30c5fbbd8530529548ca25fdba30dcc05cfc4546 Mon Sep 17 00:00:00 2001 From: Michael Wiebusch Date: Mon, 25 Nov 2013 14:02:59 +0100 Subject: [PATCH] fixed bug with double fields inherited from specFile in the testgui --- tools/xmlRendering.pm | 44 ++++++++++++------------------------------- 1 file changed, 12 insertions(+), 32 deletions(-) diff --git a/tools/xmlRendering.pm b/tools/xmlRendering.pm index 0c7761e..dc29125 100644 --- a/tools/xmlRendering.pm +++ b/tools/xmlRendering.pm @@ -71,23 +71,16 @@ sub print_registers { print ""; - print < +  -EOF + print qq% + %; print "$registerName"; #print "$registerId"; if ( $xmlfile eq $configFile ) { # we are printing the Specifications Tree - print < X  -EOF + print qq% X %; } if ( $xmlfile eq $specFile ) { # we are printing the Settings Tree - - print < →  -EOF + print qq% → %; } print ""; @@ -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 ); -- 2.43.0