001package jmri.jmrix.bachrus.speedmatcher;
002
003import javax.swing.JButton;
004import javax.swing.JLabel;
005
006import jmri.DccLocoAddress;
007import jmri.PowerManager;
008import jmri.jmrix.bachrus.Speed;
009
010/**
011 * Shared configuration data for a speed matcher
012 *
013 * @author Todd Wegter Copyright (C) 2024
014 */
015public abstract class SpeedMatcherConfig {
016
017    //<editor-fold defaultstate="collapsed" desc="Instance Variables">
018    public DccLocoAddress dccLocoAddress;
019    public PowerManager powerManager;
020    public Speed.Unit speedUnit;
021
022    public boolean trimReverseSpeed;
023
024    public int warmUpForwardSeconds;
025    public int warmUpReverseSeconds;
026
027    public JLabel statusLabel;
028    public JButton startStopButton;
029    //</editor-fold>
030
031    /**
032     * Constructor for the abstract SpeedMatcherConfig at the core of any Speed
033     * Matcher Config
034     *
035     * @param address              Address of locomotive to speed match
036     * @param speedUnit            Speed.Unit to speed match the locomotive in
037     * @param trimReverseSpeed     Set to true to trim the locomotive's reverse
038     *                             speed, false otherwise
039     * @param warmUpForwardSeconds Number of seconds to warm up the locomotive
040     *                             before forward speed matching; set to 0 to
041     *                             skip the forward warm up
042     * @param warmUpReverseSeconds Number of seconds to warm up the locomotive
043     *                             before trimming revers speed; set to 0 to
044     *                             skip the reverse warm up
045     * @param powerManager         PowerManager for turning on the DCC system
046     *                             power
047     * @param statusLabel          JLabel status label in the SpeedoConsoleFrame
048     * @param startStopButton      JButton for starting and stopping speed
049     *                             matching
050     */
051    public SpeedMatcherConfig(
052            DccLocoAddress address,
053            Speed.Unit speedUnit,
054            boolean trimReverseSpeed,
055            int warmUpForwardSeconds,
056            int warmUpReverseSeconds,
057            PowerManager powerManager,
058            JLabel statusLabel,
059            JButton startStopButton
060    ) {
061        this.speedUnit = speedUnit;
062
063        this.trimReverseSpeed = trimReverseSpeed;
064
065        this.warmUpForwardSeconds = warmUpForwardSeconds;
066        this.warmUpReverseSeconds = warmUpReverseSeconds;
067
068        this.dccLocoAddress = address;
069        this.powerManager = powerManager;
070
071        this.statusLabel = statusLabel;
072        this.startStopButton = startStopButton;
073    }
074}