Front End Software
The underlying technology for the front-end has changed a few times.
I used a Visual Basic program running on Win3.1 in the distant past. After
the javax.comm classes, I replaced it with a java/swing UI. This time
around, I thought of using a browser as a front-end. This would let me
write it all using java and not touch the code hairball of the previous
ajax. Having just finished a commercial project with the same ingredients,
it was easy to get something up and running.
The program has(or will have) the following features.
- Increase or decrease the speed of the loco by a single
step. Only 14 speed steps are supported. The current speed is
- Stop the loco.
- Send out packets to the command station in my own format.
- Display a schematic of the layout
- Control turnouts on the schematic layout
- Front-end is configured using an XML file
- Emergency Stop for the entire layout
- Front-end for programming a decoder
- Programming front-end is configured using another XML file
The front-end program is written in java. It implements a simple
web server and also interfaces to the Command Station through a serial
Any user interaction of the user with the browser front-end results in an
ajax request to the program. The program converts the request into a
packet sent to the command station.
The block diagram above shows the components of the browser based layout
- Browser front-end
build up the user interface. It uses ajax to communicate with the
|Pic 1 - Browser based front-end
||Pic 2 - Programming front-end
- Web Server
Handles all requests from the browser. It supports two types of requests -
one for static files and the other is for commands to be executed. The
commands are used to send DCC packets to control the layout.
- Layout Engine
Holds the current status of the layout. It also communicates with the
Command Station Interface to send DCC commands. The current version
acts as a simulator to allow the front-end to be tested without a
command station connected.
- Decoder Engine
Not shown in the diagram but is similar in concept to the Layout Engine.
Holds the current status of the layout item being programmed. It converts
commands received from the Web Server into one or more Command Station
instructions. The current version acts as a simulator to allow the
programming front-end to be tested without a command station and decoder.
- Command Station Interface
The Command Station Interface takes high level commands from the Layout
Engine and translates them into DCC commands. These are then sent out to
the Command Station over the RS-232 serial port.
Some features I intend to add when I get around to it are
- Support for signals.
- Support for functions like headlights on a loco.
- Support for oddball DCC driven accessories like turntables.
The front-end has undergone major changes. The pages describing previous swing based front-end and the VB based front-end are available.
Updated on 15 Jan 2002. Feedback to