Class LocoNetSlot
- java.lang.Object
- 
- jmri.jmrix.loconet.LocoNetSlot
 
- 
- Direct Known Subclasses:
- UhlenbrockSlot
 
 public class LocoNetSlot extends java.lang.Object Represents the contents of a single slot in the LocoNet command station.A SlotListener can be registered to hear of changes in this slot. All changes in values will result in notification. Strictly speaking, functions 9 through 28 are not in the actual slot, but it's convenient to imagine there's an "extended slot" and keep track of them here. This is a partial implementation, though, because setting is still done directly in LocoNetThrottle. In particular, if this slot has not been read from the command station, the first message directly setting F9 through F28 will not have a place to store information. Instead, it will trigger a slot read, so the following messages will be properly handled.Some of the message formats used in this class are Copyright Digitrax, Inc. and used with permission as part of the JMRI project. That permission does not extend to uses in other software products. If you wish to use this code, algorithm or these message formats outside of JMRI, please contact Digitrax Inc for separate permission. 
- 
- 
Field SummaryFields Modifier and Type Field Description (package private) booleanlocalF10(package private) booleanlocalF11(package private) booleanlocalF12(package private) booleanlocalF13(package private) booleanlocalF14(package private) booleanlocalF15(package private) booleanlocalF16(package private) booleanlocalF17(package private) booleanlocalF18(package private) booleanlocalF19(package private) booleanlocalF20(package private) booleanlocalF21(package private) booleanlocalF22(package private) booleanlocalF23(package private) booleanlocalF24(package private) booleanlocalF25(package private) booleanlocalF26(package private) booleanlocalF27(package private) booleanlocalF28(package private) booleanlocalF9
 - 
