Example #1
0
    def __init__(self, map_topic='/map',
                 paths=['/move_base/NavFn/plan', '/move_base/TrajectoryPlannerROS/local_plan'],
                 polygons=['/move_base/local_costmap/robot_footprint']):
        super(NavViewWidget, self).__init__()
        self._layout = QVBoxLayout()
        self._button_layout = QHBoxLayout()

        self.setAcceptDrops(True)
        self.setWindowTitle('Navigation Viewer')

        self.paths = paths
        self.polygons = polygons
        self.map = map_topic
        self._tf = tf.TransformListener()

        self._nav_view = NavView(map_topic, paths, polygons, tf = self._tf, parent = self)

        self._set_pose = QPushButton('Set Pose')
        self._set_pose.clicked.connect(self._nav_view.pose_mode)
        self._set_goal = QPushButton('Set Goal')
        self._set_goal.clicked.connect(self._nav_view.goal_mode)

        self._button_layout.addWidget(self._set_pose)
        self._button_layout.addWidget(self._set_goal)

        self._layout.addLayout(self._button_layout)

        self._layout.addWidget(self._nav_view)

        self.setLayout(self._layout)
Example #2
0
    def __init__(self):
        super(CalibrationMovementsGUI, self).__init__()
        move_group_name = rospy.get_param('~move_group', 'manipulator')
        self.angle_delta = math.radians(
            rospy.get_param('~rotation_delta_degrees', 25))
        self.translation_delta = rospy.get_param('~translation_delta_meters',
                                                 0.1)
        max_velocity_scaling = rospy.get_param('~max_velocity_scaling', 0.5)
        max_acceleration_scaling = rospy.get_param('~max_acceleration_scaling',
                                                   0.5)
        self.local_mover = CalibrationMovements(move_group_name,
                                                max_velocity_scaling,
                                                max_acceleration_scaling)
        self.current_pose = -1
        self.current_plan = None
        self.state = CalibrationMovementsGUI.NOT_INITED_YET

        self.layout = QVBoxLayout()
        self.labels_layout = QHBoxLayout()
        self.buttons_layout = QHBoxLayout()

        self.progress_bar = QProgressBar()
        self.pose_number_lbl = QLabel('0/8')
        self.bad_plan_lbl = QLabel('No plan yet')
        self.guide_lbl = QLabel('Hello')
        self.guide_lbl.setWordWrap(True)

        self.check_start_pose_btn = QPushButton('Check starting pose')
        self.check_start_pose_btn.clicked.connect(
            self.handle_check_current_state)

        self.next_pose_btn = QPushButton('Next Pose')
        self.next_pose_btn.clicked.connect(self.handle_next_pose)

        self.plan_btn = QPushButton('Plan')
        self.plan_btn.clicked.connect(self.handle_plan)

        self.execute_btn = QPushButton('Execute')
        self.execute_btn.clicked.connect(self.handle_execute)

        self.labels_layout.addWidget(self.pose_number_lbl)
        self.labels_layout.addWidget(self.bad_plan_lbl)

        self.buttons_layout.addWidget(self.check_start_pose_btn)
        self.buttons_layout.addWidget(self.next_pose_btn)
        self.buttons_layout.addWidget(self.plan_btn)
        self.buttons_layout.addWidget(self.execute_btn)

        self.layout.addWidget(self.progress_bar)
        self.layout.addLayout(self.labels_layout)
        self.layout.addWidget(self.guide_lbl)
        self.layout.addLayout(self.buttons_layout)

        self.setLayout(self.layout)

        self.plan_btn.setEnabled(False)
        self.execute_btn.setEnabled(False)

        self.setWindowTitle('Local Mover')
        self.show()
    def __init__(self, parent=None, current_values=None):
        super(BlacklistDialog, self).__init__(parent)
        self.setWindowTitle("Blacklist")
        vbox = QVBoxLayout()
        self.setLayout(vbox)

        self._blacklist = Blacklist()
        if isinstance(current_values, list):
            for val in current_values:
                self._blacklist.append(val)
        vbox.addWidget(self._blacklist)

        controls_layout = QHBoxLayout()
        add_button = QPushButton(icon=QIcon.fromTheme('list-add'))
        rem_button = QPushButton(icon=QIcon.fromTheme('list-remove'))
        ok_button = QPushButton("Ok")
        cancel_button = QPushButton("Cancel")
        add_button.clicked.connect(self._add_item)
        rem_button.clicked.connect(self._remove_item)
        ok_button.clicked.connect(self.accept)
        cancel_button.clicked.connect(self.reject)

        controls_layout.addWidget(add_button)
        controls_layout.addWidget(rem_button)
        controls_layout.addStretch(0)
        controls_layout.addWidget(ok_button)
        controls_layout.addWidget(cancel_button)
        vbox.addLayout(controls_layout)
