2022-03-05 12:44:19 +01:00
|
|
|
#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:
|
2025-05-31 20:26:47 +02:00
|
|
|
std::string getID() { return "jpss_support"; }
|
2022-02-21 23:32:11 +01:00
|
|
|
|
|
|
|
|
void init()
|
|
|
|
|
{
|
2025-05-31 20:26:47 +02:00
|
|
|
satdump::eventBus->register_handler<satdump::pipeline::RegisterModulesEvent>(registerPluginsHandler);
|
2025-05-27 18:42:18 +01:00
|
|
|
satdump::eventBus->register_handler<satdump::projection::RequestSatelliteRaytracerEvent>(provideSatProjHandler);
|
2025-01-09 20:34:51 +01:00
|
|
|
satdump::eventBus->register_handler<satdump::products::RequestImageCalibratorEvent>(provideImageCalibratorHandler);
|
2022-02-21 23:32:11 +01:00
|
|
|
}
|
|
|
|
|
|
2025-05-31 20:26:47 +02: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")
|
2025-01-09 20:34:51 +01:00
|
|
|
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
|
|
|
|
2025-01-09 20:34:51 +01:00
|
|
|
static void provideImageCalibratorHandler(const satdump::products::RequestImageCalibratorEvent &evt)
|
2023-10-28 18:56:15 +02:00
|
|
|
{
|
|
|
|
|
if (evt.id == "jpss_atms")
|
2025-01-09 20:34:51 +01:00
|
|
|
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)
|