00001 #ifndef rqt_gauges_my_plugin_H 00002 #define rqt_gauges_my_plugin_H 00003 00004 #include <QWidget> 00005 #include <ros/ros.h> 00006 #include <rqt_gui_cpp/plugin.h> 00007 #include <ui_my_plugin.h> // This is autogenerated by Qt 00008 #include "rqt_gauges/qcgaugewidget.h" 00009 #include <std_msgs/Float64.h> 00010 00011 namespace rqt_gauges { 00012 00013 class MyPlugin 00014 : public rqt_gui_cpp::Plugin 00015 { 00016 Q_OBJECT 00017 public: 00018 MyPlugin(); 00019 virtual void initPlugin(qt_gui_cpp::PluginContext& context); 00020 void newDataCallback(const std_msgs::Float64& msg); 00021 virtual void restoreSettings(const qt_gui_cpp::Settings& plugin_settings, const qt_gui_cpp::Settings& instance_settings); 00022 virtual void saveSettings(qt_gui_cpp::Settings& plugin_settings, qt_gui_cpp::Settings& instance_settings) const; 00023 virtual void shutdownPlugin(); 00024 00025 // Comment in to signal that the plugin has a way to configure it 00026 // bool hasConfiguration() const; 00027 // void triggerConfiguration(); 00028 private: 00029 Ui::Gauge ui_; 00030 QWidget* widget_; 00031 QcGaugeWidget* mSpeedGauge_; 00032 QcNeedleItem *mSpeedNeedle_; 00033 ros::Subscriber needleSub_; 00034 }; 00035 } // namespace rqt_gauges 00036 #endif // rqt_gauges_my_plugin_H