Example #4
0
    def __init__(self, context):
        super(EusGUI, self).__init__(context)
        # Give QObjects reasonable names
        self.setObjectName('EusGUI')
        self.msg = None
        # Create a container widget and give it a layout
        self._toolbar = QToolBar()
        self._toolbar.addWidget(QLabel('EusGUI'))
        self._container = QWidget()
        self._layout    = QVBoxLayout()
        self._container.setLayout(self._layout)
        
        self._layout.addWidget(self._toolbar)
        
        self._prev_button = QPushButton('PREV')
        self._prev_button.clicked.connect(self._prev_cb)
        self._layout.addWidget(self._prev_button)
        
        self._refresh_button = QPushButton('DO IT AGAIN')
        self._refresh_button.clicked.connect(self._refresh_cb)
        self._layout.addWidget(self._refresh_button)

        self._next_button = QPushButton('NEXT')
        self._next_button.clicked.connect(self._next_cb)
        self._layout.addWidget(self._next_button)
        context.add_widget(self._container)
Example #5
0
 def _create_buttons(self):
     # create the buttons line
     self.buttons = QWidget(self)
     self.horizontalLayout = QHBoxLayout(self.buttons)
     self.horizontalLayout.setContentsMargins(4, 0, 4, 0)
     self.horizontalLayout.setObjectName("horizontalLayout")
     # add the search button
     self.searchButton = QPushButton(self)
     self.searchButton.setObjectName("searchButton")
     #        self.searchButton.clicked.connect(self.on_shortcut_find)
     self.searchButton.toggled.connect(self.on_toggled_find)
     self.searchButton.setText(self._translate("&Find"))
     self.searchButton.setToolTip('Open a search dialog (Ctrl+F)')
     self.searchButton.setFlat(True)
     self.searchButton.setCheckable(True)
     self.horizontalLayout.addWidget(self.searchButton)
     # add the replace button
     self.replaceButton = QPushButton(self)
     self.replaceButton.setObjectName("replaceButton")
     #        self.replaceButton.clicked.connect(self.on_shortcut_replace)
     self.replaceButton.toggled.connect(self.on_toggled_replace)
     self.replaceButton.setText(self._translate("&Replace"))
     self.replaceButton.setToolTip('Open a search&replace dialog (Ctrl+R)')
     self.replaceButton.setFlat(True)
     self.replaceButton.setCheckable(True)
     self.horizontalLayout.addWidget(self.replaceButton)
     # add the goto button
     self.gotoButton = QPushButton(self)
     self.gotoButton.setObjectName("gotoButton")
     self.gotoButton.clicked.connect(self.on_shortcut_goto)
     self.gotoButton.setText(self._translate("&Goto line"))
     self.gotoButton.setShortcut("Ctrl+G")
     self.gotoButton.setToolTip('Open a goto dialog (Ctrl+G)')
     self.gotoButton.setFlat(True)
     self.horizontalLayout.addWidget(self.gotoButton)
     # add a tag button
     self.tagButton = self._create_tag_button(self)
     self.horizontalLayout.addWidget(self.tagButton)
     # add spacer
     spacerItem = QSpacerItem(515, 20, QSizePolicy.Expanding,
                              QSizePolicy.Minimum)
     self.horizontalLayout.addItem(spacerItem)
     # add line number label
     self.pos_label = QLabel()
     self.horizontalLayout.addWidget(self.pos_label)
     # add spacer
     spacerItem = QSpacerItem(515, 20, QSizePolicy.Expanding,
                              QSizePolicy.Minimum)
     self.horizontalLayout.addItem(spacerItem)
     # add save button
     self.saveButton = QPushButton(self)
     self.saveButton.setObjectName("saveButton")
     self.saveButton.clicked.connect(self.on_saveButton_clicked)
     self.saveButton.setText(self._translate("&Save"))
     self.saveButton.setShortcut("Ctrl+S")
     self.saveButton.setToolTip('Save the changes to the file (Ctrl+S)')
     self.saveButton.setFlat(True)
     self.horizontalLayout.addWidget(self.saveButton)
     return self.buttons
    def __init__(self):
        super(CalibrationMovementsGUI, self).__init__()
        self.handeye_client = HandeyeClient()
        self.current_target_pose = -1  # -1 is home
        self.target_poses = None
        self.plan_was_successful = None
        self.state = CalibrationMovementsGUI.NOT_INITED_YET

        self.layout = QVBoxLayout()
        self.labels_layout = QHBoxLayout()
        self.buttons_layout = QHBoxLayout()

        self.progress_bar = QProgressBar()
        self.pose_number_lbl = QLabel('0/0')
        self.bad_plan_lbl = QLabel('No plan yet')
        self.bad_plan_lbl.setAlignment(Qt.AlignCenter)
        self.guide_lbl = QLabel('Hello')
        self.guide_lbl.setWordWrap(True)

        self.check_start_pose_btn = QPushButton('Check starting pose')
        self.check_start_pose_btn.clicked.connect(
            self.handle_check_current_state)

        self.next_pose_btn = QPushButton('Next Pose')
        self.next_pose_btn.clicked.connect(self.handle_next_pose)

        self.plan_btn = QPushButton('Plan')
        self.plan_btn.clicked.connect(self.handle_plan)

        self.execute_btn = QPushButton('Execute')
        self.execute_btn.clicked.connect(self.handle_execute)

        self.labels_layout.addWidget(self.pose_number_lbl)
        self.labels_layout.addWidget(self.bad_plan_lbl)

        self.buttons_layout.addWidget(self.check_start_pose_btn)
        self.buttons_layout.addWidget(self.next_pose_btn)
        self.buttons_layout.addWidget(self.plan_btn)
        self.buttons_layout.addWidget(self.execute_btn)

        self.layout.addWidget(self.progress_bar)
        self.layout.addLayout(self.labels_layout)
        self.layout.addWidget(self.guide_lbl)
        self.layout.addLayout(self.buttons_layout)

        self.setLayout(self.layout)

        self.plan_btn.setEnabled(False)
        self.execute_btn.setEnabled(False)

        self.setWindowTitle('Local Mover')
        self.show()
    def setup_group_frame(self, group):
        layout = QVBoxLayout()

        # grid for buttons for named targets
        grid = QGridLayout()
        grid.setSpacing(1)

        self.button_group = QButtonGroup(self)

        row = 0
        column = 0
        named_targets = self.get_named_targets(group)
        for target in named_targets:
            button = QPushButton(target)
            self.button_group.addButton(button)
            grid.addWidget(button, row, column)
            column += 1
            if column >= self.MAX_COLUMNS:
                row += 1
                column = 0

        self.button_group.buttonClicked.connect(self._handle_button_clicked)

        # grid for show joint value and move arm buttons/text field
        joint_values_grid = QGridLayout()
        joint_values_grid.setSpacing(1)

        button_show_joint_values = QPushButton('Current Joint Values')
        button_show_joint_values.clicked[bool].connect(
            self._handle_show_joint_values_clicked)

        line_edit = QLineEdit()
        self.text_joint_values.append(line_edit)

        button_move_to = QPushButton('Move to')
        button_move_to.clicked[bool].connect(self._handle_move_to_clicked)

        joint_values_grid.addWidget(button_show_joint_values, 0, 1)
        joint_values_grid.addWidget(line_edit, 0, 2)
        joint_values_grid.addWidget(button_move_to, 0, 3)

        layout.addLayout(grid)
        line = QFrame()
        line.setFrameShape(QFrame.HLine)
        line.setFrameShadow(QFrame.Sunken)
        layout.addWidget(line)
        layout.addLayout(joint_values_grid)

        frame = QFrame()
        frame.setLayout(layout)
        return frame
Example #8
0
    def __init__(self, context):
        super(ImageSnapShotGUI, self).__init__(context)
        # Give QObjects reasonable names
        self.setObjectName('ImageSnapShotGUI')

        # Process standalone plugin command-line arguments
        from argparse import ArgumentParser
        parser = ArgumentParser()
        # Add argument(s) to the parser.
        parser.add_argument("-q", "--quiet", action="store_true",
                            dest="quiet",
                            help="Put plugin in silent mode")
        args, unknowns = parser.parse_known_args(context.argv())
        self._toolbar = QToolBar()
        self._toolbar.addWidget(QLabel('ImageSnapShot'))

        # Create a container widget and give it a layout
        self._container = QWidget()
        self._layout    = QVBoxLayout()
        self._container.setLayout(self._layout)
        self._layout.addWidget(self._toolbar)

        # Add a button for ....
        self._go_button = QPushButton('Head')
        self._go_button.clicked.connect(self._head)
        self._layout.addWidget(self._go_button)

        self._clear_button = QPushButton('Larm')
        self._clear_button.clicked.connect(self._larm)
        self._layout.addWidget(self._clear_button)

        self._clear_button = QPushButton('Rarm')
        self._clear_button.clicked.connect(self._rarm)
        self._layout.addWidget(self._clear_button)

        self._clear_button = QPushButton('L FishEye')
        self._clear_button.clicked.connect(self._lfisheye)
        self._layout.addWidget(self._clear_button)

        self._clear_button = QPushButton('R FishEye')
        self._clear_button.clicked.connect(self._rfisheye)
        self._layout.addWidget(self._clear_button)

        # self._step_run_button.setStyleSheet('QPushButton {color: black}')
        context.add_widget(self._container)

        self._head_pub = rospy.Publisher('/head_snap/snapshot', std_msgs.msg.Empty)
        self._lhand_pub = rospy.Publisher('/lhand_snap/snapshot', std_msgs.msg.Empty)
        self._rhand_pub = rospy.Publisher('/rhand_snap/snapshot', std_msgs.msg.Empty)
        self._lfisheye_pub = rospy.Publisher('/lfisheye_snap/snapshot', std_msgs.msg.Empty)
        self._rfisheye_pub = rospy.Publisher('/rfisheye_snap/snapshot', std_msgs.msg.Empty)