Constructor SummaryConstructors Constructor Description LocoNetSlot(int slotNum)Create a slot based solely on a slot number.LocoNetSlot(int slotNum, int inLoconetProtocol)Create a slot based solely on a slot number.LocoNetSlot(int slotNum, int inLoconetProtocol, SlotMapEntry.SlotType inSlotType)Create a slot , initialize slotnum, protocol and slot typeLocoNetSlot(LocoNetMessage l)Creates a slot object based on the contents of a LocoNet message.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSlotListener(SlotListener l)Registers a slot listener if it is not already registered.intconsistStatus()Get consist status.intcvval()intdecoderType()Get decoder mode.intdirf()Returns the mobile decoder direction and F0-F4 bits, as used in the DIRF bits of various LocoNet messages.LocoNetMessagedispatchSlot()Create LocoNet message which dispatches this slot Note that the invoking method ought to invoke the slot's NotifySlotListeners method to inform any other interested parties that the slot status has changed.voidfunctionMessage(long pkt)Sets F9 through F28 (as appropriate) from data extracted from LocoNet "OPC_IMM_PACKET" message.intgetFcDays()Return the days value from the slot.intgetFcFracMins()Return the fractional minutes value from the slot.intgetFcHours()Return the hours value from the slot.intgetFcMinutes()Return the minutes value from the slot.intgetFcRate()Get the fast-clock rate.booleangetIsInitilized()Get the state of the Acquire Throttle / slot.longgetLastUpdateTime()Returns the timestamp when this LocoNetSlot was updated by some LocoNet message.intgetLeadSlot()intgetProtocol()intgetSlot()Returns the slot number which was either specified or inferred at object creation time.SlotMapEntry.SlotTypegetSlotType()intgetThrottleIdentity()Get the throttle ID in the slotintgetTrackStatus()Get the track status byte (location 7)intid()Returns the "Throttle ID" associated with the slot.booleanisF0()Returns the slot's F0 statebooleanisF1()Returns the slot's F1 statebooleanisF10()Returns the slot's F10 statebooleanisF11()Returns the slot's F11 statebooleanisF12()Returns the slot's F12 statebooleanisF13()Returns the slot's F13 statebooleanisF14()Returns the slot's F14 statebooleanisF15()Returns the slot's F15 statebooleanisF16()Returns the slot's F16 statebooleanisF17()Returns the slot's F17 statebooleanisF18()Returns the slot's F1 statebooleanisF19()Returns the slot's F19 statebooleanisF2()Returns the slot's F2 statebooleanisF20()Returns the slot's F20 statebooleanisF21()Returns the slot's F21 statebooleanisF22()Returns the slot's F22 statebooleanisF23()Returns the slot's F23 statebooleanisF24()Returns the slot's F24 statebooleanisF25()Returns the slot's F25 statebooleanisF26()Returns the slot's F26 statebooleanisF27()Returns the slot's F27 statebooleanisF28()Returns the slot's F28 statebooleanisF3()Returns the slot's F3 statebooleanisF4()Returns the slot's F4 statebooleanisF5()Returns the slot's F5 statebooleanisF6()Returns the slot's F6 statebooleanisF7()Returns the slot's F7 statebooleanisF8()Returns the slot's F8 statebooleanisF9()Returns the slot's F9 statebooleanisForward()Returns the direction of loco movement which applies when the slot's speed is set for movement.booleanisFunction(int Fn)Return a slot Function state.booleanisSystemSlot()intlocoAddr()Returns the mobile decoder address associated with the slot.voidnotifySlotListeners()Notifies all listeners that this slot has been changed in some way.intpcmd()Returns the programmer command associated with the slot.LocoNetMessagereleaseSlot()Create a LocoNet OPC_SLOT_STAT1 message which releases this slot to the "Common" state The invoking method must send the returned LocoNet message to LocoNet in order to have a useful effect.voidremoveSlotListener(SlotListener l)Un-registers a slot listener.voidsetFcCntrlBitOff(int val)For fast-clock slot, set a "CLK_CNTRL" bit Off.voidsetFcCntrlBitOn(int val)For fast-clock slot, set a "CLK_CNTRL" bit On.voidsetFcDays(int val)For fast-clock slot, set "days" value.voidsetFcFracMins(int val)Set the "frac_mins" value.voidsetFcHours(int val)For fast-clock slot, set "hours" value.voidsetFcMinutes(int val)For fast-clock slot, set "minutes" value.voidsetFcRate(int val)For fast-clock slot, set "rate" value.protected voidsetIsInitialized(boolean state)protected voidsetProtocol(int value)set the protocol to be usedvoidsetSlot(LocoNetMessage l)Update the slot object to reflect the specific contents of a LocoNet message.voidsetSlotType(SlotMapEntry.SlotType value)Set the Slot TypevoidsetThrottleIdentity(int throttleId)Set the throttle ID in the slotvoidsetTrackStatus(int status)Set the track status byte (location 7)intslotStatus()Get slot status.intsnd()Returns the mobile decoder F5-F8 bits, as used in the SND bits of various LocoNet messages.intspeed()Returns the mobile decoder speed associated with the slotintss2()Get secondary slot status.LocoNetMessagewriteMode(int status)Update the decoder type bits in STAT1 (D2, D1, D0)LocoNetMessagewriteNullMove()Create a message to perform a null move on this slot.LocoNetMessagewriteSlot()Creates a LocoNet "OPC_WR_SL_DATA" message containing the current state of the LocoNetSlot object.LocoNetMessagewriteSpeed(int speed)Update SpeedLocoNetMessagewriteStatus(int status)Update the status mode bits in STAT1 (D5, D4)LocoNetMessagewriteThrottleID(int newID)Sets the object's ID value and returns a LocoNet message to inform the command station that the throttle ID has been changed.
 
- 
- 
- 
Field Detail- 
localF9boolean localF9 
 - 
localF10boolean localF10 
 - 
localF11boolean localF11 
 - 
localF12boolean localF12 
 - 
localF13boolean localF13 
 - 
localF14boolean localF14 
 - 
localF15boolean localF15 
 - 
localF16boolean localF16 
 - 
localF17boolean localF17 
 - 
localF18boolean localF18 
 - 
localF19boolean localF19 
 - 
localF20boolean localF20 
 - 
localF21boolean localF21 
 - 
localF22boolean localF22 
 - 
localF23boolean localF23 
 - 
localF24boolean localF24 
 - 
localF25boolean localF25 
 - 
localF26boolean localF26 
 - 
localF27boolean localF27 
 - 
localF28boolean localF28 
 
- 
 - 
