satdump/src-interface/viewer2/dsp/flowgraph/node_int.cpp

27 lines
704 B
C++
Raw Normal View History

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
{
2025-04-15 19:06:12 +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); }
2025-03-09 10:16:40 +01:00
void NodeInternal::render()
{
2025-04-15 19:06:12 +01:00
ImGui::PushItemWidth(200);
optdisp->draw();
ImGui::PopItemWidth();
2025-03-09 10:16:40 +01:00
}
2025-04-15 19:06:12 +01:00
nlohmann::json NodeInternal::getP() { return blk->get_cfg(); }
2025-03-09 10:16:40 +01:00
void NodeInternal::setP(nlohmann::json p)
{
2025-04-15 19:06:12 +01:00
blk->set_cfg(p);
optdisp->update();
2025-03-09 10:16:40 +01:00
}
2025-04-15 19:06:12 +01:00
} // namespace ndsp
} // namespace satdump