This commit is contained in:
artem30801@gmail.com
2019-03-12 14:13:56 +03:00

View File

@@ -109,7 +109,7 @@ class Client:
if self.copter_id is None:
self.copter_id = self.get_response("id")
print("Got copter id:", self.copter_id)
# drone_list.insert("", "end", self.addr[0], text=self.copter_id) # TODO to qt
model.appendRow((QStandardItem(self.copter_id), )) # TODO: get responses for another columns
def _send_all(self, msg):
self.socket.sendall(struct.pack('>I', len(msg)) + msg)
@@ -258,13 +258,6 @@ class MainWindow(QtWidgets.QMainWindow):
self.ui.action_send_animations.triggered.connect(self.send_animations)
#Initing table and table model
model = QStandardItemModel()
item = QStandardItem()
model.setHorizontalHeaderLabels(
('copter ID', 'animation ID', 'battery V', 'battery %', 'selfcheck', 'time UTC')
)
model.setColumnCount(6)
model.setRowCount(20)
self.ui.tableView.setModel(model)
self.ui.tableView.horizontalHeader().setStretchLastSection(True)
@@ -325,6 +318,12 @@ class MainWindow(QtWidgets.QMainWindow):
# ANS = dr.get_response("someshit")
# print(ANS)
model = QStandardItemModel()
model.setHorizontalHeaderLabels(
('copter ID', 'animation ID', 'battery V', 'battery %', 'selfcheck', 'time UTC')
)
model.setColumnCount(6)
model.setRowCount(0)
# Pre-initialization
# reading config