Difference between revisions of "Emulator.xml"
From RifidiWiki
(→Reference Implementation) |
|||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
+ | [[category:developerDoc]][[category:emulatorDoc]] | ||
Emulator.xml is a file that contains the information used to start up a reader. Readers typically have a set of inputs that are required to be able to create it, for example IP addresses, number of antennas, number of GPIs, etc. This file is used to supply that information to the ReaderModule, which handles the creation of a reader. | Emulator.xml is a file that contains the information used to start up a reader. Readers typically have a set of inputs that are required to be able to create it, for example IP addresses, number of antennas, number of GPIs, etc. This file is used to supply that information to the ReaderModule, which handles the creation of a reader. | ||
Line 68: | Line 69: | ||
</pre> | </pre> | ||
− | = | + | =property= |
− | + | Each reader can have its own set of information required to start it. These are supplied using the propery tags. | |
− | + | ||
==Sub elements== | ==Sub elements== | ||
− | + | #required - Whether or not this property is required. If the property is not required, the reader should be able to be created without needing this property. | |
− | + | #name - The name of the property. This will be used in the readerModule as a key to get the value of the property out of a hashmap | |
+ | #display - The display name of the property in the reader creation wizzard | ||
+ | #tooltip - The mouseover text in the reader creation wizzard | ||
+ | #defaultvalue - The default value of the property | ||
+ | #validatorclassname - Which validator should be used to make sure that a user enters in the proper value into the reader creation wizzard for this field. Some common validators are: | ||
+ | *IpAddressValidator | ||
+ | *BooleanValidator | ||
+ | *PositiveIntegerValidator | ||
==Reference Implementation== | ==Reference Implementation== | ||
− | + | These are the property tags in the alien reader. Notice that each one of these tags correspond to a value that the user can enter in the reader creation wizzard | |
<pre> | <pre> | ||
− | < | + | <property> |
+ | <required>1</required> | ||
+ | <name>inet_address</name> | ||
+ | <display>ip address</display> | ||
+ | <tooltip>The address the reader should be reachable through</tooltip> | ||
+ | <defaultvalue>127.0.0.1:20000</defaultvalue> | ||
+ | <validatorclassname>IpAddressValidator</validatorclassname> | ||
+ | </property> | ||
+ | <property> | ||
+ | <required>1</required> | ||
+ | <name>heartbeat_address</name> | ||
+ | <display>heartbeat address</display> | ||
+ | <tooltip>The address the heartbeat should bind to</tooltip> | ||
+ | <defaultvalue>255.255.255.255:3988</defaultvalue> | ||
+ | <validatorclassname>IpAddressValidator</validatorclassname> | ||
+ | </property> | ||
+ | <property> | ||
+ | <required>0</required> | ||
+ | <name>heartbeat_power</name> | ||
+ | <display>Enable Heartbeat for this reader</display> | ||
+ | <tooltip>Whether or not the heartbeat is activated</tooltip> | ||
+ | <defaultvalue>0</defaultvalue> | ||
+ | <validatorclassname>BooleanValidator</validatorclassname> | ||
+ | </property> | ||
+ | <property> | ||
+ | <required>0</required> | ||
+ | <name>heartbeat_port</name> | ||
+ | <display>Heartbeat binding port</display> | ||
+ | <tooltip>Enter the port the hearbeat broadcast should bind to</tooltip> | ||
+ | <defaultvalue>3989</defaultvalue> | ||
+ | <validatorclassname>PositiveIntegerValidator</validatorclassname> | ||
+ | </property> | ||
</pre> | </pre> |
Latest revision as of 19:44, 26 November 2010
Emulator.xml is a file that contains the information used to start up a reader. Readers typically have a set of inputs that are required to be able to create it, for example IP addresses, number of antennas, number of GPIs, etc. This file is used to supply that information to the ReaderModule, which handles the creation of a reader.
The information in this file are basically of two types:
- Information that is common to all readers in order to start them. These pieces of information have their own tags and should be included in all the reader's emulator.xml file
- Information that is specific to the reader. Information of this type will be supplied using a <property> tag
The reader creation wizzard in the UI will automatically add places to collect information according to the <property> tags in the emulator.xml. For example, if an IP address is listed as a property in the emulator.xml, the reader creation wizzard will automatically add a space to collect that information.
readerclassname
This tag is required by all readers. It is path to the ReaderModule.
Sub elements
none
Reference Implementation
This is the readerClassName tag in the alien reader
<readerclassname>org.rifidi.emulator.reader.alien.module.AlienReaderModule</readerclassname>
description
A short description of the type of the reader. It is required by all readers
Sub elements
none
Reference Implementation
This is the description tag in the alien reader
<description>Emulator for the Alien 9800</description>
maxantennas
The maximum number of antennas that this reader supports. It is required by all readers
Sub elements
none
Reference Implementation
This is the maxantennas tag in the alien reader
<maxantennas>4</maxantennas>
maxgpis
The maximum number of GPIs that this reader supports. It is required by all readers
Sub elements
none
Reference Implementation
This is the maxgpis tag in the alien reader
<maxgpis>4</maxgpis>
maxgpos
The maximum number of gpos that this reader supports. It is required by all readers
Sub elements
none
Reference Implementation
This is the maxgpos tag in the alien reader
<maxgpos>8</maxgpos>
property
Each reader can have its own set of information required to start it. These are supplied using the propery tags.
Sub elements
- required - Whether or not this property is required. If the property is not required, the reader should be able to be created without needing this property.
- name - The name of the property. This will be used in the readerModule as a key to get the value of the property out of a hashmap
- display - The display name of the property in the reader creation wizzard
- tooltip - The mouseover text in the reader creation wizzard
- defaultvalue - The default value of the property
- validatorclassname - Which validator should be used to make sure that a user enters in the proper value into the reader creation wizzard for this field. Some common validators are:
- IpAddressValidator
- BooleanValidator
- PositiveIntegerValidator
Reference Implementation
These are the property tags in the alien reader. Notice that each one of these tags correspond to a value that the user can enter in the reader creation wizzard
<property> <required>1</required> <name>inet_address</name> <display>ip address</display> <tooltip>The address the reader should be reachable through</tooltip> <defaultvalue>127.0.0.1:20000</defaultvalue> <validatorclassname>IpAddressValidator</validatorclassname> </property> <property> <required>1</required> <name>heartbeat_address</name> <display>heartbeat address</display> <tooltip>The address the heartbeat should bind to</tooltip> <defaultvalue>255.255.255.255:3988</defaultvalue> <validatorclassname>IpAddressValidator</validatorclassname> </property> <property> <required>0</required> <name>heartbeat_power</name> <display>Enable Heartbeat for this reader</display> <tooltip>Whether or not the heartbeat is activated</tooltip> <defaultvalue>0</defaultvalue> <validatorclassname>BooleanValidator</validatorclassname> </property> <property> <required>0</required> <name>heartbeat_port</name> <display>Heartbeat binding port</display> <tooltip>Enter the port the hearbeat broadcast should bind to</tooltip> <defaultvalue>3989</defaultvalue> <validatorclassname>PositiveIntegerValidator</validatorclassname> </property>