SAT9/.resources/a35f45c34d064403027c8aeffcbdb6349e40e35c0ae9cf94cc0cd268fa16fa12

22 lines
554 B
Plaintext

import json
class SendMessage():
def __init__(self, whid):
self.whid = whid
tag_path = "[%s_SCADA_TAG_PROVIDER]System/wbsckt_messages_send" % (whid)
tags_to_read = system.tag.readBlocking([tag_path])
self.messages_to_send = system.util.jsonDecode(tags_to_read[0].value)
system.tag.writeBlocking([tag_path],[system.util.jsonEncode({})])
self.message_list = {}
def build_message_list(self):
if self.messages_to_send:
self.message_list = json.dumps(self.messages_to_send)
else:
self.message_list = None