使用PyQt5实现添加工具栏、增加SwitchButton控件

前言:通过在网上找到的“电池电压监控界面”,学习PyQt5中添加工具栏、增加SwitchButton控件,在滑块控件右侧增加文本显示、设置界面背景颜色、修改文本控件字体颜色等。

1. 上位机界面效果展示

网络上原图如下:

在这里插入图片描述

自己使用PyQt5做的界面效果如下:

在这里插入图片描述

做出来的界面效果不如原来的界面好看,也尝试设置窗口的背景图片,但是选不到好看的背景图片,做出来的效果还不如单纯将界面背景设置成黑色的大气。

2. 设置开关控件,左划关闭右划打开

参考文章:PyQt 定义控件SwitchButton 指南

搞定PyQt5 开关控件 SwitchButton 滑动开关一文就够了使用这篇文章的SwitchButton 控件,实际界面在划动SwitchButton时,速度太慢了,主要是点击SwitchButton 控件事件不是鼠标往右边拉动事件。

结合上述两篇文章的代码,主要以PyQt 定义控件SwitchButton 指南这篇文章代码为主。

QSwitchButton空间效果如下,也是鼠标点击事件,不是鼠标向左右划动事件。

在这里插入图片描述

修改的QSwitchButton空间代码如下:

#!/usr/bin/env pythonimport sys
from PyQt5.QtWidgets import QApplication, QMainWindow, QWidget, QVBoxLayout
from PyQt5.QtCore import pyqtSignal, Qt, QRect
from PyQt5.QtGui import QPainter, QFont, QBrush, QColor, QPenclass QSwitchButton(QWidget):clickedOn = pyqtSignal()clickedOff = pyqtSignal()def __init__(self, parent=None):super(QSwitchButton, self).__init__(parent)self.setWindowFlags(self.windowFlags() | Qt.FramelessWindowHint)self.setAttribute(Qt.WA_TranslucentBackground)# self.resize(100, 30)# QSwitchButtonstate:True is ON,False is OFFself.state = Falseself.setFixedSize(80, 40)def mousePressEvent(self, event):"""set click event for state change"""super(QSwitchButton, self).mousePressEvent(event)if self.state:# 发射信号self.clickedOff.emit()else:# 发射信号self.clickedOn.emit()self.state = False if self.state else Trueself.update()def paintEvent(self, event):"""Set the button"""super(QSwitchButton, self).paintEvent(event)# Create a renderer and set anti-aliasing and smooth transitionspainter = QPainter(self)painter.setRenderHints(QPainter.Antialiasing | QPainter.SmoothPixmapTransform)# Defining font stylesfont = QFont("Arial")font.setPixelSize(self.height() // 3)painter.setFont(font)# QSwitchButton state:ONif self.state:# Drawing backgroundpainter.setPen(Qt.NoPen)# brush = QBrush(QColor('#bd93f9'))brush = QBrush(QColor("green"))painter.setBrush(brush)# Top left corner of the rectangle coordinaterect_x = 0rect_y = 0rect_width = self.width()rect_height = self.height()rect_radius = self.height() // 2painter.drawRoundedRect(rect_x, rect_y, rect_width, rect_height, rect_radius, rect_radius)# Drawing slides circlepainter.setPen(Qt.NoPen)brush.setColor(QColor("#ffffff"))painter.setBrush(brush)# Phase difference pixel point# Top left corner of the rectangle coordinatediff_pix = 3rect_x = self.width() - diff_pix - (self.height() - 2 * diff_pix)rect_y = diff_pixrect_width = self.height() - 2 * diff_pixrect_height = self.height() - 2 * diff_pixrect_radius = (self.height() - 2 * diff_pix) // 2painter.drawRoundedRect(rect_x, rect_y, rect_width, rect_height, rect_radius, rect_radius)# ON txt setpainter.setPen(QPen(QColor("#ffffff")))painter.setBrush(Qt.NoBrush)painter.drawText(QRect(int(self.height() / 3), int(self.height() / 3.5), 50, 20),Qt.AlignLeft,"ON",)# QSwitchButton state:OFFelse:# Drawing backgroundpainter.setPen(Qt.NoPen)# brush = QBrush(QColor('#525555'))brush = QBrush(QColor("white"))painter.setBrush(brush)# Top left corner of the rectangle coordinaterect_x = 0rect_y = 0rect_width = self.width()rect_height = self.height()rect_radius = self.height() // 2painter.drawRoundedRect(rect_x, rect_y, rect_width, rect_height, rect_radius, rect_radius)# Drawing slides circlepen = QPen(QColor("#999999"))pen.setWidth(1)painter.setPen(pen)# Phase difference pixel pointdiff_pix = 3# Top left corner of the rectangle coordinaterect_x = diff_pixrect_y = diff_pixrect_width = self.height() - 2 * diff_pixrect_height = self.height() - 2 * diff_pixrect_radius = (self.height() - 2 * diff_pix) // 2painter.drawRoundedRect(rect_x, rect_y, rect_width, rect_height, rect_radius, rect_radius)# OFF txt setpainter.setBrush(Qt.NoBrush)painter.drawText(QRect(int(self.width() * 1 / 2), int(self.height() / 3.5), 50, 20),Qt.AlignLeft,"OFF",)def main():app = QApplication(sys.argv)window = QMainWindow()window.setGeometry(100, 100, 100, 290)window.setWindowTitle("Switch Button Example")switch1 = QSwitchButton()switch2 = QSwitchButton()layout = QVBoxLayout()layout.addWidget(switch1)layout.addWidget(switch2)window.setCentralWidget(QWidget())window.centralWidget().setLayout(layout)window.show()sys.exit(app.exec_())if __name__ == "__main__":main()

3. 设置工具栏为界面左侧显示

以下是添加工具栏到界面底部的代码:

from PyQt5.QtCore import Qt# 创建一个工具栏
toolbar = QToolBar("Bottom Toolbar")
# 添加一个动作到工具栏
toolbar.addAction(QAction(QIcon('./icon/下载.png'), "下载", self))
# 将工具栏添加到主窗口
self.addToolBar(Qt.BottomToolBarArea, toolbar)

