package com.koeping.lukas.sensordatacollector;

import android.hardware.Sensor;

public enum Sensors {
    ACCELEROMETER("Accelerometer",0,3, Sensor.TYPE_ACCELEROMETER),
    LINEAR_ACCELEROMETER("LinearAccelerometer",1,3, Sensor.TYPE_LINEAR_ACCELERATION),
    GRAVITY("Gravity",2,3, Sensor.TYPE_GRAVITY),
    GYROSCOPE("Gyroscope",3,3, Sensor.TYPE_GYROSCOPE),
    MAGNETOMETER("Magnetometer", 4,3, Sensor.TYPE_MAGNETIC_FIELD),
    ROTATION_MATRIX("RotationMatrix", 5, 16, Sensor.TYPE_GRAVITY),
    ORIENTATION("Orientation", 6, 3, Sensor.TYPE_GRAVITY),
    BAROMETER("Barometer", 7, 3, Sensor.TYPE_PRESSURE);

    private int pos;
    private int nValues;
    private String name;
    private int sensorType;
    private Sensor sensor;
    private float[] data;


    private Sensors(String name, int pos, int nValues, int sensorType) {
        this.pos = pos;
        this.nValues = nValues;
        this.name = name;
        this.sensorType = sensorType;
    }

    public int getNValues() {
        return this.nValues;
    }

    public int getPos() {
        return this.pos;
    }

    public String getName() {
        return this.name;
    }

    public int getSensorType() {
        return this.sensorType;
    }

    public void setSensor(Sensor s) {
        this.sensor = s;
    }

    public Sensor getSensor() {
        return this.sensor;
    }

    public void setData(float[] data) {
        this.data = data;
    }

    public float[] getData() {
        return this.data;
    }

    public static String[] getAllNames() {
        Sensors[] allSensors = Sensors.values();
        String[] names = new String[allSensors.length];

        for(int i = 0; i < names.length; i++) {
            names[i] = allSensors[i].getName();
        }
        return names;
    }




}
