Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 import os
00034
00035 from python_qt_binding import loadUi
00036 from python_qt_binding.QtWidgets import QDialog
00037
00038 from rqt_logger_level.logger_level_widget import LoggerLevelWidget
00039 from rqt_logger_level.logger_level_service_caller import LoggerLevelServiceCaller
00040
00041
00042 class ConsoleSettingsDialog(QDialog):
00043 """
00044 Dialog to change the subscribed topic and alter the message buffer size.
00045 """
00046 def __init__(self, topics, rospack):
00047 """
00048 :param topics: list of topics to allow switching, ''list of string''
00049 :param limit: displayed in the message buffer size spin box, ''int''
00050 """
00051 super(ConsoleSettingsDialog, self).__init__()
00052 ui_file = os.path.join(rospack.get_path('rqt_console'), 'resource', 'console_settings_dialog.ui')
00053 loadUi(ui_file, self)
00054 for topic in topics:
00055 self.topic_combo.addItem(topic[0] + ' (' + topic[1] + ')', topic[0])
00056
00057 self._service_caller = LoggerLevelServiceCaller()
00058 self._logger_widget = LoggerLevelWidget(self._service_caller)
00059 self.levelsLayout.addWidget(self._logger_widget)
00060 self.adjustSize()
00061
00062 def query(self, topic, buffer_size):
00063 index = self.topic_combo.findData(topic)
00064 if index != -1:
00065 self.topic_combo.setCurrentIndex(index)
00066 self.buffer_size_spin.setValue(buffer_size)
00067 ok = self.exec_()
00068 if ok == 1:
00069 index = self.topic_combo.currentIndex()
00070 if index != -1:
00071 topic = self.topic_combo.itemData(index)
00072 buffer_size = self.buffer_size_spin.value()
00073 return topic, buffer_size