Public Member Functions | Static Public Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
mapviz::SelectServiceDialog Class Reference

#include <select_service_dialog.h>

Inheritance diagram for mapviz::SelectServiceDialog:
Inheritance graph
[legend]

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< ServiceUpdaterThreadworker_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 109 of file select_service_dialog.cpp.

mapviz::SelectServiceDialog::~SelectServiceDialog ( )
virtual

Definition at line 152 of file select_service_dialog.cpp.

Member Function Documentation

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

Definition at line 303 of file select_service_dialog.cpp.

void mapviz::SelectServiceDialog::displayUpdateError ( const QString  error_msg)
privateslot

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

Definition at line 194 of file select_service_dialog.cpp.

void mapviz::SelectServiceDialog::fetchServices ( )
privateslot

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 169 of file select_service_dialog.cpp.

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

Definition at line 203 of file select_service_dialog.cpp.

std::string mapviz::SelectServiceDialog::selectedService ( ) const

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

Returns
The selected service.

Definition at line 282 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 98 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 276 of file select_service_dialog.cpp.

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

Definition at line 296 of file select_service_dialog.cpp.

void mapviz::SelectServiceDialog::updateDisplayedServices ( )
privateslot

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

Definition at line 220 of file select_service_dialog.cpp.

void mapviz::SelectServiceDialog::updateKnownServices ( ServiceStringVector  services)
privateslot

Sets our list of known services.

Definition at line 188 of file select_service_dialog.cpp.

Member Data Documentation

std::string mapviz::SelectServiceDialog::allowed_datatype_
private

Definition at line 155 of file select_service_dialog.h.

QPushButton* mapviz::SelectServiceDialog::cancel_button_
private

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.

int mapviz::SelectServiceDialog::fetch_services_timer_id_
private

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.

QListWidget* mapviz::SelectServiceDialog::list_widget_
private

Definition at line 162 of file select_service_dialog.h.

QLineEdit* mapviz::SelectServiceDialog::name_filter_
private

Definition at line 163 of file select_service_dialog.h.

ros::NodeHandle mapviz::SelectServiceDialog::nh_
private

Definition at line 153 of file select_service_dialog.h.

QPushButton* mapviz::SelectServiceDialog::ok_button_
private

Definition at line 164 of file select_service_dialog.h.

boost::shared_ptr<ServiceUpdaterThread> mapviz::SelectServiceDialog::worker_thread_
private

Definition at line 165 of file select_service_dialog.h.


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


mapviz
Author(s): Marc Alban
autogenerated on Fri Mar 19 2021 02:44:25