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