30#include <boost/program_options.hpp>
31#include <boost/algorithm/string/predicate.hpp>
34#include "ElementsKernel/Main.h"
35#include "ElementsKernel/System.h"
36#include "ElementsKernel/Temporary.h"
38#include "Configuration/ConfigManager.h"
39#include "Configuration/Utils.h"
85namespace po = boost::program_options;
86namespace fs = boost::filesystem;
141 logger.debug() <<
"Disabling multithreading";
145 logger.debug() <<
"Disabling OpenBLAS multithreading";
149 logger.debug() <<
"Disabling dynamic multithreading";
218 "List the possible output properties for the given input parameters and exit");
220 "Show the columns created for each property");
222 "Show the columns created for each property, for the given configuration");
224 "Dump parameters with default values into a configuration file");
228 po::positional_options_description p;
229 p.add(
"python-arg", -1);
235 template <
typename T>
241 template <
typename T>
316 if (
args.find(
"config-file") !=
args.end()) {
394 logger.info() <<
"Writing output following measure order";
397 logger.info() <<
"Writing output following segmentation order";
433 logger.info() <<
"Processing frame "
438 logger.error() <<
"Failed to process the frame! " << e.what();
459 logger.info() <<
"Processing assoc catalog (no detection image)\n";
463 logger.error() <<
"Failed to process the assoc catalog!\n" << e.what();
493 logger.info() <<
"NO SOURCES DETECTED";
515 options.add_options()(
"*", po::value<std::vector<std::string>>());
538 for (
int i = 0;
i <
argc; ++
i) {
540 if (
option ==
"--config-file") {
544 if (boost::starts_with(
option,
"--config-file=")) {
547 if (
option ==
"--plugin-directory") {
551 if (boost::starts_with(
option,
"--plugin-directory=")) {
554 if (
option ==
"--plugin") {
558 if (boost::starts_with(
option,
"--plugin=")) {
571 if (
local_env[
"ELEMENTS_CONF_PATH"].empty()) {
572 local_env[
"ELEMENTS_CONF_PATH"] =
".:/etc";
610 logger.fatal() << e.what();
614 logger.fatal() <<
"Unknown exception type!";
615 logger.fatal() <<
"Please, report this as a bug";
static Logging getLogger(const std::string &name="")
static void onTerminate() noexcept
static ConfigManager & getInstance(long id)
virtual void handleMessage(const std::shared_ptr< SourceGroupInterface > &group) override
std::list< std::shared_ptr< SourceGroupInterface > > m_list
boost::program_options::options_description defineSpecificProgramOptions() override
Elements::ExitCode mainMethod(std::map< std::string, boost::program_options::variable_value > &args) override
std::string & m_plugin_path
virtual ~PluginOptionsMain()=default
PluginOptionsMain(std::string &plugin_path, std::vector< std::string > &plugin_list)
std::vector< std::string > & m_plugin_list
DeblendingFactory deblending_factory
std::shared_ptr< OutputRegistry > output_registry
std::pair< po::options_description, po::positional_options_description > defineProgramArguments() override
Return the arguments that the program accepts.
po::options_description getConfigParameters()
PartitionFactory partition_factory
SegmentationFactory segmentation_factory
void printDefaults()
Print a configuration file populated with defaults.
std::shared_ptr< SourceGroupFactory > group_factory
ProgressReporterFactory progress_printer_factory
GroupingFactory grouping_factory
std::shared_ptr< SourceFactory > source_factory
std::shared_ptr< TaskFactoryRegistry > task_factory_registry
SEMain(const std::string &plugin_path, const std::vector< std::string > &plugin_list)
OutputFactory output_factory
Elements::ExitCode mainMethod(std::map< std::string, po::variable_value > &args) override
static void writeDefaultMultiple(std::ostream &out, const po::option_description &opt, const boost::any &default_value)
Print a multiple-value option.
static void writeDefault(std::ostream &out, const po::option_description &opt, const boost::any &default_value)
Print a simple option.
MeasurementFactory measurement_factory
PluginManager plugin_manager
std::shared_ptr< TaskProvider > task_provider
po::options_description config_parameters
std::list< std::shared_ptr< SourceWithOnDemandProperties > > m_list
virtual void handleMessage(const std::shared_ptr< SourceWithOnDemandProperties > &source) override
#define CREATE_MANAGER_WITH_ARGS(MANAGER, ELEMENTS_PROGRAM,...)
std::underlying_type< ExitCode >::type ExitCodeType
long getUniqueManagerId() noexcept
static Elements::Logging logger
T set_terminate(T... args)