|
|
|
@ -1,20 +1,13 @@
|
|
|
|
|
|
|
|
|
|
from PyQt5.QtWidgets import QPushButton,QStackedWidget, QLineEdit, QVBoxLayout, QHBoxLayout, QWidget, QLabel, QSplitter
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import qtawesome
|
|
|
|
|
|
|
|
|
|
from PyQt5.QtWidgets import QPushButton,QStackedWidget, QLineEdit, QVBoxLayout, QHBoxLayout, QWidget, QLabel, QSplitter, QButtonGroup
|
|
|
|
|
from utils.DBModels.DeviceParModels import *
|
|
|
|
|
from UI.BlockParameterView import PressureTBlockView, AIFunctionBlockView, PhysicalBlockView
|
|
|
|
|
from UI.SearchAddressWidget import SearchAddressWidget
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class BlockParameterManageWidget(QWidget):
|
|
|
|
|
def __init__(self):
|
|
|
|
|
super().__init__()
|
|
|
|
@ -30,26 +23,48 @@ class BlockParameterManageWidget(QWidget):
|
|
|
|
|
self.parameStackWidget = QStackedWidget()
|
|
|
|
|
self.settingLayout = QHBoxLayout()
|
|
|
|
|
self.deviceAddressLabel = QLabel('从站地址')
|
|
|
|
|
self.deviceAddressLabel.setObjectName('deviceAddressLabel')
|
|
|
|
|
self.deviceAddressEdit = QLineEdit()
|
|
|
|
|
self.deviceAddressEdit.setObjectName("deviceAddressEdit")
|
|
|
|
|
|
|
|
|
|
self.confirmBtn = QPushButton('确定')
|
|
|
|
|
self.confirmBtn.setIcon(qtawesome.icon('fa5s.check-circle', color='#1fbb6f'))
|
|
|
|
|
self.confirmBtn.clicked.connect(self.testUI)
|
|
|
|
|
self.confirmBtn.setObjectName("parameBtn")
|
|
|
|
|
|
|
|
|
|
self.deviceAddressSearchBtn = QPushButton('查找')
|
|
|
|
|
self.deviceAddressSearchBtn.setIcon(qtawesome.icon('fa.search', color='#1fbb6f'))
|
|
|
|
|
self.deviceAddressSearchBtn.clicked.connect(self.searchAddress)
|
|
|
|
|
self.deviceAddressSearchBtn.setObjectName("parameBtn")
|
|
|
|
|
|
|
|
|
|
self.pblockBtn = QPushButton('物理块')
|
|
|
|
|
self.pblockBtn.setCheckable(True)
|
|
|
|
|
self.pblockBtn.setChecked(True)
|
|
|
|
|
self.pblockBtn.setObjectName("parameBtn")
|
|
|
|
|
self.pblockBtn.setIcon(qtawesome.icon('fa.th-large', color='#1fbb6f'))
|
|
|
|
|
# self.pblockBtn.setCheckable(True)
|
|
|
|
|
self.pblockBtn.clicked.connect(lambda: self.switchParameterWidget('pblockBtn'))
|
|
|
|
|
|
|
|
|
|
self.fblockBtn = QPushButton('功能块')
|
|
|
|
|
self.fblockBtn.setCheckable(True)
|
|
|
|
|
self.fblockBtn.setObjectName("parameBtn")
|
|
|
|
|
self.fblockBtn.setIcon(qtawesome.icon('fa.th-large', color='#1fbb6f'))
|
|
|
|
|
self.fblockBtn.clicked.connect(lambda: self.switchParameterWidget('fblockBtn'))
|
|
|
|
|
# self.pblockBtn.setCheckable(True)
|
|
|
|
|
|
|
|
|
|
self.tblockBtn = QPushButton('转换块')
|
|
|
|
|
self.tblockBtn.setObjectName("parameBtn")
|
|
|
|
|
self.tblockBtn.setCheckable(True)
|
|
|
|
|
self.tblockBtn.setIcon(qtawesome.icon('fa.th-large', color='#1fbb6f'))
|
|
|
|
|
self.tblockBtn.clicked.connect(lambda: self.switchParameterWidget('tblockBtn'))
|
|
|
|
|
# self.tblockBtn.setCheckable(True)
|
|
|
|
|
|
|
|
|
|
self.parameterButtonGroup = QButtonGroup()
|
|
|
|
|
self.parameterButtonGroup.setExclusive(True)
|
|
|
|
|
self.parameterButtonGroup.addButton(self.pblockBtn)
|
|
|
|
|
self.parameterButtonGroup.addButton(self.fblockBtn)
|
|
|
|
|
self.parameterButtonGroup.addButton(self.tblockBtn)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.settingLayout.addWidget(self.deviceAddressLabel, 1)
|
|
|
|
|
self.settingLayout.addWidget(self.deviceAddressEdit, 1)
|
|
|
|
|