From 409e2fd20af5620066796e43410a92521376b2c1 Mon Sep 17 00:00:00 2001 From: Tobias Frust Date: Mon, 11 Jul 2016 15:13:55 +0200 Subject: the number of images per second is now configurable via terminal input --- src/main_client.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main_client.cpp b/src/main_client.cpp index b88341a..2b9927d 100644 --- a/src/main_client.cpp +++ b/src/main_client.cpp @@ -19,6 +19,16 @@ void initLog() { int main (int argc, char *argv[]){ + if(argc < 2){ + BOOST_LOG_TRIVIAL(error) << "Program usage: ./onlineDetectorSimulatorClient !"; + return 0; + } + + int imagesPerSec = std::stoi(argv[1]); + + double timegap = 1./(double)imagesPerSec; + unsigned int intervall = timegap*1000*1000; + initLog(); std::cout << "Sending UDP packages: " << std::endl; @@ -26,7 +36,7 @@ int main (int argc, char *argv[]){ auto configPath = std::string { "config.cfg" }; std::string address = "127.0.0.1"; - Detector detector{address, configPath, 1000000u}; + Detector detector{address, configPath, intervall}; //DetectorModule detModule0 = DetectorModule(1, address, configPath); -- cgit v1.2.3