You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
624 B
Python
26 lines
624 B
Python
1 year ago
|
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
|