001package jmri.jmrix.anyma;
002
003import jmri.jmrix.UsbPortAdapter;
004import org.slf4j.Logger;
005import org.slf4j.LoggerFactory;
006
007/**
008 * Provides an Adapter to allow the system connection memo and multiple
009 * AnymaDMX_ managers to be handled.
010 *
011 * @author George Warner Copyright (c) 2017-2018
012 * @since 4.9.6
013 */
014public class AnymaDMX_UsbPortAdapter extends UsbPortAdapter {
015
016    /**
017     * constructor
018     */
019    public AnymaDMX_UsbPortAdapter() {
020        super(new AnymaDMX_SystemConnectionMemo());
021        log.debug("*    Constructor");
022
023        setVendorID((short) 0x16C0);
024        setProductID((short) 0x05DC);
025    }
026
027    /**
028     * {@inheritDoc}
029     */
030    @Override
031    public void configure() {
032        log.debug("*    configure() called.");
033
034        // connect to the traffic controller
035        AnymaDMX_TrafficController controller = new AnymaDMX_TrafficController();
036        controller.connectPort(this);
037
038        AnymaDMX_SystemConnectionMemo memo = (AnymaDMX_SystemConnectionMemo) getSystemConnectionMemo();
039
040        memo.setTrafficController(controller);
041        memo.configureManagers();
042    }
043
044    private final static Logger log
045            = LoggerFactory.getLogger(AnymaDMX_UsbPortAdapter.class);
046}