diff --git a/README.md b/README.md index 41b16ec..7e8ae86 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ The config file is a simple text file that contain parameters that dictate the behavior of the application. Below is an example of a config file with all parameters supported and descriptions of each parameter. ``` -# Motion Watch config file v1.3 +# Motion Watch config file # # note all lines in this config file that starts with a '#' are ignored. # also note to avoid using empty lines. if you're going to need an empty diff --git a/src/common.h b/src/common.h index bc04d95..70568bd 100644 --- a/src/common.h +++ b/src/common.h @@ -33,7 +33,8 @@ using namespace cv; using namespace std; using namespace std::filesystem; -#define BUF_SZ 10 +#define BUF_SZ 10 +#define APP_VER "1.3.t2" struct shared_t { @@ -57,7 +58,6 @@ struct shared_t int blockY; int maxDays; int retCode; - }; string genTmpFile(const string &dirOut, const string &ext, shared_t *share); diff --git a/src/main.cpp b/src/main.cpp index ac341b4..62a9f27 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -26,11 +26,7 @@ void detectLoop(shared_t *share) Rect blockArea; Mat blockImg; - if (share->skipCmd) - { - wrOut(bufFiles[0], share); - } - else if (moDetect(bufFiles[0], &blockArea, &blockImg, share)) + if (moDetect(bufFiles[0], &blockArea, &blockImg, share)) { if (objectInImage(blockImg, blockArea)) { @@ -59,6 +55,8 @@ void recLoop(shared_t *share) { while (rdConf(share)) { + createDirTree(share->buffDir); + auto bufPath = cleanDir(share->buffDir) + "/%03d." + share->vidExt; auto secs = to_string(share->secs); auto limSecs = to_string(share->secs + 3); @@ -87,10 +85,15 @@ int main(int argc, char** argv) if (parseForParam("-h", argc, argv, true) == "true") { - cout << "Motion Watch v1.3" << endl << endl; + cout << "Motion Watch " << APP_VER << endl << endl; cout << "Usage: mow " << endl << endl; cout << "-h : display usage information about this application." << endl; cout << "-c : path to the config file." << endl; + cout << "-v : display the current version." << endl; + } + if (parseForParam("-v", argc, argv, true) == "true") + { + cout << APP_VER << endl; } else if (sharedRes.conf.empty()) {