001package jmri.jmrix.marklin.cdb.serialdriver;
002
003/**
004 * Definition of objects to handle configuring a layout connection via an Marklin CDB
005 * SerialDriverAdapter object.
006 *
007 * @author Kevin Dickerson Copyright (C) 2012
008 */
009public class ConnectionConfig extends jmri.jmrix.AbstractSerialConnectionConfig {
010
011    public final static String NAME = "CC-Schnitte 2.1"; // NOI18N
012
013    /**
014     * Create a connection configuration with a preexisting adapter. This is
015     * used principally when loading a configuration that defines this
016     * connection.
017     *
018     * @param p the adapter to create a connection configuration for
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 NAME;
035    }
036
037    /**
038     * {@inheritDoc}
039     */
040    @Override
041    protected void setInstance() {
042        if (adapter == null) {
043            adapter = new SerialDriverAdapter();
044        }
045    }
046
047}