diff options
author | Tobias Frust <tobiasfrust@gmail.com> | 2016-07-11 15:13:55 +0200 |
---|---|---|
committer | Tobias Frust <tobiasfrust@gmail.com> | 2016-07-11 15:13:55 +0200 |
commit | 409e2fd20af5620066796e43410a92521376b2c1 (patch) | |
tree | bd2cb6e80b0db90713f9d24de09577125d6f3d85 /src | |
parent | d71e5fe7330fa51cdce466ec0df876eb9b8e721e (diff) | |
download | ods-409e2fd20af5620066796e43410a92521376b2c1.tar.gz ods-409e2fd20af5620066796e43410a92521376b2c1.tar.bz2 ods-409e2fd20af5620066796e43410a92521376b2c1.tar.xz ods-409e2fd20af5620066796e43410a92521376b2c1.zip |
the number of images per second is now configurable via terminal input
Diffstat (limited to 'src')
-rw-r--r-- | src/main_client.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
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 <images_per_second>!"; + 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); |