1234567891011121314151617181920212223242526272829303132333435363738 |
- package com.example.ueberwachungssystem.Detection;
-
- import android.util.Log;
-
- import java.util.Calendar;
-
- /** Detection Report Class */
- public class DetectionReport {
- public String timeStamp;
- public String detectionType;
- public float detectedValue;
- public boolean detectionState;
-
- public DetectionReport(boolean detectionState, String detectionType, float detectedAmplitude) {
- this.timeStamp = String.valueOf(Calendar.getInstance().getTime());
- this.detectionType = detectionType;
- this.detectedValue = detectedAmplitude;
- this.detectionState = detectionState;
-
- //this.detectorID = detectorID;
- }
-
-
- /** Get Detection Report in String format */
- public String toString() {
- String state = "State: " + "[" + this.detectionState + "]";
- String time = "Time: " + "[" + this.timeStamp + "]";
- String type = "Type: " + "[" + this.detectionType + "]";
- String value = "Value: " + "[" + this.detectedValue + "]";
-
- return String.join("\t", state, time, type, value);
- }
-
- /** Debug Report */
- public void log(String tag) {
- Log.d(tag, this.toString());
- }
- }
|