只要修改Qt.BottomToolBarArea为Qt.LeftToolBarArea就可以实现添加界面左侧工具栏功能。

# 将工具栏添加到主窗口
self.addToolBar(Qt.LeftToolBarArea, toolbar)

4. toolbar工具栏设置图标间隔大小

使用下面一行代码,可以设置工具栏上每个图标的间隔大小是一个固定值。

toolbar.setStyleSheet("QToolBar{spacing:8px;}")

要达到界面美观的效果,必须考虑图标之间的间隔要随着窗口的缩放而变化,使用以下在图标之间增加一个QWidget控件的方法可以实现工具栏图标间距为自适应窗口大小。

  		# 创建一个垂直的工具栏self.leftToolBar = QToolBar()# self.leftToolBar.setStyleSheet("QToolBar{spacing:60px;}")# 将工具栏添加到主窗口self.addToolBar(Qt.LeftToolBarArea, self.leftToolBar)# 创建一个QAction,并设置其图标和提示action = QAction(QIcon('./icon/主界面.png'), 'menu', self)action.setShortcut('Ctrl+Q')action.triggered.connect(self.close)self.leftToolBar.addAction(action)# 增加工具栏图标间距为自适应窗口大小self.set_action_spacer(self.leftToolBar)action = QAction(QIcon('./icon/网关信息.png'), 'internet', self)action.setShortcut('Ctrl+Q')action.triggered.connect(self.close)self.leftToolBar.addAction(action)def set_action_spacer(self, ToolBar):# 插入一个透明的间隔动作(这里使用QWidget作为间隔)spacer = QWidget()size_policy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)spacer.setSizePolicy(size_policy)ToolBar.addWidget(spacer)

5. 滑块QSlider右侧设置文本框显示滑块数值

想达到的效果是:文本框紧挨着滑块,开始的做法是设置文本框与滑块在gridLayout布局的同一个格子里面,这样就实现了文本框紧挨着滑块并显示在滑块右侧的视觉效果。

		# 创建一个标签来显示滑块的值self.horizontalSlider.setFixedSize(200, 20)self.horizontalSlider_2.setFixedSize(200, 20)self.horizontalSlider.setEnabled(True)  # 确保滑块是启用的self.horizontalSlider_2.setEnabled(True)  # 确保滑块是启用的self.valueLabel = QLabel('10%', self)self.valueLabel.setAlignment(Qt.AlignRight | Qt.AlignVCenter)  # 右对齐self.valueLabel.setFixedSize(240, 20)# 将滑块和标签添加到布局中self.gridLayout_4.addWidget(self.valueLabel, 1, 0, 1, 1)

但这样做的后果是拉不动滑块,找到原因可能是滑块的布局受限导致影响滑块的移动,取消文本框与滑块在同一个格子之后,滑块能够正常拉动数值。

在这里插入图片描述

使用Qt Designer在滑块右侧的格子中添加文本框,通过QgridLayout的layoutHorizontalSpacing属性设置滑块与文本框之间的间距,尽量在界面展示效果上达到文本框紧挨着滑块显示数值的功能。

在这里插入图片描述

6. 设置窗口背景图片

参考文章:Pyqt5设置窗口背景的3种方法

# 设置界面背景图片
palette = QPalette()
palette.setBrush(QPalette.Background, QBrush(QPixmap("./img.png")))
self.setPalette(palette)

界面设置背景图片后的展示效果如下:

在这里插入图片描述

7. 点击工具栏图标实现截图功能

参考文章:python PyQt5截图

关键代码:

		# 创建一个QAction,用于触发截图screenshot_action = QAction(QIcon('./icon/照相机.png'), 'Screenshot', self)screenshot_action.triggered.connect(self.take_screenshot)screenshot_action.setShortcut("Ctrl+S")self.leftToolBar.addAction(screenshot_action)def take_screenshot(self):# 获取整个屏幕的图像screen = QGuiApplication.primaryScreen()if screen is not None:screenshot = screen.grabWindow(0)screenshot.save('screenshot.png', 'png')# 弹出消息框显示截图QMessageBox.information(self, 'Screenshot', 'Screenshot taken.')

8. 如何去掉工具栏最上方的省略号

使用如下代码添加工具栏到界面最左侧:

		# 创建一个垂直的工具栏self.leftToolBar = QToolBar()# 将工具栏添加到主窗口self.addToolBar(Qt.LeftToolBarArea, self.leftToolBar)

运行界面会出现一种情况:工具栏最上方会有几个省略号,这样会影响美观。

在这里插入图片描述

考虑为什么会出现这种情况,当只是添加一个工具栏不添加QAction,工具栏最上方只有两个点,随着QAction的添加,工具栏上方的点数也增加,可能原因猜测是由于工具栏的空间不足导致的。考虑使用Qt Designer在界面最左侧添加一个verticalLayout,将工具栏放置在verticalLayout上面,增加工具栏的空间。

在这里插入图片描述

使用如下代码实现将工具栏放置在verticalLayout上面,增加工具栏的空间。

		 # 创建一个垂直的工具栏self.leftToolBar = QToolBar()self.leftToolBar.setOrientation(Qt.Vertical)# 将工具栏添加到主窗口# self.addToolBar(Qt.LeftToolBarArea, self.leftToolBar)self.verticalLayout.addWidget(self.leftToolBar)

结论:将工具栏放置在verticalLayout上面,增加工具栏的空间,通过这种方式解决了工具栏最上方的省略号问题,但是另一个问题是随着界面全屏显示,工具栏位置不在界面最左侧固定了,也会随着窗口变大而变化,原因应该是verticalLayout宽度增加的问题。

在这里插入图片描述

现在要解决的问题:如何使工具栏位置固定在界面最左侧,不会随着窗口变大而位置变化

解决办法:使用Qt Designer设计界面布局时,增加如下所示的两个horizontalSpacer,并且horizontalSpacer的sizeType设置为Expanding。这样随着窗口的放大,最左侧的工具栏位置也不会变动,会一直靠左显示。

在这里插入图片描述

9. 设置工具栏上QAction控件的背景颜色

QAction控件是没有样式表可以设置其背景颜色的,只有通过设置QToolBar工具栏的样式表背景颜色来达到设置工具栏上QAction控件的背景颜色目的。

