diff --git a/Static/Main.qss b/Static/Main.qss index 3ea0e24..91ed45d 100644 --- a/Static/Main.qss +++ b/Static/Main.qss @@ -298,7 +298,7 @@ QPushButton#parameBtn:pressed{ border: none; - background-color: #04942c; + background-color: #3333ff; margin-bottom: -3px; diff --git a/Static/PA块信息全表.xlsx b/Static/PA块信息全表.xlsx new file mode 100644 index 0000000..1429c2e Binary files /dev/null and b/Static/PA块信息全表.xlsx differ diff --git a/Static/PA块信息表.xlsx b/Static/PA块信息表.xlsx index 1429c2e..b95ae32 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 fd4c625..0000000 Binary files a/Static/PA块信息表1.xlsx and /dev/null differ diff --git a/Static/pict.png b/Static/pict.png index a872dc3..116620f 100644 Binary files a/Static/pict.png and b/Static/pict.png differ diff --git a/UI/BlockParameterManageWidget.py b/UI/BlockParameterManageWidget.py index ca367f5..d30e9a7 100644 --- a/UI/BlockParameterManageWidget.py +++ b/UI/BlockParameterManageWidget.py @@ -323,8 +323,8 @@ class BlockParameterManageWidget(QWidget): # QMessageBox.Yes) # return - # oldAddress = int(self.blockManage.address) - oldAddress = 106 + oldAddress = int(self.blockManage.address) + self.editAddressWidget = EditAddressWidget(oldAddress) if self.editAddressWidget.exec_() == QDialog.Accepted: diff --git a/UI/BlockParameterModel.py b/UI/BlockParameterModel.py index 1ded440..cc7610f 100644 --- a/UI/BlockParameterModel.py +++ b/UI/BlockParameterModel.py @@ -276,11 +276,8 @@ class VarButtonDelegate(QItemDelegate): blockView = self.parent() model = blockView.model parmIndex = model.datas[sender.index[0]][1] - blockType = blockView.blockType blockIndex = blockView.blcokIndex - - # print(blockName, blcokIndex, index) blockManage = Globals.getValue('blockManage') value = blockManage.getBlockParmValue(blockType, blockIndex, parmIndex) diff --git a/UI/BlockParameterView.py b/UI/BlockParameterView.py index 4a74ad4..be73b12 100644 --- a/UI/BlockParameterView.py +++ b/UI/BlockParameterView.py @@ -92,7 +92,7 @@ class ParmView(QTableView): def setData(self): # self.datas = PressureTranslationBlock.getallParame() - self.datas = self.dbModel.getallParame() + self.datas = self.dbModel.getallParameAndID() for index, data in enumerate(self.datas): data[6] = '' desc = data[3].replace('\r\n', '').replace('\n', '') diff --git a/model/ProjectModel/BlockManage.py b/model/ProjectModel/BlockManage.py index 03d26f8..75a8cd4 100644 --- a/model/ProjectModel/BlockManage.py +++ b/model/ProjectModel/BlockManage.py @@ -52,8 +52,8 @@ class BlockManage(): def __init__(self, address = None): self.address = address if address: - pass - # self.initBlocks() + # pass + self.initBlocks() @property def DPV1Master(self): @@ -141,8 +141,8 @@ class BlockManage(): return block def getBlockNums(self): - return [1,1,1] - # return [len(self.blockDict[BlockType.PB]), len(self.blockDict[BlockType.TB]), len(self.blockDict[BlockType.FB])] + # return [1,1,1] + return [len(self.blockDict[BlockType.PB]), len(self.blockDict[BlockType.TB]), len(self.blockDict[BlockType.FB])] @classmethod def searchSlave(self, callback): diff --git a/protocol/ModBus/DPV1Master.py b/protocol/ModBus/DPV1Master.py index e9f4a8c..d1315ad 100644 --- a/protocol/ModBus/DPV1Master.py +++ b/protocol/ModBus/DPV1Master.py @@ -77,7 +77,7 @@ class DPV1Master(): readDate = struct.unpack('>hhh', readByteStream) self.writeMultipleRegister(1, 750, self.resetData) self.writeMultipleRegister(1, 750, readDate) - time.sleep(0.3) + time.sleep(0.4) value = self.readHoldingRegisters(1, 750, -(-length // 2)) # -(-length // 2)向上取整 if value[0] == 57344: self.writeMultipleRegister(1, 750, self.resetData) diff --git a/utils/DBModels/DeviceParModels.py b/utils/DBModels/DeviceParModels.py index b8a983b..aea6c21 100644 --- a/utils/DBModels/DeviceParModels.py +++ b/utils/DBModels/DeviceParModels.py @@ -28,6 +28,16 @@ class PressureTranslationBlock(BaseModel): # 查询设备是否存在 @classmethod def getallParame(cls): + params = cls.get_all() + if params is 'error': + return + l = [] + for x in params: + l.append([x.index, x.paramName, x.description, x.dataType, x.accessType, x.dataSize]) + return l + + @classmethod + def getallParameAndID(cls): params = cls.get_all() if params is 'error': return