Constructor Detail- 
LocoNetSlotpublic LocoNetSlot(int slotNum) Create a slot based solely on a slot number. The remainder of the slot is left un-initialized.- Parameters:
- slotNum- slot number to be assigned to the new LocoNetSlot object
 
 - 
LocoNetSlotpublic LocoNetSlot(int slotNum, int inLoconetProtocol) Create a slot based solely on a slot number. The remainder of the slot is left un-initialized.- Parameters:
- slotNum- - slot number to be assigned to the new LocoNetSlot object
- inLoconetProtocol- - can be 0 = unknown, 1 = version 1.1, 2 = Expandedslot
 
 - 
LocoNetSlotpublic LocoNetSlot(int slotNum, int inLoconetProtocol, SlotMapEntry.SlotType inSlotType) Create a slot , initialize slotnum, protocol and slot type- Parameters:
- slotNum- - slot number to be assigned to the new LocoNetSlot object
- inLoconetProtocol- - can be 0 = unknown, 1 = version 1.1, 2 = Expandedslot
- inSlotType- - SLotType enum
 
 - 
LocoNetSlotpublic LocoNetSlot(LocoNetMessage l) throws LocoNetException Creates a slot object based on the contents of a LocoNet message. The slot number is assumed to be found in byte 2 of the message if message is 0xE6 or bytes 2 and 3 for 0xE7- Parameters:
- l- a LocoNet message
- Throws:
- LocoNetException- if the slot does not have an easily-found slot number
 
 
- 
 - 
Method Detail- 
getSlotpublic int getSlot() Returns the slot number which was either specified or inferred at object creation time.- Returns:
- the slot number
 
 - 
setSlotTypepublic void setSlotType(SlotMapEntry.SlotType value) Set the Slot Type- Parameters:
- value- enum for slottype
 
 - 
isSystemSlotpublic boolean isSystemSlot() - Returns:
- true if this is a systems slot else false
 
 - 
getSlotTypepublic SlotMapEntry.SlotType getSlotType() - Returns:
- true if this is a systems slot else false
 
 - 
getProtocolpublic int getProtocol() - Returns:
- the protocol level support by the slot.
 
 - 
setProtocolprotected void setProtocol(int value) set the protocol to be used- Parameters:
- value- one,two or unknown
 
 - 
decoderTypepublic int decoderType() Get decoder mode. The decoder (operating) mode is taken from those bits in the slot's STAT byte which reflect the "speed steps" and "consisting" mode. Note that the other bits from the STAT byte are not visible via this method. thisFor slot numbers not normally associated with mobile decoders, these bits may have other meanings. Possible values are LnConstants.DEC_MODE_128A,LnConstants.DEC_MODE_28A,LnConstants.DEC_MODE_128,LnConstants.DEC_MODE_14,LnConstants.DEC_MODE_28TRI,LnConstants.DEC_MODE_28- Returns:
- the encoded decoder operating mode.
 
 - 
slotStatuspublic int slotStatus() Get slot status.These bits are set based on the STAT byte as seen in LocoNet slot write and slot read messages. These bits determine whether the command station is actively "refreshing" the loco's speed and direction information on the DCC track signal, and whether the slot is able to be re-assigned for use by another locomotive. For slot numbers not normally associated with mobile decoders, these bits may have other meanings. This returns only those bits of the slot's STAT byte which are related to the slot's "status". Possible values are LnConstants.LOCO_IN_USE,LnConstants.LOCO_IDLE,LnConstants.LOCO_COMMON,LnConstants.LOCO_FREE- Returns:
- the slot status bits associated with the slot
 
 - 
ss2public int ss2() Get secondary slot status.These bits are set based on the STAT2 byte as seen in LocoNet slot write and slot read messages. These bits determine how the command station interprets the "address" field of the slot. For slot numbers not normally associated with mobile decoders, these bits may have other meanings. This returns only those bits of the slot's STAT2 byte which are related to the slot's "secondary status". - Returns:
- the slot secondary status bits associated with the slot
 
 - 
getIsInitilizedpublic boolean getIsInitilized() Get the state of the Acquire Throttle / slot. It is fully initialized if this is true. If it is false then any changes to its state may be lost.- Returns:
- true
 
 - 
setIsInitializedprotected void setIsInitialized(boolean state) 
 - 
