def __init__(self, parent): ''' @type parent: LaunchMain ''' super(LaunchWidget, self).__init__() self._parent = parent self._config = None #TODO: should be configurable from gui self._port_roscore = 11311 self._run_id = None self._rospack = rospkg.RosPack() ui_file = os.path.join(self._rospack.get_path('rqt_launch'), 'resource', 'launch_widget.ui') loadUi(ui_file, self) # row=0 allows any number of rows to be added. self._datamodel = QStandardItemModel(0, 1) master_uri = rosenv.get_master_uri() rospy.loginfo('LaunchWidget master_uri={}'.format(master_uri)) self._delegate = NodeDelegate(master_uri, self._rospack) self._treeview.setModel(self._datamodel) self._treeview.setItemDelegate(self._delegate) # NodeController used in controller class for launch operation. self._node_controllers = [] self._pushbutton_load_params.clicked.connect(self._parent.load_params) self._pushbutton_start_all.clicked.connect(self._parent.start_all) self._pushbutton_stop_all.clicked.connect(self._parent.stop_all) # Bind package selection with .launch file selection. self._combobox_pkg.currentIndexChanged[str].connect( self._refresh_launchfiles) # Bind a launch file selection with launch GUI generation. self._combobox_launchfile_name.currentIndexChanged[str].connect( self._load_launchfile_slot) self._update_pkgs_contain_launchfiles() # Used for removing previous nodes self._num_nodes_previous = 0
def to_QItemModel(self): """ Represent the DSDs debug data as QITemModel """ # Return cached result if available if self.__cached_item_model is not None: return self.__cached_item_model # Return empty model when no dsd data was received yet if self.__cached_msg is None: return self.__empty_item_model() # Construct a new item-model model = QStandardItemModel() for i in range(len(self.stack)): elem, _ = self.stack[i] elem_item = QStandardItem() elem_item.setEditable(False) if isinstance(elem, SequenceTreeElement): elem_item.setText('Sequence: ' + ', '.join( str(e) for e in elem.action_elements)) sequence = True else: elem_item.setText(str(elem)) sequence = False self.__append_element_to_item(elem_item, elem.debug_data) model.invisibleRootItem().appendRow(elem_item) # Add a spacer if this is not the last item if elem != self.stack[-1][0]: spacer = QStandardItem() spacer.setEditable(False) model.invisibleRootItem().appendRow(spacer) if sequence: break self.__cached_item_model = model return self.__cached_item_model
def __init__(self, mode, dotgraph, dotcode_factory, dotparser, param_manager, models_desc_file_path, nodename='', parent=None): super(OutputDialog, self).__init__(parent) if mode not in ['add', 'edit']: raise Exception('Wrong mode for Ouput Dialog') self.setWindowTitle("Add a output pipe") self.setGeometry(300, 300, 450, 250) # self._widget = QDialog() ui_file = os.path.join(rospkg.RosPack().get_path('rqt_vino_plugin'), 'resource', 'add_output_dialog.ui') loadUi(ui_file, self) self.dotgraph = dotgraph self.dotparser = dotparser self.dotcode_factory = dotcode_factory self.available_infers_list = param_manager.parse_inferlist_file( models_desc_file_path) self.connect_from_listmodel = QStandardItemModel() self.output_type_combobox.currentTextChanged.connect( self._update_display) self.update_output_types() if mode == 'add': self.buttonBox.accepted.connect(self._create_node_in_graph) elif mode == 'edit': self.nodename = nodename self.buttonBox.accepted.connect(self._edit_node_in_graph)
def _on_ctrl_info(self, index): popup = self._popup_widget ctrl = self._controllers[index.row()] popup.ctrl_name.setText(ctrl.name) popup.ctrl_type.setText(ctrl.type) res_model = QStandardItemModel() model_root = QStandardItem('Claimed Resources') res_model.appendRow(model_root) for hw_res in ctrl.claimed_resources: hw_iface_item = QStandardItem(hw_res.hardware_interface) model_root.appendRow(hw_iface_item) for res in hw_res.resources: res_item = QStandardItem(res) hw_iface_item.appendRow(res_item) popup.resource_tree.setModel(res_model) popup.resource_tree.setItemDelegate(FontDelegate(popup.resource_tree)) popup.resource_tree.expandAll() popup.move(QCursor.pos()) popup.show()
def setUp(self): unittest.TestCase.setUp(self) self._model = QStandardItemModel() node1 = QStandardItem('node1') self._node1_1 = QStandardItem('node1_1') self._node1_1_1 = QStandardItem('node1_1_1') node1_1_2 = QStandardItem('node1_1_2') node1_2 = QStandardItem('node1_2') node1.appendRow(self._node1_1) self._node1_1.appendRow(self._node1_1_1) self._node1_1.appendRow(node1_1_2) node1.appendRow(node1_2) self._model.appendRow(node1) # node_list = [node1, node1_1, self._node1_1_1, node1_1_2, node1_2] # self._model.appendRow(node_list) self._grn_node1_1_1 = '/node1/node1_1/node1_1_1' self._len_lower_grn_node1_1 = 2
def __init__(self, tabwidget, parent=None): QDockWidget.__init__(self, "LaunchGraph", parent) graph_ui_file = os.path.join( os.path.dirname(os.path.realpath(__file__)), 'GraphDockWidget.ui') loadUi(graph_ui_file, self) self.setObjectName('LaunchGraph') self.setFeatures(QDockWidget.DockWidgetMovable | QDockWidget.DockWidgetFloatable) self._tabwidget = tabwidget self._current_path = None self._root_path = None self._current_deep = 0 self.graphTreeView.setSelectionBehavior(QAbstractItemView.SelectRows) model = QStandardItemModel() self.graphTreeView.setModel(model) self.graphTreeView.setUniformRowHeights(True) self.graphTreeView.header().hide() self.htmlDelegate = HTMLDelegate() self.graphTreeView.setItemDelegateForColumn(0, self.htmlDelegate) self.graphTreeView.activated.connect(self.on_activated) self.graphTreeView.clicked.connect(self.on_clicked) self._created_tree = False self._refill_tree([], [], False)
def _init_monitor_parameters(self, _col_names_paramtable=None): """ @rtype: Thread """ self._param_datamodel = QStandardItemModel(0, 2) self._root_qitem = self._param_datamodel.invisibleRootItem() self._view_params.setModel(self._param_datamodel) # Names of header on the QTableView. if not _col_names_paramtable: _col_names_paramtable = [ 'Param name', 'Found on Parameter Server?' ] self._param_datamodel.setHorizontalHeaderLabels(_col_names_paramtable) self.sig_param.connect(self._update_output_parameters) param_check_thread = threading.Thread(target=self._check_params_alive, args=(self.sig_param, self._params_monitored, self._stop_event)) return param_check_thread
def _empty_item_model(): return QStandardItemModel()
def __init__(self, context): super(Conman, self).__init__(context) self._dotcode_sub = None self._topic_dict = {} self._update_thread = WorkerThread(self._update_thread_run, self._update_finished) # Give QObjects reasonable names self.setObjectName('Conman') # Process standalone plugin command-line arguments from argparse import ArgumentParser parser = ArgumentParser() # Add argument(s) to the parser. parser.add_argument("-q", "--quiet", action="store_true", dest="quiet", help="Put plugin in silent mode") args, unknowns = parser.parse_known_args(context.argv()) if not args.quiet: print 'arguments: ', args print 'unknowns: ', unknowns # Create QWidget self._widget = QWidget() # Get path to UI file which is a sibling of this file # in this example the .ui and .py file are in the same folder ui_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'rqt_conman.ui') # Extend the widget with all attributes and children from UI file loadUi(ui_file, self._widget) # Give QObjects reasonable names self._widget.ns_refresh_button.setIcon(QIcon.fromTheme('view-refresh')) self._widget.setObjectName('ConmanPluginUi') # Show _widget.windowTitle on left-top of each plugin (when # it's set in _widget). This is useful when you open multiple # plugins at once. Also if you open multiple instances of your # plugin at once, these lines add number to make it easy to # tell from pane to pane. if context.serial_number() > 1: self._widget.setWindowTitle(self._widget.windowTitle() + (' (%d)' % context.serial_number())) # Add widget to the user interface context.add_widget(self._widget) palette = QPalette() palette.setColor(QPalette.Background, Qt.white) self._widget.setPalette(palette) #self._widget.subscribe_button.setCheckable(True) self._widget.namespace_input.currentIndexChanged.connect( self._handle_refresh_clicked) self._widget.ns_refresh_button.clicked.connect(self.refresh_combo_box) self._widget.refresh_button.clicked[bool].connect( self._handle_refresh_clicked) self._widget.commit_button.clicked[bool].connect( self._handle_commit_clicked) #self._widget.xdot_widget.connect( #self._widget.xdot_widget, SIGNAL('_update_graph'), self._widget.xdot_widget.set_dotcode) self.update_graph_sig.connect(self._update_graph) self.blocks = {} self.groups = {} self._ns = "" self._actions_connected = False self.enable_widgets(False) self.new_dotcode_data = '' self.update_timer = QTimer(self) self.update_timer.setInterval(50) self.update_timer.timeout.connect(self._update_widgets) #self.update_timer.start() self._get_blocks = None self._set_blocks = None self._blocks_model = QStandardItemModel(0, 4) self._blocks_model.setHeaderData(0, Qt.Horizontal, "") self._blocks_model.setHeaderData(1, Qt.Horizontal, "Action") self._blocks_model.setHeaderData(2, Qt.Horizontal, "State") self._blocks_model.setHeaderData(3, Qt.Horizontal, "Block") self._widget.blocks_table.setModel(self._blocks_model) self._blocks_delegate = BlocksDelegate(self) self._widget.blocks_table.setItemDelegate(self._blocks_delegate) self._blocks_model.itemChanged.connect(self.block_changed) self._groups_model = QStandardItemModel(0, 4) self._groups_model.setHeaderData(0, Qt.Horizontal, "") self._groups_model.setHeaderData(1, Qt.Horizontal, "") self._groups_model.setHeaderData(2, Qt.Horizontal, "") self._groups_model.setHeaderData(3, Qt.Horizontal, "Group") self._widget.groups_table.setModel(self._groups_model) self._groups_delegate = GroupsDelegate(self) self._widget.groups_table.setItemDelegate(self._groups_delegate) self.refresh_combo_box()
def __init__(self, context): super(HandEyeCalibration, self).__init__(context) self.context = context self.node = context.node self.widget = QWidget() self.widget.setObjectName(self.PLUGIN_TITLE) self.widget.setWindowTitle(self.PLUGIN_TITLE) # Data self.Tsamples = [] # Toolbar _, path_pkg = get_resource('packages', 'handeye_dashboard') print("{}".format(path_pkg)) self.snapshot_action = QAction(QIcon.fromTheme('camera-photo'), 'Take a snapshot', self.widget) path = path_pkg + '/share/handeye_dashboard/images/capture.png' self.calibrate_action = QAction(QIcon(QPixmap.fromImage(QImage(path))), 'Get the camera/robot transform', self.widget) self.clear_action = QAction(QIcon.fromTheme('edit-clear'), 'Clear the record data.', self.widget) path = path_pkg + '/share/handeye_dashboard/images/UR5.png' self.execut_action = QAction(QIcon(QPixmap.fromImage(QImage(path))), 'EStart the publishing the TF.', self.widget) self.toolbar = QToolBar() self.toolbar.addAction(self.snapshot_action) self.toolbar.addAction(self.calibrate_action) self.toolbar.addAction(self.clear_action) self.toolbar.addAction(self.execut_action) # Toolbar0 self.l0 = QLabel(self.widget) self.l0.setText("Camera-Mount-Type: ") self.l0.setFixedWidth(150) self.l0.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) self.combobox = QComboBox(self.widget) self.combobox.addItem('attached on robot') self.combobox.addItem('fixed beside robot') self.toolbar0 = QToolBar() self.toolbar0.addWidget(self.l0) self.toolbar0.addWidget(self.combobox) # Toolbar1 self.l1 = QLabel(self.widget) self.l1.setText("Camera-Frame: ") self.l1.setFixedWidth(150) self.l1.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) self.camera_frame = QLineEdit(self.widget) self.camera_frame.setText("camera_link") self.toolbar1 = QToolBar() self.toolbar1.addWidget(self.l1) self.toolbar1.addWidget(self.camera_frame) # Toolbar2 self.l2 = QLabel(self.widget) self.l2.setText("Object-Frame: ") self.l2.setFixedWidth(150) self.l2.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) self.object_frame = QLineEdit(self.widget) self.object_frame.setText("calib_board") self.toolbar2 = QToolBar() self.toolbar2.addWidget(self.l2) self.toolbar2.addWidget(self.object_frame) # Toolbar3 self.l3 = QLabel(self.widget) self.l3.setText("Robot-Base-Frame: ") self.l3.setFixedWidth(150) self.l3.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) self.base_frame = QLineEdit(self.widget) self.base_frame.setText("base") self.toolbar3 = QToolBar() self.toolbar3.addWidget(self.l3) self.toolbar3.addWidget(self.base_frame) # Toolbar4 self.l4 = QLabel(self.widget) self.l4.setText("End-Effector-Frame: ") self.l4.setFixedWidth(150) self.l4.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) self.endeffector_frame = QLineEdit(self.widget) self.endeffector_frame.setText("tool0") self.toolbar4 = QToolBar() self.toolbar4.addWidget(self.l4) self.toolbar4.addWidget(self.endeffector_frame) # Toolbar5 self.l5 = QLabel(self.widget) self.l5.setText("Sample-Number: ") self.l5.setFixedWidth(150) self.l5.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignVCenter) self.le5 = QLineEdit(self.widget) self.le5.setValidator(QIntValidator()) self.le5.setText('10') self.le5.setReadOnly(True) self.toolbar5 = QToolBar() self.toolbar5.addWidget(self.l5) self.toolbar5.addWidget(self.le5) # TreeView self.treeview = QTreeView() self.treeview.setAlternatingRowColors(True) self.model = QStandardItemModel(self.treeview) self.treeview.setModel(self.model) self.treeview.setHeaderHidden(True) # TextEdit self.textedit = QTextEdit(self.widget) self.textedit.setReadOnly(True) # Layout self.layout = QVBoxLayout() self.layout.addWidget(self.toolbar0) self.layout.addWidget(self.toolbar1) self.layout.addWidget(self.toolbar2) self.layout.addWidget(self.toolbar3) self.layout.addWidget(self.toolbar4) self.layout.addWidget(self.toolbar5) self.layout.addWidget(self.toolbar) self.layoutH = QHBoxLayout() self.layoutH.addWidget(self.treeview) self.layoutH.addWidget(self.textedit) self.layout.addLayout(self.layoutH) self.widget.setLayout(self.layout) # Add the widget to the user interface if context.serial_number() > 1: self.widget.setWindowTitle(self.widget.windowTitle() + (' (%d)' % context.serial_number())) context.add_widget(self.widget) # Make the connections self.snapshot_action.triggered.connect(self.take_snapshot) self.calibrate_action.triggered.connect(self.calibration) self.clear_action.triggered.connect(self.clear) self.execut_action.triggered.connect(self.execution) # Package path self.path_pkg = path_pkg # Set up TF self.cli = self.node.create_client(HandeyeTF, 'handeye_tf_service') while not self.cli.wait_for_service(timeout_sec=1.0): self.node.get_logger().info( 'service not available, waiting again...') self.req = HandeyeTF.Request()
def __init__(self, context): super(Camera_is1500_Widget, self).__init__(context) # Give QObjects reasonable names self.setObjectName('Camera setting') # Process standalone plugin command-line arguments from argparse import ArgumentParser parser = ArgumentParser() # Add argument(s) to the parser. parser.add_argument("-q", "--quiet", action="store_true", dest="quiet", help="Put plugin in silent mode") args, unknowns = parser.parse_known_args(context.argv()) if not args.quiet: print 'arguments: ', args print 'unknowns: ', unknowns # Create QWidget self._widget = QWidget() # Get path to UI file which should be in the "resources" folder of this package ui_file = os.path.join(rospkg.RosPack().get_path('rqt_camera_is1500'), 'resources', 'Camera_is1500_Widget.ui') # Extend the widget with all attributes and children from UI file loadUi(ui_file, self._widget) # Give QObjects reasonable names self._widget.setObjectName('Camera_is1500_WidgetUI') # Show _widget.windowTitle on left-top of each plugin (when # it's set in _widget). This is useful when you open multiple # plugins at once. Also if you open multiple instances of your # plugin at once, these lines add number to make it easy to # tell from pane to pane. if context.serial_number() > 1: self._widget.setWindowTitle(self._widget.windowTitle() + (' (%d)' % context.serial_number())) # Add widget to the user interface context.add_widget(self._widget) """ Start nodes """ self.target_x = 0.0 self.target_y = 0.0 self.distance_x = 0.0 """ MAP path for is1500 package """ self.map_path_name = '' self.map_file_name = '' self.destination_map_file_name = '' self.destination_map_config_file_name = '' self.cameramap = [] self.current_wp = None """ RVIZ-APPs """ self.map_forRviz_file_name = self._widget.map_to_rviz_path_edit.text() self.utm_x_value = float(self._widget.utm_x_edit.text()) self.utm_y_value = float(self._widget.utm_y_edit.text()) self.utm_phi_value = float(self._widget.utm_phi_edit.text()) self.joao_origin_utm_x_value = float( self._widget.joao_origin_utm_x_edit.text()) self.joao_origin_utm_y_value = float( self._widget.joao_origin_utm_y_edit.text()) self.fiducials_map = [ ] # contain the position of the fiducial in camera frame self.indoor = self._widget.indoor_checkBox_edit.isChecked() self.init_transf = False # True if map already drew self.origin_cam_x = 0.0 self.origin_cam_y = 0.0 self.last_robot_x_edit = 0.0 #float(self._widget.get_pos_robot_x_edit.text()) self.last_robot_y_edit = 0.0 #float(self._widget.get_pos_robot_y_edit.text()) self.last_robot_yaw_edit = 0.0 #float(self._widget.get_pos_robot_yaw_edit.text()) self.angle_btwXcam_East = 0.0 """ Connect stuff here """ # self.model = QStandardItemModel(self._widget.arc_list) # self._widget.name_edit.setValidator(QDoubleValidator()) # self._widget.path_edit.setValidator(QDoubleValidator()) # self._widget.in_case_edit.setValidator(QDoubleValidator()) # self._widget.y_edit.setValidator(QDoubleValidator()) # self._widget.map_name_edit.setValidator() """ Start nodes """ self._widget.launch_camera_start_button.released.connect( self.start_camera_is1500_launchFile) self._widget.color_launch_camera_label.setStyleSheet( "background-color:#ff0000;") self._widget.launch_supervisor_start_button.released.connect( self.start_supervisor_launchFile) self._widget.launch_supervisor_color_label.setStyleSheet( "background-color:#ff0000;") self._widget.rviz_start_button.released.connect(self.start_rviz) self._widget.color_rviz_label.setStyleSheet( "background-color:#ff0000;") self._widget.target_start_button.released.connect( self.target_waypontPy_run) self._widget.color_target_label.setStyleSheet( "background-color:#ff0000;") self._widget.distance_start_button.released.connect( self.distance_throughDeadZone_run) self._widget.color_distance_label.setStyleSheet( "background-color:#ff0000;") self._widget.test_button.released.connect(self.test_button_function) """ Set map """ self._widget.send_map_param_button.released.connect( self.set_map_rosparam) self._widget.map_param_edit.setValidator(QDoubleValidator()) """ Add/modify map """ self._widget.file_name_button.released.connect(self.get_file) self._widget.desination_file_name_button.released.connect( self.get_folder) self._widget.desination_save_file_button.released.connect( self.save_file) self._widget.config_map_file_name_button.released.connect( self.get_file_yaml) self._widget.config_map_save_file_button.released.connect( self.config_save_file) self.model = QStandardItemModel(self._widget.map_from_mapYaml_list) self.model.itemChanged.connect(self.on_change_mapList) # Screen explaination msg # self._widget.name_edit.setToolTip("Set the name of the folder which will contain the map ") # self._widget.path_edit.setToolTip("Path of th map") # self._widget.file_name_label.setToolTipe("Map file which be added to the map folder of the robot") # Doesn't work # self._widget.name_edit.description = "This is label name_edit" # self._widget.path_edit.description = "This is label path_edit" # self._widget.file_name_button.description = "This is the OK button" # # for widget in (self._widget.name_edit, self._widget.path_edit, # self._widget.file_name_button): # widget.bind("<Enter>", self.on_enter) # widget.bind("<Leave>", self.on_leave) self._widget.map_name_edit.textChanged.connect(self.map_name_change) """ Rviz part """ self._widget.utm_x_edit.setValidator(QDoubleValidator()) self._widget.utm_y_edit.setValidator(QDoubleValidator()) self._widget.utm_phi_edit.setValidator(QDoubleValidator()) self._widget.utm_x_edit.textChanged.connect(self.utm_x_change) self._widget.utm_y_edit.textChanged.connect(self.utm_y_change) self._widget.utm_phi_edit.textChanged.connect(self.utm_phi_change) self._widget.joao_origin_utm_x_edit.setValidator(QDoubleValidator()) self._widget.joao_origin_utm_y_edit.setValidator(QDoubleValidator()) self._widget.joao_origin_utm_x_edit.textChanged.connect( self.joao_origin_utm_x_change) self._widget.joao_origin_utm_y_edit.textChanged.connect( self.joao_origin_utm_y_change) self._widget.indoor_checkBox_edit.stateChanged.connect( self.indoor_isCheck) self._widget.reset_init_map_file_button.released.connect( self.reset_init_change) self._widget.get_position_button.released.connect(self.get_pos_change) self._widget.get_pos_robot_x_edit.setValidator(QDoubleValidator()) self._widget.get_pos_robot_y_edit.setValidator(QDoubleValidator()) self._widget.get_pos_robot_yaw_edit.setValidator(QDoubleValidator()) # Buttons self._widget.map_to_rviz_send_file_button.released.connect( self.visualize_fiducials) self._widget.map_to_rviz_name_button.released.connect( self.get_file_map_to_rviz) """ ROS """ self.marker_pub = rospy.Publisher( '/fiducials_position', visualization_msgs.msg.MarkerArray, queue_size=10) # publish fiducials for a chosen map self.currentMap_marker_pub = rospy.Publisher( '/fiducials_position_current', visualization_msgs.msg.MarkerArray, queue_size=10) #publish currend used fiducials self.camera_pos_sub = rospy.Subscriber("/base_link_odom_camera_is1500", Odometry, self.publish_transform_pos) # self.camera_pos_sub = rospy.Subscriber("/position_camera_is1500", Odometry, self.publish_transform_pos) self.transform_cameraPos_pub = rospy.Publisher( '/transform_cameraPos_pub', Odometry, queue_size=1) self.tf_buffer = tf2_ros.Buffer() self.tf_listner = tf2_ros.TransformListener(self.tf_buffer) self.fromMetric_sub = rospy.Subscriber('/pointsFromMetric', GetPointsFromMetric, self.publish_metric_to_rviz) self.transform_metric_pub = rospy.Publisher( '/rviz_pointsFromMetric', visualization_msgs.msg.Marker, queue_size=10)
def init_model(title, view): model = QStandardItemModel(view) model.setColumnCount(1) model.setHeaderData(0, Qt.Horizontal, title) return model
def __init__(self, context): super(VinoGraph, self).__init__(context) # Give QObjects reasonable names self.setObjectName('VinoGraph') # Process standalone plugin command-line arguments from argparse import ArgumentParser parser = ArgumentParser() # Add argument(s) to the parser. parser.add_argument("-q", "--quiet", action="store_true", dest="quiet", help="Put plugin in silent mode") args, unknowns = parser.parse_known_args(context.argv()) if not args.quiet: print 'arguments: ', args print 'unknowns: ', unknowns # Create QWidget self._widget = QWidget() # Get path to UI file which should be in the "resource" folder of this package ui_file = os.path.join(rospkg.RosPack().get_path('rqt_vino_plugin'), 'resource', 'rqt_vino_plugin.ui') # Extend the widget with all attributes and children from UI file loadUi(ui_file, self._widget, {'InteractiveGraphicsView': InteractiveGraphicsView}) # Give QObjects reasonable names self._widget.setObjectName('VinoGraphUi') # Show _widget.windowTitle on left-top of each plugin (when # it's set in _widget). This is useful when you open multiple QListView # plugins at once. Also if you open multiple instances of your # plugin at once, these lines add number to make it easy to # tell from pane to pane. if context.serial_number() > 1: self._widget.setWindowTitle(self._widget.windowTitle() + (' (%d)' % context.serial_number())) #A dict which stores pipeline name and dotgraph pair self._dotgraphs = dict() #which dotgraph currently drawing on the scence self._current_dotcode = None self._current_pipeline_name = '' #Pydot self.dotcode_factory = VinoPydotFactory() self.dot_to_qt = DotToQtGenerator() self.param_manager = ParamManagerWrapper() #Binding scene canvas self._scene = QGraphicsScene() self._scene.setBackgroundBrush(Qt.white) self._widget.graphics_view.setScene(self._scene) self._widget.graphics_view.setClickNodeCallback(self._edit_node) #QListview of pipelines self._listmodel = QStandardItemModel() self._widget.pipeline_name_listview.clicked.connect( self._display_choosed_pipeline) #self._widget.pipeline_name_listview.itemRenamed.connect(self._rename_pipeline) #Load pipelines from yaml file self._widget.load_pipeline_push_button.clicked.connect( self._load_pipeline) #Create a pipeline self._widget.create_pipeline_push_button.clicked.connect( self._create_pipeline) #Add input to pipeline graph self._widget.add_input_push_button.clicked.connect(self._add_input) #Add infer self._widget.add_inference_push_button.clicked.connect(self._add_infer) self._widget.add_output_push_button.clicked.connect(self._add_output) self._widget.save_pipeline_push_button.clicked.connect( self._save_pipeline) self.models_desc_file_path = os.path.join( rospkg.RosPack().get_path('vino_param_lib'), 'param', 'models.yaml') # Add widget to the user interface context.add_widget(self._widget)