def __init__(self, parent=None):
     QWidget.__init__(self, parent)
     self.setObjectName("MainBox")
     self.__on_intern_change = False
     boxLayout = QFormLayout()
     boxLayout.setVerticalSpacing(0)
     self.setLayout(boxLayout)
Esempio n. 2
0
 def __init__(self, masteruri, screen_name, nodename, user=None, parent=None):
     '''
     Creates the window, connects the signals and init the class.
     '''
     QWidget.__init__(self, parent)
     # load the UI file
     screen_dock_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', 'ui', 'logscreen', 'ScreenWidget.ui')
     loadUi(screen_dock_file, self)
     self.setObjectName("ScreenWidget")
     self.setWindowIcon(nm.settings().icon('crystal_clear_show_io.png'))
     # self.setFeatures(QDockWidget.DockWidgetFloatable | QDockWidget.DockWidgetMovable | QDockWidget.DockWidgetClosable)
     self.pauseButton.setIcon(nm.settings().icon('sekkyumu_pause.png'))
     self._valid = True
     self._logpath = ''
     self._lock = threading.RLock()
     self.finished = False
     self.qfile = None
     self.thread = None
     self._info = ''
     self._masteruri = ''
     self._nodename = nodename
     self._first_fill = True
     self._seek_start = -1
     self._seek_end = -1
     self._pause_read_end = False
     self._ssh_output_file = None
     self._ssh_error_file = None
     self._ssh_input_file = None
     self._on_pause = False
     self._char_format_end = None
     self.logframe.setVisible(False)
     self.loglevelButton.toggled.connect(self.on_toggle_loggers)
     self.logger_handler = None
     # connect to the button signals
     self.output.connect(self._on_output)
     self.output_prefix.connect(self._on_output_prefix)
     self.error_signal.connect(self._on_error)
     self.auth_signal.connect(self.on_request_pw)
     self.clearCloseButton.clicked.connect(self.clear)
     # self.pauseButton.clicked.connect(self.stop)
     self.pauseButton.toggled.connect(self.pause)
     self.clear_signal.connect(self.clear)
     self.loggerFilterInput.textChanged.connect(self.on_logger_filter_changed)
     self.textBrowser.verticalScrollBar().valueChanged.connect(self.on_scrollbar_position_changed)
     self.textBrowser.verticalScrollBar().rangeChanged.connect(self.on_scrollbar_range_changed)
     self.textBrowser.set_reader(self)
     self.tf = TerminalFormats()
     self.hl = ScreenHighlighter(self.textBrowser.document())
     self.searchFrame.setVisible(False)
     self.grepFrame.setVisible(False)
     self.grepLineEdit.textChanged.connect(self.on_grep_changed)
     self._shortcut_search = QShortcut(QKeySequence(self.tr("Ctrl+F", "Activate search")), self)
     self._shortcut_search.activated.connect(self.on_search)
     self._shortcut_grep = QShortcut(QKeySequence(self.tr("Ctrl+G", "Activate grep")), self)
     self._shortcut_grep.activated.connect(self.on_grep)
     self.searchLineEdit.editingFinished.connect(self.on_search_prev)
     self.searchNextButton.clicked.connect(self.on_search_next)
     self.searchPrevButton.clicked.connect(self.on_search_prev)
     # self.visibilityChanged.connect(self.stop)
     self._connect(masteruri, screen_name, nodename, user)
	def __init__(self):
		QWidget.__init__(self)
		rp = rospkg.RosPack()
		ui_file = os.path.join(rp.get_path('rqt_bag_annotation'), 'resource', 'export_widget.ui')
		loadUi(ui_file, self)

		self.add_topic_button.setIcon(QIcon.fromTheme('list-add'))
		self.remove_topic_button.setIcon(QIcon.fromTheme('list-remove'))
		self.refresh_button.setIcon(QIcon.fromTheme('view-refresh'))

		self.add_topic_button.clicked[bool].connect(self._handle_add_topic_clicked)
		self.remove_topic_button.clicked[bool].connect(self._handle_remove_topic_clicked)
		self.refresh_button.clicked[bool].connect(self._handle_refresh_clicked)
		self.export_button.clicked[bool].connect(self._handle_export_clicked)

		self.export_location_edit.setPlainText("./export_file.txt")
		self.rospack = rospkg.RosPack()

		self._exported_topics = list()
		self._exported_publisher_info = list()
		self._annotations = list()
		self._active_topics = list()
		self._dt = 0.1

		self._current_topic_paths = dict()
		self._current_msg_paths = dict()
		self._id_counter = 0
		self.current_output = ""
