35 from __future__
import division
39 from python_qt_binding.QtCore
import QMargins, Signal
40 from python_qt_binding.QtWidgets
import (
41 QHBoxLayout, QLabel, QSplitter, QVBoxLayout, QWidget
48 from rqt_reconfigure
import logging
56 _TITLE_PLUGIN =
'Dynamic Reconfigure' 59 sig_sysmsg = Signal(str)
60 sig_sysprogress = Signal(str)
63 sig_selected = Signal(str)
67 This class is intended to be called by rqt plugin framework class. 68 Currently (12/12/2012) the whole widget is splitted into 2 panes: 69 one on left allows you to choose the node(s) you work on. Right side 70 pane lets you work with the parameters associated with the node(s) you 73 (12/27/2012) Despite the pkg name is changed to rqt_reconfigure to 74 reflect the available functionality, file & class names remain 75 'param', expecting all the parameters will become handle-able. 88 _hlayout_top = QHBoxLayout(self)
89 _hlayout_top.setContentsMargins(QMargins(0, 0, 0, 0))
93 _vlayout_nodesel_widget = QWidget()
94 _vlayout_nodesel_side = QVBoxLayout()
95 _hlayout_filter_widget = QWidget(self)
96 _hlayout_filter = QHBoxLayout()
103 _hlayout_filter_widget.setLayout(_hlayout_filter)
107 _vlayout_nodesel_side.addWidget(_hlayout_filter_widget)
109 _vlayout_nodesel_side.setSpacing(1)
110 _vlayout_nodesel_widget.setLayout(_vlayout_nodesel_side)
114 self._splitter.insertWidget(0, _vlayout_nodesel_widget)
115 self._splitter.insertWidget(1, reconf_widget)
118 self._splitter.setStretchFactor(0, 0)
119 self._splitter.setStretchFactor(1, 1)
122 reconf_widget.sig_node_disabled_selected.connect(
123 self._nodesel_widget.node_deselected
126 self._nodesel_widget.sig_node_selected.connect(
127 reconf_widget.show_reconf
134 self.setObjectName(title)
137 self._text_filter.filter_changed_signal.connect(
142 self.sig_selected.connect(self._nodesel_widget.node_selected)
143 for rn
in [rospy.resolve_name(c)
for c
in context.argv()]:
144 if rn
in self._nodesel_widget.get_paramitems():
145 self.sig_selected.emit(rn)
148 "Could not find a dynamic reconfigure client named '%s'",
158 instance_settings.set_value(
'splitter', self._splitter.saveState())
161 if instance_settings.contains(
'splitter'):
162 self._splitter.restoreState(instance_settings.value(
'splitter'))
164 self._splitter.setSizes([100, 100, 200])
170 return self.filter_lineedit.text()
178 self.sig_sysmsg.emit(msg_str)
181 if __name__ ==
'__main__':
187 sys.exit(main.main(sys.argv, standalone=
'rqt_reconfigure'))