Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
rxtools::RosoutPanel Class Reference

An embeddable panel which listens on rosout and displays any messages that arrive. More...

#include <rosout_panel.h>

Inheritance diagram for rxtools::RosoutPanel:
Inheritance graph
[legend]

List of all members.

Classes

struct  FilterInfo

Public Member Functions

void clear ()
 Clear all messages.
void clearFilters ()
RosoutFramecreateNewFrame ()
RosoutTextFilterPtr createTextFilter ()
rosgraph_msgs::LogConstPtr getMessageByIndex (uint32_t index) const
 Get a message by index in our ordered message list. Used by the list control.
RosoutMessageSummary getMessageSummary (double duration) const
 Returns a summary of the types of messages that have been received recently.
void refilter ()
 Re-filter all messages.
 RosoutPanel (wxWindow *parent, int id=wxID_ANY, wxPoint pos=wxDefaultPosition, wxSize size=wxDefaultSize, int style=wxTAB_TRAVERSAL)
 Constructor.
void setBufferSize (uint32_t size)
 Set the number of messages to display before we start throwing away old ones.
void setEnabled (bool enabled)
 Set this panel to be enabled or not.
void setTopic (const std::string &topic)
 Set the topic to listen on for rosgraph_msgs::Log messages.
 ~RosoutPanel ()

Protected Types

typedef std::map< uint32_t,
rosgraph_msgs::Log::ConstPtr > 
M_IdToMessage
typedef std::vector< FilterInfoV_FilterInfo
typedef std::vector
< rosgraph_msgs::Log::ConstPtr > 
V_Log
typedef std::vector< uint32_tV_u32

Protected Member Functions

void addFilter (const RosoutFilterPtr &filter, wxWindow *control)
void addMessageToTable (const rosgraph_msgs::Log::ConstPtr &message, uint32_t id)
 Add a message to the table.
void checkForMaster ()
bool filter (uint32_t id) const
 Filter a message based on our current filter.
void incomingMessage (const rosgraph_msgs::Log::ConstPtr &message)
 (ros callback) Called when there is a new message waiting
void onAddFilterPressed (wxCommandEvent &event)
virtual void onClear (wxCommandEvent &event)
 (wx callback) Called when the "Clear" button is pressed
void onFilterChanged (const RosoutFilter *)
void onFilterDelete (wxCommandEvent &event)
void onFilterEnableChecked (wxCommandEvent &event)
void onFilterMoveDown (wxCommandEvent &event)
void onFilterMoveUp (wxCommandEvent &event)
virtual void onLoggerLevels (wxCommandEvent &event)
void onLoggerLevelsClose (wxCloseEvent &event)
void onMasterDisconnected (wxEvent &event)
void onMasterReconnected (wxEvent &event)
virtual void onNewWindow (wxCommandEvent &event)
virtual void onPause (wxCommandEvent &event)
 (wx callback) Called when the "Pause" button is pressed
void onProcessTimer (wxTimerEvent &evt)
 (wx callback) Called every 250ms so we can process new messages
virtual void onSetup (wxCommandEvent &event)
 (wx callback) Called when the "Setup" button is pressed
void popMessage ()
 Remove The oldest message.
void processMessage (const rosgraph_msgs::Log::ConstPtr &message)
 Process a log message.
void processMessages ()
 Processes any messages in our message queue.
void removeFilter (const RosoutFilterPtr &filter)
void resizeFiltersPane ()
void setMessages (const M_IdToMessage &messages)
void subscribe ()
 subscribe to our topic
void unsubscribe ()
 unsubscribe from our topic
void updateFilterBackgrounds ()
void validateOrderedMessages ()

Protected Attributes

ros::CallbackQueue callback_queue_
boost::thread * check_master_thread_
 Thread used to periodically check for master.
bool connected_
 Are we connected to master?
wxBitmap delete_filter_bitmap_
const int DISCONNECTED_FROM_MASTER_EVENT_
bool enabled_
 Are we enabled?
V_FilterInfo filters_
LoggerLevelFramelogger_level_frame_
uint32_t max_messages_
 Max number of messages to keep around. When we hit this limit, we start throwing away the oldest messages.
uint32_t message_id_counter_
 Counter for generating unique ids for messages.
V_Log message_queue_
 Queue of messages we've received since the last time processMessages() was called.
M_IdToMessage messages_
 Map of id->message.
bool needs_refilter_
 Set to true when we need to refilter our messages (ie. a filter has changed)
ros::NodeHandle nh_
V_u32 ordered_messages_
 Already-filtered messages that are being displayed in the list.
bool pause_
wxTimer * process_timer_
 Timer used to periodically process messages.
const int RECONNECTED_TO_MASTER_EVENT_
float refilter_timer_
 Accumulator used to gate how often we refilter.
RosoutSeverityFilterPtr severity_filter_
bool shutdown_thread_
 Should the thread terminate?
ros::Subscriber sub_
std::string topic_
 The topic we're listening on (or will listen on once we're enabled)

