main_window.hh
Go to the documentation of this file.
00001 /*------------------------------------------------------------------------
00002  *---------------------           WMPSNIFFER          --------------------
00003  *------------------------------------------------------------------------
00004  *                                                         V7.0B  11/05/10
00005  *
00006  *
00007  *  File: main_window_glade.hh
00008  *  Authors: Danilo Tardioli
00009  *  ----------------------------------------------------------------------
00010  *  Copyright (C) 2000-2012, Universidad de Zaragoza, SPAIN
00011  *
00012  *  Contact Addresses: Danilo Tardioli                   dantard@unizar.es
00013  *
00014  *  RT-WMP is free software; you can  redistribute it and/or  modify it
00015  *  under the terms of the GNU General Public License  as published by the
00016  *  Free Software Foundation;  either  version 2, or (at  your option) any
00017  *  later version.
00018  *
00019  *  RT-WMP  is distributed  in the  hope  that  it will be   useful, but
00020  *  WITHOUT  ANY  WARRANTY;     without  even the   implied   warranty  of
00021  *  MERCHANTABILITY  or  FITNESS FOR A  PARTICULAR PURPOSE.    See the GNU
00022  *  General Public License for more details.
00023  *
00024  *  You should have received  a  copy of  the  GNU General Public  License
00025  *  distributed with RT-WMP;  see file COPYING.   If not,  write to the
00026  *  Free Software  Foundation,  59 Temple Place  -  Suite 330,  Boston, MA
00027  *  02111-1307, USA.
00028  *
00029  *  As a  special exception, if you  link this  unit  with other  files to
00030  *  produce an   executable,   this unit  does  not  by  itself cause  the
00031  *  resulting executable to be covered by the  GNU General Public License.
00032  *  This exception does  not however invalidate  any other reasons why the
00033  *  executable file might be covered by the GNU Public License.
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     /* update view > */
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     /* update view < */
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         /* extra-fields > */
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         /* extra-fields < */
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 /* C wrapper */
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


ros_rt_wmp_sniffer
Author(s): Danilo Tardioli, dantard@unizar.es
autogenerated on Mon Oct 6 2014 08:27:57