update 新UI

This commit is contained in:
FrankCV2048
2024-10-22 20:03:05 +08:00
parent 3baa16b54f
commit 86789aa5c4
13 changed files with 106882 additions and 104 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 443 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

1
Image/calendar.svg Normal file
View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1729426491984" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5653" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M890.127 145.672h-43.389V132.78c0-38.644-31.466-70.234-69.922-70.234h-1.032c-38.458 0-69.922 31.59-69.922 70.234v12.892h-386.7V132.78c0-38.644-31.465-70.234-69.922-70.234h-1.063c-38.457 0-69.923 31.59-69.923 70.234v12.892h-43.296c-38.458 0-69.923 31.622-69.923 70.207v671.446c0 38.644 31.466 70.236 69.923 70.236h755.17c38.458 0 69.922-31.592 69.922-70.236V215.879c0-38.585-31.464-70.207-69.923-70.207zM733.83 132.78c0-23.222 18.793-42.139 41.954-42.139h1.032c23.13 0 41.954 18.918 41.954 42.139v124.927c0 23.224-18.824 42.14-41.954 42.14h-1.032c-23.161 0-41.954-18.916-41.954-42.14V132.779z m-527.607 0c0-23.222 18.793-42.139 41.955-42.139h1.063c23.098 0 41.954 18.918 41.954 42.139v124.927c0 23.224-18.856 42.14-41.954 42.14h-1.063c-23.162 0-41.955-18.916-41.955-42.14V132.779z m683.904 768.626H134.958c-7.585 0-13.985-6.525-13.985-14.08V393.649h783.138v493.676c0 7.555-6.399 14.08-13.984 14.08z" fill="#ffffff" p-id="5654"></path><path d="M223.755 494.2H352.78v63.488H223.755V494.2zM449.035 494.2h128v63.488h-128V494.2zM673.291 494.2h125.952v63.488H673.291V494.2zM223.755 623.224H352.78v62.464H223.755v-62.464zM449.035 623.224h128v62.464h-128v-62.464zM673.291 623.224h125.952v62.464H673.291v-62.464zM223.755 749.176H352.78v65.536H223.755v-65.536zM449.035 749.176h128v65.536h-128v-65.536zM673.291 749.176h125.952v65.536H673.291v-65.536z" fill="#ffffff" p-id="5655"></path></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1729415800488" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4330" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M423.844408 284.113794c-39.870006 0-72.156392 31.870406-72.156392 71.05778 0 39.25137 32.275719 71.05778 72.156392 71.05778 39.838008 0 72.124394-31.80641 72.124394-71.05778C495.968802 315.984201 463.693082 284.113794 423.844408 284.113794zM676.237121 624.651434l20.372314-20.062997c22.558872-22.185558 22.558872-58.183758 0-80.369315l-35.25157-34.686266c11.370098-19.433695 20.244321-40.307318 26.494675-62.439545l38.056764 0c31.870406 0 57.746446-25.438728 57.746446-56.807827l0-28.435911c0-31.369099-25.876039-56.871823-57.746446-56.871823l-37.619452 0c-5.941036-21.812242-14.495275-42.621869-25.556055-61.938236l33.875639-33.310334c22.558872-22.249555 22.558872-58.247755 0-80.369315l-20.372314-20.126994c-22.558872-22.185558-59.122377-22.185558-81.617252 0l-33.246338 32.681033c-20.276319-11.626086-42.216556-20.681633-65.40473-26.931986l0-38.184758C495.968802 25.438728 470.124761 0 438.254354 0l-28.841225 0c-31.870406 0-57.714447 25.438728-57.714447 56.807827l0 38.184758c-23.188174 6.250354-45.117744 15.316567-65.436728 26.931986l-33.182341-32.681033c-22.526874-22.185558-59.090378-22.185558-81.617252 0l-20.404313 20.126994c-22.526874 22.121561-22.526874 58.119761 0 80.369315l33.875639 33.310334c-11.028782 19.316367-19.593687 40.125994-25.534723 61.938236l-37.65145 0C89.834441 284.988418 64.022399 310.480476 64.022399 341.86024l0 28.435911c0 31.369099 25.812042 56.807827 57.714447 56.807827l38.088763 0c6.186358 22.121561 15.092578 42.995183 26.441345 62.439545l-35.219572 34.686266c-22.526874 22.185558-22.526874 58.183758 0 80.369315l20.404313 20.062997c22.526874 22.185558 59.090378 22.185558 81.617252 0l35.432895-34.878256c19.689683 10.996783 40.872623 19.625686 63.186174 25.556055l0 36.435511c0 31.369099 25.844041 56.807827 57.714447 56.807827l28.841225 0c31.870406 0 57.714447-25.438728 57.714447-56.807827l0-36.435511c22.34555-5.941036 43.496492-14.559272 63.154175-25.556055l35.496892 34.878256C617.114744 646.847658 653.678249 646.847658 676.237121 624.651434zM423.844408 513.222339c-87.654284 0-158.744063-70.001833-158.744063-156.237521 0-86.374348 71.089779-156.301518 158.744063-156.301518s158.712064 69.937836 158.712064 156.301518C582.556472 443.231171 511.498692 513.222339 423.844408 513.222339zM931.979001 818.519074l-18.249755 0c-2.879856-10.623469-6.996983-20.681633-12.372714-30.057164l16.372514-16.19119c10.996783-10.751462 10.996783-28.19059 0-38.995383l-9.876839-9.748846c-10.932786-10.751462-28.627902-10.751462-39.624686 0l-16.063197 15.871206c-9.812842-5.621052-20.500308-10.058164-31.689083-13.066014l0-18.495075c0-15.25257-12.564705-27.561289-27.9986-27.561289l-14.004633 0c-15.497892 0-27.9986 12.308718-27.9986 27.561289l0 18.495075c-11.25277 2.997183-21.876239 7.434295-31.753079 13.066014l-16.127194-15.871206c-10.879456-10.751462-28.627902-10.751462-39.560689 0l-9.940836 9.748846c-10.879456 10.815459-10.879456 28.243921 0 38.995383l16.436511 16.19119c-5.311734 9.375531-9.439528 19.433695-12.372714 30.057164L638.926987 818.519074c-15.433895 0-27.9986 12.308718-27.9986 27.561289l0 13.748646c0 15.25257 12.564705 27.561289 27.9986 27.561289l18.495075 0c2.997183 10.751462 7.316967 20.873623 12.810026 30.313151l-17.119144 16.809827c-10.879456 10.751462-10.879456 28.19059 0 38.995383l9.940836 9.684849c10.932786 10.815459 28.681233 10.815459 39.560689 0l17.247138-16.873823c9.503525 5.311734 19.753679 9.503525 30.622469 12.372714l0 17.684449c0 15.188574 12.500708 27.561289 27.9986 27.561289l14.004633 0c15.433895 0 27.9986-12.372714 27.9986-27.561289l0-17.684449c10.751462-2.879856 21.065614-7.06098 30.622469-12.372714l17.119144 16.873823c10.996783 10.815459 28.681233 10.815459 39.624686 0l9.876839-9.684849c10.996783-10.815459 10.996783-28.243921 0-38.995383l-17.065814-16.809827c5.503725-9.439528 9.812842-19.561689 12.810026-30.313151l18.495075 0c15.497892 0 27.9986-12.308718 27.9986-27.561289l0-13.748646C959.977601 830.838458 947.476893 818.519074 931.979001 818.519074zM785.490325 929.20154c-42.557872 0-76.998817-33.939636-76.998817-75.80421s34.440945-75.80421 76.998817-75.80421c42.493875 0 76.998817 33.939636 76.998817 75.80421S827.984201 929.20154 785.490325 929.20154zM785.490325 818.081763c-19.369699 0-34.995583 15.433895-34.995583 34.440945 0 19.06038 15.625886 34.440945 34.995583 34.440945 19.316367 0 34.995583-15.369899 34.995583-34.440945C820.485909 833.515657 804.796027 818.081763 785.490325 818.081763z" fill="#ffffff" p-id="4331"></path></svg>

