# TODO
+# remove CGI processing routines that are now in xmlOperation.pl
+# still there but commented out
+
# substitute selectedConfigFile() with "$configFileName" inside print_registers and print_fieldsi
# outsource print_registers and print_fields to xmlOperations
# correct size in tooltip
-# build ancestry without ancestry tree outside
+
# find a solution for fileLevel <=6
# our to ENV
# DONE
+# build ancestry without ancestry tree outside
# do not include wrong type, different specfile
# whine, wenn specfile/setfiles not found
# supress circular dependencies
print $cgiHash{'debuginput'};
}
-if ( defined $cgiHash{'action'} ) {
-
- printHash( \%cgiHash );
- if ( $cgiHash{'action'} eq 'save' ) {
- parseConfigFile( $cgiHash{'configFile'} );
- save( $cgiHash{'register'}, $cgiHash{'field'}, $cgiHash{'value'} );
- writeConfigFile();
- }
- if ( $cgiHash{'action'} eq 'delete' ) {
- parseConfigFile( $cgiHash{'configFile'} );
- del( $cgiHash{'register'}, $cgiHash{'field'} );
- writeConfigFile();
- }
- if ( $cgiHash{'action'} eq 'copyDefaultRegister' ) {
- parseConfigAndSpec( $cgiHash{'configFile'} );
- del( $cgiHash{'register'}, "" ); # delete existing register from setfile
- copyDefaultRegister( $cgiHash{'register'} );
- writeConfigFile();
- }
- if ( $cgiHash{'action'} eq 'createFile' ) {
- createConfigFile( $cgiHash{'configFile'}, $cgiHash{'specFile'} );
- writeConfigFile();
- }
-
- if ( $cgiHash{'action'} eq 'deleteFile' ) {
- deleteFile( $cgiHash{'configFile'} );
- }
-
- if ( $cgiHash{'action'} eq 'changeAncestor' ) {
- parseConfigFile( $cgiHash{'configFile'} );
- changeAncestor( $cgiHash{'newAncestor'} );
- writeConfigFile();
- }
-
-}
+# # obsolete
+# if ( defined $cgiHash{'action'} ) {
+#
+# printHash( \%cgiHash );
+# if ( $cgiHash{'action'} eq 'save' ) {
+# parseConfigFile( $cgiHash{'configFile'} );
+# save( $cgiHash{'register'}, $cgiHash{'field'}, $cgiHash{'value'} );
+# writeConfigFile();
+# }
+# if ( $cgiHash{'action'} eq 'delete' ) {
+# parseConfigFile( $cgiHash{'configFile'} );
+# del( $cgiHash{'register'}, $cgiHash{'field'} );
+# writeConfigFile();
+# }
+# if ( $cgiHash{'action'} eq 'copyDefaultRegister' ) {
+# parseConfigAndSpec( $cgiHash{'configFile'} );
+# del( $cgiHash{'register'}, "" ); # delete existing register from setfile
+# copyDefaultRegister( $cgiHash{'register'} );
+# writeConfigFile();
+# }
+# if ( $cgiHash{'action'} eq 'createFile' ) {
+# createConfigFile( $cgiHash{'configFile'}, $cgiHash{'specFile'} );
+# writeConfigFile();
+# }
+#
+# if ( $cgiHash{'action'} eq 'deleteFile' ) {
+# deleteFile( $cgiHash{'configFile'} );
+# }
+#
+# if ( $cgiHash{'action'} eq 'changeAncestor' ) {
+# parseConfigFile( $cgiHash{'configFile'} );
+# changeAncestor( $cgiHash{'newAncestor'} );
+# writeConfigFile();
+# }
+#
+# }
#################### SUBLAND ######################
print '</td>';
if ( $xmlfile eq $specFile ) { # we are printing the Specifications tree
print <<EOF;
-<td class='button_move' onclick='saveSettings(selectedConfigFile(),"$registerName","$fieldName","$fieldValue");'> → </td>
+<td class='button_move' onclick='saveSettings(selectedConfigFile(),"$registerName","$fieldName","$fieldValue");reloadSetTree()'> → </td>
EOF
}
if ( $xmlfile eq $configFile ) { # we are printing the Settings Tree
my $sensorPosition = $sensor->findnodes("./position")->shift();
my $sensorDescription = $sensor->findvalue("./description");
- print h5("Sensor name:$sensorName id:$sensorId");
- print "<p>description: $sensorDescription</p>";
+# print h5("Sensor name:$sensorName id:$sensorId");
+# print "<p>description: $sensorDescription</p>";
print_sensorArea($sensor);
}
print "<div class='sensorAreaDiv' id='".$sensorAreaId."'>";
print "<table class='sensorAreaTable'>";
print "<tr>";
- print "<td colspan=2 align='center' class='td_solid'>$sensorName</td>";
+ print "<td colspan=2 align='center' class='td_solid'>";
+ print "<table><tr><td>$sensorName (id=$sensorId)</td></tr>";
+ print "<tr><td>description: $sensorDescription</td></tr></table>";
+ print "</td>";
print "</tr>";
print "<tr>";
my $previewAreaId = "preview_".$sensorId;
my $xmlfile = $_[0];
my $xmltree;
- if ( $xmlfile eq $configFile ) {
- $xmltree = $configTree;
- }
- elsif ( $xmlfile eq $specFile ) {
- $xmltree = $specTree;
- }
- else {
- die "xmlfile given to sub print_registers is unknown";
- }
- my @registers = sort by_name $xmltree->findnodes("/MAPS/register");
+# if ( $xmlfile eq $configFile ) {
+# $xmltree = $configTree;
+# }
+# elsif ( $xmlfile eq $specFile ) {
+# $xmltree = $specTree;
+# }
+# else {
+# die "xmlfile given to sub print_registers is unknown";
+# }
+ my @registers = sort by_name $quickEditMaskTree->findnodes("/MAPS/register");
print "<table class=\"registers\"";
if ( $xmlfile eq $configFile ) {
print "id='configFileRegisters'";
my $registerName = $register->findvalue("./\@name");
- # if register not in the mask file, don't print!
- unless( $quickEditMaskTree->findnodes("/MAPS/register[\@name='".
- $registerName."']")) {
- next;
- }
+# # if register not in the mask file, don't print!
+# unless( $quickEditMaskTree->findnodes("/MAPS/register[\@name='".
+# $registerName."']")) {
+# next;
+# }
my $registerId = $register->findvalue("./\@id");
my $registerSize = $register->findvalue("./\@size");
|| "n/a"
);
- my $flistid = $xmlfile . "//" . $registerName;
+ my $flistid = $configFile . "//" . $registerName;
print "<tr>";
<td class='button_move' onclick='deleteSettings("$configFileName","$registerName","");reloadQuickEditArea("$configFileName","$quickEditAreaId")'> X </td>
EOF
}
- if ( $xmlfile eq $specFile ) { # we are printing the Settings Tree
- print <<EOF;
-<td class='button_move' onclick='copyDefaultRegister("$configFileName","$registerName");reloadQuickEditArea("$configFileName","$quickEditAreaId")'> → </td>
-EOF
- }
print "</tr>";
print '<tr id="' . $flistid . '" class="bitfield">';
print '<td></td>';
print '<td class="fieldcontainer">';
- print_fields( $xmlfile, $register );
+ print_fields( $configFile, $register );
print "<td>";
print "</tr>";
}
my $register = $_[1];
my $xmlfile = $_[0];
my $registerName = $register->findvalue("./\@name");
- my @fields = sort by_name $register->findnodes("./field");
+ my @maskFields = sort by_name $register->findnodes("./field");
print "<table class=\"fields\">";
- for my $field (@fields) {
- my $fieldName = $field->findvalue("./\@name");
- # if field not in the mask file, don't print!
- unless( $quickEditMaskTree->findnodes("/MAPS/register[\@name='".
- $registerName."']/field[\@name='".$fieldName."']")) {
- next;
+ for my $maskField (@maskFields) {
+
+ my $fieldName = $maskField->findvalue("./\@name");
+
+ my $field = $configTree->findnodes("/MAPS/register[\@name='".
+ $registerName."']/field[\@name='".$fieldName."']")->shift();
+
+
+ unless(defined($field)){
+
+ my $specField = $specTree->findnodes("/MAPS/register[\@name='".
+ $registerName."']/field[\@name='".$fieldName."']")->shift();
+ $field=$register->addNewChild("","field");
+ $field->setAttribute("name",$fieldName);
+ $field->setAttribute("value",$specField->findvalue("./\@defaultValue"));
+ $field->setAttribute( "isHeritageFrom", $specFileName );
}
+
+
+
+
+# # if field not in the mask file, don't print!
+# unless( $quickEditMaskTree->findnodes("/MAPS/register[\@name='".
+# $registerName."']/field[\@name='".$fieldName."']")) {
+# next;
+# }
my $isHeritageFrom = $field->findvalue("./\@isHeritageFrom") || "";
+# my $isHeritageFrom = "";
my $readOnlyFlag = 0;
my $fieldValue = $field->findvalue("./\@value");
my $fieldSize =