from enum import Enum from utils.DBModels.DeviceParModels import * from protocol.ModBus.DPV1Master import DPV1Master class BlockType(Enum): PB = 0 TB = 1 FB = 2 class BlockManage(): address = 66 def __init__(self): self.DPV1Master = DPV1Master('192.168.3.10', 502) def readDir(self): dirHeadBytes = self.DPV1Master.readParm(address = self.address, slot = 1, index = 0, length = 12) class Block(): slot = None startIndex = None def __init__(self, blockType): self.parms = [] self.blockType = blockType def addParms(self, data): pass