satdump/plugins/jpss_support/main.cpp

37 lines
1.4 KiB
C++
Raw Permalink Normal View History

#include "core/plugin.h"
2022-02-21 23:32:11 +01:00
#include "logger.h"
2022-03-15 01:01:03 +01:00
#include "jpss/module_jpss_instruments.h"
2022-02-21 23:32:11 +01:00
2023-10-15 12:05:41 +02:00
#include "jpss/instruments/viirs/viirs_proj.h"
2023-10-28 18:56:15 +02:00
#include "jpss/instruments/atms/atms_calibrator.h"
2022-02-21 23:32:11 +01:00
class JPSSSupport : public satdump::Plugin
{
public:
std::string getID() { return "jpss_support"; }
2022-02-21 23:32:11 +01:00
void init()
{
satdump::eventBus->register_handler<satdump::pipeline::RegisterModulesEvent>(registerPluginsHandler);
2025-05-27 18:42:18 +01:00
satdump::eventBus->register_handler<satdump::projection::RequestSatelliteRaytracerEvent>(provideSatProjHandler);
satdump::eventBus->register_handler<satdump::products::RequestImageCalibratorEvent>(provideImageCalibratorHandler);
2022-02-21 23:32:11 +01:00
}
static void registerPluginsHandler(const satdump::pipeline::RegisterModulesEvent &evt) { REGISTER_MODULE_EXTERNAL(evt.modules_registry, jpss::instruments::JPSSInstrumentsDecoderModule); }
2023-10-15 12:05:41 +02:00
2025-05-27 18:42:18 +01:00
static void provideSatProjHandler(const satdump::projection::RequestSatelliteRaytracerEvent &evt)
2023-10-15 12:05:41 +02:00
{
if (evt.id == "viirs_single_line")
evt.r.push_back(std::make_shared<jpss::VIIRSNormalLineSatProj>(evt.cfg));
2023-10-15 12:05:41 +02:00
}
2023-10-28 18:56:15 +02:00
static void provideImageCalibratorHandler(const satdump::products::RequestImageCalibratorEvent &evt)
2023-10-28 18:56:15 +02:00
{
if (evt.id == "jpss_atms")
evt.calibrators.push_back(std::make_shared<jpss::atms::JpssATMSCalibrator>(evt.products, evt.calib));
2023-10-28 18:56:15 +02:00
}
2022-02-21 23:32:11 +01:00
};
PLUGIN_LOADER(JPSSSupport)