001package jmri.jmrix.wangrow.serialdriver;
002
003import jmri.jmrix.nce.serialdriver.SerialDriverAdapter;
004
005/**
006 * Definition of objects to handle configuring a layout connection via an
007 * Wangrow SerialDriverAdapter object.
008 *
009 * @author Bob Jacobsen Copyright (C) 2001, 2003
010 */
011public class ConnectionConfig extends jmri.jmrix.AbstractSerialConnectionConfig {
012
013    public final static String NAME = Bundle.getMessage("TypeSerial");
014
015    /**
016     * Create a connection configuration with a preexisting adapter.
017     *
018     * @param p the adapter associated with the 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 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}