update 更新ui和增加视觉模块
This commit is contained in:
14
Expection.py
14
Expection.py
@ -1,3 +1,13 @@
|
|||||||
from enum import Enum
|
from enum import Enum
|
||||||
class ErrorCode(Enum):
|
class Error_Code(Enum):
|
||||||
NETERROR = 404 #网络异常
|
SYS_SUCCESS = 100
|
||||||
|
SYS_NETERROR = 104 #网络异常
|
||||||
|
|
||||||
|
|
||||||
|
class VisionError_Code(Enum):
|
||||||
|
CAMERA_SUCCESS = 200
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 779 KiB After Width: | Height: | Size: 779 KiB |
|
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 66 KiB |
21
Model/Position.py
Normal file
21
Model/Position.py
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
|
||||||
|
"""
|
||||||
|
摄像头识别位置和角度
|
||||||
|
"""
|
||||||
|
class Detection_Position:
|
||||||
|
def __init__(self):
|
||||||
|
self.X = 0.0
|
||||||
|
self.Y = 0.0
|
||||||
|
self.Z = 0.0
|
||||||
|
self.U = 0.0
|
||||||
|
self.V = 0.0
|
||||||
|
self.W = 0.0
|
||||||
|
|
||||||
|
def init_position(self,X,Y,Z,U,V,W):
|
||||||
|
self.X = X
|
||||||
|
self.Y = Y
|
||||||
|
self.Z = Z
|
||||||
|
self.U = U
|
||||||
|
self.V = V
|
||||||
|
self.W = W
|
||||||
@ -1,7 +1,7 @@
|
|||||||
[Main]
|
[Main]
|
||||||
|
|
||||||
|
|
||||||
[Robot]
|
[Robot_Feed]
|
||||||
IPAddress=192.168.3.5
|
IPAddress=192.168.3.5
|
||||||
Port=8111
|
Port=8111
|
||||||
j1_min=-150
|
j1_min=-150
|
||||||
@ -18,3 +18,6 @@ j6_min=-150
|
|||||||
j6_max=+150
|
j6_max=+150
|
||||||
|
|
||||||
|
|
||||||
|
[Camera_Feed]
|
||||||
|
IPAddress=127.0.0.1
|
||||||
|
|
||||||
|
|||||||
18
Trace/README.md
Normal file
18
Trace/README.md
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# 路径处理
|
||||||
|
|
||||||
|
Code 在 Expection的VisionError_Code里 增加定义
|
||||||
|
## 提供视频流,
|
||||||
|
```
|
||||||
|
func1()
|
||||||
|
return Code,frame #返回错误代码和当前帧
|
||||||
|
```
|
||||||
|
|
||||||
|
## 提供当前摄像头位置识别结果
|
||||||
|
```
|
||||||
|
func2()
|
||||||
|
return Code,frame,position #返回带识别标签的当前图像 和 识别坐标结果Detection_Position对象
|
||||||
|
|
||||||
|
```
|
||||||
|
**注意:** 识别不到报异常Code且带有识别结果(标签和位置都绘制出来)的图像保存到本地位置,
|
||||||
|
保存位置在Seting.ini里面的[Camera_Feed]定义
|
||||||
|
|
||||||
18
Vision/README.md
Normal file
18
Vision/README.md
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
# 视觉处理
|
||||||
|
|
||||||
|
Code 在 Expection的VisionError_Code里 增加定义
|
||||||
|
## 1 提供视频流,
|
||||||
|
```
|
||||||
|
func1()
|
||||||
|
return Code,frame #返回错误代码和当前帧
|
||||||
|
```
|
||||||
|
|
||||||
|
## 2 提供当前摄像头位置识别结果
|
||||||
|
```
|
||||||
|
func2()
|
||||||
|
return Code,frame,position #返回带识别标签的当前图像 和 识别坐标结果Detection_Position对象
|
||||||
|
|
||||||
|
```
|
||||||
|
**注意:** 识别不到报异常Code且带有识别结果(标签和位置都绘制出来)的图像保存到本地位置,
|
||||||
|
保存位置在Seting.ini里面的[Camera_Feed]定义
|
||||||
|
|
||||||
140
app.py
140
app.py
@ -1,18 +1,140 @@
|
|||||||
|
import configparser
|
||||||
|
import json
|
||||||
|
import queue
|
||||||
import sys
|
import sys
|
||||||
|
from PySide6.QtWidgets import QApplication, QMainWindow, QPushButton
|
||||||
|
from ui_untitled import Ui_MainWindow
|
||||||
|
from COM.COM_Robot import RobotClient
|
||||||
|
from Expection import ErrorCode
|
||||||
|
from queue import Queue
|
||||||
|
from Model.RobotModel import *
|
||||||
|
import time
|
||||||
|
from queue import Queue
|
||||||
|
|
||||||
from PySide6.QtWidgets import QMainWindow, QApplication
|
|
||||||
|
|
||||||
from ui_untitled import Ui_MainWindow
|
|
||||||
|
|
||||||
class MainWindow(QMainWindow, Ui_MainWindow):
|
class MainWindow(QMainWindow,Ui_MainWindow):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(MainWindow, self).__init__()
|
super(MainWindow, self).__init__()
|
||||||
self.setupUi(self)
|
self.setupUi(self)
|
||||||
|
self.pushButton_17.clicked.connect(self.send_position_button_click)
|
||||||
|
self.robotClient = None
|
||||||
|
self.configReader = configparser.ConfigParser()
|
||||||
|
self.horizontalSlider_J1.sliderReleased.connect(self.slider_valueChanged)
|
||||||
|
self.horizontalSlider_J2.sliderReleased.connect(self.slider_valueChanged)
|
||||||
|
self.horizontalSlider_J3.sliderReleased.connect(self.slider_valueChanged)
|
||||||
|
self.horizontalSlider_J4.sliderReleased.connect(self.slider_valueChanged)
|
||||||
|
self.horizontalSlider_J5.sliderReleased.connect(self.slider_valueChanged)
|
||||||
|
self.horizontalSlider_J6.sliderReleased.connect(self.slider_valueChanged)
|
||||||
|
#self.horizontalSlider_J1.sliderReleased
|
||||||
|
self.command_quene = Queue()
|
||||||
|
self.status_address = DataAddress()
|
||||||
|
self.init_Run()
|
||||||
|
self.init_robot_info()
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
|
|
||||||
|
def slider_valueChanged(self):
|
||||||
|
global last_time
|
||||||
|
now_time = time.time()
|
||||||
|
if(now_time-last_time) < 2:
|
||||||
|
return
|
||||||
|
last_time = now_time
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
position_instruction = Instruction()
|
||||||
|
position_instruction.m0 = self.horizontalSlider_J1.value()
|
||||||
|
position_instruction.m1 = self.horizontalSlider_J2.value()
|
||||||
|
position_instruction.m2 = self.horizontalSlider_J3.value()
|
||||||
|
position_instruction.m3 = self.horizontalSlider_J4.value()
|
||||||
|
position_instruction.m4 = self.horizontalSlider_J5.value()
|
||||||
|
position_instruction.m5 = self.horizontalSlider_J6.value()
|
||||||
|
|
||||||
|
self.textEdit_j1.setText(str(self.horizontalSlider_J1.value()))
|
||||||
|
self.textEdit_j2.setText(str(self.horizontalSlider_J2.value()))
|
||||||
|
self.textEdit_j3.setText(str(self.horizontalSlider_J3.value()))
|
||||||
|
self.textEdit_j4.setText(str(self.horizontalSlider_J4.value()))
|
||||||
|
self.textEdit_j5.setText(str(self.horizontalSlider_J5.value()))
|
||||||
|
self.textEdit_j6.setText(str(self.horizontalSlider_J6.value()))
|
||||||
|
|
||||||
|
|
||||||
|
instruction_command = CMDInstructRequest()
|
||||||
|
instruction_command.instructions.append(vars(position_instruction))
|
||||||
|
request_command = vars(instruction_command)
|
||||||
|
print(request_command)
|
||||||
|
self.robotClient.add_sendQuene(request_command)
|
||||||
|
|
||||||
|
def on_button_click(self):
|
||||||
|
self.button.setText("Clicked!")
|
||||||
|
|
||||||
|
def send_position_button_click(self):
|
||||||
|
# if True:
|
||||||
|
# cmd_command = CMDRequest()
|
||||||
|
# cmd_command.cmdData = ['rewriteData', '800', f'{position_instruction.m0}', 0]
|
||||||
|
# request_command = vars(cmd_command)
|
||||||
|
# self.robotClient.add_sendQuene(request_command)
|
||||||
|
return
|
||||||
|
|
||||||
|
|
||||||
|
def init_Run(self):
|
||||||
|
self.configReader.read('Seting.ini')
|
||||||
|
ip = self.configReader.get('Robot_Feed', 'IPAddress')
|
||||||
|
port= int(self.configReader.get('Robot_Feed', 'Port'))
|
||||||
|
self.robotClient = RobotClient(ip, port,self.command_quene,self.status_address)
|
||||||
|
self.robotClient.CreatConnect()
|
||||||
|
if self.robotClient.is_Connect():
|
||||||
|
return 0
|
||||||
|
else:
|
||||||
|
return ErrorCode.NETERROR
|
||||||
|
|
||||||
|
def init_robot_info(self):
|
||||||
|
j1_min = int(self.configReader.get('Robot', 'j1_min'))
|
||||||
|
j1_max = int(self.configReader.get('Robot', 'j1_max'))
|
||||||
|
j2_min = int(self.configReader.get('Robot', 'j2_min'))
|
||||||
|
j2_max = int(self.configReader.get('Robot', 'j2_max'))
|
||||||
|
j3_min = int(self.configReader.get('Robot', 'j3_min'))
|
||||||
|
j3_max = int(self.configReader.get('Robot', 'j3_max'))
|
||||||
|
j4_min = int(self.configReader.get('Robot', 'j4_min'))
|
||||||
|
j4_max = int(self.configReader.get('Robot', 'j4_max'))
|
||||||
|
j5_min = int(self.configReader.get('Robot', 'j5_min'))
|
||||||
|
j5_max = int(self.configReader.get('Robot', 'j5_max'))
|
||||||
|
j6_min = int(self.configReader.get('Robot', 'j6_min'))
|
||||||
|
j6_max = int(self.configReader.get('Robot', 'j6_max'))
|
||||||
|
self.horizontalSlider_J1.setMinimum(j1_min)
|
||||||
|
self.horizontalSlider_J1.setMaximum(j1_max)
|
||||||
|
self.horizontalSlider_J2.setMinimum(j2_min)
|
||||||
|
self.horizontalSlider_J2.setMaximum(j2_max)
|
||||||
|
self.horizontalSlider_J3.setMinimum(j3_min)
|
||||||
|
self.horizontalSlider_J3.setMaximum(j3_max)
|
||||||
|
self.horizontalSlider_J4.setMinimum(j4_min)
|
||||||
|
self.horizontalSlider_J4.setMaximum(j4_max)
|
||||||
|
self.horizontalSlider_J5.setMinimum(j5_min)
|
||||||
|
self.horizontalSlider_J5.setMaximum(j5_max)
|
||||||
|
self.horizontalSlider_J6.setMinimum(j6_min)
|
||||||
|
self.horizontalSlider_J6.setMaximum(j6_max)
|
||||||
|
self.label_j1_min.setText(j1_min.__str__())
|
||||||
|
self.label_j1_max.setText(j1_max.__str__())
|
||||||
|
self.label_j2_min.setText(j2_min.__str__())
|
||||||
|
self.label_j2_max.setText(j2_max.__str__())
|
||||||
|
self.label_j3_min.setText(j3_min.__str__())
|
||||||
|
self.label_j3_max.setText(j3_max.__str__())
|
||||||
|
self.label_j4_min.setText(j4_min.__str__())
|
||||||
|
self.label_j4_max.setText(j4_max.__str__())
|
||||||
|
self.label_j5_min.setText(j5_min.__str__())
|
||||||
|
self.label_j5_max.setText(j5_max.__str__())
|
||||||
|
self.label_j6_min.setText(j6_min.__str__())
|
||||||
|
self.label_j6_max.setText(str(j6_max))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def send_position_command(self,position):
|
||||||
|
self.robotClient.add_sendQuene(position)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
app = QApplication(sys.argv)
|
app = QApplication(sys.argv)
|
||||||
win = MainWindow()
|
window = MainWindow()
|
||||||
win.show()
|
window.show()
|
||||||
app.exec()
|
sys.exit(app.exec())
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
133
main.py
133
main.py
@ -1,133 +0,0 @@
|
|||||||
import configparser
|
|
||||||
import json
|
|
||||||
import queue
|
|
||||||
import sys
|
|
||||||
from PySide6.QtWidgets import QApplication, QMainWindow, QPushButton
|
|
||||||
from ui_untitled import Ui_MainWindow
|
|
||||||
from COM.COM_Robot import RobotClient
|
|
||||||
from Expection import ErrorCode
|
|
||||||
from queue import Queue
|
|
||||||
from Model.RobotModel import *
|
|
||||||
import time
|
|
||||||
from queue import Queue
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class MainWindow(QMainWindow,Ui_MainWindow):
|
|
||||||
def __init__(self):
|
|
||||||
super(MainWindow, self).__init__()
|
|
||||||
self.setupUi(self)
|
|
||||||
self.pushButton_17.clicked.connect(self.send_position_button_click)
|
|
||||||
self.robotClient = None
|
|
||||||
self.configReader = configparser.ConfigParser()
|
|
||||||
self.horizontalSlider_J1.sliderReleased.connect(self.slider_valueChanged)
|
|
||||||
self.horizontalSlider_J2.sliderReleased.connect(self.slider_valueChanged)
|
|
||||||
self.horizontalSlider_J3.sliderReleased.connect(self.slider_valueChanged)
|
|
||||||
self.horizontalSlider_J4.sliderReleased.connect(self.slider_valueChanged)
|
|
||||||
self.horizontalSlider_J5.sliderReleased.connect(self.slider_valueChanged)
|
|
||||||
self.horizontalSlider_J6.sliderReleased.connect(self.slider_valueChanged)
|
|
||||||
#self.horizontalSlider_J1.sliderReleased
|
|
||||||
self.command_quene = Queue()
|
|
||||||
self.status_address = DataAddress()
|
|
||||||
self.init_Run()
|
|
||||||
self.init_robot_info()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def slider_valueChanged(self):
|
|
||||||
|
|
||||||
position_instruction = Instruction()
|
|
||||||
position_instruction.m0 = self.horizontalSlider_J1.value()
|
|
||||||
position_instruction.m1 = self.horizontalSlider_J2.value()
|
|
||||||
position_instruction.m2 = self.horizontalSlider_J3.value()
|
|
||||||
position_instruction.m3 = self.horizontalSlider_J4.value()
|
|
||||||
position_instruction.m4 = self.horizontalSlider_J5.value()
|
|
||||||
position_instruction.m5 = self.horizontalSlider_J6.value()
|
|
||||||
|
|
||||||
self.textEdit_j1.setText(str(self.horizontalSlider_J1.value()))
|
|
||||||
self.textEdit_j2.setText(str(self.horizontalSlider_J2.value()))
|
|
||||||
self.textEdit_j3.setText(str(self.horizontalSlider_J3.value()))
|
|
||||||
self.textEdit_j4.setText(str(self.horizontalSlider_J4.value()))
|
|
||||||
self.textEdit_j5.setText(str(self.horizontalSlider_J5.value()))
|
|
||||||
self.textEdit_j6.setText(str(self.horizontalSlider_J6.value()))
|
|
||||||
|
|
||||||
|
|
||||||
instruction_command = CMDInstructRequest()
|
|
||||||
instruction_command.instructions.append(vars(position_instruction))
|
|
||||||
request_command = vars(instruction_command)
|
|
||||||
print(request_command)
|
|
||||||
self.robotClient.add_sendQuene(request_command)
|
|
||||||
|
|
||||||
def on_button_click(self):
|
|
||||||
self.button.setText("Clicked!")
|
|
||||||
|
|
||||||
def send_position_button_click(self):
|
|
||||||
# if True:
|
|
||||||
# cmd_command = CMDRequest()
|
|
||||||
# cmd_command.cmdData = ['rewriteData', '800', f'{position_instruction.m0}', 0]
|
|
||||||
# request_command = vars(cmd_command)
|
|
||||||
# self.robotClient.add_sendQuene(request_command)
|
|
||||||
return
|
|
||||||
|
|
||||||
|
|
||||||
def init_Run(self):
|
|
||||||
self.configReader.read('Seting.ini')
|
|
||||||
ip = self.configReader.get('Robot', 'IPAddress')
|
|
||||||
port= int(self.configReader.get('Robot', 'Port'))
|
|
||||||
self.robotClient = RobotClient(ip, port,self.command_quene,self.status_address)
|
|
||||||
self.robotClient.CreatConnect()
|
|
||||||
if self.robotClient.is_Connect():
|
|
||||||
return 0
|
|
||||||
else:
|
|
||||||
return ErrorCode.NETERROR
|
|
||||||
|
|
||||||
def init_robot_info(self):
|
|
||||||
j1_min = int(self.configReader.get('Robot', 'j1_min'))
|
|
||||||
j1_max = int(self.configReader.get('Robot', 'j1_max'))
|
|
||||||
j2_min = int(self.configReader.get('Robot', 'j2_min'))
|
|
||||||
j2_max = int(self.configReader.get('Robot', 'j2_max'))
|
|
||||||
j3_min = int(self.configReader.get('Robot', 'j3_min'))
|
|
||||||
j3_max = int(self.configReader.get('Robot', 'j3_max'))
|
|
||||||
j4_min = int(self.configReader.get('Robot', 'j4_min'))
|
|
||||||
j4_max = int(self.configReader.get('Robot', 'j4_max'))
|
|
||||||
j5_min = int(self.configReader.get('Robot', 'j5_min'))
|
|
||||||
j5_max = int(self.configReader.get('Robot', 'j5_max'))
|
|
||||||
j6_min = int(self.configReader.get('Robot', 'j6_min'))
|
|
||||||
j6_max = int(self.configReader.get('Robot', 'j6_max'))
|
|
||||||
self.horizontalSlider_J1.setMinimum(j1_min)
|
|
||||||
self.horizontalSlider_J1.setMaximum(j1_max)
|
|
||||||
self.horizontalSlider_J2.setMinimum(j2_min)
|
|
||||||
self.horizontalSlider_J2.setMaximum(j2_max)
|
|
||||||
self.horizontalSlider_J3.setMinimum(j3_min)
|
|
||||||
self.horizontalSlider_J3.setMaximum(j3_max)
|
|
||||||
self.horizontalSlider_J4.setMinimum(j4_min)
|
|
||||||
self.horizontalSlider_J4.setMaximum(j4_max)
|
|
||||||
self.horizontalSlider_J5.setMinimum(j5_min)
|
|
||||||
self.horizontalSlider_J5.setMaximum(j5_max)
|
|
||||||
self.horizontalSlider_J6.setMinimum(j6_min)
|
|
||||||
self.horizontalSlider_J6.setMaximum(j6_max)
|
|
||||||
self.label_j1_min.setText(j1_min.__str__())
|
|
||||||
self.label_j1_max.setText(j1_max.__str__())
|
|
||||||
self.label_j2_min.setText(j2_min.__str__())
|
|
||||||
self.label_j2_max.setText(j2_max.__str__())
|
|
||||||
self.label_j3_min.setText(j3_min.__str__())
|
|
||||||
self.label_j3_max.setText(j3_max.__str__())
|
|
||||||
self.label_j4_min.setText(j4_min.__str__())
|
|
||||||
self.label_j4_max.setText(j4_max.__str__())
|
|
||||||
self.label_j5_min.setText(j5_min.__str__())
|
|
||||||
self.label_j5_max.setText(j5_max.__str__())
|
|
||||||
self.label_j6_min.setText(j6_min.__str__())
|
|
||||||
self.label_j6_max.setText(str(j6_max))
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def send_position_command(self,position):
|
|
||||||
self.robotClient.add_sendQuene(position)
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
app = QApplication(sys.argv)
|
|
||||||
window = MainWindow()
|
|
||||||
window.show()
|
|
||||||
sys.exit(app.exec())
|
|
||||||
18
requirements
Normal file
18
requirements
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
colorthief=0.2.1
|
||||||
|
darkdetect=0.8.0
|
||||||
|
numpy=2.0.1
|
||||||
|
pillow=10.4.
|
||||||
|
pip=24.0
|
||||||
|
PyQt5=5.15.11
|
||||||
|
PyQt5-Frameless-Window=0.3.9
|
||||||
|
PyQt5-Qt5=5.15.2
|
||||||
|
PyQt5_sip=12.15.0
|
||||||
|
PySide6=6.7.2
|
||||||
|
PySide6_Addons=6.7.2
|
||||||
|
PySide6_Essentials=6.7.2
|
||||||
|
pywin32=306
|
||||||
|
scipy=1.13.1
|
||||||
|
setuptools=69.5.1
|
||||||
|
shiboken6=6.7.2
|
||||||
|
wheel=0.43.0
|
||||||
|
python=3.9.19
|
||||||
@ -1,6 +1,5 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="Image">
|
<qresource prefix="bg">
|
||||||
<file>data/1.png</file>
|
<file>Image/robot.png</file>
|
||||||
<file>data/robot.png</file>
|
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@ -16,8 +16,8 @@ from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
|
|||||||
QImage, QKeySequence, QLinearGradient, QPainter,
|
QImage, QKeySequence, QLinearGradient, QPainter,
|
||||||
QPalette, QPixmap, QRadialGradient, QTransform)
|
QPalette, QPixmap, QRadialGradient, QTransform)
|
||||||
from PySide6.QtWidgets import (QApplication, QComboBox, QFrame, QLabel,
|
from PySide6.QtWidgets import (QApplication, QComboBox, QFrame, QLabel,
|
||||||
QLayout, QLineEdit, QMainWindow, QPushButton,
|
QLineEdit, QMainWindow, QPushButton, QSizePolicy,
|
||||||
QSizePolicy, QSlider, QTabWidget, QTextEdit,
|
QSlider, QStackedWidget, QTabWidget, QTextEdit,
|
||||||
QVBoxLayout, QWidget)
|
QVBoxLayout, QWidget)
|
||||||
import resources_rc
|
import resources_rc
|
||||||
|
|
||||||
@ -57,12 +57,13 @@ class Ui_MainWindow(object):
|
|||||||
self.tab.setObjectName(u"tab")
|
self.tab.setObjectName(u"tab")
|
||||||
self.verticalLayout = QVBoxLayout(self.tab)
|
self.verticalLayout = QVBoxLayout(self.tab)
|
||||||
self.verticalLayout.setObjectName(u"verticalLayout")
|
self.verticalLayout.setObjectName(u"verticalLayout")
|
||||||
self.verticalLayout_2 = QVBoxLayout()
|
self.stackedWidget = QStackedWidget(self.tab)
|
||||||
self.verticalLayout_2.setSpacing(0)
|
self.stackedWidget.setObjectName(u"stackedWidget")
|
||||||
self.verticalLayout_2.setObjectName(u"verticalLayout_2")
|
self.page = QWidget()
|
||||||
self.verticalLayout_2.setSizeConstraint(QLayout.SizeConstraint.SetNoConstraint)
|
self.page.setObjectName(u"page")
|
||||||
self.frame_2 = QFrame(self.tab)
|
self.frame_2 = QFrame(self.page)
|
||||||
self.frame_2.setObjectName(u"frame_2")
|
self.frame_2.setObjectName(u"frame_2")
|
||||||
|
self.frame_2.setGeometry(QRect(0, 0, 877, 555))
|
||||||
self.frame_2.setStyleSheet(u"background-color: #E6ECF5;\n"
|
self.frame_2.setStyleSheet(u"background-color: #E6ECF5;\n"
|
||||||
"")
|
"")
|
||||||
self.frame_2.setFrameShape(QFrame.Shape.StyledPanel)
|
self.frame_2.setFrameShape(QFrame.Shape.StyledPanel)
|
||||||
@ -92,14 +93,14 @@ class Ui_MainWindow(object):
|
|||||||
"border-radius: 10px;")
|
"border-radius: 10px;")
|
||||||
self.frame_3 = QFrame(self.frame_2)
|
self.frame_3 = QFrame(self.frame_2)
|
||||||
self.frame_3.setObjectName(u"frame_3")
|
self.frame_3.setObjectName(u"frame_3")
|
||||||
self.frame_3.setGeometry(QRect(0, 40, 841, 461))
|
self.frame_3.setGeometry(QRect(10, 40, 841, 461))
|
||||||
self.frame_3.setStyleSheet(u"background-color: rgb(255, 255, 255);")
|
self.frame_3.setStyleSheet(u"background-color: rgb(255, 255, 255);")
|
||||||
self.frame_3.setFrameShape(QFrame.Shape.StyledPanel)
|
self.frame_3.setFrameShape(QFrame.Shape.StyledPanel)
|
||||||
self.frame_3.setFrameShadow(QFrame.Shadow.Raised)
|
self.frame_3.setFrameShadow(QFrame.Shadow.Raised)
|
||||||
self.label_4 = QLabel(self.frame_3)
|
self.label_4 = QLabel(self.frame_3)
|
||||||
self.label_4.setObjectName(u"label_4")
|
self.label_4.setObjectName(u"label_4")
|
||||||
self.label_4.setGeometry(QRect(10, 10, 481, 261))
|
self.label_4.setGeometry(QRect(10, 10, 481, 261))
|
||||||
self.label_4.setStyleSheet(u"border-image: url(:/Image/data/robot.png);\n"
|
self.label_4.setStyleSheet(u"border-image: url(:/Image/Image/robot.png);\n"
|
||||||
"background-position:center;\n"
|
"background-position:center;\n"
|
||||||
"background-repeat:no-repeat;")
|
"background-repeat:no-repeat;")
|
||||||
self.label_4.setScaledContents(True)
|
self.label_4.setScaledContents(True)
|
||||||
@ -110,23 +111,23 @@ class Ui_MainWindow(object):
|
|||||||
"{\n"
|
"{\n"
|
||||||
" background-color: #FFFFFF; \n"
|
" background-color: #FFFFFF; \n"
|
||||||
" border-style: outset; \n"
|
" border-style: outset; \n"
|
||||||
" border-radius: 10px; \n"
|
" border-radius:5px; \n"
|
||||||
"}\n"
|
"}\n"
|
||||||
" \n"
|
" \n"
|
||||||
"QSlider::groove:horizontal\n"
|
"QSlider::groove:horizontal\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" height: 12px;\n"
|
" height: 10px;\n"
|
||||||
" background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #B1B1B1, stop:1 #c4c4c4);\n"
|
" background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #B1B1B1, stop:1 #c4c4c4);\n"
|
||||||
" margin: 2px 0\n"
|
" margin: 10px 0\n"
|
||||||
"}\n"
|
"}\n"
|
||||||
" \n"
|
" \n"
|
||||||
"QSlider::handle:horizontal \n"
|
"QSlider::handle:horizontal \n"
|
||||||
"{\n"
|
"{\n"
|
||||||
" background: QRadialGradient(cx:0, cy:0, radius: 1, fx:0.5, fy:0.5,stop:0 green, stop:1 green);\n"
|
" background: QRadialGradient(cx:0, cy:0, radius: 1, fx:0.5, fy:0.5,stop:0 green, stop:1 green);\n"
|
||||||
" width: 16px;\n"
|
" width: 10px;\n"
|
||||||
" height: 16px;\n"
|
" height: 16px;\n"
|
||||||
" margin: -5px 6px -5px 6px;\n"
|
" margin: -5px 3px -5px 6px;\n"
|
||||||
" border-radius:11px; \n"
|
" border-radius:5px; \n"
|
||||||
" border: 3px solid #007900;\n"
|
" border: 3px solid #007900;\n"
|
||||||
"}")
|
"}")
|
||||||
self.horizontalSlider.setOrientation(Qt.Orientation.Horizontal)
|
self.horizontalSlider.setOrientation(Qt.Orientation.Horizontal)
|
||||||
@ -657,11 +658,12 @@ class Ui_MainWindow(object):
|
|||||||
"")
|
"")
|
||||||
icon5 = QIcon(QIcon.fromTheme(QIcon.ThemeIcon.SystemShutdown))
|
icon5 = QIcon(QIcon.fromTheme(QIcon.ThemeIcon.SystemShutdown))
|
||||||
self.pushButton_17.setIcon(icon5)
|
self.pushButton_17.setIcon(icon5)
|
||||||
|
self.stackedWidget.addWidget(self.page)
|
||||||
|
self.page_2 = QWidget()
|
||||||
|
self.page_2.setObjectName(u"page_2")
|
||||||
|
self.stackedWidget.addWidget(self.page_2)
|
||||||
|
|
||||||
self.verticalLayout_2.addWidget(self.frame_2)
|
self.verticalLayout.addWidget(self.stackedWidget)
|
||||||
|
|
||||||
|
|
||||||
self.verticalLayout.addLayout(self.verticalLayout_2)
|
|
||||||
|
|
||||||
self.tabWidget.addTab(self.tab, "")
|
self.tabWidget.addTab(self.tab, "")
|
||||||
self.tab_2 = QWidget()
|
self.tab_2 = QWidget()
|
||||||
@ -681,7 +683,8 @@ class Ui_MainWindow(object):
|
|||||||
|
|
||||||
self.retranslateUi(MainWindow)
|
self.retranslateUi(MainWindow)
|
||||||
|
|
||||||
self.tabWidget.setCurrentIndex(0)
|
self.tabWidget.setCurrentIndex(1)
|
||||||
|
self.stackedWidget.setCurrentIndex(0)
|
||||||
|
|
||||||
|
|
||||||
QMetaObject.connectSlotsByName(MainWindow)
|
QMetaObject.connectSlotsByName(MainWindow)
|
||||||
|
|||||||
55
untitled.ui
55
untitled.ui
@ -100,15 +100,20 @@ font: 290 9pt "Microsoft YaHei";</string>
|
|||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="0">
|
<widget class="QStackedWidget" name="stackedWidget">
|
||||||
<property name="spacing">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeConstraint">
|
<widget class="QWidget" name="page">
|
||||||
<enum>QLayout::SizeConstraint::SetNoConstraint</enum>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="QFrame" name="frame_2">
|
<widget class="QFrame" name="frame_2">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>877</width>
|
||||||
|
<height>555</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">background-color: #E6ECF5;
|
<string notr="true">background-color: #E6ECF5;
|
||||||
</string>
|
</string>
|
||||||
@ -182,7 +187,7 @@ border-radius: 10px;</string>
|
|||||||
<widget class="QFrame" name="frame_3">
|
<widget class="QFrame" name="frame_3">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>10</x>
|
||||||
<y>40</y>
|
<y>40</y>
|
||||||
<width>841</width>
|
<width>841</width>
|
||||||
<height>461</height>
|
<height>461</height>
|
||||||
@ -1386,7 +1391,7 @@ background-color:#1053b2;
|
|||||||
<widget class="QPushButton" name="pushButton_17">
|
<widget class="QPushButton" name="pushButton_17">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>460</x>
|
<x>360</x>
|
||||||
<y>510</y>
|
<y>510</y>
|
||||||
<width>91</width>
|
<width>91</width>
|
||||||
<height>31</height>
|
<height>31</height>
|
||||||
@ -1412,9 +1417,39 @@ background-color: #499c8a;
|
|||||||
<iconset theme="QIcon::ThemeIcon::SystemShutdown"/>
|
<iconset theme="QIcon::ThemeIcon::SystemShutdown"/>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
<widget class="QPushButton" name="pushButton_39">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>460</x>
|
||||||
|
<y>510</y>
|
||||||
|
<width>91</width>
|
||||||
|
<height>31</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">*{
|
||||||
|
background-color: #FFFFBF;
|
||||||
|
font: 9pt "楷体";
|
||||||
|
border: 1px solid #dcdfe6;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
*:pressed
|
||||||
|
{
|
||||||
|
background-color: #FFF000;
|
||||||
|
}
|
||||||
|
</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>复位</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset theme="media-optical"/>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</widget>
|
||||||
</layout>
|
<widget class="QWidget" name="page_2"/>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
|||||||
Reference in New Issue
Block a user