Beispiel #1
0
    def __init__(self, widget_class, name, window, *args):
        super(OCSPlugin, self).__init__(None)

        if len(args) > 0:
            self._widget = widget_class(self, args[0])
        else:
            self._widget = widget_class(self)

        self._name = name
        self._window = window

        self._window_control_sub = rospy.Subscriber("/flor/ocs/window_control",
                                                    Int8,
                                                    self.processWindowControl)
        self._window_control_pub = rospy.Publisher("/flor/ocs/window_control",
                                                   Int8,
                                                   queue_size=10)

        # window visibility configuration variables
        self._last_window_control_data = -self._window
        self._set_window_visibility = True

        # this is only used to make sure we close window if ros::shutdown has already been called
        self._timer = QBasicTimer()
        self._timer.start(33, self)

        settings = QSettings("OCS", self._name)
        if settings.value("mainWindowGeometry") is not None:
            self.restoreGeometry(settings.value("mainWindowGeometry"))
        self.geometry_ = self.geometry()