satdump/plugins/fengyun2_support/main.cpp

30 lines
1.1 KiB
C++
Raw Permalink Normal View History

#include "core/plugin.h"
2022-02-21 23:32:11 +01:00
#include "fengyun2/svissr/module_svissr_decoder.h"
#include "fengyun2/svissr/module_svissr_image_decoder.h"
2025-09-14 16:21:22 +02:00
#include "fengyun2/svissr/svissr_calibrator.h"
2022-02-21 23:32:11 +01:00
class FengYun2Support : public satdump::Plugin
{
public:
2025-05-05 19:44:46 +02:00
std::string getID() { return "fengyun2_support"; }
2022-02-21 23:32:11 +01:00
2025-09-14 16:21:22 +02:00
void init() { satdump::eventBus->register_handler<satdump::pipeline::RegisterModulesEvent>(registerPluginsHandler);
satdump::eventBus->register_handler<satdump::products::RequestImageCalibratorEvent>(provideImageCalibratorHandler);
}
2022-02-21 23:32:11 +01:00
static void registerPluginsHandler(const satdump::pipeline::RegisterModulesEvent &evt)
2022-02-21 23:32:11 +01:00
{
REGISTER_MODULE_EXTERNAL(evt.modules_registry, fengyun_svissr::SVISSRDecoderModule);
REGISTER_MODULE_EXTERNAL(evt.modules_registry, fengyun_svissr::SVISSRImageDecoderModule);
}
2025-09-14 16:21:22 +02:00
static void provideImageCalibratorHandler(const satdump::products::RequestImageCalibratorEvent &evt)
{
if (evt.id == "fy2_svissr")
evt.calibrators.push_back(std::make_shared<fengyun_svissr::SvissrCalibrator>(evt.products, evt.calib));
}
2022-02-21 23:32:11 +01:00
};
PLUGIN_LOADER(FengYun2Support)