001package jmri.jmrix.loconet.ms100;
002
003/**
004 * Definition of objects to handle configuring a LocoBuffer layout connection
005 * via a LocoNet MS100Adapter object.
006 *
007 * @author Bob Jacobsen Copyright (C) 2001, 2003
008 */
009public class ConnectionConfig extends jmri.jmrix.AbstractSerialConnectionConfig {
010
011    /**
012     * Ctor for an object being created during load process; Swing init is
013     * deferred.
014     *
015     * @param p the SerialPortAdapter to associate with this connection
016     */
017    public ConnectionConfig(jmri.jmrix.SerialPortAdapter p) {
018        super(p);
019    }
020
021    /**
022     * Ctor for a connection configuration with no preexisting adapter.
023     * {@link #setInstance()} will fill the adapter member.
024     */
025    public ConnectionConfig() {
026        super();
027    }
028
029    /**
030     * Provide this adapter name, if it's available on this system.
031     *
032     * @return null if this is a macOS system that can't run MS100
033     */
034    @Override
035    public String name() {
036        return "LocoNet MS100";
037    }
038
039    /**
040     * {@inheritDoc}
041     */
042    @Override
043    protected void setInstance() {
044        if (adapter == null) {
045            adapter = new MS100Adapter();
046        }
047    }
048
049}