Upcoming Games

(UTC times)


Full list
Add a game

Upcoming Events

No events to display

Who's Online

Interface Gateway Help Requested

You are here: Home > Forum > Customising SimSig > Interface Gateway > Interface Gateway Help Requested

Page 2 of 3

Interface Gateway Help Requested 22/03/2019 at 16:05 #116551
SamTDS
Avatar
153 posts
technically a panel view would be like a customer information screen, such as at Cheltenham spa and Gloucester station they both have a board showing train timings, headcodes and a small overview. I wish I had the time to build a raspberry pi mockup tonight but it would be tight. Il have the code to connect to the multiplayer sessions as an example tomorrow.
SamTDS - STDS | My comments are my opinions and interpretations and do not reflect on the wonderfull SimSig team. I am in no way part of the team.
Log in to reply
The following user said thank you: DonRiver
Interface Gateway Help Requested 22/03/2019 at 18:37 #116553
GeoffM
Avatar
6376 posts
SamTDS in post 116551 said:
technically a panel view would be like a customer information screen, such as at Cheltenham spa and Gloucester station they both have a board showing train timings, headcodes and a small overview. I wish I had the time to build a raspberry pi mockup tonight but it would be tight. Il have the code to connect to the multiplayer sessions as an example tomorrow.
The panels I've heard of it being used for are actual (or custom made) signalling panels, ie entrance-exit buttons etc. The customer information screens I envisaged were "next train XXXX to YYYY, delayed by NN, calling at A/B/C" kind of displays.

SimSig Boss
Log in to reply
Interface Gateway Help Requested 22/03/2019 at 19:22 #116557
pedroathome
Avatar
915 posts
Whistles -

https://www.youtube.com/watch?v=A0VuspeXC5c&feature=youtu.be

Although I've learnt a fair amount since working on this first - Both in terms of SimSig and programming

Log in to reply
The following user said thank you: DonRiver
Interface Gateway Help Requested 22/03/2019 at 19:31 #116559
Steamer
Avatar
3985 posts
I've been meaning to ask- can the Gateway be used to send commands into SimSig, or is it output only?

While I can handle microcontroller programming and its associated electronics with reasonable competency, I've yet to get my head around the sort of programming that would allow me to match between that and SimSig...

"Don't stress/ relax/ let life roll off your backs./ Except for death and paying taxes/ everything in life.../ is only for now." (Avenue Q)
Log in to reply
Interface Gateway Help Requested 22/03/2019 at 19:49 #116560
pedroathome
Avatar
915 posts
Steamer in post 116559 said:
I've been meaning to ask- can the Gateway be used to send commands into SimSig, or is it output only?

While I can handle microcontroller programming and its associated electronics with reasonable competency, I've yet to get my head around the sort of programming that would allow me to match between that and SimSig...
The gateway is output only

Log in to reply
Interface Gateway Help Requested 22/03/2019 at 21:09 #116563
GeoffM
Avatar
6376 posts
pedroathome in post 116560 said:
Steamer in post 116559 said:
I've been meaning to ask- can the Gateway be used to send commands into SimSig, or is it output only?

While I can handle microcontroller programming and its associated electronics with reasonable competency, I've yet to get my head around the sort of programming that would allow me to match between that and SimSig...
The gateway is output only
No, it's two-way. The following commands are available - that is, an external device can send these commands to SimSig:
- Route request
- Signal bpull (ie cancel)
- TD interpose/step/cancel
- Set latch/flag state
- Points key command

SimSig Boss
Log in to reply
The following users said thank you: DonRiver, Oli_k123
Interface Gateway Help Requested 22/03/2019 at 21:13 #116565
pedroathome
Avatar
915 posts
GeoffM in post 116563 said:
pedroathome in post 116560 said:
Steamer in post 116559 said:
I've been meaning to ask- can the Gateway be used to send commands into SimSig, or is it output only?

While I can handle microcontroller programming and its associated electronics with reasonable competency, I've yet to get my head around the sort of programming that would allow me to match between that and SimSig...
The gateway is output only
No, it's two-way. The following commands are available - that is, an external device can send these commands to SimSig:
- Route request
- Signal bpull (ie cancel)
- TD interpose/step/cancel
- Set latch/flag state
- Points key command
The question then, but how would a user using the gateway send these commands into SimSig?

