264 lines
8.2 KiB
Python
264 lines
8.2 KiB
Python
|
# coding: gb2312
|
|||
|
from PyQt5.QtCore import Qt, QSize
|
|||
|
from PyQt5.QtGui import QIcon
|
|||
|
from PyQt5.QtWidgets import *
|
|||
|
from BaseFrontend.based_widget import BasedWidget
|
|||
|
from LSZXPagesLibrary.consensus import PICK_UP_TYPE_TABLE, PICK_UP_TYPE_LIST
|
|||
|
from LSZXPagesLibrary.keyboard_layout import Keyboard
|
|||
|
|
|||
|
|
|||
|
class BaseStationPageWidgetDefine(BasedWidget):
|
|||
|
|
|||
|
def __init__(self):
|
|||
|
super().__init__()
|
|||
|
# <20><><EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD><D8BC><EFBFBD><EFBFBD><EFBFBD>Ctrl+<2B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ת<EFBFBD>༭<EFBFBD><E0BCAD>
|
|||
|
"""**<2A><><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>**<2A><><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>**<2A><><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>**<2A><><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>**<2A><><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>**<2A><><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>"""
|
|||
|
# <20>հؼ<D7BF>
|
|||
|
self.empty_box = self._init_empty_widget()
|
|||
|
# <20><><EFBFBD><EFBFBD><EFBFBD>ؼ<EFBFBD>
|
|||
|
self.title_label = self._init_title_widget()
|
|||
|
# <20>ؼҰ<D8BC>ť
|
|||
|
self.back_home_button = self._init_back_button_widget()
|
|||
|
# һ<><D2BB>ֱ<EFBFBD><D6B1>
|
|||
|
self.line_widget = self._init_line_widget()
|
|||
|
# <20><>վ<EFBFBD><D5BE>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
self.base_station_title = self._init_base_station_title_widget()
|
|||
|
# <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>վͼƬ
|
|||
|
self.master_img = self._init_master_img_widget()
|
|||
|
# <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>վ<EFBFBD><D5BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
self.master_title = self._init_master_title_widget()
|
|||
|
# <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>վ<EFBFBD><D5BE><EFBFBD><EFBFBD>
|
|||
|
self.master_num = self._init_master_num_widget()
|
|||
|
# <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
self.master_widget = self._init_master_widget()
|
|||
|
# <20>ӻ<EFBFBD><D3BB><EFBFBD>վͼƬ
|
|||
|
self.slaver_img = self._init_slaver_img_widget()
|
|||
|
# <20>ӻ<EFBFBD><D3BB><EFBFBD>վ<EFBFBD><D5BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
self.slaver_title = self._init_slaver_title_widget()
|
|||
|
# <20>ӻ<EFBFBD><D3BB><EFBFBD>վ<EFBFBD><D5BE><EFBFBD><EFBFBD>
|
|||
|
self.slaver_num = self._init_slaver_num_widget()
|
|||
|
# <20>ӻ<EFBFBD><D3BB><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
self.slaver_widget = self._init_slaver_widget()
|
|||
|
# <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F2A3ACB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӻ<EFBFBD><D3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ
|
|||
|
self.top_widget = self._init_top_widget()
|
|||
|
# <20><><EFBFBD>¶<EFBFBD>λ<EFBFBD><CEBB>ť
|
|||
|
self.reset_button = self._init_reset_button_widget()
|
|||
|
# <20><>һ<EFBFBD><D2BB><EFBFBD><EFBFBD>ť
|
|||
|
self.next_page_button = self._init_next_page_button_widget()
|
|||
|
# logoͼ<6F><CDBC>
|
|||
|
self.logo_label = self._init_logo_label()
|
|||
|
|
|||
|
# <20><>ʼ<EFBFBD><CABC><EFBFBD>հؼ<D7BF>
|
|||
|
@staticmethod
|
|||
|
def _init_empty_widget():
|
|||
|
empty_widget = QFrame()
|
|||
|
empty_widget.setFrameShape(QFrame.Box)
|
|||
|
empty_widget.setLineWidth(0)
|
|||
|
return empty_widget
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def _init_title_widget():
|
|||
|
title_label = QLabel("<ѵ<><D1B5><EFBFBD><EFBFBD><EFBFBD>ͱ<EFBFBD><CDB1><EFBFBD>>")
|
|||
|
title_label.setAlignment(Qt.AlignCenter)
|
|||
|
title_label.setStyleSheet(
|
|||
|
"font: 30px \"Microsoft YaHei UI\";"
|
|||
|
"letter-spacing: 4px"
|
|||
|
)
|
|||
|
return title_label
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def _init_back_button_widget():
|
|||
|
back_home_button = QPushButton("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ")
|
|||
|
icon = QIcon("assets/home.png")
|
|||
|
back_home_button.setIconSize(QSize(32, 32))
|
|||
|
back_home_button.setIcon(icon)
|
|||
|
back_home_button.setStyleSheet(
|
|||
|
"font: 24px \"Microsoft YaHei UI\";"
|
|||
|
"border:none;"
|
|||
|
"color:#222222;"
|
|||
|
"letter-spacing: 10px;"
|
|||
|
"border-radius:4px;"
|
|||
|
"border:1px solid #222222"
|
|||
|
";height: 60%;"
|
|||
|
)
|
|||
|
return back_home_button
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def _init_line_widget():
|
|||
|
line = QFrame()
|
|||
|
line.setFixedHeight(1) # <20><><EFBFBD>ø߶<C3B8>Ϊ 2 <20><><EFBFBD><EFBFBD>
|
|||
|
line.setStyleSheet("border:1px solid #000000")
|
|||
|
line.setFrameShape(QFrame.HLine) # <20><><EFBFBD><EFBFBD>Ϊˮƽ<CBAE><C6BD>
|
|||
|
return line
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def _init_base_station_title_widget():
|
|||
|
base_station_title_label = QLabel("<EFBFBD><EFBFBD>վ<EFBFBD><EFBFBD>λ<EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȷ<EFBFBD>ϻ<EFBFBD>վλ<EFBFBD>á<EFBFBD><EFBFBD><EFBFBD>")
|
|||
|
base_station_title_label.setStyleSheet(
|
|||
|
"font: 24px \"Microsoft YaHei UI\";"
|
|||
|
"letter-spacing: 4px;"
|
|||
|
"padding-left: 20px;"
|
|||
|
"margin: 0px;"
|
|||
|
"border: none;"
|
|||
|
)
|
|||
|
return base_station_title_label
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def _init_master_img_widget():
|
|||
|
master_img = QLabel()
|
|||
|
master_img.setStyleSheet(
|
|||
|
"border-image: url(assets/master.png);"
|
|||
|
"background-size: contain;"
|
|||
|
"background-repeat: no-repeat;"
|
|||
|
"background-position: center;"
|
|||
|
"background-color: none;"
|
|||
|
"border: none;"
|
|||
|
)
|
|||
|
return master_img
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def _init_master_title_widget():
|
|||
|
master_title = QLabel("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>վ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
|||
|
master_title.setAlignment(Qt.AlignBottom)
|
|||
|
master_title.setStyleSheet(
|
|||
|
"font: 24px \"Microsoft YaHei UI\";"
|
|||
|
"color: #222222;"
|
|||
|
"background-color: none;"
|
|||
|
"border: none;"
|
|||
|
)
|
|||
|
return master_title
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def _init_master_num_widget():
|
|||
|
master_num = QLabel("")
|
|||
|
master_num.setAlignment(Qt.AlignTop)
|
|||
|
master_num.setStyleSheet(
|
|||
|
"font: 600 30px \"Microsoft YaHei UI\";"
|
|||
|
"color: #222222;"
|
|||
|
"background-color: none;"
|
|||
|
"border: none;"
|
|||
|
)
|
|||
|
return master_num
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def _init_master_widget():
|
|||
|
master_widget = QWidget()
|
|||
|
master_widget.setStyleSheet(
|
|||
|
"background-color: qlineargradient("
|
|||
|
"spread:pad,"
|
|||
|
"x1:0,"
|
|||
|
"y1:0,"
|
|||
|
"x2:1,"
|
|||
|
"y2:0,"
|
|||
|
"stop:0 rgba(255, 255, 255, 255),"
|
|||
|
"stop:1 rgba(229, 230, 235, 255));"
|
|||
|
"border-radius: 6px;"
|
|||
|
"border: 1px solid #bbbbbb"
|
|||
|
)
|
|||
|
return master_widget
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def _init_slaver_img_widget():
|
|||
|
slaver_img = QLabel()
|
|||
|
slaver_img.setStyleSheet(
|
|||
|
"border-image: url(assets/slave.png);"
|
|||
|
"background-size: contain;"
|
|||
|
"background-repeat: no-repeat;"
|
|||
|
"background-position: center;"
|
|||
|
"background-color: none;"
|
|||
|
"border: none;"
|
|||
|
)
|
|||
|
return slaver_img
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def _init_slaver_title_widget():
|
|||
|
slaver_title = QLabel("<EFBFBD>ӻ<EFBFBD><EFBFBD><EFBFBD>վ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
|||
|
slaver_title.setAlignment(Qt.AlignBottom)
|
|||
|
slaver_title.setStyleSheet(
|
|||
|
"font: 24px \"Microsoft YaHei UI\";"
|
|||
|
"color: #222222;"
|
|||
|
"background-color: none;"
|
|||
|
"border: none;"
|
|||
|
)
|
|||
|
return slaver_title
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def _init_slaver_num_widget():
|
|||
|
slaver_num = QLabel("")
|
|||
|
slaver_num.setAlignment(Qt.AlignTop)
|
|||
|
slaver_num.setStyleSheet(
|
|||
|
"font: 600 30px \"Microsoft YaHei UI\";"
|
|||
|
"color: #222222;"
|
|||
|
"background-color: none;"
|
|||
|
"border: none;"
|
|||
|
)
|
|||
|
return slaver_num
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def _init_slaver_widget():
|
|||
|
slaver_widget = QWidget()
|
|||
|
slaver_widget.setStyleSheet(
|
|||
|
"background-color: qlineargradient("
|
|||
|
"spread:pad,"
|
|||
|
"x1:0,"
|
|||
|
"y1:0,"
|
|||
|
"x2:1,"
|
|||
|
"y2:0,"
|
|||
|
"stop:0 rgba(255, 255, 255, 255),"
|
|||
|
"stop:1 rgba(229, 230, 235, 255));"
|
|||
|
"border-radius: 6px;"
|
|||
|
"border: 1px solid #bbbbbb"
|
|||
|
)
|
|||
|
return slaver_widget
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def _init_top_widget():
|
|||
|
top_widget = QWidget()
|
|||
|
top_widget.setStyleSheet(
|
|||
|
"border-radius: 6px;"
|
|||
|
"border: 1px solid #bbbbbb"
|
|||
|
)
|
|||
|
return top_widget
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def _init_reset_button_widget():
|
|||
|
reset_button = QPushButton("<EFBFBD><EFBFBD><EFBFBD>¶<EFBFBD>λ")
|
|||
|
reset_button.setStyleSheet(
|
|||
|
"font: 600 28px \"Microsoft YaHei UI\";"
|
|||
|
"border: none;"
|
|||
|
"color: #ffffff;"
|
|||
|
"letter-spacing: 10px;"
|
|||
|
"border-radius: 4px;"
|
|||
|
"height: 80%;"
|
|||
|
"background-color: #f56c6c;"
|
|||
|
)
|
|||
|
return reset_button
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def _init_next_page_button_widget():
|
|||
|
next_page_button = QPushButton("<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>")
|
|||
|
next_page_button.setStyleSheet(
|
|||
|
"font: 600 28px \"Microsoft YaHei UI\";"
|
|||
|
"border: none;"
|
|||
|
"color:#ffffff;"
|
|||
|
"letter-spacing: 10px;"
|
|||
|
"border-radius: 4px;"
|
|||
|
"height: 80%;"
|
|||
|
"background-color: #e6a23c;"
|
|||
|
)
|
|||
|
return next_page_button
|
|||
|
|
|||
|
@staticmethod
|
|||
|
def _init_logo_label():
|
|||
|
logo_img = QLabel()
|
|||
|
logo_img.setStyleSheet(
|
|||
|
"border-image: url(assets/logo.png);"
|
|||
|
"background-size: contain;"
|
|||
|
"background-repeat: no-repeat;"
|
|||
|
"background-position: center;"
|
|||
|
)
|
|||
|
logo_img.setAlignment(Qt.AlignCenter)
|
|||
|
logo_img.setScaledContents(True)
|
|||
|
logo_img.setContentsMargins(12, 6, 12, 6)
|
|||
|
return logo_img
|