修改UI
This commit is contained in:
parent
4d5767aa24
commit
6efdb2016f
|
@ -15,6 +15,8 @@ from robowaiter.proto import GrabSim_pb2
|
|||
from robowaiter.proto import GrabSim_pb2_grpc
|
||||
import copy
|
||||
import os
|
||||
|
||||
from robowaiter.scene.ui import scene_ui
|
||||
from robowaiter.utils import get_root_path
|
||||
from sklearn.cluster import DBSCAN
|
||||
from matplotlib import pyplot as plt
|
||||
|
@ -1452,7 +1454,9 @@ class Scene:
|
|||
# plt.text(0, 0.5, f'新增语义信息:{walker_detect_count}', fontsize=10)
|
||||
# plt.text(0, 0.3, f'更新语义信息:{update_info_count}', fontsize=10)
|
||||
# plt.text(0, 0.1, f'已存语义信息:{self.infoCount}', fontsize=10)
|
||||
# 元组传参 pyqt5中的函数名, 四个参数
|
||||
|
||||
self.ui_func(("get_info", walker_detect_count, obj_detect_count, update_info_count, self.infoCount))
|
||||
|
||||
# draw figures
|
||||
|
||||
|
|
|
@ -80,6 +80,7 @@ class UI(QMainWindow, Ui_MainWindow):
|
|||
self.btn_say.clicked.connect(self.btn_say_on_click)
|
||||
self.img_view_bt.setDragMode(QGraphicsView.ScrollHandDrag)
|
||||
|
||||
|
||||
# 下拉菜单绑定函数
|
||||
# 下拉菜单.seleted.connect(self.你写的函数)
|
||||
|
||||
|
@ -88,8 +89,13 @@ class UI(QMainWindow, Ui_MainWindow):
|
|||
# self.label_moved = False # 用于判断是否移动了标签
|
||||
# self.drag_start_position = QPoint() # 记录鼠标按下时的位置
|
||||
|
||||
self.cb_task.setCurrentIndex(-1)
|
||||
self.cb_task.setPlaceholderText("请选择城市")
|
||||
|
||||
|
||||
# 多个添加条目
|
||||
self.cb_task.addItems(['Java', 'C#', 'PHP'])
|
||||
# 当下拉索引发生改变时发射信号触发绑定的事件
|
||||
self.cb_task.currentIndexChanged.connect(self.selectionchange)
|
||||
|
||||
# 绑定任务演示按钮
|
||||
for example in example_list:
|
||||
|
@ -110,6 +116,25 @@ class UI(QMainWindow, Ui_MainWindow):
|
|||
|
||||
sys.exit(app.exec_())
|
||||
|
||||
def selectionchange(self, i):
|
||||
print(i)
|
||||
# self.create_example_click(dic[i])
|
||||
# 标签用来显示选中的文本
|
||||
# currentText():返回选中选项的文本
|
||||
# self.btn1.setText(self.cb.currentText())
|
||||
# print('Items in the list are:')
|
||||
# # 输出选项集合中每个选项的索引与对应的内容
|
||||
# # count():返回选项集合中的数目
|
||||
# for count in range(self.cb.count()):
|
||||
# print('Item' + str(count) + '=' + self.cb.itemText(count))
|
||||
# print('current index', i, 'selection changed', self.cb.currentText())
|
||||
|
||||
def get_info(self, walker_detect_count, obj_detect_count, update_info_count, infoCount):
|
||||
print(obj_detect_count)
|
||||
self.textEdit_5.clear()
|
||||
self.textEdit_5.append(str(obj_detect_count))
|
||||
# self.textEdit_5.setText(walker_detect_count + "_" + obj_detect_count + "_" + update_info_count + "_" + infoCount)
|
||||
|
||||
def new_history(self,customer_name,chat):
|
||||
role = chat["role"]
|
||||
content = chat["content"].strip()
|
||||
|
|
|
@ -101,8 +101,14 @@ class SceneUI(Scene):
|
|||
# plt.title("地图构建过程")
|
||||
# self.send_img("img_label_map")
|
||||
# plt.subplot(2, 7, 14) # 这里的2,1表示总共2行,1列,2表示这个位置是第2个子图
|
||||
|
||||
# walker_count 新增行人信息
|
||||
|
||||
# 新增语义信息
|
||||
new_add_info = len(cur_objs) - added_info + walker_count
|
||||
# plt.text(0, 0.5, f'新增语义信息:{new_add_info}', fontsize=10) # 在图中添加文字,x和y坐标是在这个图片大小内的相对位置,fontsize是字体大小
|
||||
|
||||
# 已存语义信息
|
||||
added_info += new_add_info
|
||||
# plt.text(0, 0.3, f'已存语义信息:{added_info}', fontsize=10) # 在图中添加文字,x和y坐标是在这个图片大小内的相对位置,fontsize是字体大小
|
||||
self.infoCount = added_info
|
||||
|
@ -126,6 +132,7 @@ class SceneUI(Scene):
|
|||
with open(file_json_name, 'w') as file:
|
||||
json.dump(obj_json_data, file)
|
||||
|
||||
|
||||
print("已绘制完成地图!!!")
|
||||
print("------------检测到的所有物品信息--------------")
|
||||
print(obj_json_data)
|
||||
|
|
|
@ -243,17 +243,18 @@ class Ui_MainWindow(object):
|
|||
self.btn_AT.setFont(font)
|
||||
self.btn_AT.setObjectName("btn_AT")
|
||||
self.verticalLayout.addWidget(self.btn_AT)
|
||||
self.comboBox = QtWidgets.QComboBox(self.centralwidget)
|
||||
self.cb_task = QtWidgets.QComboBox(self.centralwidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Minimum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.comboBox.sizePolicy().hasHeightForWidth())
|
||||
self.comboBox.setSizePolicy(sizePolicy)
|
||||
self.comboBox.setMinimumSize(QtCore.QSize(0, 25))
|
||||
self.comboBox.setCurrentText("")
|
||||
self.comboBox.setInsertPolicy(QtWidgets.QComboBox.InsertAtBottom)
|
||||
self.comboBox.setObjectName("comboBox")
|
||||
self.verticalLayout.addWidget(self.comboBox)
|
||||
sizePolicy.setHeightForWidth(self.cb_task.sizePolicy().hasHeightForWidth())
|
||||
self.cb_task.setSizePolicy(sizePolicy)
|
||||
self.cb_task.setMinimumSize(QtCore.QSize(0, 25))
|
||||
self.cb_task.setEditable(True)
|
||||
self.cb_task.setCurrentText("")
|
||||
self.cb_task.setInsertPolicy(QtWidgets.QComboBox.InsertAtBottom)
|
||||
self.cb_task.setObjectName("cb_task")
|
||||
self.verticalLayout.addWidget(self.cb_task)
|
||||
self.gridLayout.addLayout(self.verticalLayout, 1, 0, 1, 1)
|
||||
self.label_9 = QtWidgets.QLabel(self.centralwidget)
|
||||
font = QtGui.QFont()
|
||||
|
@ -291,7 +292,7 @@ class Ui_MainWindow(object):
|
|||
MainWindow.setStatusBar(self.statusbar)
|
||||
|
||||
self.retranslateUi(MainWindow)
|
||||
self.comboBox.setCurrentIndex(-1)
|
||||
self.cb_task.setCurrentIndex(-1)
|
||||
QtCore.QMetaObject.connectSlotsByName(MainWindow)
|
||||
|
||||
def retranslateUi(self, MainWindow):
|
||||
|
@ -317,7 +318,7 @@ class Ui_MainWindow(object):
|
|||
self.btn_GQA.setText(_translate("MainWindow", "具身多轮对话"))
|
||||
self.btn_OT.setText(_translate("MainWindow", "开放具身任务"))
|
||||
self.btn_AT.setText(_translate("MainWindow", "自主具身任务"))
|
||||
self.comboBox.setPlaceholderText(_translate("MainWindow", "其他任务"))
|
||||
self.cb_task.setPlaceholderText(_translate("MainWindow", "其他任务"))
|
||||
self.label_9.setText(_translate("MainWindow", "任务演示:(播放动画时需等待动画播放完毕才会重置场景)"))
|
||||
self.btn_say.setText(_translate("MainWindow", "说话"))
|
||||
self.label.setText(_translate("MainWindow", "语义信息"))
|
||||
|
|
|
@ -422,7 +422,7 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QComboBox" name="comboBox">
|
||||
<widget class="QComboBox" name="cb_task">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
|
@ -435,6 +435,9 @@
|
|||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="currentText">
|
||||
<string/>
|
||||
</property>
|
||||
|
@ -445,7 +448,7 @@
|
|||
<enum>QComboBox::InsertAtBottom</enum>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>其他任务</string>
|
||||
<string extracomment="其他任务">其他任务</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
Loading…
Reference in New Issue