001package jmri.jmrix.loconet.usb_dcs240;
002
003/**
004 * Definition of objects to handle configuring a DCS240 USB layout connection via a
005 * PR2Adapter object.
006 * <p>
007 * Copied from loconet.pr3.ConnectionConfig.java
008 *
009 * @author Bob Jacobsen Copyright (C) 2001, 2003, 2008, 2010
010 * @author B. Milhaupt Copyright (C) 2019
011 */
012
013public class ConnectionConfig extends jmri.jmrix.AbstractSerialConnectionConfig {
014
015    /**
016     * Ctor for an object being created during load process; Swing init is
017     * deferred.
018     * @param p the SerialPortAdapter to associate with this connection
019     */
020    public ConnectionConfig(jmri.jmrix.SerialPortAdapter p) {
021        super(p);
022    }
023
024    /**
025     * Ctor for a connection configuration with no preexisting adapter.
026     * {@link #setInstance()} will fill the adapter member.
027     */
028    public ConnectionConfig() {
029        super();
030    }
031
032    @Override
033    public String name() {
034        return "DCS240 USB Interface"; // NOI18N
035    }
036
037    @Override
038    protected void setInstance() {
039        if (adapter == null) {
040            adapter = new UsbDcs240Adapter();
041        }
042    }
043}