Class LnSimple7thGenDeviceRoutes

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, LnPanelInterface

public class LnSimple7thGenDeviceRoutes extends LnPanel
Contains all the route of a device.
See Also:
  • Constructor Details

  • Method Details

    • initComponents

      2nd stage of initialization, invoked after the constructor is complete.

      This needs to be connected to the initContext() method in implementing classes.

      Specified by:
      initComponents in interface LnPanelInterface
      Overrides:
      initComponents in class LnPanel
      Parameters:
      memo - a LocoNetSystemConnectionMemo object
    • initComponents

      public void initComponents()
      2nd stage of initialization, invoked after the constructor is complete.
      Overrides:
      initComponents in class JmriPanel
    • makeTextPanel

      protected JComponent makeTextPanel(int i, int numEntries)
    • getDeviceType

      public static int getDeviceType(String name)
      Get the device turnoutNumber (IPL device turnoutNumber) from the device name.
      Parameters:
      name - Device name
      Returns:
      device turnoutNumber
    • getDeviceName

      public static String getDeviceName(int typeNum)
      Get the device name from the device (IPL) nuber.
      Parameters:
      typeNum - device type number
      Returns:
      String containing the device name
    • getDeviceType

      public int getDeviceType()
      Getter.
      Returns:
      device type turnoutNumber
    • getSerNum

      public int getSerNum()
      Getter.
      Returns:
      device serial turnoutNumber
    • getRoutes

      Get the routes.
      Returns:
      cloned LnSimple7thGenRoute[], if any.
    • getRoutes

      public LnSimple7thGenRoute getRoutes(int routeNumber)
      get a specific route.
      Parameters:
      routeNumber - route number
      Returns:
      LnSimple7thGenRoute
    • setRoutes

      public void setRoutes(LnSimple7thGenRoute[] newRoutes)
      Set the routes.
      Parameters:
      newRoutes - an array of routes
    • setOneEntry

      public void setOneEntry(int routeNum, int entryNum, int turn, RouteSwitchPositionEnum posn)
      Set one route entry.
      Parameters:
      routeNum - route number
      entryNum - entry number
      turn - Turnout number
      posn - Position
    • setFourEntries

      public LnSimple7thGenRoute setFourEntries(int routeNum, int entrySet, int entrya, int entryb, int entryc, int entryd)
      Set four entries for a route
      Parameters:
      routeNum - Route number
      entrySet - Entry set
      entrya - Entry a of the set
      entryb - Entry b of the set
      entryc - Entry c of the set
      entryd - Entry d of the set
      Returns:
      a route
    • getOneEntryString

      public String getOneEntryString(int routeNum, int entryNum)
      get a route entry as a string.
      Parameters:
      routeNum - Route number
      entryNum - Entry number
      Returns:
      String like "Unused" or "1c" or "2044t"
    • getRoute

      public LnSimple7thGenRoute getRoute(int routeNum)
      Get a route.
      Parameters:
      routeNum - Route number
      Returns:
      LnSimple7thGenRoute, or null if route not defined
    • getBaseAddr

      public int getBaseAddr()
      Getter.
      Returns:
      Base Addr
    • setBaseAddr

      public void setBaseAddr(int baseAddr)
      Setter.
      Parameters:
      baseAddr - the base address