satdump/plugins/analog_support/main.cpp

40 lines
1.2 KiB
C++
Raw Permalink Normal View History

2022-12-01 15:38:28 +01:00
#include "core/plugin.h"
#include "logger.h"
#include "core/module.h"
#include "noaa_apt/module_noaa_apt_demod.h"
#include "noaa_apt/module_noaa_apt_decoder.h"
2023-11-07 22:04:52 +01:00
#include "noaa_apt/noaa_apt_proj.h"
2022-12-01 15:38:28 +01:00
2024-02-12 22:44:09 +01:00
#include "generic/module_generic_analog_demod.h"
2022-12-01 15:38:28 +01:00
class AnalogSupport : public satdump::Plugin
{
public:
std::string getID()
{
return "analog_support";
}
void init()
{
satdump::eventBus->register_handler<RegisterModulesEvent>(registerPluginsHandler);
2023-11-07 22:04:52 +01:00
satdump::eventBus->register_handler<satdump::RequestSatProjEvent>(provideSatProjHandler);
2022-12-01 15:38:28 +01:00
}
static void registerPluginsHandler(const RegisterModulesEvent &evt)
{
REGISTER_MODULE_EXTERNAL(evt.modules_registry, noaa_apt::NOAAAPTDemodModule);
REGISTER_MODULE_EXTERNAL(evt.modules_registry, noaa_apt::NOAAAPTDecoderModule);
2024-02-12 22:44:09 +01:00
REGISTER_MODULE_EXTERNAL(evt.modules_registry, generic_analog::GenericAnalogDemodModule);
2022-12-01 15:38:28 +01:00
}
2023-11-07 22:04:52 +01:00
static void provideSatProjHandler(const satdump::RequestSatProjEvent &evt)
{
if (evt.id == "noaa_apt_single_line")
evt.projs.push_back(std::make_shared<NOAA_APT_SatProj>(evt.cfg, evt.tle, evt.timestamps_raw));
}
2022-12-01 15:38:28 +01:00
};
PLUGIN_LOADER(AnalogSupport)