consistStatuspublic int consistStatus() Get consist status.This returns only those bits of the slot's STAT byte which are related to the slot's "consisting status". For slot numbers not normally associated with mobile decoders, these bits may have other meanings. Possible values are LnConstants.CONSIST_NO,LnConstants.CONSIST_TOP,LnConstants.CONSIST_MID,LnConstants.CONSIST_SUB- Returns:
- the slot "consist status", with unrelated bits zeroed
 
 - 
isForwardpublic boolean isForward() Returns the direction of loco movement which applies when the slot's speed is set for movement.For slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if slot is set for forward movement, else false
 
 - 
isFunctionpublic boolean isFunction(int Fn) Return a slot Function state.See individual Functions for meanings. - Parameters:
- Fn- Function number, 0-28
- Returns:
- true if Function is "on", else false
 
 - 
isF0public boolean isF0() Returns the slot's F0 stateFor slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if F0 is "on", else false
 
 - 
isF1public boolean isF1() Returns the slot's F1 stateFor slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if F1 is "on", else false
 
 - 
isF2public boolean isF2() Returns the slot's F2 stateFor slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if F2 is "on", else false
 
 - 
isF3public boolean isF3() Returns the slot's F3 stateFor slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if F3 is "on", else false
 
 - 
isF4public boolean isF4() Returns the slot's F4 stateFor slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if F4 is "on", else false
 
 - 
isF5public boolean isF5() Returns the slot's F5 stateFor slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if F5 is "on", else false
 
 - 
isF6public boolean isF6() Returns the slot's F6 stateFor slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if F6 is "on", else false
 
 - 
isF7public boolean isF7() Returns the slot's F7 stateFor slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if F7 is "on", else false
 
 - 
isF8public boolean isF8() Returns the slot's F8 stateFor slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if F8 is "on", else false
 
 - 
isF9public boolean isF9() Returns the slot's F9 stateSome command stations do not actively remember the state of this function. JMRI attempts to track the messages which control this function, but may not reliably do so in some cases. For slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if F9 is "on", else false
 
 - 
isF10public boolean isF10() Returns the slot's F10 stateSome command stations do not actively remember the state of this function. JMRI attempts to track the messages which control this function, but may not reliably do so in some cases. For slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if F10 is "on", else false
 
 - 
isF11public boolean isF11() Returns the slot's F11 stateSome command stations do not actively remember the state of this function. JMRI attempts to track the messages which control this function, but may not reliably do so in some cases. For slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if F11 is "on", else false
 
 - 
isF12public boolean isF12() Returns the slot's F12 stateSome command stations do not actively remember the state of this function. JMRI attempts to track the messages which control this function, but may not reliably do so in some cases. For slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if F12 is "on", else false
 
 - 
isF13public boolean isF13() Returns the slot's F13 stateSome command stations do not actively remember the state of this function. JMRI attempts to track the messages which control this function, but may not reliably do so in some cases. For slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if F13 is "on", else false
 
 - 
isF14public boolean isF14() Returns the slot's F14 stateSome command stations do not actively remember the state of this function. JMRI attempts to track the messages which control this function, but may not reliably do so in some cases. For slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if F14 is "on", else false
 
 - 
isF15public boolean isF15() Returns the slot's F15 stateSome command stations do not actively remember the state of this function. JMRI attempts to track the messages which control this function, but may not reliably do so in some cases. For slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if F15 is "on", else false
 
 - 
isF16public boolean isF16() Returns the slot's F16 stateSome command stations do not actively remember the state of this function. JMRI attempts to track the messages which control this function, but may not reliably do so in some cases. For slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if F16 is "on", else false
 
 - 
isF17public boolean isF17() Returns the slot's F17 stateSome command stations do not actively remember the state of this function. JMRI attempts to track the messages which control this function, but may not reliably do so in some cases. For slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if F17 is "on", else false
 
 - 
isF18public boolean isF18() Returns the slot's F1 stateSome command stations do not actively remember the state of this function. JMRI attempts to track the messages which control this function, but may not reliably do so in some cases. For slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if F1 is "on", else false
 
 - 
isF19public boolean isF19() Returns the slot's F19 stateSome command stations do not actively remember the state of this function. JMRI attempts to track the messages which control this function, but may not reliably do so in some cases. For slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if F19 is "on", else false
 
 - 
