diff --git a/app/src/main/java/com/example/ueberwachungssystem/Detection/DetectionReport.java b/app/src/main/java/com/example/ueberwachungssystem/Detection/DetectionReport.java index 2dc8cba..653e57b 100644 --- a/app/src/main/java/com/example/ueberwachungssystem/Detection/DetectionReport.java +++ b/app/src/main/java/com/example/ueberwachungssystem/Detection/DetectionReport.java @@ -9,13 +9,16 @@ public class DetectionReport { public String timeStamp; public String detectionType; public float detectedValue; - public String detectorID; + public boolean detectionState; + //public String detectorID; - public DetectionReport(String detectorID, String detectionType, float detectedAmplitude) { + public DetectionReport(boolean detectionState, String detectionType, float detectedAmplitude) { this.timeStamp = String.valueOf(Calendar.getInstance().getTime()); this.detectionType = detectionType; this.detectedValue = detectedAmplitude; - this.detectorID = detectorID; + this.detectionState = detectionState; + + //this.detectorID = detectorID; } @@ -24,9 +27,9 @@ public class DetectionReport { String time = "Time: " + "[" + this.timeStamp + "]"; String type = "Type: " + "[" + this.detectionType + "]"; String value = "Value: " + "[" + this.detectedValue + "]"; - String id = "ID: " + "[" + this.detectorID + "]"; + //String id = "ID: " + "[" + this.detectorID + "]"; - return String.join("\t", time, type, value, id); + return String.join("\t", time, type, value); } /** Debug Report */ diff --git a/app/src/main/java/com/example/ueberwachungssystem/Detection/Detector.java b/app/src/main/java/com/example/ueberwachungssystem/Detection/Detector.java index 0b726a7..38f55f0 100644 --- a/app/src/main/java/com/example/ueberwachungssystem/Detection/Detector.java +++ b/app/src/main/java/com/example/ueberwachungssystem/Detection/Detector.java @@ -20,16 +20,15 @@ abstract public class Detector { /** Triggers onDetectionListener - call this to trigger violation/alarm */ - public void reportViolation(String detectorID, String detectionType, float amplitude) { + public void reportViolation(String detectionType, float amplitude) { if (listener != null) { - DetectionReport detectionReport = new DetectionReport(detectorID, detectionType, amplitude); + DetectionReport detectionReport = new DetectionReport(true, detectionType, amplitude); listener.onDetection(detectionReport); } else { throw new IllegalStateException("No listener set for violation reporting"); } } - /** Starts Detection (abstract method: needs to be overridden in child class) */ public abstract void startDetection(); diff --git a/app/src/main/java/com/example/ueberwachungssystem/Detection/VideoDetector.java b/app/src/main/java/com/example/ueberwachungssystem/Detection/VideoDetector.java index 6362e9d..72a548c 100644 --- a/app/src/main/java/com/example/ueberwachungssystem/Detection/VideoDetector.java +++ b/app/src/main/java/com/example/ueberwachungssystem/Detection/VideoDetector.java @@ -66,7 +66,6 @@ public class VideoDetector extends Detector { private int frameCnt = 0; - // Parameters private static final float PIXEL_THRESHOLD = 30f; // Luminosity (brightness channel of YUV_420_888) private static final int BLUR_KERNEL_SIZE = 5;