From: Michael Wiebusch Date: Tue, 16 Jul 2013 20:07:58 +0000 (+0200) Subject: jtageditor is now relatively clean X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=f5c9b3b98b408bbfbd7080e1843dcb9ad16fb8c5;p=mvdsensorcontrol.git jtageditor is now relatively clean --- diff --git a/tools/jtageditor.pl b/tools/jtageditor.pl index 3e63c3a..3d64e91 100755 --- a/tools/jtageditor.pl +++ b/tools/jtageditor.pl @@ -2,6 +2,11 @@ print "Content-type: text/html\n\n"; # TODO + + + + + # what happens when files are not writable? # make sure that error fields are hidden as well! @@ -50,15 +55,7 @@ if ( !keys %cgiHash ) -# some global variables -our $specFile = ""; -our $configFile = ""; -our $specFileName = ""; -our $configFileName = ""; -our $specTree; -our $configTree; -our $configMapsType; @@ -81,9 +78,9 @@ if ( $cgiHash{'print'} eq 'spectree' ) { } parseConfigAndSpec( $cgiHash{'configFile'} ); print -"
specifications loaded from $specFileName
"; +"
specifications loaded from ".getSpecFileName()."
"; - print_registers($specFile); + print_registers(getSpecFile()); } if ( $cgiHash{'print'} eq 'settree' ) { @@ -107,7 +104,7 @@ if ( $cgiHash{'print'} eq 'settree' ) { print_ancestorInfo(); - print_registers($configFile); + print_registers(getConfigFile()); } if ( defined $cgiHash{'debuginput'} ) { @@ -259,6 +256,14 @@ sub print_fileSelection { } sub print_registers { + + my $configFile = getConfigFile(); + my $specFile = getSpecFile(); + my $configFileName = getConfigFileName(); + my $specFileName = getSpecFileName(); + my $configTree = getConfigTree(); + my $specTree = getSpecTree(); + my $xmlfile = $_[0]; my $xmltree; if ( $xmlfile eq $configFile ) { @@ -327,6 +332,13 @@ EOF sub print_fields { + my $configFile = getConfigFile(); + my $specFile = getSpecFile(); + my $configFileName = getConfigFileName(); + my $specFileName = getSpecFileName(); + my $configTree = getConfigTree(); + my $specTree = getSpecTree(); + my $register = $_[1]; my $xmlfile = $_[0]; my $registerName = $register->findvalue("./\@name"); @@ -424,6 +436,12 @@ EOF } sub print_ancestorInfo { + + my $configFile = getConfigFile(); + my $specFile = getSpecFile(); + my $configFileName = getConfigFileName(); + my $specFileName = getSpecFileName(); + print "
"; #print "my ancestry:
"; diff --git a/tools/xmlOperations.pm b/tools/xmlOperations.pm index 176509c..5a6073e 100644 --- a/tools/xmlOperations.pm +++ b/tools/xmlOperations.pm @@ -7,6 +7,33 @@ my %fileLevelHash; my $ancestryTree; my @ancestryList; + +# some global variables + +my $specFile = ""; +my $configFile = ""; +my $specFileName = ""; +my $configFileName = ""; +my $specTree; +my $configTree; +my $configMapsType; + +sub getSpecFile{ + return $specFile; +} + +sub getConfigFile{ + return $configFile; +} + +sub getSpecFileName{ + return $specFileName; +} + +sub getConfigFileName{ + return $configFileName; +} + sub getFileLevel{ return $fileLevelHash{$_[0]}; } @@ -15,6 +42,18 @@ sub getAncestryList{ return @ancestryList; } +sub getConfigTree{ + return $configTree; +} + +sub getSpecTree{ + return $specTree; +} + + + + + ############################### ## xml file operations ###############################