diff --git a/src/camera.cpp b/src/camera.cpp index 18e157e..da6b7d0 100644 --- a/src/camera.cpp +++ b/src/camera.cpp @@ -103,6 +103,8 @@ int Camera::start(const QString &conf) connect(thr2, &QThread::finished, this, &Camera::objMinusOne); connect(thr3, &QThread::finished, this, &Camera::objMinusOne); + connect(detLoop, &DetectLoop::starving, recLoop, &RecordLoop::restart); + thr1->start(); thr2->start(); thr3->start(); diff --git a/src/common.h b/src/common.h index b3323db..f13aba4 100644 --- a/src/common.h +++ b/src/common.h @@ -32,7 +32,7 @@ using namespace std; -#define APP_VERSION "3.5.t2" +#define APP_VERSION "3.5.t3" #define APP_NAME "JustMotion" #define APP_TARGET "jmotion" #define DATETIME_FMT "yyyyMMddhhmmss" diff --git a/src/detect_loop.cpp b/src/detect_loop.cpp index 89f349c..b92db0d 100644 --- a/src/detect_loop.cpp +++ b/src/detect_loop.cpp @@ -163,6 +163,8 @@ QString DetectLoop::statusLine() { if (eTimer.elapsed() >= 5000) { + emit starving(); + return "STARVED"; } else diff --git a/src/detect_loop.h b/src/detect_loop.h index c44d966..ebd2c5c 100644 --- a/src/detect_loop.h +++ b/src/detect_loop.h @@ -48,6 +48,10 @@ public: void exec(); QString statusLine(); + +signals: + + void starving(); }; #endif // DETECT_LOOP_H diff --git a/src/record_loop.h b/src/record_loop.h index 29e6633..494a779 100644 --- a/src/record_loop.h +++ b/src/record_loop.h @@ -23,7 +23,6 @@ private slots: void init(); void resetTime(); - void restart(); private: @@ -32,6 +31,10 @@ private: QString camCmdFromConf(); +public slots: + + void restart(); + public: explicit RecordLoop(shared_t *shared, QThread *thr, QObject *parent = nullptr);