|
@@ -7,7 +7,7 @@ from PyQt5.QtWidgets import QWidget, QFrame, QLabel, QLineEdit, QPushButton, QCo
|
|
|
from PyQt5.QtGui import QPixmap, QPainter, QResizeEvent, QCloseEvent, QPaintEvent, QFont
|
|
|
from PyQt5.QtCore import QSize, QTimer, Qt
|
|
|
|
|
|
-import auto_test
|
|
|
+import Count
|
|
|
from RobotData import Robot
|
|
|
import dijkstra.Map as mp
|
|
|
|
|
@@ -79,12 +79,12 @@ class ControlFrame(QFrame):
|
|
|
|
|
|
self.btnSend = QPushButton(self)
|
|
|
self.btnSend.setGeometry(150, 140, 100, 40)
|
|
|
- self.btnSend.setText(" 启动导航")
|
|
|
+ self.btnSend.setText(" 开始")
|
|
|
self.btnSend.clicked.connect(self.btnSendClick)
|
|
|
|
|
|
self.btnCancel = QPushButton(self)
|
|
|
self.btnCancel.setGeometry(150, 190, 100, 40)
|
|
|
- self.btnCancel.setText(" 取消导航")
|
|
|
+ self.btnCancel.setText(" 取消")
|
|
|
self.btnCancel.clicked.connect(self.btnCancelClick)
|
|
|
|
|
|
self.begQc.addItems(self.all_nodes_)
|
|
@@ -96,7 +96,7 @@ class ControlFrame(QFrame):
|
|
|
self.endSpaceQc.activated.connect(self.endSpaceQCChanged)
|
|
|
|
|
|
self.posestatic = QLabel(self)
|
|
|
- self.posestatic.setGeometry(260, 5, 100, 90)
|
|
|
+ self.posestatic.setGeometry(260, 20, 100, 90)
|
|
|
|
|
|
self.LedLabel = QLabel(self)
|
|
|
self.LedLabel.setGeometry(80, 160, 50, 50)
|
|
@@ -104,12 +104,12 @@ class ControlFrame(QFrame):
|
|
|
# 发送轴距
|
|
|
self.wheelbasestatic = QLabel(self)
|
|
|
self.wheelbasestatic.setText("轴距:")
|
|
|
- self.wheelbasestatic.setGeometry(260, 90, 40, 30)
|
|
|
+ self.wheelbasestatic.setGeometry(260, 100, 40, 30)
|
|
|
self.WheelBaseEdit = QLineEdit(self)
|
|
|
self.WheelBaseEdit.setText("3.3")
|
|
|
- self.WheelBaseEdit.setGeometry(300, 90, 50, 30)
|
|
|
+ self.WheelBaseEdit.setGeometry(300, 100, 50, 30)
|
|
|
|
|
|
- self.btnModelCheck = QCheckBox("双车模式", self)
|
|
|
+ self.btnModelCheck = QCheckBox("整体协调", self)
|
|
|
self.btnModelCheck.setGeometry(360, 130, 100, 40)
|
|
|
self.btnModelCheck.clicked.connect(self.MainAgvchangecb)
|
|
|
|
|
@@ -127,6 +127,11 @@ class ControlFrame(QFrame):
|
|
|
self.btnAutoDirect.setGeometry(260, 130, 100, 40)
|
|
|
self.btnAutoDirect.setCheckState(Qt.Checked)
|
|
|
|
|
|
+ self.btnAutoBegChanged = QCheckBox(self)
|
|
|
+ self.btnAutoBegChanged.setText("起点自动")
|
|
|
+ self.btnAutoBegChanged.setGeometry(260, 10, 100, 20)
|
|
|
+ self.btnAutoBegChanged.setCheckState(Qt.Checked)
|
|
|
+
|
|
|
def Update(self):
|
|
|
|
|
|
if self.robot_.timedRobotStatu_.timeout() == False:
|
|
@@ -134,6 +139,9 @@ class ControlFrame(QFrame):
|
|
|
y = self.robot_.timedRobotStatu_.statu.y
|
|
|
yaw = self.robot_.timedRobotStatu_.statu.theta
|
|
|
self.posestatic.setText("x : %.3f\ny : %.3f\nΘ : %.2f°" % (x, y, yaw * 180 / math.pi))
|
|
|
+ if self.btnAutoBegChanged.checkState()==Qt.Checked:
|
|
|
+ [label,pt]=mp.DijikstraMap().findNeastNode([x,y])
|
|
|
+ self.begQc.setCurrentText(label)
|
|
|
|
|
|
statu = "min-width: 32px; min-height: 32px;max-width:32px;\
|
|
|
max-height: 32px;border-radius: 16px; border:1px solid black;background:green"
|
|
@@ -187,7 +195,6 @@ class ControlFrame(QFrame):
|
|
|
if self.robot_.IsMainModeStatu():
|
|
|
self.btnAutoDirect.setCheckState(Qt.Unchecked)
|
|
|
|
|
|
-
|
|
|
def AutoCheck(self):
|
|
|
if self.btnAuto.checkState()==Qt.Checked:
|
|
|
self.robot_.autoTest_=True
|
|
@@ -247,7 +254,6 @@ class CountFrame(QFrame):
|
|
|
QFrame.__init__(self)
|
|
|
|
|
|
self.InitUI()
|
|
|
-
|
|
|
self.timer_ = QTimer()
|
|
|
self.timer_.timeout.connect(self.UpdateUI)
|
|
|
self.timer_.start(200)
|
|
@@ -262,7 +268,7 @@ class CountFrame(QFrame):
|
|
|
self.static2.setGeometry(5, 40, 200, 30)
|
|
|
|
|
|
def UpdateUI(self):
|
|
|
- load_str = "重载导航次数 : %d" % (auto_test.TestCount().loadCount())
|
|
|
- single_str = "单车导航次数 : %d" % (auto_test.TestCount().singleCount())
|
|
|
+ load_str = "重载导航次数 : %d" % (Count.TestCount().loadCount())
|
|
|
+ single_str = "单车导航次数 : %d" % (Count.TestCount().singleCount())
|
|
|
self.static1.setText(load_str)
|
|
|
self.static2.setText(single_str)
|