isF20public boolean isF20() Returns the slot's F20 stateSome command stations do not actively remember the state of this function. JMRI attempts to track the messages which control this function, but may not reliably do so in some cases. For slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if F20 is "on", else false
 
 - 
isF21public boolean isF21() Returns the slot's F21 stateSome command stations do not actively remember the state of this function. JMRI attempts to track the messages which control this function, but may not reliably do so in some cases. For slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if F21 is "on", else false
 
 - 
isF22public boolean isF22() Returns the slot's F22 stateSome command stations do not actively remember the state of this function. JMRI attempts to track the messages which control this function, but may not reliably do so in some cases. For slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if F22 is "on", else false
 
 - 
isF23public boolean isF23() Returns the slot's F23 stateSome command stations do not actively remember the state of this function. JMRI attempts to track the messages which control this function, but may not reliably do so in some cases. For slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if F23 is "on", else false
 
 - 
isF24public boolean isF24() Returns the slot's F24 stateSome command stations do not actively remember the state of this function. JMRI attempts to track the messages which control this function, but may not reliably do so in some cases. For slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if F24 is "on", else false
 
 - 
isF25public boolean isF25() Returns the slot's F25 stateSome command stations do not actively remember the state of this function. JMRI attempts to track the messages which control this function, but may not reliably do so in some cases. For slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if F25 is "on", else false
 
 - 
isF26public boolean isF26() Returns the slot's F26 stateSome command stations do not actively remember the state of this function. JMRI attempts to track the messages which control this function, but may not reliably do so in some cases. For slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if F26 is "on", else false
 
 - 
isF27public boolean isF27() Returns the slot's F27 stateSome command stations do not actively remember the state of this function. JMRI attempts to track the messages which control this function, but may not reliably do so in some cases. For slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if F27 is "on", else false
 
 - 
isF28public boolean isF28() Returns the slot's F28 stateSome command stations do not actively remember the state of this function. JMRI attempts to track the messages which control this function, but may not reliably do so in some cases. For slot numbers not normally associated with mobile decoders, this bit may have other meanings. - Returns:
- true if F28 is "on", else false
 
 - 
locoAddrpublic int locoAddr() Returns the mobile decoder address associated with the slot.Note that the returned address can encode a "short" address, a "long" address or an "alias". For slot numbers not normally associated with mobile decoders, these bits may have other meanings. - Returns:
- the mobile decoder address
 
 - 
speedpublic int speed() Returns the mobile decoder speed associated with the slotIf this slot object is consisted to another slot and is not the "top" of the consist, then the return value is the slot number to which this slot is consisted. For slot numbers not normally associated with mobile decoders, these bits may have other meanings. - Returns:
- the current speed step associated with the slot.
 
 - 
dirfpublic int dirf() Returns the mobile decoder direction and F0-F4 bits, as used in the DIRF bits of various LocoNet messages.If this slot object is consisted to another slot and is not the "top" of the consist, then the "direction" bit reflects the relative direction of this loco with respect to the loco it is consisted to, where "Reverse" means it travels in the "reverse" direction with respect to the loco to which it is consisted. For slot numbers not normally associated with mobile decoders, these bits may have other meanings. - Returns:
- the <DIRF> byte value
 
 - 
sndpublic int snd() Returns the mobile decoder F5-F8 bits, as used in the SND bits of various LocoNet messages.For slot numbers not normally associated with mobile decoders, these bits may have other meanings. - Returns:
- the <SND> byte value
 
 - 
idpublic int id() Returns the "Throttle ID" associated with the slot.The returned value is a 14-bit integer comprised of ID1 as the least-significant bits and ID2 as the most-significant bits. For slot numbers not normally associated with mobile decoders, these bits may have other meanings. - Returns:
- an integer representing the throttle ID number
 
 - 
pcmdpublic int pcmd() Returns the programmer command associated with the slot.The returned value is taken from the <PCMD> byte of programmer slot read and write LocoNet messages. For slot numbers other than the programmer slot, these bits may have other meanings. - Returns:
- the <PCMD> byte
 
 - 
cvvalpublic int cvval() 
 - 
