SAT9/.resources/1a67cf29366ddc4c9abeb92e093150450a0e43993714ac6fd536ac5c98043ec9
2025-04-18 19:44:27 +04:00

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