From d04d166e144d43b0f7a66ee025dae55496fd864c Mon Sep 17 00:00:00 2001 From: Bastian Kohler Date: Thu, 18 May 2023 12:01:45 +0200 Subject: [PATCH] Added log function to detection report --- .../VideoDetection/DetectionReport.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/example/ueberwachungssystem/VideoDetection/DetectionReport.java b/app/src/main/java/com/example/ueberwachungssystem/VideoDetection/DetectionReport.java index f4fef73..c73d91e 100644 --- a/app/src/main/java/com/example/ueberwachungssystem/VideoDetection/DetectionReport.java +++ b/app/src/main/java/com/example/ueberwachungssystem/VideoDetection/DetectionReport.java @@ -1,19 +1,31 @@ package com.example.ueberwachungssystem.VideoDetection; +import android.util.Log; + import java.util.Calendar; /** Detection Report Class */ - public class DetectionReport { public String timeStamp; public String detectionType; - public float detectedAmplitude; + public float detectedValue; public String detectorID; public DetectionReport(String detectorID, String detectionType, float detectedAmplitude) { this.timeStamp = String.valueOf(Calendar.getInstance().getTime()); this.detectionType = detectionType; - this.detectedAmplitude = detectedAmplitude; + this.detectedValue = detectedAmplitude; this.detectorID = detectorID; } + + /** Debug Report */ + public void log(String tag) { + String time = "Time: [" + this.timeStamp + "]"; + String type = "Type: [" + this.detectionType + "]"; + String value = "Value: [" + this.detectedValue + "]"; + String id = "ID: [" + this.detectorID + "]"; + + String message = String.join("\t", time, type, value, id); + Log.d(tag, message); + } } \ No newline at end of file