satdump/src-core/init.cpp

58 lines
1.5 KiB
C++
Raw Normal View History

2021-03-22 18:53:09 +01:00
#include "init.h"
#include "logger.h"
#include "module.h"
#include "pipeline.h"
2021-05-04 12:23:22 +02:00
#include <filesystem>
2021-05-05 15:52:12 +02:00
#include "settings.h"
2021-06-03 12:23:30 +02:00
#include "tle.h"
#include "plugin.h"
#include "satdump_vars.h"
2021-08-02 23:33:10 +02:00
2021-03-22 18:53:09 +01:00
void initSatdump()
{
logger->info(" _____ __ ____ ");
logger->info(" / ___/____ _/ /_/ __ \\__ ______ ___ ____ ");
logger->info(" \\__ \\/ __ `/ __/ / / / / / / __ `__ \\/ __ \\");
logger->info(" ___/ / /_/ / /_/ /_/ / /_/ / / / / / / /_/ /");
logger->info("/____/\\__,_/\\__/_____/\\__,_/_/ /_/ /_/ .___/ ");
logger->info(" /_/ ");
2021-08-02 23:33:10 +02:00
logger->info("Starting SatDump v" + (std::string)SATDUMP_VERSION);
2021-03-22 18:53:09 +01:00
logger->info("");
loadConfig();
loadPlugins();
2021-03-22 18:53:09 +01:00
registerModules();
// Load pipelines
2021-05-04 12:34:42 +02:00
if (std::filesystem::exists("pipelines") && std::filesystem::is_directory("pipelines"))
2021-05-04 12:23:22 +02:00
loadPipelines("pipelines");
else
loadPipelines((std::string)RESOURCES_PATH + "pipelines");
2021-03-22 18:53:09 +01:00
// List them
2021-03-22 18:53:09 +01:00
logger->debug("Registered pipelines :");
for (Pipeline &pipeline : pipelines)
logger->debug(" - " + pipeline.name);
2021-06-03 12:23:30 +02:00
// TLEs
2021-06-03 12:23:30 +02:00
tle::loadTLEs();
// Let plugins know we started
satdump::eventBus->fire_event<satdump::SatDumpStartedEvent>({});
}
// This is a pretty crappy way of doing it,
// but it avoids a few libraries complaining
// when linking in the Android NDK
#ifdef __ANDROID__
#include <stdio.h>
extern "C"
{
#undef stderr
FILE *stderr = NULL;
2021-06-15 23:24:38 +02:00
#undef stdout
FILE *stdout = NULL;
}
#endif