$search
00001 00002 /*************************************************************************** 00003 * skillgui.h - Skill GUI 00004 * 00005 * Created: Mon Nov 03 13:35:34 2008 00006 * Copyright 2008-2010 Tim Niemueller [www.niemueller.de] 00007 * 2010 Carnegie Mellon University 00008 * 2010 Intel Labs Pittsburgh 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_SKILLGUI_SKILLGUI_H_ 00025 #define __TOOLS_SKILLGUI_SKILLGUI_H_ 00026 00027 00028 #include <gtkmm.h> 00029 #include <libglademm/xml.h> 00030 #ifdef HAVE_GCONFMM 00031 # include <gconfmm.h> 00032 # define GCONF_PREFIX "/apps/fawkes/skillgui" 00033 #endif 00034 00035 #ifndef USE_ROS 00036 # include <gui_utils/connection_dispatcher.h> 00037 # include <interfaces/SkillerInterface.h> 00038 # include <interfaces/SkillerDebugInterface.h> 00039 #else 00040 # include <ros/ros.h> 00041 # include <actionlib/client/action_client.h> 00042 # include <skiller/Graph.h> 00043 # include <skiller/SetGraphColored.h> 00044 # include <skiller/SetGraphDirection.h> 00045 # include <skiller/ExecSkillAction.h> 00046 #endif 00047 00048 namespace fawkes { 00049 class BlackBoard; 00050 class InterfaceDispatcher; 00051 class LogView; 00052 class Throbber; 00053 class PluginTreeView; 00054 } 00055 00056 #ifdef USE_PAPYRUS 00057 class SkillGuiGraphViewport; 00058 #else 00059 class SkillGuiGraphDrawingArea; 00060 #endif 00061 00062 class SkillGuiGtkWindow : public Gtk::Window 00063 { 00064 public: 00065 SkillGuiGtkWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml> &refxml); 00066 ~SkillGuiGtkWindow(); 00067 00068 private: 00069 void update_graph(std::string &graph_name, std::string &dotgraph); 00070 00071 void on_config_changed(); 00072 void on_contexec_toggled(); 00073 void on_skill_changed(); 00074 void on_graphupd_clicked(); 00075 void on_update_disabled(); 00076 void on_recording_toggled(); 00077 void on_exit_clicked(); 00078 void on_graphcolor_toggled(); 00079 void on_followactivestate_toggled(); 00080 void on_graphdir_clicked(); 00081 void on_exec_clicked(); 00082 void on_stop_clicked(); 00083 #ifndef USE_ROS 00084 void on_controller_clicked(); 00085 void on_connection_clicked(); 00086 void close_bb(); 00087 void on_skiller_data_changed(); 00088 void on_skdbg_data_changed(); 00089 void on_agdbg_data_changed(); 00090 void on_connect(); 00091 void on_disconnect(); 00092 void send_graphdir_message(fawkes::SkillerDebugInterface *iface, 00093 fawkes::SkillerDebugInterface::GraphDirectionEnum gd); 00094 void on_graphdir_changed(fawkes::SkillerDebugInterface::GraphDirectionEnum gd); 00095 #else 00096 void ros_skiller_graphmsg_cb(const skiller::Graph::ConstPtr &msg); 00097 void ros_agent_graphmsg_cb(const skiller::Graph::ConstPtr &msg); 00098 void ros_exec_transition_cb(actionlib::ClientGoalHandle<skiller::ExecSkillAction> &gh); 00099 void ros_exec_feedback_cb(actionlib::ClientGoalHandle<skiller::ExecSkillAction> &gh, 00100 const skiller::ExecSkillFeedbackConstPtr &feedback); 00101 void on_graph_changed(); 00102 #endif 00103 00104 private: 00105 class SkillStringRecord : public Gtk::TreeModelColumnRecord 00106 { 00107 public: 00108 SkillStringRecord(); 00109 Gtk::TreeModelColumn<Glib::ustring> skillstring; 00110 }; 00111 SkillStringRecord __sks_record; 00112 00113 00114 #ifndef USE_ROS 00115 fawkes::BlackBoard *bb; 00116 00117 fawkes::ConnectionDispatcher connection_dispatcher; 00118 fawkes::InterfaceDispatcher *__skiller_ifd; 00119 fawkes::InterfaceDispatcher *__skdbg_ifd; 00120 fawkes::InterfaceDispatcher *__agdbg_ifd; 00121 #endif 00122 00123 Gtk::Toolbar *toolbar; 00124 Gtk::ToolItem *tb_throbber; 00125 Gtk::ToolButton *tb_connection; 00126 Gtk::ToolButton *tb_exit; 00127 Gtk::SeparatorToolItem *tb_sep; 00128 Gtk::Button *but_exec; 00129 Gtk::Button *but_stop; 00130 Gtk::ToggleButton *but_continuous; 00131 Gtk::Button *but_clearlog; 00132 Gtk::ComboBoxEntry *cbe_skillstring; 00133 Gtk::Label *lab_status; 00134 Gtk::Label *lab_alive; 00135 Gtk::Label *lab_continuous; 00136 Gtk::Label *lab_skillstring; 00137 Gtk::Label *lab_error; 00138 Gtk::ScrolledWindow *scw_graph; 00139 Gtk::Notebook *ntb_tabs; 00140 Gtk::DrawingArea *drw_graph; 00141 Gtk::Toolbar *tb_fsmgraph; 00142 Gtk::ToggleToolButton *tb_skiller; 00143 Gtk::ToggleToolButton *tb_agent; 00144 Gtk::ComboBoxText *cb_graphlist; 00145 Gtk::ToolItem *tb_graphlist; 00146 Gtk::ToolButton *tb_graphsave; 00147 Gtk::ToolButton *tb_graphopen; 00148 Gtk::ToolButton *tb_graphupd; 00149 Gtk::ToggleToolButton *tb_graphrecord; 00150 Gtk::ToolButton *tb_controller; 00151 Gtk::ToolButton *tb_zoomin; 00152 Gtk::ToolButton *tb_zoomout; 00153 Gtk::ToolButton *tb_zoomfit; 00154 Gtk::ToolButton *tb_zoomreset; 00155 00156 Gtk::MenuToolButton *tb_graphdir; 00157 Gtk::ToggleToolButton *tb_graphcolored; 00158 Gtk::ToggleToolButton *tb_followactivestate; 00159 Gtk::MenuItem *mi_graphdir; 00160 Gtk::MenuItem *mi_bottom_top; 00161 Gtk::MenuItem *mi_top_bottom; 00162 Gtk::MenuItem *mi_left_right; 00163 Gtk::MenuItem *mi_right_left; 00164 00165 Glib::RefPtr<Gtk::ListStore> __sks_list; 00166 00167 #ifdef HAVE_GCONFMM 00168 Glib::RefPtr<Gnome::Conf::Client> __gconf; 00169 #endif 00170 00171 #ifdef USE_PAPYRUS 00172 SkillGuiGraphViewport *pvp_graph; 00173 #else 00174 SkillGuiGraphDrawingArea *gda; 00175 #endif 00176 00177 #ifdef USE_ROS 00178 ros::NodeHandle __rosnh; 00179 ros::Subscriber __sub_graph_skiller; 00180 ros::Subscriber __sub_graph_agent; 00181 ros::ServiceClient __srv_graph_color_skiller; 00182 ros::ServiceClient __srv_graph_direction_skiller; 00183 ros::ServiceClient __srv_graph_color_agent; 00184 ros::ServiceClient __srv_graph_direction_agent; 00185 Glib::Dispatcher __graph_changed; 00186 skiller::Graph::ConstPtr __graph_msg_skiller; 00187 skiller::Graph::ConstPtr __graph_msg_agent; 00188 actionlib::ActionClient<skiller::ExecSkillAction> __ac_exec; 00189 actionlib::ClientGoalHandle<skiller::ExecSkillAction> __gh; 00190 #else 00191 fawkes::SkillerInterface *__skiller_if; 00192 fawkes::SkillerDebugInterface *__skdbg_if; 00193 fawkes::SkillerDebugInterface *__agdbg_if; 00194 00195 fawkes::LogView *__logview; 00196 fawkes::PluginTreeView *__trv_plugins; 00197 #endif 00198 fawkes::Throbber *__throbber; 00199 00200 }; 00201 00202 #endif