SAT9/.resources/9f686b21b3c3558f9752ce0ab99011c6b64c9199c81e10aae99b1dcd3cfd7223

22 lines
553 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