prepare application
This commit is contained in:
26
src/AbstractModbusDatapoint.py
Normal file
26
src/AbstractModbusDatapoint.py
Normal file
@ -0,0 +1,26 @@
|
||||
|
||||
class AbstractModbusDatapoint(object):
|
||||
def __init__(self, label, unit, address, count, scanRate):
|
||||
self.label = label
|
||||
self.unit = unit
|
||||
self.address = address
|
||||
self.count = count
|
||||
self.scanRate = scanRate
|
||||
self.type = 'abstract data point'
|
||||
self.command = None
|
||||
self.value = None
|
||||
self.enqueued = False
|
||||
if self.scanRate:
|
||||
self.priority = 1
|
||||
else:
|
||||
self.priority = 0
|
||||
|
||||
def __str__(self):
|
||||
return "{0}, {1}: {2} {3} {4} {5} {6}".format(self.type, self.label, self.unit, self.address, self.count, self.command, self.value)
|
||||
|
||||
def setCommand(self, cmd):
|
||||
self.command = cmd
|
||||
|
||||
def setValue(self, value):
|
||||
self.value = value
|
||||
|
Reference in New Issue
Block a user