Package jmri

Class TurnoutOperationManager

  • All Implemented Interfaces:
    InstanceManagerAutoDefault

    public class TurnoutOperationManager
    extends java.lang.Object
    implements InstanceManagerAutoDefault
    class to look after the collection of TurnoutOperation subclasses Unlike the other xxxManager, this does not inherit from AbstractManager since the resources it deals with are not DCC system resources but rather purely internal state.
    • Method Detail

      • loadOperationTypes

        public void loadOperationTypes()
        Load the operation types given by the current TurnoutManager instance, in the order given.

        The order is important because the acceptable feedback modes may overlap. All we do is instantiate the classes. The constructors take care of putting everything in the right places. We allow multiple occurrences of the same name without complaining so the Proxy stuff works. There's a threading problem here, because this invokes gets the current turnout manager, often the proxy manager, which in turn invokes loadOperationTypes again. This is bad. It's not clear why it even works.

      • getMatchingOperationAlways

        public TurnoutOperation getMatchingOperationAlways​(@Nonnull
                                                           Turnout t,
                                                           int apparentMode)
        Find a suitable operation for this turnout, based on its feedback type. The mode is passed separately so the caller can transform it
        Parameters:
        t - turnout
        apparentMode - mode(s) to be used when finding a matching operation
        Returns:
        the turnout operation
      • getMatchingOperation

        public TurnoutOperation getMatchingOperation​(@Nonnull
                                                     Turnout t,
                                                     int apparentMode)
        find the correct operation for this turnout. If operations are globally disabled, return nothing
        Parameters:
        t - turnout
        apparentMode - mode(s) to be used when finding a matching operation
        Returns:
        operation
      • concatenateTypeLists

        public static java.lang.String[] concatenateTypeLists​(@Nonnull
                                                              java.lang.String[] types)
        Proxy support. Take a concatenation of operation type lists from multiple systems and turn it into a single list, by eliminating duplicates and ensuring that NoFeedback - which matches anything - comes at the end if it is present at all.
        Parameters:
        types - list of types possibly containing dupliactes
        Returns:
        list reduced as described above
      • firePropertyChange

        protected void firePropertyChange​(@Nonnull
                                          java.lang.String p,
                                          java.lang.Object old,
                                          java.lang.Object n)