1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
#include "core/plugin.h"
#include "logger.h"
#include "core/module.h"
#include "jpss/module_jpss_instruments.h"
#include "jpss/instruments/viirs/viirs_proj.h"
#include "jpss/instruments/atms/atms_calibrator.h"
class JPSSSupport : public satdump::Plugin
{
public:
std::string getID()
{
return "jpss_support";
}
void init()
{
satdump::eventBus->register_handler<RegisterModulesEvent>(registerPluginsHandler);
satdump::eventBus->register_handler<satdump::RequestSatProjEvent>(provideSatProjHandler);
satdump::eventBus->register_handler<satdump::ImageProducts::RequestCalibratorEvent>(provideImageCalibratorHandler);
}
static void registerPluginsHandler(const RegisterModulesEvent &evt)
{
REGISTER_MODULE_EXTERNAL(evt.modules_registry, jpss::instruments::JPSSInstrumentsDecoderModule);
}
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));
}
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));
}
};
PLUGIN_LOADER(JPSSSupport)
|