Skip to content
Snippets Groups Projects
Commit 5d1847d5 authored by Corné Lukken's avatar Corné Lukken
Browse files

L2SS-340: Some clean up and basic sst integration tests

parent ddc05fe0
No related branches found
No related tags found
1 merge request!117create TCPReplicator for StatisticsClient
......@@ -95,7 +95,7 @@
"5001"
],
"Statistics_Client_TCP_Port": [
"5002"
"5000"
],
"OPC_Server_Name": [
"sdptr-sim"
......
......@@ -26,6 +26,7 @@ class StatisticsClient(CommClient):
host: hostname to listen on
port: port number to listen on
"""
self.udp_options = udp_options
self.tcp_options = tcp_options
self.queuesize = queuesize
......
from threading import Condition
from threading import Thread
from threading import Semaphore
from queue import Empty
from queue import Queue
from threading import Condition
from threading import Semaphore
from threading import Thread
import asyncio
import logging
......@@ -226,7 +225,7 @@ class TCPReplicator(Thread, StatisticsClientThread):
tcp_server = await loop.create_server(
lambda: TCPReplicator.TCPServerProtocol(options, connected_clients),
options['tcp_bind'], options['tcp_port'])
options['tcp_bind'], options['tcp_port'], reuse_address=True)
async def _process_queue(self):
"""Take a packet from the queue and reschedule this task"""
......
from queue import Queue
from queue import Full
from queue import Queue
from threading import Thread
import numpy
import logging
import numpy
import socket
import time
......@@ -18,6 +18,8 @@ class UDPReceiver(Thread, StatisticsClientThread):
# Default options for UDPReceiver
_default_options = {
"udp_host": None,
"udp_port": None,
"poll_timeout": 0.1,
}
......@@ -25,18 +27,20 @@ class UDPReceiver(Thread, StatisticsClientThread):
self.collector_queue = collector_queue
self.replicator_queue = replicator_queue
self.options = self._parse_options(options)
try:
self.host = self.options['udp_host']
options['udp_host']
except KeyError:
raise
try:
self.port = self.options['udp_port']
options['udp_port']
except KeyError:
raise
self.options = self._parse_options(options)
self.host = self.options['udp_host']
self.port = self.options['udp_port']
self.poll_timeout = self.options['poll_timeout']
self.parameters = {
......
......@@ -27,12 +27,6 @@ from tango import AttrWriteType
from clients.attribute_wrapper import attribute_wrapper
from clients.opcua_client import OPCUAConnection
from clients.statistics_client import StatisticsClient
from devices.hardware_device import hardware_device
from common.lofar_git import get_version
from common.lofar_logging import device_logging_to_python, log_exceptions
from devices.sdp.statistics import Statistics
from devices.sdp.statistics_collector import SSTCollector
......
......@@ -21,7 +21,6 @@ sys.path.append(parentdir)
from abc import ABCMeta, abstractmethod
# PyTango imports
from tango.server import run
from tango.server import device_property, attribute
from tango import AttrWriteType
# Additional import
......
......@@ -6,10 +6,14 @@ if [ -z "$LOFAR20_DIR" ]; then
exit 1
fi
# Start all required containers
# Restart all required containers
cd "$LOFAR20_DIR/docker-compose" || exit 1
make stop device-sdp device-pcc device-sst sdptr-sim pypcc-sim
make start databaseds dsconfig device-sdp device-pcc device-sst jupyter elk sdptr-sim pypcc-sim
# Give dsconfig and databaseds time to start
sleep 15
# Update the dsconfig
cd "$TANGO_LOFAR_LOCAL_DIR" || exit 1
sbin/update_ConfigDb.sh CDB/integration_ConfigDb.json
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment