satdump/plugins/jpss_support/main.cpp

44 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"
#include "core/module.h"
2022-02-21 23:32:11 +01:00
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()
{
2022-05-13 21:35:51 +02:00
return "jpss_support";
2022-02-21 23:32:11 +01:00
}
void init()
{
satdump::eventBus->register_handler<RegisterModulesEvent>(registerPluginsHandler);
2023-10-15 12:05:41 +02:00
satdump::eventBus->register_handler<satdump::RequestSatProjEvent>(provideSatProjHandler);
2023-10-28 18:56:15 +02:00
satdump::eventBus->register_handler<satdump::ImageProducts::RequestCalibratorEvent>(provideImageCalibratorHandler);
2022-02-21 23:32:11 +01:00
}
static void registerPluginsHandler(const RegisterModulesEvent &evt)
{
2022-03-15 01:01:03 +01:00
REGISTER_MODULE_EXTERNAL(evt.modules_registry, jpss::instruments::JPSSInstrumentsDecoderModule);
2022-02-21 23:32:11 +01:00
}
2023-10-15 12:05:41 +02:00
static void provideSatProjHandler(const satdump::RequestSatProjEvent &evt)
{
if (evt.id == "viirs_single_line")
evt.projs.push_back(std::make_shared<VIIRSNormalLineSatProj>(evt.cfg, evt.tle, evt.timestamps_raw));
}
2023-10-28 18:56:15 +02:00
static void provideImageCalibratorHandler(const satdump::ImageProducts::RequestCalibratorEvent &evt)
{
if (evt.id == "jpss_atms")
evt.calibrators.push_back(std::make_shared<jpss::atms::JpssATMSCalibrator>(evt.calib, evt.products));
}
2022-02-21 23:32:11 +01:00
};
PLUGIN_LOADER(JPSSSupport)