Please get vaccinated.

2021-11-27

Android Cab control

At times I seem to get fixated on making a cab view control and to date I have made five such cab controls, each time with different technology, and each time it gets a bit better.


My first effort was built into the train control software.


Then I got an HP PDA device that had a wifi connection so I wrote a program that ran on that.


Then I made one that would display in a browser. In this version, I managed to superimpose signals showing the current signal aspect into the image.


Then I made one that would run on a phone using Blynk technology. It did not allow the flexibility to position the signal in the image so I displayed signals to the side, but at least it was now on my phone.


And now, I have made one that runs on a phone (and Windows) using AppGameKit

This version has a better speed display, in addition to the track speed limit and current desired speed of the train, speeds above the speed limit of the (lead) locomotive are shown in red. The speedometer scale also changes dynamically according to the maximum speed of the current locomotive.

As before, all available digital functions can be invoked by buttons, but now the buttons also make a realistic click sound. It also superimposes signals onto the track image. When one touches any control in the cab, the image outside the window goes out of focus for half a second to simulate the depth of field of the driver's vision.

It now also features a cab window frame with windscreen wiper.

The Locomotive name and current odometer is also displayed. The odometer changes as the train travels about and is an actual distance covered by that model, accumulated over the years.


When the signal changes it shows immediately.


A new feature is the ambient light of the track image can also be simulated from bright and sunny to pitch dark. The locomotive headlights light up the image too! Here it is getting somewhat dark and the loco lights are on.


In total darkness and no headlamps!  The ambient light data comes from the layout control software which will relay the current ambient light of the layout room. So, as a sunset occurs, we see sunset colors in the cab control on the phone!

(I plan on perhaps not having the reflective stripes show up without the headlamps.)


When inside an underground station that has its own lighting, the image is of course not darkened.

Oh, and it can also announce destinations etc. in German. When the train being viewed is dispatched there is a voice announcement stating that the driver has permission to start and what the destination is. If a trip is cancelled, that is also announced. 

When the train has been dispatched, the desired speed is indicated with a yellow marker on the speedometer, and also presented (below the digital speed indicator) in yellow. 84Km/h in this example:

As before, it can also:

  • Turn layout track power on and off
  • Disable unexpected train alerts
  • Pick any train and dispatch it to any destination.
  • Trigger any event in the train control software
  • Set any accessory address to red/green
  • Monitor any sensor address

The track images are cached on the phone. If the software is directed to use an image it does not have, it fetches the image from the Bw software. It can also request all the images for all tracks and caches those for instant loading as needed.

It is based on the RemoteSign command set, communicating with my Bw train software over the network.

I might add the Buchfahrplan information display so the person driving the train sees the prototypical journey information as they progress along their trip.