Chuỗi bài: ocpp
python
162 dòng
· Cập nhật 2026-02-03
step6.py
ocpp/homework/ui_hori/step6.py
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'step6.ui'
#
# Created by: PyQt5 UI code generator 5.15.11
#
# 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, QtWidgets
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(1024, 600)
self.label = QtWidgets.QLabel(Form)
self.label.setGeometry(QtCore.QRect(0, 0, 1024, 600))
self.label.setText("")
self.label.setPixmap(QtGui.QPixmap("image/bg_step6.png"))
self.label.setObjectName("label")
self.label_2 = QtWidgets.QLabel(Form)
self.label_2.setGeometry(QtCore.QRect(374, 56, 276, 46))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(24)
self.label_2.setFont(font)
self.label_2.setStyleSheet("QLabel {\n"
" color: white; /* 文字顏色 */\n"
" font-size: 24pt; /* 字體大小 */\n"
" font-family: \"Arial\";\n"
" }\n"
" ")
self.label_2.setObjectName("label_2")
self.pushButton_previous = QtWidgets.QPushButton(Form)
self.pushButton_previous.setGeometry(QtCore.QRect(270, 485, 196, 70))
font = QtGui.QFont()
font.setPointSize(20)
self.pushButton_previous.setFont(font)
self.pushButton_previous.setStyleSheet("QPushButton {\n"
" border-image: url(\"image/btn_gr_196x70_def.png\") 0 0 0 0 stretch stretch;\n"
" color: #E9E9E9; /* 文字顏色 */\n"
" font-size: 20pt; /* 字體大小 */\n"
" }\n"
" QPushButton:pressed {\n"
" border-image: url(\"image/btn_gr_196x70_act.png\") 0 0 0 0 stretch stretch;\n"
"color: #FFFF00; /* 文字顏色 */\n"
" font-size: 20pt; /* 字體大小 */\n"
" }")
self.pushButton_previous.setIconSize(QtCore.QSize(250, 88))
self.pushButton_previous.setFlat(True)
self.pushButton_previous.setObjectName("pushButton_previous")
self.label_3 = QtWidgets.QLabel(Form)
self.label_3.setGeometry(QtCore.QRect(171, 216, 150, 46))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(26)
self.label_3.setFont(font)
self.label_3.setStyleSheet("QLabel {\n"
" color: white; /* 文字顏色 */\n"
" font-size: 26pt; /* 字體大小 */\n"
" font-family: \"Arial\";\n"
" }\n"
" ")
self.label_3.setObjectName("label_3")
self.label_uid = QtWidgets.QLabel(Form)
self.label_uid.setGeometry(QtCore.QRect(327, 189, 476, 96))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(26)
self.label_uid.setFont(font)
self.label_uid.setStyleSheet("QLabel {\n"
" color: rgb(143, 255, 45); /* 文字顏色 */\n"
" font-size: 26pt; /* 字體大小 */\n"
" font-family: \"Arial\";\n"
" border: 2px solid #C3C3C3; /* 邊框粗細、樣式、顏色 */\n"
" border-radius: 0px; /* 邊角圓弧 (可選) */\n"
" padding: 5px; /* 內距,避免字貼在邊框上 */\n"
" }\n"
" ")
self.label_uid.setFrameShape(QtWidgets.QFrame.Box)
self.label_uid.setAlignment(QtCore.Qt.AlignCenter)
self.label_uid.setObjectName("label_uid")
self.label_timestamp = QtWidgets.QLabel(Form)
self.label_timestamp.setGeometry(QtCore.QRect(276, 387, 473, 37))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(20)
self.label_timestamp.setFont(font)
self.label_timestamp.setStyleSheet("QLabel {\n"
" color: white; /* 文字顏色 */\n"
" font-size: 20pt; /* 字體大小 */\n"
" font-family: \"Arial\";\n"
" }\n"
" ")
self.label_timestamp.setObjectName("label_timestamp")
self.label_6 = QtWidgets.QLabel(Form)
self.label_6.setGeometry(QtCore.QRect(836, 180, 105, 105))
self.label_6.setText("")
self.label_6.setPixmap(QtGui.QPixmap("image/ico_ok.png"))
self.label_6.setObjectName("label_6")
self.pushButton_startcharging = QtWidgets.QPushButton(Form)
self.pushButton_startcharging.setGeometry(QtCore.QRect(524, 485, 230, 70))
font = QtGui.QFont()
font.setPointSize(20)
self.pushButton_startcharging.setFont(font)
self.pushButton_startcharging.setStyleSheet("QPushButton {\n"
" border-image: url(\"image/btn_196x70_def.png\") 0 0 0 0 stretch stretch;\n"
" color: #FFFFFF; /* 文字顏色 */\n"
" font-size: 20pt; /* 字體大小 */\n"
" }\n"
" QPushButton:pressed {\n"
" border-image: url(\"image/btn_196x70_act.png\") 0 0 0 0 stretch stretch;\n"
"color: #FFFF00; /* 文字顏色 */\n"
" font-size: 20pt; /* 字體大小 */\n"
" }")
self.pushButton_startcharging.setIconSize(QtCore.QSize(250, 88))
self.pushButton_startcharging.setFlat(True)
self.pushButton_startcharging.setObjectName("pushButton_startcharging")
self.label_4 = QtWidgets.QLabel(Form)
self.label_4.setGeometry(QtCore.QRect(172, 300, 628, 46))
self.label_4.setStyleSheet("QLabel {\n"
" color: #FF0000; /* 文字顏色 */\n"
" font-size: 26pt; /* 字體大小 */\n"
" font-family: \"Arial\";\n"
" }\n"
" ")
self.label_4.setText("")
self.label_4.setObjectName("label_4")
self.label_5 = QtWidgets.QLabel(Form)
self.label_5.setGeometry(QtCore.QRect(330, 290, 471, 41))
self.label_5.setStyleSheet("QLabel {\n"
" color: rgb(143, 255, 45);;\n"
" font: 18pt\n"
" }")
self.label_5.setObjectName("label_5")
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "Form"))
self.label_2.setText(_translate("Form", "Access granted"))
self.pushButton_previous.setText(_translate("Form", "Preious"))
self.label_3.setText(_translate("Form", "Card ID:"))
self.label_uid.setText(_translate("Form", "TextLabel"))
self.label_timestamp.setText(_translate("Form", "Timestamp: 2025-06-24 10:35:12"))
self.pushButton_startcharging.setText(_translate("Form", "Start Charging"))
self.label_5.setText(_translate("Form", "TextLabel"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
Form = QtWidgets.QWidget()
ui = Ui_Form()
ui.setupUi(Form)
Form.show()
sys.exit(app.exec_())
Bài viết liên quan
ocpp
python
Cập nhật 2026-02-03
central_system.py
central_system.py — python source code from the ocpp learning materials (ocpp/homework/central_system.py).
Đọc bài viết →
ocpp
python
Cập nhật 2026-02-03
charge_point.py
charge_point.py — python source code from the ocpp learning materials (ocpp/homework/ocpp/charge_point.py).
Đọc bài viết →
ocpp
python
Cập nhật 2026-02-03
exceptions.py
exceptions.py — python source code from the ocpp learning materials (ocpp/homework/ocpp/exceptions.py).
Đọc bài viết →
ocpp
python
Cập nhật 2026-02-03
messages.py
messages.py — python source code from the ocpp learning materials (ocpp/homework/ocpp/messages.py).
Đọc bài viết →
ocpp
python
Cập nhật 2026-02-03
routing.py
routing.py — python source code from the ocpp learning materials (ocpp/homework/ocpp/routing.py).
Đọc bài viết →
ocpp
python
Cập nhật 2026-02-03
__init__.py
__init__.py — python source code from the ocpp learning materials (ocpp/homework/ocpp/v16/__init__.py).
Đọc bài viết →