setSlotpublic void setSlot(LocoNetMessage l) throws LocoNetException Update the slot object to reflect the specific contents of a LocoNet message.Note that the object's "slot" field is not updated by this method. - Parameters:
- l- a LocoNet message
- Throws:
- LocoNetException- if the message is not one which contains slot-related data
 
 - 
functionMessagepublic void functionMessage(long pkt) Sets F9 through F28 (as appropriate) from data extracted from LocoNet "OPC_IMM_PACKET" message.If the pkt parameter does not contain data from an appropriate OPC_IMM_PACKET message, the pkt is ignored and the slot object remains unchanged. - Parameters:
- pkt- is a "long" consisting of four bytes extracted from a LocoNet "OPC_IMM_PACKET" message.
 
 - 
writeModepublic LocoNetMessage writeMode(int status) Update the decoder type bits in STAT1 (D2, D1, D0)- Parameters:
- status- New values for STAT1 (D2, D1, D0)
- Returns:
- Formatted LocoNet message to change value.
 
 - 
writeThrottleIDpublic LocoNetMessage writeThrottleID(int newID) Sets the object's ID value and returns a LocoNet message to inform the command station that the throttle ID has been changed.- Parameters:
- newID- the new ID number to set into the slot object
- Returns:
- a LocoNet message containing a "Slot Write" message to inform the command station that a specific throttle is controlling the slot.
 
 - 
setThrottleIdentitypublic void setThrottleIdentity(int throttleId) Set the throttle ID in the slot- Parameters:
- throttleId- full id
 
 - 
getThrottleIdentitypublic int getThrottleIdentity() Get the throttle ID in the slot- Returns:
- the Id of the Throttle
 
 - 
getLeadSlotpublic int getLeadSlot() 
 - 
writeStatuspublic LocoNetMessage writeStatus(int status) Update the status mode bits in STAT1 (D5, D4)- Parameters:
- status- New values for STAT1 (D5, D4)
- Returns:
- Formatted LocoNet message to change value.
 
 - 
writeSpeedpublic LocoNetMessage writeSpeed(int speed) Update Speed- Parameters:
- speed- new speed
- Returns:
- Formatted LocoNet message to change value.
 
 - 
dispatchSlotpublic LocoNetMessage dispatchSlot() Create LocoNet message which dispatches this slot Note that the invoking method ought to invoke the slot's NotifySlotListeners method to inform any other interested parties that the slot status has changed.- Returns:
- LocoNet message which "dispatches" the slot
 
 - 
writeNullMovepublic LocoNetMessage writeNullMove() Create a message to perform a null move on this slot.- Returns:
- correct LocoNetMessage for protocol being used.
 
 - 
releaseSlotpublic LocoNetMessage releaseSlot() Create a LocoNet OPC_SLOT_STAT1 message which releases this slot to the "Common" state The invoking method must send the returned LocoNet message to LocoNet in order to have a useful effect. Upon receipt of the echo of the transmitted OPC_SLOT_STAT1 message, the LocoNetSlot object will notify its listeners.- Returns:
- LocoNet message which "releases" the slot to the "Common" state
 
 - 
writeSlotpublic LocoNetMessage writeSlot() Creates a LocoNet "OPC_WR_SL_DATA" message containing the current state of the LocoNetSlot object.- Returns:
- a LocoNet message which can be used to inform the command station of a change in the slot contents.
 
 - 
addSlotListenerpublic void addSlotListener(SlotListener l) Registers a slot listener if it is not already registered.- Parameters:
- l- a slot listener
 
 - 
removeSlotListenerpublic void removeSlotListener(SlotListener l) Un-registers a slot listener.- Parameters:
- l- a slot listener
 
 - 
getLastUpdateTimepublic long getLastUpdateTime() Returns the timestamp when this LocoNetSlot was updated by some LocoNet message.- Returns:
- last time the slot info was updated
 
 - 
notifySlotListenerspublic void notifySlotListeners() Notifies all listeners that this slot has been changed in some way.
 - 
setFcCntrlBitOnpublic void setFcCntrlBitOn(int val) For fast-clock slot, set a "CLK_CNTRL" bit On. This method logs an error if invoked for a slot other than the fast-clock slot.- Parameters:
- val- is the new "CLK_CNTRL" bit value to turn On
 
 - 
