Skip to content
Snippets Groups Projects
Commit 8cb7b4b0 authored by Jan David Mol's avatar Jan David Mol
Browse files

Merge branch 'master' into L2SS-434-create-sphinx-docs

parents 79d536b0 25b6afd2
Branches
Tags
1 merge request!150L2SS-434: Add sphinx documentation content
if [ ${#} -ne 1 ]; then
echo "You must provide a file name for the TANGO_HOST DB dump!"
exit -1
fi
#!/bin/bash
docker exec -it dsconfig python -m dsconfig.dump > ${1}
# writes the JSON dump to stdout
docker exec -it dsconfig python -m dsconfig.dump
#!/bin/bash
git submodule update --init
......@@ -12,6 +12,10 @@
ABSOLUTE_PATH=$(realpath $(dirname ${BASH_SOURCE}))
export LOFAR20_DIR=${1:-$(realpath ${ABSOLUTE_PATH}/../..)}
if [ ! -f "${LOFAR20_DIR}/.git/hooks/post-checkout" ]; then
alias git="cp ${LOFAR20_DIR}/bin/update_submodules.sh ${LOFAR20_DIR}/.git/hooks/post-checkout; cp ${LOFAR20_DIR}/bin/update_submodules.sh ${LOFAR20_DIR}/.git/hooks/post-merge; unalias git; git"
fi
# This needs to be modified for a development environment.
# In case you run multiple Docker networks on the same host in parallel, you need to specify a unique
# network name for each of them.
......
......@@ -31,7 +31,6 @@ from clients.docker_client import DockerClient
from clients.attribute_wrapper import attribute_wrapper
from devices.hardware_device import hardware_device
from common.lofar_logging import device_logging_to_python, log_exceptions
from common.lofar_git import get_version
__all__ = ["Docker", "main"]
......@@ -50,7 +49,6 @@ class Docker(hardware_device):
# ----------
# Attributes
# ----------
version_R = attribute(dtype=str, access=AttrWriteType.READ, fget=lambda self: get_version())
archiver_maria_db_R = attribute_wrapper(comms_annotation={"container": "archiver-maria-db"}, datatype=numpy.bool_)
archiver_maria_db_RW = attribute_wrapper(comms_annotation={"container": "archiver-maria-db"}, datatype=numpy.bool_, access=AttrWriteType.READ_WRITE)
databaseds_R = attribute_wrapper(comms_annotation={"container": "databaseds"}, datatype=numpy.bool_)
......
......@@ -15,11 +15,12 @@ from abc import ABCMeta, abstractmethod
# PyTango imports
from tango.server import Device, command, DeviceMeta, attribute
from tango import DevState, DebugIt, Attribute, DeviceProxy
from tango import DevState, DebugIt, Attribute, DeviceProxy, AttrWriteType
# Additional import
from clients.attribute_wrapper import attribute_wrapper
from common.lofar_logging import log_exceptions
from common.lofar_git import get_version
from devices.abstract_device import AbstractDeviceMetas
from devices.device_decorators import only_in_states, fault_on_error
......@@ -56,6 +57,8 @@ class hardware_device(Device, metaclass=AbstractDeviceMetas):
The user triggers their transitions by the commands reflecting the target state (Initialise(), On(), Fault()).
"""
version_R = attribute(dtype=str, access=AttrWriteType.READ, fget=lambda self: get_version())
# list of property names too be set first by set_defaults
first_default_settings = []
......
......@@ -29,7 +29,6 @@ from devices.device_decorators import *
from clients.opcua_client import OPCUAConnection
from devices.hardware_device import hardware_device
from common.lofar_logging import device_logging_to_python, log_exceptions
from common.lofar_git import get_version
__all__ = ["opcua_device", "main"]
......
......@@ -30,7 +30,6 @@ from device_decorators import *
from clients.attribute_wrapper import attribute_wrapper
from devices.opcua_device import opcua_device
from common.lofar_logging import device_logging_to_python, log_exceptions
from common.lofar_git import get_version
__all__ = ["RECV", "main"]
......@@ -61,7 +60,6 @@ class RECV(opcua_device):
# ----------
# Attributes
# ----------
version_R = attribute(dtype=str, access=AttrWriteType.READ, fget=lambda self: get_version())
Ant_mask_RW = attribute_wrapper(comms_annotation=["2:PCC", "2:Ant_mask_RW"], datatype=numpy.bool_, dims=(3, 32), access=AttrWriteType.READ_WRITE)
CLK_Enable_PWR_R = attribute_wrapper(comms_annotation=["2:PCC", "2:CLK_Enable_PWR_R"], datatype=numpy.bool_)
CLK_I2C_STATUS_R = attribute_wrapper(comms_annotation=["2:PCC", "2:CLK_I2C_STATUS_R"], datatype=numpy.int64)
......
......@@ -28,7 +28,6 @@ from clients.attribute_wrapper import attribute_wrapper
from devices.opcua_device import opcua_device
from common.lofar_logging import device_logging_to_python, log_exceptions
from common.lofar_git import get_version
import numpy
......@@ -78,8 +77,6 @@ class SDP(opcua_device):
# Attributes
# ----------
version_R = attribute(dtype=str, access=AttrWriteType.READ, fget=lambda self: get_version())
FPGA_beamlet_output_enable_R = attribute_wrapper(comms_annotation=["2:FPGA_beamlet_output_enable_R"], datatype=numpy.bool_, dims=(16,))
FPGA_beamlet_output_enable_RW = attribute_wrapper(comms_annotation=["2:FPGA_beamlet_output_enable_RW"], datatype=numpy.bool_, dims=(16,), access=AttrWriteType.READ_WRITE)
FPGA_beamlet_output_hdr_eth_destination_mac_R = attribute_wrapper(comms_annotation=["2:FPGA_beamlet_output_hdr_eth_destination_mac_R"], datatype=numpy.str, dims=(16,))
......
......@@ -31,7 +31,6 @@ from clients.attribute_wrapper import attribute_wrapper
from devices.opcua_device import opcua_device
from common.lofar_git import get_version
from common.lofar_logging import device_logging_to_python, log_exceptions
import logging
......@@ -67,8 +66,6 @@ class Statistics(opcua_device, metaclass=ABCMeta):
# Attributes
# ----------
version_R = attribute(dtype = str, access = AttrWriteType.READ, fget = lambda self: get_version())
# number of UDP packets and bytes that were received
nof_packets_received_R = attribute_wrapper(comms_id=StatisticsClient, comms_annotation={"type": "udp", "parameter": "nof_packets_received"}, datatype=numpy.uint64)
nof_bytes_received_R = attribute_wrapper(comms_id=StatisticsClient, comms_annotation={"type": "udp", "parameter": "nof_bytes_received"}, datatype=numpy.uint64)
......
......@@ -27,7 +27,6 @@ from clients.attribute_wrapper import attribute_wrapper
from devices.opcua_device import opcua_device
from common.lofar_logging import device_logging_to_python, log_exceptions
from common.lofar_git import get_version
import numpy
......@@ -49,8 +48,6 @@ class UNB2(opcua_device):
# Attributes
# ----------
version_R = attribute(dtype=str, access=AttrWriteType.READ, fget=lambda self: get_version())
N_unb = 2
N_fpga = 4
N_ddr = 2
......
......@@ -29,7 +29,7 @@ services:
volumes:
- ..:/opt/lofar/tango:rw
- /var/run/docker.sock:/var/run/docker.sock:rw # we want to control our sibling containers, NOT do docker-in-docker (dind)
user: ${CONTAINER_EXECUTION_UID}:${DOCKER_GID} # user that starts this container by definition has access rights to docker
user: 1000:${DOCKER_GID} # uid 1000 is the default "tango" user
environment:
- TANGO_HOST=${TANGO_HOST}
entrypoint:
......
......@@ -9,7 +9,10 @@ fi
# copy file into container to read it from container, as the file's location
# in the container won't be the same as on the host.
docker cp "${file}" dsconfig:/tmp/dsconfig-load-settings.json
docker cp "${file}" dsconfig:/tmp/dsconfig-load-settings.json || exit 1
# write settings
docker exec -it dsconfig json2tango --write /tmp/dsconfig-load-settings.json
# somehow json2tango does not return 0 on success
exit 0
#!/bin/bash
#!/bin/bash -e
if [ -z "$LOFA20_DIR"]; then
# We assume we aren't in the PATH, so we can derive our path.
......@@ -18,7 +18,7 @@ make start databaseds dsconfig jupyter elk
sleep 15
# Update the dsconfig
sbin/update_ConfigDb.sh CDB/integration_ConfigDb.json
${LOFAR20_DIR}/sbin/update_ConfigDb.sh ${LOFAR20_DIR}/CDB/integration_ConfigDb.json
cd "$LOFAR20_DIR/docker-compose" || exit 1
make start sdptr-sim recv-sim unb2-sim
......
......@@ -9,7 +9,10 @@ fi
# copy file into container to read it from container, as the file's location
# in the container won't be the same as on the host.
docker cp "${file}" dsconfig:/tmp/dsconfig-update-settings.json
docker cp "${file}" dsconfig:/tmp/dsconfig-update-settings.json || exit 1
# update settings
docker exec -it dsconfig json2tango --write --update /tmp/dsconfig-update-settings.json
# somehow json2tango does not return 0 on success
exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment