diff --git a/app/src/main/java/com/example/ueberwachungssystem/Detector.java b/app/src/main/java/com/example/ueberwachungssystem/Detector.java index bc7749b..e6ac3ea 100644 --- a/app/src/main/java/com/example/ueberwachungssystem/Detector.java +++ b/app/src/main/java/com/example/ueberwachungssystem/Detector.java @@ -22,7 +22,7 @@ abstract public class Detector { /** Triggers onDetectionListener - call this to trigger violation/alarm */ - private void reportViolation(String detectorID, String detectionType, float amplitude) { + public void reportViolation(String detectorID, String detectionType, float amplitude) { if (listener != null) { DetectionReport detectionReport = new DetectionReport(detectorID, detectionType, amplitude); listener.onDetection(detectionReport); diff --git a/app/src/main/java/com/example/ueberwachungssystem/MicrophoneDetector.java b/app/src/main/java/com/example/ueberwachungssystem/MicrophoneDetector.java index 8cae886..4a58499 100644 --- a/app/src/main/java/com/example/ueberwachungssystem/MicrophoneDetector.java +++ b/app/src/main/java/com/example/ueberwachungssystem/MicrophoneDetector.java @@ -292,6 +292,7 @@ public class MicrophoneDetector extends Detector { if (progress[0].maxAmp >= Schwellwert_Alarm+kalibierWert && armed == true) { armed = false; detectionReport = new DetectionReport("Mic1", "Audio", maxAmpPrint); + //reportViolation("Mic1", "Audio", maxAmpPrint); logger.log(""); logger.log("Alarm!"); logger.log(detectionReport.toString()); diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index edd41b2..b180d0a 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -11,6 +11,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Log" + app:layout_constraintBottom_toTopOf="@+id/graph" + app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/TglBtn_Mic" />