Example #1
0
	def update_display(self):
		self.clear_display()

		self.update_flight_plan()

		for i in xrange(len(self.loaded_movement.waypoints)):
			self._widget.table_waypoints.insertRow(i)
			item_x = QTableWidgetItem(str(self.loaded_movement.waypoints[i].x))
			item_y = QTableWidgetItem(str(self.loaded_movement.waypoints[i].y))
			item_z = QTableWidgetItem(str(self.loaded_movement.waypoints[i].z))
			item_yaw = QTableWidgetItem(str(self.loaded_movement.waypoints[i].yaw))
			item_x.setTextAlignment(QtCore.Qt.AlignVCenter | QtCore.Qt.AlignRight)
			item_y.setTextAlignment(QtCore.Qt.AlignVCenter | QtCore.Qt.AlignRight)
			item_z.setTextAlignment(QtCore.Qt.AlignVCenter | QtCore.Qt.AlignRight)
			item_yaw.setTextAlignment(QtCore.Qt.AlignVCenter | QtCore.Qt.AlignRight)
			self._widget.table_waypoints.setItem(i, 0, item_x)
			self._widget.table_waypoints.setItem(i, 1, item_y)
			self._widget.table_waypoints.setItem(i, 2, item_z)
			self._widget.table_waypoints.setItem(i, 3, item_yaw)

		self.update_plot()
Example #2
0
    def _add_relations_table_row(self, relation, editable_src=False, editable_dst=False):
        src = QTableWidgetItem(utils.ontology_type2name(relation['src']))
        rel = QTableWidgetItem(utils.ontology_type2name(relation['type']))
        dst = QTableWidgetItem(utils.ontology_type2name(relation['dst']))

        src.id = relation['src']
        rel.id = relation['type']
        dst.id = relation['dst']

        src.setTextAlignment(Qt.AlignRight)
        rel.setTextAlignment(Qt.AlignHCenter)
        dst.setTextAlignment(Qt.AlignLeft)

        if not editable_src:
            src.setFlags(src.flags() & ~Qt.ItemIsEditable)
        rel.setFlags(rel.flags() & ~Qt.ItemIsEditable)
        if not editable_dst:
            dst.setFlags(dst.flags() & ~Qt.ItemIsEditable)

        self.wm_relations_widget.insertRow(self.wm_relations_widget.rowCount())
        # self.wm_relations_widget.setSpan(self.wm_relations_widget.rowCount()-1, 0, 1, 3)
        self.wm_relations_widget.setItem(self.wm_relations_widget.rowCount() - 1, 0, src)
        self.wm_relations_widget.setItem(self.wm_relations_widget.rowCount() - 1, 1, rel)
        self.wm_relations_widget.setItem(self.wm_relations_widget.rowCount() - 1, 2, dst)