diff --git a/devices/clients/sst_client.py b/devices/clients/sst_client.py index 407dabde32845b9c16d62019a13012dda2be0676..ab79fe125f66d0d0cf14bc0add00df8f515b9e32 100644 --- a/devices/clients/sst_client.py +++ b/devices/clients/sst_client.py @@ -24,14 +24,15 @@ class sst_client(CommClient): def start(self): super().start() - def __init__(self, host, port, fault_func, streams, try_interval=2): + def __init__(self, host, port, fault_func, streams, try_interval=2, queuesize=1024, buffersize=9000): """ Create the sst client and connect() to it and get the object node """ self.host = host self.port = port self.timeout = 0.1 - self.buffersize = 9000 + self.buffersize = buffersize + self.queuesize = queuesize super().__init__(fault_func, streams, try_interval) @@ -46,7 +47,7 @@ class sst_client(CommClient): Function used to connect to the client. """ if not self.connected: - self.queue = Queue(maxsize=1024) + self.queue = Queue(maxsize=self.queuesize) self.udp = UDP_Receiver(self.host, self.port, self.queue, self.streams, self.buffersize, self.timeout) self.sst = SST(self.queue, self.streams) return super().connect() diff --git a/jupyter-notebooks/test_device.ipynb b/jupyter-notebooks/test_device.ipynb index 69a441862a20d1d0d8f53bf2cf6a68a3dc7c9218..7701f520937bcaf88b09f624c8b9e3a4ee752c85 100644 --- a/jupyter-notebooks/test_device.ipynb +++ b/jupyter-notebooks/test_device.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": 30, + "execution_count": 61, "id": "waiting-chance", "metadata": {}, "outputs": [], @@ -13,7 +13,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 62, "id": "moving-alexandria", "metadata": {}, "outputs": [], @@ -23,7 +23,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 63, "id": "ranking-aluminum", "metadata": {}, "outputs": [ @@ -51,7 +51,7 @@ }, { "cell_type": "code", - "execution_count": 60, + "execution_count": 68, "id": "beneficial-evidence", "metadata": {}, "outputs": [ @@ -59,11 +59,11 @@ "name": "stdout", "output_type": "stream", "text": [ - "packet_count_R [139917203]\n", - "last_packet_timestamp_R [1623248251]\n", - "queue_percentage_used_R [100.]\n", - "State <function __get_command_func.<locals>.f at 0x7fcb20e68bf8>\n", - "Status <function __get_command_func.<locals>.f at 0x7fcb20e68bf8>\n" + "packet_count_R [55]\n", + "last_packet_timestamp_R [1623249385]\n", + "queue_percentage_used_R [0.]\n", + "State <function __get_command_func.<locals>.f at 0x7fcb205fd0d0>\n", + "Status <function __get_command_func.<locals>.f at 0x7fcb205fd0d0>\n" ] } ],