Example #9
0
 def add_command_button(self, parent, text, command):
     button = QPushButton(text)
     self.command_mapper.setMapping(button, command)
     button.clicked.connect(self.command_mapper.map)
     parent.addWidget(button)
     self.command_buttons.append(button)
     return button
    def __init__(self,
                 icon,
                 title,
                 text,
                 detailed_text="",
                 buttons=QMessageBox.Ok):
        QMessageBox.__init__(self, icon, title, text, buttons)
        if detailed_text:
            self.setDetailedText(detailed_text)
            horizontalSpacer = QSpacerItem(480, 0, QSizePolicy.Minimum,
                                           QSizePolicy.Expanding)
            layout = self.layout()
            layout.addItem(horizontalSpacer, layout.rowCount(), 0, 1,
                           layout.columnCount())

        if QMessageBox.Abort & buttons:
            self.setEscapeButton(QMessageBox.Abort)
        elif QMessageBox.Ignore & buttons:
            self.setEscapeButton(QMessageBox.Ignore)
        else:
            self.setEscapeButton(buttons)

        self.textEdit = textEdit = self.findChild(QTextEdit)
        if textEdit is not None:
            textEdit.setMinimumHeight(0)
            textEdit.setMaximumHeight(600)
            textEdit.setMinimumWidth(0)
            textEdit.setMaximumWidth(600)
            textEdit.setSizePolicy(QSizePolicy.Expanding,
                                   QSizePolicy.Expanding)

        self.ignore_all_btn = QPushButton('Don\'t display again')
        self.addButton(self.ignore_all_btn, QMessageBox.HelpRole)
Example #11
0
    def __init__(self):
        super(TopicSelection, self).__init__()
        master = rosgraph.Master('rqt_bag_recorder')
        self.setWindowTitle("Select the topics you want to record")
        self.resize(500, 700)

        self.topic_list = []
        self.selected_topics = []
        self.items_list = []

        self.area = QScrollArea(self)
        self.main_widget = QWidget(self.area)
        self.ok_button = QPushButton("Record", self)
        self.ok_button.clicked.connect(self.onButtonClicked)
        self.ok_button.setEnabled(False)

        self.main_vlayout = QVBoxLayout(self)
        self.main_vlayout.addWidget(self.area)
        self.main_vlayout.addWidget(self.ok_button)
        self.setLayout(self.main_vlayout)

        self.selection_vlayout = QVBoxLayout(self)
        self.item_all = QCheckBox("All", self)
        self.item_all.stateChanged.connect(self.updateList)
        self.selection_vlayout.addWidget(self.item_all)
        topic_data_list = master.getPublishedTopics('')
        topic_data_list.sort()
        for topic, datatype in topic_data_list:
            self.addCheckBox(topic)

        self.main_widget.setLayout(self.selection_vlayout)

        self.area.setWidget(self.main_widget)
        self.show()
Example #12
0
    def __init__(self, context, actions):
        super(ActionClientContainerWidget, self).__init__()

        grid = QGridLayout()
        grid.setSpacing(1)

        MAX_COLUMNS = 2

        self.setObjectName('ActionClientContainerWidget')

        self.clear_button = QPushButton("Clear all")
        self.clear_button.clicked[bool].connect(self._handle_clear_clicked)
        grid.addWidget(self.clear_button, 0, 0)

        self.widgets = []

        row = 1
        column = 0
        for k in sorted(actions.keys()):
            action_name = k
            widget = ActionClientWidget(context, action_name, actions[k])
            grid.addWidget(widget, row, column)
            self.widgets.append(widget)
            column += 1
            if column >= MAX_COLUMNS:
                row += 1
                column = 0

        self.setLayout(grid)
Example #13
0
 def _create_log_bar(self):
     self.log_dock = QDockWidget(self)
     self.log_dock.setObjectName('LogFrame')
     self.log_dock.setFeatures(QDockWidget.DockWidgetMovable | QDockWidget.DockWidgetFloatable)
     self.log_bar = QWidget(self)
     self.horizontal_layout_log_bar = QHBoxLayout(self.log_bar)
     self.horizontal_layout_log_bar.setContentsMargins(2, 0, 2, 0)
     self.horizontal_layout_log_bar.setObjectName("horizontal_layout_log_bar")
     # add info label
     self._log_warning_count = 0
     self.log_browser = QTextEdit()
     self.log_browser.setObjectName("log_browser")
     self.log_browser.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
     self.log_browser.setLineWrapMode(QTextEdit.NoWrap)
     # self.log_browser.setMaximumHeight(120)
     color = QColor(255, 255, 235)
     bg_style = "QTextEdit#log_browser { background-color: %s;}" % color.name()
     self.log_bar.setStyleSheet("%s" % (bg_style))
     self.horizontal_layout_log_bar.addWidget(self.log_browser)
     # add hide button
     self.clear_log_button = QPushButton("clear", self)
     self.clear_log_button.setObjectName("clear_log_button")
     self.clear_log_button.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Maximum)
     self.clear_log_button.clicked.connect(self.on_clear_log_button_clicked)
     self.clear_log_button.setFlat(True)
     self.horizontal_layout_log_bar.addWidget(self.clear_log_button)
     self.log_dock.setWidget(self.log_bar)
     return self.log_dock
