satdump/src-core/dsp/flowgraph/node_int.cpp

28 lines
735 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
2025-04-21 23:17:21 +02:00
bool NodeInternal::render()
2025-03-09 10:16:40 +01:00
{
2025-04-15 19:06:12 +01:00
ImGui::PushItemWidth(200);
2025-04-21 23:17:21 +02:00
bool r = optdisp->draw();
2025-04-15 19:06:12 +01:00
ImGui::PopItemWidth();
2025-04-21 23:17:21 +02:00
return r;
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