ecgconnelly / uss8

Run8 external dispatching program based on Hawk777's iecc8, with Union Switch and Signal styled UI
GNU General Public License v3.0
0 stars 0 forks source link

Some occupancy lights don’t always light #31

Closed Hawk777 closed 1 year ago

Hawk777 commented 1 year ago

I noticed a couple of examples of occupancy lights not lighting up when they should. This wasn’t just a momentary thing (e.g. related to code transmission); it remained true for a long time and while the code system was idle. A couple of screenshots are below, each taken at a single point in time. In the first, G-AVISWA9 occupies the main 1 section with the left-hand crossover at Calwa Crossing (i.e. the section that intersects the UP line) as well as the section with the crossover at CP Calwa, but neither lamp is lit.

occupancy1

In the second screenshot, B-SIFLAC4 occupies all three main 2 track sections between signals 10R and 10L, but two of those lamps (the one with the other line crossing and the one with the left-hand crossover) are not lit.

occupancy2

ecgconnelly commented 1 year ago

Well that's not ideal. My first thought was it was a data entry issue where those lamps were associated with the wrong block but that's clearly not the case. Did they come on and then go off while the train was occupying those sections? When they came back on, was it while the same train was still occupying the section?

I also notice that all the affected lights are OS sections. Right now those are just plain block lamps colored red. In some cases it might be possible to also look at one or more switches being occupied. Unfortunately there's quite a few places where one "switch" as reported from Run8 covers both sides of a crossover.

Hawk777 commented 1 year ago

I’m not certain whether they came on and went off again or what happened there; I was distracted looking at other trains. Are you saying that the OccupiedBlocksMessage has an entry for that block, but doesn’t always represent it as occupied if the tail of a train is in it? I notice that both of the missing ones are occupied by the tail of a train whose head is further forward. If that’s the case, it sounds like a Run8 bug which it might be impractical to fix here.

I don’t imagine the OccupiedSwitchesMessage would do much to help, since if I remember correctly both halves of a crossover are represented as a single switch ID, so if you used that, it would light up the occupancy lamps on both main 1 and main 2 any time either side was occupied.

ecgconnelly commented 1 year ago

Found the issue. Run8 is reporting correctly, but UpdateFromRun8(OccupiedBlocksMessage message) in SubArea.cs isn't set up to handle gaps in the TrackCircuit list. I really don't know how this wasn't noticed before.