Package jmri
Interface ConsistManager
- All Known Implementing Classes:
AbstractConsistManager,CbusConsistManager,DccConsistManager,EasyDccConsistManager,InternalConsistManager,JsonConsistManager,LocoNetConsistManager,MqttConsistManager,NceConsistManager,NmraConsistManager,TmccConsistManager,WiFiConsistManager,XNetConsistManager
public interface ConsistManager
Interface for Consist Manager objects, which provide access to the existing
Consists and allows for creation and destruction.
This file is part of JMRI.
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.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA listener that listens to whether the manager is enabled or disabled. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConsistListListener(ConsistListListener listener) Register a ConsistListListener object with this ConsistManagerdefault booleanCan this consist manager be disabled?booleanDoes a command station consist require a separate consist address from locomotives in consist?decodeErrorCode(int errorCode) Translate Error Codes relieved by a consistListener into StringsvoiddelConsist(LocoAddress address) Remove an old Consist.getConsist(LocoAddress address) Find a Consist with this consist address, and return it.Get a list of known consist addresses.default booleanDoes this ConsistManager allow advanced consisting?booleanDoes this implementation support Command Station Consists?default booleanCheck if this manager is enableddefault booleanDoes this ConsistManager require that all locomotives in a consist use the same protocol?voidNotify the registered ConsistListListener objects that the ConsistList has changed.default voidRegister a listener that is called if this manager is enabled or disabled.voidremoveConsistListListener(ConsistListListener listener) Remove a ConsistListListener object with this ConsistManagervoidRequest an update from the layout, loading Consists from the command station.default voidUnregister a listener that is called if this manager is enabled or disabled.
-
Method Details
-
getConsist
Find a Consist with this consist address, and return it. If the Consist doesn't exist, create it.- Parameters:
address- the consist address- Returns:
- an existing or new consist
-
delConsist
Remove an old Consist.- Parameters:
address- the consist address
-
isCommandStationConsistPossible
boolean isCommandStationConsistPossible()Does this implementation support Command Station Consists?- Returns:
- true if command station consists are supported; false otherwise
-
csConsistNeedsSeperateAddress
boolean csConsistNeedsSeperateAddress()Does a command station consist require a separate consist address from locomotives in consist?- Returns:
- true is command station consist requires separate address; false otherwise
-
getConsistList
Get a list of known consist addresses.- Returns:
- list of addresses
-
decodeErrorCode
Translate Error Codes relieved by a consistListener into Strings- Parameters:
errorCode- the code- Returns:
- the description
-
requestUpdateFromLayout
void requestUpdateFromLayout()Request an update from the layout, loading Consists from the command station. -
isAdvancedConsistPossible
Does this ConsistManager allow advanced consisting?- Returns:
- true if this manager's protocols support DCC advanced consisting
-
isSingleFormConsistRequired
Does this ConsistManager require that all locomotives in a consist use the same protocol?- Returns:
- true if this manager requires that all locomotives in a consist use the same protocol
-
addConsistListListener
Register a ConsistListListener object with this ConsistManager- Parameters:
listener- a Consist List Listener object.
-
removeConsistListListener
Remove a ConsistListListener object with this ConsistManager- Parameters:
listener- a Consist List Listener object.
-
notifyConsistListChanged
void notifyConsistListChanged()Notify the registered ConsistListListener objects that the ConsistList has changed. -
canBeDisabled
Can this consist manager be disabled?- Returns:
- true if the manager can be disabled, false otherwise
-
registerEnableListener
Register a listener that is called if this manager is enabled or disabled.- Parameters:
listener- the listener
-
unregisterEnableListener
Unregister a listener that is called if this manager is enabled or disabled.- Parameters:
listener- the listener
-
isEnabled
Check if this manager is enabled- Returns:
- true if enabled
-