Log in to reply
Interface Gateway Help Requested 22/03/2019 at 21:27 #116566
GeoffM
Avatar
6376 posts
pedroathome in post 116565 said:
GeoffM in post 116563 said:
pedroathome in post 116560 said:
Steamer in post 116559 said:
I've been meaning to ask- can the Gateway be used to send commands into SimSig, or is it output only?

While I can handle microcontroller programming and its associated electronics with reasonable competency, I've yet to get my head around the sort of programming that would allow me to match between that and SimSig...
The gateway is output only
No, it's two-way. The following commands are available - that is, an external device can send these commands to SimSig:
- Route request
- Signal bpull (ie cancel)
- TD interpose/step/cancel
- Set latch/flag state
- Points key command
The question then, but how would a user using the gateway send these commands into SimSig?
I'd have to find my test project that dumped live NROD TD data into SimSig (it was quite amusing to watch and spurned ideas of using real world steps to trigger train entries for real time delays). After the mysterious announcement this weekend...

SimSig Boss
Last edited: 22/03/2019 at 21:27 by GeoffM
Reason: None given

Log in to reply
Interface Gateway Help Requested 22/03/2019 at 21:43 #116567
belly buster
Avatar
368 posts
GeoffM in post 116563 said:
pedroathome in post 116560 said:
Steamer in post 116559 said:
I've been meaning to ask- can the Gateway be used to send commands into SimSig, or is it output only?

While I can handle microcontroller programming and its associated electronics with reasonable competency, I've yet to get my head around the sort of programming that would allow me to match between that and SimSig...
The gateway is output only
No, it's two-way. The following commands are available - that is, an external device can send these commands to SimSig:
- Route request
- Signal bpull (ie cancel)
- TD interpose/step/cancel
- Set latch/flag state
- Points key command
Thinking in terms of a hardware interface, would "signal push" be a useful addition, as this would allow you to replicate a hardware button press without having to think about any route logic.

Log in to reply
Interface Gateway Help Requested 22/03/2019 at 21:54 #116568
GeoffM
Avatar
6376 posts
belly buster in post 116567 said:
GeoffM in post 116563 said:
pedroathome in post 116560 said:
Steamer in post 116559 said:
I've been meaning to ask- can the Gateway be used to send commands into SimSig, or is it output only?

While I can handle microcontroller programming and its associated electronics with reasonable competency, I've yet to get my head around the sort of programming that would allow me to match between that and SimSig...
The gateway is output only
No, it's two-way. The following commands are available - that is, an external device can send these commands to SimSig:
- Route request
- Signal bpull (ie cancel)
- TD interpose/step/cancel
- Set latch/flag state
- Points key command
Thinking in terms of a hardware interface, would "signal push" be a useful addition, as this would allow you to replicate a hardware button press without having to think about any route logic.
The parameters are fromSignal and toSignal so while the hardware would need to act like a real life panel processor module, it doesn't need to know specific routes, just send signal pairs. This is because otherwise SimSig would not have the information to handle more than one user - think two users pressing their entrance buttons before either hits an exit: there is a chance that the two entrances actually form an entrance-exit pair and the wrong route sets.

SimSig Boss
Log in to reply
The following user said thank you: belly buster
Interface Gateway Help Requested 02/04/2019 at 05:49 #117134
Hawk777
Avatar
386 posts
SamTDS in post 116547 said:
Unfortunatly I haven't made any progress on the electronics side as currently we are finding it difficult to get decent free electronic design software. It is nice however to see the interest being brought in. I could likely make crossing status LEDs relatively simply.
Have you considered KiCad? I have used it and been quite satisfied myself.

Log in to reply
The following user said thank you: DonRiver
Interface Gateway Help Requested 19/09/2020 at 17:10 #132608
DonRiver
Avatar
166 posts
I've extended Sam's Python client to pick out the berth update messages and print them with a human-readable time.

