diff options
author | Tobias Frust <tobiasfrust@gmail.com> | 2016-07-11 15:15:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-11 15:15:32 +0200 |
commit | 8af3d595e2856f81a46a91d67e96f53cb3b25d0f (patch) | |
tree | bd2cb6e80b0db90713f9d24de09577125d6f3d85 /src/main_client.cpp | |
parent | 13783f932576a285b08cf518a6b0d679aac3c897 (diff) | |
parent | 409e2fd20af5620066796e43410a92521376b2c1 (diff) | |
download | ods-8af3d595e2856f81a46a91d67e96f53cb3b25d0f.tar.gz ods-8af3d595e2856f81a46a91d67e96f53cb3b25d0f.tar.bz2 ods-8af3d595e2856f81a46a91d67e96f53cb3b25d0f.tar.xz ods-8af3d595e2856f81a46a91d67e96f53cb3b25d0f.zip |
Merge pull request #1 from tobiasfrust/master
Implemented DetectorSimulator with basic functionalities
Diffstat (limited to 'src/main_client.cpp')
-rw-r--r-- | src/main_client.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/main_client.cpp b/src/main_client.cpp new file mode 100644 index 0000000..2b9927d --- /dev/null +++ b/src/main_client.cpp @@ -0,0 +1,49 @@ +#include "UDPClient/UDPClient.h" +#include "DetectorModule/DetectorModule.h" +#include "Detector/Detector.h" + +#include <boost/log/core.hpp> +#include <boost/log/trivial.hpp> +#include <boost/log/expressions.hpp> + +#include <iostream> +#include <string> + +void initLog() { +#ifndef NDEBUG + boost::log::core::get()->set_filter(boost::log::trivial::severity >= boost::log::trivial::debug); +#else + boost::log::core::get()->set_filter(boost::log::trivial::severity >= boost::log::trivial::info); +#endif +} + +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; + + auto configPath = std::string { "config.cfg" }; + std::string address = "127.0.0.1"; + + Detector detector{address, configPath, intervall}; + + //DetectorModule detModule0 = DetectorModule(1, address, configPath); + + detector.run(); + + std::cin.ignore(); + + return 0; + +} |