Fawkes API  Fawkes Development Version
battery_monitor.h
1 
2 /***************************************************************************
3  * battery_monitor.h - Fawkes Battery Monitor
4  *
5  * Created: Mon Apr 06 17:09:40 2009
6  * Copyright 2009 Daniel Beck
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #ifndef __TOOLS_BATTERY_MONITOR_BATTERY_MONITOR_H_
24 #define __TOOLS_BATTERY_MONITOR_BATTERY_MONITOR_H_
25 
26 #include <netcomm/service_discovery/browse_handler.h>
27 
28 #include <gtkmm.h>
29 
30 #include <map>
31 #include <string>
32 
34 
35 namespace fawkes {
36  class AvahiThread;
37 }
38 
40 : public Gtk::Window,
42 {
43  public:
44  BatteryMonitor(Glib::RefPtr<Gtk::Builder> builder);
45  ~BatteryMonitor();
46 
47  Gtk::Window& get_window() const;
48 
49  protected:
50  // service browser handler
51  void all_for_now();
52  void cache_exhausted();
53  void browse_failed( const char* name,
54  const char* type,
55  const char* domain );
56  void service_added( const char* name,
57  const char* type,
58  const char* domain,
59  const char* host_name,
60  const char* interface,
61  const struct sockaddr* addr,
62  const socklen_t addr_size,
63  uint16_t port,
64  std::list<std::string>& txt,
65  int flags );
66  void service_removed( const char* name,
67  const char* type,
68  const char* domain );
69 
70  private:
71  void on_btn_quit_clicked();
72 
73  Gtk::Window* m_wnd_main;
74  BatteryMonitorTreeView* m_trv_battery;
75  Gtk::Button* m_btn_quit;
76 
77  std::map< std::string, std::string > m_services;
78  fawkes::AvahiThread* m_avahi;
79 };
80 
81 #endif /* __TOOLS_BATTERY_MONITOR_BATTERY_MONITOR_H_ */
A treeview that retrieves battery data from the robots over remote blackboard connections and display...
Fawkes library namespace.
Interface for class that process browse results.
Avahi main thread.
Definition: avahi_thread.h:54
A battery monitor.