main
zcwBit 1 year ago
parent 7797fb03c6
commit 9cd4ffc9ce

@ -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);

Binary file not shown.

Binary file not shown.

@ -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)

@ -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)

@ -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):

@ -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')

Loading…
Cancel
Save