l1.5-safety-system/safety_user_plugin/scripts/qt_wrapper.py
2018-09-18 19:09:59 +02:00

89 lines
2.5 KiB
Python

#!/usr/bin/env python
import os
import rospy
import rospkg
# from python_qt_binding.QtGui import QPalette
# from python_qt_binding.QtWidgets import QPushButton
# from python_qt_binding.QtWidgets import QWidget, QDialog
class QtWrapper:
def __init__(self,widget):
self.widget = widget
self.widget.logsBrowser.setText('Sukces')
def connect_robot_signals(self):
raise NotImplementedError
def connect_signals(self):
self.widget.openButton.clicked.connect(self.handle_openButton_clicked)
self.widget.clutchButton.clicked.connect(self.handle_clutchButton_clicked_callback)
self.widget.stopButton.clicked.connect(self.handle_stopButton_clicked_callback)
def get_selected_robot_id(self):
raise NotImplementedError
def handle_openButton_clicked(self):
selected_robot_id = self.get_selected_robot_id()
if selected_robot_id != None:
self.handle_openButton_clicked_callback(selected_robot_id)
else:
# TODO - Log info
raise NotImplementedError
def set_robot_selection_callback(self,callback):
self.handle_openButton_clicked_callback = callback
def set_user_stop_state_updated_callback(self,callback):
self.handle_stopButton_clicked_callback = callback
def set_clutch_switched_callback(self,callback):
self.handle_clutchButton_clicked_callback = callback
def select_robot(self,robot_id):
self.widget.logsBrowser.setText('Sukcesx1')
def release_robot(self):
self.widget.logsBrowser.setText('Sukcesx2')
def update_robots_list_gui(self,robots_id_list):
robots_id_list.sort()
id_strings_list = (('PIONIER'+str(x)) for x in robots_id_list)
self.widget.robotsList.addItems(id_strings_list)
def update_selected_robot_info(self,robot_info):
raise NotImplementedError
def master_stopped(self):
raise NotImplementedError
def master_started(self):
raise NotImplementedError
def user_stopped(self):
raise NotImplementedError
def user_started(self):
raise NotImplementedError
def engage_clutch(self):
# raise NotImplementedError
pass
def disengage_clutch(self):
raise NotImplementedError
def master_is_stopped_notify(self):
raise NotImplementedError
def update_restrictions_gui(self,restrictions):
raise NotImplementedError
def connection_to_robot_lost(self,lost_robot_id):
raise NotImplementedError