From f71ff1e92d73fdffb77893b888d2cf0e466b1bd8 Mon Sep 17 00:00:00 2001 From: Michael Wiebusch Date: Wed, 21 Aug 2013 13:12:48 +0200 Subject: [PATCH] show/hide of conversion tools --- layout/jtageditor_blue.css | 9 +++++ tools/xmlOperation.pl | 4 +-- tools/xmlOperations.pm | 7 ++-- tools/xmlRendering.pm | 70 +++++++++++++++++++++++++++++--------- 4 files changed, 69 insertions(+), 21 deletions(-) diff --git a/layout/jtageditor_blue.css b/layout/jtageditor_blue.css index 84e7c60..081f156 100644 --- a/layout/jtageditor_blue.css +++ b/layout/jtageditor_blue.css @@ -190,6 +190,15 @@ tr.bitfield{ cursor:auto; } +table.conversion { + visibility:collapse; + font-size:9pt; +} + +tr.fileLevel:hover td table.conversion { + visibility:visible; +} + table.registers tr.bitfield td:first-child{ background:transparent; cursor:default; diff --git a/tools/xmlOperation.pl b/tools/xmlOperation.pl index fcb069f..7c75f53 100755 --- a/tools/xmlOperation.pl +++ b/tools/xmlOperation.pl @@ -39,8 +39,8 @@ unless ($q->param()){ print br,br; print "possible actions: save, delete, copyDefaultRegister, createFile, deleteFile, changeAncestor",br,br; print "parameter summary:",br; - print "save a value into a specific field:",br; - print escapeHTML("action=save&configFile=[configFile]®ister=[register]&field=[field]&value=[value]"),br,br; + print "save a value into a specific field, optional: if you enter a numeric base, value will be saved in the specified format.:",br; + print escapeHTML("action=save&configFile=[configFile]®ister=[register]&field=[field]&value=[value]&base=[base]"),br,br; print "delete a specific field:",br; print escapeHTML("action=delete&configFile=[configFile]®ister=[register]&field=[field]"),br,br; print "delete a whole register:",br; diff --git a/tools/xmlOperations.pm b/tools/xmlOperations.pm index 72363b6..b7c7369 100644 --- a/tools/xmlOperations.pm +++ b/tools/xmlOperations.pm @@ -351,7 +351,7 @@ sub save { my $fieldName = $_[1]; my $xmlfile = $configFile; my $newValue; - $newValue = $_[2]; + $newValue = $_[2]; my $base = $_[3]; my $xmltree = $configTree; @@ -403,10 +403,13 @@ sub save { # print SCHREIBEN $xmltree->toString(); # close SCHREIBEN; } -# args: registerName,fieldName,newValue +# args: registerName,fieldName,newValue,base # globs: $configFile,$configTree, # description: saves value "newValue" in field "fieldName" in register "registerName" (in the $configTree) # if field or register does not exist yet, it is created. +# If you enter "hex", "dec" or "bin" for base, the value gets converted to the +# corresponding number format. If only base and no newValue is given, the +# current value wil be converted to the new base. # make change permanent by calling writeConfigFile() hereafter. sub copyDefaultRegister { diff --git a/tools/xmlRendering.pm b/tools/xmlRendering.pm index 9a1e1cb..1945906 100644 --- a/tools/xmlRendering.pm +++ b/tools/xmlRendering.pm @@ -230,34 +230,29 @@ sub print_fields { print "$fieldName"; print "  = "; +# print ""; +# print_conversionMenu($registerName,$fieldName); +# print ""; if ($readOnlyFlag) { print <$fieldValue EOF } else { - print < - - -EOF +%; + + print_conversionMenu($registerName,$fieldName); + +print ""; } print ''; - if ( $xmlfile eq $configFile) { - print qq%%; - print "H"; - print ""; -# print ""; - print qq%%; - print "B"; - print ""; -# print ""; - print qq%%; - print "D"; - print ""; - } +# if ( $xmlfile eq $configFile and $isHeritageFrom eq "") { +# print_conversionMenu($registerName,$fieldName); +# } if ( $xmlfile eq $specFile ) { # we are printing the Specifications tree print < →  @@ -305,6 +300,47 @@ EOF } +sub print_conversionMenu { + + my $configFileName= getConfigFileName(); + my $registerName = shift(); + my $fieldName = shift(); + + print "
"; + print qq%%; + print "hex "; + print ""; +# print ""; + print qq%%; + print "bin "; + print ""; +# print ""; + print qq%%; + print "dec"; + print ""; + print "
"; + +} + +sub print_conversionMenu_bak { + + my $configFileName= getConfigFileName(); + my $registerName = shift(); + my $fieldName = shift(); + print qq%%; + print "H"; + print ""; +# print ""; + print qq%%; + print "B"; + print ""; +# print ""; + print qq%%; + print "D"; + print ""; + +} + 1; -- 2.43.0