设置工具栏上QToolBar的背景颜色为淡蓝色,关键代码:

 self.leftToolBar.setStyleSheet(f"QToolBar {{background-color: {QColor('lightBlue').name()}}};")

完整代码:

        # 创建一个垂直的工具栏self.leftToolBar = QToolBar()self.leftToolBar.setOrientation(Qt.Vertical)# self.leftToolBar.setStyleSheet("QToolBar{spacing:60px;}")# 将工具栏添加到主窗口# self.addToolBar(Qt.LeftToolBarArea, self.leftToolBar)self.verticalLayout.addWidget(self.leftToolBar)action = QAction(QIcon("./icon/电池.png"), "BatteryInfo", self)# action.setShortcut("Ctrl+Q")# action.triggered.connect(self.close)self.leftToolBar.addAction(action)self.leftToolBar.setStyleSheet(f"QToolBar {{background-color: {QColor('lightBlue').name()}}};")# 增加工具栏图标间距为自适应窗口大小self.set_action_spacer(self.verticalLayout)

10. 完整界面程序代码

main.py代码如下:

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : Logintern09import sys
from PyQt5.QtWidgets import (QApplication,QMainWindow,QWidget,QLabel,QAction,QToolBar,QSizePolicy,QMessageBox,
)
from PyQt5.QtGui import QIcon, QPalette, QColor, QFont, QGuiApplication
from PyQt5.QtCore import Qt
from battery_v import Ui_MainWindow
from QSwitchButton import QSwitchButtonclass mainWindow(QMainWindow, Ui_MainWindow):def __init__(self):super(mainWindow, self).__init__()self.setupUi(self)  # 初始化窗口# 设置界面的背景颜色self.set_background_color()# 设置界面背景图片# palette = QPalette()# palette.setBrush(QPalette.Background, QBrush(QPixmap("./img.png")))# self.setPalette(palette)# 设置窗口图标self.setWindowIcon(QIcon("./icon/电量未知.png"))progressBar_list = [self.progressBar_3,self.progressBar_4,self.progressBar_5,self.progressBar_6,]for progressBar in progressBar_list:progressBar.setFixedSize(60, 150)# 创建QSwitchButton控件并放入容器self.switchButton = QSwitchButton()self.gridLayout_8.addWidget(self.switchButton, 0, 1, 1, 1)self.switchButton.clickedOn.connect(self.on_voltage_view)self.switchButton.clickedOff.connect(self.off_voltage_view)# 创建一个标签来显示滑块的值self.horizontalSlider.setFixedSize(200, 20)self.horizontalSlider_2.setFixedSize(200, 20)self.horizontalSlider.setEnabled(True)  # 确保滑块是启用的self.horizontalSlider_2.setEnabled(True)  # 确保滑块是启用的# 连接滑块的值改变信号到槽函数self.horizontalSlider.valueChanged.connect((lambda: self.on_slider_value_changed(self.label_26, self.horizontalSlider.value())))# # 连接滑块的值改变信号到槽函数self.horizontalSlider_2.valueChanged.connect((lambda: self.on_slider_value_changed(self.label_27, self.horizontalSlider_2.value())))# 找到所有的QLabel控件label_obj = self.findChildren(QLabel)for label in label_obj:label.setStyleSheet("color: white;")  # 设置字体颜色为白色# 设置QLabel的字体大小font = QFont()font.setPointSize(14)  # 设置字体大小为14点label.setFont(font)self.label_7.setStyleSheet("color: green;")  # 设置字体颜色为绿色self.label_25.setFixedSize(100, 40)# 设置按钮的样式self.pushButton.setFixedSize(200, 40)font = QFont()font.setPointSize(14)  # 设置字体大小为14点font.setBold(True)self.pushButton.setFont(font)# 创建一个垂直的工具栏self.leftToolBar = QToolBar()self.leftToolBar.setOrientation(Qt.Vertical)# self.leftToolBar.setStyleSheet("QToolBar{spacing:60px;}")# 将工具栏添加到主窗口# self.addToolBar(Qt.LeftToolBarArea, self.leftToolBar)self.verticalLayout.addWidget(self.leftToolBar)# 创建一个QAction,并设置其图标和提示action = QAction(QIcon("./icon/主界面.png"), "Menu", self)# action.setShortcut("Ctrl+Q")# action.triggered.connect(self.close)self.leftToolBar.addAction(action)# 增加工具栏图标间距为自适应窗口大小self.set_action_spacer(self.verticalLayout)# 创建一个垂直的工具栏self.leftToolBar = QToolBar()self.leftToolBar.setOrientation(Qt.Vertical)# self.leftToolBar.setStyleSheet("QToolBar{spacing:60px;}")# 将工具栏添加到主窗口# self.addToolBar(Qt.LeftToolBarArea, self.leftToolBar)self.verticalLayout.addWidget(self.leftToolBar)action = QAction(QIcon("./icon/网关信息.png"), "Internet", self)# action.setShortcut("Ctrl+Q")# action.triggered.connect(self.close)self.leftToolBar.addAction(action)# 增加工具栏图标间距为自适应窗口大小self.set_action_spacer(self.verticalLayout)# 创建一个垂直的工具栏self.leftToolBar = QToolBar()self.leftToolBar.setOrientation(Qt.Vertical)# self.leftToolBar.setStyleSheet("QToolBar{spacing:60px;}")# 将工具栏添加到主窗口# self.addToolBar(Qt.LeftToolBarArea, self.leftToolBar)self.verticalLayout.addWidget(self.leftToolBar)action = QAction(QIcon("./icon/HD连接.png"), "HDConnect", self)# action.setShortcut("Ctrl+Q")# action.triggered.connect(self.close)self.leftToolBar.addAction(action)# 增加工具栏图标间距为自适应窗口大小self.set_action_spacer(self.verticalLayout)# 创建一个垂直的工具栏self.leftToolBar = QToolBar()self.leftToolBar.setOrientation(Qt.Vertical)# self.leftToolBar.setStyleSheet("QToolBar{spacing:60px;}")# 将工具栏添加到主窗口# self.addToolBar(Qt.LeftToolBarArea, self.leftToolBar)self.verticalLayout.addWidget(self.leftToolBar)action = QAction(QIcon("./icon/电池.png"), "BatteryInfo", self)# action.setShortcut("Ctrl+Q")# action.triggered.connect(self.close)self.leftToolBar.addAction(action)self.leftToolBar.setStyleSheet(f"QToolBar {{background-color: {QColor('lightBlue').name()}}};")# 增加工具栏图标间距为自适应窗口大小self.set_action_spacer(self.verticalLayout)# 创建一个垂直的工具栏self.leftToolBar = QToolBar()self.leftToolBar.setOrientation(Qt.Vertical)# self.leftToolBar.setStyleSheet("QToolBar{spacing:60px;}")# 将工具栏添加到主窗口# self.addToolBar(Qt.LeftToolBarArea, self.leftToolBar)self.verticalLayout.addWidget(self.leftToolBar)# 创建一个QAction,用于触发截图screenshot_action = QAction(QIcon("./icon/照相机.png"), "Screenshot", self)screenshot_action.triggered.connect(self.take_screenshot)screenshot_action.setShortcut("Ctrl+S")self.leftToolBar.addAction(screenshot_action)# 增加工具栏图标间距为自适应窗口大小self.set_action_spacer(self.verticalLayout)# 创建一个垂直的工具栏self.leftToolBar = QToolBar()self.leftToolBar.setOrientation(Qt.Vertical)# self.leftToolBar.setStyleSheet("QToolBar{spacing:60px;}")# 将工具栏添加到主窗口# self.addToolBar(Qt.LeftToolBarArea, self.leftToolBar)self.verticalLayout.addWidget(self.leftToolBar)action = QAction(QIcon("./icon/四点连接.png"), "Close", self)action.setShortcut("Ctrl+Q")action.triggered.connect(self.close)self.leftToolBar.addAction(action)def set_background_color(self):# 创建调色板palette = QPalette()# 设置背景颜色为亮黑色palette.setColor(QPalette.Background, QColor(30, 30, 30))  # 亮黑色# 应用调色板self.setPalette(palette)def on_slider_value_changed(self, valueLabel, value):# 当滑块的值改变时,更新标签显示的数值valueLabel.setText(str(value) + "%")def on_voltage_view(self):progressBar_list = [self.progressBar_3,self.progressBar_4,self.progressBar_5,self.progressBar_6,]text_label = [self.label_14, self.label_15, self.label_16, self.label_17]label_data = ["3.79V", "3.80V", "3.80V", "3.80V"]for progressBar in progressBar_list:progressBar.setValue(60)for i, label in enumerate(text_label):label.setText(label_data[i])def off_voltage_view(self):progressBar_list = [self.progressBar_3,self.progressBar_4,self.progressBar_5,self.progressBar_6,]text_label = [self.label_14, self.label_15, self.label_16, self.label_17]for progressBar in progressBar_list:progressBar.setValue(0)for i, label in enumerate(text_label):label.setText("0V")def set_action_spacer(self, layout):# 插入一个透明的间隔动作(这里使用QWidget作为间隔)spacer = QWidget()size_policy = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Expanding)spacer.setSizePolicy(size_policy)layout.addWidget(spacer)def take_screenshot(self):# 获取整个屏幕的图像screen = QGuiApplication.primaryScreen()if screen is not None:screenshot = screen.grabWindow(0)screenshot.save("screenshot.png", "png")# 弹出消息框显示截图QMessageBox.information(self, "Screenshot", "Screenshot taken.")if __name__ == "__main__":app = QApplication(sys.argv)ui = mainWindow()ui.show()sys.exit(app.exec_())

