55 lines
1.2 KiB
C++
Executable File
55 lines
1.2 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* main (RecordingManagement)
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
|
|
#include <nglapplication/nglcoreapplication.h>
|
|
#include <LtsCommandLineParser/LtsCommandLineParser.h>
|
|
|
|
#include "main_handler.h"
|
|
#include "logger.h"
|
|
#include "settings.h"
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
NGLCoreApplication app(argc, argv);
|
|
|
|
LtsCommandLineParser::LtsCommandLineParser options;
|
|
if (!options.init())
|
|
return -1;
|
|
app.createLogger("REC", options.exerciseId());
|
|
|
|
if (options.exerciseId() <= 0)
|
|
{
|
|
options.showHelp();
|
|
ERROR_LOG(app.baseLogger()) << "No RecordingManagement for exercise <= 0. Use a valid exerciseId.";
|
|
return -2;
|
|
}
|
|
RecordingManagement::Settings::setIniFile(options.iniFile());
|
|
|
|
DEBUG_LOG(app.baseLogger()) << "DomainId: #" << options.domainId() << ", exerciseId: #" << options.exerciseId();
|
|
|
|
int iRet = -3;
|
|
{
|
|
std::unique_ptr<RecordingManagement::MainHandler> initRecMgmt(new RecordingManagement::MainHandler());
|
|
|
|
if (!initRecMgmt->init(options.domainId(), options.exerciseId()))
|
|
return iRet;
|
|
|
|
STARTUP_LOG(app.baseLogger());
|
|
|
|
iRet = app.exec();
|
|
|
|
SHUTDOWN_LOG(app.baseLogger());
|
|
}
|
|
|
|
return iRet;
|
|
}
|
|
|
|
|
|
|