Elvas Tower: poor mans switch panel - Elvas Tower

Jump to content

Posting Rules

All new threads will be started by members of the Open Rails team, Staff, and/or Admins. Existing threads started in other forums may get moved here when it makes sense to do so.

Once a thread is started any member may post replies to it.
  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

poor mans switch panel Create a switch panel webpage to be handled using a tablet Rate Topic: -----

#1 User is offline   Siebren 

  • Fireman
  • Group: Status: Active Member
  • Posts: 101
  • Joined: 16-November 22
  • Gender:Not Telling
  • Location:Ede, the Netherlands
  • Simulator:open rails
  • Country:

Posted 14 April 2023 - 01:18 AM

I'm working on a what I call a poor mans switch panel for Open Rails. I bought a secondhand Android tablet and implemented a websocket connection between Open Rails and a webpage on the tablet. Advantages are not having to remember the switches, being able to display the status ("Doors closed") and the webpage on the tabled is always in focus. Current implementation is fully compatible with keyboard usage. When using the keyboard, changes in status are also written to the switch panel. And vice versa, pushing a button on the switch panel also gives a message in Open Rails. The advantage of a websocket connection is an always connected two ways connection, no polling. At least that's what I understood and see.

Implementing the websocket part is rather clean and not that much code. The same for firing the action in Open Rails when pushing the button on the tablet. However determining the status needs a lot of code, as there is no such thing in Open Rails. But not all buttons would need a status displayed, for instance subwindows like map, track monitor etc. would not need it.

I'm using the keyboard for brakes, forward, etc. The keys you need every second. Different keys can be shown on the tablet for different types of locomotives: steam, diesel or electric. I even dream of an Options tab for setting the keys as you wish on the tablet webpage. Current implementation would permit this as the button info is stored in Open Rails and send to the tablet.

Testing can also be done using a second monitor and clicking with the mouse on the buttons. You would need a second monitor as the webpage is switched to full screen.

Tablet on my desk:

Attached Image: desk.jpg

Current contents of the tablet webpage:

Attached Image: tablet.jpg

#2 User is offline   cjakeman 

  • Vice President
  • PipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 2,866
  • Joined: 03-May 11
  • Gender:Male
  • Location:Peterborough, UK
  • Simulator:Open Rails
  • Country:

Posted 14 April 2023 - 10:06 AM

View PostSiebren, on 14 April 2023 - 01:18 AM, said:

However determining the status needs a lot of code, as there is no such thing in Open Rails.

This looks like a very nice installation.

Regarding your issue about lots of code, if a control has a display in the cab, then the web API which reports the Cab Controls should include it, like this:

Attached Image: 2023-04-14 19_02_54-MS Excel with extensions - Squared1.jpg


How does your situation differ, I wonder?

#3 User is offline   eric from trainsim 

  • Waste Disposal Engineer
  • Group: Private - Open Rails Developer
  • Posts: 1,577
  • Joined: 30-October 10
  • Gender:Male
  • Simulator:ORTS
  • Country:

Posted 14 April 2023 - 10:23 AM

I really like the way that looks.

Now let's do that with the path ahead and have the ability to open and close turnouts/switches/points.... the dispatcher window is good, but just a linear path similar to a CTC board is what I'd really like to see eventually.

#4 User is offline   steved 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,848
  • Joined: 19-December 09
  • Gender:Male
  • Location:South of here
  • Simulator:ORMG
  • Country:

Posted 14 April 2023 - 10:51 AM

The concept is way cool.
And I like Eric's idea with the CTC board.

Randy


#5 User is offline   ATW 

  • Engineer
  • Group: Status: Contributing Member
  • Posts: 638
  • Joined: 07-January 13
  • Gender:Male
  • Simulator:MSTS Open Rails
  • Country:

Posted 14 April 2023 - 12:26 PM

I like Eric's idea on CTC as well and it will help even down the line for PTC TCS controlling.

I have been doing something similar and growing towards the better end of success
Attached Image: 20230413_120048.jpg

