l1.5-safety-system/safety_user_plugin/scripts/user_widget.py

18 lines
594 B
Python
Raw Normal View History

2018-09-17 18:29:00 +02:00
#!/usr/bin/env python
import os
import rospkg
from python_qt_binding.QtWidgets import QWidget
from python_qt_binding import loadUi
class UserWidget(QWidget):
def __init__(self,context):
super(UserWidget, self).__init__()
ui_file = os.path.join(rospkg.RosPack().get_path('safety_user_plugin'), 'ui', 'user_view.ui')
loadUi(ui_file, self)
self.setObjectName('User Plugin - L1.5 safety system')
if context.serial_number() > 1:
self.setWindowTitle(self.windowTitle() + (' (%d)' % context.serial_number()))
context.add_widget(self)