Qt Designer工具设计基础界面布局,生成的.ui转成python的.py代码如下:

# -*- coding: utf-8 -*-# Form implementation generated from reading ui file 'battery_v.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again.  Do not edit this file unless you know what you are doing.from PyQt5 import QtCore, QtGui, QtWidgetsclass Ui_MainWindow(object):def setupUi(self, MainWindow):MainWindow.setObjectName("MainWindow")MainWindow.resize(982, 740)self.centralwidget = QtWidgets.QWidget(MainWindow)self.centralwidget.setObjectName("centralwidget")self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)self.gridLayout.setObjectName("gridLayout")self.horizontalLayout = QtWidgets.QHBoxLayout()self.horizontalLayout.setSizeConstraint(QtWidgets.QLayout.SetDefaultConstraint)self.horizontalLayout.setObjectName("horizontalLayout")self.label = QtWidgets.QLabel(self.centralwidget)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth())self.label.setSizePolicy(sizePolicy)font = QtGui.QFont()font.setBold(True)font.setWeight(75)self.label.setFont(font)self.label.setAlignment(QtCore.Qt.AlignCenter)self.label.setObjectName("label")self.horizontalLayout.addWidget(self.label)self.gridLayout.addLayout(self.horizontalLayout, 0, 2, 1, 1)self.frame_4 = QtWidgets.QFrame(self.centralwidget)self.frame_4.setFrameShape(QtWidgets.QFrame.Box)self.frame_4.setFrameShadow(QtWidgets.QFrame.Sunken)self.frame_4.setLineWidth(2)self.frame_4.setObjectName("frame_4")self.gridLayout_10 = QtWidgets.QGridLayout(self.frame_4)self.gridLayout_10.setObjectName("gridLayout_10")self.gridLayout_4 = QtWidgets.QGridLayout()self.gridLayout_4.setContentsMargins(-1, 50, -1, 0)self.gridLayout_4.setSpacing(20)self.gridLayout_4.setObjectName("gridLayout_4")self.label_26 = QtWidgets.QLabel(self.frame_4)font = QtGui.QFont()font.setBold(True)font.setWeight(75)self.label_26.setFont(font)self.label_26.setObjectName("label_26")self.gridLayout_4.addWidget(self.label_26, 1, 1, 1, 1)self.label_5 = QtWidgets.QLabel(self.frame_4)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.label_5.sizePolicy().hasHeightForWidth())self.label_5.setSizePolicy(sizePolicy)font = QtGui.QFont()font.setBold(True)font.setWeight(75)self.label_5.setFont(font)self.label_5.setAlignment(QtCore.Qt.AlignCenter)self.label_5.setObjectName("label_5")self.gridLayout_4.addWidget(self.label_5, 1, 4, 1, 1)self.horizontalSlider = QtWidgets.QSlider(self.frame_4)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.horizontalSlider.sizePolicy().hasHeightForWidth())self.horizontalSlider.setSizePolicy(sizePolicy)self.horizontalSlider.setMaximum(100)self.horizontalSlider.setProperty("value", 10)self.horizontalSlider.setOrientation(QtCore.Qt.Horizontal)self.horizontalSlider.setObjectName("horizontalSlider")self.gridLayout_4.addWidget(self.horizontalSlider, 1, 0, 1, 1)self.horizontalSlider_2 = QtWidgets.QSlider(self.frame_4)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.horizontalSlider_2.sizePolicy().hasHeightForWidth())self.horizontalSlider_2.setSizePolicy(sizePolicy)self.horizontalSlider_2.setAutoFillBackground(False)self.horizontalSlider_2.setMaximum(100)self.horizontalSlider_2.setProperty("value", 30)self.horizontalSlider_2.setOrientation(QtCore.Qt.Horizontal)self.horizontalSlider_2.setObjectName("horizontalSlider_2")self.gridLayout_4.addWidget(self.horizontalSlider_2, 1, 2, 1, 1)self.label_2 = QtWidgets.QLabel(self.frame_4)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth())self.label_2.setSizePolicy(sizePolicy)self.label_2.setObjectName("label_2")self.gridLayout_4.addWidget(self.label_2, 0, 2, 1, 1)self.label_3 = QtWidgets.QLabel(self.frame_4)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth())self.label_3.setSizePolicy(sizePolicy)self.label_3.setObjectName("label_3")self.gridLayout_4.addWidget(self.label_3, 0, 0, 1, 1)self.label_4 = QtWidgets.QLabel(self.frame_4)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.label_4.sizePolicy().hasHeightForWidth())self.label_4.setSizePolicy(sizePolicy)self.label_4.setLayoutDirection(QtCore.Qt.LeftToRight)self.label_4.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignVCenter)self.label_4.setObjectName("label_4")self.gridLayout_4.addWidget(self.label_4, 0, 4, 1, 1)self.label_27 = QtWidgets.QLabel(self.frame_4)font = QtGui.QFont()font.setBold(True)font.setWeight(75)self.label_27.setFont(font)self.label_27.setObjectName("label_27")self.gridLayout_4.addWidget(self.label_27, 1, 3, 1, 1)self.gridLayout_10.addLayout(self.gridLayout_4, 0, 0, 1, 1)self.gridLayout.addWidget(self.frame_4, 1, 2, 1, 1)self.frame_3 = QtWidgets.QFrame(self.centralwidget)self.frame_3.setFrameShape(QtWidgets.QFrame.Box)self.frame_3.setFrameShadow(QtWidgets.QFrame.Sunken)self.frame_3.setLineWidth(2)self.frame_3.setObjectName("frame_3")self.gridLayout_2 = QtWidgets.QGridLayout(self.frame_3)self.gridLayout_2.setObjectName("gridLayout_2")self.gridLayout_9 = QtWidgets.QGridLayout()self.gridLayout_9.setContentsMargins(-1, -1, -1, 0)self.gridLayout_9.setHorizontalSpacing(20)self.gridLayout_9.setVerticalSpacing(0)self.gridLayout_9.setObjectName("gridLayout_9")self.label_24 = QtWidgets.QLabel(self.frame_3)self.label_24.setFrameShadow(QtWidgets.QFrame.Sunken)self.label_24.setText("")self.label_24.setAlignment(QtCore.Qt.AlignCenter)self.label_24.setObjectName("label_24")self.gridLayout_9.addWidget(self.label_24, 0, 2, 1, 1)self.pushButton = QtWidgets.QPushButton(self.frame_3)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.pushButton.sizePolicy().hasHeightForWidth())self.pushButton.setSizePolicy(sizePolicy)font = QtGui.QFont()font.setBold(True)font.setWeight(75)self.pushButton.setFont(font)self.pushButton.setObjectName("pushButton")self.gridLayout_9.addWidget(self.pushButton, 0, 3, 1, 1)self.label_23 = QtWidgets.QLabel(self.frame_3)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.label_23.sizePolicy().hasHeightForWidth())self.label_23.setSizePolicy(sizePolicy)self.label_23.setAlignment(QtCore.Qt.AlignCenter)self.label_23.setObjectName("label_23")self.gridLayout_9.addWidget(self.label_23, 0, 0, 1, 1)self.label_25 = QtWidgets.QLabel(self.frame_3)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.label_25.sizePolicy().hasHeightForWidth())self.label_25.setSizePolicy(sizePolicy)font = QtGui.QFont()font.setBold(True)font.setWeight(75)self.label_25.setFont(font)self.label_25.setFrameShape(QtWidgets.QFrame.StyledPanel)self.label_25.setFrameShadow(QtWidgets.QFrame.Sunken)self.label_25.setLineWidth(100)self.label_25.setMidLineWidth(20)self.label_25.setAlignment(QtCore.Qt.AlignCenter)self.label_25.setObjectName("label_25")self.gridLayout_9.addWidget(self.label_25, 0, 1, 1, 1)self.gridLayout_2.addLayout(self.gridLayout_9, 0, 0, 1, 1)self.gridLayout.addWidget(self.frame_3, 4, 2, 1, 1)spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)self.gridLayout.addItem(spacerItem, 0, 1, 1, 1)self.verticalLayout = QtWidgets.QVBoxLayout()self.verticalLayout.setSizeConstraint(QtWidgets.QLayout.SetDefaultConstraint)self.verticalLayout.setSpacing(1)self.verticalLayout.setObjectName("verticalLayout")self.label_28 = QtWidgets.QLabel(self.centralwidget)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.label_28.sizePolicy().hasHeightForWidth())self.label_28.setSizePolicy(sizePolicy)self.label_28.setText("")self.label_28.setObjectName("label_28")self.verticalLayout.addWidget(self.label_28)self.gridLayout.addLayout(self.verticalLayout, 0, 0, 5, 1)self.frame_2 = QtWidgets.QFrame(self.centralwidget)self.frame_2.setFrameShape(QtWidgets.QFrame.Box)self.frame_2.setFrameShadow(QtWidgets.QFrame.Sunken)self.frame_2.setLineWidth(2)self.frame_2.setObjectName("frame_2")self.gridLayout_12 = QtWidgets.QGridLayout(self.frame_2)self.gridLayout_12.setObjectName("gridLayout_12")self.gridLayout_6 = QtWidgets.QGridLayout()self.gridLayout_6.setHorizontalSpacing(80)self.gridLayout_6.setVerticalSpacing(7)self.gridLayout_6.setObjectName("gridLayout_6")self.progressBar_5 = QtWidgets.QProgressBar(self.frame_2)self.progressBar_5.setProperty("value", 0)self.progressBar_5.setOrientation(QtCore.Qt.Vertical)self.progressBar_5.setObjectName("progressBar_5")self.gridLayout_6.addWidget(self.progressBar_5, 0, 2, 1, 1)self.progressBar_4 = QtWidgets.QProgressBar(self.frame_2)self.progressBar_4.setProperty("value", 0)self.progressBar_4.setOrientation(QtCore.Qt.Vertical)self.progressBar_4.setObjectName("progressBar_4")self.gridLayout_6.addWidget(self.progressBar_4, 0, 1, 1, 1)self.label_16 = QtWidgets.QLabel(self.frame_2)self.label_16.setAlignment(QtCore.Qt.AlignCenter)self.label_16.setObjectName("label_16")self.gridLayout_6.addWidget(self.label_16, 1, 2, 1, 1)self.label_14 = QtWidgets.QLabel(self.frame_2)self.label_14.setAlignment(QtCore.Qt.AlignCenter)self.label_14.setObjectName("label_14")self.gridLayout_6.addWidget(self.label_14, 1, 0, 1, 1)self.progressBar_3 = QtWidgets.QProgressBar(self.frame_2)self.progressBar_3.setProperty("value", 0)self.progressBar_3.setOrientation(QtCore.Qt.Vertical)self.progressBar_3.setObjectName("progressBar_3")self.gridLayout_6.addWidget(self.progressBar_3, 0, 0, 1, 1)self.label_15 = QtWidgets.QLabel(self.frame_2)self.label_15.setAlignment(QtCore.Qt.AlignCenter)self.label_15.setObjectName("label_15")self.gridLayout_6.addWidget(self.label_15, 1, 1, 1, 1)self.progressBar_6 = QtWidgets.QProgressBar(self.frame_2)self.progressBar_6.setProperty("value", 0)self.progressBar_6.setOrientation(QtCore.Qt.Vertical)self.progressBar_6.setObjectName("progressBar_6")self.gridLayout_6.addWidget(self.progressBar_6, 0, 3, 1, 1)self.label_17 = QtWidgets.QLabel(self.frame_2)self.label_17.setAlignment(QtCore.Qt.AlignCenter)self.label_17.setObjectName("label_17")self.gridLayout_6.addWidget(self.label_17, 1, 3, 1, 1)self.gridLayout_12.addLayout(self.gridLayout_6, 0, 0, 2, 1)self.gridLayout_8 = QtWidgets.QGridLayout()self.gridLayout_8.setObjectName("gridLayout_8")self.label_22 = QtWidgets.QLabel(self.frame_2)self.label_22.setObjectName("label_22")self.gridLayout_8.addWidget(self.label_22, 0, 0, 1, 1)self.gridLayout_12.addLayout(self.gridLayout_8, 1, 2, 1, 1)self.gridLayout_7 = QtWidgets.QGridLayout()self.gridLayout_7.setHorizontalSpacing(100)self.gridLayout_7.setVerticalSpacing(0)self.gridLayout_7.setObjectName("gridLayout_7")self.label_18 = QtWidgets.QLabel(self.frame_2)self.label_18.setObjectName("label_18")self.gridLayout_7.addWidget(self.label_18, 0, 0, 1, 1)self.label_19 = QtWidgets.QLabel(self.frame_2)font = QtGui.QFont()font.setBold(True)font.setWeight(75)self.label_19.setFont(font)self.label_19.setObjectName("label_19")self.gridLayout_7.addWidget(self.label_19, 1, 0, 1, 1)self.label_20 = QtWidgets.QLabel(self.frame_2)self.label_20.setObjectName("label_20")self.gridLayout_7.addWidget(self.label_20, 0, 1, 1, 1)self.label_21 = QtWidgets.QLabel(self.frame_2)font = QtGui.QFont()font.setBold(True)font.setWeight(75)self.label_21.setFont(font)self.label_21.setObjectName("label_21")self.gridLayout_7.addWidget(self.label_21, 1, 1, 1, 1)self.gridLayout_12.addLayout(self.gridLayout_7, 0, 2, 1, 1)spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum)self.gridLayout_12.addItem(spacerItem1, 0, 1, 1, 1)self.gridLayout.addWidget(self.frame_2, 3, 2, 1, 1)self.frame = QtWidgets.QFrame(self.centralwidget)self.frame.setFrameShape(QtWidgets.QFrame.Box)self.frame.setFrameShadow(QtWidgets.QFrame.Sunken)self.frame.setLineWidth(2)self.frame.setObjectName("frame")self.gridLayout_3 = QtWidgets.QGridLayout(self.frame)self.gridLayout_3.setObjectName("gridLayout_3")self.gridLayout_5 = QtWidgets.QGridLayout()self.gridLayout_5.setHorizontalSpacing(180)self.gridLayout_5.setVerticalSpacing(20)self.gridLayout_5.setObjectName("gridLayout_5")self.label_11 = QtWidgets.QLabel(self.frame)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.label_11.sizePolicy().hasHeightForWidth())self.label_11.setSizePolicy(sizePolicy)font = QtGui.QFont()font.setBold(True)font.setWeight(75)self.label_11.setFont(font)self.label_11.setObjectName("label_11")self.gridLayout_5.addWidget(self.label_11, 1, 2, 1, 1)self.label_7 = QtWidgets.QLabel(self.frame)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.label_7.sizePolicy().hasHeightForWidth())self.label_7.setSizePolicy(sizePolicy)font = QtGui.QFont()font.setBold(True)font.setWeight(75)self.label_7.setFont(font)self.label_7.setObjectName("label_7")self.gridLayout_5.addWidget(self.label_7, 1, 0, 1, 1)self.label_9 = QtWidgets.QLabel(self.frame)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.label_9.sizePolicy().hasHeightForWidth())self.label_9.setSizePolicy(sizePolicy)font = QtGui.QFont()font.setBold(True)font.setWeight(75)self.label_9.setFont(font)self.label_9.setObjectName("label_9")self.gridLayout_5.addWidget(self.label_9, 1, 1, 1, 1)self.label_8 = QtWidgets.QLabel(self.frame)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.label_8.sizePolicy().hasHeightForWidth())self.label_8.setSizePolicy(sizePolicy)self.label_8.setObjectName("label_8")self.gridLayout_5.addWidget(self.label_8, 0, 1, 1, 1)self.label_10 = QtWidgets.QLabel(self.frame)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.label_10.sizePolicy().hasHeightForWidth())self.label_10.setSizePolicy(sizePolicy)self.label_10.setObjectName("label_10")self.gridLayout_5.addWidget(self.label_10, 0, 2, 1, 1)self.label_6 = QtWidgets.QLabel(self.frame)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.label_6.sizePolicy().hasHeightForWidth())self.label_6.setSizePolicy(sizePolicy)self.label_6.setObjectName("label_6")self.gridLayout_5.addWidget(self.label_6, 0, 0, 1, 1)self.label_12 = QtWidgets.QLabel(self.frame)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.label_12.sizePolicy().hasHeightForWidth())self.label_12.setSizePolicy(sizePolicy)self.label_12.setObjectName("label_12")self.gridLayout_5.addWidget(self.label_12, 0, 3, 1, 1)self.label_13 = QtWidgets.QLabel(self.frame)sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)sizePolicy.setHorizontalStretch(0)sizePolicy.setVerticalStretch(0)sizePolicy.setHeightForWidth(self.label_13.sizePolicy().hasHeightForWidth())self.label_13.setSizePolicy(sizePolicy)font = QtGui.QFont()font.setBold(True)font.setWeight(75)self.label_13.setFont(font)self.label_13.setObjectName("label_13")self.gridLayout_5.addWidget(self.label_13, 1, 3, 1, 1)self.gridLayout_3.addLayout(self.gridLayout_5, 0, 0, 1, 1)self.gridLayout.addWidget(self.frame, 2, 2, 1, 1)spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)self.gridLayout.addItem(spacerItem2, 1, 3, 1, 1)MainWindow.setCentralWidget(self.centralwidget)self.statusbar = QtWidgets.QStatusBar(MainWindow)self.statusbar.setObjectName("statusbar")MainWindow.setStatusBar(self.statusbar)self.retranslateUi(MainWindow)QtCore.QMetaObject.connectSlotsByName(MainWindow)def retranslateUi(self, MainWindow):_translate = QtCore.QCoreApplication.translateMainWindow.setWindowTitle(_translate("MainWindow", "智能电池信息"))self.label.setText(_translate("MainWindow", "智能电池信息"))self.label_26.setText(_translate("MainWindow", "10%"))self.label_5.setText(_translate("MainWindow", "00:52"))self.label_2.setText(_translate("MainWindow", "低电量报警"))self.label_3.setText(_translate("MainWindow", "严重低电量报警"))self.label_4.setText(_translate("MainWindow", "飞行时间"))self.label_27.setText(_translate("MainWindow", "30%"))self.pushButton.setText(_translate("MainWindow", "电池历史记录信息"))self.label_23.setText(_translate("MainWindow", "开始自放电时间"))self.label_25.setText(_translate("MainWindow", "10天"))self.label_16.setText(_translate("MainWindow", "0V"))self.label_14.setText(_translate("MainWindow", "0V"))self.label_15.setText(_translate("MainWindow", "0V"))self.label_17.setText(_translate("MainWindow", "0V"))self.label_22.setText(_translate("MainWindow", "主屏显示电压"))self.label_18.setText(_translate("MainWindow", "电池寿命"))self.label_19.setText(_translate("MainWindow", "100%"))self.label_20.setText(_translate("MainWindow", "循环次数"))self.label_21.setText(_translate("MainWindow", "3"))self.label_11.setText(_translate("MainWindow", "4471 mAH"))self.label_7.setText(_translate("MainWindow", "15.18 V"))self.label_9.setText(_translate("MainWindow", "1922 mAH"))self.label_8.setText(_translate("MainWindow", "当前电量"))self.label_10.setText(_translate("MainWindow", "电池容量"))self.label_6.setText(_translate("MainWindow", "电压"))self.label_12.setText(_translate("MainWindow", "温度"))self.label_13.setText(_translate("MainWindow", "40 ℃"))

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/44804.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【Linux】多线程_3