Example #14
0
    def loadThrusters(self):
        # Loop over all of the thruster values found in the params
        for i in range(0, len(self.names)):
            # Add a button to a list so we can mess with it later
            self.thrusterButtons.append(QPushButton(self.names[i]['name']))
            # Modify setting of the button
            self.thrusterButtons[i].setCheckable(True)

            # Save the callbacks in a list
            self.thrusterCallbacks[self.names[i]['name']] = \
                getattr(self, '_handle_thruster' + str(i))

            # Connect the callback to the button's toggle event
            self.thrusterButtons[i].toggled[bool].connect(
                    self.thrusterCallbacks[self.names[i]['name']])

            # Add the button to the Ui
            self._widget.thrusterButtons.addWidget(self.thrusterButtons[i])


            # Get the orientation
            self.thrusterScales.append(0)
            for v in self.names[i]['orientation'].values():
                self.thrusterScales[i] = self.thrusterScales[i] + v

            # Append a value to the thruster message for this button
            self.thrusterMessage.data.append(0.0)
        print self.thrusterScales
    def __init__(self, parent=None, logger=Logger()):
        QWidgetWithLogger.__init__(self, parent, logger)

        # start widget
        hbox = QHBoxLayout()
        hbox.setMargin(0)
        hbox.setContentsMargins(0, 0, 0, 0)

        # get system icon
        icon = QIcon.fromTheme("view-refresh")
        size = icon.actualSize(QSize(32, 32))

        # add combo box
        self.parameter_set_names_combo_box = QComboBox()
        self.parameter_set_names_combo_box.currentIndexChanged[str].connect(
            self.param_changed)
        hbox.addWidget(self.parameter_set_names_combo_box)

        # add refresh button
        self.get_all_parameter_set_names_button = QPushButton()
        self.get_all_parameter_set_names_button.clicked.connect(
            self._get_all_parameter_set_names)

        self.get_all_parameter_set_names_button.setIcon(icon)
        self.get_all_parameter_set_names_button.setFixedSize(
            size.width() + 2,
            size.height() + 2)

        hbox.addWidget(self.get_all_parameter_set_names_button)

        # end widget
        self.setLayout(hbox)

        # init widget
        self.reset_parameter_set_selection()
Example #16
0
    def __init__(self, context):
        super(SpectrogramPlugin, self).__init__(context)
        self.setObjectName('Spectrogram')

        self._widget = QWidget()
        layout = QVBoxLayout()
        self._widget.setLayout(layout)

        layout_ = QHBoxLayout()
        self.line_edit = QLineEdit()
        layout_.addWidget(self.line_edit)
        self.apply_btn = QPushButton("Apply")
        self.apply_btn.clicked.connect(self.apply_clicked)
        layout_.addWidget(self.apply_btn)
        layout.addLayout(layout_)

        self.fig = Figure((5, 4), dpi=100)
        self.canvas = FigureCanvas(self.fig)
        self.axes = self.fig.add_subplot(111)
        self.fig.tight_layout()

        layout.addWidget(self.canvas)

        context.add_widget(self._widget)

        self.update_signal.connect(self.update_spectrogram)
        self.subscriber_signal.connect(self.update_subscriber)

        self.subscriber_signal.emit('spec')
