diff options
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; + +} |