00001 // Copyright (C) 2005-2009 Christopher Mire, Mark McKelvy 00002 // Copyright (C) 2005-2009 University of Louisiana at Lafayette 00003 00004 #ifndef CAJUN_CBSTAT_UI_CONFIG_H 00005 #define CAJUN_CBSTAT_UI_CONFIG_H 00006 00007 #include "ui_base.H" 00008 #include <cassert> 00009 #include <cstring> 00010 #include <string> 00011 #include <fstream> 00012 #include <vector> 00013 #include <gtk/gtk.h> 00014 #include <glade/glade-xml.h> 00015 00016 namespace cajun 00017 { 00018 #define MDF_MODE 0 00019 class ui_config_t 00020 { 00021 public: 00022 ui_config_t (); 00023 ~ui_config_t (); 00024 00025 void init (std::string cbstat_glade_file_); 00026 gboolean gui_init (); 00027 void app_finished (); 00028 gboolean is_app_finished () const; 00029 00030 GladeXML *get_cbstat_xml () const; 00031 00032 void set_cbstat_async_queue (GAsyncQueue *q_); 00033 GAsyncQueue *get_cbstat_async_queue (); 00034 00035 void set_poll_interval (guint poll_interval_); 00036 guint get_poll_interval () const; 00037 00038 void set_time_out (guint time_out_); 00039 guint get_time_out () const; 00040 00041 void set_route_mode (int mode_); 00042 gint get_route_mode () const; 00043 00044 void set_route_file (gchar *name_); 00045 const gchar *get_route_file (); 00046 00047 void set_mission_file (gchar *name_); 00048 const gchar *get_mission_file (); 00049 00050 void set_bot_name (const char* name_); 00051 const gchar *get_bot_name (); 00052 void set_script_name (const char* name_); 00053 const gchar *get_script_name (); 00054 void set_user_name (const char* name_); 00055 const gchar *get_user_name (); 00056 00057 void started_run (); 00058 gboolean ran_once () const; 00059 00060 void enable_broadcast (const char* addr_and_port_); 00061 void disable_broadcast (); 00062 gboolean broadcast_enabled () const; 00063 const gchar *broadcast_net (); 00064 00065 void add_log_folder (gchar *folder_name_); 00066 void clear_log_folders (); 00067 const std::vector<gchar *> &get_log_folders () const; 00068 00069 void add_ui_queue (my_ui_base_t *q_); 00070 guint get_ui_queue_size () const; 00071 my_ui_base_t *get_ui_queue (guint id_); 00072 00073 void clear_sick_check_buttons (GtkContainer *c); 00074 std::map<std::string, GtkWidget *> *get_sick_check_buttons () 00075 { return m_sick_check_buttons; }; 00076 00077 void clear_camera_check_buttons (GtkContainer *c); 00078 std::map<std::string, GtkWidget *> *get_camera_check_buttons () 00079 { return m_camera_check_buttons; }; 00080 00081 void clear_ibeo_alasca_check_buttons (GtkContainer *c); 00082 std::map<std::string, GtkWidget *> *get_ibeo_alasca_check_buttons () 00083 { return m_ibeo_alasca_check_buttons; }; 00084 00085 void clear_vorad_radar_check_buttons (GtkContainer *c); 00086 std::map<std::string, GtkWidget *> *get_vorad_radar_check_buttons () 00087 { return m_vorad_radar_check_buttons; }; 00088 00089 private: 00090 gboolean m_init; 00091 gboolean m_gui_init; 00092 gboolean m_app_finished; 00093 GladeXML *m_cbstat_xml; 00094 GAsyncQueue *m_cbstat_async_queue; 00095 gint m_route_mode; 00096 guint m_poll_interval; 00097 guint m_time_out; 00098 gchar m_route_file[100]; 00099 gchar m_mission_file[100]; 00100 gchar m_bot_name[30]; 00101 gchar m_script_name[30]; 00102 gchar m_user_name[30]; 00103 gboolean m_ran_once; 00104 gboolean m_enable_broadcast; 00105 gchar m_broadcast_addr[100]; 00106 std::vector<gchar *> m_log_folder_list; 00107 std::vector<my_ui_base_t *> m_ui_queue_list; 00108 std::map<std::string, GtkWidget *> *m_sick_check_buttons; 00109 std::map<std::string, GtkWidget *> *m_camera_check_buttons; 00110 std::map<std::string, GtkWidget *> *m_ibeo_alasca_check_buttons; 00111 std::map<std::string, GtkWidget *> *m_vorad_radar_check_buttons; 00112 }; 00113 }; 00114 00115 #endif 00116 00117 // Emacs 00118 // Local Variables: 00119 // mode: c++ 00120 // End: 00121