Example #17
0
    def __init__(self):
        super(NodeWidgetsContainer, self).__init__()

        yaml_file = rospy.get_param("~config_file")

        stream = open(yaml_file, "r")
        nodes = yaml.load(stream)

        rp = rospkg.RosPack()
        ui_file = os.path.join(rp.get_path('mcr_event_gui'), 'ros',
                               'resources', 'NodeWidgetsContainer.ui')
        loadUi(ui_file, self)

        grid = QGridLayout()
        grid.setSpacing(1)

        MAX_COLUMNS = 2

        self.setObjectName('NodeWidgetsContainer')

        self.clear_button = QPushButton("Clear all")
        self.clear_button.clicked[bool].connect(self._handle_clear_clicked)
        self.stop_button = QPushButton("Stop all")
        self.stop_button.clicked[bool].connect(self._handle_stop_clicked)
        grid.addWidget(self.clear_button, 0, 0)
        grid.addWidget(self.stop_button, 0, 1)

        self.widgets = []

        row = 1
        column = 0
        for k in sorted(nodes.keys()):
            node_name = k
            widget = NodeEventsWidget(node_name, nodes[k])
            width = widget.width()
            height = widget.height()
            grid.addWidget(widget, row, column)
            grid.setColumnMinimumWidth(column, width)
            grid.setRowMinimumHeight(row, height)
            self.widgets.append(widget)
            column += 1
            if column >= MAX_COLUMNS:
                row += 1
                column = 0

        self.setLayout(grid)
    def __init__(self, masteruri, cfg, ns, nodes, parent=None):
        QFrame.__init__(self, parent)
        self._masteruri = masteruri
        self._nodes = {cfg: {ns: nodes}}
        frame_layout = QVBoxLayout(self)
        frame_layout.setContentsMargins(0, 0, 0, 0)
        # create frame for warning label
        self.warning_frame = warning_frame = QFrame(self)
        warning_layout = QHBoxLayout(warning_frame)
        warning_layout.setContentsMargins(0, 0, 0, 0)
        warning_layout.addItem(
            QSpacerItem(0, 0, QSizePolicy.Expanding, QSizePolicy.Expanding))
        self.warning_label = QLabel()
        icon = nm.settings().icon('crystal_clear_warning.png')
        self.warning_label.setPixmap(icon.pixmap(QSize(40, 40)))
        self.warning_label.setToolTip(
            'Multiple configuration for same node found!\nA first one will be selected for the start a node!'
        )
        warning_layout.addWidget(self.warning_label)
        warning_layout.addItem(
            QSpacerItem(0, 0, QSizePolicy.Expanding, QSizePolicy.Expanding))
        frame_layout.addItem(
            QSpacerItem(0, 0, QSizePolicy.Expanding, QSizePolicy.Expanding))
        frame_layout.addWidget(warning_frame)
        # create frame for start/stop buttons
        buttons_frame = QFrame()
        buttons_layout = QHBoxLayout(buttons_frame)
        buttons_layout.setContentsMargins(0, 0, 0, 0)
        buttons_layout.addItem(QSpacerItem(20, 20))
        self.on_button = QPushButton()
        self.on_button.setFlat(False)
        self.on_button.setText("On")
        self.on_button.clicked.connect(self.on_on_clicked)
        buttons_layout.addWidget(self.on_button)

        self.off_button = QPushButton()
        self.off_button.setFlat(True)
        self.off_button.setText("Off")
        self.off_button.clicked.connect(self.on_off_clicked)
        buttons_layout.addWidget(self.off_button)
        buttons_layout.addItem(QSpacerItem(20, 20))
        frame_layout.addWidget(buttons_frame)
        frame_layout.addItem(
            QSpacerItem(0, 0, QSizePolicy.Expanding, QSizePolicy.Expanding))
        self.warning_frame.setVisible(False)
Example #19
0
 def _create_tag_button(self, parent=None):
     btn = QPushButton(parent)
     btn.setObjectName("tagButton")
     btn.setText(self._translate("Add &tag"))
     btn.setShortcut("Ctrl+T")
     btn.setToolTip('Adds a ROS launch tag to launch file (Ctrl+T)')
     btn.setMenu(self._create_tag_menu(btn))
     btn.setFlat(True)
     return btn
    def __init__(self, updater, config):
        self.updater = ApplyGroup.ApplyUpdater(updater)
        super(ApplyGroup, self).__init__(self.updater, config)

        self.button = QPushButton("Apply %s" % self.name)
        self.button.clicked.connect(self.updater.apply_update)

        rows = self.grid.rowCount()
        self.grid.addWidget(self.button, rows + 1, 1, Qt.AlignRight)
    def initUI(self):
        self.layout = QVBoxLayout()
        self.labels_layout = QHBoxLayout()
        self.buttons_layout = QHBoxLayout()

        self.progress_bar = QProgressBar()
        self.pose_number_lbl = QLabel('0/8')
        self.bad_plan_lbl = QLabel('No plan yet')
        self.guide_lbl = QLabel('Hello')

        self.check_start_pose_btn = QPushButton('Check starting pose')
        self.check_start_pose_btn.clicked.connect(
            self.handle_check_current_state)

        self.next_pose_btn = QPushButton('Next Pose')
        self.next_pose_btn.clicked.connect(self.handle_next_pose)

        self.plan_btn = QPushButton('Plan')
        self.plan_btn.clicked.connect(self.handle_plan)

        self.execute_btn = QPushButton('Execute')
        self.execute_btn.clicked.connect(self.handle_execute)

        self.labels_layout.addWidget(self.pose_number_lbl)
        self.labels_layout.addWidget(self.bad_plan_lbl)

        self.buttons_layout.addWidget(self.check_start_pose_btn)
        self.buttons_layout.addWidget(self.next_pose_btn)
        self.buttons_layout.addWidget(self.plan_btn)
        self.buttons_layout.addWidget(self.execute_btn)

        self.layout.addWidget(self.progress_bar)
        self.layout.addLayout(self.labels_layout)
        self.layout.addWidget(self.guide_lbl)
        self.layout.addLayout(self.buttons_layout)

        self.setLayout(self.layout)

        self.plan_btn.setEnabled(False)
        self.execute_btn.setEnabled(False)

        self.setWindowTitle('Local Mover')
        self.show()
