Package jmri.jmrit.vsdecoder
Class VSDecoderManager
java.lang.Object
jmri.jmrit.vsdecoder.VSDecoderManager
- All Implemented Interfaces:
PropertyChangeListener,EventListener
VSDecoderFactory, builds VSDecoders as needed, handles loading from XML if needed.
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.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) int(package private) booleanprotected EventListenerListstatic final intprotected NamedBeanHandleManager(package private) int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEventListener(VSDManagerListener listener) voidPrepare the start of a VSDecoder on the layoutvoidvoidbooleanCheck if Block is a possible startblock.voiddeleteDecoder(String address) Delete a VSDecodervoiddoResume()(package private) voidintgetArrayIndex(int number) Get index of a decoder.Get the VSD listener location.Get the VSD listener system name.intgetLocoAddr(Block blk) Get the loco address from a BlockintGet the master volume of all VSDecoders.getProfilePath(String profile) Retrieve the Path for a given Profile name.getVSDecoder(VSDConfig config) Provide or build a VSDecoder based on a provided configuration.Get a VSDecoder by its address.Get a VSDecoder by its Id.Get a list of all VSDecoders.Get a reference to the VSD Preferences.Get a list of all profiles.(package private) voidstatic VSDecoderManagerinstance()Provide the VSdecoderManager instance.voidloadProfiles(VSDFile vf) voidlocoInBlockRemove(int numb) voidGet the VSD GUI.protected voidregisterBeanListener(Manager<Block> beanManager, String sysName) protected voidregisterReporterListener(String sysName) protected voidvoidremoveEventListener(VSDManagerListener listener) voidvoidvoidvoidvoidsetListenerLocation(String id, ListeningSpot sp) voidsetMasterVolume(int mv) Set the master volume for all VSDecoders.(package private) void
-
Field Details
-
nbhm
-
currentBlock
-
listenerList
-
max_decoder
- See Also:
-
geofile_ok
boolean geofile_ok -
num_setups
int num_setups -
alf_version
int alf_version
-
-
Constructor Details
-
VSDecoderManager
public VSDecoderManager()
-
-
Method Details
-
instance
Provide the VSdecoderManager instance.- Returns:
- the manager
-
getVSDecoderPreferences
Get a reference to the VSD Preferences.- Returns:
- the preferences reference
-
getMasterVolume
Get the master volume of all VSDecoders.- Returns:
- the master volume
-
setMasterVolume
Set the master volume for all VSDecoders.- Parameters:
mv- The new master volume
-
checkForPossibleStartblock
Check if Block is a possible startblock.- Parameters:
blk- Block to check- Returns:
- true if possible, else false
-
doResume
-
provideManagerFrame
Get the VSD GUI.- Returns:
- the VSD frame
-
getVSDecoder
Provide or build a VSDecoder based on a provided configuration.- Parameters:
config- previous configuration, not null.- Returns:
- vsdecoder, or null on error.
-
getVSDecoderByID
Get a VSDecoder by its Id.- Parameters:
id- The Id of the VSDecoder- Returns:
- vsdecoder, or null on error.
-
getVSDecoderByAddress
Get a VSDecoder by its address.- Parameters:
sa- The address of the VSDecoder- Returns:
- vsdecoder, or null on error.
-
getVSDProfileNames
Get a list of all profiles.- Returns:
- sl The profiles list.
-
getVSDecoderList
Get a list of all VSDecoders.- Returns:
- the VSDecoder list.
-
getDefaultListenerName
Get the VSD listener system name.- Returns:
- the system name.
-
getDefaultListenerLocation
Get the VSD listener location.- Returns:
- the location or null.
-
setListenerLocation
-
setDecoderPositionByID
-
setDecoderPositionByAddr
-
addEventListener
-
removeEventListener
-
fireMyEvent
-
getProfilePath
Retrieve the Path for a given Profile name.- Parameters:
profile- the profile to get the path for- Returns:
- the path for the profile
-
registerReporterListener
-
registerBeanListener
-
registerReporterListeners
-
deleteDecoder
Delete a VSDecoder- Parameters:
address- The DCC address of the VSDecoder
-
atStart
Prepare the start of a VSDecoder on the layout- Parameters:
blk- The current Block of the VSDecoder
-
getLocoAddr
Get the loco address from a Block- Parameters:
blk- The current Block of the VSDecoder- Returns:
- The number of the loco address
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-
blockPropertyChange
-
reporterPropertyChange
-
reporterManagerPropertyChange
-
getArrayIndex
Get index of a decoder.- Parameters:
number- The loco address number.- Returns:
- the index of a decoder's loco address number in the array or the length of the array.
-
locoInBlockRemove
-
loadProfiles
-
initSoundPositionTimer
void initSoundPositionTimer() -
stopSoundPositionTimer
void stopSoundPositionTimer() -
calcNewPosition
-