The columns are the time, the train description, the 'from' berth and the 'to' berth. So cancelling or interposing a TD will leave a blank in one of the columns.

For my next trick - I want to see if I can use this data to construct an automatically-updating train list, a table showing all the TDs currently on the panel, where they are, and when they entered that berth. Yes SimSig has a train list, but the train list has non-diegetic information (like the train's exact speed) which I don't think is available to the signaller, so I'd like to play without it if I can ;)


Post has attachments. Log in to view them.
(named for the one in Tasmania, not in Russia)
Log in to reply
Interface Gateway Help Requested 19/09/2020 at 19:25 #132613
DonRiver
Avatar
166 posts
Well that was pretty painless.

What would make this more useful would be:

- keyboard controls to sort the list by train ID, berth ID, or time (it's hardcoded to sort by train ID) as well as to gracefully disconnect and quit
- a per-sim dictionary to give a clue as to where each signal is, and also to filter out terminus platform-end berths, "last sent" berths, etc

I've never programmed much in Python before but am finding this quite gratifying.


Post has attachments. Log in to view them.
(named for the one in Tasmania, not in Russia)
Log in to reply
Interface Gateway Help Requested 21/09/2020 at 03:13 #132638
DonRiver
Avatar
166 posts
I've made something slightly more useful! This shows trains berthed at red or caution signals. It does this by listening for berth-update and signal-update messages to build up a picture of the panel. (The "dump the status of everything" idea mentioned earlier would help a lot with the setup of this!)

Here, 2R90 and 1L00 are berthed at red signals. For 1L00 it's because it's not due to depart yet (and in a less contrived example, would have a stale 'updated' time). 2R90 is approaching a red signal and prompt action can avoid embarrassing "<x> stopped at red signal <y>" messages/phone calls.

5C23 has a route set but not very far, so its route still needs checking ahead.

I've been making some very promising enquiries into Urwid - I have the feeling I'll soon be able to kiss goodbye the companion text editor / spreadsheet / pad of paper I usually use to remind myself of what's going where (particularly trains starting from non-TRTS platforms!)


Post has attachments. Log in to view them.
(named for the one in Tasmania, not in Russia)
Log in to reply
The following user said thank you: broodje
Interface Gateway Help Requested 01/10/2020 at 06:25 #132829
DonRiver
Avatar
166 posts
Goodbye companion spreadsheet, hello SimSig Companion Console!



It lets me record a comment and a departure time for each train described on the berths, shows the aspect of the signal associated with the berth, along with metadata like it's location and what line it's on (which I'll gradually add to as I play).

The table can be sorted on all its columns, and with a bit of jockeying with the order I can put them into this order:

- Underway and berthed at a signal with unknown aspect
- Underway and berthed at a red signal
- Underway and berthed at a caution signal
- Underway and berthed at a clear signal
- Not scheduled to depart yet
- Still on the panel but not at signals I control
- Berthed in a non-route berth (e.g. the 'last sent' berths and the platform-end berths)

User input is with a rudimentary but expressive command line. It's so, so, SO NICE to be able to just type in "2k32 06:14 Edinburgh" and now I don't need to think about the train until 06:14, when it recategorises itself as "Berthed at a red signal"!

There's still a bunch of features to add - but it's already pretty nice

Post has attachments. Log in to view them.
(named for the one in Tasmania, not in Russia)
Last edited: 01/10/2020 at 06:25 by DonRiver
Reason: Reason: Reason: Reason: Reason: Reason: Reason:

Log in to reply
Interface Gateway Help Requested 01/10/2020 at 10:35 #132833
SamTDS
Avatar
153 posts
Nice work ive seen you comment your code quite well too. i think it would be great to use in general. are we able to have a demonstration of how your putting the dep time in works.
SamTDS - STDS | My comments are my opinions and interpretations and do not reflect on the wonderfull SimSig team. I am in no way part of the team.
Log in to reply
Interface Gateway Help Requested 01/10/2020 at 11:42 #132834
DonRiver
Avatar
166 posts
SamTDS in post 132833 said:
Nice work ive seen you comment your code quite well too. i think it would be great to use in general. are we able to have a demonstration of how your putting the dep time in works.
Much of what I did was cribbed from Mike Pirnat's talk "Dungeons and Dragons and Python":
https://www.youtube.com/watch?v=TjUTaFcxXYo
https://github.com/mpirnat/dndme

The command handler takes the user input and splits it into words. It uses the first word to find a matching command. If it succeeds, it passes the remainder of the input to that command's `do_command` function along with a reference to the game state object. The command then handles the rest of the input and acts on the game state appropriately.

If it can't match the first word to a command keyword, it sends the whole input to the "remark" command as a shortcut since this will be the most commonly used command.

"remark" expects a headcode or comma-separated headcodes, followed by an optional HH:MM time, followed by an optional remark text. Leaving both blank will clear those fields in the table. It figures out if the first word after the headcode is a time or not by attempting to convert it into one.

remark 1S25 Inverness via Aberdeen
r 1S25 Inverness via Aberdeen
1S25 Inverness via Aberdeen

These all record "Inverness via Aberdeen" as a remark for 1S25

2K32 06:14

Records 06:14 as the departure time for 2K32 and leaves the remark alone

2k32 06:14 Edinburgh

Updates both the departure time and the remark

2k32 06:99 Edinburgh

This would set the remark to "06:99 Edinburgh" since 06:99 can't be parsed as a time

2k32

This would clear both the departure time and the remark

5k22,5l06 12:00

This sets the departure time to 12:00 for 5K22 and 5L06

(named for the one in Tasmania, not in Russia)
Log in to reply
The following user said thank you: SamTDS
Interface Gateway Stuff 01/10/2020 at 16:17 #132839
SamTDS
Avatar
153 posts
nice and straight forwards. often the best code in python is reusing from previous projects I find, with one of mine being getting the file length. a possible is to have with the time a certain way to enter like 99:99 where it wont modify the dep time but also wont put it into the remarks. It looks to be coming along very well
SamTDS - STDS | My comments are my opinions and interpretations and do not reflect on the wonderfull SimSig team. I am in no way part of the team.
Log in to reply
Interface Gateway Help Requested 05/10/2020 at 01:36 #132887
DonRiver
Avatar
166 posts
I've gone back a bit and redone the basic "print out gateway messages" thing to try and figure out what messages SimSig is actually emitting, especially now my Python is a bit more refined!

This one filters out certain kinds of messages, and certain message fields. It also doesn't print messages which exactly repeat the last message given for that object. Then it uses tab expansion to present the message data in a more readable way than before.

So, excluding message fields about track circuit, point, subroute, and berth update messages, and excluding a bunch of message fields, here's a Eurostar going round Sheepcote Curve:





I'm particularly intrigued by the `flag` messages as these aren't mentioned on the wiki, but also don't match exactly the behaviour on the panel.
`flag: LKENSINGTON_ROUTE state: 1` was sent when the roundel started to flash, when the train entered the area.
It either didn't send a message when I clicked on the roundel to accept the train and the roundel changed to solid, or it sent the same message again and the duplicate filter ate it.
`flag: LKENSINGTON_ROUTE state: 0` came much later when the roundel reset to normal/black.

I'm very excited to see these messages as I want to have a concentrated "these slots were requested, did you accept them" panel on the finished UI. Shame that a slot in "requested" and "accepted" states are both described as `state: 1` but oh well. (Maybe a flashing roundel could be described with a different state?)

Flags L58, L140 and L219 are the direction arrows on the reversible lines and have names corresponding to signals on the route. L140 is visible lit in the screenshot - S140 is the signal to the left, above the first O in QUEENSTOWN ROAD.

I set this up because I want to be able to identify (and filter out) trains approaching a signal where a route is set and the signal is only red due to the presence of a train in advance of the signal - e.g. the signal will clear when that train moves on, no action needed. These signals will show as aspect:0, rset:true. However, that's also what a non-TORR signal shows after the first train has vamoosed and the busy overloaded signaller hasn't reset the route yet, and a train approaching this signal very much needs attention. Guess I'm adding a 'never/sometimes/always TORR' column to the signal metadata spreadsheet!

Post has attachments. Log in to view them.
(named for the one in Tasmania, not in Russia)
Last edited: 05/10/2020 at 01:45 by DonRiver
Reason: :nosaeR

Log in to reply
Interface Gateway Help Requested 05/10/2020 at 02:21 #132888
GeoffM
Avatar
6376 posts
I can't help directly but slots have a prefix of Y, not L. L is for latches (flags) which are used for anything that is not one of the other basic types (points, signals, routes etc). From a quick run, that LKENSINGTON_FLAG looks like it's set when a train needs a route at Latchmere and resets as it passes, but don't quote me on that.

The Wimbledon sim was built from the ground up so won't match the Waterloo sim.

SimSig Boss
Log in to reply
The following user said thank you: DonRiver
Interface Gateway Help Requested 05/10/2020 at 10:20 #132891
DonRiver
Avatar
166 posts
I will be submitting a formal "please can these features be added to the interface gateway" request at some point then Geoff ;)

(the main one being some way to get the entire panel state when the client connects)

(named for the one in Tasmania, not in Russia)
Log in to reply
Interface Gateway Help Requested 05/10/2020 at 10:57 #132892
clive
Avatar
2789 posts
To expand on what Geoff said, L (flags) are internal variables within the interlocking or simulation. On SimSig their values range from 0 to 63, though I don't recall ever going above 6 when using one and the vast majority only use 0 and 1.

There is *no* association between the flag name and any other object except in the sim author's head. I can call a flag LS123 and then use it to lock points P456 if I want. Doing so might be bad style, but it's not forbidden. So for each flag you're going to have to try to work out exactly what it does, or you're going to have to beg help from the sim author.

For example, I've just looked at WembleySub. It has 13 flags. I'm not going to list them all, but:

LS4OFF counts how long signal 4 has been off (this is an anti-flicker mechanism) so can have any value from 0 to 63, though the only test is for greater than or equal to 4.

LLUS2 notes whether a description beginning with a letter (hence an LU description) has entered berth 4 or 8 (with the route to 4 set) and not yet stepped back to berth 11 (signal 2 is held at red in this situation).

L308SB indicates whether a train is waiting at the stop board to enter Cardiff Road CEGB sidings.

LESPARR and LESPDEP are the Stonebridge Park alert lights (the simulation can show different text or symbols on the screen for different flag states, so a value of 0 is shown as an unlit lamp and a value of 1 as a lit lamp).

LEASHOE is the Queen's Park negative shoe detector status (1 = shoe, 0 = no shoe).

From that, I'll leave you to work out what LDWAJBO and LDTX are for.

Log in to reply
The following user said thank you: DonRiver
Interface Gateway Help Requested 05/10/2020 at 15:19 #132897
DonRiver
Avatar
166 posts
Good to know, thanks Clive. I did wonder why Aston is emitting messages about a flag/latch named LTEST...

I guess they're included in interface gateway messages to assist with sim development?

And if they're any use at all for client apps, that's per-sim and largely a fortunate coincidence!

(named for the one in Tasmania, not in Russia)
Log in to reply
Interface Gateway Help Requested 05/10/2020 at 15:26 #132898
headshot119
Avatar
4869 posts
DonRiver in post 132897 said:
Good to know, thanks Clive. I did wonder why Aston is emitting messages about a flag/latch named LTEST...

I guess they're included in interface gateway messages to assist with sim development?

And if they're any use at all for client apps, that's per-sim and largely a fortunate coincidence!
They where included to allow people to replicate all the indications that the sim puts out to the user. If you take North Wales Coast all of the AB indications (Not the controls) are flags.

"Passengers for New Lane, should be seated in the rear coach of the train " - Opinions are my own and not those of my employer
Log in to reply
Interface Gateway Help Requested 05/10/2020 at 16:58 #132899
DonRiver
Avatar
166 posts
If that's the intent, it's not fully realised - the roundels for the Waterloo slots and I think the NEScot entry slots show state:1 for both flashing and steady?
(named for the one in Tasmania, not in Russia)
Log in to reply