After

Width:  |  Height:  |  Size: 4.6 KiB

1
Image/icon_other.svg Normal file
View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1729433249559" class="icon" viewBox="0 0 1030 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6750" xmlns:xlink="http://www.w3.org/1999/xlink" width="201.171875" height="200"><path d="M376.053929 561.350639H86.337861A86.440889 86.440889 0 0 0 0 647.6885v289.922125a86.492404 86.492404 0 0 0 86.337861 86.389375H376.053929a86.492404 86.492404 0 0 0 86.389375-86.389375v-289.922125A86.440889 86.440889 0 0 0 376.053929 561.350639z m8.396821 376.053929a8.551363 8.551363 0 0 1-8.396821 8.602877H86.337861a8.499849 8.499849 0 0 1-8.345306-8.39682v-289.922125a8.448335 8.448335 0 0 1 8.345306-8.345307H376.053929a8.499849 8.499849 0 0 1 8.396821 8.345307z" p-id="6751" fill="#ffffff"></path><path d="M1018.694034 287.91307l-82.422779-142.488379a38.97052 38.97052 0 1 0-67.483651 38.996277l82.422779 142.488379a8.602878 8.602878 0 0 1-3.090854 11.487675l-251.08039 144.909548a8.087735 8.087735 0 0 1-6.336251 0.824228 8.242278 8.242278 0 0 1-5.151424-3.863568L540.899487 229.18684a8.499849 8.499849 0 0 1 3.090854-11.436161l251.028876-144.961062a38.996277 38.996277 0 0 0-38.944763-67.535165L504.839521 150.215515a85.668176 85.668176 0 0 0-40.284133 52.699064 84.637891 84.637891 0 0 0-1.906027 9.272563V127.90985A86.492404 86.492404 0 0 0 376.053929 41.520475H86.337861A86.440889 86.440889 0 0 0 0 127.90985v289.922125a86.440889 86.440889 0 0 0 86.337861 86.337861H376.053929a86.440889 86.440889 0 0 0 86.595432-86.337861V238.253345a85.822719 85.822719 0 0 0 10.302847 29.929772L618.170842 519.263507a85.513633 85.513633 0 0 0 61.817084 42.087132h-68.616963a86.492404 86.492404 0 0 0-86.389375 86.337861v289.922125a86.543918 86.543918 0 0 0 86.389375 86.389375H901.499145a86.492404 86.492404 0 0 0 86.337861-86.389375v-289.922125A86.440889 86.440889 0 0 0 901.499145 561.350639h-195.187444a85.925747 85.925747 0 0 0 29.723715-10.302847l251.08039-145.16712a86.440889 86.440889 0 0 0 31.578228-117.967602zM384.656807 417.831975A8.499849 8.499849 0 0 1 376.053929 426.177281H86.337861a8.448335 8.448335 0 0 1-8.345306-8.345306V127.90985a8.499849 8.499849 0 0 1 8.345306-8.396821H376.053929a8.551363 8.551363 0 0 1 8.396821 8.396821z m524.981587 229.856525v289.922125a8.499849 8.499849 0 0 1-8.345306 8.39682h-289.922125a8.551363 8.551363 0 0 1-8.396821-8.39682v-289.922125a8.499849 8.499849 0 0 1 8.396821-8.345307H901.499145a8.448335 8.448335 0 0 1 8.139249 8.345307z" p-id="6752" fill="#ffffff"></path></svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -1,6 +1,14 @@
<RCC>
<qresource prefix="main">
<file>Image/backgroud_head_btn.jpg</file>
<file>Image/wait.png</file>
<file>Image/1.png</file>
<file>Image/icon_other.svg</file>
<file>Image/backgroud_leftMenu_btn_child.jpg</file>
<file>Image/calendar.svg</file>
<file>Image/icon_leftMenu_btn_sys.svg</file>
<file>Image/title_ico.png</file>
<file>Image/backgroud_leftMenu_btn.jpg</file>
<file>Image/logout.svg</file>
<file>Image/login.svg</file>
</qresource>

