diff options
Diffstat (limited to 'src/main_client.cpp')
-rw-r--r-- | src/main_client.cpp | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/main_client.cpp b/src/main_client.cpp index 451bd02..ed7d285 100644 --- a/src/main_client.cpp +++ b/src/main_client.cpp @@ -1,19 +1,38 @@ #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[]){ + initLog(); + std::cout << "Sending UDP packages: " << std::endl; auto configPath = std::string { "config.cfg" }; - std::string address = "10.0.0.10"; + std::string address = "localhost"; + + Detector detector{address, configPath, 1000u}; + + //DetectorModule detModule0 = DetectorModule(1, address, configPath); - DetectorModule detModule0 = DetectorModule(0, address, configPath); + detector.run(); - detModule0.sendPeriodically(5000u); + std::cin.ignore(); return 0; |