TextView.hh
Go to the documentation of this file.
1/*
2 * Copyright (C) 2012 Open Source Robotics Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16*/
17#ifndef _TEXTVIEW_HH_
18#define _TEXTVIEW_HH_
19
20#include <string>
21#include <boost/thread/mutex.hpp>
22
23#include "gazebo/common/Time.hh"
24#include "gazebo/msgs/msgs.hh"
25
27
28#include "gazebo/gui/qt.h"
30#include "gazebo/util/system.hh"
31
32namespace gazebo
33{
34 namespace gui
35 {
36 class GZ_GUI_VISIBLE TextView : public TopicView
37 {
38 Q_OBJECT
39
42 public: TextView(QWidget *_parent, const std::string &_msgType);
43
45 public: virtual ~TextView();
46
47 // Documentation inherited
48 public: virtual void SetTopic(const std::string &_topicName);
49
52 signals: void AddMsg(QString _msg);
53
54 // Documentation inherited
55 private: virtual void UpdateImpl();
56
59 private: void OnText(const std::string &_msg);
60
63 private slots: void OnBuffer(int _value);
64
67 private slots: void OnPause(bool _value);
68
71 private slots: void OnAddMsg(QString _msg);
72
74 private: QListWidget *msgList;
75
78 private: int bufferSize;
79
81 private: boost::shared_ptr<google::protobuf::Message> msg;
82
84 private: boost::mutex mutex;
85
87 private: bool paused;
88 };
89 }
90}
91#endif
gui
Definition KeyEventHandler.hh:29
Forward declarations for transport.
Definition TextView.hh:37
virtual ~TextView()
Destructor.
void AddMsg(QString _msg)
Signal to add a message to the GUI list.
TextView(QWidget *_parent, const std::string &_msgType)
Constructor.
virtual void SetTopic(const std::string &_topicName)
Set the name of the topic to get data from.
Base class for widgets that display topic data.
Definition TopicView.hh:79
Forward declarations for the common classes.
Definition Animation.hh:27