Package jmri

Interface ConsistListener

  • All Superinterfaces:
    java.util.EventListener
    All Known Implementing Classes:
    ConsistToolFrame

    public interface ConsistListener
    extends java.util.EventListener
    Allow notification of delayed consisting errors.

    This allows a Consist object to return delayed status.


    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.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ALREADY_CONSISTED
      An add request is not valid for this address because the locomotive is already in a consist.
      static int CONSIST_ERROR
      An Error Occurred.
      static int CONSIST_FULL
      All of the slots available for the consist are full Note: This may not be an error.
      static int DELETE_ERROR
      The operation failed because it is not possible to delete the locomotive
      static int LOCO_NOT_OPERATED
      The requested locomotive has not been operated by this device, or is currently being operated by another device
      static int NONZERO_SPEED
      The operation is not valid because the locomotive's speed is not zero.
      static int NOT_CONSIST_ADDR
      The operation is not valid because the specified address is not a consist base address
      static int NOT_CONSISTED
      A remove request is not valid for this address because the locomotive is not in a consist.
      static int NotImplemented
      Constant denoting that the request failed because it requested some unimplemented capability.
      static int OK
      Constant denoting that the request completed correctly.
      static int OPERATION_SUCCESS
      the Operation Completed successfully.
      static int STACK_FULL
      The operation failed because the command station stack is full
    • Field Detail

      • OK

        static final int OK
        Constant denoting that the request completed correctly. Note this is a specific value; all others are bitwise combinations
        See Also:
        Constant Field Values
      • NotImplemented

        static final int NotImplemented
        Constant denoting that the request failed because it requested some unimplemented capability. Note that this can also result in an exception during the original request; which happens is implementation dependent
        See Also:
        Constant Field Values
      • CONSIST_FULL

        static final int CONSIST_FULL
        All of the slots available for the consist are full Note: This may not be an error. If the last locomotive added to the consist caused the number of units in the consist to equal the size limit, the value returned to the listeners should be OPERATION_SUCCESS | CONSIST_FULL. To indicate an error, send CONSIST_ERROR | CONSIST_FULL, and to send an information message, just send CONSIST_FULL
        See Also:
        Constant Field Values
      • LOCO_NOT_OPERATED

        static final int LOCO_NOT_OPERATED
        The requested locomotive has not been operated by this device, or is currently being operated by another device
        See Also:
        Constant Field Values
      • NOT_CONSISTED

        static final int NOT_CONSISTED
        A remove request is not valid for this address because the locomotive is not in a consist.
        See Also:
        Constant Field Values
    • Method Detail

      • consistReply

        void consistReply​(LocoAddress locoaddress,
                          int status)
        Receive notification at the end of a consisting operation.
        Parameters:
        locoaddress - Address of specific locomotive involved, if error is locomotive specific.
        status - Denotes the completion code. Note that this is a bitwise combination of the various status coded defined in this interface.