bk_video #4

Manually merged
kohlerba68671 merged 30 commits from bk_video into master 2023-06-02 15:51:57 +00:00
Showing only changes of commit fdb0036ea6 - Show all commits

View File

@ -1,14 +1,17 @@
package com.example.ueberwachungssystem;
import android.content.Context;
import androidx.annotation.NonNull;
abstract public class Detector {
private OnDetectionListener listener;
/** Constructor - takes context of current activity */
public Detector(Context context) {};
/** On Detection Listener - runs when violation is reported */
public interface OnDetectionListener {
void onDetection(@NonNull DetectionReport detectionReport);
}
@ -16,6 +19,8 @@ abstract public class Detector {
this.listener = listener;
}
/** Triggers onDetectionListener - call this to trigger violation/alarm */
private void reportViolation(String detectorID, String detectionType, float amplitude) {
if (listener != null) {
DetectionReport detectionReport = new DetectionReport(detectorID, detectionType, amplitude);
@ -25,6 +30,10 @@ abstract public class Detector {
}
}
/** Starts Detection (abstract method: needs to be overridden in child class) */
public abstract void startDetection();
/** Stops Detection (abstract method: needs to be overridden in child class) */
public abstract void stopDetection();
}