whatever
This commit is contained in:
@ -83,20 +83,24 @@ class HoldingRegisterDatapoint(AbstractModbusDatapoint):
|
|||||||
self.writeRequestValue = value
|
self.writeRequestValue = value
|
||||||
|
|
||||||
|
|
||||||
|
class ReadOnlyDatapoint(AbstractModbusDatapoint):
|
||||||
|
|
||||||
class InputRegisterDatapoint(AbstractModbusDatapoint):
|
|
||||||
def __init__(self, label, unit, address, count, scanRate, updateOnly, publishTopic):
|
def __init__(self, label, unit, address, count, scanRate, updateOnly, publishTopic):
|
||||||
super().__init__(label, unit, address, count, scanRate)
|
super().__init__(label, unit, address, count, scanRate)
|
||||||
self.updateOnly = updateOnly
|
self.updateOnly = updateOnly
|
||||||
self.lastValue = None
|
self.lastValue = None
|
||||||
self.publishTopic = publishTopic
|
self.publishTopic = publishTopic
|
||||||
self.lastContact = None
|
self.lastContact = None
|
||||||
self.type = 'input register'
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "[{0!s}, UpdateOnly: {1}, Read: {2}".format(super().__str__(), self.updateOnly, self.publishTopic)
|
return "[{0!s}, UpdateOnly: {1}, Read: {2}".format(super().__str__(), self.updateOnly, self.publishTopic)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class InputRegisterDatapoint(ReadOnlyDatapoint):
|
||||||
|
def __init__(self, label, unit, address, count, scanRate, updateOnly, publishTopic):
|
||||||
|
super().__init__(label, unit, address, count, scanRate, updateOnly, publishTopic)
|
||||||
|
self.type = 'input register'
|
||||||
|
|
||||||
def process(self, client, pubQueue):
|
def process(self, client, pubQueue):
|
||||||
successFull = True
|
successFull = True
|
||||||
giveUp = False
|
giveUp = False
|
||||||
@ -123,18 +127,11 @@ class InputRegisterDatapoint(AbstractModbusDatapoint):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class DiscreteInputDatapoint(AbstractModbusDatapoint):
|
class DiscreteInputDatapoint(ReadOnlyDatapoint):
|
||||||
def __init__(self, label, unit, address, count, scanRate, updateOnly, publishTopic):
|
def __init__(self, label, unit, address, count, scanRate, updateOnly, publishTopic):
|
||||||
super().__init__(label, unit, address, count, scanRate)
|
super().__init__(label, unit, address, count, scanRate, updateOnly, publishTopic)
|
||||||
self.updateOnly = updateOnly
|
|
||||||
self.lastValue = None
|
|
||||||
self.publishTopic = publishTopic
|
|
||||||
self.lastContact = None
|
|
||||||
self.type = 'discrete input'
|
self.type = 'discrete input'
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return "[{0!s}, UpdateOnly: {1}, Read: {2}".format(super().__str__(), self.updateOnly, self.publishTopic)
|
|
||||||
|
|
||||||
def process(self, client, pubQueue):
|
def process(self, client, pubQueue):
|
||||||
successFull = True
|
successFull = True
|
||||||
giveUp = False
|
giveUp = False
|
||||||
|
Reference in New Issue
Block a user