Package jmri

Interface SectionManager

  • All Superinterfaces:
    Manager<Section>, PropertyChangeProvider, SilenceablePropertyChangeProvider, VetoableChangeProvider
    All Known Implementing Classes:
    DefaultSectionManager

    public interface SectionManager
    extends Manager<Section>
    Basic Implementation of a SectionManager.

    This doesn't have a "new" interface, since Sections are independently implemented, instead of being system-specific.

    Note that Section system names must begin with system prefix and type character, usually IY, and be followed by a string, usually, but not always, a number. This is enforced when a Section is created.


    This file is part of JMRI.

    JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.

    JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

    • Method Detail

      • createNewSection

        @Nonnull
        Section createNewSection​(@Nonnull
                                 java.lang.String systemName,
                                 java.lang.String userName)
                          throws java.lang.IllegalArgumentException
        Create a new Section if the Section does not exist.
        Parameters:
        systemName - the desired system name
        userName - the desired user name
        Returns:
        a new Section or
        Throws:
        java.lang.IllegalArgumentException - if a Section with the same systemName or userName already exists, or if there is trouble creating a new Section.
      • createNewSection

        @Nonnull
        Section createNewSection​(java.lang.String userName)
                          throws java.lang.IllegalArgumentException
        Create a New Section with Auto System Name.
        Parameters:
        userName - UserName for new Section
        Returns:
        new Section with Auto System Name.
        Throws:
        java.lang.IllegalArgumentException - if existing Section, or unable to create a new Section.
      • deleteSection

        void deleteSection​(Section y)
        Remove an existing Section.
        Parameters:
        y - the section to remove
      • getSection

        Section getSection​(java.lang.String name)
        Get an existing Section. First look up assuming that name is a User Name. If this fails look up assuming that name is a System Name.
        Parameters:
        name - the name to find; user names are searched for a match first, followed by system names
        Returns:
        the found section of null if no matching Section found
      • validateAllSections

        int validateAllSections()
        Validate all Sections.
        Returns:
        number or validation errors; -2 is returned if there are no sections
      • setupDirectionSensors

        int setupDirectionSensors()
        Check direction sensors in SSL for signals.
        Returns:
        the number or errors; 0 if no errors; -1 if the panel is null; -2 if there are no sections
      • removeDirectionSensorsFromSSL

        int removeDirectionSensorsFromSSL()
        Remove direction sensors from SSL for all signals.
        Returns:
        the number or errors; 0 if no errors; -1 if the panel is null; -2 if there are no sections
      • initializeBlockingSensors

        void initializeBlockingSensors()
        Initialize all blocking sensors that exist - set them to 'ACTIVE'.
      • generateBlockSections

        void generateBlockSections()
        Generate Block Sections in stubs/sidings. Called after generating signal logic.