From 00127cbeb288df20893b192728e504e06cab1028 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Sun, 26 Oct 2014 20:47:05 -0400 Subject: [PATCH] Moved alprd "Country" from a command line argument to daemon config file --- config/alprd.conf | 3 +++ src/daemon.cpp | 5 +---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/alprd.conf b/config/alprd.conf index df6d7dd..4a7e952 100644 --- a/config/alprd.conf +++ b/config/alprd.conf @@ -1,6 +1,9 @@ [daemon] + +country = us + ; Declare each stream on a separate line ; each unique stream should be defined as stream = [url] diff --git a/src/daemon.cpp b/src/daemon.cpp index eccb4fe..33cd527 100644 --- a/src/daemon.cpp +++ b/src/daemon.cpp @@ -84,11 +84,9 @@ int main( int argc, const char** argv ) int topn; std::string configFile; - std::string country; TCLAP::CmdLine cmd("OpenAlpr Daemon", ' ', Alpr::getVersion()); - TCLAP::ValueArg countryCodeArg("c","country","Country code to identify (either us for USA or eu for Europe). Default=us",false, "us" ,"country_code"); TCLAP::ValueArg configFileArg("","config","Path to the openalpr.conf file.",false, "" ,"config_file"); TCLAP::ValueArg topNArg("n","topn","Max number of possible plate numbers to return. Default=25",false, 25 ,"topN"); TCLAP::ValueArg logFileArg("l","log","Log file to write to. Default=" + DEFAULT_LOG_FILE_PATH,false, DEFAULT_LOG_FILE_PATH ,"topN"); @@ -99,7 +97,6 @@ int main( int argc, const char** argv ) try { - cmd.add( countryCodeArg ); cmd.add( topNArg ); cmd.add( configFileArg ); cmd.add( logFileArg ); @@ -111,7 +108,6 @@ int main( int argc, const char** argv ) return 1; } - country = countryCodeArg.getValue(); configFile = configFileArg.getValue(); logFile = logFileArg.getValue(); topn = topNArg.getValue(); @@ -180,6 +176,7 @@ int main( int argc, const char** argv ) return 1; } + std::string country = ini.GetValue("daemon", "country", "us"); 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);