#6 User is offline   Siebren 

  • Fireman
  • Group: Status: Active Member
  • Posts: 101
  • Joined: 16-November 22
  • Gender:Not Telling
  • Location:Ede, the Netherlands
  • Simulator:open rails
  • Country:

Posted 15 April 2023 - 12:23 AM

View Postcjakeman, on 14 April 2023 - 10:06 AM, said:

This looks like a very nice installation.

Regarding your issue about lots of code, if a control has a display in the cab, then the web API which reports the Cab Controls should include it, like this:

Attachment 2023-04-14 19_02_54-MS Excel with extensions - Squared1.jpg


How does your situation differ, I wonder?


The situation differs in that I want a clear description off the status on the key. For instance for the headlight the statuses Off, Dim and Bright instead of 0, 1 or 2. And lots of code, depends on what you regard as lots. At first I was hoping I could use the message displayed on the screen. But that message is more like an action instead of a status. For instance the messages for pantograph actions is "raise" or "lower". And on the button I use "Down" and "Up". That gives at most 10 lines of code extra per button.

#7 User is offline   Siebren 

  • Fireman
  • Group: Status: Active Member
  • Posts: 101
  • Joined: 16-November 22
  • Gender:Not Telling
  • Location:Ede, the Netherlands
  • Simulator:open rails
  • Country:

Posted 15 April 2023 - 12:59 AM

View PostWeter, on 14 April 2023 - 10:18 AM, said:

Hello.
Do I understand Your idea right, that it's going to be virtual keyboard with true functions written on every big key, instead of just alphanumeric symbols, as ordinary keyboard has? Also, as I understand, the different color of keys would indicate, whether given button is currently "depressed"/function activated, or no?

Poor man's raildriver, but without levers yet? By the way, how about sliders in future?


Yes a virtual keyboard. Different colors could be done, red for "Door Open", green for "Door Closed", not yet implemented. Sliders could be done also. But my opinion is that you need real sliders or just the keyboard for those functions. I have a digital model railroad and used to drive the trains via the keyboard and mouse, but replaced that by real sort of levers:
Attached Image: sliders.jpg
But for this you would need extra hardware instead of just a tablet.

#8 User is offline   Siebren 

  • Fireman
  • Group: Status: Active Member
  • Posts: 101
  • Joined: 16-November 22
  • Gender:Not Telling
  • Location:Ede, the Netherlands
  • Simulator:open rails
  • Country:

Posted 15 April 2023 - 01:07 AM

View PostATW, on 14 April 2023 - 12:26 PM, said:

I like Eric's idea on CTC as well and it will help even down the line for PTC TCS controlling.

I have been doing something similar and growing towards the better end of success
Attachment 20230413_120048.jpg


Looks really nice, your hardware.
I'm rather new to Open Rails and I just use it to drive a train. No CTC (Centralized traffic control?) yet. And what do the abbreviations PTC TCS stand for?

#9 User is offline   eric from trainsim 

  • Waste Disposal Engineer
  • Group: Private - Open Rails Developer
  • Posts: 1,577
  • Joined: 30-October 10
  • Gender:Male
  • Simulator:ORTS
  • Country:

Posted 15 April 2023 - 02:54 AM

PTC TCS are positive train control and train control system. We can discuss those elsewhere as not to detract from your accomplishments.

#10 User is online   Weter 

  • Member, Board of Directors
  • PipPipPipPipPipPipPipPipPipPip
  • Group: ET Admin
  • Posts: 6,923
  • Joined: 01-June 20
  • Gender:Not Telling
  • Simulator:ORTS
  • Country:

Posted 15 April 2023 - 04:19 AM

Hello!

Quote

red for "Door Open", green for "Door Closed"

May I suggest to keep red color for malfunctions and emergency or critical notes, but to use yellow or orange color for "normal" statuses, demanding attention.
Furthermore, when it's acceptable to move with opened doors, or if not closed doors prevent traction application automatically.
I like Your krafts!

Erick, You are right, but in given case particularly, some ones are not aware about these specific abbreviations meaning, so brief answer is welcomre!

  • 2 Pages +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users