001package jmri.jmrix.can.adapters.gridconnect.net;
002
003import java.util.ResourceBundle;
004
005/**
006 * Definition of objects to handle configuring a connection via a
007 * NetworkDriverAdapter object.
008 *
009 * @author Bob Jacobsen Copyright (C) 2010
010 */
011public class MergConnectionConfig extends ConnectionConfig {
012
013    public final static String MERG_NAME = "CAN via MERG Network Interface";
014
015    /**
016     * Create a connection configuration with a preexisting adapter.
017     * This is 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 MergConnectionConfig(jmri.jmrix.NetworkPortAdapter p) {
023        super(p);
024    }
025
026    @Override
027    public String name() {
028        return MERG_NAME;
029    }
030
031    /**
032     * Ctor for a connection configuration with no preexisting adapter.
033     * {@link #setInstance()} will fill the adapter member.
034     */
035    public MergConnectionConfig() {
036        super();
037    }
038
039    /**
040     * {@inheritDoc}
041     */
042    @Override
043    protected void setInstance() {
044        if (adapter == null) {
045            adapter = new MergNetworkDriverAdapter();
046            adapter.setPort(5550);
047        }
048    }
049
050    @Override
051    protected ResourceBundle getActionModelResourceBundle() {
052        return ResourceBundle.getBundle("jmri.jmrix.can.CanActionListBundle");
053    }
054
055}