Class SprogSlot


  • public class SprogSlot
    extends java.lang.Object
    Represent information for a DCC Command Station Queue entry where each entry is a DCC packet to be transmitted to the rails.

    A SlotListener can be registered to hear of changes in this slot. All changes in values will result in notification.

    Updated by Andrew Crosland February 2012 to allow slots to hold 28 step speed packets

    • Constructor Summary

      Constructors 
      Constructor Description
      SprogSlot​(int num)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()  
      void eStop()  
      void f0to4packet​(int address, boolean isLongAddress, boolean f0, boolean f0Momentary, boolean f1, boolean f1Momentary, boolean f2, boolean f2Momentary, boolean f3, boolean f3Momentary, boolean f4, boolean f4Momentary)  
      void f13to20packet​(int address, boolean isLongAddress, boolean f13, boolean f13Momentary, boolean f14, boolean f14Momentary, boolean f15, boolean f15Momentary, boolean f16, boolean f16Momentary, boolean f17, boolean f17Momentary, boolean f18, boolean f18Momentary, boolean f19, boolean f19Momentary, boolean f20, boolean f20Momentary)  
      void f21to28packet​(int address, boolean isLongAddress, boolean f21, boolean f21Momentary, boolean f22, boolean f22Momentary, boolean f23, boolean f23Momentary, boolean f24, boolean f24Momentary, boolean f25, boolean f25Momentary, boolean f26, boolean f26Momentary, boolean f27, boolean f27Momentary, boolean f28, boolean f28Momentary)  
      void f29to36packet​(int address, boolean isLongAddress, boolean f29, boolean f29Momentary, boolean f30, boolean f30Momentary, boolean f31, boolean f31Momentary, boolean f32, boolean f32Momentary, boolean f33, boolean f33Momentary, boolean f34, boolean f34Momentary, boolean f35, boolean f35Momentary, boolean f36, boolean f36Momentary)  
      void f37to44packet​(int address, boolean isLongAddress, boolean f37, boolean f37Momentary, boolean f38, boolean f38Momentary, boolean f39, boolean f39Momentary, boolean f40, boolean f40Momentary, boolean f41, boolean f41Momentary, boolean f42, boolean f42Momentary, boolean f43, boolean f43Momentary, boolean f44, boolean f44Momentary)  
      void f45to52packet​(int address, boolean isLongAddress, boolean f45, boolean f45Momentary, boolean f46, boolean f46Momentary, boolean f47, boolean f47Momentary, boolean f48, boolean f48Momentary, boolean f49, boolean f49Momentary, boolean f50, boolean f50Momentary, boolean f51, boolean f51Momentary, boolean f52, boolean f52Momentary)  
      void f53to60packet​(int address, boolean isLongAddress, boolean f53, boolean f53Momentary, boolean f54, boolean f54Momentary, boolean f55, boolean f55Momentary, boolean f56, boolean f56Momentary, boolean f57, boolean f57Momentary, boolean f58, boolean f58Momentary, boolean f59, boolean f59Momentary, boolean f60, boolean f60Momentary)  
      void f5to8packet​(int address, boolean isLongAddress, boolean f5, boolean f5Momentary, boolean f6, boolean f6Momentary, boolean f7, boolean f7Momentary, boolean f8, boolean f8Momentary)  
      void f61to68packet​(int address, boolean isLongAddress, boolean f61, boolean f61Momentary, boolean f62, boolean f62Momentary, boolean f63, boolean f63Momentary, boolean f64, boolean f64Momentary, boolean f65, boolean f65Momentary, boolean f66, boolean f66Momentary, boolean f67, boolean f67Momentary, boolean f68, boolean f68Momentary)  
      void f9to12packet​(int address, boolean isLongAddress, boolean f9, boolean f9Momentary, boolean f10, boolean f10Momentary, boolean f11, boolean f11Momentary, boolean f12, boolean f12Momentary)  
      int getAddr()  
      boolean getIsLong()  
      long getLastUpdateTime()  
      byte[] getPayload()
      Get the payload of this slot.
      int getRepeat()  
      int getSlotNumber()  
      boolean isActiveAddressMatch​(DccLocoAddress address)  
      boolean isF0to4Packet()  
      boolean isF13to20Packet()  
      boolean isF21to28Packet()  
      boolean isF29to36Packet()  
      boolean isF37to44Packet()  
      boolean isF45to52Packet()  
      boolean isF53to60Packet()  
      boolean isF5to8Packet()  
      boolean isF61to68Packet()  
      boolean isF9to12Packet()  
      boolean isFinished()  
      boolean isForward()  
      boolean isFree()  
      boolean isLongAddress()  
      boolean isOpsPkt()  
      boolean isSpeedPacket()  
      int locoAddr()  
      void set​(int address, byte[] payload, int repeat)
      Set the contents of the slot.
      void setAccessoryPacket​(int address, boolean closed, int repeats)  
      void setAddr​(int a)  
      void setIsLong​(boolean a)  
      void setOps​(int address, boolean longAddr, int cv, int val)  
      void setRepeat​(int r)  
      void setSpeed​(SpeedStepMode mode, int address, boolean isLongAddress, int speed, boolean forward)  
      int slotStatus()  
      int speed()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • set

        public void set​(int address,
                        byte[] payload,
                        int repeat)
        Set the contents of the slot. Intended for accessory packets.
        Parameters:
        address - int
        payload - byte[]
        repeat - int
      • setAccessoryPacket

        public void setAccessoryPacket​(int address,
                                       boolean closed,
                                       int repeats)
      • setSpeed

        public void setSpeed​(SpeedStepMode mode,
                             int address,
                             boolean isLongAddress,
                             int speed,
                             boolean forward)
      • setOps

        public void setOps​(int address,
                           boolean longAddr,
                           int cv,
                           int val)
      • f5to8packet

        public void f5to8packet​(int address,
                                boolean isLongAddress,
                                boolean f5,
                                boolean f5Momentary,
                                boolean f6,
                                boolean f6Momentary,
                                boolean f7,
                                boolean f7Momentary,
                                boolean f8,
                                boolean f8Momentary)
      • f9to12packet

        public void f9to12packet​(int address,
                                 boolean isLongAddress,
                                 boolean f9,
                                 boolean f9Momentary,
                                 boolean f10,
                                 boolean f10Momentary,
                                 boolean f11,
                                 boolean f11Momentary,
                                 boolean f12,
                                 boolean f12Momentary)
      • f13to20packet

        public void f13to20packet​(int address,
                                  boolean isLongAddress,
                                  boolean f13,
                                  boolean f13Momentary,
                                  boolean f14,
                                  boolean f14Momentary,
                                  boolean f15,
                                  boolean f15Momentary,
                                  boolean f16,
                                  boolean f16Momentary,
                                  boolean f17,
                                  boolean f17Momentary,
                                  boolean f18,
                                  boolean f18Momentary,
                                  boolean f19,
                                  boolean f19Momentary,
                                  boolean f20,
                                  boolean f20Momentary)
      • f21to28packet

        public void f21to28packet​(int address,
                                  boolean isLongAddress,
                                  boolean f21,
                                  boolean f21Momentary,
                                  boolean f22,
                                  boolean f22Momentary,
                                  boolean f23,
                                  boolean f23Momentary,
                                  boolean f24,
                                  boolean f24Momentary,
                                  boolean f25,
                                  boolean f25Momentary,
                                  boolean f26,
                                  boolean f26Momentary,
                                  boolean f27,
                                  boolean f27Momentary,
                                  boolean f28,
                                  boolean f28Momentary)
      • f29to36packet

        public void f29to36packet​(int address,
                                  boolean isLongAddress,
                                  boolean f29,
                                  boolean f29Momentary,
                                  boolean f30,
                                  boolean f30Momentary,
                                  boolean f31,
                                  boolean f31Momentary,
                                  boolean f32,
                                  boolean f32Momentary,
                                  boolean f33,
                                  boolean f33Momentary,
                                  boolean f34,
                                  boolean f34Momentary,
                                  boolean f35,
                                  boolean f35Momentary,
                                  boolean f36,
                                  boolean f36Momentary)
      • f37to44packet

        public void f37to44packet​(int address,
                                  boolean isLongAddress,
                                  boolean f37,
                                  boolean f37Momentary,
                                  boolean f38,
                                  boolean f38Momentary,
                                  boolean f39,
                                  boolean f39Momentary,
                                  boolean f40,
                                  boolean f40Momentary,
                                  boolean f41,
                                  boolean f41Momentary,
                                  boolean f42,
                                  boolean f42Momentary,
                                  boolean f43,
                                  boolean f43Momentary,
                                  boolean f44,
                                  boolean f44Momentary)
      • f45to52packet

        public void f45to52packet​(int address,
                                  boolean isLongAddress,
                                  boolean f45,
                                  boolean f45Momentary,
                                  boolean f46,
                                  boolean f46Momentary,
                                  boolean f47,
                                  boolean f47Momentary,
                                  boolean f48,
                                  boolean f48Momentary,
                                  boolean f49,
                                  boolean f49Momentary,
                                  boolean f50,
                                  boolean f50Momentary,
                                  boolean f51,
                                  boolean f51Momentary,
                                  boolean f52,
                                  boolean f52Momentary)
      • f53to60packet

        public void f53to60packet​(int address,
                                  boolean isLongAddress,
                                  boolean f53,
                                  boolean f53Momentary,
                                  boolean f54,
                                  boolean f54Momentary,
                                  boolean f55,
                                  boolean f55Momentary,
                                  boolean f56,
                                  boolean f56Momentary,
                                  boolean f57,
                                  boolean f57Momentary,
                                  boolean f58,
                                  boolean f58Momentary,
                                  boolean f59,
                                  boolean f59Momentary,
                                  boolean f60,
                                  boolean f60Momentary)
      • f61to68packet

        public void f61to68packet​(int address,
                                  boolean isLongAddress,
                                  boolean f61,
                                  boolean f61Momentary,
                                  boolean f62,
                                  boolean f62Momentary,
                                  boolean f63,
                                  boolean f63Momentary,
                                  boolean f64,
                                  boolean f64Momentary,
                                  boolean f65,
                                  boolean f65Momentary,
                                  boolean f66,
                                  boolean f66Momentary,
                                  boolean f67,
                                  boolean f67Momentary,
                                  boolean f68,
                                  boolean f68Momentary)
      • f0to4packet

        public void f0to4packet​(int address,
                                boolean isLongAddress,
                                boolean f0,
                                boolean f0Momentary,
                                boolean f1,
                                boolean f1Momentary,
                                boolean f2,
                                boolean f2Momentary,
                                boolean f3,
                                boolean f3Momentary,
                                boolean f4,
                                boolean f4Momentary)
      • eStop

        public void eStop()
      • clear

        public void clear()
      • isFree

        public boolean isFree()
      • setRepeat

        public void setRepeat​(int r)
      • speed

        public int speed()
      • setAddr

        public void setAddr​(int a)
      • setIsLong

        public void setIsLong​(boolean a)
      • getPayload

        public byte[] getPayload()
        Get the payload of this slot. Note - if this slot has a number of repeats, calling this method will also decrement the internal repeat counter.
        Returns:
        a byte array containing the payload of this slot