Example #22
0
    def startPropertyEdit(self):

        self.editing_properties = True
        self.edit_existing_location = self.edit_properties_location

        self.edit_area_button[LocationFunction.ADD_LOCATION_AREA].setEnabled(
            True)
        self.edit_area_button[LocationFunction.EDIT_EXISTING_AREA].setEnabled(
            True)

        # Construct the configuration layout.
        clearLayoutAndFixHeight(self.configuration_layout)

        neighbors_str = makeNeighborsString(
            self.locations[self.edit_properties_location], self.locations)
        self.update_name_label = QLabel(
            "Location (" + self.edit_properties_location + " - " +
            neighbors_str + ")      New Name: ", self.widget)
        self.configuration_layout.addWidget(self.update_name_label)

        self.update_name_textedit = QLineEdit(self.widget)
        self.update_name_textedit.setText(self.edit_properties_location)
        self.update_name_textedit.textEdited.connect(
            self.locationNameTextEdited)
        self.configuration_layout.addWidget(self.update_name_textedit)

        self.update_name_button = QPushButton("Update location Name",
                                              self.widget)
        self.update_name_button.clicked[bool].connect(self.updateLocationName)
        self.update_name_button.setEnabled(False)
        self.configuration_layout.addWidget(self.update_name_button)

        self.remove_location_button = QPushButton("Remove Location",
                                                  self.widget)
        self.remove_location_button.clicked[bool].connect(
            self.removeCurrentLocation)
        self.configuration_layout.addWidget(self.remove_location_button)

        self.configuration_layout.addStretch(1)

        self.updateOverlay()
    def __init__(self, parent=None, logger=Logger()):
        QWidgetWithLogger.__init__(self, parent, logger)

        # start widget
        vbox = QVBoxLayout()
        vbox.setMargin(0)
        vbox.setContentsMargins(0, 0, 0, 0)

        # add layout which is dynamically filled
        self.parameter_tree_widget = QParameterTreeWidget(logger=self.logger)
        vbox.addWidget(self.parameter_tree_widget)

        # button panel
        vbox_commands = QVBoxLayout()
        hbox = QHBoxLayout()

        # upload topic
        send_parameter_topic_widget = QTopicWidget(self, 'vigir_footstep_planning_msgs/SetParameterSetAction', True)
        send_parameter_topic_widget.topic_changed_signal.connect(self._init_upload_paramater_set_client)
        hbox.addWidget(send_parameter_topic_widget)

        # upload command
        self.upload_command = QPushButton("Upload")
        self.upload_command.clicked.connect(self.upload_parameters)
        hbox.addWidget(self.upload_command)
        vbox_commands.addLayout(hbox)

        # reload command
        self.reload_command = QPushButton("Reload")
        self.reload_command.clicked.connect(self.reload_parameters)
        vbox_commands.addWidget(self.reload_command)

        # add button panel
        vbox.addLayout(vbox_commands)

        # end widget
        self.setLayout(vbox)

        # init
        self.clear()
        send_parameter_topic_widget.emit_topic_name()
 def __init__(self, parent=None):
     super(ComboBoxDialog, self).__init__()
     self.number = 0
     vbox = QtGui.QVBoxLayout(self)
     self.combo_box = QComboBox(self)
     self.combo_box.activated.connect(self.onActivated)
     vbox.addWidget(self.combo_box)
     button = QPushButton()
     button.setText("Done")
     button.clicked.connect(self.buttonCallback)
     vbox.addWidget(button)
     self.setLayout(vbox)
Example #25
0
    def _create_layout(self):
        name_hor_sub_widget = QWidget()
        name_hor_layout = QHBoxLayout(name_hor_sub_widget)

        name_widget = QLabel(self.name + ": ")
        name_hor_layout.addWidget(name_widget)
        if self.add == True:
            btn_add = QPushButton("+", name_hor_sub_widget)

            btn_add.clicked.connect(self._push_param)
            btn_add.clicked.connect(self._update_item)
            name_hor_layout.addWidget(btn_add)

            btn_subtract = QPushButton("-", name_hor_sub_widget)
            btn_subtract.clicked.connect(self._pop_param)
            btn_subtract.clicked.connect(self._update_item)
            name_hor_layout.addWidget(btn_subtract)
            pass

        self.arg_ver_layout.addWidget(name_hor_sub_widget)
        self.dlg_layout.addWidget(self.arg_ver_sub_widget)
        self._update_item()
Example #26
0
    def __init__(self, master):
        QObject.__init__(self)
        self.name = master.name
        self._master = master
        self._syncronized = MasterSyncButtonHelper.NOT_SYNC
        self.ICONS = {MasterSyncButtonHelper.SYNC: nm.settings().icon("%s_sync.png" % self.ICON_PREFIX),
                      MasterSyncButtonHelper.NOT_SYNC: nm.settings().icon("%s_not_sync.png" % self.ICON_PREFIX),
                      MasterSyncButtonHelper.SWITCHED: nm.settings().icon("%s_start_sync.png" % self.ICON_PREFIX)}
        self.widget = QPushButton()