文章目录 九、多线程3. C11中的多线程4. 线程的简单封装 未完待续 九、多线程 3. C11中的多线程 Linux中是根据多线程库来实现多线程的,C11也有自己的多线程,那它的多线程又是怎样的?我们来使用一些C11的多线程。 Makefile: te…

Linux - 探索命令行

探索命令行 Linux命令行中的命令使用格式都是相同的: 命令名称 参数1 参数2 参数3 ...参数之间用任意数量的空白字符分开. 关于命令行, 可以先阅读一些基本常识. 然后我们介绍最常用的一些命令: ls用于列出当前目录(即"文件夹")下的所有文件(或目录). 目录会用蓝色…

CSIP-FTE考试专业题

靶场下载链接: https://pan.baidu.com/s/1ce1Kk0hSYlxrUoRTnNsiKA?pwdha1x pte-2003密码:admin123 centos:root admin123 解压密码: PTE考试专用 下载好后直接用vmware打开,有两个靶机,一个是基础题&#x…

【CTF-Crypto】数论基础-02

【CTF-Crypto】数论基础-02 文章目录 【CTF-Crypto】数论基础-021-16 二次剩余1-20 模p下-1的平方根*1-21 Legendre符号*1-22 Jacobi符号*2-1 群*2-2 群的性质2-3 阿贝尔群*2-4 子群2-11 群同态2-18 原根2-21 什么是环2-23 什么是域2-25 子环2-26 理想2-32 多项式环 1-16 二次剩…

