Package jmri.jmrix.loconet

Provides access to LocoNet systems, along with a lot of Swing-based tools.

Initialization Sequence

This section describes the LocoNet implementation of the new (2010) configuration system.
  1. jmri.jmrix.loconet.NN.configurexml.ConnectionConfigXml is invoked by the configurexml when the specific class is named in an XML input file.
  2. It is a child of the jmri.jmrix.configurexml.AbstractConnectionConfigXml, which invokes the getInstance() method of it (not a static method) in its load() method to load the "adapter" member variable with a specific *Adapter class, e.g. MS100Adapter.
  3. More importantly, that getInstance()
  4. Later, after the port is (hopefully) up, AbstractConnectionConfigXml invokes the Adapter's configure() method.
  5. That Adapter configure() method does, in order:
    1. sets up Packetizer/port/etc as needed
    2. configureCommandStation() from LnPortController
    3. configureManagers() from LnPortController, but overridden in e.g. PR3Adapter.
    4. does any other initialization of it's own, e.g. startThreads()

      At this point, the system is basically up and ready for operation.

    5. Finally, a jmri.jmrix.loconet.LocoNetSystemConnectionMemo object is created and registered with the InstanceManager.
  6. Later, jmri.jmrix.ActiveSystemsMenu wants to create user menus, and finds the LocoNetSystemConnectionMemo object in the InstanceManager
  7. The menu code asks that specific SystemConnectionMemo object to create and return the menu. It does so, in the process connecting each Action to itself so that the individual tools will be able to connect to the proper e.g. TrafficController, SlotMonitor, etc.
  8. When an Action is fired later on, the invoked class(es) enquire of the LocoNetSystemConnectionMemo when they need a resource, instead of referring to an instance() method in the resource's class.
To adapt a type, e.g. Turnout:
  1. Basic manager needs to have getSystemPrefix in addition to letter
  2. ProxyManager has to check for system prefix, not letter

Related Documentation

For overviews, tutorials, examples, guides, and tool documentation, please see: