001package jmri.jmrix.bachrus.drmserialdriver; 002 003import jmri.util.SystemType; 004 005/** 006 * Definition of objects to handle configuring a connection via a Bachrus 007 * SerialDriverAdapter object. 008 * 009 * @author Bob Jacobsen Copyright (C) 2001, 2003 010 * @author Andrew Crosland Copyright (C) 2010 011 * @author Lolke Bijlsma Copyright (C) 2025 012 */ 013public class ConnectionConfig extends jmri.jmrix.AbstractSerialConnectionConfig { 014 015 /** 016 * Create a connection configuration with a preexisting adapter. This is 017 * used principally when loading a configuration that defines this 018 * connection. 019 * 020 * @param p the adapter to create a connection configuration for 021 */ 022 public ConnectionConfig(jmri.jmrix.SerialPortAdapter p) { 023 super(p); 024 } 025 026 /** 027 * Ctor for a connection configuration with no preexisting adapter. 028 * {@link #setInstance()} will fill the adapter member. 029 */ 030 public ConnectionConfig() { 031 super(); 032 } 033 034 @Override 035 public String name() { 036 return "Speedo"; // NOI18N 037 } 038 039 @Override 040 protected String[] getPortFriendlyNames() { 041 if (SystemType.isWindows()) { 042 return new String[]{"Bachrus Speedo", "Bachrus"}; 043 } 044 return new String[]{}; 045 } 046 047 /** 048 * {@inheritDoc} 049 */ 050 @Override 051 protected void setInstance() { 052 if (adapter == null) { 053 adapter = new SerialDriverAdapter(); 054 } 055 } 056 057}