satdump/src-core/init.cpp

59 lines
1.6 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"
2021-05-04 12:23:22 +02:00
#ifndef RESOURCES_PATH
#define RESOURCES_PATH "./"
#endif
2021-03-22 18:53:09 +01:00
2021-08-02 23:33:10 +02:00
#ifndef SATDUMP_VERSION
#define SATDUMP_VERSION "0.0.0-dev"
#endif
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("");
registerModules();
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
2021-05-05 15:52:12 +02:00
//if (std::filesystem::exists("settings.json"))
// loadSettings("settings.json");
//else
// loadSettings((std::string)RESOURCES_PATH + "settings.json");
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
tle::loadTLEs();
}
// 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