diff --git a/Static/Main.qss b/Static/Main.qss index 5f182f1..c245a13 100644 --- a/Static/Main.qss +++ b/Static/Main.qss @@ -36,6 +36,43 @@ QComboBox#tbcombox{ } + +QComboBox#deviceTypeCombox{ + + background-color: #f0f0f0; + + border: none; + + height: 43px; + + padding-left: 5px; + + border-radius: 5px; + + font-size: 20px; + +} + + +QComboBox#deviceTypeCombox::drop-down{ + + image: url(Static/down.png); + + subcontrol-origin: padding; + + subcontrol-position: top right; + + background-color: #f0f0f0; + + width: 20px; + + border:none; + + border-radius: 5px; + + +} + QComboBox#modeCombox::drop-down{ image: url(Static/down.png); diff --git a/Static/PA块信息表.xlsx b/Static/PA块信息表.xlsx index 5f0907d..da87d2c 100644 Binary files a/Static/PA块信息表.xlsx and b/Static/PA块信息表.xlsx differ diff --git a/Static/PA块信息表1.xlsx b/Static/PA块信息表1.xlsx deleted file mode 100644 index 13920e0..0000000 Binary files a/Static/PA块信息表1.xlsx and /dev/null differ diff --git a/UI/BlockParameterManageWidget.py b/UI/BlockParameterManageWidget.py index e7fe3c7..cdfa594 100644 --- a/UI/BlockParameterManageWidget.py +++ b/UI/BlockParameterManageWidget.py @@ -113,7 +113,7 @@ class DynamicAddBlock(QHBoxLayout): fblockBtn.setObjectName("parameBtn") fblockBtn.setIcon(qtawesome.icon('fa.th-large', color='#1fbb6f')) fblockBtn.clicked.connect(lambda _, fbbtn = fblockBtn: self.switchParameterWidget(fbbtn)) - self.addWidget(fblockBtn, 3) + # self.addWidget(fblockBtn, 3) self.buttonlist.append(fblockBtn) aiFunctionBlockView = ParmView(AIFunctionBlock, i, BlockType.FB) self.blockViewlist.append(aiFunctionBlockView) diff --git a/UI/EditAddressWidget.py b/UI/EditAddressWidget.py index 592fdd2..fb7e606 100644 --- a/UI/EditAddressWidget.py +++ b/UI/EditAddressWidget.py @@ -73,7 +73,7 @@ class EditAddressWidget(QDialog): self.deviceTypeCombox.setObjectName('deviceTypeCombox') # self.deviceTypeCombox.addItems(['1', '2']) self.addCheckItem() - self.deviceTypeCombox.currentIndexChanged.connect(lambda index: self.changeDeviceType(index = index)) + # self.deviceTypeCombox.currentIndexChanged.connect(lambda index: self.changeDeviceType(index = index)) self.exitButton = QPushButton('取消') self.exitButton.clicked.connect(self.close) diff --git a/UI/MainWindow.py b/UI/MainWindow.py index 229ca26..48406c0 100644 --- a/UI/MainWindow.py +++ b/UI/MainWindow.py @@ -8,7 +8,7 @@ import subprocess import qtawesome from PyQt5.QtWidgets import QApplication, QPushButton, QMainWindow, QDockWidget, QWidget, QHBoxLayout, QStackedWidget\ - ,QVBoxLayout, QProgressBar, QLabel + ,QVBoxLayout, QProgressBar, QLabel, QButtonGroup from PyQt5.QtCore import Qt, QTimer, QSize from PyQt5.QtGui import QIcon, QWindow, QPixmap from utils.DBModels.BaseModel import * @@ -128,6 +128,7 @@ class MainWindow(QWidget): self.switchTouchBtn.clicked.connect(self.switchTouchMode) self.switchTouchBtn.setCheckable(True) + # 创建按钮 self.minimizeButton = QPushButton(QIcon(':/static/min.png'), "") self.minimizeButton.setObjectName('minButton') @@ -294,15 +295,15 @@ class MainWindow(QWidget): def switchDeviceParManageWidget(self): - if self.deviceParameterManageBtn.isChecked(): - self.stackWidget.setCurrentIndex(2) - self.deviceParameterManageBtn.setText('变量读写') - self.deviceParameterManageBtn.setIcon(qtawesome.icon('fa.pencil-square-o', color='#1fbb6f')) - - else: - self.stackWidget.setCurrentIndex(0) - self.deviceParameterManageBtn.setText('设备参数管理') - self.deviceParameterManageBtn.setIcon(qtawesome.icon('fa.gears', color='#1fbb6f')) + # if self.deviceParameterManageBtn.isChecked(): + self.stackWidget.setCurrentIndex(2) + # self.deviceParameterManageBtn.setText('变量读写') + self.deviceParameterManageBtn.setIcon(qtawesome.icon('fa.pencil-square-o', color='#1fbb6f')) + + # else: + # self.stackWidget.setCurrentIndex(0) + # self.deviceParameterManageBtn.setText('设备参数管理') + # self.deviceParameterManageBtn.setIcon(qtawesome.icon('fa.gears', color='#1fbb6f')) def showLowerWidget(self, process): diff --git a/protocol/ModBus/DPV1Master.py b/protocol/ModBus/DPV1Master.py index f3e7e0f..fb1c213 100644 --- a/protocol/ModBus/DPV1Master.py +++ b/protocol/ModBus/DPV1Master.py @@ -137,6 +137,10 @@ class DPV1Master(): def editDevAddress(self, oldAddress, newAddress, identNumer): oldAddressHex = oldAddress.to_bytes(length=1, byteorder='little') newAddressHex = newAddress.to_bytes(1, byteorder='little') + closeProtocolHex = b'\x05\x00' + closeProtocolData = struct.unpack('>h', closeProtocolHex) + self.writeMultipleRegister(1, 750, closeProtocolHex) + time.sleep(0.4) # print(identNumer) idHighHex = int(identNumer[:2], 16).to_bytes(1, byteorder='little') idLowHex = int(identNumer[2:], 16).to_bytes(1, byteorder='little')