Simulator Configuration and Usage

Simulator Types

The simulator controller manages four simulator types, each with different configuration. The following sections describe the configuration of the simulator controller and each simulator type including usage instructions:

Simulator Controller

Configuration of the Fosstrak Reader

The following XML code is an example on how to configure the Fosstrak Reader to use the HAL implementation of the simulator controller. The name can be chosen arbitrary but must be unique if multiple readers are configured. The class implementing the HardwareAbstraction interface for the simulator controller is org.fosstrak.hal.impl.sim.SimulatorController. The properties element contains the path to the configuration file. For information about this see the configuration file example below.

<?xml version="1.0" encoding="UTF-8"?>
<properties>

   <!-- ... other configuration elements ... -->

   <!-- All readers (HardwareAbstractions) used -->
      <readers>
         <reader>
            <name>SimulatorController</name>
            <class>org.fosstrak.hal.impl.sim.SimulatorController</class>
            <properties>/props/SimulatorController.xml</properties>
            <readpoint>Shelf1</readpoint>
            <readpoint>Shelf2</readpoint>
            <readpoint>Shelf3</readpoint>
            <readpoint>Shelf4</readpoint>
         </reader>
      </readers>
   <!-- End -->

   <!-- ... other configuration elements ... -->

</properties>

Configuration File Example

This is an example of a configuration file for the simulator controller. All options with their comments should be self-explanatory.

<?xml version="1.0" encoding="UTF-8"?>
<properties>

   <!-- SimulatorType to be loaded dynamically -->
   <simType>org.fosstrak.hal.impl.sim.GraphicSimulator</simType>
   <simTypePropFile>/props/GraphicSimulator.xml</simTypePropFile>

   <!-- Configuration file with all the transponder models -->
   <epcTransponderModelsConfig>/props/EPCTransponderModels_default.xml</epcTransponderModelsConfig>
   <!-- The IdTypes configuration file -->
   <idTypesConfig>/props/IDTypes_default.xml</idTypesConfig>

   <!-- Read point definition -->
   <numberOfReadPoints>4</numberOfReadPoints>
   <!-- readpoints numebred readPoint_1 ... readPoint_n (at the moment) -->
   <!-- the client has to use these names to address these read points -->
   <!-- example: <readPoint_1>Antenna1</readPoint_1> -->
   <readPoint_1>Shelf1</readPoint_1>
   <readPoint_2>Shelf2</readPoint_2>
   <readPoint_3>Shelf3</readPoint_3>
   <readPoint_4>Shelf4</readPoint_4>

</properties>

Graphic Simulator

Configuration of the Simulator Controller

The following XML code is an example on how to configure the Simulator Controller to use this simulator. The class implementing the SimulatorEngine interface for the graphic simulator is org.fosstrak.hal.impl.sim.GraphicSimulator. The simTypePropFile element contains the path to the configuration file. For information about this see the configuration file example below.

<?xml version="1.0" encoding="UTF-8"?>
<properties>

   <!-- SimulatorType to be loaded dynamically -->
   <simType>org.fosstrak.reader.hal.impl.sim.GraphicSimulator</simType>
   <simTypePropFile>/props/GraphicSimulator.xml</simTypePropFile>

   <!-- ... other configuration elements ... -->

</properties>

Configuration File Example

<?xml version="1.0" encoding="UTF-8"?>
<properties>

   <!-- language -->
   <Language>en</Language>

   <!-- rfid reader -->
   <ReaderImage>/images/rfid-reader_default.png</ReaderImage>
   <ReaderWidth>141</ReaderWidth>
   <ReaderHeight>100</ReaderHeight>
   <ReaderLabelSize>10</ReaderLabelSize>
   <ReaderLabelFont>Verdana</ReaderLabelFont>
   <InterReaderPadding>200</InterReaderPadding>

   <!-- rfid antenna -->
   <AntennasPerRow>4</AntennasPerRow>
   <AntennaImage>/images/rfid-antenna_default.png</AntennaImage>
   <AntennaLabelFont>Verdana</AntennaLabelFont>
   <AntennaLabelSize>10</AntennaLabelSize>
   <AntennaWidth>100</AntennaWidth>
   <AntennaHeight>110</AntennaHeight>
   <HorizontalInterAntennaPadding>120</HorizontalInterAntennaPadding>
   <VerticalInterAntennaPadding>60</VerticalInterAntennaPadding>

   <!-- rfid tag -->
   <TagImage>/images/rfid-tag_default.png</TagImage>
   <TagLabelFont>Verdana</TagLabelFont>
   <TagLabelSize>10</TagLabelSize>
   <TagWidth>100</TagWidth>
   <TagHeight>20</TagHeight>
   <InterTagPadding>10</InterTagPadding>
   <TagPrefix>9204F0004B0</TagPrefix>

   <!-- paddings -->
   <FramePadding>50</FramePadding>
   <HorizontalPadding>50</HorizontalPadding>
   <VerticalPadding>50</VerticalPadding>

   <!-- window -->
   <MinimumWindowWidth>800</MinimumWindowWidth>
   <MinimumWindowHeight>400</MinimumWindowHeight>

   <!-- dialog windows -->
   <DialogWindowWidth>800</DialogWindowWidth>
   <DialogWindowHeight>120</DialogWindowHeight>

</properties>

Usage

Handling of the graphic simulater is very intuitive. Tags can be created via the 'Tag' - 'Add new Tag' menu item or the context menu. Drag tags over an antenna to read them.

Graphic Simulator User Interface