setFcCntrlBitOffpublic void setFcCntrlBitOff(int val) For fast-clock slot, set a "CLK_CNTRL" bit Off. This method logs an error if invoked for a slot other than the fast-clock slot.- Parameters:
- val- is the new "CLK_CNTRL" bit value to turn Off
 
 - 
getTrackStatuspublic int getTrackStatus() Get the track status byte (location 7)Note that the <TRK> byte is not accurate on some command stations. - Returns:
- the effective <TRK> byte
 
 - 
setTrackStatuspublic void setTrackStatus(int status) Set the track status byte (location 7)Note that setting the LocoNetSlot object's track status may result in a change to the command station's actual track status if the slot's status is communicated to the command station via an OPC_WR_DL_DATA LocoNet message. - Parameters:
- status- is the new track status value.
 
 - 
getFcDayspublic int getFcDays() Return the days value from the slot. Only valid for fast-clock slot.This method logs an error if invoked for a slot other than the fast-clock slot. - Returns:
- "Days" value currently in fast-clock slot.
 
 - 
setFcDayspublic void setFcDays(int val) For fast-clock slot, set "days" value.Note that the new days value is not effective until a LocoNet message is sent which writes the fast-clock slot data. This method logs an error if invoked for a slot other than the fast-clock slot. - Parameters:
- val- is the new fast-clock "days" value
 
 - 
getFcHourspublic int getFcHours() Return the hours value from the slot. Only valid for fast-clock slot.This method logs an error if invoked for a slot other than the fast-clock slot. - Returns:
- "Hours" value currently stored in fast clock slot.
 
 - 
setFcHourspublic void setFcHours(int val) For fast-clock slot, set "hours" value.Note that the new hours value is not effective until a LocoNet message is sent which writes the fast-clock slot data. This method logs an error if invoked for a slot other than the fast-clock slot. - Parameters:
- val- is the new fast-clock "hours" value
 
 - 
getFcMinutespublic int getFcMinutes() Return the minutes value from the slot. Only valid for fast-clock slot.This method logs an error if invoked for a slot other than the fast-clock slot. - Returns:
- Return minutes value currently stored in the fast clock slot.
 
 - 
setFcMinutespublic void setFcMinutes(int val) For fast-clock slot, set "minutes" value.Note that the new minutes value is not effective until a LocoNet message is sent which writes the fast-clock slot data. This method logs an error if invoked for a slot other than the fast-clock slot. - Parameters:
- val- is the new fast-clock "minutes" value
 
 - 
getFcFracMinspublic int getFcFracMins() Return the fractional minutes value from the slot. Only valid for fast- clock slot.This method logs an error if invoked for a slot other than the fast-clock slot. - Returns:
- Return frac_mins field which is the number of 65ms ticks until then next minute rollover. These ticks step at the current fast clock rate
 
 - 
setFcFracMinspublic void setFcFracMins(int val) Set the "frac_mins" value. This has to be calculated as required by the Command Station, then bit shifted if required. It is comprised of a base number and the distance from the base to 0x8000 or 0x4000 deoending on command station. It is read and written as is LO,HO and loses the bit 7 of the LO. It was never intended for external use. The base can be found by setting the clock to 0xXX7F, with a rate of 1 and pounding the clock every 250 to 100 msecs until it roles.Note 1: The new fractional minutes value is not effective until a LocoNet slot write happens Note 2: DT40x & DT500 throttles ignore this value, and set only the whole minutes. This method logs an error if invoked for a slot other than the fast-clock slot. - Parameters:
- val- is the new fast-clock "fractional minutes" including the base, and bit shifted if required.
 
 - 
getFcRatepublic int getFcRate() Get the fast-clock rate. Only valid for fast-clock slot.This method logs an error if invoked for a slot other than the fast-clock slot. - Returns:
- Rate stored in fast clock slot.
 
 - 
setFcRatepublic void setFcRate(int val) For fast-clock slot, set "rate" value.Note that the new rate is not effective until a LocoNet message is sent which writes the fast-clock slot data. This method logs an error if invoked for a slot other than the fast-clock slot. - Parameters:
- val- is the new fast-clock rate
 
 
- 
 
-