Public Member Functions | Static Public Member Functions | Private Slots | Private Member Functions | Private Attributes
mapviz::SelectServiceDialog Class Reference

#include <select_service_dialog.h>

List of all members.

Public Member Functions

std::string selectedService () const
 SelectServiceDialog (const std::string &datatype="", QWidget *parent=0)
void setDatatypeFilter (const std::string &datatype)
virtual ~SelectServiceDialog ()

Static Public Member Functions

static std::string selectService (const std::string &datatype, QWidget *parent=0)

Private Slots

void displayUpdateError (const QString)
void fetchServices ()
void updateDisplayedServices ()
void updateKnownServices (ServiceStringVector services)

Private Member Functions

void closeEvent (QCloseEvent *)
std::vector< std::string > filterServices ()
void timerEvent (QTimerEvent *)

Private Attributes

std::string allowed_datatype_
QPushButton * cancel_button_
std::vector< std::string > displayed_services_
int fetch_services_timer_id_
std::vector< std::string > known_services_
QListWidget * list_widget_
QLineEdit * name_filter_
ros::NodeHandle nh_
QPushButton * ok_button_
boost::shared_ptr
< ServiceUpdaterThread
worker_thread_

Detailed Description

Provides a dialog that the user can use to either list all known ROS services or all ROS services that handle a particular type.

Definition at line 87 of file select_service_dialog.h.


Constructor & Destructor Documentation

mapviz::SelectServiceDialog::SelectServiceDialog ( const std::string &  datatype = "",
QWidget *  parent = 0 
)

Constructs a new SelectServiceDialog and automatically starts a timer that will refresh the list of services every 5 seconds.

Parameters:
[in]datatypeThe type of service to search for; if empty, it will show the user a list of all services.
[in]parentThe dialog's parent widget.

Definition at line 110 of file select_service_dialog.cpp.

Definition at line 153 of file select_service_dialog.cpp.


Member Function Documentation

void mapviz::SelectServiceDialog::closeEvent ( QCloseEvent *  event) [private]

Definition at line 304 of file select_service_dialog.cpp.

void mapviz::SelectServiceDialog::displayUpdateError ( const QString  error_msg) [private, slot]

Displays a message box indicating that there was an error and stops our update timer.

Definition at line 195 of file select_service_dialog.cpp.

If no worker thread is currently active, this will start a worker thread that will fetch all of the services matching the known data type.

Definition at line 170 of file select_service_dialog.cpp.

std::vector< std::string > mapviz::SelectServiceDialog::filterServices ( ) [private]

Definition at line 204 of file select_service_dialog.cpp.

Gets the service the user had selected, or an empty string if there was none.

Returns:
The selected service.

Definition at line 283 of file select_service_dialog.cpp.

std::string mapviz::SelectServiceDialog::selectService ( const std::string &  datatype,
QWidget *  parent = 0 
) [static]

Convenience function for creating a dialog that will prompt the user to select a service and then return the value. If no service was selected, the returned value will be empty.

Parameters:
[in]datatypeThe type of service to search for; if empty, it will show the user a list of all services.
[in]parentThe dialog's parent widget.
Returns:
The name of the selected service, or an empty string if there was none.

Definition at line 99 of file select_service_dialog.cpp.

void mapviz::SelectServiceDialog::setDatatypeFilter ( const std::string &  datatype)

Set a datatype filter to limit displayed topics based on their types. If the vector is empty (default), the dialog will display all available topics.

Parameters:
[in]datatypeThe type of service to search for.

Definition at line 277 of file select_service_dialog.cpp.

void mapviz::SelectServiceDialog::timerEvent ( QTimerEvent *  event) [private]

Definition at line 297 of file select_service_dialog.cpp.

Updates the list of services displayed to the user based on the list of known services and the current filter value.

Definition at line 221 of file select_service_dialog.cpp.

Sets our list of known services.

Definition at line 189 of file select_service_dialog.cpp.


Member Data Documentation

Definition at line 155 of file select_service_dialog.h.

Definition at line 161 of file select_service_dialog.h.

std::vector<std::string> mapviz::SelectServiceDialog::displayed_services_ [private]

Definition at line 156 of file select_service_dialog.h.

Definition at line 159 of file select_service_dialog.h.

std::vector<std::string> mapviz::SelectServiceDialog::known_services_ [private]

Definition at line 157 of file select_service_dialog.h.

Definition at line 162 of file select_service_dialog.h.

Definition at line 163 of file select_service_dialog.h.

Definition at line 153 of file select_service_dialog.h.

Definition at line 164 of file select_service_dialog.h.

Definition at line 166 of file select_service_dialog.h.


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


mapviz
Author(s): Marc Alban
autogenerated on Thu Aug 24 2017 02:45:59