$search
00001 00002 /*************************************************************************** 00003 * rosspawn_gui.h - Plugin Tool Gui 00004 * 00005 * Created: Thu Nov 09 20:15:27 2007 00006 * Copyright 2007 Daniel Beck 00007 * 2008-2010 Tim Niemueller [www.niemueller.de] 00008 * 00009 ****************************************************************************/ 00010 00011 /* This program is free software; you can redistribute it and/or modify 00012 * it under the terms of the GNU General Public License as published by 00013 * the Free Software Foundation; either version 2 of the License, or 00014 * (at your option) any later version. 00015 * 00016 * This program is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 * GNU Library General Public License for more details. 00020 * 00021 * Read the full text in the LICENSE.GPL file in the doc directory. 00022 */ 00023 00024 #ifndef __TOOLS_PLUGIN_PLUGIN_GUI_PLUGIN_GUI_H_ 00025 #define __TOOLS_PLUGIN_PLUGIN_GUI_PLUGIN_GUI_H_ 00026 00027 #include <gtkmm.h> 00028 #include <ros/ros.h> 00029 00030 #include <rosspawn/NodeEvent.h> 00031 00032 class RosSpawnGuiWindow : public Gtk::Window 00033 { 00034 public: 00035 RosSpawnGuiWindow(BaseObjectType* cobject, const Glib::RefPtr<Gtk::Builder> &builder); 00036 virtual ~RosSpawnGuiWindow(); 00037 00038 void set_ros_node(ros::NodeHandle &n); 00039 void cb_node_event(const rosspawn::NodeEvent::ConstPtr &msg); 00040 00041 void on_status_toggled(const Glib::ustring& path); 00042 00043 private: 00044 class PluginRecord : public Gtk::TreeModelColumnRecord 00045 { 00046 public: 00047 PluginRecord() 00048 { 00049 add(index); 00050 add(name); 00051 add(description); 00052 add(loaded); 00053 add(status); 00054 } 00055 00056 Gtk::TreeModelColumn<int> index; 00057 Gtk::TreeModelColumn<Glib::ustring> name; 00058 Gtk::TreeModelColumn<Glib::ustring> description; 00059 Gtk::TreeModelColumn<bool> loaded; 00060 Gtk::TreeModelColumn<Glib::ustring> status; 00061 }; 00062 00063 private: 00064 Glib::RefPtr<Gtk::ListStore> m_plugin_list; 00065 PluginRecord m_plugin_record; 00066 00067 Gtk::Statusbar *m_stb_status; 00068 Gtk::TreeView *m_trv_plugins; 00069 Glib::Dispatcher __redraw_dispatcher; 00070 00071 ros::NodeHandle __n; 00072 ros::ServiceClient __srv_start; 00073 ros::ServiceClient __srv_stop; 00074 ros::ServiceClient __srv_pause; 00075 ros::ServiceClient __srv_cont; 00076 ros::ServiceClient __srv_lstld; 00077 ros::ServiceClient __srv_lstav; 00078 ros::Subscriber __sub_node_events; 00079 }; 00080 00081 #endif