2025-01-31 10:34:47 +01:00
|
|
|
#include "flowgraph_processor.h"
|
|
|
|
|
#include "logger.h"
|
|
|
|
|
|
|
|
|
|
// TODOREWORK
|
|
|
|
|
#include "flowgraph/datasetproc_node.h"
|
|
|
|
|
#include "flowgraph/image_nodes.h"
|
|
|
|
|
#include "flowgraph/imageproduct_node.h"
|
2025-05-04 12:48:02 +02:00
|
|
|
#include "imgui/imnodes/imnodes.h"
|
2025-01-31 10:34:47 +01:00
|
|
|
|
|
|
|
|
namespace satdump
|
|
|
|
|
{
|
2025-05-19 22:26:32 +02:00
|
|
|
namespace handlers
|
2025-01-31 10:34:47 +01:00
|
|
|
{
|
2025-05-04 12:48:02 +02:00
|
|
|
Flowgraph_DatasetProductProcessor::Flowgraph_DatasetProductProcessor(DatasetHandler *dh, Handler *dp, nlohmann::json p) : DatasetProductProcessor(dh, dp, p)
|
2025-01-31 10:34:47 +01:00
|
|
|
{
|
|
|
|
|
// TODOREWORK
|
|
|
|
|
if (ImNodes::GetCurrentContext() == nullptr)
|
|
|
|
|
ImNodes::CreateContext();
|
|
|
|
|
|
2025-05-04 12:48:02 +02:00
|
|
|
flowgraph.node_internal_registry.emplace("image_product_source", []() { return std::make_shared<ImageProductSource_Node>(); });
|
|
|
|
|
flowgraph.node_internal_registry.emplace("image_product_equation", []() { return std::make_shared<ImageProductExpression_Node>(); });
|
|
|
|
|
flowgraph.node_internal_registry.emplace("image_sink", []() { return std::make_shared<ImageSink_Node>(); });
|
|
|
|
|
flowgraph.node_internal_registry.emplace("image_get_proj", []() { return std::make_shared<ImageGetProj_Node>(); });
|
|
|
|
|
flowgraph.node_internal_registry.emplace("image_reproj", []() { return std::make_shared<ImageReproj_Node>(); });
|
|
|
|
|
flowgraph.node_internal_registry.emplace("image_equation", []() { return std::make_shared<ImageExpression_Node>(); });
|
|
|
|
|
flowgraph.node_internal_registry.emplace("image_handler_sink", [dp]() { return std::make_shared<ImageHandlerSink_Node>(dp); });
|
|
|
|
|
flowgraph.node_internal_registry.emplace("image_equalize", []() { return std::make_shared<ImageEqualize_Node>(); });
|
|
|
|
|
flowgraph.node_internal_registry.emplace("image_source", []() { return std::make_shared<ImageSource_Node>(); });
|
2025-01-31 10:34:47 +01:00
|
|
|
|
2025-05-04 12:48:02 +02:00
|
|
|
flowgraph.node_internal_registry.emplace("dataset_product_source", [this]() { return std::make_shared<DatasetProductSource_Node>(this); });
|
2025-02-01 14:08:53 +01:00
|
|
|
|
2025-01-31 10:34:47 +01:00
|
|
|
if (p.contains("flowgraph"))
|
|
|
|
|
flowgraph.setJSON(p["flowgraph"]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
nlohmann::json Flowgraph_DatasetProductProcessor::getCfg()
|
|
|
|
|
{
|
2025-02-01 14:08:53 +01:00
|
|
|
nlohmann::json cfg = DatasetProductProcessor::getCfg();
|
2025-01-31 10:34:47 +01:00
|
|
|
cfg["flowgraph"] = flowgraph.getJSON();
|
|
|
|
|
return cfg;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool Flowgraph_DatasetProductProcessor::can_process()
|
|
|
|
|
{
|
|
|
|
|
return true; // TODOREWORK
|
|
|
|
|
}
|
|
|
|
|
|
2025-05-04 12:48:02 +02:00
|
|
|
void Flowgraph_DatasetProductProcessor::process(float *progress) { flowgraph.run(); }
|
2025-01-31 10:34:47 +01:00
|
|
|
|
2025-05-04 12:48:02 +02:00
|
|
|
void Flowgraph_DatasetProductProcessor::renderUI() { flowgraph.render(); }
|
2025-05-19 22:26:32 +02:00
|
|
|
} // namespace handlers
|
2025-05-04 12:48:02 +02:00
|
|
|
} // namespace satdump
|