101875
MainRecources_rc.py Normal file

File diff suppressed because it is too large Load Diff

2720
MainWin.ui

File diff suppressed because it is too large Load Diff

View File

@ -1,40 +1,49 @@
from PySide6.QtWidgets import QApplication, QWidget, QVBoxLayout, QPushButton
import configparser
import json
import logging
import queue
import sys
from multiprocessing import Process
from PyQt5.uic.properties import QtWidgets
from PySide6.QtCore import QThread, Signal, Slot, QObject, QEvent
from PySide6.QtGui import QIntValidator, QStandardItemModel, QStandardItem, Qt, QMovie
from PySide6.QtWidgets import QApplication, QMainWindow, QPushButton, QLabel, QHeaderView, QTableWidget, \
QTableWidgetItem, QWidget, QHBoxLayout, QAbstractItemView, QMessageBox
from datetime import datetime
import Util.util_pic
from Util.util_ini import writeFeedLine_to_ini
import Constant
from CU.Command import FeedCommand
from CU.Feeding import FeedLine, FeedingConfig, Feeding, FeedStatus
from Util.util_log import QTextEditLogger
from Vision.camera_coordinate_dete import Detection
from COM.COM_Robot import RobotClient
from Expection import Error_Code
from queue import Queue
from Model.RobotModel import *
import time
from queue import Queue
from Model.Position import Real_Position, Detection_Position
from threading import Thread
from CU.Command import Status
from Util.util_log import log
from ui_MainWin import Ui_MainWindow
class MainWindow1(QMainWindow, Ui_MainWindow):
def __init__(self):
super(MainWindow1, self).__init__()
self.setupUi(self)
self.frame_sys_seting.setVisible(False)
self.frame_other_set.hide()
if __name__ == "__main__":
app = QApplication(sys.argv)
window = QWidget()
layout = QVBoxLayout()
# 创建按钮
button = QPushButton("Button")
# 使用 QSS 设置按钮样式
window.setStyleSheet("""
QPushButton {
background-color: #4CAF50; /* 按钮背景色 */
color: white; /* 按钮文本颜色 */
padding: 10px; /* 按钮内边距 */
border: none; /* 移除所有默认边框 */
border-right: 20px solid white; /* 仅设置右边的边框 */
background-color: qlineargradient(x1: 0.5, y1: 0, x2: 0.5, y2: 1, stop: 0 #4CAF50, stop: 0.5 rgba(0, 235, 0, 0), stop: 1 #4CAF50);
border-width: 2px; /* 边框宽度 */
border-radius: 5px; /* 按钮圆角 */
}
QPushButton:hover {
background-color: #45a049; /* 悬停时背景色 */
}
""")
##
# border-color:qradialgradient(cx: 0.5, cy: 0.5
# , radius: 0.8, fx:0.5 ,fy:0.5,
# stop: 0 rgba(255, 255, 255, 255),
# stop: 1 rgba(19, 36, 69, 255));
layout.addWidget(button)
window.setLayout(layout)
window = MainWindow1()
window.show()
sys.exit(app.exec())