打造智慧校园德育管理,提升学生操行基础分

智慧校园的德育管理系统内嵌的操行基础分功能,是对学生日常行为规范和道德素养进行量化评估的一个创新实践。该功能通过将抽象的道德品质转化为具体可量化的指标,如遵守纪律、尊师重道、团结协作、爱护环境及参与集体活动的积极性等,为每个学…

医疗器械FDA |FDA网络安全测试具体内容

医疗器械FDA网络安全测试的具体内容涵盖了多个方面,以确保医疗器械在网络环境中的安全性和合规性。以下是根据权威来源归纳的FDA网络安全测试的具体内容: 一、技术文件审查 网络安全计划:制造商需要提交网络安全计划,详细描述产…

Spring Boot集成easyposter快速入门Demo

1.什么是easyposter? easyposter是一个简单的,便于扩展的绘制海报工具包 使用场景 在日常工作过程中,通常一些C端平台会伴随着海报生成与分享业务。因为随着移动互联网的迅猛发展,社交分享已成为我们日常生活的重要组成部分。海报分享作为…

visual studio 2019版下载以及与UE4虚幻引擎配置(过程记录)(官网无法下载visual studio 2019安装包)

一、概述 由于需要使用到UE4虚幻引擎,我使用的版本是4.27版本的,其官方默认的visual studio版本是2019版本的,相应的版本对应关系可以通过下面的官方网站对应关系查询。https://docs.unrealengine.com/4.27/zh-CN/ProductionPipelines/Develo…

