Package jmri.jmrix.roco.z21
Class RocoZ21CommandStation
- java.lang.Object
-
- jmri.jmrix.lenz.LenzCommandStation
-
- jmri.jmrix.roco.RocoCommandStation
-
- jmri.jmrix.roco.z21.RocoZ21CommandStation
-
- All Implemented Interfaces:
CommandStation
public class RocoZ21CommandStation extends RocoCommandStation
Defines the standard/common routines used in multiple classes related to a Roco z21 Command Station.This class keeps track of the broadcast flags associated with the currently connected Roco Z21 Command Station.
Brief descriptions of the flags are as follows (loosely translated from section 2.16 of the manual from the German with the aid of google translate).
- 0x00000001 send XpressNet related information (track power on/off, programming mode, short circuit, broadcast stop, locomotive information, turnout information).
- 0x00000002 send data changes that occur on the RMBUS.
- 0x00000004 (deprecated by Roco) send Railcom Data
- 0x00000100 send changes in system state (such as track voltage)
- 0x00010000 send changes to locomotives on XpressNet (must also have 0x00000001 set.
- 0x01000000 forward LocoNet data to the client. Does not send Locomotive or turnout data.
- 0x02000000 send Locomotive specific LocoNet data to the client.
- 0x04000000 send Turnout specific LocoNet data to the client.
- 0x08000000 send Occupancy information from LocoNet to the client
- 0x00040000 Automatically send updates for Railcom data to the client
- 0x00080000 send can detector messages to the client
-
-
Constructor Summary
Constructors Constructor Description RocoZ21CommandStation()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
getCanDetectorFlag()
Is flag bit 0x00080000, which tells the command station to send CAN detector data to the client set.int
getHardwareVersion()
get the hardware version.boolean
getLocoNetLocomotiveMessagesFlag()
Is flag bit 0x02000000 which tells the command station to send Locomotive specific LocoNet data to the client set?boolean
getLocoNetMessagesFlag()
Is flag bit 0x01000000 which tells the command station to send LocoNet data,except Locomotive and Turnout data, to the client set?boolean
getLocoNetOccupancyMessagesFlag()
Is flag bit 0x08000000 which tells the command station to send Occupancy information from LocoNet to the client set?boolean
getLocoNetTurnoutMessagesFlag()
Is flag bit 0x04000000 which tells the command station to send Turnout specific LocoNet data to the client set?boolean
getRailComAutomaticFlag()
Is flag bit 0x00040000, which tells the command station to automatically send Railcom data to the client set.boolean
getRailComMessagesFlag()
Is flag bit 0x00000004, which tells the command station to send Railcom data to the client set (this flag may no longer be supported by Roco).boolean
getRMBusMessagesFlag()
Is flag bit 0x00000002 which tells the command station to send data changes on the RMBus to the client set?int
getSerialNumber()
get the serial number.float
getSoftwareVersion()
get the software version.boolean
getSystemStatusMessagesFlag()
Is flag bit 0x00000100 which tells the command station to send changes in system state (such as track voltage) set?boolean
getXPressNetLocomotiveMessagesFlag()
Is flag bit 0x00010000 which tells the command station to send XpressNet related locomoitve information to the client set?boolean
getXPressNetMessagesFlag()
Is flag bit 0x00000001 which tells the command station to send XpressNet related information (track power on/off, programming mode, short circuit, broadcast stop, locomotive information, turnout information) set?int
getZ21BroadcastFlags()
get the current value of the broadcast flags as an intvoid
setCanDetectorFlag(boolean flag)
Set flag bit 0x00080000, which tells the command station to send CAN detector data to the client.void
setHardwareVersion(int hv)
set the hardware version associated with this Z21 command station.void
setLocoNetLocomotiveMessagesFlag(boolean flag)
Set flag bit 0x02000000 which tells the command station to send Locomotive specific LocoNet data to the client.void
setLocoNetMessagesFlag(boolean flag)
Set flag bit 0x01000000 which tells the command station to send LocoNet data,except Locomotive and Turnout data, to the client.void
setLocoNetOccupancyMessagesFlag(boolean flag)
Set flag bit 0x08000000 which tells the command station to send Occupancy information from LocoNet to the clientvoid
setLocoNetTurnoutMessagesFlag(boolean flag)
Set flag bit 0x04000000 which tells the command station to send Turnout specific LocoNet data to the client set?void
setRailComAutomaticFlag(boolean flag)
Set flag bit 0x00040000, which tells the command station to automatically send Railcom data to the client set.void
setRailComMessagesFlag(boolean flag)
Set flag bit 0x00000004, which tells the command station to send Railcom data to the client set (this flag may no longer be supported by Roco).void
setRMBusMessagesFlag(boolean flag)
Set flag bit 0x00000002 which tells the command station to send data changes on the RMBus to the client set?void
setSerialNumber(int sn)
set the serial number associated with this Z21 command station.void
setSoftwareVersion(float sv)
set the software version associated with this Z21 command station.void
setSystemStatusMessagesFlag(boolean flag)
Set flag bit 0x00000100 which tells the command station to send changes in system state (such as track voltage).void
setXPressNetLocomotiveMessagesFlag(boolean flag)
Set flag bit 0x00010000 which tells the command station to send XpressNet related locomoitve information to the client.void
setXPressNetMessagesFlag(boolean flag)
Set flag bit 0x00000001 which tells the command station to send XpressNet related information (track power on/off, programming mode, short circuit, broadcast stop, locomotive information, turnout information).void
setZ21BroadcastFlags(int flags)
set the current value of the broadcast flags as an int-
Methods inherited from class jmri.jmrix.lenz.LenzCommandStation
calcLocoAddress, getCommandStationSoftwareVersion, getCommandStationSoftwareVersionBCD, getCommandStationType, getDCCAddressHigh, getDCCAddressLow, getSystemPrefix, getUserName, getVersionString, isOpsModePossible, sendPacket, setCommandStationSoftwareVersion, setCommandStationSoftwareVersion, setCommandStationType, setCommandStationType, setSystemConnectionMemo, setTrafficController
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jmri.CommandStation
sendAccSignalDecoderPkt, sendAltAccSignalDecoderPkt
-
-
-
-
Constructor Detail
-
RocoZ21CommandStation
public RocoZ21CommandStation()
-
-
Method Detail
-
getSerialNumber
public int getSerialNumber()
get the serial number.- Returns:
- serial number of the connected Z21 command station
-
setSerialNumber
public void setSerialNumber(int sn)
set the serial number associated with this Z21 command station.- Parameters:
sn
- serial number
-
getSoftwareVersion
public float getSoftwareVersion()
get the software version.- Returns:
- software version of the connected Z21 command station
-
setSoftwareVersion
public void setSoftwareVersion(float sv)
set the software version associated with this Z21 command station.- Parameters:
sv
- software version
-
getHardwareVersion
public int getHardwareVersion()
get the hardware version.- Returns:
- hardware version of the connected Z21 command station
-
setHardwareVersion
public void setHardwareVersion(int hv)
set the hardware version associated with this Z21 command station.- Parameters:
hv
- software version
-
getZ21BroadcastFlags
public int getZ21BroadcastFlags()
get the current value of the broadcast flags as an int- Returns:
- value representing the broadcast flags.
-
setZ21BroadcastFlags
public void setZ21BroadcastFlags(int flags)
set the current value of the broadcast flags as an int- Parameters:
flags
- representing the broadcast flags.
-
getXPressNetMessagesFlag
public boolean getXPressNetMessagesFlag()
Is flag bit 0x00000001 which tells the command station to send XpressNet related information (track power on/off, programming mode, short circuit, broadcast stop, locomotive information, turnout information) set?- Returns:
- true if flag is set.
-
setXPressNetMessagesFlag
public void setXPressNetMessagesFlag(boolean flag)
Set flag bit 0x00000001 which tells the command station to send XpressNet related information (track power on/off, programming mode, short circuit, broadcast stop, locomotive information, turnout information).- Parameters:
flag
- true if flag is to be set.
-
getRMBusMessagesFlag
public boolean getRMBusMessagesFlag()
Is flag bit 0x00000002 which tells the command station to send data changes on the RMBus to the client set?- Returns:
- true if flag is set.
-
setRMBusMessagesFlag
public void setRMBusMessagesFlag(boolean flag)
Set flag bit 0x00000002 which tells the command station to send data changes on the RMBus to the client set?- Parameters:
flag
- true if flag is to be set.
-
getRailComMessagesFlag
public boolean getRailComMessagesFlag()
Is flag bit 0x00000004, which tells the command station to send Railcom data to the client set (this flag may no longer be supported by Roco).- Returns:
- true if flag is set.
-
setRailComMessagesFlag
public void setRailComMessagesFlag(boolean flag)
Set flag bit 0x00000004, which tells the command station to send Railcom data to the client set (this flag may no longer be supported by Roco).- Parameters:
flag
- true if flag is to be set.
-
getRailComAutomaticFlag
public boolean getRailComAutomaticFlag()
Is flag bit 0x00040000, which tells the command station to automatically send Railcom data to the client set.- Returns:
- true if flag is set.
-
setRailComAutomaticFlag
public void setRailComAutomaticFlag(boolean flag)
Set flag bit 0x00040000, which tells the command station to automatically send Railcom data to the client set.- Parameters:
flag
- true if flag is to be set.
-
getCanDetectorFlag
public boolean getCanDetectorFlag()
Is flag bit 0x00080000, which tells the command station to send CAN detector data to the client set.- Returns:
- true if flag is set.
-
setCanDetectorFlag
public void setCanDetectorFlag(boolean flag)
Set flag bit 0x00080000, which tells the command station to send CAN detector data to the client.- Parameters:
flag
- true if flag is to be set.
-
getSystemStatusMessagesFlag
public boolean getSystemStatusMessagesFlag()
Is flag bit 0x00000100 which tells the command station to send changes in system state (such as track voltage) set?- Returns:
- true if flag is set.
-
setSystemStatusMessagesFlag
public void setSystemStatusMessagesFlag(boolean flag)
Set flag bit 0x00000100 which tells the command station to send changes in system state (such as track voltage).- Parameters:
flag
- true if flag is to be set.
-
getXPressNetLocomotiveMessagesFlag
public boolean getXPressNetLocomotiveMessagesFlag()
Is flag bit 0x00010000 which tells the command station to send XpressNet related locomoitve information to the client set?- Returns:
- true if flag is set
-
setXPressNetLocomotiveMessagesFlag
public void setXPressNetLocomotiveMessagesFlag(boolean flag)
Set flag bit 0x00010000 which tells the command station to send XpressNet related locomoitve information to the client.- Parameters:
flag
- true if flag is to be set.
-
getLocoNetMessagesFlag
public boolean getLocoNetMessagesFlag()
Is flag bit 0x01000000 which tells the command station to send LocoNet data,except Locomotive and Turnout data, to the client set?- Returns:
- true if flag is set.
-
setLocoNetMessagesFlag
public void setLocoNetMessagesFlag(boolean flag)
Set flag bit 0x01000000 which tells the command station to send LocoNet data,except Locomotive and Turnout data, to the client.- Parameters:
flag
- true if flag is to be set.
-
getLocoNetLocomotiveMessagesFlag
public boolean getLocoNetLocomotiveMessagesFlag()
Is flag bit 0x02000000 which tells the command station to send Locomotive specific LocoNet data to the client set?- Returns:
- true if flag is set.
-
setLocoNetLocomotiveMessagesFlag
public void setLocoNetLocomotiveMessagesFlag(boolean flag)
Set flag bit 0x02000000 which tells the command station to send Locomotive specific LocoNet data to the client.- Parameters:
flag
- true if flag is to be set.
-
getLocoNetTurnoutMessagesFlag
public boolean getLocoNetTurnoutMessagesFlag()
Is flag bit 0x04000000 which tells the command station to send Turnout specific LocoNet data to the client set?- Returns:
- true if flag is set.
-
setLocoNetTurnoutMessagesFlag
public void setLocoNetTurnoutMessagesFlag(boolean flag)
Set flag bit 0x04000000 which tells the command station to send Turnout specific LocoNet data to the client set?- Parameters:
flag
- true if flag is to be set.
-
getLocoNetOccupancyMessagesFlag
public boolean getLocoNetOccupancyMessagesFlag()
Is flag bit 0x08000000 which tells the command station to send Occupancy information from LocoNet to the client set?- Returns:
- true if flag is set.
-
setLocoNetOccupancyMessagesFlag
public void setLocoNetOccupancyMessagesFlag(boolean flag)
Set flag bit 0x08000000 which tells the command station to send Occupancy information from LocoNet to the client
If this flag is set to true, the Z21 will format Transponding messages as described in section 9.5 of the Z21 Lan Protocol. This message format is currentlyunsupported by JMRI.
- Parameters:
flag
- true if flag is to be set.
-
-