120
test6.py Normal file
View File

@ -0,0 +1,120 @@
from PySide6.QtWidgets import QApplication, QWidget, QVBoxLayout, QPushButton, QFrame, QLabel, QScrollArea
from PySide6.QtCore import Qt
import sys
class FriendList(QWidget):
def __init__(self):
super().__init__()
# 使用 QVBoxLayout 布局
self.layout = QVBoxLayout()
self.layout.setSpacing(0)
self.layout.setContentsMargins(0, 0, 0, 0)
# 添加好友分组
self.group1 = self.create_group("我的好友", ["小明", "小红", "小李"])
self.group2 = self.create_group("同学", ["张三", "李四", "王五"])
self.group3 = self.create_group("家人", ["爸爸", "妈妈", "姐姐"])
# 将每个分组添加到主布局
self.layout.addWidget(self.group1)
self.layout.addWidget(self.group2)
self.layout.addWidget(self.group3)
# 设置主布局
self.setLayout(self.layout)
def create_group(self, group_name, friends):
# 创建一个 QFrame 作为分组的容器
group_frame = QFrame()
group_layout = QVBoxLayout()
group_layout.setSpacing(0)
group_layout.setContentsMargins(0, 0, 0, 0)
# 创建分组按钮
group_button = QPushButton(group_name)
group_button.setObjectName("groupButton")
group_button.setCheckable(True)
group_button.setChecked(False) # 默认不展开
group_button.clicked.connect(lambda: self.toggle_group(group_frame)) # 切换菜单显示
# 创建好友列表
friend_frame = QFrame()
friend_layout = QVBoxLayout()
friend_layout.setSpacing(0)
friend_layout.setContentsMargins(20, 0, 0, 0) # 设置左边距,使其与分组按钮有明显缩进
for friend in friends:
friend_label = QLabel(friend)
friend_label.setObjectName("friendLabel")
friend_layout.addWidget(friend_label)
# 设置好友列表布局并隐藏
friend_frame.setLayout(friend_layout)
friend_frame.setVisible(False) # 默认隐藏
# 将按钮和好友列表添加到分组布局
group_layout.addWidget(group_button)
group_layout.addWidget(friend_frame)
group_frame.setLayout(group_layout)
# 绑定子菜单,用于后续切换显示
group_frame.menu = friend_frame
return group_frame
def toggle_group(self, group_frame):
# 切换好友列表的显示和隐藏
group_frame.menu.setVisible(not group_frame.menu.isVisible())
if __name__ == "__main__":
app = QApplication(sys.argv)
# 创建主窗口
window = QWidget()
layout = QVBoxLayout()
# 创建 FriendList 控件
friend_list = FriendList()
# 将 FriendList 放入滚动区域
scroll_area = QScrollArea()
scroll_area.setWidgetResizable(True)
scroll_area.setWidget(friend_list)
# 将滚动区域添加到主布局
layout.addWidget(scroll_area)
window.setLayout(layout)
# 设置窗口大小
window.resize(300, 500)
window.show()
# 使用 QSS 设置样式,模拟类似 QQ 好友列表的样式
app.setStyleSheet("""
QPushButton#groupButton {
background-color: #3A9;
border: none;
padding: 10px;
font-size: 16px;
color: white;
text-align: left;
}
QPushButton#groupButton:checked {
background-color: #5BB;
}
QLabel#friendLabel {
background-color: #EEE;
padding: 5px;
font-size: 14px;
color: black;
text-align: left;
}
QLabel#friendLabel:hover {
background-color: #CCC;
}
QFrame {
background-color: #FFF;
}
""")
sys.exit(app.exec())

2097
ui_MainWin.py Normal file

File diff suppressed because it is too large Load Diff

View File

@ -413,7 +413,7 @@ font: 10pt &quot;楷体&quot;;
<string>10</string>
</property>
</widget>
<widget class="QPushButton" name="pushButton_num6">
<widget class="QPushButton" name="pushButton_4">
<property name="geometry">
<rect>
<x>80</x>
@ -500,7 +500,7 @@ font: 10pt &quot;楷体&quot;;
<widget class="QPushButton" name="pushButton_num_free">
<property name="geometry">
<rect>
<x>150</x>
<x>220</x>
<y>60</y>
<width>61</width>
<height>31</height>
@ -582,7 +582,7 @@ font: 10pt &quot;楷体&quot;;</string>
<zorder>pushButton_num_free</zorder>
<zorder>pushButton_num5</zorder>
<zorder>pushButton_num1</zorder>
<zorder>pushButton_num6</zorder>
<zorder>pushButton_4</zorder>
<zorder>pushButton_num3</zorder>
<zorder>pushButton_num4</zorder>
<zorder>pushButton_num2</zorder>