Detailed Description

An embeddable panel which listens on rosout and displays any messages that arrive.

Definition at line 100 of file rosout_panel.h.


Member Typedef Documentation

typedef std::map<uint32_t, rosgraph_msgs::Log::ConstPtr> rxtools::RosoutPanel::M_IdToMessage [protected]

Definition at line 251 of file rosout_panel.h.

typedef std::vector<FilterInfo> rxtools::RosoutPanel::V_FilterInfo [protected]

Definition at line 281 of file rosout_panel.h.

typedef std::vector<rosgraph_msgs::Log::ConstPtr> rxtools::RosoutPanel::V_Log [protected]

Definition at line 262 of file rosout_panel.h.

typedef std::vector<uint32_t> rxtools::RosoutPanel::V_u32 [protected]

Definition at line 271 of file rosout_panel.h.


Constructor & Destructor Documentation

rxtools::RosoutPanel::RosoutPanel ( wxWindow *  parent,
int  id = wxID_ANY,
wxPoint  pos = wxDefaultPosition,
wxSize  size = wxDefaultSize,
int  style = wxTAB_TRAVERSAL 
)

Constructor.

Parameters:
parentThe window which is the parent of this one

Definition at line 58 of file rosout_panel.cpp.

Definition at line 111 of file rosout_panel.cpp.


Member Function Documentation

void rxtools::RosoutPanel::addFilter ( const RosoutFilterPtr filter,
wxWindow *  control 
) [protected]

Definition at line 324 of file rosout_panel.cpp.

void rxtools::RosoutPanel::addMessageToTable ( const rosgraph_msgs::Log::ConstPtr &  message,
uint32_t  id 
) [protected]

Add a message to the table.

Parameters:
messageThe message
idThe unique id of the message

Definition at line 513 of file rosout_panel.cpp.

Definition at line 764 of file rosout_panel.cpp.

Clear all messages.

Definition at line 126 of file rosout_panel.cpp.

Definition at line 434 of file rosout_panel.cpp.

Definition at line 196 of file rosout_panel.cpp.

Definition at line 494 of file rosout_panel.cpp.

bool rxtools::RosoutPanel::filter ( uint32_t  id) const [protected]

Filter a message based on our current filter.

Parameters:
idThe id of the message to filter
Returns:
True of anything in the message matches, false otherwise

Definition at line 531 of file rosout_panel.cpp.

rosgraph_msgs::LogConstPtr rxtools::RosoutPanel::getMessageByIndex ( uint32_t  index) const

Get a message by index in our ordered message list. Used by the list control.

Parameters:
indexIndex of the message to return
Returns:
The message

Definition at line 518 of file rosout_panel.cpp.

Returns a summary of the types of messages that have been received recently.

Parameters:
durationControls how far in the past the function searches for messages
Returns:
a RosoutMessageSummary structure detailing the types of messages received.

Definition at line 720 of file rosout_panel.cpp.

void rxtools::RosoutPanel::incomingMessage ( const rosgraph_msgs::Log::ConstPtr &  message) [protected]

(ros callback) Called when there is a new message waiting

Definition at line 687 of file rosout_panel.cpp.

void rxtools::RosoutPanel::onAddFilterPressed ( wxCommandEvent &  event) [protected]

Definition at line 503 of file rosout_panel.cpp.

void rxtools::RosoutPanel::onClear ( wxCommandEvent &  event) [protected, virtual]

(wx callback) Called when the "Clear" button is pressed

Reimplemented from rxtools::RosoutPanelBase.

Definition at line 508 of file rosout_panel.cpp.

void rxtools::RosoutPanel::onFilterChanged ( const RosoutFilter ) [protected]

Definition at line 442 of file rosout_panel.cpp.

void rxtools::RosoutPanel::onFilterDelete ( wxCommandEvent &  event) [protected]

Definition at line 250 of file rosout_panel.cpp.

void rxtools::RosoutPanel::onFilterEnableChecked ( wxCommandEvent &  event) [protected]

Definition at line 234 of file rosout_panel.cpp.

void rxtools::RosoutPanel::onFilterMoveDown ( wxCommandEvent &  event) [protected]

Definition at line 288 of file rosout_panel.cpp.

void rxtools::RosoutPanel::onFilterMoveUp ( wxCommandEvent &  event) [protected]

Definition at line 265 of file rosout_panel.cpp.

void rxtools::RosoutPanel::onLoggerLevels ( wxCommandEvent &  event) [protected, virtual]

Reimplemented from rxtools::RosoutPanelBase.

Definition at line 217 of file rosout_panel.cpp.

void rxtools::RosoutPanel::onLoggerLevelsClose ( wxCloseEvent &  event) [protected]

Definition at line 211 of file rosout_panel.cpp.

void rxtools::RosoutPanel::onMasterDisconnected ( wxEvent &  event) [protected]

Definition at line 796 of file rosout_panel.cpp.

void rxtools::RosoutPanel::onMasterReconnected ( wxEvent &  event) [protected]

