From 732a604c240cea6c298cc3cfd1104e7661f9dad5 Mon Sep 17 00:00:00 2001 From: Zii Date: Mon, 29 May 2023 20:06:19 -0400 Subject: [PATCH] v3.0.t9 -removed the delay after motion was detected. it was not having the desired effect and after more thought event overlap would be impossible anyway. -the test cameras are still picking up motion during the post command. adjusted the after command delay to see if that helps. -reduced the DetectLoop heartbeat from 3 to 2 to better match the record loop's cadence. --- src/camera.cpp | 12 +++++------- src/common.h | 3 +-- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/camera.cpp b/src/camera.cpp index 16becd8..d7e110a 100644 --- a/src/camera.cpp +++ b/src/camera.cpp @@ -363,10 +363,10 @@ bool EventLoop::wrOutVod(const QString &name, const QStringList &vids) DetectLoop::DetectLoop(shared_t *sharedRes, QThread *thr, QObject *parent) : Loop(sharedRes, thr, parent) { pcTimer = 0; - heartBeat = 3; + heartBeat = 2; delayCycles = 4; // this will be used to delay the // actual start of DetectLoop by - // 12secs. + // 8secs. } void DetectLoop::init() @@ -398,8 +398,8 @@ void DetectLoop::pcBreak() } else { - if (delayCycles == 0) delayCycles = 1; - else delayCycles += 1; + if (delayCycles == 0) delayCycles = 5; + else delayCycles += 5; detLog("no motion detected, running post command: " + shared->postCmd, shared); system(shared->postCmd.toUtf8().data()); @@ -420,7 +420,7 @@ bool DetectLoop::exec() else { auto curDT = QDateTime::currentDateTime(); - auto images = backwardFacingFiles("img", ".bmp", curDT, 5); + auto images = backwardFacingFiles("img", ".bmp", curDT, 6); if (images.size() < 2) { @@ -458,8 +458,6 @@ bool DetectLoop::exec() event.timeStamp = curDT; event.imgPath = images[pos]; - delayCycles = shared->evMaxSecs / heartBeat; - shared->recList.append(event); mod = true; } } diff --git a/src/common.h b/src/common.h index 5674b7e..3eab771 100644 --- a/src/common.h +++ b/src/common.h @@ -28,7 +28,7 @@ using namespace std; -#define APP_VER "3.0.t8" +#define APP_VER "3.0.t9" #define APP_NAME "Motion Watch" #define APP_BIN "mow" #define REC_LOG_NAME "rec_log_lines.html" @@ -50,7 +50,6 @@ struct shared_t QString conf; QString recLog; QString detLog; - QString upkLog; QString recordUrl; QString outDir; QString postCmd;