Esempio n. 4
0
 def __init__(self, parent=None):
     QWidget.__init__(self, parent)
     self.setObjectName("MainBox")
     self.__on_intern_change = False
     boxLayout = QFormLayout()
     boxLayout.setVerticalSpacing(0)
     self.setLayout(boxLayout)
 def __init__(self, request):
     QWidget.__init__(self)
     self._request = request
     ui_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'handoff_request.ui')
     loadUi(ui_file, self)
     self.button_allow.clicked.connect(self._on_allow)
     self.button_wait.clicked.connect(self._on_wait)
     self.button_deny.clicked.connect(self._on_deny)
     self.ocu_address = Address(request.ocu)
     self.label_requester.setText("Requester: %s" % self.ocu_address)
     self.label_reason.setText("Reason: %s" % request.explanation)
     self._last_update = rospy.Time.now()
     self._current_state = self.STATE_NONE
     self._active = True
Esempio n. 6
0
 def __init__(self, path, parent=None):
     QWidget.__init__(self, parent)
     self.path = path
     self._layout = QHBoxLayout(self)
     self._layout.setContentsMargins(0, 0, 0, 0)
     self._layout.setSpacing(0)
     self._button = QPushButton('...')
     self._button.setMaximumSize(QSize(24, 20))
     self._button.clicked.connect(self._on_path_select_clicked)
     self._layout.addWidget(self._button)
     self._lineedit = QLineEdit(path)
     self._lineedit.returnPressed.connect(self._on_editing_finished)
     self._layout.addWidget(self._lineedit)
     self.setLayout(self._layout)
     self.setFocusProxy(self._button)
     self.setAutoFillBackground(True)
	def __init__(self, timeline_frame):
		QWidget.__init__(self)
		self.timeline_frame = timeline_frame
		rp = rospkg.RosPack()
		ui_file = os.path.join(rp.get_path('rqt_bag_annotation'), 'resource', 'annotation_widget.ui')

		loadUi(ui_file, self)
		self.setObjectName('AnnotationWidget')
		rd_file = os.path.join(rp.get_path('turtlebot_description'), 'robots', 'kobuki_hexagons_kinect.urdf.xacro')
		a = xacro.parse(rd_file)
		xacro.process_includes(a, rd_file)
		xacro.eval_self_contained(a)
		rospy.set_param('robot_description', a.toxml()) 
		
		self._cur_annotation = None
		self.save_button.clicked[bool].connect(self.save)
