-src => './testgui.js'}
);
#process the arguments
+
+
report_param();
}
-style=>[{'src'=>'../layout/styles.css'},
{'src'=>'../layout/testgui.css'}
],
--script=>{ -type => 'text/javascript',
--src => './testgui.js'}
+-script=>[
+{ -type => 'text/javascript', -src => './testgui.js'},
+{ -type => 'text/javascript', -src => './xmlOperations.js'}
+]
);
print h2("testgui");
}
+# 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 ) {
+# $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");
+# print "<table class=\"registers\"";
+# if ( $xmlfile eq $configFile ) {
+# print "id='configFileRegisters'";
+# }
+# print ">";
+#
+# for my $register (@registers) {
+#
+#
+# my $registerName = $register->findvalue("./\@name");
+#
+# # 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");
+# my $registerDescr = prepare_text(
+# $specTree->findvalue(
+# "/MAPS/register[\@name='" . $registerName . "']/description"
+# )
+# || "n/a"
+# );
+#
+# my $flistid = $xmlfile . "//" . $registerName;
+#
+# print "<tr>";
+#
+# print <<EOF;
+# <td onClick='toggleVis("$flistid",this)' class='regheader'> + </td>
+# EOF
+# 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("$registerName","");'> X </td>
+# EOF
+# }
+# if ( $xmlfile eq $specFile ) { # we are printing the Settings Tree
+#
+# print <<EOF;
+# <td class='button_move' onclick='copyDefaultRegister("$registerName");'> → </td>
+# EOF
+# }
+#
+# print "</tr>";
+#
+# #print "<tr>";
+#
+# print '<tr id="' . $flistid . '" background=dea>';
+# print '<td></td>';
+# print '<td class="fieldcontainer">';
+# print_fields( $xmlfile, $register );
+# print "<td>";
+# print "</tr>";
+# }
+# print "</table>";
+# }
+#
+#
+# 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");
+# my @fields = 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;
+# }
+#
+# my $isHeritageFrom = $field->findvalue("./\@isHeritageFrom") || "";
+# my $readOnlyFlag = 0;
+# my $fieldValue = $field->findvalue("./\@value");
+# my $fieldSize =
+# $specTree->findvalue( "/MAPS/register[\@name='"
+# . $registerName
+# . "']/field[\@name='"
+# . $fieldName
+# . "']/\@size" )
+# || "n/a";
+# my $fieldDescr = prepare_text(
+# $specTree->findvalue(
+# "/MAPS/register[\@name='"
+# . $registerName
+# . "']/field[\@name='"
+# . $fieldName
+# . "']/description"
+# )
+# || "n/a"
+# );
+#
+# my $maxFieldVal = 2**$fieldSize;
+# my $sizeInfo =
+# sprintf(
+# "Field contains %d bits, possible values: 0-%d (0x0-0x%x)\n\n",
+# $fieldSize, $maxFieldVal, $maxFieldVal );
+#
+# $fieldDescr = $sizeInfo . $fieldDescr;
+#
+# unless ( $isHeritageFrom eq "" ) {
+# $fieldDescr =
+# "Field was inherited from $isHeritageFrom\n\n" . $fieldDescr;
+# }
+#
+# my $fieldId = $xmlfile . "//" . $registerName . "/" . $fieldName;
+# if ( $fieldValue eq "" ) {
+# $fieldValue = $field->findvalue("./\@defaultValue");
+# $readOnlyFlag = 1;
+# }
+#
+# print "<tr class='fileLevel" . getFileLevel($isHeritageFrom) . "'>";
+# print "<td width=120 title=\"$fieldDescr\"";
+# print ">$fieldName</td>";
+# print "<td> = </td>";
+# if ($readOnlyFlag) {
+# print <<EOF;
+# <td width=120 align='right'>$fieldValue</td>
+# EOF
+# }
+# else {
+# print <<EOF;
+# <td align='right'>
+# <input type='text' align='right' value='$fieldValue' onchange='saveSettings("$registerName","$fieldName",this.value)' >
+# </td>
+# EOF
+#
+# }
+#
+# print '</td>';
+# if ( $xmlfile eq $specFile ) { # we are printing the Specifications tree
+# print <<EOF;
+# <td class='button_move' onclick='saveSettings("$registerName","$fieldName","$fieldValue");'> → </td>
+# EOF
+# }
+# if ( $xmlfile eq $configFile ) { # we are printing the Settings Tree
+#
+# if ( $isHeritageFrom eq "" )
+# { # these are actual settings, not inherited!
+# print <<EOF;
+# <td class='button_move' onclick='deleteSettings("$registerName","$fieldName");'> X </td>
+# EOF
+# }
+# else {
+# print "<td class='button_move_deac'> X </td>";
+# }
+# }
+# print "</tr>";
+# if ( ( any2dec($fieldValue) < 0 )
+# or ( any2dec($fieldValue) > $maxFieldVal ) )
+# {
+# print
+# "<tr class='fieldError'><td colspan = 4 align='center'>!!!Above value not in allowed range!!!</td></tr>"
+# ; # just debug
+# }
+# }
+# print "</table>";
+#
+# }
+
+
sub print_registers {
my $configFile = getConfigFile();
else {
die "xmlfile given to sub print_registers is unknown";
}
-
my @registers = sort by_name $xmltree->findnodes("/MAPS/register");
print "<table class=\"registers\"";
if ( $xmlfile eq $configFile ) {
print "id='configFileRegisters'";
}
print ">";
-
for my $register (@registers) {
-
my $registerName = $register->findvalue("./\@name");
- # if register not in the mask file, don't print!
+ # if register not in the mask file, don't print!
unless( $quickEditMaskTree->findnodes("/MAPS/register[\@name='".
$registerName."']")) {
next;
if ( $xmlfile eq $configFile ) { # we are printing the Specifications Tree
print <<EOF;
-<td class='button_move' onclick='deleteSettings("$registerName","");'> X </td>
+<td class='button_move' onclick='deleteSettings(selectedConfigFile(),"$registerName","");reloadSetTree()'> X </td>
EOF
}
if ( $xmlfile eq $specFile ) { # we are printing the Settings Tree
print <<EOF;
-<td class='button_move' onclick='copyDefaultRegister("$registerName");'> → </td>
+<td class='button_move' onclick='copyDefaultRegister(selectedConfigFile(),"$registerName");reloadSetTree()'> → </td>
EOF
}
#print "<tr>";
- print '<tr id="' . $flistid . '" background=dea>';
+ print '<tr id="' . $flistid . '" class="bitfield">';
print '<td></td>';
print '<td class="fieldcontainer">';
print_fields( $xmlfile, $register );
print "</table>";
}
-
sub print_fields {
my $configFile = getConfigFile();
my @fields = 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!
+ 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;
}
-
+
my $isHeritageFrom = $field->findvalue("./\@isHeritageFrom") || "";
my $readOnlyFlag = 0;
my $fieldValue = $field->findvalue("./\@value");
else {
print <<EOF;
<td align='right'>
-<input type='text' align='right' value='$fieldValue' onchange='saveSettings("$registerName","$fieldName",this.value)' >
+<input type='text' align='right' value='$fieldValue' onchange='saveSettings(selectedConfigFile(),"$registerName","$fieldName",this.value);reloadSetTree()' >
</td>
EOF
print '</td>';
if ( $xmlfile eq $specFile ) { # we are printing the Specifications tree
print <<EOF;
-<td class='button_move' onclick='saveSettings("$registerName","$fieldName","$fieldValue");'> → </td>
+<td class='button_move' onclick='saveSettings(selectedConfigFile(),"$registerName","$fieldName","$fieldValue");'> → </td>
EOF
}
if ( $xmlfile eq $configFile ) { # we are printing the Settings Tree
if ( $isHeritageFrom eq "" )
{ # these are actual settings, not inherited!
print <<EOF;
-<td class='button_move' onclick='deleteSettings("$registerName","$fieldName");'> X </td>
+<td class='button_move' onclick='deleteSettings(selectedConfigFile(),"$registerName","$fieldName");reloadSetTree()'> X </td>
EOF
}
else {
print "</table>";
}
-