Let The Computer Drive Today
the circuits was easy compared to writing the Windows program that
operates the railroad. I wrote the C++ program with windows API
code, the low level language of Microsoft's MFC. There
are about 3 thousand instructions to choose from and finding the right one
for the job is pretty tough for the amateur
program provides point and click controls for railroad operation.
The main screen is a bitmap picture representing the track layout.
Switch tracks can be switched by moving the cursor over the desired fork
|The program uses
voltage and current readings, delivered 5 times per second from the
Sensor Array Board, to calculate the location of engines. The
accuracy is approximately 2 inches. It then draws a red dot that
moves along the track images to indicate the current position of the
on picture for full sized image.
A Scan Display window shows which section of track an engine is on, how
many inches it has progressed on the track, and the scale speed in miles
Speed and direction are controlled by another small window with windows
scroll bars for throttles and small pushbuttons for setting the
direction. The current speed for each throttle is displayed at the
top of the scroll bar. Either the user or computer controlled
scripts may set these controls.
||Right clicking in
the main program window opens a set of menus to open throttle or scan
windows, run computer controlled scripts, or play selected sound
|Finally, a status
window displays current step being executed in the chosen script.
All four of these windows fit on the system display when in 800x600