|
|
@@ -47,6 +47,7 @@ public class Accelerometer extends Detector implements SensorEventListener { |
|
|
|
private DetectionReport detectionReport; |
|
|
|
TextView textView; |
|
|
|
|
|
|
|
|
|
|
|
//Queue for taking in values |
|
|
|
LinkedBlockingQueue<Float> linkedBlockingQueue = new LinkedBlockingQueue<>(); |
|
|
|
|
|
|
@@ -94,6 +95,7 @@ public class Accelerometer extends Detector implements SensorEventListener { |
|
|
|
if (betrag > threshold) { |
|
|
|
alarm = true; |
|
|
|
detectionReport = new DetectionReport("Accelerometer1", "Bewegung", betrag); |
|
|
|
reportViolation("Accelo1", "Bewegung", betrag); |
|
|
|
|
|
|
|
stringBuffer.append("\nDetectionReport = ").append(detectionReport).append("\nAlarm an"); |
|
|
|
logger.clearLog(); |
|
|
@@ -124,6 +126,7 @@ public class Accelerometer extends Detector implements SensorEventListener { |
|
|
|
@Override |
|
|
|
public void startDetection() { |
|
|
|
// entspricht void start() |
|
|
|
getSensor(); |
|
|
|
if (accelerometer != null) { |
|
|
|
sensorManager.registerListener(this, accelerometer, SensorManager.SENSOR_DELAY_GAME); |
|
|
|
logger.log("Sensor registriert"); |