Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef _MAIN_WINDOW_HH
00038 # include "main_window_glade.hh"
00039 # include "core/include/frames.h"
00040 # include "bridge.hh"
00041 # define _MAIN_WINDOW_HH
00042 # include "window1.hh"
00043 # include "window2.hh"
00044 # include "window3.hh"
00045 # include "area.h"
00046 #include "basic_io.h"
00047 #include <map>
00048 #include <glibmm/keyfile.h>
00049 class main_window : public main_window_glade
00050 { public:
00051 main_window(char * s_iface);
00052 ~main_window();
00053 void setRobotPose(int idx,double x, double y, double a, int col);
00054 virtual void on_button6_clicked();
00055 virtual void on_button7_clicked();
00056 virtual void on_togglebutton2_clicked();
00057 virtual void on_button8_clicked();
00058 virtual void on_button9_clicked();
00059 virtual void on_togglebutton1_clicked();
00060 virtual void on_hscale_position_value_changed();
00061 virtual void on_hscale_zoom_value_changed();
00062 virtual void on_nuevo1_activate();
00063 virtual void on_abrir1_activate();
00064 virtual void on_guardar1_activate();
00065 virtual void on_guardar_como1_activate();
00066 virtual void on_salir1_activate();
00067 virtual void on_cortar1_activate();
00068 virtual void on_copiar1_activate();
00069 virtual void on_pegar1_activate();
00070 virtual void on_borrar1_activate();
00071 virtual void on_acerca_de1_activate();
00072 virtual void on_button23_clicked();
00073 virtual bool on_exit();
00074 virtual void on_xfield_tw_cursor_changed(){}
00075 virtual bool on_xfield_tw_focus_in_event(GdkEventFocus *ev);
00076 virtual bool on_xfield_tw_focus_out_event(GdkEventFocus *ev);
00077 virtual void on_xfield_tw_row_collapsed(const Gtk::TreeModel::iterator& iter, const Gtk::TreeModel::Path& path);
00078 virtual void on_xfield_tw_row_expanded(const Gtk::TreeModel::iterator& iter, const Gtk::TreeModel::Path& path);
00079 virtual bool on_xfield_tw_button_press_event(GdkEventButton *ev);
00080 virtual void on_import_activate();
00081 virtual void on_create_log_activate();
00082 void begin_play();
00083 void continue_play();
00084 void stop_playing();
00085 bool begin_online_record();
00086 bool begin_record();
00087 void continue_record(char * data, int data_size);
00088 void request_stop_recording();
00089 void recording_stopped();
00090 virtual bool on_main_window_button_press_event(GdkEventButton *ev);
00091 void on_w_resize(GdkEventConfigure* event);
00092 virtual bool on_main_window_motion_notify_event(GdkEventMotion *ev);
00093
00094 virtual bool on_main_window_expose_event(GdkEventExpose *ev);
00095 virtual void on_spinbutton1_activate();
00096 void fill_screen();
00097 void reset(int val = -1);
00098
00099 void draw_stuffs(char * data, int pos_in_file,int show_frames, int show_nodes,int show_text);
00100 void update_frame_labels(wmpFrame * f);
00101 void update_pose_labels();
00102 void update_frame_info(simData_Hdr *p, wmpFrame * q);
00103 void show_broadcast_data(wmpFrame *f);
00104 void show_routing_data(wmpFrame *f);
00105 void show_qos_data(wmpFrame * f);
00106
00107 void statistics(char *);
00108 bool on_main_window_scroll_event(GdkEventScroll * e);
00109 void on_button13_clicked();
00110 void notify_selection(int);
00111 void save_cfg_file();
00112 class area *areadx, *areasx;
00113 class MyArea * MyArea;
00114 double sim_xsize,sim_ysize,sim_thresh;
00115 Glib::KeyFile *kf;
00116 wmpFrame selectedFrame;
00117
00118 private:
00119 int timer;
00120 int yap;
00121 int rec_type;
00122
00123 class ModelColumns: public Gtk::TreeModel::ColumnRecord {
00124 public:
00125 ModelColumns() {
00126 add(m_col_id);
00127 add(m_col_name);
00128 add(m_col_value);
00129 add(m_col_type);
00130 }
00131 Gtk::TreeModelColumn<unsigned int> m_col_type;
00132 Gtk::TreeModelColumn<unsigned int> m_col_id;
00133 Gtk::TreeModelColumn<Glib::ustring> m_col_name;
00134 Gtk::TreeModelColumn<Glib::ustring> m_col_value;
00135 };
00136 ModelColumns m_Columns;
00137 std::map<std::string,bool> rows_expanded;
00138 Glib::RefPtr<Gtk::TreeStore> m_refTreeModel;
00139 Gtk::TreeModel::Row row;
00140 Gtk::TreeModel::Row subrow;
00141 Gtk::Menu m_Menu_Popup;
00142 void row_child_child_append(std::string txt1, std::string txt2);
00143 void row_append(std::string txt1, std::string txt2);
00144 void row_child_append(std::string txt1, std::string txt2);
00145 void row_child_child_append(std::string txt1, int id, int val, std::string uni);
00146 void saveRowsStatus();
00147 void restoreRowsStatus();
00148 void show_path();
00149
00150
00151 char filename[256];
00152 char data_backup[2500];
00153 int play_idx, play_idx2, playing, recording;
00154 int nnodes,k,idx3;
00155 int checkstring(char * txt);
00156 long long frame_time;
00157 void fill_tree(wmpFrame * r, long long ptime, int pos_in_file=-1);
00158 bool timer_callback();
00159 class rec_param_dlg * rp_dlg;
00160 window1* w1;
00161 window2* w2;
00162 window3* w3;
00163 std::string cfg_file, executable;
00164 bool tw_has_focus;
00165 bool timered_show_t;
00166 void updater();
00167 virtual void on_rec_btn_clicked();
00168 virtual void on_rec_tb_toggled();
00169 virtual void on_rec_tb_released();
00170 virtual void on_rec_tb_activate();
00171 bool MyCallback(int n);
00172 };
00173
00174
00175 void new_frame(char * data, int data_size);
00176 void getSimParam(double & threshold, double & x_size, double & y_size);
00177 void lowerLayersRecStop();
00178 bool showForeign();
00179 void informBridgeOff();
00180 #endif