//Entry point of application, crates central controller class and initializes the publishers #include #include #include #include "SystemControler.h" #include "SystemConfig.h" #include #include "PublisherBenderRcm.h" #include "PublisherPowercenter.h" INITIALIZE_EASYLOGGINGPP using namespace std; typedef std::unique_ptr unique_publisher_ptr; typedef unsigned int u_int; int main() { //Load global System configuration for parameters SystemConfig configuration; configuration.readStandardConfig(); //Load config file and apply on all loggers std::filesystem::create_directory("log"); el::Configurations conf("log/logger_config.conf"); el::Loggers::reconfigureAllLoggers(conf); LOG(INFO) << "Started execution"; //Create the System Controller SystemControler controler; //register publisher at controler auto poc = std::make_unique(); auto bender = std::make_unique(); //controler.registerPublisher(std::move(poc)); controler.registerPublisher(std::move(bender)); //Opens port for tcp/ip client connection controler.startIpTcpServer(); //Modbus Worker Thread, processes the modbus register queue controler.startModbusWorkerThread(); //Frequently enqueing of modbus register controler.startEnqueuingRegister(); //Test environment on main thread while(true) { char key = cin.get(); switch (key) { case 'l': controler.deleteFiles(std::chrono::seconds(0)); break; case 'c': controler.cancelReadingModbusAlerts(); break; case 'e': controler.evaluate(); break; case 'q': return 0; case 'p': std::cout << configuration << std::endl; break; case 'f': controler.flushAfterNData(); break; default: break; } } LOG(INFO) << "End of execution\n"; return 0; }