001package jmri.jmrix.sprog.serialdriver;
002
003import jmri.util.SystemType;
004
005/**
006 * Definition of objects to handle configuring a layout connection via an SPROG
007 * SerialDriverAdapter object.
008 *
009 * @author Bob Jacobsen Copyright (C) 2001, 2003
010 */
011public class ConnectionConfig extends jmri.jmrix.AbstractSerialConnectionConfig {
012
013    /**
014     * Ctor for an object being created during load process; Swing init is
015     * deferred.
016     * @param p Serial port adapter.
017     */
018    public ConnectionConfig(jmri.jmrix.SerialPortAdapter p) {
019        super(p);
020    }
021
022    /**
023     * Ctor for a connection configuration with no preexisting adapter.
024     * {@link #setInstance()} will fill the adapter member.
025     */
026    public ConnectionConfig() {
027        super();
028    }
029
030    @Override
031    public String name() {
032        return "SPROG"; // NOI18N
033    }
034
035    @Override
036    protected String[] getPortFriendlyNames() {
037        if (SystemType.isWindows()) {
038            return new String[]{"SPROG"};
039        }
040        return new String[]{};
041    }
042
043    /**
044     * {@inheritDoc}
045     */
046    @Override
047    protected void setInstance() {
048        if(adapter == null) {
049           adapter = new SerialDriverAdapter();
050        }
051    }
052
053}