Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
frankosterfeld committed Apr 23, 2024
1 parent c34644e commit 524c437
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/ui/blocks/ImPlotSink.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
namespace opendigitizer {

template<typename T>
requires std::is_floating_point_v<T> || (meta::is_dataset_v<T> && std::is_floating_point_v<typename T::value_type>)
struct ImPlotSink : public gr::Block<ImPlotSink<T>, gr::BlockingIO<false>, gr::SupportedTypes<float, double, gr::DataSet_float, gr::DataSet_double>, gr::Drawable<gr::UICategory::ChartPane, "Dear ImGui">> {
struct ImPlotSink : public gr::Block<ImPlotSink<T>,
gr::BlockingIO<false>, gr::SupportedTypes<float, double, gr::DataSet<float>, gr::DataSet<double>>, gr::Drawable<gr::UICategory::ChartPane, "Dear ImGui">> {
gr::PortIn<T> in;
uint32_t color = 0xff0000; ///< RGB color for the plot // TODO use better type, support configurable colors for datasets?
std::string signal_name;
Expand Down
6 changes: 4 additions & 2 deletions src/ui/flowgraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,12 +482,14 @@ static std::unique_ptr<gr::BlockModel> createGRBlock(gr::PluginLoader &loader, c
auto params = block.parameters();
params["name"] = block.name;
auto grBlock = loader.instantiate(block.typeName(), DataType::name(t));
grBlock->settings().set(params);
grBlock->settings().applyStagedParameters();

if (!grBlock) {
fmt::println(std::cerr, "Could not create GR Block for {} ({}<{}>)\n", block.name, block.typeName(), DataType::name(t));
return nullptr;
}

grBlock->settings().set(params);
grBlock->settings().applyStagedParameters();
return grBlock;
}
} // namespace
Expand Down

0 comments on commit 524c437

Please sign in to comment.