1 /* 2 * Copyright © 2016 Greg Chabala 3 * 4 * This file is part of brick-control-lab. 5 * 6 * brick-control-lab is free software: you can redistribute it and/or modify 7 * it under the terms of the GNU Lesser General Public License as 8 * published by the Free Software Foundation, either version 3 of the 9 * License, or (at your option) any later version. 10 * 11 * brick-control-lab is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public License 17 * along with brick-control-lab. If not, see http://www.gnu.org/licenses/. 18 */ 19 package org.chabala.brick.controllab; 20 21 /** 22 * Identifiers for the input ports on the control lab. 23 * <p> 24 * Inputs 1-4 are passive, they read the resistence of the sensor 25 * connected to them. They are colored yellow on the control lab. 26 * <p> 27 * Inputs 5-8 are active, they supply power to the connected sensor 28 * in order for it to work. They are colored blue on the control lab. 29 */ 30 public enum InputId { 31 /** Input 1. */ I1(InputType.PASSIVE), 32 /** Input 2. */ I2(InputType.PASSIVE), 33 /** Input 3. */ I3(InputType.PASSIVE), 34 /** Input 4. */ I4(InputType.PASSIVE), 35 /** Input 5. */ I5(InputType.ACTIVE), 36 /** Input 6. */ I6(InputType.ACTIVE), 37 /** Input 7. */ I7(InputType.ACTIVE), 38 /** Input 8. */ I8(InputType.ACTIVE); 39 40 private final InputType inputType; 41 42 InputId(InputType inputType) { 43 this.inputType = inputType; 44 } 45 46 /** 47 * Returns an {@link InputType} to indicate if this {@link InputId} is 48 * active or passive. 49 * @return the input type for this input ID 50 */ 51 public InputType getInputType() { 52 return inputType; 53 } 54 }