Esempio n. 8
0
 def __init__(self, path, parent=None):
     QWidget.__init__(self, parent)
     self.path = path
     self._layout = QHBoxLayout(self)
     self._layout.setContentsMargins(0, 0, 0, 0)
     self._layout.setSpacing(0)
     self._button = QPushButton('...')
     self._button.setMaximumSize(QSize(24, 20))
     self._button.clicked.connect(self._on_path_select_clicked)
     self._layout.addWidget(self._button)
     self._lineedit = QLineEdit(path)
     self._lineedit.returnPressed.connect(self._on_editing_finished)
     self._layout.addWidget(self._lineedit)
     self.setLayout(self._layout)
     self.setFocusProxy(self._button)
     self.setAutoFillBackground(True)
    def __init__(self, parent=None, subscribe=False):
        QWidget.__init__(self, parent)

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

        # add error status text edit
        self.error_status_text_box = QErrorStatusTextBox()
        self.error_status_text_box_layout = QHBoxLayout()
        self.error_status_text_box_layout.addWidget(self.error_status_text_box)
        vbox.addLayout(self.error_status_text_box_layout)

        # add panel
        hbox = QHBoxLayout()

        # clear push button
        self.execute_command = QPushButton("Clear")
        self.execute_command.clicked.connect(self.error_status_text_box.clear)
        hbox.addWidget(self.execute_command)

        hbox.addStretch()

        # hide window checkbox
        hide_window_check_box = QCheckBox("Hide")
        hide_window_check_box.stateChanged.connect(self.state_changed)
        hbox.addWidget(hide_window_check_box)

        # end panel
        vbox.addLayout(hbox)

        # end widget
        self.setLayout(vbox)
        #self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Minimum)

        # subscriber
        if subscribe:
            self.error_status_sub = rospy.Subscriber("error_status", ErrorStatus, self.error_status_callback)
        self.subscribed = subscribe

        # connect signal slot internally to prevent crash by subscriber
        self.error_status_signal.connect(self.append_error_status)
    def __init__(self, parent = None, subscribe = False):
        QWidget.__init__(self, parent)

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

        # add error status text edit
        self.error_status_text_box = QErrorStatusTextBox()
        self.error_status_text_box_layout = QHBoxLayout()
        self.error_status_text_box_layout.addWidget(self.error_status_text_box)
        vbox.addLayout(self.error_status_text_box_layout)

        # add panel
        hbox = QHBoxLayout()

        # clear push button
        self.execute_command = QPushButton("Clear")
        self.execute_command.clicked.connect(self.error_status_text_box.clear)
        hbox.addWidget(self.execute_command)

        hbox.addStretch()

        # hide window checkbox
        hide_window_check_box = QCheckBox("Hide")
        hide_window_check_box.stateChanged.connect(self.state_changed)
        hbox.addWidget(hide_window_check_box)

        # end panel
        vbox.addLayout(hbox)

        # end widget
        self.setLayout(vbox)
        #self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Minimum)

        # subscriber
        if (subscribe):
            self.error_status_sub = rospy.Subscriber("error_status", ErrorStatus, self.error_status_callback)
        self.subscribed = subscribe

        # connect signal slot internally to prevent crash by subscriber
        self.error_status_signal.connect(self.append_error_status)
    def __init__(self, parent=None, topic_type=str(), is_action_topic=False):
        QWidget.__init__(self, parent)

        if is_action_topic:
            self.topic_type = topic_type + "Goal"
        else:
            self.topic_type = topic_type
        self.is_action_topic = is_action_topic

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

        # topic combo box
        self.topic_combo_box = QComboBox()
        self.topic_combo_box.setEnabled(False)
        self.topic_combo_box.blockSignals(True)
        self.topic_combo_box.setValidator(
            QRegExpValidator(QRegExp('((\d|\w|/)(?!//))*'), self))
        self.topic_combo_box.currentIndexChanged[str].connect(
            self.topic_changed)
        hbox.addWidget(self.topic_combo_box)

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

        # add refresh button
        refresh_topics_button = QPushButton()
        refresh_topics_button.clicked.connect(self.update_topic_list)
        refresh_topics_button.setIcon(icon)
        refresh_topics_button.setFixedSize(size.width() + 2, size.height() + 2)
        hbox.addWidget(refresh_topics_button)

        # end widget
        self.setLayout(hbox)

        # init widget
        self.update_topic_list()
    def __init__(self, parent = None, topic_type = str(), is_action_topic = False):
        QWidget.__init__(self, parent)

        if is_action_topic:
            self.topic_type = topic_type + "Goal"
        else:
            self.topic_type = topic_type
        self.is_action_topic = is_action_topic

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

        # topic combo box
        self.topic_combo_box = QComboBox()
        self.topic_combo_box.setEnabled(False)
        self.topic_combo_box.blockSignals(True)
        self.topic_combo_box.setValidator(QRegExpValidator(QRegExp('((\d|\w|/)(?!//))*'), self))
        self.topic_combo_box.currentIndexChanged[str].connect(self.topic_changed)
        hbox.addWidget(self.topic_combo_box)

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

        # add refresh button
        refresh_topics_button = QPushButton()
        refresh_topics_button.clicked.connect(self.update_topic_list)
        refresh_topics_button.setIcon(icon)
        refresh_topics_button.setFixedSize(size.width()+2, size.height()+2)
        hbox.addWidget(refresh_topics_button)

        # end widget
        self.setLayout(hbox)

        # init widget
        self.update_topic_list()
 def __init__(self, parent = None, logger = Logger()):
     QWidget.__init__(self, parent)
     self.set_logger(logger)
 def __init__(self, *args):
     QWidget.__init__(self, *args)
     self.edit = None
     # it is the highest line that is currently visible.
     self.highest_line = 0
 def __init__(self, parent=None, logger=Logger()):
     QWidget.__init__(self, parent)
     self.set_logger(logger)