Definition at line 789 of file rosout_panel.cpp.

void rxtools::RosoutPanel::onNewWindow ( wxCommandEvent &  event) [protected, virtual]

Reimplemented from rxtools::RosoutPanelBase.

Definition at line 206 of file rosout_panel.cpp.

void rxtools::RosoutPanel::onPause ( wxCommandEvent &  event) [protected, virtual]

(wx callback) Called when the "Pause" button is pressed

Reimplemented from rxtools::RosoutPanelBase.

Definition at line 695 of file rosout_panel.cpp.

void rxtools::RosoutPanel::onProcessTimer ( wxTimerEvent &  evt) [protected]

(wx callback) Called every 250ms so we can process new messages

Definition at line 474 of file rosout_panel.cpp.

void rxtools::RosoutPanel::onSetup ( wxCommandEvent &  event) [protected, virtual]

(wx callback) Called when the "Setup" button is pressed

Reimplemented from rxtools::RosoutPanelBase.

Definition at line 700 of file rosout_panel.cpp.

void rxtools::RosoutPanel::popMessage ( ) [protected]

Remove The oldest message.

Definition at line 613 of file rosout_panel.cpp.

void rxtools::RosoutPanel::processMessage ( const rosgraph_msgs::Log::ConstPtr &  message) [protected]

Process a log message.

Parameters:
messageThe message to process

Definition at line 643 of file rosout_panel.cpp.

Processes any messages in our message queue.

Definition at line 662 of file rosout_panel.cpp.

Re-filter all messages.

Definition at line 588 of file rosout_panel.cpp.

void rxtools::RosoutPanel::removeFilter ( const RosoutFilterPtr filter) [protected]

Definition at line 418 of file rosout_panel.cpp.

Definition at line 394 of file rosout_panel.cpp.

Set the number of messages to display before we start throwing away old ones.

Parameters:
sizeThe number of messages

Definition at line 711 of file rosout_panel.cpp.

Set this panel to be enabled or not.

When enabled, it will be subscribed to the rosout topic and processing messages. When disabled, it will not.

Parameters:
enabledShould we be enabled?

Definition at line 133 of file rosout_panel.cpp.

void rxtools::RosoutPanel::setMessages ( const M_IdToMessage messages) [protected]

Definition at line 180 of file rosout_panel.cpp.

void rxtools::RosoutPanel::setTopic ( const std::string &  topic)

Set the topic to listen on for rosgraph_msgs::Log messages.

Parameters:
topicThe topic name

Definition at line 166 of file rosout_panel.cpp.

void rxtools::RosoutPanel::subscribe ( ) [protected]

subscribe to our topic

Definition at line 151 of file rosout_panel.cpp.

void rxtools::RosoutPanel::unsubscribe ( ) [protected]

unsubscribe from our topic

Definition at line 161 of file rosout_panel.cpp.

Definition at line 306 of file rosout_panel.cpp.

Definition at line 570 of file rosout_panel.cpp.


Member Data Documentation

Definition at line 278 of file rosout_panel.h.

boost::thread* rxtools::RosoutPanel::check_master_thread_ [protected]

Thread used to periodically check for master.

Definition at line 295 of file rosout_panel.h.

Are we connected to master?

Definition at line 294 of file rosout_panel.h.

Definition at line 286 of file rosout_panel.h.

Definition at line 299 of file rosout_panel.h.

Are we enabled?

Definition at line 257 of file rosout_panel.h.

Definition at line 282 of file rosout_panel.h.

Definition at line 290 of file rosout_panel.h.

Max number of messages to keep around. When we hit this limit, we start throwing away the oldest messages.

Definition at line 274 of file rosout_panel.h.

Counter for generating unique ids for messages.

Definition at line 267 of file rosout_panel.h.

Queue of messages we've received since the last time processMessages() was called.

Definition at line 263 of file rosout_panel.h.

Map of id->message.

Definition at line 269 of file rosout_panel.h.

Set to true when we need to refilter our messages (ie. a filter has changed)

Definition at line 275 of file rosout_panel.h.

Definition at line 260 of file rosout_panel.h.

Already-filtered messages that are being displayed in the list.

Definition at line 272 of file rosout_panel.h.

Definition at line 288 of file rosout_panel.h.

Timer used to periodically process messages.

Definition at line 265 of file rosout_panel.h.

Definition at line 298 of file rosout_panel.h.

Accumulator used to gate how often we refilter.

Definition at line 276 of file rosout_panel.h.

Definition at line 284 of file rosout_panel.h.

Should the thread terminate?

Definition at line 296 of file rosout_panel.h.

Definition at line 279 of file rosout_panel.h.

std::string rxtools::RosoutPanel::topic_ [protected]

The topic we're listening on (or will listen on once we're enabled)

Definition at line 258 of file rosout_panel.h.


The documentation for this class was generated from the following files:


rxtools
Author(s): Josh Faust, Rob Wheeler, Ken Conley
autogenerated on Mon Oct 6 2014 07:25:59