2025-03-09 10:16:40 +01:00
|
|
|
#include "node_int.h"
|
|
|
|
|
#include "flowgraph.h"
|
2025-04-15 19:06:12 +01:00
|
|
|
#include "imgui/imgui.h"
|
|
|
|
|
|
2025-03-09 10:16:40 +01:00
|
|
|
namespace satdump
|
|
|
|
|
{
|
|
|
|
|
namespace ndsp
|
|
|
|
|
{
|
2026-03-10 18:04:18 +01:00
|
|
|
namespace flowgraph
|
2026-02-27 12:21:05 +01:00
|
|
|
{
|
2026-03-10 18:04:18 +01:00
|
|
|
NodeInternal::NodeInternal(const Flowgraph *f, std::shared_ptr<ndsp::Block> b) : f((Flowgraph *)f), blk(b)
|
|
|
|
|
{
|
|
|
|
|
optdisp = std::make_unique<ndsp::OptDisplayerWarper>(blk);
|
|
|
|
|
optdisp->setShowStats(true);
|
|
|
|
|
}
|
2025-03-09 10:16:40 +01:00
|
|
|
|
2026-03-10 18:04:18 +01:00
|
|
|
bool NodeInternal::render()
|
|
|
|
|
{
|
|
|
|
|
// Limit width. Might need to change that later?
|
|
|
|
|
ImGui::PushItemWidth(200);
|
|
|
|
|
bool r = optdisp->draw();
|
|
|
|
|
ImGui::PopItemWidth();
|
2026-01-29 23:10:31 +01:00
|
|
|
|
2026-03-10 18:04:18 +01:00
|
|
|
return r;
|
|
|
|
|
}
|
2025-03-09 10:16:40 +01:00
|
|
|
|
2026-03-10 18:04:18 +01:00
|
|
|
nlohmann::json NodeInternal::getP() { return blk->get_cfg(); }
|
2025-03-09 10:16:40 +01:00
|
|
|
|
2026-03-10 18:04:18 +01:00
|
|
|
void NodeInternal::setP(nlohmann::json p)
|
|
|
|
|
{
|
|
|
|
|
blk->set_cfg(p);
|
|
|
|
|
optdisp->update();
|
|
|
|
|
}
|
|
|
|
|
} // namespace flowgraph
|
2025-04-15 19:06:12 +01:00
|
|
|
} // namespace ndsp
|
2026-03-10 18:04:18 +01:00
|
|
|
} // namespace satdump
|