From 3653a0b1d1a575f1fcb92c2ec7e5244ea09b0519 Mon Sep 17 00:00:00 2001 From: Jan Michel Date: Tue, 2 Jul 2013 11:27:29 +0200 Subject: [PATCH] moved database, schema and setup to directories. Adjusted relative paths accordingly. --- xml-db/database/CTS.xml | 2 +- xml-db/database/HUB.xml | 2 +- xml-db/database/JtagController.xml | 2 +- xml-db/database/RDO.xml | 2 +- xml-db/database/TDC.xml | 2 +- xml-db/database/TrbNet.xml | 18 ++-- xml-db/{database => schema}/TrbNetCommon.xsd | 0 xml-db/{database => schema}/TrbNetEntity.xsd | 0 xml-db/{database => schema}/TrbNetSetup.xsd | 0 xml-db/setup/trb-setup-default.xml | 101 ++++++++++++++++++ xml-db/trb-setup.xml | 102 +------------------ xml-db/xml-db.pl | 10 +- 12 files changed, 121 insertions(+), 120 deletions(-) rename xml-db/{database => schema}/TrbNetCommon.xsd (100%) rename xml-db/{database => schema}/TrbNetEntity.xsd (100%) rename xml-db/{database => schema}/TrbNetSetup.xsd (100%) create mode 100644 xml-db/setup/trb-setup-default.xml mode change 100644 => 120000 xml-db/trb-setup.xml diff --git a/xml-db/database/CTS.xml b/xml-db/database/CTS.xml index ed6fc52..642637a 100644 --- a/xml-db/database/CTS.xml +++ b/xml-db/database/CTS.xml @@ -1,6 +1,6 @@ diff --git a/xml-db/database/HUB.xml b/xml-db/database/HUB.xml index 4a7597d..6585a37 100644 --- a/xml-db/database/HUB.xml +++ b/xml-db/database/HUB.xml @@ -1,6 +1,6 @@ diff --git a/xml-db/database/JtagController.xml b/xml-db/database/JtagController.xml index 4982cf4..eea44c5 100644 --- a/xml-db/database/JtagController.xml +++ b/xml-db/database/JtagController.xml @@ -1,6 +1,6 @@ diff --git a/xml-db/database/RDO.xml b/xml-db/database/RDO.xml index e5cc890..16a89b9 100644 --- a/xml-db/database/RDO.xml +++ b/xml-db/database/RDO.xml @@ -1,6 +1,6 @@ diff --git a/xml-db/database/TDC.xml b/xml-db/database/TDC.xml index 2dd89ec..7eecb3e 100644 --- a/xml-db/database/TDC.xml +++ b/xml-db/database/TDC.xml @@ -1,6 +1,6 @@ diff --git a/xml-db/database/TrbNet.xml b/xml-db/database/TrbNet.xml index 2b435c4..2c2f28b 100644 --- a/xml-db/database/TrbNet.xml +++ b/xml-db/database/TrbNet.xml @@ -1,23 +1,17 @@ Common Registers on allmost all endpoints - - IPU handler status register - - FSM state bits - IDLE - WaitForLength - GotLength - SendDHDR - ReadData - EndReadout + + Common Status Register 0 + + Board temperature diff --git a/xml-db/database/TrbNetCommon.xsd b/xml-db/schema/TrbNetCommon.xsd similarity index 100% rename from xml-db/database/TrbNetCommon.xsd rename to xml-db/schema/TrbNetCommon.xsd diff --git a/xml-db/database/TrbNetEntity.xsd b/xml-db/schema/TrbNetEntity.xsd similarity index 100% rename from xml-db/database/TrbNetEntity.xsd rename to xml-db/schema/TrbNetEntity.xsd diff --git a/xml-db/database/TrbNetSetup.xsd b/xml-db/schema/TrbNetSetup.xsd similarity index 100% rename from xml-db/database/TrbNetSetup.xsd rename to xml-db/schema/TrbNetSetup.xsd diff --git a/xml-db/setup/trb-setup-default.xml b/xml-db/setup/trb-setup-default.xml new file mode 100644 index 0000000..eed3e98 --- /dev/null +++ b/xml-db/setup/trb-setup-default.xml @@ -0,0 +1,101 @@ + + + + + + + + + + 5900000337e29728 + cf00000337e29e28 + ad00000338175028 + 0e00000338174b28 + 4400000338174628 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0-15 => 1, + 34 => 1, + + + + + + + + + + + Bla + 0-15 => 1, + 34 => 5, + + + + + + + + diff --git a/xml-db/trb-setup.xml b/xml-db/trb-setup.xml deleted file mode 100644 index c7d54bc..0000000 --- a/xml-db/trb-setup.xml +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - 5900000337e29728 - cf00000337e29e28 - ad00000338175028 - 0e00000338174b28 - 4400000338174628 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0-15 => 1, - 34 => 1, - - - - - - - - - - - Bla - 0-15 => 1, - 34 => 5, - - - - - - - - diff --git a/xml-db/trb-setup.xml b/xml-db/trb-setup.xml new file mode 120000 index 0000000..3c8d56f --- /dev/null +++ b/xml-db/trb-setup.xml @@ -0,0 +1 @@ +setup/trb-setup-default.xml \ No newline at end of file diff --git a/xml-db/xml-db.pl b/xml-db/xml-db.pl index 5f54796..54af587 100755 --- a/xml-db/xml-db.pl +++ b/xml-db/xml-db.pl @@ -22,6 +22,7 @@ my $help = 0; my $verbose = 0; my $warnings = 1; my $db_dir = "$RealBin/database"; +my $schema_dir = "$RealBin/schema"; my $dump_database = 0; Getopt::Long::Configure(qw(gnu_getopt)); @@ -31,6 +32,7 @@ GetOptions( 'verbose|v+' => \$verbose, 'warnings|w!' => \$warnings, 'db-dir=s' => \$db_dir, + 'schema-dir=s' => \$schema_dir, 'dump' => \$dump_database ) or pod2usage(2); pod2usage(1) if $help; @@ -39,6 +41,7 @@ pod2usage(-exitval => 0, -verbose => 2) if $man; # tell something about the configuration if ($verbose) { print STDERR "Database directory: $db_dir\n"; + print STDERR "Schema directory: $schema_dir\n"; # always enable warnings if verbose $warnings = 1; } @@ -290,8 +293,8 @@ sub LoadDBAndFiles { my $parser = XML::LibXML->new(line_numbers => 1); { - # change to the db_dir in the first part - local $CWD = $db_dir; + # change to the schema_dir in the first part + local $CWD = $schema_dir; # we first load the schemas and parse them @@ -302,6 +305,8 @@ sub LoadDBAndFiles { } # load the xml files in the database + # change to the db_dir in the first part + local $CWD = $db_dir; while (<*.xml>) { my $doc = $parser->parse_file($_); my $schema = ValidateXML($doc, $schemas); @@ -332,6 +337,7 @@ sub ValidateXML($$) { my $doc = shift; my $schemas = shift; my $xsd_file = $doc->getDocumentElement->getAttribute('xsi:noNamespaceSchemaLocation'); + ($xsd_file) = $xsd_file =~ m%.*/([^/]*)$%; die "Schema $xsd_file not found to validate <$_>" unless defined $schemas->{$xsd_file}; $schemas->{$xsd_file}->validate($doc); return $schemas->{$xsd_file}; -- 2.43.0