001package jmri.jmrix.tmcc.simulator;
002
003/**
004 * Handle configuring an TMCC layout connection via a SimulatorAdapter adapter.
005 * <p>
006 * This uses the {@link SimulatorAdapter} class to do the actual connection.
007 *
008 * @author Bob Jacobsen Copyright (C) 2001, 2003
009 * @author Paul Bender Copyright (C) 2009
010 * @author Mark Underwood Copyright (C) 2015
011 *
012 * @see SimulatorAdapter
013 *
014 * Based on jmri.jmrix.lenz.xnetsimulator.ConnectionConfig, copied from DCCpp,
015 * EasyDCC
016 */
017public class ConnectionConfig extends jmri.jmrix.AbstractSimulatorConnectionConfig {
018
019    /**
020     * Create a connection configuration with a preexisting adapter. This is
021     * used principally when loading a configuration that defines this
022     * connection.
023     *
024     * @param p the adapter to create a connection configuration for
025     */
026    public ConnectionConfig(jmri.jmrix.SerialPortAdapter p) {
027        super(p);
028    }
029
030    /**
031     * Ctor for a connection configuration with no preexisting adapter.
032     * {@link #setInstance()} will fill the adapter member.
033     */
034    public ConnectionConfig() {
035        super();
036    }
037
038    @Override
039    public String name() {
040        return "TMCC Simulator";
041    }
042
043    String manufacturerName = jmri.jmrix.tmcc.SerialConnectionTypeList.LIONEL;
044
045    @Override
046    public String getManufacturer() {
047        return manufacturerName;
048    }
049
050    @Override
051    public void setManufacturer(String manu) {
052        manufacturerName = manu;
053    }
054
055    /**
056     * {@inheritDoc}
057     */
058    @Override
059    protected void setInstance() {
060        if (adapter == null) {
061            adapter = new SimulatorAdapter();
062        }
063    }
064
065}