MMSegmentation笔记

如何训练自制数据集? 首先需要在 mmsegmentation/mmseg/datasets 目录下创建一个自制数据集的配置文件,以我的苹果叶片病害分割数据集为例,创建了mmsegmentation/mmseg/datasets/appleleafseg.py 可以看到,这个配置文件主要定义…

python:使用matplotlib库绘制图像(四)

作者是跟着http://t.csdnimg.cn/4fVW0学习的,matplotlib系列文章是http://t.csdnimg.cn/4fVW0的自己学习过程中整理的详细说明版本,对小白更友好哦! 四、条形图 1. 一个数据样本的条形图 条形图:常用于比较不同类别的数量或值&…

3dmax-vray5大常用材质设置方法

3dmax云渲染平台——渲染100 以高性价比著称,是预算有限的小伙伴首选。 15分钟0.2,60分钟内0.8;注册填邀请码【7788】可领30元礼包和免费渲染券 提供了多种机器配置选择(可以自行匹配环境)最高256G大内存机器,满足不同用户需求。 木纹材质 肌理调整&…

练习9.5 彩票分析

练习 9.14:彩票 创建⼀个列表或元素,其中包含 10 个数和 5 个字 ⺟。从这个列表或元组中随机选择 4 个数或字⺟,并打印⼀条消息, 指出只要彩票上是这 4 个数或字⺟,就中⼤奖了。 练习 9.15:彩票分析 可以使…

