diff --git a/config/alprd.conf b/config/alprd.conf index bdcadf4..df6d7dd 100644 --- a/config/alprd.conf +++ b/config/alprd.conf @@ -13,5 +13,6 @@ store_plates = 0 store_plates_location = /var/www/html/plates/ ; upload address is the destination to POST to +upload_data = 0 upload_address = http://localhost:9000/alpr/push/ diff --git a/src/daemon.cpp b/src/daemon.cpp index 6bc1ba6..36cb4a7 100644 --- a/src/daemon.cpp +++ b/src/daemon.cpp @@ -161,6 +161,7 @@ int main( int argc, const char** argv ) bool storePlates = ini.GetBoolValue("daemon", "store_plates", false); std::string imageFolder = ini.GetValue("daemon", "store_plates_location", "/tmp/"); + bool uploadData = ini.GetBoolValue("daemon", "upload_data", false); std::string upload_url = ini.GetValue("daemon", "upload_address", ""); std::string site_id = ini.GetValue("daemon", "site_id", ""); @@ -186,10 +187,13 @@ int main( int argc, const char** argv ) tthread::thread* thread_recognize = new tthread::thread(streamRecognitionThread, (void*) tdata); - // Kick off the data upload thread - UploadThreadData* udata = new UploadThreadData(); - udata->upload_url = upload_url; - tthread::thread* thread_upload = new tthread::thread(dataUploadThread, (void*) udata ); + if (uploadData) + { + // Kick off the data upload thread + UploadThreadData* udata = new UploadThreadData(); + udata->upload_url = upload_url; + tthread::thread* thread_upload = new tthread::thread(dataUploadThread, (void*) udata ); + } break; }