#    self.widget.setFlat(True)
        self.widget.setIcon(self.ICONS[MasterSyncButtonHelper.NOT_SYNC])
        self.widget.setMaximumSize(48, 48)
        self.widget.setCheckable(True)
        self.widget.clicked.connect(self.on_sync_clicked)
 def _create_find_frame(self):
     find_frame = QFrame(self)
     find_hbox_layout = QHBoxLayout(find_frame)
     find_hbox_layout.setContentsMargins(0, 0, 0, 0)
     find_hbox_layout.setSpacing(1)
     self.search_field = EnchancedLineEdit(find_frame)
     self.search_field.setPlaceholderText('search text')
     self.search_field.textChanged.connect(self.on_search_text_changed)
     self.search_field.returnPressed.connect(self.on_search)
     find_hbox_layout.addWidget(self.search_field)
     self.search_result_label = QLabel(find_frame)
     self.search_result_label.setText(' ')
     find_hbox_layout.addWidget(self.search_result_label)
     self.find_button_back = QPushButton("<")
     self.find_button_back.setFixedWidth(44)
     self.find_button_back.clicked.connect(self.on_search_back)
     find_hbox_layout.addWidget(self.find_button_back)
     self.find_button = QPushButton(">")
     self.find_button.setDefault(True)
     # self.find_button.setFlat(True)
     self.find_button.setFixedWidth(44)
     self.find_button.clicked.connect(self.on_search)
     find_hbox_layout.addWidget(self.find_button)
     return find_frame
Example #28
0
    def update_buttons(self):
        self.clean()
        for index, level in enumerate(self.levels):
            self.text_label.setText("Choose Level: ")
            button = QPushButton(level.level_id, self._widget)
            button.clicked[bool].connect(self.handle_button)
            button.setCheckable(True)
            self._button_layout.addWidget(button)
            self.buttons.append(button)

        # Subscribe to the current level we are on.
        if self.status_subscriber is None:
            self.status_subscriber = rospy.Subscriber(
                "level_mux/current_level", LevelMetaData,
                self.process_level_status)
    def __init__(self, parent=None):
        super(VisualizerWidget, self).__init__(parent)
        self.setWindowTitle('Graph Profiler Visualizer')
        vbox = QVBoxLayout()
        self.setLayout(vbox)

        toolbar_layout = QHBoxLayout()
        refresh_button = QPushButton()
        refresh_button.setIcon(QIcon.fromTheme('view-refresh'))
        auto_refresh_checkbox = QCheckBox("Auto Refresh")
        hide_disconnected_topics = QCheckBox("Hide Disconnected Topics")
        topic_blacklist_button = QPushButton("Topic Blacklist")
        node_blacklist_button = QPushButton("Node Blacklist")

        refresh_button.clicked.connect(self._refresh)
        topic_blacklist_button.clicked.connect(self._edit_topic_blacklist)
        node_blacklist_button.clicked.connect(self._edit_node_blacklist)
        auto_refresh_checkbox.setCheckState(2)
        auto_refresh_checkbox.stateChanged.connect(self._autorefresh_changed)
        hide_disconnected_topics.setCheckState(2)
        hide_disconnected_topics.stateChanged.connect(self._hidedisconnectedtopics_changed)

        toolbar_layout.addWidget(refresh_button)
        toolbar_layout.addWidget(auto_refresh_checkbox)
        toolbar_layout.addStretch(0)
        toolbar_layout.addWidget(hide_disconnected_topics)
        toolbar_layout.addWidget(topic_blacklist_button)
        toolbar_layout.addWidget(node_blacklist_button)
        vbox.addLayout(toolbar_layout)

        # Initialize the Visualizer
        self._view = qt_view.QtView()
        self._adapter = rosprofiler_adapter.ROSProfileAdapter(self._view)
        self._adapter.set_topic_quiet_list(TOPIC_BLACKLIST)
        self._adapter.set_node_quiet_list(NODE_BLACKLIST)
        vbox.addWidget(self._view)
Example #30
0
    def __init__(self, context):
        super(TriangleGUI, self).__init__(context)
        # Give QObjects reasonable names
        self.setObjectName('TriangleGUI')

        # Process standalone plugin command-line arguments
        from argparse import ArgumentParser
        parser = ArgumentParser()
        # Add argument(s) to the parser.
        parser.add_argument("-q",
                            "--quiet",
                            action="store_true",
                            dest="quiet",
                            help="Put plugin in silent mode")
        args, unknowns = parser.parse_known_args(context.argv())
        self._toolbar = QToolBar()
        self._toolbar.addWidget(QLabel('Triangle'))

        # Create a container widget and give it a layout
        self._container = QWidget()
        self._layout = QVBoxLayout()
        self._container.setLayout(self._layout)

        self._layout.addWidget(self._toolbar)

        # Add a button for killing nodes
        self._go_button = QPushButton('Go')
        self._go_button.clicked.connect(self._go)
        self._layout.addWidget(self._go_button)

        self._clear_button = QPushButton('Clear')
        self._clear_button.clicked.connect(self._clear)
        self._layout.addWidget(self._clear_button)
        # self._step_run_button.setStyleSheet('QPushButton {color: black}')

        context.add_widget(self._container)