2022-03-05 12:44:19 +01:00
|
|
|
#define SATDUMP_DLL_EXPORT 1
|
|
|
|
|
#include "core/module.h"
|
|
|
|
|
#include "logger.h"
|
|
|
|
|
#include "plugin.h"
|
|
|
|
|
|
|
|
|
|
SATDUMP_DLL float ui_scale = 1; // UI Scaling factor, set to 1 (no scaling) by default
|
|
|
|
|
SATDUMP_DLL int demod_constellation_size = 200; // Demodulator constellation size
|
|
|
|
|
|
|
|
|
|
ProcessingModule::ProcessingModule(std::string input_file, std::string output_file_hint, nlohmann::json parameters) : d_input_file(input_file),
|
|
|
|
|
d_output_file_hint(output_file_hint),
|
|
|
|
|
d_parameters(parameters)
|
|
|
|
|
{
|
|
|
|
|
input_active = false;
|
|
|
|
|
streamingInput = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::vector<std::string> ProcessingModule::getOutputs()
|
|
|
|
|
{
|
|
|
|
|
return d_output_files;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ProcessingModule::setInputType(ModuleDataType type)
|
|
|
|
|
{
|
|
|
|
|
input_data_type = type;
|
|
|
|
|
|
|
|
|
|
if (type != DATA_FILE)
|
|
|
|
|
streamingInput = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ProcessingModule::setOutputType(ModuleDataType type)
|
|
|
|
|
{
|
|
|
|
|
output_data_type = type;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ModuleDataType ProcessingModule::getInputType()
|
|
|
|
|
{
|
|
|
|
|
return input_data_type;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ModuleDataType ProcessingModule::getOutputType()
|
|
|
|
|
{
|
|
|
|
|
return output_data_type;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ProcessingModule::init()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ProcessingModule::stop()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ProcessingModule::drawUI(bool /*window*/)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Registry
|
|
|
|
|
SATDUMP_DLL std::map<std::string, std::function<std::shared_ptr<ProcessingModule>(std::string, std::string, nlohmann::json)>> modules_registry;
|
|
|
|
|
|
2022-03-15 16:42:15 +01:00
|
|
|
#include "modules/demod/module_fsk_demod.h"
|
|
|
|
|
#include "modules/demod/module_pm_demod.h"
|
2022-03-25 19:33:31 +01:00
|
|
|
#include "modules/demod/module_psk_demod.h"
|
2023-02-01 13:40:36 +01:00
|
|
|
#include "modules/demod/module_sdpsk_demod.h"
|
2022-03-05 12:44:19 +01:00
|
|
|
|
2022-07-04 15:06:13 +02:00
|
|
|
#include "modules/network/module_network_server.h"
|
2022-07-04 16:33:09 +02:00
|
|
|
#include "modules/network/module_network_client.h"
|
2022-07-04 15:06:13 +02:00
|
|
|
|
2022-03-05 12:44:19 +01:00
|
|
|
#include "modules/xrit/module_goesrecv_publisher.h"
|
2022-04-30 23:24:22 +02:00
|
|
|
#include "modules/xrit/module_s2udp_xrit_cadu_extractor.h"
|
2022-03-05 12:44:19 +01:00
|
|
|
|
2023-05-04 21:27:47 +02:00
|
|
|
#include "modules/ccsds/module_ccsds_conv_concat_decoder.h"
|
2022-03-05 12:44:19 +01:00
|
|
|
#include "modules/ccsds/module_ccsds_simple_psk_decoder.h"
|
2022-12-22 13:08:09 +01:00
|
|
|
#include "modules/ccsds/module_ccsds_ldpc_decoder.h"
|
2023-05-27 13:12:23 +02:00
|
|
|
#include "modules/ccsds/module_ccsds_turbo_decoder.h"
|
2022-03-05 12:44:19 +01:00
|
|
|
|
2022-05-18 14:54:41 +02:00
|
|
|
#include "modules/products/module_products_processor.h"
|
|
|
|
|
|
2022-03-11 09:22:20 +01:00
|
|
|
void registerModules()
|
2022-03-05 12:44:19 +01:00
|
|
|
{
|
|
|
|
|
// Register modules
|
|
|
|
|
|
|
|
|
|
// Demods
|
2022-03-30 10:06:26 +02:00
|
|
|
REGISTER_MODULE(demod::FSKDemodModule);
|
2022-03-25 19:33:31 +01:00
|
|
|
REGISTER_MODULE(demod::PMDemodModule);
|
|
|
|
|
REGISTER_MODULE(demod::PSKDemodModule);
|
2023-02-01 13:40:36 +01:00
|
|
|
REGISTER_MODULE(demod::SDPSKDemodModule);
|
2022-03-28 11:51:13 +02:00
|
|
|
|
2022-07-04 15:06:13 +02:00
|
|
|
// Network
|
|
|
|
|
REGISTER_MODULE(network::NetworkServerModule);
|
2022-07-04 16:33:09 +02:00
|
|
|
REGISTER_MODULE(network::NetworkClientModule);
|
2022-07-04 15:06:13 +02:00
|
|
|
|
2022-03-05 12:44:19 +01:00
|
|
|
// xRIT
|
|
|
|
|
REGISTER_MODULE(xrit::GOESRecvPublisherModule);
|
2022-04-30 23:24:22 +02:00
|
|
|
REGISTER_MODULE(xrit::S2UDPxRITCADUextractor);
|
2022-03-05 12:44:19 +01:00
|
|
|
|
|
|
|
|
// CCSDS
|
2023-05-04 21:27:47 +02:00
|
|
|
REGISTER_MODULE(ccsds::CCSDSConvConcatDecoderModule);
|
2022-03-05 12:44:19 +01:00
|
|
|
REGISTER_MODULE(ccsds::CCSDSSimplePSKDecoderModule);
|
2022-12-22 13:08:09 +01:00
|
|
|
REGISTER_MODULE(ccsds::CCSDSLDPCDecoderModule);
|
2023-05-27 13:12:23 +02:00
|
|
|
REGISTER_MODULE(ccsds::CCSDSTurboDecoderModule);
|
2022-03-05 12:44:19 +01:00
|
|
|
|
2022-05-18 14:54:41 +02:00
|
|
|
// Products Processor. This one is a bit different!
|
|
|
|
|
REGISTER_MODULE(products::ProductsProcessorModule);
|
|
|
|
|
|
2022-03-05 12:44:19 +01:00
|
|
|
// Plugin modules
|
|
|
|
|
satdump::eventBus->fire_event<RegisterModulesEvent>({modules_registry});
|
|
|
|
|
|
|
|
|
|
// Log them out
|
|
|
|
|
logger->debug("Registered modules (" + std::to_string(modules_registry.size()) + ") : ");
|
|
|
|
|
for (std::pair<const std::string, std::function<std::shared_ptr<ProcessingModule>(std::string, std::string, nlohmann::json)>> &it : modules_registry)
|
|
|
|
|
logger->debug(" - " + it.first);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void drawStatus(instrument_status_t status)
|
|
|
|
|
{
|
|
|
|
|
if (status == DECODING)
|
|
|
|
|
ImGui::TextColored(ImColor(255, 255, 0), "Decoding...");
|
|
|
|
|
else if (status == PROCESSING)
|
|
|
|
|
ImGui::TextColored(ImColor(200, 0, 255), "Processing...");
|
|
|
|
|
else if (status == SAVING)
|
|
|
|
|
ImGui::TextColored(ImColor(100, 255, 100), "Saving...");
|
|
|
|
|
else if (status == DONE)
|
|
|
|
|
ImGui::TextColored(ImColor(0, 255, 0), "Done");
|
|
|
|
|
else
|
|
|
|
|
ImGui::TextColored(ImColor(255, 0, 0), "Invalid!");
|
|
|
|
|
};
|