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