コード例 #1
0
 def _showWarning(self, title, body):
     if threading.current_thread().name != "MainThread":
         rospy.logwarn("{}: {}".format(title, body))
     else:
         msg = QMessageBox()
         msg.setIcon(QMessageBox.Warning)
         msg.setWindowTitle(title)
         msg.setText(body)
         msg.setStandardButtons(QMessageBox.Ok)
         msg.exec_()
コード例 #2
0
 def _showWarning(self, title, body):
     if threading.current_thread().name != "MainThread":
         rospy.logwarn("{}: {}".format(title, body))
     else:
         msg = QMessageBox()
         msg.setIcon(QMessageBox.Warning)
         msg.setWindowTitle(title)
         msg.setText(body)
         msg.setStandardButtons(QMessageBox.Ok)
         msg.exec_()
コード例 #3
0
ファイル: util.py プロジェクト: Aerobota/rqt_robot_plugins
def dasherr(msg, obj, title='Error'):
    """
    Logs a message with ``rospy.logerr`` and displays a ``QMessageBox`` to the user

    :param msg: Message to display.
    :type msg: str
    :param obj: Parent object for the ``QMessageBox``
    :type obj: QObject
    :param title: An optional title for the `QMessageBox``
    :type title: str
    """
    rospy.logerr(msg)

    box = QMessageBox()
    box.setText(msg)
    box.setWindowTitle(title)
    box.show()

    obj._message_box = box
コード例 #4
0
def dasherr(msg, obj, title='Error'):
    """
    Logs a message with ``rospy.logerr`` and displays a ``QMessageBox`` to the user

    :param msg: Message to display.
    :type msg: str
    :param obj: Parent object for the ``QMessageBox``
    :type obj: QObject
    :param title: An optional title for the `QMessageBox``
    :type title: str
    """
    rospy.logerr(msg)

    box = QMessageBox()
    box.setText(msg)
    box.setWindowTitle(title)
    box.show()

    obj._message_box = box