Skip to content

Commit

Permalink
Add UI category to the BlockModel
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-cukic authored and RalphSteinhagen committed Apr 24, 2024
1 parent 5d73fd2 commit b9fefce
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
8 changes: 8 additions & 0 deletions core/include/gnuradio-4.0/Graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@ class BlockModel {
processScheduledMessages()
= 0;

virtual UICategory uiCategory() const {
return UICategory::None;
}

[[nodiscard]] virtual void *
raw() = 0;
};
Expand Down Expand Up @@ -420,6 +424,10 @@ class BlockWrapper : public BlockModel {
return work::Status::ERROR;
}

UICategory uiCategory() const override {
return T::DrawableControl::kCategory;
}

void
processScheduledMessages() override {
return blockRef().processScheduledMessages();
Expand Down
9 changes: 4 additions & 5 deletions core/include/gnuradio-4.0/annotated.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,9 @@ template<IncompleteFinalUpdateEnum updatePolicy>
struct IncompleteFinalUpdatePolicy {
static constexpr IncompleteFinalUpdateEnum kIncompleteFinalUpdatePolicy = updatePolicy;
};

template<typename T>
concept IsIncompleteFinalUpdatePolicy = requires {
T::kIncompleteFinalUpdatePolicy;
} && std::is_base_of_v<IncompleteFinalUpdatePolicy<T::kIncompleteFinalUpdatePolicy>, T>;
concept IsIncompleteFinalUpdatePolicy = requires { T::kIncompleteFinalUpdatePolicy; } && std::is_base_of_v<IncompleteFinalUpdatePolicy<T::kIncompleteFinalUpdatePolicy>, T>;

template<typename T>
using is_incompleteFinalUpdatePolicy = std::bool_constant<IsIncompleteFinalUpdatePolicy<T>>;
Expand All @@ -163,8 +162,8 @@ enum class UICategory { None, Toolbar, ChartPane, StatusBar, Menu };
*/
template<UICategory category_, gr::meta::fixed_string toolkit_ = "">
struct Drawable {
static constexpr UICategory kCategory = category_;
static constexpr gr::meta::fixed_string kToolkit = toolkit_;
static constexpr UICategory kCategory = category_;
static constexpr gr::meta::fixed_string kToolkit = toolkit_;
};

template<typename T>
Expand Down

0 comments on commit b9fefce

Please sign in to comment.