2.5 OJ 网站的使用与作业全解

目录 1 OJ 网站如何使用 1.1 注册账户 1.2 登录账户 1.3 做题步骤 2 本节课的 OJ 作业说明 3 章节综合判断题 4 课时2作业1 5 课时2作业2 6 课时2作业3 1 OJ 网站如何使用 〇J 是英文 Online Judge 的缩写,中文翻译过来是在线判题。当用户将自己编写的代码…

基于XC7VX690T FPGA+ZU15EG SOC的6U VPX总线实时信号处理平台(支持4路光纤)

6U VPX架构,符合VITA46规范板载高性能FPGA处理器:XC7VX690T-2FFG1927I板载1片高性能MPSOC:XCZU15EG-2FFVB1156I板载1片MCU,进行健康管理、时钟配置等V7 FPGA外挂2个FMC接口两片FPGA之间通过高速GTH进行互联 基于6U VPX总线架构的通…

从零开始做题:神奇的棋盘

题目 打开得到一副adfgvx加密棋盘 观察txt数据只有1-5,猜测是数字字母坐标转换,用notepad批量操作一下 解题 AGAXXDAGGVGGVDVADAVXDGADVGDVAADDDDFXAFAFDGDVXXDGGDGGDXDDFDDXVGXADGVDFXVVAADDXDXXADDVGGGXGXXXXGXXGGXGDVVVGGGAGAAAAGAAGGAGDDDAGAGGG…

翁恺-C语言程序设计-05-3. 求a的连续和

05-3. 求a的连续和 输入两个整数a和n,a的范围是[0,9],n的范围是[1,8],求数列之和S aaaaaa…aaa…a(n个a)。如a为2、n为8时输出的是222222…22222222的和。 输入格式: 输入在一行中给出两个整数&#xf…

VUE_TypeError: Cannot convert a BigInt value to a number at Math.pow 解决方法

错误信息 TypeError: Cannot convert a BigInt value to a number at Math.pow vue 或 react package.json添加 "browserslist": {"production": ["chrome > 67","edge > 79","firefox > 68","opera >…

实战演练-2021年电赛国一之三端口DC-DC变换器

文章目录 前言一、题目二、题目分析1、题目要求解析2、题目方案选定方案一(使用buck-boost电路+双向DC-DC电路(前端))方案二(使用同步整流Boost升压电路+双向DC-DC电路(前端))方案三(使用同步整流Boost升压…

二叉搜索树大冒险:寻找-插入-删除

OK,看我们题目就可知道啦,今天要分享学习的一种数据结构就是二叉搜索树。 内容题目也说了三个大概的,分别是寻找、插入、删除。 讲这个之前呢,那么就先讲讲这个二叉搜索树是何方神圣呢? 二叉搜索树: 又…

【学习笔记】无人机(UAV)在3GPP系统中的增强支持(五)-同时支持无人机和eMBB用户数据传输的用例

引言 本文是3GPP TR 22.829 V17.1.0技术报告,专注于无人机(UAV)在3GPP系统中的增强支持。文章提出了多个无人机应用场景,分析了相应的能力要求,并建议了新的服务级别要求和关键性能指标(KPIs)。…