/*
 *  Copyright (C) 2006  Takashi Kasuya <kasuya@sfc.keio.ac.jp>
 *
 * This library is free software; you can redistribute it and/or
 *　modify it under the terms of the GNU Lesser General Public
 *　License as published by the Free Software Foundation; either
 *　version 2.1 of the License, or (at your option) any later version.
 *　This library is distributed in the hope that it will be useful,
 *　but WITHOUT ANY WARRANTY; without even the implied warranty of
 *　MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *　Lesser General Public License for more details.
 *
 *　You should have received a copy of the GNU Lesser General Public
 *　License along with this library; if not, write to the Free Software
 *　Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */


package jp.ac.naka.ec.serial;

/**
 * MOXAのセンサーデバイスを表すクラス
 * @author 粕谷
 * 
 */
public class MoxaDeviceType {
	public static final int DEVICE_TYPE_NULL = 0; // !< デバイスを接続していないとき指定してください
	public static final int SENSOR_TYPE_COLOR = 1; // !< 光センサー
	public static final int SENSOR_TYPE_INFRARED = 2; // !< 赤外線センサー
	public static final int SENSOR_TYPE_SGAS = 3; // !< ガスセンサー (硫化物検出)
	public static final int SENSOR_TYPE_HUMIDITY = 4; // !< 湿度センサー
	public static final int SENSOR_TYPE_TEMPERATURE = 5; // !< 温度センサー
	public static final int SENSOR_TYPE_MIC = 6; // !< マイク
	public static final int SENSOR_TYPE_AIRPRESSURE = 7; // !< 気圧センサー
	public static final int SENSOR_TYPE_PRESSURE = 8; // !< 圧力センサー
	public static final int SENSOR_TYPE_ACCE = 9; // !< 加速度センサー
	public static final int SENSOR_TYPE_GYRO = 10; // !< 角速度センサー
	public static final int SENSOR_TYPE_BEND = 11; // !< 曲げセンサー
	public static final int SENSOR_TYPE_TOUCH = 12; // !< タッチセンサー
	public static final int SENSOR_TYPE_PUSH = 13; // !< プッシュボタン
	public static final int SENSOR_TYPE_SLIDER = 14; // !< スライダー
	public static final int SENSOR_TYPE_ROTATION = 15; // !< ロータリー
	public static final int ACTUATOR_TYPE_LED = 16; // !< LED (Sinkタイプ)
	public static final int ACTUATOR_TYPE_LED2 = 17; // !< LED (Sourceタイプ)
	public static final int DEVICE_TYPE_SIZEOF = 18;// !< デバイスの種類を表す列挙形の数
	
	public static String getSensorTypeString(int type) {
		String retval = "";
		switch (type) {
		case DEVICE_TYPE_NULL : retval = "DEVICE_TYPE_NULL"; break;
		case SENSOR_TYPE_COLOR : retval = "DEVICE_TYPE_COLOR"; break;
		case SENSOR_TYPE_INFRARED : retval = "SENSOR_TYPE_INFRARED"; break;
		case SENSOR_TYPE_SGAS : retval = "SENSOR_TYPE_SGAS"; break;
		case SENSOR_TYPE_HUMIDITY : retval = "SENSOR_TYPE_HUMIDITY"; break;
		case SENSOR_TYPE_TEMPERATURE : retval = "SENSOR_TYPE_TEMPERATURE"; break;
		case SENSOR_TYPE_MIC : retval = "SENSOR_TYPE_MIC"; break;
		case SENSOR_TYPE_AIRPRESSURE : retval = "SENSOR_TYPE_AIRPRESSURE"; break;
		case SENSOR_TYPE_PRESSURE : retval = "SENSOR_TYPE_PRESSURE"; break;
		case SENSOR_TYPE_ACCE : retval = "SENSOR_TYPE_ACCE"; break;
		case SENSOR_TYPE_GYRO : retval = "SENSOR_TYPE_GYRO"; break;
		case SENSOR_TYPE_TOUCH : retval = "SENSOR_TYPE_TOUCH"; break;
		case SENSOR_TYPE_PUSH : retval = "SENSOR_TYPE_PUSH"; break;
		case SENSOR_TYPE_SLIDER : retval = "SENSOR_TYPE_SLIDER"; break;
		case SENSOR_TYPE_ROTATION : retval = "SENSOR_TYPE_ROTATION"; break;
		case ACTUATOR_TYPE_LED : retval = "ACTUATOR_TYPE_LED"; break;
		case ACTUATOR_TYPE_LED2 : retval = "ACTUATOR_TYPE_LED2"; break;
		default :
			assert(false);
		}
		return retval;
	}
}
