Class Topology


  • public class Topology
    extends java.lang.Object
    IF AND ONLY IF LayoutDesign is available: This object creates a list of objects that describe the path from the passed O.S. section to ALL other adjacent O.S. sections in a specified direction. It finds all sensors and turnouts (and their alignments). Ultimately, this will provide information to fill in completely (for the direction indicated: left / right traffic) the table _mTRL_TrafficLockingRulesSSVList in FrmTRL_Rules.java Sorry to say that as of 7/16/2020, LayoutBlock routine "getNeighbourAtIndex" does NOT work in complex track situations (one that I know of: Double crossovers), which leads to a failure to "auto-generate" properly Signal Mast Logic for specific signal masts. I wanted to avoid this. By this time the user SHOULD HAVE been done with all ABS (or APB, etc) rules for signals. We rely on this to generate our information. Also, NEVER allocate the terminating O.S. section, otherwise the dispatcher cannot clear the terminating O.S. section IN THE SAME DIRECTION as the originating O.S. section!
    • Constructor Summary

      Constructors 
      Constructor Description
      Topology()
      DO NOT USE, only for test suite!
      Topology​(CTCSerialData CTCSerialData, java.util.ArrayList<java.lang.String> OSSectionOccupiedExternalSensors, java.lang.String normal, java.lang.String reverse)  
    • Constructor Detail

      • Topology

        public Topology()
        DO NOT USE, only for test suite! Object will crash if anything referenced in it. This constructor will be replaced by something more useful to the test suite "someday" when the test suite it coded for it.
      • Topology

        public Topology​(CTCSerialData CTCSerialData,
                        java.util.ArrayList<java.lang.String> OSSectionOccupiedExternalSensors,
                        java.lang.String normal,
                        java.lang.String reverse)
        Parameters:
        CTCSerialData - The one and only.
        OSSectionOccupiedExternalSensors - List of sensors to start from.
        normal - Bundle.getMessage("TLE_Normal")
        reverse - Bundle.getMessage("TLE_Reverse")
    • Method Detail

      • isTopologyAvailable

        public boolean isTopologyAvailable()
        Returns:
        boolean - true if available, else false.
      • getTrafficLockingRules

        public java.util.ArrayList<TopologyInfogetTrafficLockingRules​(boolean leftTraffic)
        Parameters:
        leftTraffic - Traffic direction ON THE CTC PANEL that we are generating the rules for.
        Returns:
        TopologyInfo. All of the possible paths from this O.S. section to all destination(s) in the direction indicated. WE HAVE TO GO in the opposite direction to get the mast for the O.S. section we are in! There can ONLY be one signal in that direction, so upon encountering it, PROCESS ONLY IT! (we could check if there is another, and issue an error, but I believe that the Panel Editor would prevent this!) JMRI: West is left, East is right.