The memory of a tag can be accessed and changed by hand through its context menu.

Memory Access

Batch Simulator

Configuration of the Simulator Controller

The following XML code is an example on how to configure the Simulator Controller to use this simulator. The class implementing the SimulatorEngine interface for the batch simulator is org.fosstrak.hal.impl.sim.BatchSimulator. The simTypePropFile element contains the path to the configuration file. For information about this see the configuration file example below.

<?xml version="1.0" encoding="UTF-8"?>
<properties>

   <!-- SimulatorType to be loaded dynamically -->
   <simType>org.fosstrak.reader.hal.impl.sim.BatchSimulator</simType>
   <simTypePropFile>/props/BatchSimulator.xml</simTypePropFile>

   <!-- ... other configuration elements ... -->

</properties>

Configuration File Example

<?xml version="1.0" encoding="UTF-8"?>
<!-- Properties file for BatchSimulator -->
<properties>

   <!-- Absolute file path or name of the batch file -->
   <!-- Value: file URL or name -->
   <!-- Example: C:\project\props\batchfile.txt -->
   <!-- Example: /props/batchfile.txt -->
   <batchfile>/props/batchfile.txt</batchfile>

   <!-- Number of iterations to execute -->
   <!-- Value: iterations (long) -->
   <iterations>3</iterations>

</properties>

Usage

Example batch file with comments:

# Example batch file for Fosstrak BatchSimulator
# Author: Jonas Haller
#
# Lines beginning with '#' are not processed (comments)
# An event line has the following form:
#  <time>;<eventTypeName>;<sourceID>;<serial>;<userMemoryData>
# The values have following meaning:
#  <time>: Time after last event in milliseconds, must fit into a long
#  <eventTypeName>: Type of the event, 'EN' for enter, 'EX' for exit
#  <sourceID>: ID of the source (read point name)
#  <serial>: Serial number of the tag triggering the event
#  <userMemoryData>: String containing the user memory data of the tag or 'null' if none
# Example of an event line:
#  1000;EN;Antenna;9204F0004B00001;0123456789ABCDEF
500;EN;Shelf1;9204F0004B00001;null
500;EX;Shelf1;9204F0004B00001;null

With this batch file a tag enters the range of antenna 'Shelf1' 500 milliseconds after starting the simulator. An other 500 ms later the tag leaves the read range of the antenna.

Command Line Simulator

Configuration of the Simulator Controller

The following XML code is an example on how to configure the Simulator Controller to use this simulator. The class implementing the SimulatorEngine interface for the command line simulator is org.fosstrak.hal.impl.sim.CmdLineSim. The simTypePropFile element can be left empty as this simulator does not need any configuration.

<?xml version="1.0" encoding="UTF-8"?>
<properties>

   <!-- SimulatorType to be loaded dynamically -->
   <simType>org.fosstrak.reader.hal.impl.sim.CmdLineSim</simType>
   <simTypePropFile></simTypePropFile>

   <!-- ... other configuration elements ... -->

</properties>

Configuration

The command line simulator does not need any configuration.

Usage

After starting the command line simulator, a prompt is shown in the console and awaits one of the following commands:

  • sourceids : Lists all available source IDs
  • add : Asks for a source ID and a tag ID and adds the tag to this source
  • remove : Asks for a source ID and a tag ID and removes the tag from this source
  • contains : Asks for a source ID and a tag ID and returnes 'Yes' if the source contains this tag
  • getall : Asks for a source ID and lists all tags contained by this source
  • exit : Exit the command line simulator

Multi Simulator

Configuration of the Simulator Controller

The following XML code is an example on how to configure the Simulator Controller to use this simulator. The class implementing the SimulatorEngine interface for the multi simulator is org.fosstrak.hal.impl.sim.SimulatorClient. The simTypePropFile element contains the path to the configuration file of the simulator client. For information about this see the configuration file example below.

<?xml version="1.0" encoding="UTF-8"?>
<properties>

   <!-- SimulatorType to be loaded dynamically -->
   <simType>org.fosstrak.reader.hal.impl.sim.SimulatorClient</simType>
   <simTypePropFile>/props/SimulatorClient.xml</simTypePropFile>

   <!-- ... other configuration elements ... -->

</properties>

Configuration File Example

Simulator client:

<?xml version="1.0" encoding="UTF-8"?>
<properties>

   <!-- the host to connect to -->
   <host>localhost</host>

   <!-- the port to connect to -->
   <port>8800</port>

   <!-- the waittime between connection attempts in ms -->
   <waittime>500</waittime>

   <!-- the timeout for connection attempt in ms-->
   <timeout>3000</timeout>

</properties>

Simulator server controller (SimulatorServerController.xml):

<?xml version="1.0" encoding="UTF-8"?>
<properties>

   <!-- SimulatorType to be loaded dynamically -->
   <simType>org.fosstrak.reader.hal.impl.sim.multi.GraphicSimulatorServer</simType>
   <simTypePropFile>/props/GraphicSimulator.xml</simTypePropFile>

   <!-- the port to listen to -->
   <port>8800</port>

</properties>

Usage

The multi simulator consists of a client implementing the SimulatorEngine interface and connecting to a server through TCP/IP. The server can run on an other computer and starts a graphic, batch or command line simulator. The events generated by the simulator on the server are sent to the client.

Executing the main method of the class org.fosstrak.hal.impl.sim.multi.SimulatorServerController starts the simulator server.

See the user guide of the simulator type configured in the simulator server controller configuration file.