<xs:element ref="fifo" />
<xs:element name="field" type="fieldtype" />
</xs:choice>
- <xs:attribute name="type" type="xs:string" use="required" />
+ <xs:attribute name="ref" type="nametype" use="required" />
<xs:attribute name="address" type="addresstype" />
</xs:complexType>
<!-- we configure the trb endpoint with address 0x8000 -->
<trb address="8000">
- <entity type="TrbNet" />
+ <entity ref="TrbNet" />
<!-- it has a TDC (at default register address) -->
- <entity type="TDC">
+ <entity ref="TDC">
<!-- this way we modify the number of channels to 5. This works
since group/register/memory/fifo have unique names. It
might be that there are several places where one should
</entity>
<!-- and it has a CTS -->
- <entity type="CTS" />
+ <entity ref="CTS" />
</trb>
<trb address="0200">
<!-- Standard TrbNet enpoint with standard 65ch TDC... -->
- <entity type="TrbNet" />
- <entity type="TDC" />
+ <entity ref="TrbNet" />
+ <entity ref="TDC" />
<!-- ...but also some "external" PaDiWa frontends connected at
chain 0 and 2. The fronend has some more registers which can
be accessed via SPI. The idea is that there's also a
PaDiWa.pm in the database which handles this access, usually
via conventional TrbNet registers
-->
- <external type="PaDiWa" address="0000" />
- <external type="PaDiWa" address="0002" />
+ <external ref="PaDiWa" address="0000" />
+ <external ref="PaDiWa" address="0002" />
</trb>
<!-- An example how to execute a setting. In general, the entities
are identified by their type and address (if specified) -->
<trb address="0200">
- <entity type="TDC">
+ <entity ref="TDC">
<!-- this field is a bitmask, so there's a converter to easily
set single bits -->
<field name="ChannelEnable">
my ($db,$files) = &LoadDBAndFiles;
#print Dumper($files);
+ my $merged = {};
foreach my $item (@$files) {
my $file = $item->[0];
my $doc = $item->[1]; print "Working on $file...\n" if $verbose;
- my $merged = {};
+
foreach my $trbnode ($doc->getDocumentElement->findnodes('trb')) {
my $trbaddress = $trbnode->getAttribute('address');
print $trbaddress,"\n";
foreach my $entitynode ($trbnode->findnodes('entity')) {
- my $type = $entitynode->getAttribute('type');
+ my $ref = $entitynode->getAttribute('ref');
+
# check if we know this type
- FatalError($entitynode, "Entity type $type not found in database")
- unless defined $db->{"$type.xml"};
+ FatalError($entitynode, "Entity reference $ref not found in database")
+ unless defined $db->{$ref};
+
+ # check if there's
- print $type,"\n";
+ print $ref,"\n";
}
}
}
while (<*.xml>) {
my $doc = $parser->parse_file($_);
ValidateXML($doc, $schemas);
- $db->{$_} = $doc;
- print "Loaded and validated <$_> from database\n" if $verbose;
+ my $dbname = $doc->getDocumentElement->getAttribute('name');
+ $db->{$dbname} = $doc;
+ print "Loaded and validated entity <$dbname> from db/$_\n" if $verbose;
}
}