001package jmri.jmrit.ctc.ctcserialdata;
002
003import java.util.ArrayList;
004
005/**
006 * @author Gregory J. Bedlek Copyright (C) 2018, 2019
007 *
008 * This describes a single line of Call On Data from the GUI screen.
009 */
010public class CallOnEntry {
011    public final String _mExternalSignal;
012    public final String _mSignalFacingDirection;
013    public final String _mSignalAspectToDisplay;
014    public final String _mCalledOnExternalSensor;
015    public final String _mExternalBlock;
016    public final String _mSwitchIndicator1;
017    public final String _mSwitchIndicator2;
018    public final String _mSwitchIndicator3;
019    public final String _mSwitchIndicator4;
020    public final String _mSwitchIndicator5;
021    public final String _mSwitchIndicator6;
022
023    private static final int EXTERNAL_SIGNAL_INDEX = 0;
024    private static final int SIGNAL_FACING_DIRECTION_INDEX = 1;
025    private static final int SIGNAL_ASPECT_TO_DISPLAY_INDEX = 2;
026    private static final int CALLED_ON_EXTERNAL_SENSOR_INDEX = 3;
027    private static final int EXTERNAL_BLOCK_INDEX = 4;
028    private static final int SWITCHINDICATOR1_INDEX = 5;
029    private static final int SWITCHINDICATOR2_INDEX = 6;
030    private static final int SWITCHINDICATOR3_INDEX = 7;
031    private static final int SWITCHINDICATOR4_INDEX = 8;
032    private static final int SWITCHINDICATOR5_INDEX = 9;
033    private static final int SWITCHINDICATOR6_INDEX = 10;
034    private static final int ARRAY_SIZE = 11;
035
036    public CallOnEntry(String csvString) {
037        ArrayList<String> arrayListOfStrings = ProjectsCommonSubs.getFixedArrayListSizeFromCSV(csvString, ARRAY_SIZE);
038        _mExternalSignal = arrayListOfStrings.get(EXTERNAL_SIGNAL_INDEX);
039        _mSignalFacingDirection = arrayListOfStrings.get(SIGNAL_FACING_DIRECTION_INDEX);
040        _mSignalAspectToDisplay = arrayListOfStrings.get(SIGNAL_ASPECT_TO_DISPLAY_INDEX);
041        _mCalledOnExternalSensor = arrayListOfStrings.get(CALLED_ON_EXTERNAL_SENSOR_INDEX);
042        _mExternalBlock = arrayListOfStrings.get(EXTERNAL_BLOCK_INDEX);
043        _mSwitchIndicator1 = arrayListOfStrings.get(SWITCHINDICATOR1_INDEX);
044        _mSwitchIndicator2 = arrayListOfStrings.get(SWITCHINDICATOR2_INDEX);
045        _mSwitchIndicator3 = arrayListOfStrings.get(SWITCHINDICATOR3_INDEX);
046        _mSwitchIndicator4 = arrayListOfStrings.get(SWITCHINDICATOR4_INDEX);
047        _mSwitchIndicator5 = arrayListOfStrings.get(SWITCHINDICATOR5_INDEX);
048        _mSwitchIndicator6 = arrayListOfStrings.get(SWITCHINDICATOR6_INDEX);
049    }
050}