9 #include <QMdiSubWindow> 10 #include <QPushButton> 17 #include <unordered_map> 48 constexpr
Id INVALID_ID =
static_cast<Id>(std::numeric_limits<size_t>::max());
101 std::variant<int64_t, double, uint64_t, std::string, RT::State::state_t>
187 const std::string& mod_name,
188 const std::vector<IO::channel_t>& channels,
189 const std::vector<Widgets::Variable::Info>& variables);
202 return std::get<T>(this->parameters.at(var_id).value);
214 this->parameters.at(var_id).value = value;
259 return this->parameters;
270 std::vector<Widgets::Variable::Info> parameters;
282 Panel(
const std::string& mod_name,
301 virtual void createGUI(
const std::vector<Widgets::Variable::Info>& vars,
302 const std::vector<Widgets::Variable::Id>& skip_ids);
346 virtual void pause(
bool p);
372 void setParameter(
const QString& var_name,
double value);
381 void setParameter(
const QString& var_name, uint64_t value);
407 void setComment(
const QString& var_name,
const QString& comment);
422 std::string
getName() {
return this->m_name; }
446 QMainWindow* main_window =
nullptr;
448 QMdiSubWindow* m_subwindow =
nullptr;
453 QPushButton* pauseButton =
nullptr;
454 QPushButton* modifyButton =
nullptr;
455 QPushButton* unloadButton =
nullptr;
459 QLabel* label =
nullptr;
465 std::unordered_map<std::string, param_t> parameter;
556 const int result = 0;
558 if (
typeid(T) ==
typeid(int64_t)) {
560 }
else if (
typeid(T) ==
typeid(
double)) {
562 }
else if (
typeid(T) ==
typeid(uint64_t)) {
564 }
else if (
typeid(T) ==
typeid(std::string)) {
568 "Widgets::Plugin::setComponentParameter : Parameter type not " 573 event.setParam(
"paramID", std::any(parameter_id));
574 event.setParam(
"paramType", std::any(param_type));
575 event.setParam(
"paramValue", std::any(value));
576 event.setParam(
"paramWidget", std::any(this->plugin_component.get()));
586 std::string
getName()
const {
return this->name; }
623 void setLibrary(
const std::string& lib) { this->library = lib; }
653 std::unique_ptr<Widgets::Component> plugin_component;
657 QMainWindow* main_window =
nullptr;
void postEvent(Object *event)
void ERROR_MSG(const std::string &errmsg, Args... args)
@ RT_WIDGET_PARAMETER_CHANGE_EVENT