0316更新

main
parent 42d367c786
commit bb15b38860

@ -21,7 +21,7 @@ QPushButton#okBtn:hover, QPushButton#delAreaBtn:hover {
}
QPushButton#wirteDIDOforceBtn {
QPushButton#wirteDIDOforceBtn{
font-size: 16px;
@ -33,8 +33,19 @@ QPushButton#wirteDIDOforceBtn {
padding-bottom: 5px;
border: 1px solid black;
border-radius: 5px;
}
QPushButton#wirteDIDOforceBtn:hover{
font: bold;
}
QPushButton#forceBtn {
font-size: 22px;
@ -47,6 +58,20 @@ QPushButton#forceBtn {
padding-bottom: 5px;
border: 1px solid black;
border-radius: 5px;
/* background-color: #328ffc;*/
}
QPushButton#forceBtn:hover{
font: bold;
}
@ -163,6 +188,14 @@ QLineEdit#byteLineEdit{
font-size: 20px;
border-top: none;
border-left: none;
border-right: none;
border-bottom: 2px solid gary;
}
@ -182,6 +215,13 @@ QLineEdit#wirteDIDOareaLineEdit {
font-size: 16px;
border-top: none;
border-left: none;
border-right: none;
border-bottom: 2px solid gary;
}
@ -196,7 +236,7 @@ QLineEdit#areaLineEdit {
border-right: none;
border-bottom: 1px solid gary;
border-bottom: 2px solid gary;
}
@ -205,7 +245,11 @@ QLineEdit#areaLineEdit {
QComboBox#dataTypeCombox, QComboBox#orderCombox{
font-size: 20px;
font-size: 20px;
/* border: 1px solid black;*/
/* border-radius: 5px;*/
}

@ -9,7 +9,8 @@ from PyQt5.QtWidgets import QApplication, QMainWindow, QTabWidget, QWidget, QVBo
QHBoxLayout, QComboBox, QLineEdit, QSpacerItem, QSizePolicy, QGridLayout, QMessageBox, QSplitter, QFrame
from PyQt5.QtGui import QIcon
from PyQt5.QtCore import QSize
from PyQt5.QtCore import QSize, Qt
from model.ProjectModel.DeviceManage import Device, DevicesManange
from UI.RightAreaWidget import RightAreaWidgets

@ -119,6 +119,7 @@ class MainWindow(QWidget):
def startProtocol(self):
if self.startProtocolBtn.isChecked():
self.devicesManange.connect()
self.startProtocolBtn.setText('停止通讯')
self.startProtocolBtn.setIcon(QIcon('Static/pause.png'))
self.startProtocolBtn.setIconSize(QSize(22, 22))

@ -1,7 +1,9 @@
import re
from PyQt5.QtWidgets import QApplication, QMainWindow, QTabWidget, QWidget, QVBoxLayout, QLabel, QPushButton, QLayout, \
QHBoxLayout, QComboBox, QLineEdit, QSpacerItem, QSizePolicy, QGridLayout, QMessageBox, QSplitter, QFrame
import re
from PyQt5.QtCore import Qt
class forceButton(QPushButton):
def __init__(self, number = None, valueLabel = None, valueEdit = None):
super().__init__()
@ -95,6 +97,7 @@ class RightAreaWidgets(QWidget):
areaValueLabel.setObjectName('wirteDIDOareaValueLabel')
areaLineEdit.setObjectName('wirteDIDOareaLineEdit')
areaLineEdit.setFixedSize(30, 27)
areaLineEdit.setAlignment(Qt.AlignHCenter)
forceBtn.setObjectName('wirteDIDOforceBtn')
if self.deviceName[-2:] + self.dataType in ['主站DI','从站DO']:
@ -111,7 +114,7 @@ class RightAreaWidgets(QWidget):
def wirteAreaLineEditValue(self,dataTypeAndModel, valueLabel, number, value):
if dataTypeAndModel in ['主站AO','从站AI']:
pattern = re.compile(r'^\d+(\.\d+)?$')
pattern = re.compile(r'-?\d*\.?\d+')
match = pattern.match(value)
if not match:
QMessageBox.warning(self, '提示', '请输入数字。')

@ -22,7 +22,6 @@ class TcpMaster():
try:
self.master.execute(slaveId, cst.WRITE_MULTIPLE_REGISTERS, starting_address = address, output_value=outputValue)
except Exception as e:
print(e)
return 'error'

@ -35,7 +35,7 @@ class DeviceDB(BaseModel):
try:
return cls.get(cls.deviceName == str(deviceName))
except Exception as e:
return print(e)
return
# 删除设备
@ -46,7 +46,7 @@ class DeviceDB(BaseModel):
query.execute()
return 'ok'
except Exception as e:
return e
return
# 添加设备

Loading…
Cancel
Save