|
|
|
@ -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, '提示', '请输入数字。')
|
|
|
|
|