#include <select_service_dialog.h>
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_ |
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.
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.
[in] | datatype | The type of service to search for; if empty, it will show the user a list of all services. |
[in] | parent | The dialog's parent widget. |
Definition at line 114 of file select_service_dialog.cpp.
mapviz::SelectServiceDialog::~SelectServiceDialog | ( | ) | [virtual] |
Definition at line 157 of file select_service_dialog.cpp.
void mapviz::SelectServiceDialog::closeEvent | ( | QCloseEvent * | event | ) | [private] |
Definition at line 308 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 199 of file select_service_dialog.cpp.
void mapviz::SelectServiceDialog::fetchServices | ( | ) | [private, slot] |
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 174 of file select_service_dialog.cpp.
std::vector< std::string > mapviz::SelectServiceDialog::filterServices | ( | ) | [private] |
Definition at line 208 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.
Definition at line 287 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.
[in] | datatype | The type of service to search for; if empty, it will show the user a list of all services. |
[in] | parent | The dialog's parent widget. |
Definition at line 103 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.
[in] | datatype | The type of service to search for. |
Definition at line 281 of file select_service_dialog.cpp.
void mapviz::SelectServiceDialog::timerEvent | ( | QTimerEvent * | event | ) | [private] |
Definition at line 301 of file select_service_dialog.cpp.
void mapviz::SelectServiceDialog::updateDisplayedServices | ( | ) | [private, slot] |
Updates the list of services displayed to the user based on the list of known services and the current filter value.
Definition at line 225 of file select_service_dialog.cpp.
void mapviz::SelectServiceDialog::updateKnownServices | ( | ServiceStringVector | services | ) | [private, slot] |
Sets our list of known services.
Definition at line 193 of file select_service_dialog.cpp.
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.
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 166 of file select_service_dialog.h.