pax_global_header 0000666 0000000 0000000 00000000064 13707315520 0014515 g ustar 00root root 0000000 0000000 52 comment=802d122ec853d3543573aab7c5d31d1560f4bfbd
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/ 0000775 0000000 0000000 00000000000 13707315520 0017672 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/.gitignore 0000664 0000000 0000000 00000000310 13707315520 0021654 0 ustar 00root root 0000000 0000000 *.sav
*.swp
*.py[cod]
*.egg-info
*.eggs
.ipynb_checkpoints
build
dist
.cache
__pycache__
htmlcov
.coverage
coverage.xml
.pytest_cache
*,cover
docs/_build
docs/apidocs
# ide
.idea
.eclipse
.vscode
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/.gitlab-ci.yml 0000664 0000000 0000000 00000010551 13707315520 0022330 0 ustar 00root root 0000000 0000000 # GitLab CI in conjunction with GitLab Runner can use Docker Engine to test and build any application.
# Docker, when used with GitLab CI, runs each job in a separate and isolated container using the predefined image that is set up in .gitlab-ci.yml.
# In this case we use the latest python docker image to build and test this project.
#image: nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:latest
variables:
DOCKER_DRIVER: overlay2
services:
- docker:dind
# TODO: add file for LOW project
include:
- local: csp-lmc-common/.gitlab-ci.yml
- local: csp-lmc-mid/.gitlab-ci.yml
# cache is used to specify a list of files and directories which should be cached between jobs. You can only use paths that are within the project workspace.
# If cache is defined outside the scope of jobs, it means it is set globally and all jobs will use that definition
cache:
paths:
# before_script is used to define the command that should be run before all jobs, including deploy jobs, but after the restoration of artifacts.
# This can be an array or a multi-line string.
#before_script:
# - docker login --username $DOCKER_REGISTRY_USERNAME --password $DOCKER_REGISTRY_PASSWORD $DOCKER_REGISTRY_HOST
# The YAML file defines a set of jobs with constraints stating when they should be run.
# You can specify an unlimited number of jobs which are defined as top-level elements with an arbitrary name and always have to contain at least the script clause.
# In this case we have only the test job which produce an artifacts (it must be placed into a directory called "public")
# It is also specified that only the master branch will be subject of this job.
# stages:
# build: build the docker images for csp-lmc-mid and csp-lmc-low
# test: execute tests on csp-lmc-common, csp-lmc-mid, csp-lmc-low
# package: create the python packages for common, mid and low
# publish: publish on nexus the mid and low images and the common python package
# pages: create the badges
stages:
- build_common
- test_common
- publish_common
- build
- test
- linting
- publish
- pages
- release
.install_pip: &install_pip |-
apt-get -y update && apt-get install -yq curl python3-distutils
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python3 get-pip.py
clean shell runner:
stage: .pre
tags:
- docker-executor
script:
# Gitlab CI badges creation
- pwd
- ls -lR
- rm -rf build/*
#
# Pages
#
pages:
tags:
- docker-executor
stage: pages
variables:
COMMON_PATH: csp-lmc-common/docker
MIDCSP_PATH: csp-lmc-mid/docker
script:
- pwd
- pip3 install junitparser
#update coverage o the last release
- pip3 install --upgrade coverage
- ls -lR
# copy the content of packages folders in public
# path to all files is relative to the repository
# that has been cloned during the build
- cp -R $COMMON_PATH/build/ public
- cp -R $MIDCSP_PATH/build/* public
- ls -lR
- junitparser merge public/reports/csp-lmc-common-unit-tests.xml public/reports/csp-lmc-mid-unit-tests.xml public/reports/unit-tests.xml
- ls -lR
- junitparser merge public/reports/csp-lmc-common-linting.xml public/reports/csp-lmc-mid-linting.xml public/reports/linting.xml
- rm public/reports/csp-lmc-common-unit-tests.xml public/reports/csp-lmc-mid-unit-tests.xml
- rm public/reports/csp-lmc-common-linting.xml public/reports/csp-lmc-mid-linting.xml
- cp $COMMON_PATH/build/coverage.xml ./public/reports/code-coverage.xml
#- cd public
#- coverage combine csp-lmc-common_coverage csp-lmc-mid_coverage
#- coverage xml -i
# rename file because bagdges creation looks for code-coverage.xml file
#- mv coverage.xml ./reports/code-coverage.xml
artifacts:
paths:
- public
expire_in: 30 days
create ci metrics:
stage: .post
image: nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:latest
when: always
tags:
- docker-executor
script:
- ls -lR
# copy public in build because ci-metrics scripts look for files in build
- cp -R public build
- ls -lR
# Gitlab CI badges creation: START
- apt-get -y update
- apt-get install -y curl --no-install-recommends
- curl -s https://gitlab.com/ska-telescope/ci-metrics-utilities/raw/master/scripts/ci-badges-func.sh | sh
# Gitlab CI badges creation: END
artifacts:
paths:
- ./build
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/.readthedocs.yml 0000664 0000000 0000000 00000000720 13707315520 0022757 0 ustar 00root root 0000000 0000000 # .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/src/conf.py
# Build documentation with MkDocs
#mkdocs:
# configuration: mkdocs.yml
# Optionally build your docs in additional formats such as PDF and ePub
# formats: all
conda:
environment: docs/src/environment.yml
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/CHANGELOG.rst 0000664 0000000 0000000 00000000402 13707315520 0021707 0 ustar 00root root 0000000 0000000 ###########
Change Log
###########
All notable changes to this project will be documented in this file.
This project adheres to `Semantic Versioning `_.
[Unreleased]
************
Added
-----
* Empty Python project directory structure
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/LICENSE 0000664 0000000 0000000 00000002735 13707315520 0020706 0 ustar 00root root 0000000 0000000
BSD License
Copyright (c) 2018, SKA Organisation
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
* Neither the name of SKA Skeleton nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/README.md 0000664 0000000 0000000 00000017056 13707315520 0021162 0 ustar 00root root 0000000 0000000 CPS.LMC project
===========================
[![Documentation Status](https://readthedocs.org/projects/csp-lmc/badge/?version=latest)](https://developer.skatelescope.org/projects/csp-lmc/en/latest/?badge=latest)
[![coverage report](https://gitlab.com/ska-telescope/csp-lmc/badges/master/coverage.svg)](https://ska-telescope.gitlab.io/csp-lmc/)
[![pipeline status](https://gitlab.com/ska-telescope/csp-lmc/badges/master/pipeline.svg)](https://gitlab.com/ska-telescope/csp-lmc/pipelines)
## Table of contents
* [Introduction](#introduction)
* [Repository](#repository)
* [CSP.LMC Common Package](#csp-lmc-common)
* [Create the CSP.LMC Common Software python package](#python-package)
* [CSP_Mid LMC](#mid-csp-mid-lmc)
* [Running tests](#running-tests)
* [CSP_Low LMC](#csp-low-lmc)
* [Run in containers](#how-to-run-in-docker-containers)
* [Known bugs](#known-bugs)
* [Troubleshooting](#troubleshooting)
* [License](#license)
## Introduction
General requirements for the monitor and control functionality are the same for both the SKA MID and LOW telescopes.
In addition, two of three other CSP Sub-elements, namely the `Pulsar Search` and the `Pulsar Timing`, have the same functionality and use the same design in both telescopes.
Functionality common to `CSP_Low.LMC` and `CSP_Mid.LMC` includes: communication framework, logging, archiving, alarm generation, sub-
arraying, some of the functionality related to handling observing mode changes, `Pulsar Search` and
`Pulsar Timing`, and to some extent Very Long Baseline Interferometry (`VLBI`).
The difference between `CSP_Low.LMC` and `CSP_Mid.LMC` is mostly due to different receivers (dishes vs stations) and
different `CBF` functionality and design.
To maximize code reuse, the software common to `CSP_Low.LMC` and `CSP_Mid.LMC` is developed by the work
package `CSP_Common.LMC` and provided to work packages `CSP_Low.LMC` and `CSP_Mid.LMC`, to
be used as a base for telescope specific `CSP.LMC` software.
## Repository organization
To simplify the access at the whole CSP.LMC software, the `CSP_Common.LMC`, `CSP_Low.LMC` and `CSP_Mid.LMC` software packages are hosted in the same SKA GitLab repository, named `CSP.LMC`.
The `CSP.LMC` repository is organized in three main folders, `csp-lmc-common`, `csp-low-lmc` and `csp-mid-lmc`, each presenting
the same organization:
* project source: contains the specific project TANGO Device Class files
* pogo: contains the POGO files of the TANGO Device Classes of the project
* docker: containes the `docker`, `docker-compose` and `dsconfig` configuration files as well as the Makefile to generate the docker image and run the tests.
* tests: contains the test
To get a local copy of the repository:
```bash
git clone https://gitlab.com/ska-telescope/csp-lmc.git
```
## Prerequisities
* A TANGO development environment properly configured, as described in [SKA developer portal](https://developer.skatelescope.org/en/latest/tools/tango-devenv-setup.html)
* [SKA Base classes](https://gitlab.com/ska-telescope/lmc-base-classes)
*
## CSP_Mid.LMC
The TANGO devices of the CSP_Mid.LMC prototype run in a containerised environment.
Currently only a limitated number of CSP_Mid.LMC and CBF_Mid.LMC devices are run in Docker containers:
* the MidCspMaster and MID CbfMaster
* the MidCspCapabilityMonitor devices
* two instances of the CSP_Mid and CBF_Mid subarrays
* four instances of the Very Coarse Channelizer (VCC) devices
* four instance of the Frequency Slice Processor (FPS) devices
* two instances of the TM TelState Simulator devices
The Docker containers running the CBF_Mid devices are instantiated pulling the `mid-cbf-mcs:test` project image from the [Nexus repository](https://nexus.engageska-portugal.pt).
The CSP_Mid.LMC project provides a [Makefile](Makefile) to start the system containers and the tests.
The containerised environment relies on three YAML configuration files:
* `mid-csp-tangodb.yml`
* `mid-csp-lmc.yml`
* `mid-cbf-mcs.yml`
Each file includes the stages to run the the `CSP_Mid.LMC TANGO DB`, the `CSP_Mid.LMC` devices and `Mid-CBF.LMC` TANGO Devices inside separate docker containers.
These YAML files are used by `docker-compose` to run both the CSP_Mid.LMC and CBF.LMC TANGO device
instances, that is, to run the whole `CSP_Mid.LMC` prototype.>br\>
In this way, it's possible to execute some preliminary integration tests, as for example the assignment/release of receptors to a `CSP_Mid Subarray` and its configuration to execute a scan in Imaging mode.
The `CSP_Mid.LMC` and `Mid-CBF.LMC TANGO` Devices are registered with the same TANGO DB, and its
configuration is performed via the `dsconfig` TANGO Device provided by the [dsconfig project](https://gitlab.com/MaxIV-KitsControls/lib-maxiv-dsconfig).
This device use a JSON file to configure the TANGO DB.
The `CSP_Mid.LMC` and `Mid-CBF.LMC` projects provide its own JSON file:
[midcsplmc\_dsconfig.json](csp-lmc/csp-lmc-mid/csp-lmc-mid/docker/config/midcsplmc_dsconfig.json) and [midcbf\_dsconfig.json](sp-lmc/csp-lmc-mid/csp-lmc-mid/docker/config/midcbf_dsconfig.json)
To run the `CSP_Mid.LMC` prototype inside Docker containers,issue the command:
```bash
make up
```
from the `docker` of the project directory. At the end of the procedure the command
docker ps
shows the list of the running containers:
```
mid-csp-lmc-tangodb: the MariaDB database with the TANGO database tables
mid-csp-lmc-databaseds: the TANGO DB device server
mid-csp-lmc-cbf_dsconfig: the dsconfig container to configure CBF.LMC devices in the TANGO DB
mid-csp-lmc-cbf_dsconfig: the dsconfig container to configure CSP.LMC devices in the TANGO DB
mid-csp-lmc-midcspmaster: the CspMaster TANGO device
mid-csp-lmc-midcapabilitymonitor: the monitor devices of the CSP_Mid.LMC Capabilities
mid-csp-lmc-midcspsubarray[01-02]: two instances of the CspSubarray TANGO device
mid-csp-lmc-rsyslog-csplmc: the rsyslog container for the CSP.LMC devices
mid-csp-lmc-rsyslog-cbf : the rsyslog container for the CBF.LMC devices
mid-csp-lmc-cbfmaster: the CbfMaster TANGO device
mid-csp-lmc-cbfsubarray[01-02]: two instances of the CbfSubarray TANGO device
mid-csp-lmc-vcc[001-004]: four instances of the Mid-CBF VCC TANGO device
mid-csp-lmc-fsp[01-04]: four instances of the Mid-CBF FSP TANGO device
mid-csp-lmc-tmcspsubarrayleafnodetest/2: two instances of the TelState TANGO Device
simulator provided by the CBF project to support scan
configuration for Subarray1/2
```
To stop and removes the Docker containers, issue the command
make down
from the prototype root directory.
__NOTE__
>Docker containers are run with the `--network=host` option.
In this case there is no isolation between the host machine and the containers.
This means that the TANGO DB running in the container is available on port 10000 of the host machine.
Running `jive` on the local host, the `CSP.LMC` and `Mid-CBF.LMC` TANGO Devices registered with the TANGO DB (running in a docker container)
can be visualized and explored.
## Running tests
The project includes a set of tests for the `MidCspMaster` and `MidCspSubarray` TANGO Devices that can be found in the project `tests` folder.
To run the test on the local host issue the command
make test
from the `docker` project directory.
The test are run in docker containers providing the proper environment setup and isolation.
## Known bugs
## Troubleshooting
## License
See the LICENSE file for details.
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/ 0000775 0000000 0000000 00000000000 13707315520 0022516 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/.gitlab-ci.yml 0000664 0000000 0000000 00000007350 13707315520 0025157 0 ustar 00root root 0000000 0000000 # Local Gitlab-CI file for csp-lmc-common project
#
# Build csp-lmc-common python package
#
.build_python_common:
stage: build_common
dependencies: []
image: nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:latest
tags:
- docker-executor
- engageska
artifacts:
paths:
- ./$COMMON_BUILD_PATH/dist/
.build_python_dev_common:
extends: .build_python_common
dependencies: []
script:
- cd $COMMON_BUILD_PATH
- python setup.py egg_info -b+dev.$CI_COMMIT_SHORT_SHA sdist bdist_wheel
.build_python_release_common:
extends: .build_python_common
script:
- cd $COMMON_BUILD_PATH
- python setup.py egg_info -b+$CI_COMMIT_SHORT_SHA sdist bdist_wheel
build:csp-lmc-common_pkg_dev: # Executed on a commit
extends: .build_python_dev_common
variables:
COMMON_BUILD_PATH: csp-lmc-common
build:csp-lmc-common_pkg:
extends: .build_python_release_common
variables:
COMMON_BUILD_PATH: csp-lmc-common
only: [master]
#
# Build csp-lmc-common image
#
build:csp-lmc-common_image:
image: nexus.engageska-portugal.pt/ska-docker/tango-builder:latest
before_script:
- docker login -u $DOCKER_REGISTRY_USERNAME -p $DOCKER_REGISTRY_PASSWORD $DOCKER_REGISTRY_HOST
tags:
- docker-executor
- engageska
stage: build_common
script:
- cd $COMMON_BUILD_PATH
- make build
variables:
COMMON_BUILD_PATH: csp-lmc-common/docker
#
# Test csp-lmc-common project
#
.test_common:
image: nexus.engageska-portugal.pt/ska-docker/tango-builder:latest
before_script:
- docker login -u $DOCKER_REGISTRY_USERNAME -p $DOCKER_REGISTRY_PASSWORD $DOCKER_REGISTRY_HOST
tags:
- docker-executor
artifacts:
paths:
- ./$COMMON_BUILD_PATH/build/
variables:
COMMON_BUILD_PATH: csp-lmc-common/docker
test:csp-lmc-common:
extends: .test_common
stage: test_common
script:
- cd $COMMON_BUILD_PATH
- make test
#
# linting stage
.linting_common:
extends: .test_common
stage: linting
dependencies: []
script:
- apt-get -y update
- apt-get install -y python3-pip python3-setuptools python3-wheel --no-install-recommends
- cd $COMMON_BUILD_PATH
- make lint
linting:csp-lmc-common:
extends: .linting_common
dependencies: []
#
# Publish csp-lmc-common python package
#
.publish_python_common:
stage: publish_common
image: nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:latest
variables:
TWINE_USERNAME: $TWINE_USERNAME
TWINE_PASSWORD: $TWINE_PASSWORD
tags:
- docker-executor
before_script:
- pip install twine
.publish_python_dev_common:
extends: .publish_python_common
except: [master]
script:
- cd $BUILD_PATH
- twine upload --repository-url $PYPI_REPOSITORY_URL dist/* || true
only: # publish development package only when source code changes
changes:
- "**/*.py"
.publish_python_release_common:
extends: .publish_python_common
only: [master]
script:
- cd $COMMON_BUILD_PATH
- twine upload --repository-url $PYPI_REPOSITORY_URL dist/* || true
- twine upload --skip-existing -u $PYPI_USER -p $PYPI_PASS dist/* || true
publish:csp-lmc-common_dev:
extends: .publish_python_dev_common
dependencies:
- build:csp-lmc-common_pkg_dev
variables:
BUILD_PATH: csp-lmc-common
publish:csp-lmc-common:
extends: .publish_python_release_common
dependencies:
- build:csp-lmc-common_pkg
variables:
COMMON_BUILD_PATH: csp-lmc-common
#
# Release csp-lmc-common image on nexus
#
release csp-lmc-common image:
tags:
- docker-executor
stage: release
dependencies:
- build:csp-lmc-common_image
script:
- cd $COMMON_BUILD_PATH
- make push
when: manual
only:
refs:
- master
variables:
COMMON_BUILD_PATH: csp-lmc-common/docker
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/.pylintrc 0000664 0000000 0000000 00000022063 13707315520 0024366 0 ustar 00root root 0000000 0000000 [MASTER]
# Specify a configuration file.
#rcfile=
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook='
# Profiled execution.
profile=no
# Add files or directories to the blacklist. They should be base names, not
# paths.
ignore=CVS
# Pickle collected data for later comparisons.
persistent=yes
# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
load-plugins=
[MESSAGES CONTROL]
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time. See also the "--disable" option for examples.
enable=unreachable,
duplicate-key,
unnecessary-semicolon,
global-variable-not-assigned,
unused-variable,
binary-op-exception,
bad-format-string,
anomalous-backslash-in-string,
bad-open-mode
# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once).You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable= R,C,W,
no-member,
[REPORTS]
# Set the output format. Available formats are text, parseable, colorized, msvs
# (visual studio) and html. You can also give a reporter class, eg
# mypackage.mymodule.MyReporterClass.
#output-format=parseable
output-format=parseable
# Put messages in a separate file for each module / package specified on the
# command line instead of printing them on stdout. Reports (if any) will be
# written in a file name "pylint_global.[txt|html]".
files-output=no
# Tells whether to display a full report or only the messages
reports=yes
# Activate the evaluation score.
score=yes
# Python expression which should return a note less than 10 (10 is the highest
# note). You have access to the variables errors warning, statement which
# respectively contain the number of errors / warnings messages and the total
# number of statements analyzed. This is used by the global evaluation report
# (RP0004).
evaluation= 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
# Add a comment according to your evaluation note. This is used by the global
# evaluation report (RP0004).
comment=no
# Template used to display messages. This is a python new-style format string
# used to format the message information. See doc for all details
#msg-template=
[SIMILARITIES]
# Minimum lines number of a similarity.
min-similarity-lines=4
# Ignore comments when computing similarities.
ignore-comments=yes
# Ignore docstrings when computing similarities.
ignore-docstrings=yes
# Ignore imports when computing similarities.
ignore-imports=no
[TYPECHECK]
# Tells whether missing members accessed in mixin class should be ignored. A
# mixin class is detected if its name ends with "mixin" (case insensitive).
ignore-mixin-members=yes
# List of classes names for which member attributes should not be checked
# (useful for classes with attributes dynamically set).
ignored-classes=SQLObject
# Show a hint with possible names when a member name was not found. The aspect
# of finding the hint is based on edit distance.
missing-member-hint=yes
# When zope mode is activated, add a predefined set of Zope acquired attributes
# to generated-members.
zope=no
# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E0201 when accessed. Python regular
# expressions are accepted.
generated-members=REQUEST,acl_users,aq_parent
[VARIABLES]
# Tells whether we should check for unused import in __init__ files.
init-import=no
# A regular expression matching the beginning of the name of dummy variables
# (i.e. not used).
dummy-variables-rgx=_$|dummy
# List of additional names supposed to be defined in builtins. Remember that
# you should avoid to define new builtins when possible.
additional-builtins=
# Tells whether unused global variables should be treated as a violation.
allow-global-unused-variables=yes
[FORMAT]
# Maximum number of characters on a single line.
max-line-length=100
# Regexp for a line that is allowed to be longer than the limit.
ignore-long-lines=^\s*(# )??$
# Allow the body of an if to be on the same line as the test if there is no
# else.
single-line-if-stmt=no
# List of optional constructs for which whitespace checking is disabled
no-space-check=trailing-comma,dict-separator
# Maximum number of lines in a module
max-module-lines=1000
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
# tab).
indent-string=' '
[BASIC]
# Required attributes for module, separated by a comma
required-attributes=
# List of builtins function names that should not be used, separated by a comma
bad-functions=map,filter,apply,input
# Regular expression which should only match correct module names
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
# Regular expression which should only match correct module level names
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
# Regular expression which should only match correct class names
class-rgx=[A-Z_][a-zA-Z0-9]+$
# Regular expression which should only match correct function names
function-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct method names
method-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct instance attribute names
attr-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct argument names
argument-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct variable names
variable-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct attribute names in class
# bodies
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
# Regular expression which should only match correct list comprehension /
# generator expression variable names
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
# Good variable names which should always be accepted, separated by a comma
good-names=i,j,k,ex,Run,_
# Bad variable names which should always be refused, separated by a comma
bad-names=foo,bar,baz,toto,tutu,tata
# Regular expression which should only match function or class names that do
# not require a docstring.
no-docstring-rgx=__.*__
# Minimum line length for functions/classes that require docstrings, shorter
# ones are exempt.
docstring-min-length=-1
[MISCELLANEOUS]
# List of note tags to take in consideration, separated by a comma.
notes=FIXME,
XXX,
TODO
[IMPORTS]
# Deprecated modules which should not be used, separated by a comma
deprecated-modules=regsub,TERMIOS,Bastion,rexec
# Create a graph of every (i.e. internal and external) dependencies in the
# given file (report RP0402 must not be disabled)
import-graph=
# Create a graph of external dependencies in the given file (report RP0402 must
# not be disabled)
ext-import-graph=
# Create a graph of internal dependencies in the given file (report RP0402 must
# not be disabled)
int-import-graph=
[CLASSES]
# List of interface methods to ignore, separated by a comma. This is used for
# instance to not check methods defines in Zope's Interface base class.
ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
# List of method names used to declare (i.e. assign) instance attributes.
defining-attr-methods=__init__,__new__,setUp
# List of valid names for the first argument in a class method.
valid-classmethod-first-arg=cls
# List of valid names for the first argument in a metaclass class method.
valid-metaclass-classmethod-first-arg=mcs
[DESIGN]
# Maximum number of arguments for function / method
max-args=5
# Argument names that match this expression will be ignored. Default to name
# with leading underscore
ignored-argument-names=_.*
# Maximum number of locals for function / method body
max-locals=20
# Maximum number of return / yield for function / method body
max-returns=6
# Maximum number of branch for function / method body
max-branches=15
# Maximum number of statements in function / method body
max-statements=50
# Maximum number of parents for a class (see R0901).
max-parents=7
# Maximum number of attributes for a class (see R0902).
max-attributes=20
# Minimum number of public methods for a class (see R0903).
min-public-methods=2
# Maximum number of public methods for a class (see R0904).
max-public-methods=40
[EXCEPTIONS]
# Exceptions that will emit a warning when being caught. Defaults to
# "Exception"
overgeneral-exceptions=Exception
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/HISTORY 0000664 0000000 0000000 00000007466 13707315520 0023617 0 ustar 00root root 0000000 0000000 0.6.4
- CSP Subarrays are enabled when the On command is invoked on the CspMaster
- fix EndScan: command invoked synchronously
- GoToIdle now invoked synchronously
0.6.3
- use ska-python-buildenv and runtime 9.3.2
- use lmcbaseclasses ver 0.6.3
- Add support for Off and ObsReset commands
- Fix type_in argument for Scan (now it accepts a DevString instead of a DevStringVarArray)
- EndScan to discuss actual implementation
0.6.2
- Finalized support for Configure command.
- Added GoToIdle command subclassing the ActionCommand class.
0.6.1
- adding support for Configure command
0.6.0
- start implementing lmcbaseclasses 0.6.0
0.5.12
- push event on obsState
- set subarray to CONFIGURING at Configure command reception
- modified __configure_scan thread to catch the CbfSubarray CONFIGURING
obsState
0.5.11
- call to DeviceProxy instead of tango.DeviceProxy to have the deviceemocking works
properly
- removed the cbfOutputLinks forwarded attribute and updated the configuration
files for the TANGO DB.
- set the lmcbaseclasses version < 0.6.0
0.5.10
- fix a minor bug
0.5.9
- implemented the ADR-4 and ADR-10 decisions:
- the json file contains the unique configuration ID
and the list of the outputlinks, channelAverageMap and
received addresses for CBF
- the Scan command specifies as argument the scan Id
- added the isCmdInProgress attribute to get information
about the execution state of a command
0.5.8
- use ska-logging 0.3.0 and lmcbasclasses 0.5.2
-
0.5.7
- removed the problem with forwarded attributes of array of strings.
When the root attribute of a forwarded attribute is an array of
strings the devices crashes.
Moved forwarded attributes to TANGO attributes.
- modify install_requires package in setup.py: use of
ska-logging version < 0.3.0 (0.3.0 has changed
importing and current lmcbaseclasses package is not
updated, yet.).
0.5.6
- set the exec flag before the thread start
- re-enable the cmd_ended_cb callback registration with
the asynchronous commands
- configure thread lock to access commad execution flag
- removed some typos
- more logs
0.5.5
- reduced the sleep time inside monitoring threads in CspMaster.py and CspSubarray.py
- the Csp State attribute is updated in the event callback only when the device is
not running any power command.
- don't register the cmd_ended_cb callback with the asynchronous commands issued to power
the CSP Element. When the CbfMaster is already in the requested State, the exception thrown
by it is caught after the end of the thread and the class attribute _cmd_execution_state
(even if reset to IDLE inside the thread) is still equal RUNNING. This causes the device
failure if a new power command is issued on it. Maybe this issue is related to the PyTango
issue with threading and I/O.
0.5.3
- Use lmcbaseclasses = 0.5.0
- Moved ConfigureScan command to Configure.
- Moved EndSB() method to GoToIdle().
- CspMaster: moved attribute with "alarm" string in the name to "failure".
- Removed the default polling for xxCmdDurationExpected/Measured attributes.
- Removed a bug in the Off() method.
- CspSubarray: removed severe errors from the delete_device() method.
- Commented out the line with connection to PssSubarray.
- Removed a bug in passing arguments to the SubarrayRejectDecorator.
- Updated the csp-lmc-common TANGO DB configuration to resolve
forwarded attributes not addressed.
- Install in editable mode the csp-lmc-common package to install also
lmcbaseclasses package and its dependencies.
- Modified .gitlab-ci.yml file to execute linting and generate metrics.
- Still not resolved the issue to combine coverage outputs of
the different repository projects (csp-lmc-common and csp-lmc-mid).
0.4.0
- Use lmcbaseclasses = 0.4.1
- ska-python-buildenv 9.3.1
- ska-python-runtime 9.3.1
0.3.0
- Use lmcbaseclasses version >=0.2.0
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/Pipfile 0000664 0000000 0000000 00000002012 13707315520 0024024 0 ustar 00root root 0000000 0000000 [[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[[source]]
url = "https://nexus.engageska-portugal.pt/repository/pypi/simple"
verify_ssl = true
name = "nexus-hosted"
[packages]
# numpy and pytango versions must match those in the ska-python-builder image,
# otherwise pytango will be recompiled.
numpy = "==1.17.2"
pytango = "==9.3.1"
# itango is added to make it easier to exercise the device in a CLI session,
# but it's not mandatory. If you remove itango, you should also remove the
# 'RUN ipython profile create' line from Dockerfile.
itango = "*"
future = "*"
lmcbaseclasses= ">=0.5.0"
# If you want to debug devices running in containers, add pydevd to the dependencies
# pydevd = "*"
[dev-packages]
docutils = "*"
MarkupSafe = "*"
Pygments = "*"
pylint = "*"
pytest = "*"
pytest-cov = "*"
pytest-pylint = "*"
pytest-json-report = "*"
python-dotenv = ">=0.5.1"
ptvsd = "*"
Sphinx = "*"
sphinx_rtd_theme = "*"
sphinx-autobuild = "*"
sphinxcontrib-websupport = "*"
[requires]
python_version = "3"
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/Pipfile.lock 0000664 0000000 0000000 00000110313 13707315520 0024757 0 ustar 00root root 0000000 0000000 {
"_meta": {
"hash": {
"sha256": "4fd50e85d5f17054a7da52c09b748d0a37ff5bb1311e63824c58cf1ba65eb597"
},
"pipfile-spec": 6,
"requires": {
"python_version": "3"
},
"sources": [
{
"name": "pypi",
"url": "https://pypi.org/simple",
"verify_ssl": true
},
{
"name": "nexus-hosted",
"url": "https://nexus.engageska-portugal.pt/repository/pypi/simple",
"verify_ssl": true
}
]
},
"default": {
"backcall": {
"hashes": [
"sha256:38ecd85be2c1e78f77fd91700c76e14667dc21e2713b63876c0eb901196e01e4",
"sha256:bbbf4b1e5cd2bdb08f915895b51081c041bac22394fdfcfdfbe9f14b77c08bf2"
],
"version": "==0.1.0"
},
"decorator": {
"hashes": [
"sha256:41fa54c2a0cc4ba648be4fd43cff00aedf5b9465c9bf18d64325bc225f08f760",
"sha256:e3a62f0520172440ca0dcc823749319382e377f37f140a0b99ef45fecb84bfe7"
],
"version": "==4.4.2"
},
"enum34": {
"hashes": [
"sha256:13ef9a1c478203252107f66c25b99b45b1865693ca1284aab40dafa7e1e7ac17",
"sha256:708aabfb3d5898f99674c390d360d59efdd08547019763622365f19e84a7fef4",
"sha256:98df1f1937840b7d8012fea7f0b36392a3e6fd8a2f429c48a3ff4b1aad907f3f"
],
"version": "==1.1.9"
},
"future": {
"hashes": [
"sha256:b1bead90b70cf6ec3f0710ae53a525360fa360d306a86583adc6bf83a4db537d"
],
"version": "==0.18.2"
},
"ipython": {
"hashes": [
"sha256:ca478e52ae1f88da0102360e57e528b92f3ae4316aabac80a2cd7f7ab2efb48a",
"sha256:eb8d075de37f678424527b5ef6ea23f7b80240ca031c2dd6de5879d687a65333"
],
"version": "==7.13.0"
},
"ipython-genutils": {
"hashes": [
"sha256:72dd37233799e619666c9f639a9da83c34013a73e8bbc79a7a6348d93c61fab8",
"sha256:eb2e116e75ecef9d4d228fdc66af54269afa26ab4463042e33785b887c628ba8"
],
"version": "==0.2.0"
},
"itango": {
"hashes": [
"sha256:b81d58319e88494d40105dd4b4e2cf6840deeb2dffa74bd9a977396a17306640"
],
"index": "pypi",
"version": "==0.1.6"
},
"jedi": {
"hashes": [
"sha256:b4f4052551025c6b0b0b193b29a6ff7bdb74c52450631206c262aef9f7159ad2",
"sha256:d5c871cb9360b414f981e7072c52c33258d598305280fef91c6cae34739d65d5"
],
"version": "==0.16.0"
},
"lmcbaseclasses": {
"hashes": [
"sha256:3ac6551c36993100f68393000cf1d2fd6f73531bfbf93fc1a7baac6891535238",
"sha256:9476822b37fe9173ace8e385ac723645e71ee3c0b08d8f3914b37891c2cf7c66"
],
"index": "pypi",
"version": "==0.4.0+5bdedbed"
},
"numpy": {
"hashes": [
"sha256:05dbfe72684cc14b92568de1bc1f41e5f62b00f714afc9adee42f6311738091f",
"sha256:0d82cb7271a577529d07bbb05cb58675f2deb09772175fab96dc8de025d8ac05",
"sha256:10132aa1fef99adc85a905d82e8497a580f83739837d7cbd234649f2e9b9dc58",
"sha256:12322df2e21f033a60c80319c25011194cd2a21294cc66fee0908aeae2c27832",
"sha256:16f19b3aa775dddc9814e02a46b8e6ae6a54ed8cf143962b4e53f0471dbd7b16",
"sha256:3d0b0989dd2d066db006158de7220802899a1e5c8cf622abe2d0bd158fd01c2c",
"sha256:438a3f0e7b681642898fd7993d38e2bf140a2d1eafaf3e89bb626db7f50db355",
"sha256:5fd214f482ab53f2cea57414c5fb3e58895b17df6e6f5bca5be6a0bb6aea23bb",
"sha256:73615d3edc84dd7c4aeb212fa3748fb83217e00d201875a47327f55363cef2df",
"sha256:7bd355ad7496f4ce1d235e9814ec81ee3d28308d591c067ce92e49f745ba2c2f",
"sha256:7d077f2976b8f3de08a0dcf5d72083f4af5411e8fddacd662aae27baa2601196",
"sha256:a4092682778dc48093e8bda8d26ee8360153e2047826f95a3f5eae09f0ae3abf",
"sha256:b458de8624c9f6034af492372eb2fee41a8e605f03f4732f43fc099e227858b2",
"sha256:e70fc8ff03a961f13363c2c95ef8285e0cf6a720f8271836f852cc0fa64e97c8",
"sha256:ee8e9d7cad5fe6dde50ede0d2e978d81eafeaa6233fb0b8719f60214cf226578",
"sha256:f4a4f6aba148858a5a5d546a99280f71f5ee6ec8182a7d195af1a914195b21a2"
],
"index": "pypi",
"version": "==1.17.2"
},
"parso": {
"hashes": [
"sha256:0c5659e0c6eba20636f99a04f469798dca8da279645ce5c387315b2c23912157",
"sha256:8515fc12cfca6ee3aa59138741fc5624d62340c97e401c74875769948d4f2995"
],
"version": "==0.6.2"
},
"pexpect": {
"hashes": [
"sha256:0b48a55dcb3c05f3329815901ea4fc1537514d6ba867a152b581d69ae3710937",
"sha256:fc65a43959d153d0114afe13997d439c22823a27cefceb5ff35c2178c6784c0c"
],
"markers": "sys_platform != 'win32'",
"version": "==4.8.0"
},
"pickleshare": {
"hashes": [
"sha256:87683d47965c1da65cdacaf31c8441d12b8044cdec9aca500cd78fc2c683afca",
"sha256:9649af414d74d4df115d5d718f82acb59c9d418196b7b4290ed47a12ce62df56"
],
"version": "==0.7.5"
},
"prompt-toolkit": {
"hashes": [
"sha256:a402e9bf468b63314e37460b68ba68243d55b2f8c4d0192f85a019af3945050e",
"sha256:c93e53af97f630f12f5f62a3274e79527936ed466f038953dfa379d4941f651a"
],
"version": "==3.0.3"
},
"ptyprocess": {
"hashes": [
"sha256:923f299cc5ad920c68f2bc0bc98b75b9f838b93b599941a6b63ddbc2476394c0",
"sha256:d7cc528d76e76342423ca640335bd3633420dc1366f258cb31d05e865ef5ca1f"
],
"version": "==0.6.0"
},
"pygments": {
"hashes": [
"sha256:2a3fe295e54a20164a9df49c75fa58526d3be48e14aceba6d6b1e8ac0bfd6f1b",
"sha256:98c8aa5a9f778fcd1026a17361ddaf7330d1b7c62ae97c3bb0ae73e0b9b6b0fe"
],
"version": "==2.5.2"
},
"pytango": {
"hashes": [
"sha256:254348ca5f17ed5b79cb653eeb46d87ac3d7347fc17b4b2185c4618fc4c000d7",
"sha256:54bdca5091fb351be984f71738ce0e2f8ba90c3ac6a50be20dfc7d4cad054806",
"sha256:618008d84d9ed34749f61e9e5232d0bbb9c7ad295e79b83407bbb0876c41cd7b",
"sha256:89647522eb85e676fbfdf442de28eb8154ea3130cb2be6edfbf13b966ed1aeaa",
"sha256:8e61617c1ba98d7abecc6c939a3b6bed6ad5ff00d515d29ea030347755a59200",
"sha256:cccf547b34d48cd7ef99aa1279d47784da1c1cb582b6cbc546ca4e280cbd2459",
"sha256:de4f7280df1d0c3194be5b59bc2c23aa9b4b84985d696a145073d71a057a6bb9"
],
"index": "pypi",
"version": "==9.3.1"
},
"six": {
"hashes": [
"sha256:236bdbdce46e6e6a3d61a337c0f8b763ca1e8717c03b369e87a7ec7ce1319c0a",
"sha256:8f3cd2e254d8f793e7f3d6d9df77b92252b52637291d0f0da013c76ea2724b6c"
],
"version": "==1.14.0"
},
"ska-logging": {
"hashes": [
"sha256:1c9ea6bc9342c9851e241312386b4964c6c178501fbe9b8ff865e04908ed4e3f",
"sha256:7ddb0c25d848d486c733a394e9b24af1de93a91689981b72ba21091eea4052b9"
],
"version": "==0.2.1"
},
"traitlets": {
"hashes": [
"sha256:70b4c6a1d9019d7b4f6846832288f86998aa3b9207c6821f3578a6a6a467fe44",
"sha256:d023ee369ddd2763310e4c3eae1ff649689440d4ae59d7485eb4cfbbe3e359f7"
],
"version": "==4.3.3"
},
"wcwidth": {
"hashes": [
"sha256:8fd29383f539be45b20bd4df0dc29c20ba48654a41e661925e612311e9f3c603",
"sha256:f28b3e8a6483e5d49e7f8949ac1a78314e740333ae305b4ba5defd3e74fb37a8"
],
"version": "==0.1.8"
}
},
"develop": {
"alabaster": {
"hashes": [
"sha256:446438bdcca0e05bd45ea2de1668c1d9b032e1a9154c2c259092d77031ddd359",
"sha256:a661d72d58e6ea8a57f7a86e37d86716863ee5e92788398526d58b26a4e4dc02"
],
"version": "==0.7.12"
},
"argh": {
"hashes": [
"sha256:a9b3aaa1904eeb78e32394cd46c6f37ac0fb4af6dc488daa58971bdc7d7fcaf3",
"sha256:e9535b8c84dc9571a48999094fda7f33e63c3f1b74f3e5f3ac0105a58405bb65"
],
"version": "==0.26.2"
},
"astroid": {
"hashes": [
"sha256:71ea07f44df9568a75d0f354c49143a4575d90645e9fead6dfb52c26a85ed13a",
"sha256:840947ebfa8b58f318d42301cf8c0a20fd794a33b61cc4638e28e9e61ba32f42"
],
"version": "==2.3.3"
},
"attrs": {
"hashes": [
"sha256:08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c",
"sha256:f7b7ce16570fe9965acd6d30101a28f62fb4a7f9e926b3bbc9b61f8b04247e72"
],
"version": "==19.3.0"
},
"babel": {
"hashes": [
"sha256:1aac2ae2d0d8ea368fa90906567f5c08463d98ade155c0c4bfedd6a0f7160e38",
"sha256:d670ea0b10f8b723672d3a6abeb87b565b244da220d76b4dba1b66269ec152d4"
],
"version": "==2.8.0"
},
"certifi": {
"hashes": [
"sha256:017c25db2a153ce562900032d5bc68e9f191e44e9a0f762f373977de9df1fbb3",
"sha256:25b64c7da4cd7479594d035c08c2d809eb4aab3a26e5a990ea98cc450c320f1f"
],
"version": "==2019.11.28"
},
"chardet": {
"hashes": [
"sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae",
"sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"
],
"version": "==3.0.4"
},
"coverage": {
"hashes": [
"sha256:15cf13a6896048d6d947bf7d222f36e4809ab926894beb748fc9caa14605d9c3",
"sha256:1daa3eceed220f9fdb80d5ff950dd95112cd27f70d004c7918ca6dfc6c47054c",
"sha256:1e44a022500d944d42f94df76727ba3fc0a5c0b672c358b61067abb88caee7a0",
"sha256:25dbf1110d70bab68a74b4b9d74f30e99b177cde3388e07cc7272f2168bd1477",
"sha256:3230d1003eec018ad4a472d254991e34241e0bbd513e97a29727c7c2f637bd2a",
"sha256:3dbb72eaeea5763676a1a1efd9b427a048c97c39ed92e13336e726117d0b72bf",
"sha256:5012d3b8d5a500834783689a5d2292fe06ec75dc86ee1ccdad04b6f5bf231691",
"sha256:51bc7710b13a2ae0c726f69756cf7ffd4362f4ac36546e243136187cfcc8aa73",
"sha256:527b4f316e6bf7755082a783726da20671a0cc388b786a64417780b90565b987",
"sha256:722e4557c8039aad9592c6a4213db75da08c2cd9945320220634f637251c3894",
"sha256:76e2057e8ffba5472fd28a3a010431fd9e928885ff480cb278877c6e9943cc2e",
"sha256:77afca04240c40450c331fa796b3eab6f1e15c5ecf8bf2b8bee9706cd5452fef",
"sha256:7afad9835e7a651d3551eab18cbc0fdb888f0a6136169fbef0662d9cdc9987cf",
"sha256:9bea19ac2f08672636350f203db89382121c9c2ade85d945953ef3c8cf9d2a68",
"sha256:a8b8ac7876bc3598e43e2603f772d2353d9931709345ad6c1149009fd1bc81b8",
"sha256:b0840b45187699affd4c6588286d429cd79a99d509fe3de0f209594669bb0954",
"sha256:b26aaf69713e5674efbde4d728fb7124e429c9466aeaf5f4a7e9e699b12c9fe2",
"sha256:b63dd43f455ba878e5e9f80ba4f748c0a2156dde6e0e6e690310e24d6e8caf40",
"sha256:be18f4ae5a9e46edae3f329de2191747966a34a3d93046dbdf897319923923bc",
"sha256:c312e57847db2526bc92b9bfa78266bfbaabac3fdcd751df4d062cd4c23e46dc",
"sha256:c60097190fe9dc2b329a0eb03393e2e0829156a589bd732e70794c0dd804258e",
"sha256:c62a2143e1313944bf4a5ab34fd3b4be15367a02e9478b0ce800cb510e3bbb9d",
"sha256:cc1109f54a14d940b8512ee9f1c3975c181bbb200306c6d8b87d93376538782f",
"sha256:cd60f507c125ac0ad83f05803063bed27e50fa903b9c2cfee3f8a6867ca600fc",
"sha256:d513cc3db248e566e07a0da99c230aca3556d9b09ed02f420664e2da97eac301",
"sha256:d649dc0bcace6fcdb446ae02b98798a856593b19b637c1b9af8edadf2b150bea",
"sha256:d7008a6796095a79544f4da1ee49418901961c97ca9e9d44904205ff7d6aa8cb",
"sha256:da93027835164b8223e8e5af2cf902a4c80ed93cb0909417234f4a9df3bcd9af",
"sha256:e69215621707119c6baf99bda014a45b999d37602cb7043d943c76a59b05bf52",
"sha256:ea9525e0fef2de9208250d6c5aeeee0138921057cd67fcef90fbed49c4d62d37",
"sha256:fca1669d464f0c9831fd10be2eef6b86f5ebd76c724d1e0706ebdff86bb4adf0"
],
"version": "==5.0.3"
},
"docutils": {
"hashes": [
"sha256:0c5b78adfbf7762415433f5515cd5c9e762339e23369dbe8000d84a4bf4ab3af",
"sha256:c2de3a60e9e7d07be26b7f2b00ca0309c207e06c100f9cc2a94931fc75a478fc"
],
"index": "pypi",
"version": "==0.16"
},
"idna": {
"hashes": [
"sha256:7588d1c14ae4c77d74036e8c22ff447b26d0fde8f007354fd48a7814db15b7cb",
"sha256:a068a21ceac8a4d63dbfd964670474107f541babbd2250d61922f029858365fa"
],
"version": "==2.9"
},
"imagesize": {
"hashes": [
"sha256:6965f19a6a2039c7d48bca7dba2473069ff854c36ae6f19d2cde309d998228a1",
"sha256:b1f6b5a4eab1f73479a50fb79fcf729514a900c341d8503d62a62dbc4127a2b1"
],
"version": "==1.2.0"
},
"importlib-metadata": {
"hashes": [
"sha256:06f5b3a99029c7134207dd882428a66992a9de2bef7c2b699b5641f9886c3302",
"sha256:b97607a1a18a5100839aec1dc26a1ea17ee0d93b20b0f008d80a5a050afb200b"
],
"markers": "python_version < '3.8'",
"version": "==1.5.0"
},
"isort": {
"hashes": [
"sha256:54da7e92468955c4fceacd0c86bd0ec997b0e1ee80d97f67c35a78b719dccab1",
"sha256:6e811fcb295968434526407adb8796944f1988c5b65e8139058f2014cbe100fd"
],
"version": "==4.3.21"
},
"jinja2": {
"hashes": [
"sha256:93187ffbc7808079673ef52771baa950426fd664d3aad1d0fa3e95644360e250",
"sha256:b0eaf100007721b5c16c1fc1eecb87409464edc10469ddc9a22a27a99123be49"
],
"version": "==2.11.1"
},
"lazy-object-proxy": {
"hashes": [
"sha256:0c4b206227a8097f05c4dbdd323c50edf81f15db3b8dc064d08c62d37e1a504d",
"sha256:194d092e6f246b906e8f70884e620e459fc54db3259e60cf69a4d66c3fda3449",
"sha256:1be7e4c9f96948003609aa6c974ae59830a6baecc5376c25c92d7d697e684c08",
"sha256:4677f594e474c91da97f489fea5b7daa17b5517190899cf213697e48d3902f5a",
"sha256:48dab84ebd4831077b150572aec802f303117c8cc5c871e182447281ebf3ac50",
"sha256:5541cada25cd173702dbd99f8e22434105456314462326f06dba3e180f203dfd",
"sha256:59f79fef100b09564bc2df42ea2d8d21a64fdcda64979c0fa3db7bdaabaf6239",
"sha256:8d859b89baf8ef7f8bc6b00aa20316483d67f0b1cbf422f5b4dc56701c8f2ffb",
"sha256:9254f4358b9b541e3441b007a0ea0764b9d056afdeafc1a5569eee1cc6c1b9ea",
"sha256:9651375199045a358eb6741df3e02a651e0330be090b3bc79f6d0de31a80ec3e",
"sha256:97bb5884f6f1cdce0099f86b907aa41c970c3c672ac8b9c8352789e103cf3156",
"sha256:9b15f3f4c0f35727d3a0fba4b770b3c4ebbb1fa907dbcc046a1d2799f3edd142",
"sha256:a2238e9d1bb71a56cd710611a1614d1194dc10a175c1e08d75e1a7bcc250d442",
"sha256:a6ae12d08c0bf9909ce12385803a543bfe99b95fe01e752536a60af2b7797c62",
"sha256:ca0a928a3ddbc5725be2dd1cf895ec0a254798915fb3a36af0964a0a4149e3db",
"sha256:cb2c7c57005a6804ab66f106ceb8482da55f5314b7fcb06551db1edae4ad1531",
"sha256:d74bb8693bf9cf75ac3b47a54d716bbb1a92648d5f781fc799347cfc95952383",
"sha256:d945239a5639b3ff35b70a88c5f2f491913eb94871780ebfabb2568bd58afc5a",
"sha256:eba7011090323c1dadf18b3b689845fd96a61ba0a1dfbd7f24b921398affc357",
"sha256:efa1909120ce98bbb3777e8b6f92237f5d5c8ea6758efea36a473e1d38f7d3e4",
"sha256:f3900e8a5de27447acbf900b4750b0ddfd7ec1ea7fbaf11dfa911141bc522af0"
],
"version": "==1.4.3"
},
"livereload": {
"hashes": [
"sha256:78d55f2c268a8823ba499305dcac64e28ddeb9a92571e12d543cd304faf5817b",
"sha256:89254f78d7529d7ea0a3417d224c34287ebfe266b05e67e51facaf82c27f0f66"
],
"version": "==2.6.1"
},
"markupsafe": {
"hashes": [
"sha256:00bc623926325b26bb9605ae9eae8a215691f33cae5df11ca5424f06f2d1f473",
"sha256:09027a7803a62ca78792ad89403b1b7a73a01c8cb65909cd876f7fcebd79b161",
"sha256:09c4b7f37d6c648cb13f9230d847adf22f8171b1ccc4d5682398e77f40309235",
"sha256:1027c282dad077d0bae18be6794e6b6b8c91d58ed8a8d89a89d59693b9131db5",
"sha256:13d3144e1e340870b25e7b10b98d779608c02016d5184cfb9927a9f10c689f42",
"sha256:24982cc2533820871eba85ba648cd53d8623687ff11cbb805be4ff7b4c971aff",
"sha256:29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b",
"sha256:43a55c2930bbc139570ac2452adf3d70cdbb3cfe5912c71cdce1c2c6bbd9c5d1",
"sha256:46c99d2de99945ec5cb54f23c8cd5689f6d7177305ebff350a58ce5f8de1669e",
"sha256:500d4957e52ddc3351cabf489e79c91c17f6e0899158447047588650b5e69183",
"sha256:535f6fc4d397c1563d08b88e485c3496cf5784e927af890fb3c3aac7f933ec66",
"sha256:596510de112c685489095da617b5bcbbac7dd6384aeebeda4df6025d0256a81b",
"sha256:62fe6c95e3ec8a7fad637b7f3d372c15ec1caa01ab47926cfdf7a75b40e0eac1",
"sha256:6788b695d50a51edb699cb55e35487e430fa21f1ed838122d722e0ff0ac5ba15",
"sha256:6dd73240d2af64df90aa7c4e7481e23825ea70af4b4922f8ede5b9e35f78a3b1",
"sha256:717ba8fe3ae9cc0006d7c451f0bb265ee07739daf76355d06366154ee68d221e",
"sha256:79855e1c5b8da654cf486b830bd42c06e8780cea587384cf6545b7d9ac013a0b",
"sha256:7c1699dfe0cf8ff607dbdcc1e9b9af1755371f92a68f706051cc8c37d447c905",
"sha256:88e5fcfb52ee7b911e8bb6d6aa2fd21fbecc674eadd44118a9cc3863f938e735",
"sha256:8defac2f2ccd6805ebf65f5eeb132adcf2ab57aa11fdf4c0dd5169a004710e7d",
"sha256:98c7086708b163d425c67c7a91bad6e466bb99d797aa64f965e9d25c12111a5e",
"sha256:9add70b36c5666a2ed02b43b335fe19002ee5235efd4b8a89bfcf9005bebac0d",
"sha256:9bf40443012702a1d2070043cb6291650a0841ece432556f784f004937f0f32c",
"sha256:ade5e387d2ad0d7ebf59146cc00c8044acbd863725f887353a10df825fc8ae21",
"sha256:b00c1de48212e4cc9603895652c5c410df699856a2853135b3967591e4beebc2",
"sha256:b1282f8c00509d99fef04d8ba936b156d419be841854fe901d8ae224c59f0be5",
"sha256:b2051432115498d3562c084a49bba65d97cf251f5a331c64a12ee7e04dacc51b",
"sha256:ba59edeaa2fc6114428f1637ffff42da1e311e29382d81b339c1817d37ec93c6",
"sha256:c8716a48d94b06bb3b2524c2b77e055fb313aeb4ea620c8dd03a105574ba704f",
"sha256:cd5df75523866410809ca100dc9681e301e3c27567cf498077e8551b6d20e42f",
"sha256:cdb132fc825c38e1aeec2c8aa9338310d29d337bebbd7baa06889d09a60a1fa2",
"sha256:e249096428b3ae81b08327a63a485ad0878de3fb939049038579ac0ef61e17e7",
"sha256:e8313f01ba26fbbe36c7be1966a7b7424942f670f38e666995b88d012765b9be"
],
"index": "pypi",
"version": "==1.1.1"
},
"mccabe": {
"hashes": [
"sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42",
"sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"
],
"version": "==0.6.1"
},
"more-itertools": {
"hashes": [
"sha256:5dd8bcf33e5f9513ffa06d5ad33d78f31e1931ac9a18f33d37e77a180d393a7c",
"sha256:b1ddb932186d8a6ac451e1d95844b382f55e12686d51ca0c68b6f61f2ab7a507"
],
"version": "==8.2.0"
},
"packaging": {
"hashes": [
"sha256:170748228214b70b672c581a3dd610ee51f733018650740e98c7df862a583f73",
"sha256:e665345f9eef0c621aa0bf2f8d78cf6d21904eef16a93f020240b704a57f1334"
],
"version": "==20.1"
},
"pathtools": {
"hashes": [
"sha256:7c35c5421a39bb82e58018febd90e3b6e5db34c5443aaaf742b3f33d4655f1c0"
],
"version": "==0.1.2"
},
"pluggy": {
"hashes": [
"sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0",
"sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"
],
"version": "==0.13.1"
},
"port-for": {
"hashes": [
"sha256:b16a84bb29c2954db44c29be38b17c659c9c27e33918dec16b90d375cc596f1c"
],
"version": "==0.3.1"
},
"ptvsd": {
"hashes": [
"sha256:10745fbb788001959b4de405198d8bd5243611a88fb5a2e2c6800245bc0ddd74",
"sha256:1d3d82ecc82186d099992a748556e6e54037f5c5e4d3fc9bba3e2302354be0d4",
"sha256:20f48ffed42a6beb879c250d82662e175ad59cc46a29c95c6a4472ae413199c5",
"sha256:22b699369a18ff28d4d1aa6a452739e50c7b7790cb16c6312d766e023c12fe27",
"sha256:2bbc121bce3608501998afbe742f02b80e7d26b8fecd38f78b903f22f52a81d9",
"sha256:3b05c06018fdbce5943c50fb0baac695b5c11326f9e21a5266c854306bda28ab",
"sha256:3f839fe91d9ddca0d6a3a0afd6a1c824be1768498a737ab9333d084c5c3f3591",
"sha256:459137736068bb02515040b2ed2738169cb30d69a38e0fd5dffcba255f41e68d",
"sha256:58508485a1609a495dd45829bd6d219303cf9edef5ca1f01a9ed8ffaa87f390c",
"sha256:612948a045fcf9c8931cd306972902440278f34de7ca684b49d4caeec9f1ec62",
"sha256:70260b4591c07bff95566d49b6a5dc3051d8558035c43c847bad9a954def46bb",
"sha256:72d114baa5737baf29c8068d1ccdd93cbb332d2030601c888eed0e3761b588d7",
"sha256:90cbd082e7a9089664888d0d94aca760202f080133fca8f3fe65c48ed6b9e39d",
"sha256:92d26aa7c8f7ffe41cb4b50a00846027027fa17acdf2d9dd8c24de77b25166c6",
"sha256:b9970e3dc987eb2a6001af6c9d2f726dd6455cfc6d47e0f51925cbdee7ea2157",
"sha256:c01204e3f025c3f7252c79c1a8a028246d29e3ef339e1a01ddf652999f47bdea",
"sha256:c893fb9d1c2ef8f980cc00ced3fd90356f86d9f59b58ee97e0e7e622b8860f76",
"sha256:c97c71835dde7e67fc7b06398bee1c012559a0784ebda9cf8acaf176c7ae766c",
"sha256:ccc5c533135305709461f545feed5061c608714db38fa0f58e3f848a127b7fde",
"sha256:cf09fd4d90c4c42ddd9bf853290f1a80bc2128993a3923bd3b96b68cc1acd03f",
"sha256:d2662ec37ee049c0f8f2f9a378abeb7e570d9215c19eaf0a6d7189464195009f",
"sha256:d9337ebba4d099698982e090b203e85670086c4b29cf1185b2e45cd353a8053e",
"sha256:de5234bec74c47da668e1a1a21bcc9821af0cbb28b5153df78cd5abc744b29a2",
"sha256:eda10ecd43daacc180a6fbe524992be76a877c3559e2b78016b4ada8fec10273",
"sha256:fad06de012a78f277318d0c308dd3d7cc1f67167f3b2e1e2f7c6caf04c03440c"
],
"index": "pypi",
"version": "==4.3.2"
},
"py": {
"hashes": [
"sha256:5e27081401262157467ad6e7f851b7aa402c5852dbcb3dae06768434de5752aa",
"sha256:c20fdd83a5dbc0af9efd622bee9a5564e278f6380fffcacc43ba6f43db2813b0"
],
"version": "==1.8.1"
},
"pygments": {
"hashes": [
"sha256:2a3fe295e54a20164a9df49c75fa58526d3be48e14aceba6d6b1e8ac0bfd6f1b",
"sha256:98c8aa5a9f778fcd1026a17361ddaf7330d1b7c62ae97c3bb0ae73e0b9b6b0fe"
],
"version": "==2.5.2"
},
"pylint": {
"hashes": [
"sha256:3db5468ad013380e987410a8d6956226963aed94ecb5f9d3a28acca6d9ac36cd",
"sha256:886e6afc935ea2590b462664b161ca9a5e40168ea99e5300935f6591ad467df4"
],
"index": "pypi",
"version": "==2.4.4"
},
"pyparsing": {
"hashes": [
"sha256:4c830582a84fb022400b85429791bc551f1f4871c33f23e44f353119e92f969f",
"sha256:c342dccb5250c08d45fd6f8b4a559613ca603b57498511740e65cd11a2e7dcec"
],
"version": "==2.4.6"
},
"pytest": {
"hashes": [
"sha256:0d5fe9189a148acc3c3eb2ac8e1ac0742cb7618c084f3d228baaec0c254b318d",
"sha256:ff615c761e25eb25df19edddc0b970302d2a9091fbce0e7213298d85fb61fef6"
],
"index": "pypi",
"version": "==5.3.5"
},
"pytest-cov": {
"hashes": [
"sha256:cc6742d8bac45070217169f5f72ceee1e0e55b0221f54bcf24845972d3a47f2b",
"sha256:cdbdef4f870408ebdbfeb44e63e07eb18bb4619fae852f6e760645fa36172626"
],
"index": "pypi",
"version": "==2.8.1"
},
"pytest-json-report": {
"hashes": [
"sha256:08182e00de9eb1735274fe4b91b0cf7314e138c0dac7e4ae424c3ec469787a2b",
"sha256:628b2a3a8f6edf069bf502ad8f65694ce6f2e4f86e73db442f18122389dafc38"
],
"index": "pypi",
"version": "==1.2.1"
},
"pytest-metadata": {
"hashes": [
"sha256:2071a59285de40d7541fde1eb9f1ddea1c9db165882df82781367471238b66ba",
"sha256:c29a1fb470424926c63154c1b632c02585f2ba4282932058a71d35295ff8c96d"
],
"version": "==1.8.0"
},
"pytest-pylint": {
"hashes": [
"sha256:3996a55ba66ce8ddf150754d8549567a4b067d63fa4513fdfd3325c7553c8075",
"sha256:b3f83f4525b2cbd019e9e46b4ee9c4ccee82bde66edf9872690ccfdc75456703"
],
"index": "pypi",
"version": "==0.15.0"
},
"python-dotenv": {
"hashes": [
"sha256:81822227f771e0cab235a2939f0f265954ac4763cafd806d845801c863bf372f",
"sha256:92b3123fb2d58a284f76cc92bfe4ee6c502c32ded73e8b051c4f6afc8b6751ed"
],
"index": "pypi",
"version": "==0.12.0"
},
"pytz": {
"hashes": [
"sha256:1c557d7d0e871de1f5ccd5833f60fb2550652da6be2693c1e02300743d21500d",
"sha256:b02c06db6cf09c12dd25137e563b31700d3b80fcc4ad23abb7a315f2789819be"
],
"version": "==2019.3"
},
"pyyaml": {
"hashes": [
"sha256:059b2ee3194d718896c0ad077dd8c043e5e909d9180f387ce42012662a4946d6",
"sha256:1cf708e2ac57f3aabc87405f04b86354f66799c8e62c28c5fc5f88b5521b2dbf",
"sha256:24521fa2890642614558b492b473bee0ac1f8057a7263156b02e8b14c88ce6f5",
"sha256:4fee71aa5bc6ed9d5f116327c04273e25ae31a3020386916905767ec4fc5317e",
"sha256:70024e02197337533eef7b85b068212420f950319cc8c580261963aefc75f811",
"sha256:74782fbd4d4f87ff04159e986886931456a1894c61229be9eaf4de6f6e44b99e",
"sha256:940532b111b1952befd7db542c370887a8611660d2b9becff75d39355303d82d",
"sha256:cb1f2f5e426dc9f07a7681419fe39cee823bb74f723f36f70399123f439e9b20",
"sha256:dbbb2379c19ed6042e8f11f2a2c66d39cceb8aeace421bfc29d085d93eda3689",
"sha256:e3a057b7a64f1222b56e47bcff5e4b94c4f61faac04c7c4ecb1985e18caa3994",
"sha256:e9f45bd5b92c7974e59bcd2dcc8631a6b6cc380a904725fce7bc08872e691615"
],
"version": "==5.3"
},
"requests": {
"hashes": [
"sha256:43999036bfa82904b6af1d99e4882b560e5e2c68e5c4b0aa03b655f3d7d73fee",
"sha256:b3f43d496c6daba4493e7c431722aeb7dbc6288f52a6e04e7b6023b0247817e6"
],
"version": "==2.23.0"
},
"six": {
"hashes": [
"sha256:236bdbdce46e6e6a3d61a337c0f8b763ca1e8717c03b369e87a7ec7ce1319c0a",
"sha256:8f3cd2e254d8f793e7f3d6d9df77b92252b52637291d0f0da013c76ea2724b6c"
],
"version": "==1.14.0"
},
"snowballstemmer": {
"hashes": [
"sha256:209f257d7533fdb3cb73bdbd24f436239ca3b2fa67d56f6ff88e86be08cc5ef0",
"sha256:df3bac3df4c2c01363f3dd2cfa78cce2840a79b9f1c2d2de9ce8d31683992f52"
],
"version": "==2.0.0"
},
"sphinx": {
"hashes": [
"sha256:776ff8333181138fae52df65be733127539623bb46cc692e7fa0fcfc80d7aa88",
"sha256:ca762da97c3b5107cbf0ab9e11d3ec7ab8d3c31377266fd613b962ed971df709"
],
"index": "pypi",
"version": "==2.4.3"
},
"sphinx-autobuild": {
"hashes": [
"sha256:66388f81884666e3821edbe05dd53a0cfb68093873d17320d0610de8db28c74e",
"sha256:e60aea0789cab02fa32ee63c7acae5ef41c06f1434d9fd0a74250a61f5994692"
],
"index": "pypi",
"version": "==0.7.1"
},
"sphinx-rtd-theme": {
"hashes": [
"sha256:00cf895504a7895ee433807c62094cf1e95f065843bf3acd17037c3e9a2becd4",
"sha256:728607e34d60456d736cc7991fd236afb828b21b82f956c5ea75f94c8414040a"
],
"index": "pypi",
"version": "==0.4.3"
},
"sphinxcontrib-applehelp": {
"hashes": [
"sha256:806111e5e962be97c29ec4c1e7fe277bfd19e9652fb1a4392105b43e01af885a",
"sha256:a072735ec80e7675e3f432fcae8610ecf509c5f1869d17e2eecff44389cdbc58"
],
"version": "==1.0.2"
},
"sphinxcontrib-devhelp": {
"hashes": [
"sha256:8165223f9a335cc1af7ffe1ed31d2871f325254c0423bc0c4c7cd1c1e4734a2e",
"sha256:ff7f1afa7b9642e7060379360a67e9c41e8f3121f2ce9164266f61b9f4b338e4"
],
"version": "==1.0.2"
},
"sphinxcontrib-htmlhelp": {
"hashes": [
"sha256:3c0bc24a2c41e340ac37c85ced6dafc879ab485c095b1d65d2461ac2f7cca86f",
"sha256:e8f5bb7e31b2dbb25b9cc435c8ab7a79787ebf7f906155729338f3156d93659b"
],
"version": "==1.0.3"
},
"sphinxcontrib-jsmath": {
"hashes": [
"sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178",
"sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8"
],
"version": "==1.0.1"
},
"sphinxcontrib-qthelp": {
"hashes": [
"sha256:4c33767ee058b70dba89a6fc5c1892c0d57a54be67ddd3e7875a18d14cba5a72",
"sha256:bd9fc24bcb748a8d51fd4ecaade681350aa63009a347a8c14e637895444dfab6"
],
"version": "==1.0.3"
},
"sphinxcontrib-serializinghtml": {
"hashes": [
"sha256:eaa0eccc86e982a9b939b2b82d12cc5d013385ba5eadcc7e4fed23f4405f77bc",
"sha256:f242a81d423f59617a8e5cf16f5d4d74e28ee9a66f9e5b637a18082991db5a9a"
],
"version": "==1.1.4"
},
"sphinxcontrib-websupport": {
"hashes": [
"sha256:50fb98fcb8ff2a8869af2afa6b8ee51b3baeb0b17dacd72505105bf15d506ead",
"sha256:bad3fbd312bc36a31841e06e7617471587ef642bdacdbdddaa8cc30cf251b5ea"
],
"index": "pypi",
"version": "==1.2.0"
},
"tornado": {
"hashes": [
"sha256:349884248c36801afa19e342a77cc4458caca694b0eda633f5878e458a44cb2c",
"sha256:398e0d35e086ba38a0427c3b37f4337327231942e731edaa6e9fd1865bbd6f60",
"sha256:4e73ef678b1a859f0cb29e1d895526a20ea64b5ffd510a2307b5998c7df24281",
"sha256:559bce3d31484b665259f50cd94c5c28b961b09315ccd838f284687245f416e5",
"sha256:abbe53a39734ef4aba061fca54e30c6b4639d3e1f59653f0da37a0003de148c7",
"sha256:c845db36ba616912074c5b1ee897f8e0124df269468f25e4fe21fe72f6edd7a9",
"sha256:c9399267c926a4e7c418baa5cbe91c7d1cf362d505a1ef898fde44a07c9dd8a5"
],
"version": "==6.0.3"
},
"typed-ast": {
"hashes": [
"sha256:0666aa36131496aed8f7be0410ff974562ab7eeac11ef351def9ea6fa28f6355",
"sha256:0c2c07682d61a629b68433afb159376e24e5b2fd4641d35424e462169c0a7919",
"sha256:249862707802d40f7f29f6e1aad8d84b5aa9e44552d2cc17384b209f091276aa",
"sha256:24995c843eb0ad11a4527b026b4dde3da70e1f2d8806c99b7b4a7cf491612652",
"sha256:269151951236b0f9a6f04015a9004084a5ab0d5f19b57de779f908621e7d8b75",
"sha256:4083861b0aa07990b619bd7ddc365eb7fa4b817e99cf5f8d9cf21a42780f6e01",
"sha256:498b0f36cc7054c1fead3d7fc59d2150f4d5c6c56ba7fb150c013fbc683a8d2d",
"sha256:4e3e5da80ccbebfff202a67bf900d081906c358ccc3d5e3c8aea42fdfdfd51c1",
"sha256:6daac9731f172c2a22ade6ed0c00197ee7cc1221aa84cfdf9c31defeb059a907",
"sha256:715ff2f2df46121071622063fc7543d9b1fd19ebfc4f5c8895af64a77a8c852c",
"sha256:73d785a950fc82dd2a25897d525d003f6378d1cb23ab305578394694202a58c3",
"sha256:8c8aaad94455178e3187ab22c8b01a3837f8ee50e09cf31f1ba129eb293ec30b",
"sha256:8ce678dbaf790dbdb3eba24056d5364fb45944f33553dd5869b7580cdbb83614",
"sha256:aaee9905aee35ba5905cfb3c62f3e83b3bec7b39413f0a7f19be4e547ea01ebb",
"sha256:bcd3b13b56ea479b3650b82cabd6b5343a625b0ced5429e4ccad28a8973f301b",
"sha256:c9e348e02e4d2b4a8b2eedb48210430658df6951fa484e59de33ff773fbd4b41",
"sha256:d205b1b46085271b4e15f670058ce182bd1199e56b317bf2ec004b6a44f911f6",
"sha256:d43943ef777f9a1c42bf4e552ba23ac77a6351de620aa9acf64ad54933ad4d34",
"sha256:d5d33e9e7af3b34a40dc05f498939f0ebf187f07c385fd58d591c533ad8562fe",
"sha256:fc0fea399acb12edbf8a628ba8d2312f583bdbdb3335635db062fa98cf71fca4",
"sha256:fe460b922ec15dd205595c9b5b99e2f056fd98ae8f9f56b888e7a17dc2b757e7"
],
"markers": "implementation_name == 'cpython' and python_version < '3.8'",
"version": "==1.4.1"
},
"urllib3": {
"hashes": [
"sha256:2f3db8b19923a873b3e5256dc9c2dedfa883e33d87c690d9c7913e1f40673cdc",
"sha256:87716c2d2a7121198ebcb7ce7cccf6ce5e9ba539041cfbaeecfb641dc0bf6acc"
],
"version": "==1.25.8"
},
"watchdog": {
"hashes": [
"sha256:c560efb643faed5ef28784b2245cf8874f939569717a4a12826a173ac644456b"
],
"version": "==0.10.2"
},
"wcwidth": {
"hashes": [
"sha256:8fd29383f539be45b20bd4df0dc29c20ba48654a41e661925e612311e9f3c603",
"sha256:f28b3e8a6483e5d49e7f8949ac1a78314e740333ae305b4ba5defd3e74fb37a8"
],
"version": "==0.1.8"
},
"wrapt": {
"hashes": [
"sha256:565a021fd19419476b9362b05eeaa094178de64f8361e44468f9e9d7843901e1"
],
"version": "==1.11.2"
},
"zipp": {
"hashes": [
"sha256:aa36550ff0c0b7ef7fa639055d797116ee891440eac1a56f378e2d3179e0320b",
"sha256:c599e4d75c98f6798c509911d08a22e6c021d074469042177c8c86fb92eefd96"
],
"version": "==3.1.0"
}
}
}
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/README.md 0000664 0000000 0000000 00000001540 13707315520 0023775 0 ustar 00root root 0000000 0000000 ## Description
General requirements for the monitor and control functionality are the same for both SKA Mid and Low
telescopes.
Two of three `CSP` Sub-elements, `PSS` and `PST`, have the same functionality and use the
same design in both telesopes.
Functionality common to Low and Mid `CSP.LMC` includes:
* communication software
* logging
* archiving
* alarm generation
* sub-arraying
* some of the functionality related to handling observing mode
* Pulsar Search and Pulsar Timing.
The main differences between `Low` and `Mid` `CSP.LMC` are due to the different receivers and `CBF`
functionality and design.
The `CSP.LMC Common Software` package provides the base software to develop the Low and Mid CSP.LMC.
The `CSP.LMC` software is based on the `TANGO Control System`,the `SKA Control System Guidelines` and the `SKA CSP.LMC Base Classes`.
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/conftest.py 0000664 0000000 0000000 00000006045 13707315520 0024722 0 ustar 00root root 0000000 0000000 """
A module defining a list of fixture functions.
"""
import importlib
import pytest
import tango
from unittest import mock
from tango import DeviceProxy
from tango.test_context import DeviceTestContext
@pytest.fixture(scope="class")
def tango_context(request):
"""Creates and returns a TANGO DeviceTestContext object.
Parameters
----------
request: _pytest.fixtures.SubRequest
A request object gives access to the requesting test context.
"""
test_properties = {
'CspMaster': {'SkaLevel': '2',
'CspCbf': 'mid_csp_cbf/sub_elt/master',
'CspPss': 'mid_csp_pss/sub_elt/master',
'CspPst': 'mid_csp_pst/sub_elt/master',
},
'CspSubarray': {'CspMaster': 'common/elt/master',
'CbfSubarray': 'mid_csp_cbf/sub_elt/subarray_01',
'PssSubarray': 'mid_csp_pss/sub_elt/subarray_01',
'SubID' : 1,
},
}
# TODO: package_name and class_name can be used in future
# fq_test_class_name = request.cls.__module__
# fq_test_class_name_details = fq_test_class_name.split(".")
# package_name = fq_test_class_name_details[1]
# class_name = module_name = fq_test_class_name_details[1]
test_class_name = request.cls.__name__
class_name = test_class_name.split('Test', 1)[-1]
module = importlib.import_module("{}.{}".format("csp_lmc_common", class_name))
klass = getattr(module, class_name)
tango_context = DeviceTestContext(klass, properties=test_properties.get(class_name))
tango_context.start()
yield tango_context
tango_context.stop()
#
# NOTE: if initialize_device is called, the tests crash with error because during the
# CspMaster and CspMaster access to the TANGO DB to get the memorized attributes.
# Need to mock the call to the TANGO DB get_device_attribute
@pytest.fixture(scope="function")
def initialize_device(tango_context):
"""Re-initializes the device.
Parameters
----------
tango_context: tango.test_context.DeviceTestContext
Context to run a device without a database.
"""
yield tango_context.device.Init()
@pytest.fixture(scope="class")
def cbf_master():
"""Create DeviceProxy for the CbfMaster device
to test the device with the TANGO DB
"""
database = tango.Database()
instance_list = database.get_device_exported_for_class('CbfMaster')
for instance in instance_list.value_string:
try:
return tango.DeviceProxy(instance)
except tango.DevFailed:
continue
@pytest.fixture(scope="class")
def csp_master():
"""Create DeviceProxy for the CspMaster device
to test the device with the TANGO DB
"""
database = tango.Database()
instance_list = database.get_device_exported_for_class('CspMaster')
for instance in instance_list.value_string:
try:
return tango.DeviceProxy(instance)
except tango.DevFailed:
continue
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/csp_lmc_common/ 0000775 0000000 0000000 00000000000 13707315520 0025506 5 ustar 00root root 0000000 0000000 CspBeamCapabilityBaseClass.py 0000664 0000000 0000000 00000006716 13707315520 0033110 0 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/csp_lmc_common # -*- coding: utf-8 -*-
#
# This file is part of the CspBeamCapabilityBaseClass project
#
# INAF-SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
""" CSP Beam Capability Base Class
Parent class of the CSP Beams Capability
"""
# PROTECTED REGION ID (CspBeamCapabilityBase.standardlibray_import) ENABLED START #
# Python standard library
# PROTECTED REGION END# //CspBeamCapabilityBase.standardlibray_import
# PyTango imports
import tango
from tango import DebugIt
from tango.server import run
from tango.server import Device
from tango.server import attribute, command
from tango.server import device_property
from tango import AttrQuality, DispLevel, DevState
from tango import AttrWriteType, PipeWriteType
from ska.base import SKACapability
# Additional import
# PROTECTED REGION ID(CspBeamCapabilityBaseClass.additionnal_import) ENABLED START #
# PROTECTED REGION END # // CspBeamCapabilityBaseClass.additionnal_import
__all__ = ["CspBeamCapabilityBaseClass", "main"]
class CspBeamCapabilityBaseClass(SKACapability):
"""
Parent class of the CSP Beams Capability
**Properties:**
- Device Property
"""
# PROTECTED REGION ID(CspBeamCapabilityBaseClass.class_variable) ENABLED START #
# PROTECTED REGION END # // CspBeamCapabilityBaseClass.class_variable
# -----------------
# Device Properties
# -----------------
# ----------
# Attributes
# ----------
subarrayMembership = attribute(
dtype='DevUShort',
label="The Beam Capability subarray affiliation.",
doc="The subarray ID the CSP Beam Capability belongs to.",
)
# ---------------
# General methods
# ---------------
def init_device(self):
"""Initialises the attributes and properties of the CspBeamCapabilityBaseClass."""
SKACapability.init_device(self)
# PROTECTED REGION ID(CspBeamCapabilityBaseClass.init_device) ENABLED START #
# PROTECTED REGION END # // CspBeamCapabilityBaseClass.init_device
def always_executed_hook(self):
"""Method always executed before any TANGO command is executed."""
# PROTECTED REGION ID(CspBeamCapabilityBaseClass.always_executed_hook) ENABLED START #
# PROTECTED REGION END # // CspBeamCapabilityBaseClass.always_executed_hook
def delete_device(self):
"""Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command.
"""
# PROTECTED REGION ID(CspBeamCapabilityBaseClass.delete_device) ENABLED START #
# PROTECTED REGION END # // CspBeamCapabilityBaseClass.delete_device
# ------------------
# Attributes methods
# ------------------
def read_subarrayMembership(self):
# PROTECTED REGION ID(CspBeamCapabilityBaseClass.subarrayMembership_read) ENABLED START #
"""Return the subarrayMembership attribute."""
return 0
# PROTECTED REGION END # // CspBeamCapabilityBaseClass.subarrayMembership_read
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
# PROTECTED REGION ID(CspBeamCapabilityBaseClass.main) ENABLED START #
return run((CspBeamCapabilityBaseClass,), args=args, **kwargs)
# PROTECTED REGION END # // CspBeamCapabilityBaseClass.main
if __name__ == '__main__':
main()
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/csp_lmc_common/CspCapabilityMonitor.py 0000664 0000000 0000000 00000043045 13707315520 0032165 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
#
# This file is part of the CspCapabilityMonitor project
#
# INAF, SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
""" CSP.LMC Common Class
CSP.LMC Common Class designed to monitoring the SCM
attributes of the CSP Capabilities: SearchBeams, TimingBeams,
VlbiBeams, Receptors/Stations.
"""
# PROTECTED REGION ID (CspMaster.standardlibray_import) ENABLED START #
# Python standard library
from __future__ import absolute_import
import sys
import os
from collections import defaultdict
# PROTECTED REGION END# //CspMaster.standardlibray_import
# tango imports
import tango
from tango import DebugIt
from tango.server import run
from tango.server import attribute, command
from tango.server import device_property
from tango import AttrQuality, DispLevel, DevState
from tango import AttrWriteType, EventType
# Additional import
# PROTECTED REGION ID(CspCapabilityMonitor.additionnal_import) ENABLED START #
from ska.base import SKABaseDevice
from ska.base import utils
from ska.base.control_model import HealthState, AdminMode, ObsState, ObsMode
# PROTECTED REGION END # // CspCapabilityMonitor.additionnal_import
__all__ = ["CspCapabilityMonitor", "main"]
class CspCapabilityMonitor(SKABaseDevice):
"""
CSP.LMC Common Class designed to monitoring the SCM
attributes of the CSP Capabilities: SearchBeams, TimingBeams,
VlbiBeams, Receptors/Stations.
**Properties:**
- Device Property
CapabilityDevices
- The list of the CSP Capability devices FQDNs monitored\nby the instance.
- Type:'DevVarStringArray'
"""
# PROTECTED REGION ID(CspCapabilityMonitor.class_variable) ENABLED START #
# PROTECTED REGION END # // CspCapabilityMonitor.class_variable
# -----------------
# Device Properties
# -----------------
CapabilityDevices = device_property(
dtype='DevVarStringArray',
)
# ----------
# Attributes
# ----------
numOfUnassignedIDs = attribute(
dtype='DevUShort',
)
capabilityState = attribute(
dtype=('DevState',),
max_dim_x=1500,
label="Capability State",
doc="Report the State of the capabilities.",
)
capabilityHealthState = attribute(
dtype=('DevUShort',),
max_dim_x=1500,
)
capabilityAdminMode = attribute(
dtype=('DevUShort',),
access=AttrWriteType.READ_WRITE,
max_dim_x=1500,
)
capabilityObsState = attribute(
dtype=('DevUShort',),
max_dim_x=1500,
)
unassignedIDs = attribute(
dtype=('DevUShort',),
max_dim_x=1500,
)
capabilityAddresses = attribute(
dtype=('DevString',),
max_dim_x=1500,
label="CSP.LMC Capability devices FQDNs",
doc="The FQDNs of the CSP.LMC Capability devices: SearchBeams, TimingBeams, VlbiBeams,\nReceptors (MID instance), Stations (LOW instance)",
)
capabilityMembership = attribute(
dtype=('DevUShort',),
max_dim_x=1500,
label="Capability sub-array affiliation",
)
# ---------------
# General methods
# ---------------
def init_device(self):
"""Initialises the attributes and properties of the CspCapabilityMonitor."""
SKABaseDevice.init_device(self)
# PROTECTED REGION ID(CspCapabilityMonitor.init_device) ENABLED START #
self.set_state(tango.DevState.INIT)
# _capability_fqdn
# Python list of the FQDNs of the Capability devices
self._capability_fqdn = []
# _capability_proxies
# Python dictionary with the proxies the Capability devices
# keys: capability fqdn
# values: tango proxy
self._capability_proxies = {}
# _event_id
# Python dictionary with the event ids of the subscribed attributes
# keys: capability fqdn
# values: event id
self._event_id = defaultdict(lambda: defaultdict(lambda: 0))
# _capability_state
# Python dictionary with the State of each capability
# keys: capability fqdn
# values: capability device State
self._capability_state = {}
# _capability_health_state
# Python dictionary with the healthState of each capability
# keys: capability fqdn
# values: capability healthState
self._capability_health_state = {}
# _capability_admin_mode
# Python dictionary with the adminMode of each capability
# keys: capability fqdn
# values: capability adminMode
self._capability_admin_mode = {}
# _capability_obs_state
# Python dictionary with the obsSate of each capability
# keys: capability fqdn
# values: capability obsState
self._capability_obs_state = {}
# _capability_membership
# Python dictionary with the subarray affiliation (subarrayID
# value) of each capability
# keys: capability fqdn
# values: capability affiliation (= subarrayID, 0 if not assigned to
# any subarray)
self._capability_membership = {}
# self.CapabilityDevices type is
# copy to a Python list
for fqdn in self.CapabilityDevices:
self._capability_fqdn.append(fqdn)
# initialization
self._unassigned_ids = [0]* len(self._capability_fqdn)
self._capability_state = {fqdn:tango.DevState.DISABLE for fqdn in self._capability_fqdn}
self._capability_health_state = {fqdn:HealthState.UNKNOWN for fqdn in self._capability_fqdn}
self._capability_admin_mode = {fqdn:AdminMode.NOT_FITTED for fqdn in self._capability_fqdn}
self._capability_obs_state = {fqdn:ObsState.IDLE for fqdn in self._capability_fqdn}
self._capability_membership = {fqdn:0 for fqdn in self._capability_fqdn}
# establish connection with the CSP.LMC TANGO DB
self._csp_tango_db = 0
self._csp_tango_db = tango.Database()
attribute_properties = self._csp_tango_db.get_device_attribute_property(self.get_name(),
{'adminMode': ['__value']})
try:
admin_mode_memorized = attribute_properties['adminMode']['__value']
self._admin_mode = int(admin_mode_memorized[0])
except KeyError as key_err:
self.logger.info("No {} key found".format(str(key_err)))
self._connect_to_capability()
self._healthState = HealthState.OK
self.set_state(tango.DevState.ON)
def _connect_to_capability(self):
# connect to DB and read the adminMode of each capability
for fqdn in self.CapabilityDevices:
self._event_id[fqdn] = []
attribute_properties = self._csp_tango_db.get_device_attribute_property(fqdn, {'adminMode': ['__value'],})
try:
admin_mode_memorized = attribute_properties['adminMode']['__value']
self._capability_admin_mode[fqdn] = int(admin_mode_memorized[0])
except KeyError as key_err:
self.logger.warning("_connect_to_capability: No key {} found.".format(str(key_err)))
try:
device_proxy = tango.DeviceProxy(fqdn)
self._capability_proxies[fqdn] = device_proxy
ev_id = device_proxy.subscribe_event("adminMode",
EventType.CHANGE_EVENT,
self._attributes_change_event_cb,
stateless=True)
self._event_id[fqdn].append(ev_id)
ev_id = device_proxy.subscribe_event("State",
EventType.CHANGE_EVENT,
self._attributes_change_event_cb,
stateless=True)
self._event_id[fqdn].append(ev_id)
ev_id = device_proxy.subscribe_event("healthState",
EventType.CHANGE_EVENT,
self._attributes_change_event_cb,
stateless=True)
self._event_id[fqdn].append(ev_id)
ev_id = device_proxy.subscribe_event("obsState",
EventType.CHANGE_EVENT,
self._attributes_change_event_cb,
stateless=True)
self._event_id[fqdn].append(ev_id)
ev_id = device_proxy.subscribe_event("subarrayMemebership",
EventType.CHANGE_EVENT,
self._attributes_change_event_cb,
stateless=True)
self._event_id[fqdn].append(ev_id)
except tango.DevFailed as tango_err:
self.logger.warning("_connect_to_capability: {}.".format(tango_err.args[0].desc))
def _attributes_change_event_cb(self, evt):
dev_name = evt.device.dev_name()
if not evt.err:
try:
if dev_name in self.CapabilityDevices:
if evt.attr_value.name.lower() == "state":
self._capability_state[dev_name] = evt.attr_value.value
elif evt.attr_value.name.lower() == "healthstate":
self._capability_health_state[dev_name] = evt.attr_value.value
elif evt.attr_value.name.lower() == "adminmode":
self._capability_admin_mode[dev_name] = evt.attr_value.value
elif evt.attr_value.name.lower() == "obsstate":
self._capability_obsstate[dev_name] = evt.attr_value.value
elif evt.attr_value.name.lower() == "subarrayMembershp":
self._capability_membership[dev_name] = evt.attr_value.value
else:
self.logger.info("Attribute {} not still "
"handled".format(evt.attr_name))
else:
self.logger.info("Unexpected change event for"
" attribute: {}".format(str(evt.attr_name)))
return
log_msg = "New value for {} is {}".format(str(evt.attr_name),
str(evt.attr_value.value))
except tango.DevFailed as df:
self.logger.error(str(df.args[0].desc))
except Exception as except_occurred:
self.logger.error(str(except_occurred))
else:
for item in evt.errors:
# API_EventTimeout: if sub-element device not reachable it transitions
# to UNKNOWN state.
if item.reason == "API_EventTimeout":
self._capability_state[dev_name] = tango.DevState.DISABLED
self._capability_health_state[dev_name] = HealthState.UNKNOWN
self._capability_admin_mode[dev_name] = AdminMode.NOT_FITTED
self._capability_health_state[dev_name] = ObsState.IDLE
log_msg = item.reason + ": on attribute " + str(evt.attr_name)
self.logger.warning(log_msg)
def always_executed_hook(self):
"""Method always executed before any TANGO command is executed."""
# PROTECTED REGION ID(CspCapabilityMonitor.always_executed_hook) ENABLED START #
# PROTECTED REGION END # // CspCapabilityMonitor.always_executed_hook
def delete_device(self):
"""Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command.
"""
# PROTECTED REGION ID(CspCapabilityMonitor.delete_device) ENABLED START #
for fqdn in self._capability_fqdn:
self.logger.info("delete: {}".format(fqdn))
event_to_remove = []
try:
for ev_id in self._event_id[fqdn]:
self.logger.info("ev_id:{}".format(ev_id))
try:
self._capability_proxies[fqdn].unsubscribe_event(ev_id)
event_to_remove.append(ev_id)
except KeyError as key_err:
msg = ("Failure unsubscribing event {} "
"on device {}. Reason: {}".format(ev_id,
fqdn,
key_err))
self.logger.error(msg)
self.logger.info(event_to_remove)
# remove the events id from the list
for k in event_to_remove:
self._event_id[fqdn].remove(k)
if self._event_id[fqdn]:
msg = "Still subscribed events: {}".format(self._event_id)
self.logger.warning(msg)
else:
# remove the dictionary element
self._event_id.pop(fqdn)
self.logger.info(self._event_id)
except KeyError as key_err:
msg = " Can't retrieve the information of key {}".format(key_err)
self.logger.error(msg)
self.logger.info("1")
self.logger.info("self._capability_fqdn:{}".format(self._capability_fqdn))
self.logger.info("self._capability_fqdn:{}".format(type(self._capability_fqdn)))
#self._capability_fqdn.clear()
self.logger.info("2")
self._capability_state.clear()
self.logger.info("3")
self._capability_health_state.clear()
self.logger.info("4")
self._capability_admin_mode.clear()
self.logger.info("5")
self._capability_obs_state.clear()
self.logger.info("6")
self._capability_membership.clear()
self.logger.info("7")
# PROTECTED REGION END # // CspCapabilityMonitor.delete_device
# ------------------
# Attributes methods
# ------------------
def read_numOfUnassignedIDs(self):
# PROTECTED REGION ID(CspCapabilityMonitor.numOfUnassignedIDs_read) ENABLED START #
"""Return the numOfUnassignedIDs attribute."""
return len(self._unassigned_ids)
# PROTECTED REGION END # // CspCapabilityMonitor.numOfUnassignedIDs_read
def read_capabilityState(self):
# PROTECTED REGION ID(CspCapabilityMonitor.capabilityState_read) ENABLED START #
"""Return the capabilityState attribute."""
return list(self._capability_state.values())
# PROTECTED REGION END # // CspCapabilityMonitor.capabilityState_read
def read_capabilityHealthState(self):
# PROTECTED REGION ID(CspCapabilityMonitor.capabilityHealthState_read) ENABLED START #
"""Return the capabilityHealthState attribute."""
return list(self._capability_health_state.values())
# PROTECTED REGION END # // CspCapabilityMonitor.capabilityHealthState_read
def read_capabilityAdminMode(self):
# PROTECTED REGION ID(CspCapabilityMonitor.capabilityAdminMode_read) ENABLED START #
"""Return the capabilityAdminMode attribute."""
return list(self._capability_admin_mode.values())
# PROTECTED REGION END # // CspCapabilityMonitor.capabilityAdminMode_read
def write_capabilityAdminMode(self, value):
# PROTECTED REGION ID(CspCapabilityMonitor.capabilityAdminMode_write) ENABLED START #
"""Set the capabilityAdminMode attribute."""
pass
# PROTECTED REGION END # // CspCapabilityMonitor.capabilityAdminMode_write
def read_capabilityObsState(self):
# PROTECTED REGION ID(CspCapabilityMonitor.capabilityObsState_read) ENABLED START #
"""Return the capabilityObsState attribute."""
return list(self._capability_obs_state.values())
# PROTECTED REGION END # // CspCapabilityMonitor.capabilityObsState_read
def read_unassignedIDs(self):
# PROTECTED REGION ID(CspCapabilityMonitor.unassignedIDs_read) ENABLED START #
"""Return the unassignedIDs attribute."""
return self._unassigned_ids
# PROTECTED REGION END # // CspCapabilityMonitor.unassignedIDs_read
def read_capabilityAddresses(self):
# PROTECTED REGION ID(CspCapabilityMonitor.capabilityAddresses_read) ENABLED START #
return self.CapabilityDevices
# PROTECTED REGION END # // CspCapabilityMonitor.capabilityAddresses_read
def read_capabilityMembership(self):
# PROTECTED REGION ID(CspCapabilityMonitor.membership_read) ENABLED START #
"""Return the membership attribute."""
return list(self._capability_membership.values())
# PROTECTED REGION END # // CspCapabilityMonitor.membership_read
# --------
# Commands
# --------
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
# PROTECTED REGION ID(CspCapabilityMonitor.main) ENABLED START #
return run((CspCapabilityMonitor,), args=args, **kwargs)
# PROTECTED REGION END # // CspCapabilityMonitor.main
if __name__ == '__main__':
main()
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/csp_lmc_common/CspMaster.py 0000664 0000000 0000000 00000272136 13707315520 0027774 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
#
# This file is part of the CspMaster project
#
# INAF - SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
""" CSP.LMC Common CspMaster
CSP.LMC Common Class for the CSPMaster TANGO Device.
"""
# PROTECTED REGION ID (CspMaster.standardlibray_import) ENABLED START #
# Python standard library
import sys
import os
import time
import threading
from collections import defaultdict
# PROTECTED REGION END# //CspMaster.standardlibray_import
# tango imports
import tango
from tango import DebugIt
from tango.server import run
from tango.server import Device
from tango.server import attribute, command
from tango.server import device_property
from tango import AttrQuality, EventType, DevState
from tango import AttrWriteType, DeviceProxy
# Additional import
# PROTECTED REGION ID(CspMaster.additional_import) ENABLED START #
#
from ska.base import SKAMaster
from ska.base import utils
from ska.base.commands import ResultCode
from ska.base.control_model import HealthState, AdminMode, ObsState, LoggingLevel
from .utils.decorators import AdminModeCheck, CmdInputArgsCheck
from .utils.cspcommons import CmdExecState
from . import release
# PROTECTED REGION END# //CspMaster.additional_import
__all__ = ["CspMaster", "main"]
class CspMaster(SKAMaster):
"""
CSP.LMC Common Class for the CSPMaster TANGO Device.
**Properties:**
- Device Property
CspCbf
- FQDN of the CBF Sub-element Master
- Type:'DevString'
CspPss
- TANGO FQDN of the PSS Sub-element Master
- Type:'DevString'
CspPst
- TANGO FQDN of the PST Sub-element Master
- Type:'DevString'
CspSubarrays
- TANGO FQDN of the CSP.LMC Subarrays
- Type:'DevVarStringArray'
SearchBeamsMonitor
- TANGO Device to monitor the CSP SearchBeams Capability\ndevices.
- Type:'DevString'
TimingBeamsMonitor
- TANGO Device to monitor the CSP TimingBeams Capability\ndevices.
- Type:'DevString'
VlbiBeamsMonitor
- TANGO Device to monitor the CSP VlbiBeams Capability\ndevices.
- Type:'DevString'
"""
# PROTECTED REGION ID(CspMaster.class_variable) ENABLED START #
# PROTECTED REGION END # // CspMaster.class_variable
# PROTECTED REGION ID(CspMaster.class_protected_methods) ENABLED START #
# !! NOTE !!:
# In methods and attributes of the class:
# 'se' prefix stands for 'sub-element
# 'cb' suffix stands for 'callback'
#----------------
# Event Callback functions
# ---------------
def _se_scm_change_event_cb(self, evt):
"""
Class callback function.
Retrieve the values of the sub-element SCM attributes subscribed
for change event at device initialization.
:param evt: The event data
:return: None
"""
dev_name = evt.device.dev_name()
if not evt.err:
try:
if dev_name in self._se_fqdn:
if evt.attr_value.name.lower() == "state":
self.logger.debug("{}: received event on {} value {}".format(dev_name,
evt.attr_value.name,
evt.attr_value.value))
self._se_state[dev_name] = evt.attr_value.value
elif evt.attr_value.name.lower() == "healthstate":
self.logger.debug("{}: received event on {} value {}".format(dev_name,
evt.attr_value.name,
evt.attr_value.value))
self._se_health_state[dev_name] = evt.attr_value.value
elif evt.attr_value.name.lower() == "adminmode":
self.logger.debug("device: {} adminMode value {}".format(dev_name,evt.attr_value.value ))
self._se_admin_mode[dev_name] = evt.attr_value.value
else:
log_msg = ("Attribute {} not still "
"handled".format(evt.attr_name))
self.logger.warning(log_msg)
else:
log_msg = ("Unexpected change event for"
" attribute: {}".format(str(evt.attr_name)))
self.logger.warning(log_msg)
return
log_msg = "New value for {} is {}".format(str(evt.attr_name),
str(evt.attr_value.value))
self.logger.info(log_msg)
# update CSP global state
# healthState and State are updated accordingly to the updated values of
# sub-elements healthState, State and adminMode
if evt.attr_value.name.lower() in ["state", "healthstate", "adminmode"]:
self._update_csp_state()
except tango.DevFailed as df:
self.logger.error(str(df.args[0].desc))
except Exception as except_occurred:
self.logger.error(str(except_occurred))
else:
for item in evt.errors:
# API_EventTimeout: if sub-element device not reachable it transitions
# to UNKNOWN state.
if item.reason == "API_EventTimeout":
# only if the device is ONLINE/MAINTENANCE, its State is set to
# UNKNOWN when there is a timeout on connection, otherwise its
# State should be reported always as DISABLE
if self._se_admin_mode[dev_name] in [AdminMode.ONLINE,
AdminMode.MAINTENANCE]:
self._se_state[dev_name] = tango.DevState.UNKNOWN
self._se_health_state[dev_name] = HealthState.UNKNOWN
# if the device is executing the shutdown the state is set to
# OFF
if self._se_cmd_execution_state[dev_name]['off'] == CmdExecState.RUNNING:
self._se_state[dev_name] = tango.DevState.OFF
# update the State and healthState of the CSP Element
self._update_csp_state()
log_msg = item.reason + ": on attribute " + str(evt.attr_name)
self.logger.warning(log_msg)
def _attributes_change_evt_cb(self, evt):
"""
Class callback function.
Retrieve the value of the sub-element xxxCommandProgress and xxxcmdTimeoutExpired
attributes subscribed for change event when a long-running command is issued
on the sub-element device.
:param evt: The event data
:return: None
"""
dev_name = evt.device.dev_name()
if not evt.err:
try:
if "commandprogress" == evt.attr_value.name.lower()[-15:]:
if dev_name in self._se_fqdn:
# get the command name (on/off/standby) from the attribute name
# (onCommandProgress/offCommandProgress/standbyCommandProgress))
# removing the last 15 chars
cmd_name = evt.attr_value.name[:-15]
self._se_cmd_progress[dev_name][cmd_name] = evt.attr_value.value
elif evt.attr_value.name.lower() == "oncmdtimeoutexpired":
self._se_timeout_expired[dev_name]['on'] = True
elif evt.attr_value.name.lower() == "offcmdtimeoutexpired":
self._se_timeout_expired[dev_name]['off'] = True
elif evt.attr_value.name.lower() == "standbycmdtimeoutexpired":
self._se_timeout_expired[dev_name]['standby'] = True
else:
log_msg = ("Unexpected change event for"
" attribute: {}".format(str(evt.attr_name)))
self.logger.warning(log_msg)
return
log_msg = "New value for {} is {}".format(str(evt.attr_name),
str(evt.attr_value.value))
self.logger.info(log_msg)
except tango.DevFailed as df:
self.logger.error(str(df.args[0].desc))
except Exception as except_occurred:
self.logger.error(str(except_occurred))
else:
for item in evt.errors:
log_msg = item.reason + ": on attribute " + str(evt.attr_name)
self.logger.warning(log_msg)
def _cmd_ended_cb(self, evt):
"""
Callback function immediately executed when the asynchronous invoked
command returns.
:param evt: a CmdDoneEvent object. This class is used to pass data
to the callback method in asynchronous callback model for command
execution.
:type: CmdDoneEvent object
It has the following members:
- device : (DeviceProxy) The DeviceProxy object on which the
call was executed.
- cmd_name : (str) The command name
- argout_raw : (DeviceData) The command argout
- argout : The command argout
- err : (bool) A boolean flag set to true if the command
failed. False otherwise
- errors : (sequence) The error stack
- ext
:return: none
"""
# NOTE:if we try to access to evt.cmd_name or other paramters, sometime
# the callback crashes with this error:
# terminate called after throwing an instance of 'boost::python::error_already_set'
try:
# Can happen evt empty??
if evt:
if not evt.err:
msg = "Device {} is processing command {}".format(evt.device,
evt.cmd_name)
self.logger.info(msg)
else:
msg = "Error!!Command {} ended on device {}.\n".format(evt.cmd_name,
evt.device.dev_name())
msg += " Desc: {}".format(evt.errors[0].desc)
self.logger.error(msg)
self._se_cmd_execution_state[evt.device.dev_name()][evt.cmd_name.lower()] = CmdExecState.FAILED
self._failure_message[evt.cmd_name] = msg
self.logger.info("_cmd_ended_cb _cmd_execution_state:{}".format(self._cmd_execution_state))
# obsState and obsMode values take on the CbfSubarray's values via
# the subscribe/publish mechanism
else:
self.logger.error("cmd_ended callback: evt is empty!!")
except tango.DevFailed as df:
msg = ("CommandCallback cmd_ended failure - desc: {}"
" reason: {}".format(df.args[0].desc, df.args[0].reason))
self.logger.error(msg)
except Exception as ex:
msg = "CommandCallBack cmd_ended general exception: {}".format(str(ex))
self.logger.error(msg)
# ---------------
# Class methods
# ---------------
def _update_csp_state(self):
"""
Class method.
Retrieve the *State* attribute value of the CBF sub-element and build up
the CSP global state: only if CBF sub-element is present CSP can work.
The *State* of of PSS and PST sub-elements (if ONLINE/MAINTENANCE) only
contributes to determine the CSP *healthState*
:param: None
:return: None
"""
self._update_csp_health_state()
if all(value == CmdExecState.IDLE for value in self._cmd_execution_state.values()) or (not any(self._cmd_execution_state)):
self.logger.debug("_cmd_execution_state:{}".format(self._cmd_execution_state.items()))
self.set_state(self._se_state[self.CspCbf])
if self._admin_mode in [AdminMode.OFFLINE, AdminMode.NOT_FITTED, AdminMode.RESERVED]:
self.set_state(tango.DevState.DISABLE)
self.logger.debug("CspState: {}".format(self.get_state()))
def _update_csp_health_state(self):
"""
Class method.
Retrieve the *healthState* and *adminMode* attributes of the CSP
sub-elements and aggregate them to build up the CSP *healthState*.
:param: None
:return: None
"""
# The whole CSP HealthState is OK only if:
# - all sub-elements with adminMode ON-LINE or MAINTENACE are ON AND
# - each sub-element HealthState is OK
# default value to DEGRADED
self._health_state = HealthState.DEGRADED
# build the list of all the sub-elements ONLINE/MAINTENANCE
admin_fqdn = [fqdn for fqdn, admin_value in self._se_admin_mode.items()
if admin_value in [AdminMode.ONLINE, AdminMode.MAINTENANCE]]
# build the list of sub-elements with State ON/STANDBY and ONLINE/MAINTENANCE
state_fqdn = [fqdn for fqdn in admin_fqdn if self._se_state[fqdn] in [tango.DevState.ON,
tango.DevState.STANDBY]]
# build the list with the healthState of ONLINE/MAINTENANCE devices
health_list = [self._se_health_state[fqdn] for fqdn in state_fqdn]
if self.CspCbf in admin_fqdn:
if all(value == HealthState.OK for value in health_list):
self._health_state = HealthState.OK
elif self._se_health_state[self.CspCbf] in [HealthState.FAILED,
HealthState.UNKNOWN,
HealthState.DEGRADED]:
self._health_state = self._se_health_state[self.CspCbf]
else:
# if CBF is not ONLINE/MAINTENANCE ....
self._health_state = self._se_health_state[self.CspCbf]
return
def _connect_to_subelements (self):
"""
Class method.
Establish a *stateless* connection with each CSP sub-element and
subscribe for the sub-element SCM attributes.
:return: None
"""
for fqdn in self._se_fqdn:
try:
# DeviceProxy to sub-elements
log_msg = "Trying connection to" + str(fqdn) + " device"
self.logger.info(log_msg)
device_proxy = DeviceProxy(fqdn)
#device_proxy.ping()
# Note: ping() method is not called. The DeviceProxy is initialized even if the
# sub-element is not running (but defined into the TANGO DB!).
# The connection with a sub-element is establish as soon as the corresponding
# Master device starts.
# store the sub-element proxies
self._se_proxies[fqdn] = device_proxy
# subscription of SCM attributes (State, healthState and adminMode).
# Note: subscription is performed also for devices not ONLINE/MAINTENANCE.
# In this way the CspMaster is able to detect a change in the admin value.
ev_id = device_proxy.subscribe_event("adminMode",
EventType.CHANGE_EVENT,
self._se_scm_change_event_cb,
stateless=True)
self._se_event_id[fqdn]['adminMode'] = ev_id
ev_id = device_proxy.subscribe_event("State",
EventType.CHANGE_EVENT,
self._se_scm_change_event_cb,
stateless=True)
self._se_event_id[fqdn]['state'] = ev_id
ev_id = device_proxy.subscribe_event("healthState",
EventType.CHANGE_EVENT,
self._se_scm_change_event_cb,
stateless=True)
self._se_event_id[fqdn]['healthState'] = ev_id
except KeyError as key_err:
log_msg = ("No key {} found".format(str(key_err)))
self.logger.warning(log_msg)
except tango.DevFailed as df:
#for item in df.args:
log_msg = ("Failure in connection to {}"
" device: {}".format(str(fqdn), str(df.args[0].desc)))
self.logger.error(log_msg)
def _is_device_running(self, device_fqdn, proxy_list=None):
"""
*Class method.*
Check if a TANGO device is exported in the TANGO DB (i.e its TANGO
device server is running).
:param: device_fqdn : the FQDN of the sub-element
:type: `DevString`
:param proxy_list: the list with the proxies for the device
:type: list of TANGO proxies
:return: True if the connection with the subarray is established,
False otherwise
"""
if not proxy_list:
return False
try:
proxy = proxy_list[device_fqdn]
# ping the device to control if is alive
proxy.ping()
return True
except KeyError as key_err:
# Raised when a mapping (dictionary) key is not found in the set
# of existing keys.
# no proxy registered for the subelement device
msg = "Can't retrieve proxy for device {}".format(key_err)
self.logger.error(msg)
return False
except tango.DevFailed:
return False
def _issue_power_command(self, device_list, **args_dict):
"""
Target function called when the power command threads start.
The *On*, *Standby* and *Off* methods issue the command on the sub-element
devices in a separate thread.
The target function accepts as input arguments the command to execute and
the list of devices to command.
:param device_list: tuple with the FQDN of the sub-element devices
args_dict: dictionary with information about the command to execute.
The dictionary keys are:
- cmd_name : the TANGO command name to execute
- attr_name: the corresponding command progress attribute to subscribe
- dev_state: the expected end state for the device transition
"""
#TODO: order the list alphabetically so that the CBF is always the first element to start
# the TANGO command to execute
tango_cmd_name = 0
# the sub-element device state after successful transition
dev_successful_state = 0
try:
tango_cmd_name = args_dict['cmd_name']
dev_successful_state = args_dict['dev_state']
except KeyError as key_err:
self.logger.warning("No key: {}".format(str(key_err)))
# reset the CSP and CSP sub-elements command execution
# state flags
self._se_cmd_execution_state.clear()
self._cmd_execution_state.clear()
return
# tango_cmd_name: is the TANGO command name with the capital letter
# In the dictionary keys, is generally used the command name in lower letters
cmd_name = tango_cmd_name.lower()
self.logger.debug("cmd_name: {} dev_state: {}".format(cmd_name,
dev_successful_state))
num_of_failed_device = 0
self._num_dev_completed_task[cmd_name] = 0
self._list_dev_completed_task[cmd_name] = []
self._cmd_progress[cmd_name] = 0
self._cmd_duration_measured[cmd_name] = 0
self._failure_message[cmd_name] = ''
# sub-element command execution measured time
se_cmd_duration_measured = defaultdict(lambda:defaultdict(lambda:0))
# loop on the devices and power-on them sequentially
for device in device_list:
se_cmd_duration_measured[device][cmd_name] = 0
self._se_cmd_progress[device][cmd_name] = 0
device_proxy = self._se_proxies[device]
self.logger.debug("Issue asynch command {} on device {}:".format(cmd_name, device))
# Note: when the command ends on the sub-element, the _cmd_ended_cb callback
# is called. This callback sets the sub-element execution state to FAULT if
# an exception is caught during the execution on the sub-element.
#
# !!Note!!:
# If the command is issued while the same command is already running on a
# sub-element, the sub-element should return without throwing any exception
# (see "SKA System Control Guidelines").
# In this case the current method enters the while loop and the execution of the
# sub-element command is tracked in the right way.
try:
# 04-11-2020: removed the registration of the cmd_ended_cb callback. It has
# been observed a wrong behavior when the callback is thrown after the end of the
# thread. This happens when the same command is executed twice on the CbfMaster.
# In this case the CbfMaster throws an exception to signal that the device is
# already in that state, the check on the device state passes with success,
# the self._cmd_execution_state is set to
# IDLE and the thread exit. After it is received the callback message with the
# error message generated by the CbfMaster but the
# self._cmd_execution_state results RUNNING and the device stucks
device_proxy.command_inout_asynch(tango_cmd_name, self._cmd_ended_cb)
except tango.DevFailed as df:
# It should not happen! Verify
msg = "Failure reason: {} Desc: {}".format(str(df.args[0].reason), str(df.args[0].desc))
self.logger.warning(msg)
self._se_cmd_execution_state[device][cmd_name] = CmdExecState.FAILED
self._failure_message[cmd_name] += msg
num_of_failed_device += 1
# skip to next device
continue
# set the sub-element command execution flag
self._se_cmd_execution_state[device][cmd_name] = CmdExecState.RUNNING
# register the starting time for the command
self._se_cmd_starting_time[device] = time.time()
# loop on the device until the State changes to ON or a timeout or
# a failure detection occurred
self.logger.debug("Device {} State {} expected value {}".format(device, self._se_state[device], dev_successful_state))
command_progress = self._cmd_progress[cmd_name]
while True:
if self._se_state[device] == dev_successful_state:
self.logger.info("Command {} ended with success on device {}.".format(cmd_name,
device))
# update the list and number of device that completed the task
self._num_dev_completed_task[cmd_name] += 1
self._list_dev_completed_task[cmd_name].append(device)
# reset the value of the attribute reporting the execution state of
# the command
self._se_cmd_execution_state[device][cmd_name] = CmdExecState.IDLE
self._se_cmd_progress[device][cmd_name] = 100
# command success: exit from the wait loop and issue the command
# on the next device in the list
break
# check for other sub-element FAULT values
if self._se_state[device] == tango.DevState.FAULT:
self._se_cmd_execution_state[device][cmd_name] = CmdExecState.FAILED
self._failure_message[cmd_name] += ("Device {} is {}".format(device, self.get_status()))
self.logger.warning(self._failure_message[cmd_name])
num_of_failed_device += 1
break
# check if sub-element command ended throwing an exception: in this case the
# 'cmd_ended_cb' callback is invoked. The callback log the exception and
# sets the sub-element execution state to FAILED.
# NOTE: as per the "SKA Control Guidelines", a sub-element shall not throw an
# exception if the sub-element is already in the requested final state or if the
# command is already running.
# A different implementation could cause a wrong behavior of the current function.
if self._se_cmd_execution_state[device][cmd_name] == CmdExecState.FAILED:
# execution ended for this sub-element, skip to the next one
num_of_failed_device += 1
# skip to next device
break
# check for timeout event. A timeout event can be detected in two ways:
# 1- the sub-element implements the 'onTimeoutExpired' attribute configured
# for change event
# 2- the CspMaster periodically checks the time elapsed from the start
# of the command: if the value is greater than the sub-element expected time
# for command execution, the sub-element command execution state is set
# to TIMEOUT
# Note: the second check, can be useful if the timeout event is not received
# (for example for a temporary connection timeout)
elapsed_time = time.time() - self._se_cmd_starting_time[device]
if (elapsed_time > self._se_cmd_duration_expected[device][cmd_name] or
self._se_cmd_execution_state[device][cmd_name] == CmdExecState.TIMEOUT):
msg = ("Timeout executing {} command on device {}".format(cmd_name, device))
self.logger.warning(msg)
self._se_cmd_execution_state[device][cmd_name] = CmdExecState.TIMEOUT
num_of_failed_device += 1
# if the CBF command timeout expires, the CSP power-on is stopped
# TODO: verify if this behavior conflicts with ICD
self.logger.debug("elapsed_time:{} device {}".format(elapsed_time, device))
if device == self.CspCbf:
self.logger.error("CBF Timeout during command {} "
"execution!!! Exit".format(cmd_name))
self._timeout_expired[cmd_name] = True
self._se_cmd_execution_state[device][cmd_name] = CmdExecState.IDLE
with self._cmd_exec_state_lock:
self._cmd_execution_state[cmd_name] = CmdExecState.IDLE
return
# timeout on the sub-element, skip to the next device
break
time.sleep(0.1)
# update the progress counter inside the loop taking into account the number of devices
# executing the command
self._cmd_progress[cmd_name] = command_progress + self._se_cmd_progress[device][cmd_name]/len(device_list)
# end of the while loop
# calculate the real execution time for the command
se_cmd_duration_measured[device][cmd_name] = (time.time()
- self._se_cmd_starting_time[device])
self.logger.info("measured duration:{}".format(se_cmd_duration_measured[device][cmd_name]))
self._cmd_duration_measured[cmd_name] += se_cmd_duration_measured[device][cmd_name]
# update the progress counter at the end of the loop
self._cmd_progress[cmd_name] = command_progress + (self._se_cmd_progress[device][cmd_name]/len(device_list))
if len(device_list) == self._num_dev_completed_task[cmd_name] + num_of_failed_device:
self.logger.info("All devices have been handled!")
# end of the command: the command has been issued on all the sub-element devices
# reset the execution flag for the CSP
break
# out of the for loop
self._last_executed_command = cmd_name
# if one or more sub-elements goes in timeout or failure, set the CSP
# corresponding attribute
for device in device_list:
# reset the CSP sub-element command execution flag
if self._se_cmd_execution_state[device][cmd_name] == CmdExecState.TIMEOUT:
# set the CSP timeout flag
self._timeout_expired[cmd_name] = True
if self._se_cmd_execution_state[device][cmd_name] == CmdExecState.FAILED:
# set the CSP timeout flag
self._failure_raised[cmd_name] = True
# reset the CSP sub-element command execution flag
self._se_cmd_execution_state[device][cmd_name] = CmdExecState.IDLE
# reset the CSP command execution flag
with self._cmd_exec_state_lock:
self._cmd_execution_state[cmd_name] = CmdExecState.IDLE
self._update_csp_state()
self.logger.info("CSP State:{}".format(self.get_state()))
self._enable_subarrays(tango_cmd_name)
def _enable_subarrays(self, tango_cmd_name):
enable = False
subarray_cmd = tango_cmd_name
if tango_cmd_name == 'On':
enable = True
if tango_cmd_name == 'Standby':
subarray_cmd = 'Off'
master_state = self.get_state()
if (enable, master_state) not in [(True, tango.DevState.ON), (False, tango.DevState.STANDBY)]:
self.logger.warning("CSPMaster is not in the proper state ({})".format(self.get_state()))
return
try:
subarray_group = tango.Group("CSPSubarray")
for subarray in self.CspSubarrays:
subarray_group.add(subarray)
self.logger.info("Issue command {} on subarray group".format(subarray_cmd))
answers = subarray_group.command_inout(subarray_cmd)
for reply in answers:
if reply.has_failed():
self.logger.info("stack: {}".format(len(reply.get_err_stack())))
for err in reply.get_err_stack():
self.logger.info("err {} reason {}".format(err.desc, err.reason) )
self.logger.warning("Subarray {} failed executing command {}".format(reply.dev_name(),
subarray_cmd))
else:
(result_code, msg) = reply.get_data()
if result_code == ResultCode.FAILED:
self.logger.error(msg[0])
elif result_code == ResultCode.OK:
self.logger.info(msg[0])
except Exception:
self.logger.error("TANGO Group command failed")
def _se_write_adminMode(self, value, device_fqdn):
"""
*Class method.*
Set the administrative mode of the specified device.
:param: subelement_name : the FQDN of the sub-element
:type: `DevString`
:return: True if the connection with the subarray is established,
False otherwise
"""
# check if the device is exported in the TANGO DB (that is the server is running)
# 03-19-20
# NOTE: this check can be removed because the check on valid values
# for attributes of DevEnum type is done by TANGO
if value not in [AdminMode.ONLINE, AdminMode.MAINTENANCE, AdminMode.OFFLINE,
AdminMode.NOT_FITTED, AdminMode.RESERVED]:
msg = "Invalid {} value for adminMode attribute".format(value)
tango.Except.throw_exception("Command failed",
msg,
"write_adminMode",
tango.ErrSeverity.ERR)
# check if the sub-element administrative mode has already the requested value
if value == self._se_admin_mode[device_fqdn]:
return
if self._is_device_running(device_fqdn, self._se_proxies):
try:
proxy = self._se_proxies[device_fqdn]
proxy.write_attribute_asynch('adminMode', value)
# TODO: add checks for timeout/errors
except KeyError as key_err:
msg = "Can't retrieve the information of key {}".format(key_err)
self.logger.error(msg)
tango.Except.throw_exception("DevFailed excpetion", msg,
"write adminMode", tango.ErrSeverity.ERR)
def _connect_capabilities_monitor(self):
"""
Protected Class method.
Establish connecton with the TANGO devices performing the monitor of the CSP
Element Capabilities.
"""
# build the list with the Capability monitor devices
for fqdn in self._capability_monitor_fqdn:
try:
self._capability_monitor_proxy[fqdn] = DeviceProxy(fqdn)
except tango.DevFailed as tango_err:
self.logger.warning(tango_err.args[0].desc)
# PROTECTED REGION END # // CspMaster.class_protected_methods
# -----------------
# Device Properties
# -----------------
CspCbf = device_property(
dtype='DevString',
)
CspPss = device_property(
dtype='DevString',
)
CspPst = device_property(
dtype='DevString',
)
CspSubarrays = device_property(
dtype='DevVarStringArray',
)
SearchBeamsMonitor = device_property(
dtype='DevString',
)
TimingBeamsMonitor = device_property(
dtype='DevString',
)
VlbiBeamsMonitor = device_property(
dtype='DevString',
)
# ----------
# Attributes
# ----------
adminMode = attribute(
dtype='DevEnum',
access=AttrWriteType.READ_WRITE,
polling_period=1000,
memorized=True,
doc= ("The admin mode reported for this device. It may interpret the"
"current device condition and condition of all managed devices"
"to set this. Most possibly an aggregate attribute."),
enum_labels=["ON-LINE", "OFF-LINE", "MAINTENANCE", "NOT-FITTED", "RESERVED", ],
)
onCommandProgress = attribute(
dtype='DevUShort',
label="Progress percentage for the On command",
polling_period=3000,
abs_change=10,
max_value=100,
min_value=0,
doc=("Percentage progress implemented for commands that result in state/mode"
"transitions for a large \nnumber of components and/or are executed in "
"stages (e.g power up, power down)"),
)
offCommandProgress = attribute(
dtype='DevUShort',
label="Progress percentage for the Off command",
polling_period=3000,
abs_change=10,
max_value=100,
min_value=0,
doc=("Percentage progress implemented for commands that result in state/mode"
" transitions for a large \nnumber of components and/or are executed in "
"stages (e.g power up, power down)"),
)
standbyCommandProgress = attribute(
dtype='DevUShort',
label="Progress percentage for the Standby command",
polling_period=3000,
abs_change=10,
max_value=100,
min_value=0,
doc=("Percentage progress implemented for commands that result in state/mode "
"transitions for a large \nnumber of components and/or are executed in "
"stages (e.g power up, power down)"),
)
onCmdDurationExpected = attribute(
dtype='DevUShort',
access=AttrWriteType.READ_WRITE,
label="Expected duration (sec) of the On command execution",
abs_change=0,
max_value=100,
min_value=0,
memorized=True,
doc=("Set/Report the duration expected (in sec.) for the On command execution"),
)
offCmdDurationExpected = attribute(
dtype='DevUShort',
access=AttrWriteType.READ_WRITE,
label="Expected duration (sec) of the Off command",
abs_change=0,
max_value=100,
min_value=0,
memorized=True,
doc=("Set/Report the duration expected (in sec.) for the Off command execution"),
)
standbyCmdDurationExpected = attribute(
dtype='DevUShort',
access=AttrWriteType.READ_WRITE,
label="Expected duration (sec) of the Standby command",
abs_change=0,
max_value=100,
min_value=0,
memorized=True,
doc=("Set/Report the duration expected (in sec.) for the Standby command"),
)
onCmdDurationMeasured = attribute(
dtype='DevUShort',
label="Measured duration (sec) of the On command execution",
abs_change=0,
max_value=100,
min_value=0,
doc=("Report the measured duration (in sec.) of the On command execution"),
)
offCmdDurationMeasured = attribute(
dtype='DevUShort',
label="Measured duration (sec) of the Off command",
abs_change=0,
max_value=100,
min_value=0,
doc=("Report the measured duration (in sec.) of the Off command execution"),
)
standbyCmdDurationMeasured = attribute(
dtype='DevUShort',
label="Measured duration (sec) of the Standby command",
abs_change=0,
max_value=100,
min_value=0,
doc=("Report the measured duration (in sec.) of the Standby command"),
)
onCmdTimeoutExpired = attribute(
dtype='DevBoolean',
label="CBF command timeout flag",
polling_period=2000,
doc=("Signal the occurence of a timeout during the execution of commands on"
" CBF Sub-element"),
)
offCmdTimeoutExpired = attribute(
dtype='DevBoolean',
label="PSS command timeout flag",
polling_period=2000,
doc=("Signal the occurence of a timeout during the execution of commands on "
"PSS Sub-element"),
)
standbyCmdTimeoutExpired = attribute(
dtype='DevBoolean',
label="PST command timeout flag",
polling_period=2000,
doc=("Signal the occurence of a timeout during the execution of commands on"
" PST Sub-element"),
)
cspCbfState = attribute(
dtype='DevState',
label="CBF status",
polling_period=3000,
doc=("The CBF sub-element Device State. Allowed values are ON, STANDBY, OFF, "
"DISABLE, ALARM, FAULT, UNKNOWN"),
)
cspPssState = attribute(
dtype='DevState',
label="PSS status",
polling_period=3000,
doc=("The PSS sub-element Device State. Allowed values are ON, STANDBY, OFF,"
" DISABLE, ALARM, FAULT, UNKNOWN"),
)
cspPstState = attribute(
dtype='DevState',
label="PST status",
polling_period=3000,
doc=("The PST sub-element Device State. Allowed values are ON, STANDBY,OFF,"
" DISABLE, ALARM, FAULT, UNKNOWN"),
)
cspCbfHealthState = attribute(
dtype='DevEnum',
label="CBF Health status",
polling_period=3000,
abs_change=1,
doc="The CBF sub-element healthState.",
enum_labels=["OK", "DEGRADED", "FAILED", "UNKNOWN", ],
)
cspPssHealthState = attribute(
dtype='DevEnum',
label="PSS Health status",
polling_period=3000,
abs_change=1,
doc="The PSS sub-element healthState",
enum_labels=["OK", "DEGRADED", "FAILED", "UNKNOWN", ],
)
cspPstHealthState = attribute(
dtype='DevEnum',
label="PST health status",
polling_period=3000,
abs_change=1,
doc="The PST sub-element healthState.",
enum_labels=["OK", "DEGRADED", "FAILED", "UNKNOWN", ],
)
cbfMasterAddress = attribute(
dtype='DevString',
doc="TANGO FQDN of the CBF sub-element Master",
)
pssMasterAddress = attribute(
dtype='DevString',
doc="TANGO FQDN of the PSS sub-element Master",
)
pstMasterAddress = attribute(
dtype='DevString',
doc="TANGO FQDN of the PST sub-element Master",
)
cspCbfAdminMode = attribute(
dtype='DevEnum',
access=AttrWriteType.READ_WRITE,
label="CBF administrative Mode",
polling_period=3000,
abs_change=1,
doc=("The CBF sub-lement adminMode. Allowed values are ON-LINE, "
"MAINTENANCE, OFF-LINE, NOT-FITTED, RESERVED"),
enum_labels=["ON-LINE", "OFF-LINE", "MAINTENANCE", "NOT-FITTED", "RESERVED", ],
)
cspPssAdminMode = attribute(
dtype='DevEnum',
access=AttrWriteType.READ_WRITE,
label="PSS administrative mode",
polling_period=3000,
abs_change=1,
doc=("The PSS sub-lement adminMode. Allowed values are ON-LINE, "
"MAINTENANCE, OFF-LINE, NOT-FITTED, RESERVED"),
enum_labels=["ON-LINE", "OFF-LINE", "MAINTENANCE", "NOT-FITTED", "RESERVED", ],
)
cspPstAdminMode = attribute(
dtype='DevEnum',
access=AttrWriteType.READ_WRITE,
label="PST administrative mode",
polling_period=3000,
abs_change=1,
doc=("The PST sub-lement adminMode. Allowed values are ON-LINE, "
"MAINTENANCE, OFF-LINE, NOT-FITTED, RESERVED"),
enum_labels=["ON-LINE", "OFF-LINE", "MAINTENANCE", "NOT-FITTED", "RESERVED", ],
)
numOfDevCompletedTask = attribute(
dtype='DevUShort',
label="Number of devices that completed the task",
doc="Number of devices that completed the task",
)
onCmdFailure = attribute(
dtype='DevBoolean',
label="CBF command failure flag",
polling_period=1000,
doc="Alarm flag set when the On command fails with error(s).",
)
onFailureMessage = attribute(
dtype='DevString',
label="On execution failure message",
doc="Alarm message when the On command fails with error(s).",
)
offCmdFailure = attribute(
dtype='DevBoolean',
label="Off execution failure flag",
polling_period=1000,
doc="Alarm flag set when the Off command fails with error(s).",
)
offFailureMessage = attribute(
dtype='DevString',
label="Off execution failure message",
doc="Alarm message when the Off command fails with error(s).",
)
standbyCmdFailure = attribute(
dtype='DevBoolean',
label="Standby execution failure message",
polling_period=1000,
doc="Alarm flag set when the Standby command fails with error(s).",
)
standbyFailureMessage = attribute(
dtype='DevString',
label="Standby execution failure message",
doc="Alarm message when the Standby command fails with error(s).",
)
searchBeamsAddresses = attribute(
dtype=('DevString',),
max_dim_x=1500,
label="Search Beam Capabilities Addresses",
doc="The SearchBeam Capabilityies FQDNs",
)
timingBeamsAddresses = attribute(
dtype=('DevString',),
max_dim_x=16,
label="Timing Beams Capability Addresses",
doc="The list of Timing Beam Capabilities FQDNs",
)
vlbiBeamsAddresses = attribute(
dtype=('DevString',),
max_dim_x=20,
label="Vlbi Beam Capabilities Addresses",
doc="The list of VlbiBeam Capabilities FQDNs",
)
reportSearchBeamState = attribute(
dtype=('DevState',),
max_dim_x=1500,
label="SearchBeam Capabilities State",
doc="Report the state of the SearchBeam Capabilities as an array of DevState.",
)
reportSearchBeamHealthState = attribute(
dtype=('DevUShort',),
max_dim_x=1500,
label="SearchBeam Capabilities healthState",
abs_change=1,
doc=("Report the health state of the SearchBeam Capabilities as an array"
" of unsigned short. For ex`: [0,0,...,1..]`"),
)
reportSearchBeamAdminMode = attribute(
dtype=('DevUShort',),
access=AttrWriteType.READ_WRITE,
max_dim_x=1500,
label="SearchBeam Capabilities adminMode",
abs_change=1,
doc=("Report the administrative mode of the SearchBeam Capabilities as an"
" array of unsigned short. For ex `:[0,0,0,...2..]`"),
)
reportTimingBeamState = attribute(
dtype=('DevState',),
max_dim_x=16,
label="TimingBeam Capabilities State",
doc="Report the state of the TimingBeam Capabilities as an array of DevState.",
)
reportTimingBeamHealthState = attribute(
dtype=('DevUShort',),
max_dim_x=16,
label="TimingBeam Capabilities healthState",
abs_change=1,
doc=("Report the health state of the TimingBeam Capabilities as an array of"
" unsigned short. For ex [0,0,...,1..]"),
)
reportTimingBeamAdminMode = attribute(
dtype=('DevUShort',),
access=AttrWriteType.READ_WRITE,
max_dim_x=16,
label="TimingBeam Capabilities adminMode",
abs_change=1,
doc=("Report the administrativw mode of the TimingBeam Capabilities as an"
" array of unsigned short. For ex [0,0,0,...2..]"),
)
reportVlbiBeamState = attribute(
dtype=('DevState',),
max_dim_x=20,
label="VlbiBeam Capabilities State",
doc="Report the state of the VLBIBeam Capabilities as an array of DevState.",
)
reportVlbiBeamHealthState = attribute(
dtype=('DevUShort',),
max_dim_x=20,
label="VlbiBeam Capabilities healthState",
abs_change=1,
doc=("Report the health state of the VlbiBeam Capabilities as an array of"
" unsigned short. For ex [0,0,...,1..]"),
)
reportVlbiBeamAdminMode = attribute(
dtype=('DevUShort',),
access=AttrWriteType.READ_WRITE,
max_dim_x=20,
label="VlbiBeam Capabilities adminMode",
abs_change=1,
doc=("Report the administrative mode of the VlbiBeam Capabilities as an"
" array of unsigned short. For ex -[0,0,0,...2..]"),
)
cspSubarrayAddresses = attribute(
dtype=('DevString',),
max_dim_x=16,
doc="CSPSubarrays FQDN",
)
listOfDevCompletedTask = attribute(
dtype=('DevString',),
max_dim_x=100,
label="List of devices that completed the task",
doc="List of devices that completed the task",
)
reservedSearchBeamIDs = attribute(
dtype=('DevString',),
max_dim_x=16,
label="SearchBeams reserved IDS",
doc="For each sub-array idm reports the list of the reserved SearchBeam IDs",
)
reportSearchBeamState = attribute(name="reportSearchBeamState",
label="SearchBeam Capabilities State",
forwarded=True
)
reportSearchBeamHealthState = attribute(name="reportSearchBeamHealthState",
label="SearchBeam Capabilities healthState",
forwarded=True
)
reportSearchBeamObsState = attribute(name="reportSearchBeamObsState",
label="SearchBeam Capabilities obsState",
forwarded=True
)
reportSearchBeamAdminMode = attribute(name="reportSearchBeamAdminMode",
label="SearchBeam Capabilities adminMode",
forwarded=True
)
reportTimingBeamState = attribute(name="reportTimingBeamState",
label="TimingBeam Capabilities State",
forwarded=True
)
reportTimingBeamHealthState = attribute(name="reportTimingBeamHealthState",
label="TimingBeam Capabilities healthState",
forwarded=True
)
reportTimingBeamObsState = attribute(name="reportTimingBeamObsState",
label="TimingBeam Capabilities obsState",
forwarded=True
)
reportTimingBeamAdminMode = attribute(name="reportTimingBeamAdminMode",
label="TimingBeam Capabilities adminMode",
forwarded=True
)
reportVlbiBeamState = attribute(name="reportVlbiBeamState",
label="VlbiBeam Capabilities State",
forwarded=True
)
reportVlbiBeamHealthState = attribute(name="reportVlbiBeamHealthState",
label="VlbiBeam Capabilities healthState",
forwarded=True
)
reportVlbiBeamObsState = attribute(name="reportVlbiBeamObsState",
label="VlbiBeam Capabilities obsState",
forwarded=True
)
reportVlbiBeamAdminMode = attribute(name="reportVlbiBeamAdminMode",
label="VlbiBeam Capabilities adminMode",
forwarded=True
)
unassignedVlbiBeamIDs = attribute(name="unassignedVlbiBeamIDs",
label="Unassigned VlbiBeam Capabilities IDs",
forwarded=True
)
unassignedTimingBeamIDs = attribute(name="unassignedTimingBeamIDs",
label="Unassigned TimingBeam Capabilities IDs",
forwarded=True
)
unassignedSearchBeamIDs = attribute(name="unassignedSearchBeamIDs",
label="Unassigned SeachBeam Capabilities IDs",
forwarded=True
)
numOfUnassignedVlbiBeams = attribute(name="numOfUnassignedVlbiBeams",
label="Num of onassigned VlbiBeam Capabilities IDs",
forwarded=True
)
numOfUnassignedTimingBeams = attribute(name="numOfUnassignedTimingBeams",
label="Num of unassigned TimingBeam Capabilities IDs",
forwarded=True
)
numOfUnassignedSearchBeams = attribute(name="numOfUnassignedSearchBeams",
label="Num of unassigned SeachBeam Capabilities IDs",
forwarded=True
)
#numOfReservedSearchBeams = attribute(name="numOfReservedSearchBeams",
# label="Number of reserved SeachBeam Capabilities",
# forwarded=True
#)
searchBeamMembership = attribute(name="searchBeamMembership",
label="SearchBeam Membership",
forwarded=True
)
timingBeamMembership = attribute(name="timingBeamMembership",
label="TimingBeam Membership",
forwarded=True
)
vlbiBeamMembership = attribute(name="vlbiBeamMembership",
label="VlbiBeam Membership",
forwarded=True
)
# ---------------
# General methods
# ---------------
def init_device(self):
"""Initialises the attributes and properties of the CspMaster."""
SKAMaster.init_device(self)
# PROTECTED REGION ID(CspMaster.init_device) ENABLED START #
self._build_state = '{}, {}, {}'.format(release.name, release.version, release.description)
self._version_id = release.version
# connect to TANGO DB
csp_tango_db = tango.Database()
# read the CSP memorized attributes from the TANGO DB.
# Note: a memorized attribute has defined the attribute
# property '__value'
attribute_properties = csp_tango_db.get_device_attribute_property(self.get_name(),
{'adminMode': ['__value']})
# set init values for the CSP Element and Sub-element SCM states
self.set_state(tango.DevState.INIT)
self._health_state = HealthState.OK
self._admin_mode = AdminMode.ONLINE
# use defaultdict to initialize the sub-element State,healthState
# and adminMode. The dictionary uses as keys the sub-element
# fqdn, for example
# self._se_state[self.CspCbf]
# return the State value of the Mid Cbf sub-element.
self._se_state = defaultdict(lambda: tango.DevState.DISABLE)
self._se_health_state = defaultdict(lambda: HealthState.UNKNOWN)
self._se_admin_mode = defaultdict(lambda: AdminMode.NOT_FITTED)
# build a dictionary with the (attr_name, value) of the memorized attributes
# use memorized atrtibute if present, otherwise the default one
memorized_attr_dict = {attr_name : int(value[0]) for attr_name, db_key in attribute_properties.items()
for key, value in db_key.items()
if key == '__value'}
try:
self._admin_mode = memorized_attr_dict['adminMode']
if self._admin_mode not in [AdminMode.ONLINE, AdminMode.MAINTENANCE]:
self._health_state = HealthState.UNKNOWN
self.set_state(tango.DevState.DISABLE)
except KeyError as key_err:
self.logger.info("Key {} not found".format(key_err))
# initialize list with CSP sub-element FQDNs
self._se_fqdn = []
# NOTE:
# The normal behavior when a Device Property is created is:
# - a self.Property attribute is created in the Dev_Impl object
# - it takes a value from the Database if it has been defined.
# - if not, it takes the default value assigned in Pogo.
# - if no value is specified nowhere, the attribute is created
# with [] value.
self._se_fqdn.append(self.CspCbf)
self._se_fqdn.append(self.CspPss)
self._se_fqdn.append(self.CspPst)
# read the sub-elements adminMode (memorized) attributes from
# the TANGO DB.
# Note: a memorized attribute has defined the attribute property '__value'
for fqdn in self._se_fqdn:
attribute_properties = csp_tango_db.get_device_attribute_property(fqdn,
{'adminMode': ['__value']})
self.logger.info("fqdn: {} attribute_properties: {}".format(fqdn, attribute_properties))
try:
admin_mode_memorized = attribute_properties['adminMode']['__value']
self._se_admin_mode[fqdn] = int(admin_mode_memorized[0])
except KeyError as key_err:
msg = ("No key {} found for sub-element {}"
" adminMode attribute".format(key_err, fqdn))
self.logger.info(msg)
# _se_proxies: the sub-element proxies
# implemented as dictionary:
# keys: sub-element FQDN
# values: device proxy
self._se_proxies = {}
# Nested default dictionary with list of event ids/sub-element. Need to
# store the event ids for each sub-element and attribute to un-subscribe
# them at sub-element disconnection.
# keys: sub-element FQDN
# values: dictionary (keys: attribute name, values: event id)
self._se_event_id = defaultdict(lambda: defaultdict(lambda: 0))
# _se_cmd_execution_state: implement the execution state of a long-running
# command for each sub-element.
# implemented as a nested default dictionary:
# keys: sub-element FQDN
# values: defaut dictionary (keys: command name, values: command state)
self._se_cmd_execution_state = defaultdict(lambda: defaultdict(lambda: CmdExecState.IDLE))
# _cmd_execution_state: implement the execution state of a long-running
# command for the whole CSP. Setting this attribute prevent the execution
# of the same command while it is already running.
# implemented as a default dictionary:
# keys: command name
# values:command state
self._cmd_execution_state = defaultdict(lambda: CmdExecState.IDLE)
# _se_cmd_starting_time: for each sub-element report the long-running command
# starting time
# Implemented as dictionary:
# keys: the sub-element FQDN
# values: starting time
self._se_cmd_starting_time = defaultdict(lambda: 0.0)
# _command_thread: thread for the command execution
# keys: the command name('on, 'off'...)
# values: thread instance
self._command_thread = {}
# _cmd_exec_state_lock: lock to share the _cmd_execution_state
# attribute among thread in a safe way
self._cmd_exec_state_lock = threading.Lock()
# _se_cmd_progress: for each sub-element report the execution progress
# of a long-running command
# implemented as a default nested dictionary:
# keys: sub-element FQDN
# values: default dictionary (keys: command name, values: the execution percentage)
self._se_cmd_progress = defaultdict(lambda: defaultdict(lambda: 0))
# _cmd_progress: report the execution progress of a long-running command
# implemented as a dictionary:
# keys: command name ('on', 'off'..)
# values: the percentage
self._cmd_progress = defaultdict(lambda: 0)
# _se_cmd_duration_expected: for each sub-element, store the duration (in sec.)
# configured for a long-running command
# Implemented as a nested default dictionary
# keys: FQDN
# values: default dictionary (keys: command name, values: the duration (in sec))
self._se_cmd_duration_expected = defaultdict(lambda: defaultdict(lambda: 20))
# _cmd_duration_expected: store the duration (in sec.) configured for
# a long-running command
# Implemented asdefault dictionary
# keys: command name ('on', 'off',..)
# values: the duration (in sec)
self._cmd_duration_expected = defaultdict(lambda: 30)
# _cmd_duration_measured: report the measured duration (in sec.) for
# a long-running command
# Implemented as default dictionary
# keys: command name ('on', 'off',..)
# values: the duration (in sec)
self._cmd_duration_measured = defaultdict(lambda: 0)
# _timeout_expired: report the timeout flag
# Implemented as a dictionary
# keys: command name ('on', 'off', 'standby'..)
# values: True/False
self._timeout_expired = defaultdict(lambda: False)
# _failure_raised: report the failure flag
# Implemented as a dictionary
# keys: command name ('on', 'off', 'standby'..)
# values: True/False
self._failure_raised = defaultdict(lambda: False)
# _failure_message: report the failure message
# Implemented as a dictionary
# keys: command name ('on', 'off', 'standby'..)
# values: the message
self._failure_message = defaultdict(lambda: '')
# _list_dev_completed_task: for each long-running command report the list of subordinate
# components that completed the task
# Implemented as a dictionary
# keys: the command name ('on', 'off',...)
# values: the list of components
self._list_dev_completed_task = defaultdict(lambda: [])
# the last executed command
self._last_executed_command = ""
# _num_dev_completed_task: for each long-running command report the number
# of subordinate components that completed the task
# Implemented as a dictionary
# keys: the command name ('on', 'off',...)
# values: the number of components
self._num_dev_completed_task = defaultdict(lambda:0)
# _capability_proxy: dictionary
# keys: the Capability Monitor devices FQDNs
# values: DeviceProxy proxies
self._capability_monitor_proxy = {}
# _capability_fqdn: list of CapabilityMonitor FQDN devices
self._capability_monitor_fqdn = []
# Try connection with sub-elements
self._connect_to_subelements()
# to use the push model in command_inout_asynch (the one with the callback parameter),
# change the global TANGO model to PUSH_CALLBACK.
apiutil = tango.ApiUtil.instance()
apiutil.set_asynch_cb_sub_model(tango.cb_sub_model.PUSH_CALLBACK)
# PROTECTED REGION END # // CspMaster.init_device
def always_executed_hook(self):
"""Method always executed before any TANGO command is executed."""
# PROTECTED REGION ID(CspMaster.always_executed_hook) ENABLED START #
# PROTECTED REGION END # // CspMaster.always_executed_hook
def delete_device(self):
"""Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command.
"""
# PROTECTED REGION ID(CspMaster.delete_device) ENABLED START #
event_to_remove = {}
for fqdn in self._se_fqdn:
try:
event_to_remove[fqdn] = []
for attr_name, event_id in self._se_event_id[fqdn].items():
try:
# need to check the event_id value because with the use of defaultdict
# it may happen that a dictionary entry is = 0 (default ditionary value)
if event_id:
self._se_proxies[fqdn].unsubscribe_event(event_id)
event_to_remove[fqdn].append(attr_name)
# NOTE: in tango unsubscription of not-existing event
# id raises a KeyError exception not a DevFailed !!
except KeyError as key_err:
msg = ("Failure unsubscribing event {} "
"on device {}. Reason: {}".format(event_id,
fqdn,
key_err))
self.logger.error(msg)
# remove the attribute entry from the fqdn dictionary
for attr_name in event_to_remove[fqdn]:
del self._se_event_id[fqdn][attr_name]
# check if there are still some registered events.
if not self._se_event_id[fqdn]:
# remove the dictionary element when the fqdn dictionary is
# empty
self._se_event_id.pop(fqdn)
else:
# What to do in this case??. Only log (for the moment)
msg = "Still subscribed events: {}".format(self._se_event_id)
self.logger.warning(msg)
except KeyError as key_err:
msg = " Can't retrieve the information of key {}".format(key_err)
self.logger.error(msg)
continue
# clear any list and dict
self._se_fqdn.clear()
self._se_proxies.clear()
# PROTECTED REGION END # // CspMaster.delete_device
# ------------------
# Attributes methods
# ------------------
def read_adminMode(self):
# PROTECTED REGION ID(CspMaster.adminMode_read) ENABLED START #
"""Return the adminMode attribute."""
return self._admin_mode
# PROTECTED REGION END # // CspMaster.adminMode_read
def write_adminMode(self, value):
# PROTECTED REGION ID(CspMaster.adminMode_write) ENABLED START #
"""
Write attribute method.
Set the administration mode for the whole CSP element.
:param value: one of the administration mode value (ON-LINE,\
OFF-LINE, MAINTENANCE, NOT-FITTED, RESERVED).
:type: DevEnum
:return: None
"""
# PROTECTED REGION ID(CspMaster.adminMode_write) ENABLED START #
for fqdn in self._se_fqdn:
try:
self._se_write_adminMode(value, fqdn)
except tango.DevFailed as df:
log_msg = (("Failure in setting adminMode "
"for device {}: {}".format(str(fqdn),
str(df.args[0].reason))))
self.logger.error(log_msg)
#TODO: what happens if one sub-element fails?
# add check on timeout command execution
self._admin_mode = value
if self._admin_mode in [AdminMode.OFFLINE, AdminMode.NOT_FITTED, AdminMode.RESERVED]:
self.set_state(tango.DevState.DISABLE)
else:
if self.get_state() == tango.DevState.DISABLE:
#STANDBY or ON how can be determined??
self.set_state(tango.DevState.STANDBY)
# PROTECTED REGION END # // CspMaster.adminMode_write
def read_onCommandProgress(self):
# PROTECTED REGION ID(CspMaster.onCommandProgress_read) ENABLED START #
"""Return the onCommandProgress attribute."""
return int(self._cmd_progress['on'])
# PROTECTED REGION END # // CspMaster.onCommandProgress_read
def read_offCommandProgress(self):
# PROTECTED REGION ID(CspMaster.offCommandProgress_read) ENABLED START #
"""Return the offCommandProgress attribute."""
return int(self._cmd_progress['off'])
# PROTECTED REGION END # // CspMaster.offCommandProgress_read
def read_standbyCommandProgress(self):
# PROTECTED REGION ID(CspMaster.standbyCommandProgress_read) ENABLED START #
"""Return the standbyCommandProgress attribute."""
return int(self._cmd_progress['standby'])
# PROTECTED REGION END # // CspMaster.standbyCommandProgress_read
def read_onCmdDurationExpected(self):
# PROTECTED REGION ID(CspMaster.onCmdDurationExpected_read) ENABLED START #
"""Return the onCmdDurationExpected attribute."""
return self._cmd_duration_expected['on']
# PROTECTED REGION END # // CspMaster.onCmdDurationExpected_read
def write_onCmdDurationExpected(self, value):
# PROTECTED REGION ID(CspMaster.onCmdDurationExpected_write) ENABLED START #
"""Set the onCmdDurationExpected attribute."""
self._cmd_duration_expected['on'] = value
# PROTECTED REGION END # // CspMaster.onCmdDurationExpected_write
def read_offCmdDurationExpected(self):
# PROTECTED REGION ID(CspMaster.offCmdDurationExpected_read) ENABLED START #
"""Return the offCmdDurationExpected attribute."""
return self._cmd_duration_expected['off']
# PROTECTED REGION END # // CspMaster.offCmdDurationExpected_read
def write_offCmdDurationExpected(self, value):
# PROTECTED REGION ID(CspMaster.offCmdDurationExpected_write) ENABLED START #
"""Set the offCmdDurationExpected attribute."""
self._cmd_duration_expected['off'] = value
# PROTECTED REGION END # // CspMaster.offCmdDurationExpected_write
def read_standbyCmdDurationExpected(self):
# PROTECTED REGION ID(CspMaster.standbyCmdDurationExpected_read) ENABLED START #
"""Return the standbyCmdDurationExpected attribute."""
return self._cmd_duration_expected['standby']
# PROTECTED REGION END # // CspMaster.standbyCmdDurationExpected_read
def write_standbyCmdDurationExpected(self, value):
# PROTECTED REGION ID(CspMaster.standbyCmdDurationExpected_write) ENABLED START #
"""Set the standbyCmdDurationExpected attribute."""
self._cmd_duration_expected['standby'] = value
# PROTECTED REGION END # // CspMaster.standbyCmdDurationExpected_write
def read_onCmdDurationMeasured(self):
# PROTECTED REGION ID(CspMaster.onCmdDurationMeasured_read) ENABLED START #
"""Return the onCmdDurationMeasured attribute."""
return int(self._cmd_duration_measured['on'])
# PROTECTED REGION END # // CspMaster.onCmdDurationMeasured_read
def read_offCmdDurationMeasured(self):
# PROTECTED REGION ID(CspMaster.offCmdDurationMeasured_read) ENABLED START #
"""Return the offCmdDurationMeasured attribute."""
return int(self._cmd_duration_measured['off'])
# PROTECTED REGION END # // CspMaster.offCmdDurationMeasured_read
def read_standbyCmdDurationMeasured(self):
# PROTECTED REGION ID(CspMaster.standbyCmdDurationMeasured_read) ENABLED START #
"""Return the standbyCmdDurationMeasured attribute."""
return int(self._cmd_duration_measured['standby'])
# PROTECTED REGION END # // CspMaster.standbyCmdDurationMeasured_read
def read_onCmdTimeoutExpired(self):
# PROTECTED REGION ID(CspMaster.onCmdTimeoutExpired_read) ENABLED START #
"""Return the onCmdTimeoutExpired attribute."""
return self._timeout_expired['on']
# PROTECTED REGION END # // CspMaster.cbfOnCmdTimeoutExpired_read
def read_offCmdTimeoutExpired(self):
# PROTECTED REGION ID(CspMaster.pssOnCmdTimeoutExpired_read) ENABLED START #
"""Return the offCmdTimeoutExpired attribute."""
return self._timeout_expired['off']
# PROTECTED REGION END # // CspMaster.pssOnCmdTimeoutExpired_read
def read_standbyCmdTimeoutExpired(self):
# PROTECTED REGION ID(CspMaster.standbyCmdTimeoutExpired_read) ENABLED START #
"""Return the standbyCmdTimeoutExpired attribute."""
return self._timeout_expired['standby']
# PROTECTED REGION END # // CspMaster.standbyCmdTimeoutExpired_read
def read_cspCbfState(self):
# PROTECTED REGION ID(CspMaster.cspCbfState_read) ENABLED START #
"""Return the cspCbfState attribute."""
return self._se_state[self.CspCbf]
# PROTECTED REGION END # // CspMaster.cspCbfState_read
def read_cspPssState(self):
# PROTECTED REGION ID(CspMaster.cspPssState_read) ENABLED START #
"""Return the cspPssState attribute."""
return self._se_state[self.CspPss]
# PROTECTED REGION END # // CspMaster.cspPssState_read
def read_cspPstState(self):
# PROTECTED REGION ID(CspMaster.cspPstState_read) ENABLED START #
"""Return the cspPstState attribute."""
return self._se_state[self.CspPst]
# PROTECTED REGION END # // CspMaster.cspPstState_read
def read_cspCbfHealthState(self):
# PROTECTED REGION ID(CspMaster.cspCbfHealthState_read) ENABLED START #
"""Return the cspCbfHealthState attribute."""
return self._se_health_state[self.CspCbf]
# PROTECTED REGION END # // CspMaster.cspCbfHealthState_read
def read_cspPssHealthState(self):
# PROTECTED REGION ID(CspMaster.cspPssHealthState_read) ENABLED START #
"""Return the cspPssHealthState attribute."""
return self._se_health_state[self.CspPss]
# PROTECTED REGION END # // CspMaster.cspPssHealthState_read
def read_cspPstHealthState(self):
# PROTECTED REGION ID(CspMaster.cspPstHealthState_read) ENABLED START #
"""Return the cspPstHealthState attribute."""
return self._se_health_state[self.CspPst]
# PROTECTED REGION END # // CspMaster.cspPstHealthState_read
def read_cbfMasterAddress(self):
# PROTECTED REGION ID(CspMaster.cbfMasterAddress_read) ENABLED START #
"""Return the cbfMasterAddress attribute."""
return self.CspCbf
# PROTECTED REGION END # // CspMaster.cbfMasterAddress_read
def read_pssMasterAddress(self):
# PROTECTED REGION ID(CspMaster.pssMasterAddress_read) ENABLED START #
"""Return the pssMasterAddress attribute."""
return self.CspPss
# PROTECTED REGION END # // CspMaster.pssMasterAddress_read
def read_pstMasterAddress(self):
# PROTECTED REGION ID(CspMaster.pstMasterAddress_read) ENABLED START #
"""Return the pstMasterAddress attribute."""
return self.CspPst
# PROTECTED REGION END # // CspMaster.pstMasterAddress_read
def read_cspCbfAdminMode(self):
# PROTECTED REGION ID(CspMaster.cspCbfAdminMode_read) ENABLED START #
"""Return the cspCbfAdminMode attribute."""
return self._se_admin_mode[self.CspCbf]
# PROTECTED REGION END # // CspMaster.cspCbfAdminMode_read
def write_cspCbfAdminMode(self, value):
# PROTECTED REGION ID(CspMaster.cspCbfAdminMode_write) ENABLED START #
"""
Write attribute method
Set the CBF sub-element *adminMode* attribute value.
:param value: one of the administration mode value (ON-LINE,\
OFF-LINE, MAINTENANCE, NOT-FITTED, RESERVED).
:return: None
:raises: tango.DevFailed when there is no DeviceProxy providing interface \
to the CBF sub-element Master, or an exception is caught in command execution.
"""
self._se_write_adminMode(value, self.CspCbf)
# PROTECTED REGION END # // CspMaster.cspCbfAdminMode_write
def read_cspPssAdminMode(self):
# PROTECTED REGION ID(CspMaster.cspPssAdminMode_read) ENABLED START #
"""Return the cspPssAdminMode attribute."""
return self._se_admin_mode[self.CspPss]
# PROTECTED REGION END # // CspMaster.cspPssAdminMode_read
def write_cspPssAdminMode(self, value):
# PROTECTED REGION ID(CspMaster.cspPssAdminMode_write) ENABLED START #
"""Set the cspPssAdminMode attribute."""
self._se_write_adminMode(value, self.CspPss)
# PROTECTED REGION END # // CspMaster.cspPssAdminMode_write
def read_cspPstAdminMode(self):
# PROTECTED REGION ID(CspMaster.cspPstAdminMode_read) ENABLED START #
"""Return the cspPstAdminMode attribute."""
return self._se_admin_mode[self.CspPst]
# PROTECTED REGION END # // CspMaster.cspPstAdminMode_read
def write_cspPstAdminMode(self, value):
# PROTECTED REGION ID(CspMaster.cspPstAdminMode_write) ENABLED START #
"""Set the cspPstAdminMode attribute."""
self._se_write_adminMode(value, self.CspPst)
# PROTECTED REGION END # // CspMaster.cspPstAdminMode_write
def read_numOfDevCompletedTask(self):
# PROTECTED REGION ID(CspMaster.numOfDevCompletedTask_read) ENABLED START #
"""Return the numOfDevCompletedTask attribute."""
if not self._last_executed_command:
return 0
return self._num_dev_completed_task[self._last_executed_command]
# PROTECTED REGION END # // CspMaster.numOfDevCompletedTask_read
def read_onCmdFailure(self):
# PROTECTED REGION ID(CspMaster.onCmdFailure_read) ENABLED START #
"""Return the onCmdFailure attribute."""
return self._failure_raised['on']
# PROTECTED REGION END # // CspMaster.onCmdFailure_read
def read_onFailureMessage(self):
# PROTECTED REGION ID(CspMaster.onFailureMessage_read) ENABLED START #
"""Return the onFailureMessage attribute."""
return self._failure_message['on']
# PROTECTED REGION END # // CspMaster.onFailureMessage_read
def read_offCmdFailure(self):
# PROTECTED REGION ID(CspMaster.offCmdFailure_read) ENABLED START #
"""Return the offCmdFailure attribute."""
return self._failure_raised['off']
# PROTECTED REGION END # // CspMaster.offCmdFailure_read
def read_offFailureMessage(self):
# PROTECTED REGION ID(CspMaster.offFailureMessage_read) ENABLED START #
"""Return the offFailureMessage attribute."""
return self._failure_message['off']
# PROTECTED REGION END # // CspMaster.offFailureMessage_read
def read_standbyCmdFailure(self):
# PROTECTED REGION ID(CspMaster.standbyCmdFailure_read) ENABLED START #
"""Return the standbyCmdFailure attribute."""
return self._failure_raised['standby']
# PROTECTED REGION END # // CspMaster.standbyCmdFailure_read
def read_standbyFailureMessage(self):
# PROTECTED REGION ID(CspMaster.standbyFailureMessage_read) ENABLED START #
"""Return the standbyFailureMessage attribute."""
return self._failure_message['standby']
# PROTECTED REGION END # // CspMaster.standbyFailureMessage_read
def read_cspSubarrayAddresses(self):
# PROTECTED REGION ID(CspMaster.cspSubarrayAddresses_read) ENABLED START #
"""Return the cspSubarrayAddresses attribute."""
return self.CspSubarrays
# PROTECTED REGION END # // CspMaster.cspSubarrayAddresses_read
def read_listOfDevCompletedTask(self):
# PROTECTED REGION ID(CspMaster.listOfDevCompletedTask_read) ENABLED START #
"""Return the listOfDevCompletedTask attribute."""
#TO IMPLEMENT
# report the list of the devices that completed the last executed task
if not self._last_executed_command:
return ('',)
return self._list_dev_completed_task[self._last_executed_command]
# PROTECTED REGION END # // CspMaster.listOfDevCompletedTask_read
def read_reservedSearchBeamIDs(self):
# PROTECTED REGION ID(CspMaster.reservedSearchBeamIDs_read) ENABLED START #
"""Return the reservedSearchBeamIDs attribute."""
return ('',)
# PROTECTED REGION END # // CspMaster.reservedSearchBeamIDs_read
def read_searchBeamsAddresses(self):
# PROTECTED REGION ID(CspMaster.searchBeamsAddresses_read) ENABLED START #
"""Return the searchBeamsAddresses attribute.
This attribute stores the list of the SearchBeams Capabilities TANGO
addresses (FQDNs)
"""
self.logger.info(self._capability_monitor_fqdn)
if not self._is_device_running(self.SearchBeamsMonitor, self._capability_monitor_proxy):
return ('',)
try:
proxy = self._capability_monitor_proxy[self.SearchBeamsMonitor]
return proxy.capabilityAddresses
except tango.DevFailed as tango_err:
msg = "Attribute reading failure: {}".format(tango_err.args[0].desc)
self.logger.error(msg)
tango.Except.throw_exception("Attribute reading failure", msg,
"read_searchBeamsAddresses", tango.ErrSeverity.ERR)
# PROTECTED REGION END # // CspMaster.searchBeamsAddresses_read
def read_timingBeamsAddresses(self):
# PROTECTED REGION ID(CspMaster.timingBeamsAddresses_read) ENABLED START #
"""Return the timingBeamsAddresses attribute.
This attribute stores the list of the TimingBeams Capabilities TANGO
addresses (FQDNs)
"""
if not self._is_device_running(self.TimingBeamsMonitor, self._capability_monitor_proxy):
return ('',)
try:
proxy = self._capability_monitor_proxy[self.TimingBeamsMonitor]
return proxy.capabilityAddresses
except tango.DevFailed as tango_err:
msg = "Attribute reading failure: {}".format(tango_err.args[0].desc)
self.logger.error(msg)
tango.Except.throw_exception("Attribute reading failure", msg,
"read_timingBeamsAddresses", tango.ErrSeverity.ERR)
# PROTECTED REGION END # // CspMaster.timingBeamsAddresses_read
def read_vlbiBeamsAddresses(self):
# PROTECTED REGION ID(CspMaster.vlbiBeamsAddresses_read) ENABLED START #
"""Return the vlbiBeamsAddresses attribute.
This attribute stores the list of the VlbiBeams Capabilities TANGO
addresses (FQDNs)
"""
if not self._is_device_running(self.VlbiBeamsMonitor, self._capability_monitor_proxy):
return ('',)
try:
proxy = self._capability_monitor_proxy[self.VlbiBeamsMonitor]
return proxy.capabilityAddresses
except tango.DevFailed as tango_err:
msg = "Attribute reading failure: {}".format(tango_err.args[0].desc)
self.logger.error(msg)
tango.Except.throw_exception("Attribute reading failure", msg,
"read_vlbiBeamsAddresses", tango.ErrSeverity.ERR)
# PROTECTED REGION END # // CspMaster.vlbiBeamsAddresses_read
# --------
# Commands
# --------
@AdminModeCheck('On')
def is_On_allowed(self):
"""
*TANGO is_allowed method*
Command *On* is allowed when the device *State* is STANDBY.
:return: True if the method is allowed, otherwise False.
"""
# PROTECTED REGION ID(CspMaster.is_On_allowed) ENABLED START #
# Note: as per SKA Guidelines, the command is allowed when
if self.get_state() not in [tango.DevState.STANDBY, tango.DevState.ON]:
return False
return True
@command(
dtype_in='DevVarStringArray',
doc_in=("If the array length is 0, the command applies to the whole CSP Element."
" If the array length is > 1, each array element specifies the FQDN of "
"the CSP SubElement to switch ON."),
)
@DebugIt()
@CmdInputArgsCheck("onCommandProgress", "onCmdTimeoutExpired", cmd_name = "on")
def On(self, argin):
# PROTECTED REGION ID(CspMaster.On) ENABLED START #
"""
*Class TANGO method*
Switch-on the CSP sub-elements specified by the input argument. If no argument is
specified, the command is issued on all the CSP sub-elements.
The command is executed if the *AdminMode* is ONLINE or *MAINTENANCE*.
If the AdminMode is *OFFLINE*, *NOT-FITTED* or *RESERVED*, the method throws an
exception.
The CSP.LMC commands sub-element transition from STANDBY to ON sequentially. It
waits for the first sub-element (CBF) to complete the transition, then issues the
command to the second sub-element (e.g. PST), waits for PST to complete and then
issues command for PSS.
Command is forwarded to the sub-element devices specified in the input list,
only if their adminMode is ONLINE or MAINTENANCE.
:param argin:
The list of sub-element FQDNs to switch-on or an empty list to switch-on the whole
CSP Element.
If the array length is 0, the command applies to the whole CSP Element. If the
array length is > 1, each array element specifies the FQDN of the
CSP SubElement to switch ON.
:type: 'DevVarStringArray'
:return: None
:raises: *tango.DevFailed* exception when:
- the CSP adminMode is not correct
- one or more sub-element devices are already running a power command
- there is no DeviceProxy providing interface to the CBF sub-element
"""
# the input list after decorator examination
device_list = argin
# invoke the constructor for the command thread.
# The target thread function is common to all the invoked commands. Specifc information
# are passed as arguments of the function
# args: the list of sub-element FQDNS
# args_dict: dictionary with the specific command information
args_dict = {'cmd_name':'On', 'dev_state': tango.DevState.ON}
self._command_thread['on'] = threading.Thread(target=self._issue_power_command, name="Thread-On",
args=(device_list,),
kwargs=args_dict)
try:
# start the thread
# set the CSP command execution running flag
self.logger.debug("self._cmd_execution_state: {}".format(self._cmd_execution_state.items()))
with self._cmd_exec_state_lock:
self._cmd_execution_state['on'] = CmdExecState.RUNNING
self._command_thread['on'].start()
self.logger.debug("self._cmd_execution_state: {}".format(self._cmd_execution_state.items()))
# sleep for a while to let the thread start
#time.sleep(0.1)
except Exception:
# reset the sub-element command exec state
self._se_cmd_execution_state.clear()
self._cmd_execution_state['on'] = CmdExecState.IDLE
tango.Except.throw_exception("Command failed",
"Thread non started while executing On command",
"On",
tango.ErrSeverity.ERR)
# PROTECTED REGION END # // CspMaster.On
@AdminModeCheck('Off')
def is_Off_allowed(self):
"""
*TANGO is_allowed method*
Command *Off* is allowed when the device *State* is STANDBY.
:return: True if the method is allowed, otherwise False.
"""
# PROTECTED REGION ID(CspMaster.is_On_allowed) ENABLED START #
# Note: as per SKA Guidelines, the command is allowed when
if self.get_state() not in [tango.DevState.STANDBY, tango.DevState.OFF]:
return False
return True
@command(
dtype_in='DevVarStringArray',
doc_in=("If the array length is 0, the command applies to the whole CSP Element."
"If the array length is > 1, each array element specifies the FQDN of the"
" CSP SubElement to switch OFF."),
)
@DebugIt()
@CmdInputArgsCheck("offCommandProgress", "offCmdTimeoutExpired", cmd_name = "off")
def Off(self, argin):
# PROTECTED REGION ID(CspMaster.Off) ENABLED START #
"""
*Class TANGO method*
Power-down the CSP sub-elements specified by the input argument. If no argument is
specified, the command is issued on all the CSP sub-elements.
The command is executed if the *AdminMode* is ONLINE or *MAINTENANCE*.
If the AdminMode is *OFFLINE*, *NOT-FITTED* or *RESERVED*, the method throws an
exception.
The CSP.LMC commands sub-element transition from STANDBY to OFF sequentially.It
waits for the first sub-element (CBF) to complete the transition, then issues the
command to the second sub-element (e.g. PST), waits for PST to complete and then
issues command for PSS.
Command is forwarded to the sub-element devices specified in the input list,
only if their adminMode is ONLINE or MAINTENANCE.
:param argin:
The list of sub-element FQDNs to power-down or an empty list to
power-off the whole CSP Element.
If the array length is 0, the command applies to the whole CSP
Element. If the array length is > 1, each array element specifies
the FQDN of the CSP SubElement to power-off.
:type: 'DevVarStringArray'
:return: None
:raises: *tango.DevFailed* exception when:
- the CSP adminMode is not correct
- one or more sub-element devices are already running a power command
- there is no DeviceProxy providing interface to the CBF sub-element
"""
# the input list after decorator examination
device_list = argin
# invoke the constructor for the command thread.
# The target thread function is common to all the invoked commands. Specifc information
# are passed as arguments of the function
# args: the list of sub-element FQDNS
# args_dict: dictionary with the specific command information
args_dict = {'cmd_name':'Off',
'dev_state': tango.DevState.OFF}
self._command_thread['off'] = threading.Thread(target=self._issue_power_command, name="Thread-Off",
args=(device_list,),
kwargs=args_dict)
try:
# set the CSP command execution running flag
with self._cmd_exec_state_lock:
self._cmd_execution_state['off'] = CmdExecState.RUNNING
# start the thread
self._command_thread['off'].start()
# sleep for a while to let the thread start
#time.sleep(0.1)
except Exception:
# reset the sub-element command exec state
self._se_cmd_execution_state.clear()
self._cmd_execution_state['off'] = CmdExecState.IDLE
tango.Except.throw_exception("Command failed",
"Thread non started while executing Off command",
"Off",
tango.ErrSeverity.ERR)
# PROTECTED REGION END # // CspMaster.Off
@AdminModeCheck('Standby')
def is_Standby_allowed(self):
"""
*TANGO is_allowed method*
Command *Standby* is allowed when the device *State* is ON.
:return: True if the method is allowed, otherwise False.
"""
# PROTECTED REGION ID(CspMaster.is_On_allowed) ENABLED START #
# Note: as per SKA Guidelines, the command is allowed when
if self.get_state() not in [tango.DevState.STANDBY, tango.DevState.ON]:
return False
return True
@command(
dtype_in='DevVarStringArray',
doc_in=("If the array length is 0, the command applies to the whole CSP Element. "
"If the array length is > 1, each array element specifies the FQDN of the"
"CSP SubElement to put in STANDBY mode."),
)
@DebugIt()
@CmdInputArgsCheck("standbyCommandProgress",
"standbyCmdTimeoutExpired", cmd_name = "standby")
def Standby(self, argin):
# PROTECTED REGION ID(CspMaster.Standby) ENABLED START #
"""
Transit CSP or one or more CSP SubElements from ON to *STANDBY*.
The command is executed only if the *AdminMode* is ONLINE or *MAINTENANCE*.
If the AdminMode is *OFFLINE*, *NOT-FITTED* or *RESERVED*, the method throws an
exception.
The CSP.LMC commands sub-element transition from ON to STANDBY sequentially. It
waits for the first sub-element (CBF) to complete the transition, then issues the
command to the second sub-element (e.g. PST), waits for PST to complete and then
issues command for PSS.
Command is forwarded to the sub-element devices specified in the input list,
only if their adminMode is ONLINE or MAINTENANCE.
:param argin: A list with the FQDN of the sub-elements to set in low-power.
If the array length is 0, the command applies to the whole
CSP Element. If the array length is > 1, each array element
specifies the FQDN of the CSP SubElement to put in STANDBY mode.
:type: 'DevVarStringArray'
:return: None
:raises: *tango.DevFailed* exception when:
- the CSP adminMode is not correct
- one or more sub-element devices are already running a power command
- there is no DeviceProxy providing interface to the CBF sub-element
"""
device_list = argin
# build the dictionary to pass as argument of the thread target function
# The dictionary keys are:
# cmd_name : the TANGO command name to execute
# attr_name: the corresponding command progress attribute to subscribe
# dev_state: the expected finale state for the device transition
args_dict = {'cmd_name':'Standby',
'dev_state':tango.DevState.STANDBY}
# invoke the constructor for the command thread
self._command_thread['standby'] = threading.Thread(target=self._issue_power_command,
name="Thread-Standby",
args=(device_list,),
kwargs=args_dict)
try:
# set the CSP command execution running flag
self.logger.debug("self._cmd_execution_state: {}".format(self._cmd_execution_state.items()))
with self._cmd_exec_state_lock:
self._cmd_execution_state['standby'] = CmdExecState.RUNNING
# start the thread
self._command_thread['standby'].start()
self.logger.debug("self._cmd_execution_state: {}".format(self._cmd_execution_state.items()))
# sleep for a while to let the thread start
#time.sleep(0.1)
except Exception:
# reset the sub-element command exec state
self._se_cmd_execution_state.clear()
self._cmd_execution_state['standby'] = CmdExecState.IDLE
tango.Except.throw_exception("Command failed",
"Thread not started while executing Standby command",
"Standby",
tango.ErrSeverity.ERR)
# PROTECTED REGION END # // CspMaster.Standby
@command(
)
@DebugIt()
def Upgrade(self):
# PROTECTED REGION ID(CspMaster.Upgrade) ENABLED START #
"""
:return: None
"""
pass
# PROTECTED REGION END # // CspMaster.Upgrade
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
# PROTECTED REGION ID(CspMaster.main) ENABLED START #
return run((CspMaster,), args=args, **kwargs)
# PROTECTED REGION END # // CspMaster.main
if __name__ == '__main__':
main()
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/csp_lmc_common/CspSearchBeamCapability.py 0000664 0000000 0000000 00000017661 13707315520 0032535 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
#
# This file is part of the CspSearchBeamCapability project
#
# INAF-SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
""" CSP SearchBeam Capability
The class models the Capability Search Beam exsposing
the attributes and commands used to monitor and control beamforming
and PSS pulsar search in a single beam.
In particular it maps components used for beamforming with those
that perform PSS processing (pulsar search and transients).
Used for development of LOW and MID specific devices.
"""
# PROTECTED REGION ID (CspSearchBeamCapability.standardlibray_import) ENABLED START #
# Python standard library
# PROTECTED REGION END# //CspSearchBeamCapability.standardlibray_import
# tango imports
import tango
from tango import DebugIt
from tango.server import run
from tango.server import Device
from tango.server import attribute, command
from tango.server import device_property
from tango import AttrQuality, DispLevel, DevState
from tango import AttrWriteType, PipeWriteType
# Additional import
# PROTECTED REGION ID(CspSearchBeamCapability.additionnal_import) ENABLED START #
from ska.base import SKACapability
from ska.base.control_model import HealthState, AdminMode, ObsState, ObsMode
# PROTECTED REGION END # // CspSearchBeamCapability.additionnal_import
__all__ = ["CspSearchBeamCapability", "main"]
class CspSearchBeamCapability(SKACapability):
"""
The class models the Capability Search Beam exsposing
the attributes and commands used to monitor and control beamforming
and PSS pulsar search in a single beam.
In particular it maps components used for beamforming with those
that perform PSS processing (pulsar search and transients).
Used for development of LOW and MID specific devices.
**Properties:**
- Device Property
"""
# PROTECTED REGION ID(CspSearchBeamCapability.class_variable) ENABLED START #
# PROTECTED REGION END # // CspSearchBeamCapability.class_variable
# -----------------
# Device Properties
# -----------------
# ----------
# Attributes
# ----------
pssPipelineTangoAddr = attribute(
dtype='DevString',
label="The PSS pipeline name",
doc="The PssPipeline TANGO Device FQDN.",
)
pssPipelineIPAddr = attribute(
dtype='DevString',
label="PSS Node IP address",
doc="The IP address of the PSS node hosting the PssPipeline TANGO Device and running the\ndata reduction pipeline.",
)
pssPipelineIPPort = attribute(
dtype='DevUShort',
label="The PSS data pipeline IP port",
doc="The IP port the data reduction processing pipeline is listening to receive commands and\ninput parameters.",
)
pssPipelineState = attribute(
dtype='DevState',
label="The PssPipeline State",
doc="The STate of the PssPipeline TANGO Device. It represents the operational state of the\nPSS data reduction pipeline.",
)
pssPipelineAdminMode = attribute(
dtype='DevEnum',
access=AttrWriteType.READ_WRITE,
label="The PssPipeline adminMode",
doc="The adminMode of the PssPipeline TANGO Device.",
)
pssPipelineObsState = attribute(
dtype='DevEnum',
label="The PssPipeline obsState",
doc="The obsState of the PssPipeline TANGO Device.",
)
pssPipelineObsMode = attribute(
dtype='DevEnum',
label="The PssPipeline obsMode",
doc="The obsMode of the PSsPipeline TANGO Device.",
)
subarrayMembership = attribute(
dtype='DevUShort',
label="The Beam Capability subarray affiliation.",
doc="The subarray ID the CSP Beam Capability belongs to.",
)
# ---------------
# General methods
# ---------------
def init_device(self):
"""Initialises the attributes and properties of the CspSearchBeamCapability."""
SKACapability.init_device(self)
# PROTECTED REGION ID(CspSearchBeamCapability.init_device) ENABLED START #
# PROTECTED REGION END # // CspSearchBeamCapability.init_device
def always_executed_hook(self):
"""Method always executed before any TANGO command is executed."""
# PROTECTED REGION ID(CspSearchBeamCapability.always_executed_hook) ENABLED START #
# PROTECTED REGION END # // CspSearchBeamCapability.always_executed_hook
def delete_device(self):
"""Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command.
"""
# PROTECTED REGION ID(CspSearchBeamCapability.delete_device) ENABLED START #
# PROTECTED REGION END # // CspSearchBeamCapability.delete_device
# ------------------
# Attributes methods
# ------------------
def read_pssPipelineTangoAddr(self):
# PROTECTED REGION ID(CspSearchBeamCapability.pssPipelineTangoAddr_read) ENABLED START #
"""Return the pssPipelineTangoAddr attribute."""
return ''
# PROTECTED REGION END # // CspSearchBeamCapability.pssPipelineTangoAddr_read
def read_pssPipelineIPAddr(self):
# PROTECTED REGION ID(CspSearchBeamCapability.pssPipelineIPAddr_read) ENABLED START #
"""Return the pssPipelineIPAddr attribute."""
return ''
# PROTECTED REGION END # // CspSearchBeamCapability.pssPipelineIPAddr_read
def read_pssPipelineIPPort(self):
# PROTECTED REGION ID(CspSearchBeamCapability.pssPipelineIPPort_read) ENABLED START #
"""Return the pssPipelineIPPort attribute."""
return 0
# PROTECTED REGION END # // CspSearchBeamCapability.pssPipelineIPPort_read
def read_pssPipelineState(self):
# PROTECTED REGION ID(CspSearchBeamCapability.pssPipelineState_read) ENABLED START #
"""Return the pssPipelineState attribute."""
return tango.DevState.UNKNOWN
# PROTECTED REGION END # // CspSearchBeamCapability.pssPipelineState_read
def read_pssPipelineAdminMode(self):
# PROTECTED REGION ID(CspSearchBeamCapability.pssPipelineAdminMode_read) ENABLED START #
"""Return the pssPipelineAdminMode attribute."""
return 0
# PROTECTED REGION END # // CspSearchBeamCapability.pssPipelineAdminMode_read
def write_pssPipelineAdminMode(self, value):
# PROTECTED REGION ID(CspSearchBeamCapability.pssPipelineAdminMode_write) ENABLED START #
"""Set the pssPipelineAdminMode attribute."""
pass
# PROTECTED REGION END # // CspSearchBeamCapability.pssPipelineAdminMode_write
def read_pssPipelineObsState(self):
# PROTECTED REGION ID(CspSearchBeamCapability.pssPipelineObsState_read) ENABLED START #
"""Return the pssPipelineObsState attribute."""
return 0
# PROTECTED REGION END # // CspSearchBeamCapability.pssPipelineObsState_read
def read_pssPipelineObsMode(self):
# PROTECTED REGION ID(CspSearchBeamCapability.pssPipelineObsMode_read) ENABLED START #
"""Return the pssPipelineObsMode attribute."""
return 0
# PROTECTED REGION END # // CspSearchBeamCapability.pssPipelineObsMode_read
def read_subarrayMembership(self):
# PROTECTED REGION ID(CspSearchBeamCapability.subarrayMembership_read) ENABLED START #
"""Return the subarrayMembership attribute."""
return 0
# PROTECTED REGION END # // CspSearchBeamCapability.subarrayMembership_read
# --------
# Commands
# --------
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
"""Main function of the CspSearchBeamCapability module."""
# PROTECTED REGION ID(CspSearchBeamCapability.main) ENABLED START #
return run((CspSearchBeamCapability,), args=args, **kwargs)
# PROTECTED REGION END # // CspSearchBeamCapability.main
if __name__ == '__main__':
main()
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/csp_lmc_common/CspSearchBeamsMonitor.py 0000664 0000000 0000000 00000010412 13707315520 0032251 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
#
# This file is part of the CspSearchBeamsMonitor project
#
# INAF.SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
""" CSP.LMC Capability monitor for SearchBeams Capabilty devices
CSP.LMC Capability monitor for SearchBeams Capabilty devices
"""
# PROTECTED REGION ID (CspSearchBeamsMonitor.standardlibray_import) ENABLED START #
# Python standard library
# PROTECTED REGION END# //CspSearchBeamsMonitor.standardlibray_import
# PyTango imports
import tango
from tango import DebugIt
from tango.server import run
from tango.server import Device
from tango.server import attribute, command
from tango.server import device_property
from tango import AttrQuality, DispLevel, DevState
from tango import AttrWriteType, PipeWriteType
# Additional import
# PROTECTED REGION ID(CspSearchBeamsMonitor.additionnal_import) ENABLED START #
from ska.base.control_model import HealthState, AdminMode, ObsState, ObsMode
from .CspCapabilityMonitor import CspCapabilityMonitor
# PROTECTED REGION END # // CspSearchBeamsMonitor.additionnal_import
__all__ = ["CspSearchBeamsMonitor", "main"]
class CspSearchBeamsMonitor(CspCapabilityMonitor):
"""
CSP.LMC Capability monitor for SearchBeams Capabilty devices
**Properties:**
- Device Property
"""
# PROTECTED REGION ID(CspSearchBeamsMonitor.class_variable) ENABLED START #
# PROTECTED REGION END # // CspSearchBeamsMonitor.class_variable
# -----------------
# Device Properties
# -----------------
# ----------
# Attributes
# ----------
numOfReservedIDs = attribute(
dtype='DevUShort',
label="Number of reserved IDs",
doc="The number of all sub-arrays reserved IDs.",
)
reservedIDs = attribute(
dtype=('DevString',),
max_dim_x=16,
label="Number of reserved IDs",
doc="The number of SearchBeam IDs reserved to each sub-array",
)
# ---------------
# General methods
# ---------------
def init_device(self):
"""Initialises the attributes and properties of the CspSearchBeamsMonitor."""
CspCapabilityMonitor.init_device(self)
# PROTECTED REGION ID(CspSearchBeamsMonitor.init_device) ENABLED START #
# self._reserved_ids: the number of reserved searchBeams for each subarray
# dictionary:
# keys: subarray ID
# value list of SearchBeams IDs
self._reserved_ids = {}
self._num_of_reserved_ids = 0
# PROTECTED REGION END # // CspSearchBeamsMonitor.init_device
def always_executed_hook(self):
"""Method always executed before any TANGO command is executed."""
# PROTECTED REGION ID(CspSearchBeamsMonitor.always_executed_hook) ENABLED START #
# PROTECTED REGION END # // CspSearchBeamsMonitor.always_executed_hook
def delete_device(self):
"""Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command.
"""
# PROTECTED REGION ID(CspSearchBeamsMonitor.delete_device) ENABLED START #
# PROTECTED REGION END # // CspSearchBeamsMonitor.delete_device
# ------------------
# Attributes methods
# ------------------
def read_numOfReservedIDs(self):
# PROTECTED REGION ID(CspSearchBeamsMonitor.numOfReservedIDs_read) ENABLED START #
"""Return the numOfReservedIDs attribute."""
return self._num_of_reserved_ids
# PROTECTED REGION END # // CspSearchBeamsMonitor.numOfReservedIDs_read
def read_reservedIDs(self):
# PROTECTED REGION ID(CspSearchBeamsMonitor.reservedIDs_read) ENABLED START #
"""Return the reservedIDs attribute."""
return ('',)
# PROTECTED REGION END # // CspSearchBeamsMonitor.reservedIDs_read
# --------
# Commands
# --------
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
# PROTECTED REGION ID(CspSearchBeamsMonitor.main) ENABLED START #
return run((CspSearchBeamsMonitor,), args=args, **kwargs)
# PROTECTED REGION END # // CspSearchBeamsMonitor.main
if __name__ == '__main__':
main()
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/csp_lmc_common/CspSubarray.py 0000664 0000000 0000000 00000415106 13707315520 0030325 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
#
# This file is part of the CspSubarray project
#
# INAF - SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
""" CSP.LMC Common CspSubarray
CSP subarray functionality is modeled via a TANGCSP.LMC Common Class for the CSPSubarray TANGO Device.
"""
# PROTECTED REGION ID (CspSubarray.standardlibray_import) ENABLED START #
# Python standard library
from __future__ import absolute_import
import sys
import os
from collections import defaultdict
from enum import IntEnum, unique
import threading
import time
import json
# PROTECTED REGION END# //CspSubarray.standardlibray_import
# tango imports
import tango
from tango import DebugIt
from tango.server import run
from tango.server import Device
from tango.server import attribute, command
from tango.server import class_property, device_property
from tango import AttrQuality, EventType, DevState
from tango import AttrWriteType, DeviceProxy
# Additional import
# PROTECTED REGION ID(CspSubarray.additionnal_import) ENABLED START #
from ska.base import SKASubarray, SKASubarrayStateModel
#from ska.base import utils
from ska.base.commands import ActionCommand, ResultCode
from ska.base.faults import CapabilityValidationError
from ska.base.control_model import HealthState, AdminMode, ObsState, ObsMode
from .utils.decorators import AdminModeCheck, ObsStateCheck, SubarrayRejectCmd
from .utils.cspcommons import CmdExecState
from . import release
# PROTECTED REGION END # // CspSubarray.additionnal_import
__all__ = ["CspSubarray", "main"]
class CspSubarrayStateModel(SKASubarrayStateModel):
_subarray_transitions = {
('READY', 'goto_idle_succeeded'): (
"IDLE",
lambda self: self._set_obs_state(ObsState.IDLE)
),
('READY', 'goto_idle_started'): ("READY",None),
('READY', 'goto_idle_failed'): (
"OBSFAULT",
lambda self: self._set_obs_state(ObsState.FAULT)
),
}
def __init__(self, dev_state_callback=None):
"""
Initialises the model. Note that this does not imply moving to
INIT state. The INIT state is managed by the model itself.
"""
super().__init__(
dev_state_callback=dev_state_callback,
)
self.update_transitions(self._subarray_transitions)
class CspSubarray(SKASubarray):
"""
CSP subarray functionality is modeled via a TANGCSP.LMC Common Class for the CSPSubarray TANGO Device.
**Properties:**
- Class Property
PSTBeams
- PST sub-element PSTBeams TANGO devices FQDNs
- Type:'DevVarStringArray'
- Device Property
CspMaster
- The TANGO address of the CspMaster.
- Type:'DevString'
CbfSubarray
- CBF sub-element sub-array TANGO device FQDN
- Type:'DevString'
PssSubarray
- PST sub-element sub-array TANGO device FQDN.
- Type:'DevString'
SubarrayProcModeCorrelation
- CSP Subarray *Correlation Inherent Capability*\nTANGO device FQDN
- Type:'DevString'
SubarrayProcModePss
- CSP Subarray *Pss Inherent Capability*\nTANGO device FQDN
- Type:'DevString'
SubarrayProcModePst
- CSP Subarray *PST Inherent Capability*\nTANGO device FQDN
- Type:'DevString'
SubarrayProcModeVlbi
- CSP Subarray *VLBI Inherent Capability*\nTANGO device FQDN
- Type:'DevString'
"""
class InitCommand(SKASubarray.InitCommand):
"""
A class for the SKASubarray's init_device() "command".
"""
def do(self):
"""
Stateless hook for device initialisation.
:return: A tuple containing a return code and a string
message indicating status. The message is for
information purpose only.
:rtype: (ResultCode, str)
"""
(result_code, message) = super().do()
device = self.target
device._build_state = '{}, {}, {}'.format(release.name, release.version, release.description)
device._version_id = release.version
# connect to CSP.LMC TANGO DB
# _config_delay_expected: inherited from the SKAObsDevice base class
# Note: the _config_delay_expected could be set equal the max among the sub-elements
# sub-arrays expected times for the command
# For tests purpose we set it = 10
device._config_delay_expected = 10
device._scan_id = 0
device._configuration_id = ''
# flag to signal if we have a recofniguraiton
device._reconfiguring = False
# connect to TANGO DB
# use defaultdict to initialize the sub-element State,healthState
# and adminMode. The dictionary uses as keys the sub-element
# fqdn, for example
# device._sc_subarray_state[device.CspCbf]
# return the State value of the Mid Cbf sub-element.
device._sc_subarray_state = defaultdict(lambda: tango.DevState.DISABLE)
device._sc_subarray_health_state = defaultdict(lambda: HealthState.UNKNOWN)
device._sc_subarray_admin_mode = defaultdict(lambda: AdminMode.NOT_FITTED)
device._sc_subarray_obs_state = defaultdict(lambda: ObsState.IDLE)
device._sc_subarray_obs_mode = defaultdict(lambda: ObsMode.IDLE)
device._csp_tango_db = tango.Database()
# read the CSP memorized attributes from the TANGO DB.
# Note: a memorized attribute has defined the attribute
# property '__value'
attribute_properties = device._csp_tango_db.get_device_attribute_property(device.get_name(),
{'adminMode': ['__value']})
# build a dictionary with the (attr_name, value) of the memorized attributes
# use memorized atrtibute if present, otherwise the default one
memorized_attr_dict = {attr_name : int(value[0]) for attr_name, db_key in attribute_properties.items()
for key, value in db_key.items()
if key == '__value'}
try:
device._admin_mode = memorized_attr_dict['adminMode']
if device._admin_mode not in [AdminMode.ONLINE, AdminMode.MAINTENANCE]:
device._health_state = HealthState.UNKNOWN
device.set_state(tango.DevState.DISABLE)
except KeyError as key_err:
device.logger.info("Key {} not found".format(key_err))
# list of sub-array sub-component FQDNs
device._sc_subarray_fqdn = []
# list of sub-component FQDNs assigned to the sub-array
device._sc_subarray_assigned_fqdn = []
# _sc_subarray_proxies: the sub-element sub-array proxies
# implementes as dictionary:
# keys: sub-element sub-arrayFQDN
# values: device proxy
device._sc_subarray_proxies = {}
# Nested default dictionary with list of event ids/CSP sub-array sub-component. Need to
# store the event ids for each CSP sub-array component and attribute to un-subscribe
# them at disconnection.
# keys: sub-component FQDN
# values: dictionary (keys: attribute name, values: event id)
device._sc_subarray_event_id = defaultdict(lambda: defaultdict(lambda: 0))
# _sc_subarray_cmd_exec_state: implement the execution state of a long-running
# command for each sub-array sub-component.
# implemented as a nested default dictionary:
# keys: sub-element FQDN
# values: defaut dictionary (keys: command name, values: command state)
device._sc_subarray_cmd_exec_state = defaultdict(lambda: defaultdict(lambda: CmdExecState.IDLE))
# _sc_subarray_cmd_starting_time: for each sub-element report the long-running command
# starting time
# Implemented as dictionary:
# keys: the sub-element sub-array FQDN
# values: starting time
device._sc_subarray_cmd_starting_time = defaultdict(lambda: 0.0)
# _command_thread: thread for the command execution
# keys: the command name('on, 'off'...)
# values: thread instance
device._command_thread = {}
# _end_scan_event: thread event to signal EndScan
device._end_scan_event = threading.Event()
# _abort_command_event: thread event to signal Abort request
device._abort_command_event = threading.Event()
# of a long-running command
# implemented as a default nested dictionary:
# keys: sub-element sub-array FQDN
# values: default dictionary (keys: command name, values: the execution percentage)
device._sc_subarray_cmd_progress = defaultdict(lambda: defaultdict(lambda: 0))
# _sc_subarray_cmd_duration_expected: for each sub-element, store the duration (in sec.)
# configured for a long-running command
# Implemented as a nested default dictionary
# keys: FQDN
# values: default dictionary (keys: command name, values: the duration (in sec))
device._sc_subarray_cmd_duration_expected = defaultdict(lambda: defaultdict(lambda: 10))
# _sc_subarray_scan_configuration: report the scan configuration
# for each sub-array sub-component (CBF, PSS subarray, PSTBeams)
# Implemented as default dictionary
# keys: FQDN
# values: the scan confiration as JSON formatted string
device._sc_subarray_scan_configuration = defaultdict(lambda:'')
# _cmd_execution_state: implement the execution state of a long-running
# command for the whole CSP sub-array Setting this attribute prevent the execution
# of the same command while it is already running.
# implemented as a default dictionary:
# keys: command name
# values:command state
device._cmd_execution_state = defaultdict(lambda: CmdExecState.IDLE)
# _cmd_progress: report the execution progress of a long-running command
# implemented as a dictionary:
# keys: command name ('addbeams', 'removebeams', 'configure')
# values: the percentage
device._cmd_progress = defaultdict(lambda: 0)
# _cmd_duration_expected: store the duration (in sec.) configured for
# a long-running command
# Implemented asdefault dictionary
# keys: command name ('addsearchbeams','configurescan'....)
# values: the duration (in sec)
device._cmd_duration_expected = defaultdict(lambda: 0)
# _cmd_duration_measured: report the measured duration (in sec.) for
# a long-running command
# Implemented as default dictionary
# keys: command name ('on', 'off',..)
# values: the duration (in sec)
device._cmd_duration_measured = defaultdict(lambda: 0)
# _timeout_expired: report the timeout flag
device._timeout_expired = False
# _failure_raised: report the failure flag
device._failure_raised = False
# _failure_message: report the failure message
# Implemented as a dictionary
# keys: command name ('addserachbeams', 'configurescan'..)
# values: the message
device._failure_message = defaultdict(lambda: '')
# _list_dev_completed_task: for each long-running command report the list of subordinate
# components that completed the task
# Implemented as a dictionary
# keys: the command name ('on', 'off',...)
# values: the list of components
device._list_dev_completed_task = defaultdict(lambda: [])
# the last executed command
device._last_executed_command = ""
# _num_dev_completed_task: for each long-running command report the number
# of subordinate components that completed the task
# Implemented as a dictionary
# keys: the command name ('addbeams, 'configurescan',...)
# values: the number of components
device._num_dev_completed_task = defaultdict(lambda:0)
# _valid_scan_configuration: the last programmed scan configuration
device._valid_scan_configuration = ''
# unassigned CSP SearchBeam, TimingBeam, VlbiBeam Capability IDs
device._assigned_search_beams = []
#device._unassigned_search_beam_num = 0
device._reserved_search_beams = []
#device._reserved_search_beam_num = 0
device._assigned_timing_beams= []
device._assigned_vlbi_beams = []
# Try connection with the CBF sub-array
device.connect_to_subarray_subcomponent(device.CbfSubarray)
# Try connection with the PSS sub-array
device.connect_to_subarray_subcomponent(device.PssSubarray)
# to use the push model in command_inout_asynch (the one with the callback parameter),
# change the global TANGO model to PUSH_CALLBACK.
apiutil = tango.ApiUtil.instance()
apiutil.set_asynch_cb_sub_model(tango.cb_sub_model.PUSH_CALLBACK)
message = "CspSubarray Init command completed OK"
self.logger.info(message)
return (result_code, message)
class OnCommand(SKASubarray.OnCommand):
def do(self):
super().do()
device = self.target
self.logger.info("Call On Command")
for fqdn in device._sc_subarray_fqdn:
try:
(result_code, message) = device._sc_subarray_proxies[fqdn].On()
if result_code == ResultCode.FAILED:
self.logger.error("On command failed on device {}".format(fqdn))
if fqdn != device.CbfSubarray:
device._health_state = HealthState.DEGRADED
continue
else:
return (ResultCode.FAILED, message)
except tango.DevFailed as tango_err:
message = str(tango_err.args[0].desc)
return (ResultCode.FAILED, message)
message = "On command completed OK"
self.logger.info(message)
return (ResultCode.OK, message)
class OffCommand(SKASubarray.OffCommand):
def do(self):
self.logger.info("Call Off Command")
device = self.target
for fqdn in device._sc_subarray_fqdn:
try:
# check if the sub-element subarray is already in the
# requested state
if device._sc_subarray_state[fqdn] == tango.DevState.OFF:
continue
(result_code, message) = device._sc_subarray_proxies[fqdn].Off()
if result_code == ResultCode.FAILED:
self.logger.error("Off command failed on device {}".format(fqdn))
if fqdn != device.CbfSubarray:
device._health_state = HealthState.DEGRADED
continue
else:
return (ResultCode.FAILED, message)
except tango.DevFailed as tango_err:
message = str(tango_err.args[0].desc)
return (ResultCode.FAILED, message)
message = "Off command completed OK"
self.logger.info(message)
return (ResultCode.OK, message)
class ConfigureCommand(SKASubarray.ConfigureCommand):
def do(self, argin):
# checks on State, adminMode and obsState values are performed inside the
# python decorators
# the dictionary with the scan configuration
target_device = self.target
try:
# if the stored configuration attribute is not empty, check
# for the received configuration content
if target_device._valid_scan_configuration:
try:
stored_configuration = json.dumps(target_device._valid_scan_configuration, sort_keys=True)
received_configuration = json.dumps(argin, sort_keys=True)
# if the received configuration is equal to the last valid configuration and the
# state of the subarray is READY than subarray is not re-configured.
if (stored_configuration == received_configuration) and (target_device.state_model._obs_state == ObsState.READY):
self.logger.info("Subarray is going to use the same configuration")
return (ResultCode.OK, "Configure command OK")
except Exception as e:
self.logger.warning(str(e))
# go ahead and parse the received configuration
self.validate_scan_configuration(argin)
except tango.DevFailed as tango_err:
# validation failure
msg = "Failure during validation of configuration:{}".format(tango_err.args[0].desc)
self.logger.error(msg)
tango.Except.throw_exception("Command failed",
msg,
"Configure",
tango.ErrSeverity.ERR)
target_device._reconfiguring = False
if target_device.state_model._obs_state == ObsState.READY:
target_device._reconfiguring = True
# Forward the Configure command to the sub-elements
# components (subarrays, pst beams)
for device in target_device._sc_subarray_assigned_fqdn:
# reset the command progress counter for each
# sub-array component
target_device._sc_subarray_cmd_progress[device]['configurescan'] = 0
target_device._failure_message['configurescan'] = ''
# NOTE: what happens if a sub-element subarray/PSt beam TANGO
# device is not running? The next calls to proxy should fail
# with a tango.DevFailed exception.
if not target_device._is_sc_subarray_running(device):
msg = "Device {} not running".format(device)
if device == target_device.CbfSubarray:
return (ResultCode.FAILED, msg)
target_device._failure_message['configurescan'] += msg
target_device._sc_subarray_cmd_exec_state[device]['configurescan'] = CmdExecState.FAILED
#skip to next device
continue
proxy = target_device._sc_subarray_proxies[device]
# subscribe sub-elements attributes to track command execution and
# timeout on subarray sub-components
attributes = ['configureScanCmdProgress', 'timeoutExpiredFlag']
for attr in attributes:
try:
if target_device._sc_subarray_event_id[attr.lower()] == 0:
event_id = proxy.subscribe_event(attr,
tango.EventType.CHANGE_EVENT,
target_device._attributes_change_evt_cb,
stateless=False)
target_device._sc_subarray_event_id[device][attr] = event_id
except tango.DevFailed as df:
self.logger.info(df.args[0].desc)
# NOTE: CBF/PSS sub-array checks for the validity of its
# configuration. Failure in configuration throws an exception that is
# caught via the _cmd_ended_cb callback
"""
try:
# read the timeout configured for the operation on the device
self._sc_subarray_cmd_duration_expected[device]['configurescan'] = proxy.configureDelayExpected
except AttributeError as attr_err:
self.logger.info("No attribute {} on device {}".format(str(attr_err), device))
"""
try:
# read the timeout configured for the operation on the device
target_device._sc_subarray_cmd_duration_expected[device]['configurescan'] = target_device._get_expected_delay(proxy, "configureDelayExpected")
#self.logger.info("config delay: {}".format(target_device._sc_subarray_cmd_duration_expected[device]['configurescan']))
except tango.DevFailed as tango_err:
self.logger.info("No attribute {} on device {}".format(tango_err.args[0].desc, device))
try:
target_device._timeout_expired = False
target_device._failure_raised = False
proxy.command_inout_asynch("ConfigureScan",
target_device._sc_subarray_scan_configuration[device],
target_device._cmd_ended_cb)
self.logger.info("Exec state command flag is {}".format(target_device._sc_subarray_cmd_exec_state[device]['configurescan']))
# Note: check if callaback executed...
if target_device._sc_subarray_cmd_exec_state[device]['configurescan'] != CmdExecState.FAILED:
target_device._sc_subarray_cmd_exec_state[device]['configurescan'] = CmdExecState.RUNNING
except tango.DevFailed as tango_err:
if device == target_device.CbfSubarray:
msg = "Failure in configuring CBF: {}".format(tango_err.args[0].desc)
self.logger.error(msg)
# throw the exception, configuration can't proceed
return (ResultCode.FAILED, msg)
target_device._failure_message['configurescan'] += tango_err.args[0].desc
target_device._sc_subarray_cmd_exec_state[device]['configurescan'] = CmdExecState.FAILED
# register the starting time for the command
target_device._sc_subarray_cmd_starting_time[device] = time.time()
self.logger.debug("configure starting time: {}".format(target_device._sc_subarray_cmd_starting_time[device]))
# end for loop on devices
# TODO: evaluate the global timeout as the max of the single sub-element
# timeouts
# configure the timeout for the operation
if target_device._config_delay_expected > 0:
target_device._cmd_duration_expected['configurescan'] = target_device._config_delay_expected
self.logger.debug("_config_delay_expected :{}".format(target_device._config_delay_expected))
# invoke the constructor for the command thread
thread_args = [target_device._sc_subarray_assigned_fqdn, argin]
target_device._command_thread['configurescan'] = threading.Thread(target=self._configure_scan,
name="Thread-Configure",
args=(thread_args,))
target_device._abort_command_event.clear()
target_device._cmd_execution_state['configurescan'] = CmdExecState.RUNNING
target_device._cmd_duration_measured['configurescan'] = 0
target_device._command_thread['configurescan'].start()
message = "Configure command started"
self.logger.info(message)
return (ResultCode.STARTED, message)
def _configure_scan(self, input_arg, **args_dict):
"""
Thread target function invoked from Configure method.
It monitors the obsState value of each sub-array sub-component
configuring the scan, looking for timeout or failure conditions.
:param: input_arg: a list with two elements:
- the FQDNs of the sub-array sub-components
- the configuration string
If the CSP.LMC Subarray device is properly configured, the received
string passed as input argument of the command is stored the
class atribute _valid_scan_configuration.
:return: None
"""
target_device = self.target
self.logger.info("__configure scan started!!")
cmd_name = 'configurescan'
dev_successful_state = ObsState.READY
# tango_cmd_name: is the TANGO command name with the capital letter
# In the dictionary keys, is generally used the command name in lower letters
self.logger.info("cmd_name: {} dev_state: {}".format(cmd_name,
dev_successful_state))
command_start_time = time.time()
target_device._num_dev_completed_task[cmd_name] = 0
target_device._list_dev_completed_task[cmd_name] = []
target_device._cmd_progress[cmd_name] = 0
target_device._cmd_duration_measured[cmd_name] = 0
# flag to signal when configuration ends on a sub-array sub-component
device_done = defaultdict(lambda:False)
# inside the end-less lop check the obsState of each sub-component
device_list = input_arg[0]
self.logger.info("device_list:{}".format(device_list))
while True:
command_progress = 0
for device in device_list:
self.logger.info("Command {} obs_state: {}".format(cmd_name,
target_device._sc_subarray_obs_state[device]))
if device_done[device] == True:
continue
# if the sub-component execution flag is no more RUNNING, the command has
# ended with or without success. Go to check next device state.
if target_device._sc_subarray_obs_state[device] == dev_successful_state:
self.logger.info("Reconfiguring is:{}".format(target_device._reconfiguring))
if not target_device._reconfiguring:
self.logger.info("Command {} ended with success on device {}.".format(cmd_name,
device))
# update the list and number of device that completed the task
target_device._num_dev_completed_task[cmd_name] += 1
target_device._list_dev_completed_task[cmd_name].append(device)
# reset the value of the attribute reporting the execution state of
# the command
target_device._sc_subarray_cmd_exec_state[device][cmd_name] = CmdExecState.IDLE
target_device._sc_subarray_cmd_progress[device][cmd_name] = 100
# command success: step to next device
device_done[device] = True
# check for timeout event. A timeout event can be detected in two ways:
# 1- the sub-element implements the 'timeoutExpiredFlag' attribute configured
# for change event
# 2- the CspSubarray periodically checks the time elapsed from the start
# of the command: if the value is greater than the sub-element expected time
# for command execution, the sub-element command execution state is set
# to TIMEOUT
# Note: the second check, can be useful if the timeout event is not received
# (for example for a temporary connection timeout)
elapsed_time = time.time() - target_device._sc_subarray_cmd_starting_time[device]
self.logger.debug("elapsed_time:{}".format(elapsed_time))
if (elapsed_time > target_device._sc_subarray_cmd_duration_expected[device][cmd_name] or
target_device._sc_subarray_cmd_exec_state[device][cmd_name] == CmdExecState.TIMEOUT):
msg = ("Timeout executing {} command on device {}".format(cmd_name, device))
self.logger.warning(msg)
target_device._sc_subarray_cmd_exec_state[device][cmd_name] = CmdExecState.TIMEOUT
device_done[device] = True
self.logger.info("elapsed_time:{} device {}".format(elapsed_time, device))
# check if sub-element command ended throwing an exception: in this case the
# 'cmd_ended_cb' callback is invoked.
if target_device._sc_subarray_cmd_exec_state[device][cmd_name] == CmdExecState.FAILED or \
target_device._sc_subarray_obs_state[device] == ObsState.FAULT:
target_device._sc_subarray_cmd_exec_state[device][cmd_name] = CmdExecState.FAILED
# execution ended for this sub-element, skip to the next one
device_done[device] = True
# update the progress counter inside the loop taking into account the number of devices
# executing the command
command_progress += target_device._sc_subarray_cmd_progress[device][cmd_name]/len(device_list)
self.logger.debug("Command {} on device {} exec_state {}:".format(cmd_name,device,
target_device._sc_subarray_cmd_exec_state[device][cmd_name]))
target_device._cmd_progress[cmd_name] = command_progress
if any(target_device._sc_subarray_obs_state[device] == ObsState.CONFIGURING for device in device_list):
target_device._reconfiguring = False
self.logger.info("Reconfiguring is:{}".format(target_device._reconfiguring))
if all(value == True for value in device_done.values()):
self.logger.info("All devices have been handled!")
break
# check for global timeout expiration
# may be this check is not necessary
if target_device._cmd_duration_expected[cmd_name] < (time.time() - command_start_time):
target_device._timeout_expired = True
self.logger.warning("Device went in timeout during configuration")
break
# TODO:
# check for abort request.
self.logger.debug("Sleep for 0.1")
time.sleep(0.1)
# end of the while loop
# check for timeout/failure conditions on each sub-component
if any(target_device._sc_subarray_cmd_exec_state[device][cmd_name] == CmdExecState.TIMEOUT for device in device_list):
target_device._timeout_expired = True
if any(target_device._sc_subarray_cmd_exec_state[device][cmd_name] == CmdExecState.FAILED for device in device_list):
target_device._failure_raised = True
# reset sub-component execution flag
target_device._sc_subarray_cmd_exec_state[device][cmd_name] = CmdExecState.IDLE
self.logger.info("CspSubarray failure flag:{}".format(target_device._failure_raised))
self.logger.info("CspSubarray timeout flag:{}".format(target_device._timeout_expired))
if target_device._timeout_expired or target_device._failure_raised:
# if failure/timeout found check if the CBF subarray is configured. In
# this case the CSP.LMC Subarray obsState is set to READY.
if target_device._sc_subarray_obs_state[target_device.CbfSubarray] == ObsState.READY:
return target_device.configure_cmd_obj.succeeded()
else :
return target_device.configure_cmd_obj.failed()
#TODO:
# self.set_state(tango.DevState.FAULT)
#
if all(target_device._sc_subarray_obs_state[fqdn] == dev_successful_state for fqdn in device_list):
target_device._valid_scan_configuration = input_arg[1]
target_device._cmd_duration_measured[cmd_name] = time.time() - command_start_time
target_device._cmd_progress[cmd_name] = 100
target_device._last_executed_command = cmd_name
self.logger.info("Configure ends with success!!")
return target_device.configure_cmd_obj.succeeded()
else:
return target_device.configure_cmd_obj.failed()
def validate_scan_configuration(self, argin):
"""
This method is overwritten in each CspSubarray instance.
:param argin: the JSON string with scan configuration
:return: None
:raises: tango.DevFailed exception
"""
target_device = self.target
try:
json_dict = json.loads(argin)
if "id" not in json_dict:
msg = ("Command failed: No configuration ID in JSON object")
self.logger.error(msg)
tango.Except.throw_exception("Command failed",
msg,
"ConfigureScan execution",
tango.ErrSeverity.ERR)
self._configuration_id = json_dict["id"]
self.logger.info("Processing configuration {}".format(target_device._configuration_id))
except json.JSONDecodeError as e: # argument not a valid JSON object
# this is a fatal error
msg = ("Scan configuration object is not a valid JSON object."
"Aborting configuration:{}".format(str(e)))
self.logger.error(msg)
tango.Except.throw_exception("Command failed",
msg,
"ConfigureScan execution",
tango.ErrSeverity.ERR)
class ScanCommand(SKASubarray.ScanCommand):
def do(self, argin):
target_device = self.target
try:
target_device._scan_id = int(argin)
except (ValueError, Exception) as err:
msg = "Scan command invalid argument:{}".format(str(err))
self.logging.error(msg)
return (ResultCode.FAILED, msg)
# invoke the constructor for the command thread
self.logger.info("Received Scan command with id:{}".format(target_device._scan_id))
for device in target_device._sc_subarray_assigned_fqdn:
try:
proxy = target_device._sc_subarray_proxies[device]
if not target_device._sc_subarray_event_id[device]['scancmdprogress']:
evt_id = proxy.subscribe_event("scanCmdProgress",
tango.EventType.CHANGE_EVENT,
target_device._attributes_change_evt_cb,
stateless=False)
target_device._sc_subarray_event_id[device]['scancmdprogress'] = evt_id
except KeyError as key_err:
self.logger.warning("No key {} found".format(key_err))
except tango.DevFailed as tango_err:
self.logger.info(tango_err.args[0].desc)
try:
target_device._timeout_expired = False
target_device._failure_raised = False
proxy.command_inout_asynch("Scan", target_device._scan_id, target_device._cmd_ended_cb)
except tango.DevFailed as tango_err:
self.logger.info(tango_err.args[0].desc)
# TODO: add check on the failed device. If CBF
# throw an exception.
# invoke the constructor for the command thread
target_device._command_thread['scan'] = threading.Thread(target=self.__monitor_scan_execution,
name="Thread-Scan",
args=(target_device._sc_subarray_assigned_fqdn,))
target_device._cmd_execution_state['scan'] = CmdExecState.RUNNING
target_device._command_thread['scan'].start()
return (ResultCode.STARTED, "Scan command started")
def __monitor_scan_execution(self, device_list):
cmd_name = 'scan'
target_device = self.target
dev_successful_state = ObsState.READY
target_device._num_dev_completed_task[cmd_name] = 0
target_device._list_dev_completed_task[cmd_name] = []
target_device._cmd_progress[cmd_name] = 0
for device in device_list:
target_device._failure_message[cmd_name] = ''
target_device._sc_subarray_cmd_exec_state[device][cmd_name] = CmdExecState.RUNNING
self.logger.info("Device {} State {} expected value {}".format(device,
target_device._sc_subarray_obs_state[device],
dev_successful_state))
# flag to signal when configuration ends on a sub-array sub-component
device_done = defaultdict(lambda:False)
elapsed_time = 0
starting_time = time.time()
target_device._end_scan_event.clear()
# inside the end-less loop check the obsState of each sub-component
while True:
# Note: CbfSubarray changes the obsState value after forwarding the command
# (synchrnously) to FSP and VCC devices. This means that When the thread function enters,
# the loop, the obsState is still READY and the function exits immediately.
# Adding the wait delay here let the CbfSubarray to change the obsState and
# generate the event.
# Need to modify the CbfSubarray behavior
# TODO: add check of abort_command_event.
#if self._abort_command_event.is_set():
# dev_successful_state = ObsState.IDLE
#if self._end_scan_event.is_set() or self._abort_command_event.is_set():
for device in device_list:
if device_done[device] == True:
continue
# if the sub-component execution flag is no more RUNNING, the command has
# ended with or without success. Go to check next device state.
if target_device._sc_subarray_obs_state[device] == dev_successful_state:
self.logger.info("Command {} ended with success on device {}.".format(cmd_name,
device))
# update the list and number of device that completed the task
target_device._num_dev_completed_task[cmd_name] += 1
target_device._list_dev_completed_task[cmd_name].append(device)
# reset the value of the attribute reporting the execution state of
# the command
target_device._sc_subarray_cmd_exec_state[device][cmd_name] = CmdExecState.IDLE
target_device._sc_subarray_cmd_progress[device][cmd_name] = 100
# command success: step to next device
device_done[device] = True
# check if sub-element command ended throwing an exception: in this case the
# 'cmd_ended_cb' callback is invoked.
if target_device._sc_subarray_cmd_exec_state[device][cmd_name] == CmdExecState.FAILED or\
target_device._sc_subarray_obs_state[device] == ObsState.FAULT:
# execution ended for this sub-element, skip to the next one
target_device._failure_raised = True
device_done[device] = True
target_device._sc_subarray_cmd_exec_state[device][cmd_name] = CmdExecState.IDLE
# TODO: handle connection problems
#if target_device._sc_subarray_state[device] == DevState.UNKNOWN:
# self.logger.warning("Connection with device {} temporaly down".format(device))
if target_device._end_scan_event.is_set():
if any(device_done.values()) and all(value == True for value in device_done.values()):
self.logger.info("All devices have been handled!")
break
self.logger.info("Going to sleep")
time.sleep(0.1)
# end of the while loop
target_device._cmd_execution_state[cmd_name] = CmdExecState.IDLE
# check for timeout/failure conditions on each sub-component
if any(target_device._sc_subarray_cmd_exec_state[device][cmd_name] == CmdExecState.FAILED for device in device_list):
target_device._failure_raised = True
return target_device.scan_cmd_obj.failed()
# update the progress counter at the end of the loop
if all(target_device._sc_subarray_obs_state[fqdn] == dev_successful_state for fqdn in device_list):
target_device._cmd_progress[cmd_name] = 100
elapsed_time = time.time() - starting_time
self.logger.info("Scan elapsed time:{}".format(elapsed_time))
target_device._last_executed_command = cmd_name
return
class EndScanCommand(SKASubarray.EndScanCommand):
def do(self):
target_device = self.target
device_list = target_device._sc_subarray_assigned_fqdn
self.logger.info("EndScan assigned_fqdn: {}".format(device_list))
if not any(target_device._sc_subarray_assigned_fqdn):
# need to add a check also on PSTBeams belonging to subarray
device_list = target_device._sc_subarray_fqdn
try:
sc_group = tango.Group("EndScanGroup")
self.logger.info("Create group!!")
for device in device_list:
sc_group.add(device)
except Exception:
self.logger.error("TANGO Group command failed")
return (ResultCode.FAILED, "EndScan Command FAILED")
self.logger.info("Issue EndScan")
answers = sc_group.command_inout("EndScan")
target_device._end_scan_event.set()
self.logger.info("end scan set: {}".format(format(target_device._end_scan_event.is_set())))
for reply in answers:
if reply.has_failed():
for err in reply.get_err_stack():
self.logger.error("device {}: {}-{}".format(reply.dev_name(), err.desc, err.reason))
else:
(result_code,msg) = reply.get_data()
self.logger.error("device {}: {}".format(reply.dev_name(), msg))
if any(target_device._sc_subarray_obs_state[device]== ObsState.FAULT for device in device_list):
return (ResultCode.FAILED, "EndScan Command FAILED")
return (ResultCode.OK, "EndScan command executed OK")
class ObsResetCommand(SKASubarray.ObsResetCommand):
def do(self):
self.logger.info("Call ObsReset")
target_device = self.target
devices_to_reset = []
device_list = target_device._sc_subarray_assigned_fqdn
if not any(target_device._sc_subarray_assigned_fqdn):
# need to add a check also on PSTBeams belonging to subarray
device_list = target_device._sc_subarray_fqdn
for device in device_list:
if target_device._sc_subarray_obs_state[device] == ObsState.FAULT:
devices_to_reset.append(device)
self.logger.info("devices_to_reset:{}".format(devices_to_reset))
if not any(devices_to_reset):
return (ResultCode.OK, "ObsReset command OK")
for device in devices_to_reset:
try:
proxy = target_device._sc_subarray_proxies[device]
target_device._timeout_expired = False
target_device._failure_raised = False
proxy.command_inout_asynch("ObsReset", target_device._cmd_ended_cb)
except KeyError as key_err:
self.logger.warning("No key {} found".format(key_err))
except tango.DevFailed as tango_err:
self.logger.warning(tango_err.args[0].desc)
# TODO: address this case!
# signal the failure raising the failure flag?
target_device._command_thread['obsreset'] = threading.Thread(target=self._monitor_obsreset,
name="Thread-ObsReset",
args=(devices_to_reset,))
target_device._command_thread['obsreset'].start()
# set the threading endScan event
return (ResultCode.STARTED, "ObsReset command executed STARTED")
def _monitor_obsreset(self, device_list):
cmd_name = 'obsreset'
target_device = self.target
dev_successful_state = ObsState.IDLE
target_device._cmd_progress[cmd_name] = 0
device_done = defaultdict(lambda:False)
# inside the end-less loop check the obsState of each sub-component
self.logger.debug("device_list:{}".format(device_list))
while True:
self.logger.info("Going to sleep")
time.sleep(0.1)
for device in device_list:
if device_done[device] == True:
continue
# if the sub-component execution flag is no more RUNNING, the command has
# ended with or without success. Go to check next device state.
self.logger.info("device {} obs_state:{}".format(device, target_device._sc_subarray_obs_state[device]))
if target_device._sc_subarray_obs_state[device] == dev_successful_state:
self.logger.info("Command {} ended with success on device {}.".format(cmd_name,
device))
target_device._sc_subarray_cmd_exec_state[device][cmd_name] = CmdExecState.IDLE
target_device._sc_subarray_cmd_progress[device][cmd_name] = 100
# command success: step to next device
device_done[device] = True
# check if sub-element command ended throwing an exception: in this case the
# 'cmd_ended_cb' callback is invoked.
if target_device._sc_subarray_cmd_exec_state[device][cmd_name] == CmdExecState.FAILED or\
target_device._sc_subarray_obs_state[device] == ObsState.FAULT:
# execution ended for this sub-element, skip to the next one
target_device._failure_raised = True
device_done[device] = True
target_device._sc_subarray_cmd_exec_state[device][cmd_name] = CmdExecState.IDLE
if any(device_done.values()) and all(value == True for value in device_done.values()):
self.logger.info("All devices have been handled!")
break
# end of the while loop
# check for timeout/failure conditions on each sub-component
if target_device._failure_raised or target_device._timeout_expired:
return target_device.obsreset_cmd_obj.failed()
if all(target_device._sc_subarray_obs_state[fqdn] == dev_successful_state for fqdn in device_list):
target_device._cmd_progress[cmd_name] = 100
target_device._last_executed_command = cmd_name
self.logger.info("ObsReset ends with success")
return target_device.obsreset_cmd_obj.succeeded()
'''
class AbortCommand(SKASubarray.AbortCommand):
def do(self):
device = self.target
device_list = device._sc_subarray_assigned_fqdn
if not any(device._sc_subarray_assigned_fqdn):
# beed to add a check also on PSTBeams belonging to subarray
device_list = device._sc_subarray_fqdn
for fqdn in device_list:
try:
proxy = device._sc_subarray_proxies[fqdn]
proxy.command_inout_asynch("Abort", self._cmd_ended_cb)
except KeyError as key_err:
self.logger.warning("No key {} found".format(key_err))
device._sc_subarray_cmd_exec_state[fqdn]['abort'] = CmdExecState.FAILED
except tango.DevFailed as tango_err:
device._sc_subarray_cmd_exec_state[fqdn]['abort'] = CmdExecState.FAILED
self.logger.warning(tango_err.args[0].desc)
device._abort_command_event.set()
message = "Abort command completed OK"
self.logger.info(message)
return (ResultCode.OK, message)
class GoToIdleCommand(ActionCommand):
"""
A class for the CSPSubarray's GoToIdle() command.
"""
def __init__(self, target, state_model, logger=None):
super().__init__(
target, state_model, "goto_idle", start_action=True, logger=logger
)
def do(self):
"""
Stateless hook for GoToIdle() command functionality.
:return: A tuple containing a return code and a string
message indicating status. The message is for
information purpose only.
:rtype: (ResultCode, str)
"""
target_device = self.target
device_list = target_device._sc_subarray_assigned_fqdn
if not any(target_device._sc_subarray_assigned_fqdn):
# need to add a check also on PSTBeams belonging to subarray
device_list = target_device._sc_subarray_fqdn
for device in device_list:
# TODO: check if the device is running
# set to 3 sec. the duration expected
target_device._sc_subarray_cmd_duration_expected[device]['gotoidle'] = 3
target_device._cmd_duration_expected['gotoidle']
try:
proxy = target_device._sc_subarray_proxies[device]
# register the starting time for the command
target_device._sc_subarray_cmd_starting_time[device] = time.time()
target_device._timeout_expired = False
target_device._failure_raised = False
proxy.command_inout_asynch("GoToIdle", target_device._cmd_ended_cb)
# read the timeout attribute configured for this command
# if not implemented an AttributeError exception is thrown
# and the default value is used
target_device._sc_subarray_cmd_duration_expected[device]['gotoidle'] = proxy.gotoIdleCmdDurationExpected
except KeyError as key_err:
msg = "GoToIdle execution:no key {} found".format(str(key_err))
self.logger.warning(msg)
return (ResultCode.FAILED, msg)
except tango.DevFailed as tango_err:
msg = "GotToIdle execution: {}".format(tango_err.args[0].desc)
self.logger.warning(msg)
return (ResultCode.FAILED, msg)
except AttributeError as attr_err:
self.logger.info("Attribute {} not exported by device {}".format(str(attr_err),
device))
target_device._sc_subarray_cmd_exec_state[device]['gotoidle'] = CmdExecState.RUNNING
if target_device._sc_subarray_cmd_duration_expected[device]['gotoidle'] > target_device._cmd_duration_expected['gotoidle']:
target_device._cmd_duration_expected['gotoidle'] = target_device._sc_subarray_cmd_duration_expected[device]['gotoidle']
# invoke the constructor for the command thread
target_device._command_thread['gotoidle'] = threading.Thread(target=self._gotoidle,
name="Thread-GotoIdle",
args=(target_device._sc_subarray_assigned_fqdn,))
target_device._cmd_execution_state['gotoidle'] = CmdExecState.RUNNING
target_device._command_thread['gotoidle'].start()
# sleep for a while to let the thread start
#time.sleep(0.2)
# TODO:
# add some check on command exeuction: end state has to be IDLE for each
# sub-array sub-component
message = "GoToIdle command STARTED"
self.logger.info(message)
return (ResultCode.STARTED, message)
def _gotoidle(self, device_list, **args_dict):
"""
Thread target function invoked from GoToIdle method.
It monitors the obsState value of each sub-array sub-component
looking for timeout or failure conditions.
:param device_list: the FQDNs of the sub-array sub-components
:return: None
"""
target_device = self.target
cmd_name = 'gotoidle'
dev_successful_state = ObsState.IDLE
# tango_cmd_name: is the TANGO command name with the capital letter
# In the dictionary keys, is generally used the command name in lower letters
target_device._num_dev_completed_task[cmd_name] = 0
target_device._list_dev_completed_task[cmd_name] = []
target_device._cmd_progress[cmd_name] = 0
target_device._cmd_duration_measured[cmd_name] = 0
# sub-component command execution measured time
sc_cmd_duration_measured = defaultdict(lambda:defaultdict(lambda:0))
# loop on the devices and issue asynchrnously the Configure command
command_progress = target_device._cmd_progress[cmd_name]
# flag to signal when configuration ends on a sub-array sub-component
device_done = defaultdict(lambda:False)
# inside the end-less lop check the obsState of each sub-component
while True:
for device in device_list:
elapsed_time = time.time() - target_device._sc_subarray_cmd_starting_time[device]
sc_cmd_duration_measured[device][cmd_name] = elapsed_time
self.logger.debug("Command {} obs_state: {}".format(cmd_name,
target_device._sc_subarray_obs_state[device]))
if device_done[device] == True:
continue
# if the sub-component execution flag is no more RUNNING, the command has
# ended with or without success. Go to check next device state.
if target_device._sc_subarray_obs_state[device] == dev_successful_state:
self.logger.info("Command {} ended with success on device {}.".format(cmd_name,
device))
# update the list and number of device that completed the task
target_device._num_dev_completed_task[cmd_name] += 1
target_device._list_dev_completed_task[cmd_name].append(device)
# reset the value of the attribute reporting the execution state of
# the command
target_device._sc_subarray_cmd_exec_state[device][cmd_name] = CmdExecState.IDLE
target_device._sc_subarray_cmd_progress[device][cmd_name] = 100
# calculate the execution time for the command as the max value of all the execution times
if sc_cmd_duration_measured[device][cmd_name] >= target_device._cmd_duration_measured[cmd_name]:
target_device._cmd_duration_measured[cmd_name] = sc_cmd_duration_measured[device][cmd_name]
# command success: step to next device
device_done[device] = True
# check for timeout event. A timeout event can be detected in two ways:
# 1- the sub-element implements the 'onTimeoutExpired' attribute configured
# for change event
# 2- the CspMaster periodically checks the time elapsed from the start
# of the command: if the value is greater than the sub-element expected time
# for command execution, the sub-element command execution state is set
# to TIMEOUT
# Note: the second check, can be useful if the timeout event is not received
# (for example for a temporary connection timeout)
#elapsed_time = time.time() - self._sc_subarray_cmd_starting_time[device]
#sc_cmd_duration_measured[device][cmd_name] = elapsed_time
if (elapsed_time > target_device._sc_subarray_cmd_duration_expected[device][cmd_name] or
target_device._sc_subarray_cmd_exec_state[device][cmd_name] == CmdExecState.TIMEOUT):
msg = ("Timeout executing {} command on device {}".format(cmd_name, device))
self.logger.warning(msg)
target_device._sc_subarray_cmd_exec_state[device][cmd_name] = CmdExecState.TIMEOUT
device_done[device] = True
self.logger.info("elapsed_time:{} device {}".format(elapsed_time, device))
# check if sub-element command ended throwing an exception: in this case the
# 'cmd_ended_cb' callback is invoked.
if target_device._sc_subarray_cmd_exec_state[device][cmd_name] == CmdExecState.FAILED:
# execution ended for this sub-element, skip to the next one
device_done[device] = True
# update the progress counter inside the loop taking into account the number of devices
# executing the command
target_device._cmd_progress[cmd_name] = command_progress+ target_device._sc_subarray_cmd_progress[device][cmd_name]/len(device_list)
self.logger.debug("Command {} on device {} obsState {}:".format(cmd_name,device,
target_device._sc_subarray_cmd_exec_state[device][cmd_name]))
if all(value == True for value in device_done.values()):
self.logger.info("All devices have been handled!")
break
self.logger.info("Sleeping...")
time.sleep(0.1)
# end of the while loop
# check for timeout/failure conditions on each sub-component
for device in device_list:
self.logger.info("Device {} running state is : {}".format(device,
target_device._sc_subarray_cmd_exec_state[device][cmd_name]))
if target_device._sc_subarray_cmd_exec_state[device][cmd_name] == CmdExecState.TIMEOUT:
target_device._timeout_expired = True
if target_device._sc_subarray_cmd_exec_state[device][cmd_name] == CmdExecState.FAILED:
target_device._failure_raised = True
# reset sub-component execution flag
# update the progress counter at the end of the loop
target_device._cmd_progress[cmd_name] = command_progress + target_device._sc_subarray_cmd_progress[device][cmd_name]/len(device_list)
self.logger.info("1")
target_device._sc_subarray_cmd_exec_state[device][cmd_name] = CmdExecState.IDLE
if target_device._failure_raised or target_device._timeout_expired:
return target_device.gotoidle_cmd_obj.failed()
self.logger.info("2")
if all(target_device._sc_subarray_obs_state[fqdn] == dev_successful_state for fqdn in device_list):
target_device._last_executed_command = cmd_name
# reset the CSP Subarray command execution flag
target_device._cmd_execution_state[cmd_name] = CmdExecState.IDLE
return target_device.gotoidle_cmd_obj.succeeded()
def check_allowed(self):
"""
Whether this command is allowed to be run in current device
state
:return: True if this command is allowed to be run in
current device state
:rtype: boolean
:raises: DevFailed if this command is not allowed to be run
in current device state
"""
if self.state_model.dev_state == DevState.ON:
return True
msg = "GoToIdle not allowed in State {}".format(self.state_model.dev_state)
tango.Except.throw_exception("API_CommandFailed",
msg,
"GoToIdle",
tango.ErrSeverity.ERR)
#if not self.state_model.obs_state in [ObsState.READY]:
# msg = "GoToIdle not allowed in obsState {}".format(self.state_model.obs_state)
# tango.Except.throw_exception("API_CommandFailed",
# msg,
# "GoToIdle",
# tango.ErrSeverity.ERR)
'''
class GoToIdleCommand(SKASubarray.EndCommand):
def do(self):
target_device = self.target
device_list = target_device._sc_subarray_assigned_fqdn
if not any(target_device._sc_subarray_assigned_fqdn):
# need to add a check also on PSTBeams belonging to subarray
device_list = target_device._sc_subarray_fqdn
try:
self.logger.info("Creating group for GoToIdle {}".format(device_list))
sc_group = tango.Group("GoToIdleGroup")
for device in device_list:
sc_group.add(device)
except Exception:
self.logger.error("TANGO Group command failed")
return (ResultCode.FAILED, "GoToIDle Command FAILED")
self.logger.info("Issue GoToIdle")
answers = sc_group.command_inout("GoToIdle")
for reply in answers:
if reply.has_failed():
for err in reply.get_err_stack():
self.logger.error("device {}: {}-{}".format(reply.dev_name(), err.desc, err.reason))
else:
(result_code,msg) = reply.get_data()
self.logger.error("device {}: {}".format(reply.dev_name(), msg))
if any(target_device._sc_subarray_obs_state[device]== ObsState.FAULT for device in device_list):
return (ResultCode.FAILED, "GoToIdle Command FAILED")
return (ResultCode.OK, "GoToIdle command executed OK")
# PROTECTED REGION ID(CspSubarray.class_variable) ENABLED START #
# PROTECTED REGION END # // CspSubarray.class_variable
# !! NOTE !!:
# In methods and attributes of the class:
# 'sc' prefix stands for 'sub-component'
# 'cb' suffix stands for 'callback'
#----------------
# Event Callback functions
# ---------------
def _sc_scm_change_event_cb(self, evt):
"""
Class protected callback function.
Retrieve the values of the sub-array sub-component SCM attributes subscribed
at device connection.
Sub-array sub-components are:
- the CBF sub-array (assigned at initialization!)
- the PSS sub-array if SearchBeams are assigned to the sub-array
- the PSTBeams if TimingBeams are assigned to the sub-array
These values are used to report the whole Csp Subarray State and healthState.
:param evt: The event data
:return: None
"""
dev_name = evt.device.dev_name()
if not evt.err:
try:
if dev_name in self._sc_subarray_fqdn:
if evt.attr_value.name.lower() == "state":
self.logger.info("device: {} state value {}".format(dev_name,evt.attr_value.value))
self._sc_subarray_state[dev_name] = evt.attr_value.value
elif evt.attr_value.name.lower() == "healthstate":
self.logger.info("device: {} healthstate value {}".format(dev_name,evt.attr_value.value))
self._sc_subarray_health_state[dev_name] = evt.attr_value.value
elif evt.attr_value.name.lower() == "adminmode":
self.logger.info("device: {} adminMode value {}".format(dev_name,evt.attr_value.value))
self._sc_subarray_admin_mode[dev_name] = evt.attr_value.value
elif evt.attr_value.name.lower() == "obsstate":
self.logger.info("device: {} obsState value {}".format(dev_name,evt.attr_value.value ))
self._sc_subarray_obs_state[dev_name] = evt.attr_value.value
elif evt.attr_value.name.lower() == "obsmode":
self.logger.debug("device: {} obsMode value {}".format(dev_name, evt.attr_value.value ))
self._sc_subarray_obs_mode[dev_name] = evt.attr_value.value
else:
log_msg = ("Attribute {} not still "
"handled".format(evt.attr_name))
self.logger.warning(log_msg)
else:
log_msg = ("Unexpected change event for"
" attribute: {}".format(str(evt.attr_name)))
self.logger.warning(log_msg)
return
log_msg = "New value for {} is {}".format(str(evt.attr_name),
str(evt.attr_value.value))
self.logger.info(log_msg)
# update CSP sub-array SCM
#07-2020: with the new base classes, transitions are handled via actions.
#if evt.attr_value.name.lower() in ["state", "healthstate", "adminmode", "obsstate"]:
# self.update_subarray_state()
if evt.attr_value.name.lower() == "healthstate":
self._update_subarray_health_state()
except tango.DevFailed as df:
self.logger.error(str(df.args[0].desc))
except Exception as except_occurred:
self.logger.error(str(except_occurred))
else:
for item in evt.errors:
# API_EventTimeout: if sub-element device not reachable it transitions
# to UNKNOWN state.
if item.reason == "API_EventTimeout":
self.logger.info("API_EventTimeout")
# only if the device is ONLINE/MAINTENANCE, its State is set to
# UNKNOWN when there is a timeout on connection, otherwise its
# State should be reported always as DISABLE
if self._sc_subarray_admin_mode[dev_name] in [AdminMode.ONLINE,
AdminMode.MAINTENANCE]:
self._sc_subarray_state[dev_name] = tango.DevState.UNKNOWN
self._sc_subarray_health_state[dev_name] = HealthState.UNKNOWN
# TODO how report obsState?
# adminMode can't be change otherwise the State and healthState
# are note updated
# 07-2020
# Note: with new base classes transition are handled via actions. But here we
# have to be careful....need to review this part
# update the State and healthState of the CSP sub-array
#self.update_subarray_state()
log_msg = item.reason + ": on attribute " + str(evt.attr_name)
self.logger.warning(log_msg)
def _attributes_change_evt_cb(self, evt):
"""
*Class callback function.*
Retrieve the value of the sub-element xxxCommandProgress attribute
subscribed for change event when a long-running command is issued
on the sub-element device.
:param evt: The event data
:return: None
"""
dev_name = evt.device.dev_name()
if not evt.err:
try:
if "cmdprogress" == evt.attr_value.name.lower()[-11:]:
if dev_name in self._sc_subarray_fqdn:
cmd_name = evt.attr_value.name[:-15]
self._sc_subarray_cmd_progress[dev_name][cmd_name] = evt.attr_value.value
elif "timeoutexpiredflag" == evt.attr_value.name.lower():
if dev_name in self._sc_subarray_fqdn:
self._timeout_expired = True
else:
log_msg = ("Unexpected change event for"
" attribute: {}".format(str(evt.attr_name)))
self.logger.warning(log_msg)
return
log_msg = "New value for {} is {}".format(str(evt.attr_name),
str(evt.attr_value.value))
self.logger.info(log_msg)
except tango.DevFailed as df:
self.logger.error(str(df.args[0].desc))
except Exception as except_occurred:
self.logger.error(str(except_occurred))
else:
for item in evt.errors:
log_msg = item.reason + ": on attribute " + str(evt.attr_name)
self.logger.warning(log_msg)
def _cmd_ended_cb(self, evt):
"""
Callback function immediately executed when the asynchronous invoked
command returns.
:param evt: a CmdDoneEvent object. This class is used to pass data
to the callback method in asynchronous callback model for command
execution.
:type: CmdDoneEvent object
It has the following members:
- device : (DeviceProxy) The DeviceProxy object on which the
call was executed.
- cmd_name : (str) The command name
- argout_raw : (DeviceData) The command argout
- argout : The command argout
- err : (bool) A boolean flag set to true if the command
failed. False otherwise
- errors : (sequence) The error stack
- ext
:return: none
"""
# NOTE:if we try to access to evt.cmd_name or other paramters, sometime
# the callback crashes withthis error:
# terminate called after throwing an instance of 'boost::python::error_already_set'
try:
# Can happen evt empty??
if evt:
if not evt.err:
if evt.argout[0] == ResultCode.STARTED:
self.logger.info("Device {} is processing the command {}".format(evt.device.dev_name(),
evt.cmd_name))
if evt.argout[0] == ResultCode.OK:
self.logger.info("Device {} successfully processed the command {}".format(evt.device.dev_name(),
evt.cmd_name))
if evt.argout[0] == ResultCode.FAILED:
self.logger.info("Failure in Device {} while processing the command {}".format(evt.device.dev_name(),
evt.cmd_name))
self._sc_subarray_cmd_exec_state[evt.device.dev_name()][evt.cmd_name.lower()] = CmdExecState.FAILED
self.logger.info("sc_subarray_cmd_exec_state[{}][{}]:{}".format(evt.device.dev_name(), evt.cmd_name.lower(),
self._sc_subarray_cmd_exec_state[evt.device.dev_name()][evt.cmd_name.lower()]))
self._failure_message[evt.cmd_name.lower()] += evt.argout[1]
else:
msg = "Error!!Command {} ended on device {}.\n".format(evt.cmd_name,
evt.device.dev_name())
msg += " Desc: {}".format(evt.errors[0].desc)
self.logger.info(msg)
self._sc_subarray_cmd_exec_state[evt.device.dev_name()][evt.cmd_name.lower()] = CmdExecState.FAILED
self._failure_message[evt.cmd_name.lower()] += msg
# obsState and obsMode values take on the CbfSubarray's values via
# the subscribe/publish mechanism
else:
self.logger.error("cmd_ended callback: evt is empty!!")
except tango.DevFailed as df:
msg = ("CommandCallback cmd_ended failure - desc: {}"
" reason: {}".format(df.args[0].desc, df.args[0].reason))
self.logger.error(msg)
except Exception as ex:
msg = "CommandCallBack cmd_ended general exception: {}".format(str(ex))
self.logger.error(msg)
# Class protected methods
# ---------------
def update_subarray_state(self):
"""
Class protected method.
Retrieve the State attribute values of the CSP sub-elements and aggregate
them to build up the CSP global state.
:param: None
:return: None
"""
self._update_subarray_health_state()
if self._command_thread:
a = [self._command_thread[cmd_name].is_alive() for cmd_name in self._command_thread.keys()]
self.logger.info("list of running threds:{}".format(a))
if any(self._command_thread[cmd_name].is_alive() for cmd_name in self._command_thread.keys()):
self.logger.info("A command is already running...the obsState is not updated")
return False
# CSP state reflects the status of CBF. Only if CBF is present
# CSP can work. The state of PSS and PST sub-elements only contributes
# to determine the CSP health state.
if self._sc_subarray_state[self.CbfSubarray] == DevState.OFF:
if self._sc_subarray_obs_state[self.CbfSubarray] == ObsState.EMPTY:
self.off_cmd_obj.succeeded()
if self._sc_subarray_state[self.CbfSubarray] == DevState.ON:
if self._sc_subarray_obs_state[self.CbfSubarray] == ObsState.EMPTY:
self.on_cmd_obj.succeeded()
if self._sc_subarray_obs_state[self.CbfSubarray] == ObsState.READY:
self.configure_cmd_obj.succeeded()
#self.set_state(self._sc_subarray_state[self.CbfSubarray])
#self.logger.info("Csp subarray state: {} obsState: {}".format(self.get_state(), self.state_model._obs_state))
return True
def _update_subarray_health_state(self):
"""
Class protected method.
Retrieve the healthState attribute of the CSP sub-elements and
aggregate them to build up the CSP health state
:param: None
:return: None
"""
# if the Subarray is OFF (no assigned resources) or DISABLE,
# its health state is UNKNOWN.
# Note: when the Subarray adminMode is set OFFLINE/RESERVED/NOT_FITTED
# all its allocated resources are released and its State moves to DISABLE.
#
if self.get_state() in [tango.DevState.OFF, tango.DevState.DISABLE]:
self._health_state = HealthState.UNKNOWN
# The whole CspSubarray HealthState is OK if is ON and all its assigned sub-components
# (CBF and PSS subarrays as well PST Beams) are OK.
# - CbfSubarray ON (receptors/stations assigned)
# - PssSubarray ON
# default value to DEGRADED
self._health_state = HealthState.DEGRADED
# build the list of all the Csp Subarray sub-components ONLINE/MAINTENANCE
admin_fqdn = [fqdn for fqdn, admin_value in self._sc_subarray_admin_mode.items()
if admin_value in [AdminMode.ONLINE, AdminMode.MAINTENANCE]]
# build the list of sub-elements with State ON
state_fqdn = [fqdn for fqdn in admin_fqdn if self._sc_subarray_state[fqdn] == tango.DevState.ON]
# build the list with the healthState of ONLINE/MAINTENANCE devices
health_list = [self._sc_subarray_health_state[fqdn] for fqdn in state_fqdn]
if self.CbfSubarray in admin_fqdn:
if all(value == HealthState.OK for value in health_list):
self._health_state = HealthState.OK
elif self._sc_subarray_health_state[self.CbfSubarray] in [HealthState.FAILED,
HealthState.UNKNOWN,
HealthState.DEGRADED]:
self._health_state = self._sc_subarray_health_state[self.CbfSubarray]
else:
# if CBF Subarray is not ONLINE/MAINTENANCE ....
self._health_state = self._sc_subarray_health_state[self.CbfSubarray]
return
'''
def _update_subarray_obs_state(self):
"""
Class protected method.
Retrieve the State attribute values of the CSP sub-elements and aggregate
them to build up the CSP global state.
:param: None
:return: None
"""
# update the CspSubarray ObsMode only when no command is running on sub-array
# sub-components
exec_state_list = []
device_list = self._sc_subarray_fqdn
if not any(self._sc_subarray_assigned_fqdn):
for fqdn in self._sc_subarray_fqdn:
if self._sc_subarray_obs_state[fqdn] == ObsState.READY:
self._sc_subarray_assigned_fqdn.append(fqdn)
device_list = self._sc_subarray_assigned_fqdn
for fqdn in device_list:
device_exec_state_list = [value for value in self._sc_subarray_cmd_exec_state[fqdn].values()]
exec_state_list.extend(device_exec_state_list)
# when command are not running, the CbfSubarray osbState reflects the
# CSP Subarray obsState.
# If CbfSubarray obsState is READY and PssSubarray IDLE, the CspSubarray
# onsState is READY (it can performs IMAGING!)
if all(value == CmdExecState.IDLE for value in exec_state_list) or (not any(exec_state_list)):
self._obs_state = self._sc_subarray_obs_state[self.CbfSubarray]
self.logger.info("All sub-array sub-component are IDLE."
"Subarray obsState:{}".format( self._obs_state))
self.logger.info("Subarray ObsState:{}".format( self._obs_state))
'''
def _open_connection(self, fqdn):
device_proxy = DeviceProxy(fqdn)
return device_proxy
def _get_expected_delay(self, proxy,attr_name):
try:
attr_value = proxy.read_attribute(attr_name)
return attr_value.value()
except AttributeError as attr_err:
self.logger.info("No attribute {} on device {}".format(str(attr_err), proxy))
tango.Except.throw_exception("Attribute Error", str(attr_err), "", tango.ErrSeverity.ERR)
def connect_to_subarray_subcomponent(self, fqdn):
"""
Class method.
Establish a *stateless* connection with a CSP Subarray sub-component
device (CBF Subarray, PSS Subarray , PST Beams).
Exceptions are logged.
:param fqdn:
the CspSubarray sub-component FQDN
:return: None
"""
# check if the device has already been addedd
if fqdn in self._sc_subarray_fqdn:
return
# read the sub-componet adminMode (memorized) attribute from
# the CSP.LMC TANGO DB.
attribute_properties = self._csp_tango_db.get_device_attribute_property(fqdn,
{'adminMode': ['__value']})
self.logger.debug("fqdn: {} attribute_properties: {}".format(fqdn, attribute_properties))
try:
admin_mode_memorized = attribute_properties['adminMode']['__value']
self._sc_subarray_admin_mode[fqdn] = int(admin_mode_memorized[0])
except KeyError as key_error:
self.logger.warning("No key {} found".format(str(key_error)))
try:
log_msg = "Trying connection to " + str(fqdn) + " device"
self.logger.info(log_msg)
device_proxy = self._open_connection(fqdn)
self.logger.info("fqdn: {} device_proxy: {}".format(fqdn, device_proxy))
# Note: The DeviceProxy is initialized even if the sub-component
# device is not running (but defined into the TANGO DB! If not defined in the
# TANGO DB a exception is throw).
# The connection with a sub-element is establish as soon as the corresponding
# device starts.
# append the FQDN to the list and store the sub-element proxies
self._sc_subarray_fqdn.append(fqdn)
self._sc_subarray_proxies[fqdn] = device_proxy
# subscription of SCM attributes (State, healthState and adminMode).
# Note: subscription is performed also for devices not ONLINE or MAINTENANCE.
# In this way the CspMaster is able to detect a change in the admin value.
ev_id = device_proxy.subscribe_event("adminMode",
EventType.CHANGE_EVENT,
self._sc_scm_change_event_cb,
stateless=True)
self._sc_subarray_event_id[fqdn]['adminMode'] = ev_id
ev_id = device_proxy.subscribe_event("State",
EventType.CHANGE_EVENT,
self._sc_scm_change_event_cb,
stateless=True)
self._sc_subarray_event_id[fqdn]['state'] = ev_id
ev_id = device_proxy.subscribe_event("healthState",
EventType.CHANGE_EVENT,
self._sc_scm_change_event_cb,
stateless=True)
self._sc_subarray_event_id[fqdn]['healthState'] = ev_id
ev_id = device_proxy.subscribe_event("obsState",
EventType.CHANGE_EVENT,
self._sc_scm_change_event_cb,
stateless=True)
self._sc_subarray_event_id[fqdn]['obsState'] = ev_id
#ev_id = device_proxy.subscribe_event("obsMode",
# EventType.CHANGE_EVENT,
# self._sc_scm_change_event_cb,
# stateless=True)
#self._sc_subarray_event_id[fqdn]['obsMode'] = ev_id
except KeyError as key_err:
log_msg = ("No key {} found".format(str(key_err)))
self.logger.warning(log_msg)
except tango.DevFailed as df:
log_msg = ("Failure in connection to {}"
" device: {}".format(str(fqdn), str(df.args[0].desc)))
self.logger.error(log_msg)
def _is_sc_subarray_running (self, device_name):
"""
*Class protected method.*
Check if a sub-element is exported in the TANGO DB (i.e its TANGO
device server is running).
If the device is not in the list of the connected sub-elements,
a connection with the device is performed.
:param subelement_name : the FQDN of the sub-element
:type: `DevString`
:return: True if the connection with the subarray is established,
False otherwise
"""
try:
proxy = self._sc_subarray_proxies[device_name]
proxy.ping()
except KeyError as key_err:
# Raised when a mapping (dictionary) key is not found in the set
# of existing keys.
# no proxy registered for the subelement device
msg = "Can't retrieve the information of key {}".format(key_err)
self.logger.warning(msg)
try:
proxy = DeviceProxy(device_name)
# execute a ping to detect if the device is actually running
proxy.ping()
self._sc_subarray_proxies[device_name] = proxy
except tango.DevFailed as df:
return False
except tango.DevFailed as df:
msg = "Failure reason: {} Desc: {}".format(str(df.args[0].reason), str(df.args[0].desc))
self.logger.warning(msg)
return False
return True
def _is_subarray_composition_allowed(self):
if self.get_state() in [tango.DevState.ON, tango.DevState.OFF]:
return True
return False
def _is_subarray_configuring_allowed(self):
if self.get_state() == tango.DevState.ON:
return True
return False
def _push_event_on_obs_state(self,value):
self._obs_state = value
self.push_change_event("obsState", self._obs_state)
# ----------------
# Class private methods
# ----------------
def _init_state_model(self):
"""
Sets up the state model for the device
"""
self.state_model = CspSubarrayStateModel(
dev_state_callback=self._update_state,
)
def init_command_objects(self):
"""
Sets up the command objects
"""
super().init_command_objects()
args = (self, self.state_model, self.logger)
self.configure_cmd_obj = self.ConfigureCommand(*args)
self.off_cmd_obj = self.OffCommand(*args)
self.on_cmd_obj = self.OnCommand(*args)
self.scan_cmd_obj = self.ScanCommand(*args)
self.gotoidle_cmd_obj = self.GoToIdleCommand(*args)
self.obsreset_cmd_obj = self.ObsResetCommand(*args)
self.register_command_object("GoToIdle", self.GoToIdleCommand(*args))
self.register_command_object("Configure", self.ConfigureCommand(*args))
self.register_command_object("Scan", self.ScanCommand(*args))
self.register_command_object("ObsReset", self.ObsResetCommand(*args))
# ----------------
# Class Properties
# ----------------
PSTBeams = class_property(
dtype='DevVarStringArray',
)
# -----------------
# Device Properties
# -----------------
CspMaster = device_property(
dtype='DevString',
)
CbfSubarray = device_property(
dtype='DevString',
)
PssSubarray = device_property(
dtype='DevString',
)
SubarrayProcModeCorrelation = device_property(
dtype='DevString',
)
SubarrayProcModePss = device_property(
dtype='DevString',
)
SubarrayProcModePst = device_property(
dtype='DevString',
)
SubarrayProcModeVlbi = device_property(
dtype='DevString',
)
# ----------
# Attributes
# ----------
scanID = attribute(
dtype='DevULong64',
access=AttrWriteType.READ_WRITE,
)
procModeCorrelationAddr = attribute(
dtype='DevString',
label="Correlation Inherent Capability Address",
doc="The CSP sub-array Correlation Inherent Capability FQDN.",
)
procModePssAddr = attribute(
dtype='DevString',
label="PSS Inherent Capability address",
doc="The CSP sub-array PSS Inherent Capability FQDN.",
)
procModePstAddr = attribute(
dtype='DevString',
label="PST Inherent Capability address",
doc="The CSP sub-array PST Inherent Capability FQDN.",
)
procModeVlbiAddr = attribute(
dtype='DevString',
label="VLBI Inhernt Capabilityaddress",
doc="The CSP sub-array VLBI Inherent Capability FQDN.",
)
cbfSubarrayState = attribute(
dtype='DevState',
)
pssSubarrayState = attribute(
dtype='DevState',
)
cbfSubarrayHealthState = attribute(
dtype='DevEnum',
label="CBF Subarray Health State",
doc="CBF Subarray Health State",
enum_labels=["OK", "DEGRADED", "FAILED", "UNKNOWN", ],
)
pssSubarrayHealthState = attribute(
dtype='DevEnum',
label="PSS Subarray Health State",
doc="PSS Subarray Health State",
enum_labels=["OK", "DEGRADED", "FAILED", "UNKNOWN", ],
)
cbfSubarrayAdminMode = attribute(
dtype='DevEnum',
label="CBF Subarray Admin Mode",
doc="CBF Subarray Admin Mode",
enum_labels=["ON-LINE", "OFF-LINE", "MAINTENANCE", "NOT-FITTED", "RESERVED",],
)
pssSubarrayAdminMode = attribute(
dtype='DevEnum',
label="PSS Subarray Admin Mode",
doc="PSS Subarray Admin Mode",
enum_labels=["ON-LINE", "OFF-LINE", "MAINTENANCE", "NOT-FITTED", "RESERVED",],
)
cbfSubarrayObsState = attribute(
dtype='DevEnum',
label="CBF Subarray Observing State",
doc="The CBF subarray observing state.",
enum_labels=["IDLE", "CONFIGURING", "READY", "SCANNING", "PAUSED", "ABORTED", "FAULT",],
)
pssSubarrayObsState = attribute(
dtype='DevEnum',
label="PSS Subarray Observing State",
doc="The PSS subarray observing state.",
enum_labels=["IDLE", "CONFIGURING", "READY", "SCANNING", "PAUSED", "ABORTED", "FAULT",],
)
pssSubarrayAddr = attribute(
dtype='DevString',
label="PSS sub-array address",
doc="The PSS sub-element sub-array FQDN.",
)
cbfSubarrayAddr = attribute(
dtype='DevString',
label="CBF sub-array address",
doc="The CBF sub-element sub-array FQDN.",
)
validScanConfiguration = attribute(
dtype='DevString',
label="Valid Scan Configuration",
doc="Store the last valid scan configuration.",
)
addSearchBeamsDurationExpected = attribute(
dtype='DevUShort',
access=AttrWriteType.READ_WRITE,
label="AddSearchBeams command duration expected",
doc="The duration expected (in sec) for the AddSearchBeams command.",
)
remSearchBeamsDurationExpected = attribute(
dtype='DevUShort',
access=AttrWriteType.READ_WRITE,
label="RemoveSearchBeams command duration expected",
doc="The duration expected (in sec) for the RemoveSearchBeams command.",
)
addSearchBeamsDurationMeasured = attribute(
dtype='DevUShort',
label="AddSearchBeams command duration measured",
doc="The duration measured (in sec) for the AddSearchBeams command.",
)
remSearchBeamsDurationMeasured = attribute(
dtype='DevUShort',
label="RemoveSearchBeams command duration measured",
doc="The duration measured (in sec) for the RemoveSearchBeams command.",
)
addTimingBeamsDurationExpected = attribute(
dtype='DevUShort',
access=AttrWriteType.READ_WRITE,
label="AddTimingBeams command duration expected",
doc="The duration expected (in sec) for the AddTimingBeams command.",
)
remTimingBeamsDurationExpected = attribute(
dtype='DevUShort',
access=AttrWriteType.READ_WRITE,
label="RemoveTimingBeams command duration expected",
doc="The duration expected (in sec) for the RemoveTimingBeams command.",
)
addTimingBeamsDurationMeasured = attribute(
dtype='DevUShort',
label="AddTimingBeams command duration measured",
doc="The duration measured (in sec) for the AddTimingBeams command.",
)
remTimingBeamsDurationMeasured = attribute(
dtype='DevUShort',
label="GoToIdle command duration measured",
doc="The duration measured (in sec) for the RemoveTimingBeams command.",
)
goToIdleDurationExpected = attribute(
dtype='DevUShort',
access=AttrWriteType.READ_WRITE,
label="GoToIdle command duration expected",
doc="The duration expected (in sec) for the GoToIdle command.",
)
goToIdleDurationMeasured = attribute(
dtype='DevUShort',
label="GoToIdle command duration measured",
doc="The duration measured (in sec) for the GoToIdle command.",
)
goToIdleCmdProgress = attribute(
dtype='DevUShort',
label="GoToIdle command progress percentage",
polling_period=1500,
abs_change=5,
doc="The progress percentage for the GoToIdle command.",
)
endScanDurationExpected = attribute(
dtype='DevUShort',
label="EndScan command duration expected",
doc="The duration expected (in sec) for the EndScan command.",
)
endScanDurationMeasured = attribute(
dtype='DevUShort',
label="EndScan command duration measured",
doc="The duration measured (in sec) for the EndScan command.",
)
endScanCmdProgress = attribute(
dtype='DevUShort',
label="EndScan command progress percentage",
polling_period=1500,
abs_change=5,
doc="The progress percentage for the EndScan command.",
)
addResourcesCmdProgress = attribute(
dtype='DevUShort',
label="Add resources command progress percentage",
polling_period=1500,
abs_change=5,
doc="The progress percentage for the Add resources command.",
)
removeResourcesCmdProgress = attribute(
dtype='DevUShort',
label="Remove resources command progress percentage",
polling_period=1500,
abs_change=5,
doc="The progress percentage for the Add/SearchBeams command.",
)
scanCmdProgress = attribute(
dtype='DevUShort',
label="Scan command progress percentage",
polling_period=1500,
abs_change=5,
doc="The progress percentage for the Scan command.",
)
reservedSearchBeamNum = attribute(
dtype='DevUShort',
label="Number of reserved SearchBeam IDs",
doc="Number of SearchBeam IDs reserved for the CSP sub-array",
)
numOfDevCompletedTask = attribute(
dtype='DevUShort',
label="Number of devices that completed the task",
doc="Number of devices that completed the task",
)
timeoutExpiredFlag = attribute(
dtype='DevBoolean',
label="CspSubarray command execution timeout flag",
polling_period=1000,
doc="The timeout flag for a CspSubarray command.",
)
failureRaisedFlag = attribute(
dtype='DevBoolean',
label="CspSubarray failure flag",
polling_period=1000,
doc="The failure flag for a CspSubarray command.",
)
cmdFailureMessage = attribute(
dtype='DevString',
label="The failure message",
doc="The failure message on command execution",
)
isCmdInProgress = attribute(
dtype='DevBoolean',
)
configurationID = attribute(
dtype='DevString',
label="Configuration ID",
doc="The configuration identifier (string)",
)
pstOutputLink = attribute(
dtype='DevString',
label="PST output link",
doc="The output link for PST products.",
)
assignedSearchBeamIDs = attribute(
dtype=('DevUShort',),
max_dim_x=1500,
label="List of assigned Search Beams",
doc="List of assigned Search Beams",
)
reservedSearchBeamIDs = attribute(
dtype=('DevUShort',),
max_dim_x=1500,
label="List of reserved SearchBeam IDs",
doc="List of SearchBeam IDs reserved for the CSP sub-array",
)
assignedTimingBeamIDs = attribute(
dtype=('DevUShort',),
max_dim_x=16,
label="List of assigned TimingBeam IDs",
doc="List of TimingBeam IDs assigned to the CSP sub-array",
)
assignedVlbiBeamIDs = attribute(
dtype=('DevUShort',),
max_dim_x=20,
label="List of assigned VlbiBeam IDs",
doc="List of VlbiBeam IDs assigned to the CSP sub-array",
)
assignedSearchBeamsState = attribute(
dtype=('DevState',),
max_dim_x=1500,
label="Assigned SearchBeams State",
doc="State of the assigned SearchBeams",
)
assignedTimingBeamsState = attribute(
dtype=('DevState',),
max_dim_x=16,
label="Assigned TimingBeams State",
doc="State of the assigned TimingBeams",
)
assignedVlbiBeamsState = attribute(
dtype=('DevState',),
max_dim_x=20,
label="Assigned VlbiBeams State",
doc="State of the assigned VlbiBeams",
)
assignedSearchBeamsHealthState = attribute(
dtype=('DevUShort',),
max_dim_x=1500,
label="Assigned SearchBeams HealthState",
doc="HealthState of the assigned SearchBeams",
)
assignedTimingBeamsHealthState = attribute(
dtype=('DevUShort',),
max_dim_x=16,
label="Assigned TimingBeams HealthState",
doc="HealthState of the assigned TimingBeams",
)
assignedVlbiBeamsHealthState = attribute(
dtype=('DevUShort',),
max_dim_x=20,
label="Assigned VlbiBeams HealthState",
doc="HealthState of the assigned VlbiBeams",
)
assignedSearchBeamsObsState = attribute(
dtype=('DevUShort',),
max_dim_x=1500,
label="Assigned SearchBeams ObsState",
doc="ObsState of the assigned SearchBeams",
)
assignedTimingBeamsObsState = attribute(
dtype=('DevUShort',),
max_dim_x=16,
label="Assigned TimingBeams ObsState",
doc="ObsState of the assigned TimingBeams",
)
assignedVlbiBeamsObsState = attribute(
dtype=('DevUShort',),
max_dim_x=20,
label="Assigned VlbiBeams ObsState",
doc="ObsState of the assigned VlbiBeams",
)
assignedSearchBeamsAdminMode = attribute(
dtype=('DevUShort',),
max_dim_x=1500,
label="Assigned SearchBeams AdminMode",
doc="AdminMode of the assigned SearchBeams",
)
assignedTimingBeamsAdminMode = attribute(
dtype=('DevUShort',),
max_dim_x=16,
label="Assigned TimingBeams AdminMode",
doc="AdminMode of the assigned TimingBeams",
)
assignedVlbiBeamsAdminMode = attribute(
dtype=('DevUShort',),
max_dim_x=20,
label="Assigned VlbiBeams AdminMode",
doc="AdminMode of the assigned VlbiBeams",
)
pstBeams = attribute(
dtype=('DevString',),
max_dim_x=16,
label="PSTBeams addresses",
doc="PST sub-element PSTBeam TANGO device FQDNs.",
)
listOfDevCompletedTask = attribute(
dtype=('DevString',),
max_dim_x=100,
label="List of devices that completed the task",
doc="List of devices that completed the task",
)
# ---------------
# General methods
# ---------------
def always_executed_hook(self):
"""Method always executed before any TANGO command is executed."""
# PROTECTED REGION ID(CspSubarray.always_executed_hook) ENABLED START #
# PROTECTED REGION END # // CspSubarray.always_executed_hook
def delete_device(self):
"""Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command.
"""
# PROTECTED REGION ID(CspSubarray.delete_device) ENABLED START #
#release the allocated event resources
event_to_remove = {}
for fqdn in self._sc_subarray_fqdn:
try:
event_to_remove[fqdn] = []
for attr_name, event_id in self._sc_subarray_event_id[fqdn].items():
try:
# self._se_subarray_event_id[fqdn].remove(event_id)
# in Pyton3 can't remove the element from the list while looping on it.
# Store the unsubscribed events in a temporary list and remove them later.
if event_id:
self._sc_subarray_proxies[fqdn].unsubscribe_event(event_id)
event_to_remove[fqdn].append(attr_name)
except tango.DevFailed as df:
msg = ("Unsubscribe event failure.Reason: {}. "
"Desc: {}".format(df.args[0].reason, df.args[0].desc))
self.logger.error(msg)
except KeyError as key_err:
# NOTE: in PyTango unsubscription of a not-existing event id raises a
# KeyError exception not a DevFailed!!
msg = "Unsubscribe event failure. Reason: {}".format(str(key_err))
self.logger.error(msg)
# remove the attribute entry from the fqdn dictionary
for attr_name in event_to_remove[fqdn]:
del self._sc_subarray_event_id[fqdn][attr_name]
# check if there are still some registered events. What to do in this case??
if not self._sc_subarray_event_id[fqdn]:
# remove the dictionary element when the fqdn dictionary is
# empty
self._sc_subarray_event_id.pop(fqdn)
else:
msg = "Still subscribed events: {} for device {}".format(self._sc_subarray_event_id[fqdn], fqdn)
self.logger.warning(msg)
except KeyError as key_err:
msg = " Can't retrieve the information of key {}".format(key_err)
self.logger.err(msg)
# clear the subarrays list and dictionary
self._sc_subarray_fqdn.clear()
self._sc_subarray_proxies.clear()
# PROTECTED REGION END # // CspSubarray.delete_device
# ------------------
# Attributes methods
# ------------------
def read_scanID(self):
# PROTECTED REGION ID(CspSubarray.scanID_read) ENABLED START #
"""Return the scanID attribute."""
return self._scan_id
# PROTECTED REGION END # // CspSubarray.scanID_read
def write_scanID(self, value):
# PROTECTED REGION ID(CspSubarray.scanID_write) ENABLED START #
"""Set the scanID attribute."""
self._scan_id = value
# PROTECTED REGION END # // CspSubarray.scanID_write
def read_procModeCorrelationAddr(self):
# PROTECTED REGION ID(CspSubarray.procModeCorrelationAddr_read) ENABLED START #
"""Return the procModeCorrelationAddr attribute."""
return self.SubarrayProcModeCorrelation
# PROTECTED REGION END # // CspSubarray.corrInherentCapAddr_read
def read_procModePssAddr(self):
# PROTECTED REGION ID(CspSubarray.procModePssAddr_read) ENABLED START #
"""Return the procModePssAddr attribute."""
return self.SubarrayProcModePss
# PROTECTED REGION END # // CspSubarray.pssInherentCapAddr_read
def read_procModePstAddr(self):
# PROTECTED REGION ID(CspSubarray.procModePstAdd_read) ENABLED START #
"""Return the procModePstAddr( attribute."""
return self.SubarrayProcModePst
# PROTECTED REGION END # // CspSubarray.procModePsstdd_read
def read_procModeVlbiAddr(self):
# PROTECTED REGION ID(CspSubarray.procModeVlbiAdd_read) ENABLED START #
"""Return the procModeVlbiAddr attribute."""
return self.SubarrayProcModeVlbi
# PROTECTED REGION END # // CspSubarray.procModeVlbiAdd_read
def read_cbfSubarrayState(self):
# PROTECTED REGION ID(CspSubarray.cbfSubarrayState_read) ENABLED START #
"""Return the cbfSubarrayState attribute."""
return self._sc_subarray_state[self.CbfSubarray]
# PROTECTED REGION END # // CspSubarray.cbfSubarrayState_read
def read_pssSubarrayState(self):
# PROTECTED REGION ID(CspSubarray.pssSubarrayState_read) ENABLED START #
"""Return the pssSubarrayState attribute."""
return self._sc_subarray_state[self.PssSubarray]
# PROTECTED REGION END # // CspSubarray.pssSubarrayState_read
def read_cbfSubarrayHealthState(self):
# PROTECTED REGION ID(CspSubarray.cbfSubarrayHealthState_read) ENABLED START #
"""Return the cbfSubarrayHealthState attribute."""
return self._sc_subarray_health_state[self.CbfSubarray]
# PROTECTED REGION END # // CspSubarray.cbfSubarrayHealthState_read
def read_pssSubarrayHealthState(self):
# PROTECTED REGION ID(CspSubarray.pssSubarrayHealthState_read) ENABLED START #
"""Return the pssSubarrayHealthState attribute."""
return self._sc_subarray_health_state[self.PssSubarray]
# PROTECTED REGION END # // CspSubarray.pssSubarrayHealthState_read
def read_cbfSubarrayAdminMode(self):
# PROTECTED REGION ID(CspSubarray.cbfSubarrayHealthState_read) ENABLED START #
"""Return the cbfSubarrayHealthState attribute."""
return self._sc_subarray_admin_mode[self.CbfSubarray]
# PROTECTED REGION END # // CspSubarray.cbfSubarrayHealthState_read
def read_pssSubarrayAdminMode(self):
# PROTECTED REGION ID(CspSubarray.pssSubarrayHealthState_read) ENABLED START #
"""Return the pssSubarrayHealthState attribute."""
return self._sc_subarray_admin_mode[self.PssSubarray]
# PROTECTED REGION END # // CspSubarray.pssSubarrayHealthState_read
def read_cbfSubarrayObsState(self):
# PROTECTED REGION ID(CspSubarray.cbfSubarrayObsState_read) ENABLED START #
"""Return the cbfSubarrayObsState attribute."""
return self._sc_subarray_obs_state[self.CbfSubarray]
# PROTECTED REGION END # // CspSubarray.cbfSubarrayObsState_read
def read_pssSubarrayObsState(self):
# PROTECTED REGION ID(CspSubarray.pssSubarrayObsState_read) ENABLED START #
"""Return the pssSubarrayObsState attribute."""
return self._sc_subarray_obs_state[self.PssSubarray]
# PROTECTED REGION END # // CspSubarray.pssSubarrayObsState_read
def read_pssSubarrayAddr(self):
# PROTECTED REGION ID(CspSubarray.pssSubarrayAddr_read) ENABLED START #
"""Return the pssSubarrayAddr attribute."""
return self.PssSubarray
# PROTECTED REGION END # // CspSubarray.pssSubarrayAddr_read
def read_cbfSubarrayAddr(self):
# PROTECTED REGION ID(CspSubarray.cbfSubarrayAddr_read) ENABLED START #
"""Return the cbfSubarrayAddr attribute."""
return self.CbfSubarray
# PROTECTED REGION END # // CspSubarray.cbfSubarrayAddr_read
def read_validScanConfiguration(self):
# PROTECTED REGION ID(CspSubarray.validScanConfiguration_read) ENABLED START #
"""Return the validScanConfiguration attribute."""
return self._valid_scan_configuration
# PROTECTED REGION END # // CspSubarray.validScanConfiguration_read
def read_addSearchBeamsDurationExpected(self):
# PROTECTED REGION ID(CspSubarray.addSearchBeamsDurationExpected_read) ENABLED START #
"""Return the addSearchBeamsDurationExpected attribute."""
return self._cmd_duration_expected['addsearchbeams']
# PROTECTED REGION END # // CspSubarray.addSearchBeamsDurationExpected_read
def write_addSearchBeamsDurationExpected(self, value):
# PROTECTED REGION ID(CspSubarray.addSearchBeamsDurationExpected_write) ENABLED START #
"""Set the addSearchBeamsDurationExpected attribute."""
self._cmd_duration_expected['addsearchbeams'] = value
# PROTECTED REGION END # // CspSubarray.addSearchBeamDurationExpected_write
def read_remSearchBeamsDurationExpected(self):
# PROTECTED REGION ID(CspSubarray.remSearchBeamsDurationExpected_read) ENABLED START #
"""Return the remSearchBeamsDurationExpected attribute."""
return self._cmd_duration_expected['removesearchbeams']
# PROTECTED REGION END # // CspSubarray.remSearchBeamsDurationExpected_read
def write_remSearchBeamsDurationExpected(self, value):
# PROTECTED REGION ID(CspSubarray.remSearchBeamsDurationExpected_write) ENABLED START #
"""Set the remSearchBeamsDurationExpected attribute."""
self._cmd_duration_expected['removesearchbeams'] = value
# PROTECTED REGION END # // CspSubarray.remSearchBeamsDurationExpected_write
def read_addSearchBeamsDurationMeasured(self):
# PROTECTED REGION ID(CspSubarray.addSearchBeamsDurationMeasured_read) ENABLED START #
"""Return the addSearchBeamsDurationMeasured attribute."""
return self._cmd_duration_measured['addsearchbeams']
# PROTECTED REGION END # // CspSubarray.addSearchBeamsDurationMeasured_read
def read_remSearchBeamsDurationMeasured(self):
# PROTECTED REGION ID(CspSubarray.remSearchBeamsDurationMeasured_read) ENABLED START #
"""Return the remSearchBeamsDurationMeasured attribute."""
return self._cmd_duration_measured['removesearchbeams']
# PROTECTED REGION END # // CspSubarray.remSearchBeamsDurationMeasured_read
def read_addTimingBeamsDurationExpected(self):
# PROTECTED REGION ID(CspSubarray.addTimingBeamsDurationExpected_read) ENABLED START #
"""Return the addTimingBeamsDurationExpected attribute."""
return self._cmd_duration_expected['addtimingbeams']
# PROTECTED REGION END # // CspSubarray.addTimingBeamsDurationExpected_read
def write_addTimingBeamsDurationExpected(self, value):
# PROTECTED REGION ID(CspSubarray.addTimingBeamsDurationExpected_write) ENABLED START #
"""Set the addTimingBeamsDurationExpected attribute."""
self._cmd_duration_expected['addtimingbeams'] = value
# PROTECTED REGION END # // CspSubarray.addTimingBeamsDurationExpected_write
def read_remTimingBeamsDurationExpected(self):
# PROTECTED REGION ID(CspSubarray.remTimingBeamsDurationExpected_read) ENABLED START #
"""Return the remTimingBeamsDurationExpected attribute."""
return self._cmd_duration_expected['removetimingbeams']
# PROTECTED REGION END # // CspSubarray.remTimingBeamsDurationExpected_read
def write_remTimingBeamsDurationExpected(self, value):
# PROTECTED REGION ID(CspSubarray.remTimingBeamsDurationExpected_write) ENABLED START #
"""Set the remTimingBeamsDurationExpected attribute."""
self._cmd_duration_expected['removetimingbeams'] = value
# PROTECTED REGION END # // CspSubarray.remTimingBeamsDurationExpected_write
def read_addTimingBeamsDurationMeasured(self):
# PROTECTED REGION ID(CspSubarray.addTimingBeamsDurationMeasured_read) ENABLED START #
"""Return the addTimingBeamDurationMeasured attribute."""
return self._cmd_duration_measured['addtimingbeams']
# PROTECTED REGION END # // CspSubarray.addTimingBeamsDurationMeasured_read
def read_remTimingBeamsDurationMeasured(self):
# PROTECTED REGION ID(CspSubarray.remTimingBeamsDurationMeasured_read) ENABLED START #
"""Return the remTimingBeamsDurationMeasured attribute."""
return self._cmd_duration_measured['removetimingbeams']
# PROTECTED REGION END # // CspSubarray.remTimingBeamsDurationMeasured_read
def read_addResourcesCmdProgress(self):
# PROTECTED REGION ID(CspSubarray.searchBeamsCmdProgress_read) ENABLED START #
"""Return the assResourcesCmdProgress attribute."""
return self._cmd_progress['addbeams']
# PROTECTED REGION END # // CspSubarray.searchBeamsCmdProgress_read
def read_goToIdleDurationExpected(self):
# PROTECTED REGION ID(CspSubarray.goToIdleDurationExpected_read) ENABLED START #
"""Return the goToIdleDurationExpected attribute."""
return self._cmd_duration_expected['gotoidle']
# PROTECTED REGION END # // CspSubarray.goToIdleDurationExpected_read
def write_goToIdleDurationExpected(self, value):
# PROTECTED REGION ID(CspSubarray.goToIdleDurationExpected_write) ENABLED START #
"""Set the goToIdleDurationExpected attribute."""
self._cmd_duration_expected['gotoidle'] = value
# PROTECTED REGION END # // CspSubarray.endSBDurationExpected_write
def read_goToIdleDurationMeasured(self):
# PROTECTED REGION ID(CspSubarray.goToIdleDurationMeasured_read) ENABLED START #
"""Return the goToIdleDurationMeasured attribute."""
return self._cmd_duration_measured['gotoidle']
# PROTECTED REGION END # // CspSubarray.goToIdleDurationMeasured_read
def read_endScanDurationExpected(self):
# PROTECTED REGION ID(CspSubarray.endScanDurationExpected_read) ENABLED START #
"""Return the endScanDurationExpected attribute."""
return self._cmd_duration_expected['endscan']
# PROTECTED REGION END # // CspSubarray.endScanDurationExpected_read
def read_endScanDurationMeasured(self):
# PROTECTED REGION ID(CspSubarray.endScanDurationMeasured_read) ENABLED START #
"""Return the endScanDurationMeasured attribute."""
return self._cmd_duration_measured['endscan']
# PROTECTED REGION END # // CspSubarray.endScanDurationMeasured_read
def read_removeResourcesCmdProgress(self):
# PROTECTED REGION ID(CspSubarray.removeResourcesCmdProgress_read) ENABLED START #
"""Return the removeResourcesCmdProgress attribute."""
return 0
# PROTECTED REGION END # // CspSubarray.removeResourcesCmdProgress_read
def read_goToIdleCmdProgress(self):
# PROTECTED REGION ID(CspSubarray.goToIdleCmdProgress_read) ENABLED START #
"""Return the goToIdleCmdProgress attribute."""
return self._cmd_progress['gotoidle']
# PROTECTED REGION END # // CspSubarray.goToIdleCmdProgress_read
def read_endScanCmdProgress(self):
# PROTECTED REGION ID(CspSubarray.endScanCmdProgress_read) ENABLED START #
"""Return the endScanCmdProgress attribute."""
return self._cmd_progress['endscan']
# PROTECTED REGION END # // CspSubarray.endScanCmdProgress_read
def read_reservedSearchBeamNum(self):
# PROTECTED REGION ID(CspSubarray.reservedSearchBeamNum_read) ENABLED START #
"""Return the reservedSearchBeamNum attribute."""
return 0
# PROTECTED REGION END # // CspSubarray.reservedSearchBeamNum_read
def read_numOfDevCompletedTask(self):
# PROTECTED REGION ID(CspSubarray.numOfDevCompletedTask_read) ENABLED START #
"""Return the numOfDevCompletedTask attribute."""
return self._num_dev_completed_task[self._last_executed_command]
# PROTECTED REGION END # // CspSubarray.numOfDevCompletedTask_read
def read_assignedSearchBeamIDs(self):
# PROTECTED REGION ID(CspSubarray.assignedSearchBeamIDs_read) ENABLED START #
"""Return the assignedSearchBeamIDs attribute."""
return (0,)
# PROTECTED REGION END # // CspSubarray.assignedSearchBeamIDs_read
def read_reservedSearchBeamIDs(self):
# PROTECTED REGION ID(CspSubarray.reservedSearchBeamIDs_read) ENABLED START #
"""Return the reservedSearchBeamIDs attribute."""
return (0,)
# PROTECTED REGION END # // CspSubarray.reservedSearchBeamIDs_read
def read_assignedTimingBeamIDs(self):
# PROTECTED REGION ID(CspSubarray.assignedTimingBeamIDs_read) ENABLED START #
"""Return the assignedTimingBeamIDs attribute."""
return (0,)
# PROTECTED REGION END # // CspSubarray.assignedTimingBeamIDs_read
def read_assignedVlbiBeamIDs(self):
# PROTECTED REGION ID(CspSubarray.assignedVlbiBeamIDs_read) ENABLED START #
"""Return the assignedVlbiBeamIDs attribute."""
return (0,)
# PROTECTED REGION END # // CspSubarray.assignedVlbiBeamIDs_read
def read_assignedSearchBeamsState(self):
# PROTECTED REGION ID(CspSubarray.assignedSearchBeamsState_read) ENABLED START #
"""Return the assignedSearchBeamsState attribute."""
return (tango.DevState.UNKNOWN,)
# PROTECTED REGION END # // CspSubarray.assignedSearchBeamsState_read
def read_assignedTimingBeamsState(self):
# PROTECTED REGION ID(CspSubarray.assignedTimingBeamsState_read) ENABLED START #
"""Return the assignedTimingBeamsState attribute."""
return (tango.DevState.UNKNOWN,)
# PROTECTED REGION END # // CspSubarray.assignedTimingBeamsState_read
def read_assignedVlbiBeamsState(self):
# PROTECTED REGION ID(CspSubarray.assignedVlbiBeamsState_read) ENABLED START #
"""Return the assignedVlbiBeamsState attribute."""
return (tango.DevState.UNKNOWN,)
# PROTECTED REGION END # // CspSubarray.assignedVlbiBeamsState_read
def read_assignedSearchBeamsHealthState(self):
# PROTECTED REGION ID(CspSubarray.assignedSearchBeamsHealthState_read) ENABLED START #
"""Return the assignedSearchBeamsHealthState attribute."""
return (0,)
# PROTECTED REGION END # // CspSubarray.assignedSearchBeamsHealthState_read
def read_assignedTimingBeamsHealthState(self):
# PROTECTED REGION ID(CspSubarray.assignedTimingBeamsHealthState_read) ENABLED START #
"""Return the assignedTimingBeamsHealthState attribute."""
return (0,)
# PROTECTED REGION END # // CspSubarray.assignedTimingBeamsHealthState_read
def read_assignedVlbiBeamsHealthState(self):
# PROTECTED REGION ID(CspSubarray.assignedVlbiBeamsHealthState_read) ENABLED START #
"""Return the assignedVlbiBeamsHealthState attribute."""
return (0,)
# PROTECTED REGION END # // CspSubarray.assignedVlbiBeamsHealthState_read
def read_assignedSearchBeamsObsState(self):
# PROTECTED REGION ID(CspSubarray.assignedSearchBeamsObsState_read) ENABLED START #
"""Return the assignedSearchBeamsObsState attribute."""
return (0,)
# PROTECTED REGION END # // CspSubarray.assignedSearchBeamsObsState_read
def read_assignedTimingBeamsObsState(self):
# PROTECTED REGION ID(CspSubarray.assignedTimingBeamsObsState_read) ENABLED START #
"""Return the assignedTimingBeamsObsState attribute."""
return (0,)
# PROTECTED REGION END # // CspSubarray.assignedTimingBeamsObsState_read
def read_assignedVlbiBeamsObsState(self):
# PROTECTED REGION ID(CspSubarray.assignedVlbiBeamsObsState_read) ENABLED START #
"""Return the assignedVlbiBeamsObsState attribute."""
return (0,)
# PROTECTED REGION END # // CspSubarray.assignedVlbiBeamsObsState_read
def read_assignedSearchBeamsAdminMode(self):
# PROTECTED REGION ID(CspSubarray.assignedSearchBeamsAdminMode_read) ENABLED START #
"""Return the assignedSearchBeamsAdminMode attribute."""
return (0,)
# PROTECTED REGION END # // CspSubarray.assignedSearchBeamsAdminMode_read
def read_assignedTimingBeamsAdminMode(self):
# PROTECTED REGION ID(CspSubarray.assignedTimingBeamsAdminMode_read) ENABLED START #
"""Return the assignedTimingBeamsAdminMode attribute."""
return (0,)
# PROTECTED REGION END # // CspSubarray.assignedTimingBeamsAdminMode_read
def read_assignedVlbiBeamsAdminMode(self):
# PROTECTED REGION ID(CspSubarray.assignedVlbiBeamsAdminMode_read) ENABLED START #
"""Return the assignedVlbiBeamsAdminMode attribute."""
return (0,)
# PROTECTED REGION END # // CspSubarray.assignedVlbiBeamsAdminMode_read
def read_pstBeams(self):
# PROTECTED REGION ID(CspSubarray.pstBeams_read) ENABLED START #
"""Return the pstBeams attribute."""
return self.PSTBeams
# PROTECTED REGION END # // CspSubarray.pstBeams_read
def read_scanCmdProgress(self):
# PROTECTED REGION ID(CspSubarray.scanCmdProgress_read) ENABLED START #
"""Return the scanCmdProgress attribute."""
return self._cmd_progress['scan']
# PROTECTED REGION END # // CspSubarray.scanCmdProgress_read
def read_timeoutExpiredFlag(self):
# PROTECTED REGION ID(CspSubarray.timeoutExpiredFlag_read) ENABLED START #
"""Return the timeoutExpiredFlag attribute."""
return self._timeout_expired
# PROTECTED REGION END # // CspSubarray.cmdTimeoutExpired_read
def read_failureRaisedFlag(self):
# PROTECTED REGION ID(CspSubarray.failureRaisedFlag_read) ENABLED START #
"""Return the failureRaisedFlag attribute."""
return self._failure_raised
# PROTECTED REGION END # // CspSubarray.cmdAlarmRaised_read
def read_isCmdInProgress(self):
# PROTECTED REGION ID(CspSubarray.isCmdInProgress_read) ENABLED START #
"""Return the isCmdInProgress attribute."""
if all(value == CmdExecState.IDLE for value in self._cmd_execution_state.values()):
return False
return True
# PROTECTED REGION END # // CspSubarray.isCmdInProgress_read
def read_cmdFailureMessage(self):
# PROTECTED REGION ID(CspSubarray.cmdFailureMessage_read) ENABLED START #
"""Return the cmdFailureMessage attribute."""
return self._failure_message[self._last_executed_command]
# PROTECTED REGION END # // CspSubarray.cmdFailureMessage_read
def read_pstOutputLink(self):
# PROTECTED REGION ID(CspSubarray.pstOutputLink_read) ENABLED START #
"""Return the pstOutputLink attribute."""
return ''
# PROTECTED REGION END # // CspSubarray.pstOutputLink_read
def read_listOfDevCompletedTask(self):
# PROTECTED REGION ID(CspSubarray.listOfDevCompletedTask_read) ENABLED START #
"""Return the listOfDevCompletedTask attribute."""
self._list_dev_completed_task[self._last_executed_command]
# PROTECTED REGION END # // CspSubarray.listOfDevCompletedTask_read
def read_configurationID(self):
# PROTECTED REGION ID(CspSubarray.configurationID_read) ENABLED START #
"""Return the configurationID attribute."""
return self._configuration_id
# PROTECTED REGION END # // CspSubarray.configurationID_read
# --------
# Commands
# --------
@command(
dtype_in='DevString',
dtype_out='DevVarLongStringArray',
)
@DebugIt()
def Scan(self, argin):
# PROTECTED REGION ID(CspSubarray.Scan) ENABLED START #
"""
Starts the scan.
:param argin: the scanID number.
:type: 'DevVarStringArray'
:return: 'DevVarLongStringArray'
"""
self.logger.info("Call Scan command")
handler = self.get_command_object("Scan")
(result_code, message) = handler(argin)
return [[result_code], [message]]
# PROTECTED REGION END # // CspSubarray.Scan
@command(
dtype_in='DevString',
doc_in="A Json-encoded string with the scan configuration.",
dtype_out='DevVarLongStringArray',
doc_out="(ReturnType, 'informational message')",
)
@DebugIt()
def Configure(self, argin):
"""
*TANGO Class method*
Configure a scan for the subarray.\n
The command can be execuced when the CspSubarray State is *ON* and the \
ObsState is *IDLE* or *READY*.\n
If the configuration for the scan is not correct (invalid parameters or invalid JSON)\
the configuration is not applied and the ObsState of the CspSubarray remains IDLE.
:param argin: a JSON-encoded string with the parameters to configure a scan.
:return: None
:raises:
tango.DevFailed exception if the CspSubarray ObsState is not valid or if an exception\
is caught during command execution.
"""
self.logger.info("Call Configure command")
handler = self.get_command_object("Configure")
(result_code, message) = handler(argin)
return [[result_code], [message]]
@command(
dtype_out='DevVarLongStringArray',
doc_out="(ReturnType, 'informational message')",
)
@DebugIt()
def GoToIdle(self):
# PROTECTED REGION ID(CspSubarray.GoToIdle) ENABLED START #
"""
Set the subarray obsState to IDLE.
:return: None
"""
self.logger.info("Call GoToIdle command")
handler = self.get_command_object("GoToIdle")
(result_code, message) = handler()
return [[result_code], [message]]
# PROTECTED REGION END # // CspSubarray.GoToIdle
'''
@command(
dtype_out='DevVarLongStringArray',
)
@DebugIt()
def EndScan(self):
# PROTECTED REGION ID(CspSubarray.EndScan) ENABLED START #
"""
*Class method*
End the execution of a running scan. After successful execution, the CspSubarray \
*ObsState* is IDLE.
:raises: *tango.DevFailed* if the subarray *obsState* is not SCANNING or if an exception
is caught during the command execution.
"""
# PROTECTED REGION END # // CspSubarray.EndScan
@command(
dtype_in='DevUShort',
doc_in="The number of SearchBeams Capabilities to assign to the subarray.",
)
@DebugIt()
@ObsStateCheck('addresources')
@SubarrayRejectCmd('RemoveSearchBeams',
'RemoveNumOfSearchBeams',
'Configure')
def AddNumOfSearchBeams(self, argin):
# PROTECTED REGION ID(CspSubarray.AddNumOfSearchBeams) ENABLED START #
self._cmd_execution_state['addsearchbeams'] = CmdExecState.RUNNING
# connect to CspMaster and check if enough beams are available
# forward the command to PSS
# wait for PSS number of assigned pipelines == number of required beams
# get the PSS beams IDs
# if map exists, retrieve the SearchBeam IDs
# get the corresponding SearchBeams FQDNs
# open proxies to devices
# subscribe SearchBeams attributes
self._cmd_execution_state['addsearchbeams'] = CmdExecState.RUNNING
# PROTECTED REGION END # // CspSubarray.AddNumOfSearchBeams
pass
@AdminModeCheck('RemoveNumOfSearchBeams')
def is_RemoveNumOfSearchBeams_allowed(self):
return self._is_subarray_composition_allowed()
@command(
dtype_in='DevUShort',
doc_in="The number of SearchBeam Capabilities to remove from the \nCSP sub-array.\nAll the assigned SearcBbeams are removed from the CSP sub-array if the\ninput number is equal to the max number of SearchBeam \nCapabilities for the specified Csp sub-array instance (1500 for MID,\n500 for LOW)",
)
@DebugIt()
@ObsStateCheck('removeresources')
@SubarrayRejectCmd('AddSearchBeams', 'Configure')
def RemoveNumOfSearchBeams(self, argin):
# PROTECTED REGION ID(CspSubarray.RemoveNumOfSearchBeams) ENABLED START #
"""
Remove the specified number of SearchBeam Capabilities from the subarray.
:param argin: The number of SearchBeam Capabilities to remove from the \
CSP sub-array. All the assigned SearcBbeams are removed from the CSP \
sub-array if the input number is equal to the max number of SearchBeam \
Capabilities for the specified Csp sub-array instance (1500 for MID, 500 for LOW)
:type: 'DevUShort'
:return: None
"""
self._cmd_execution_state['removesearchbeams'] = CmdExecState.RUNNING
# PROTECTED REGION END # // CspSubarray.RemoveNumOfSearchBeams
@AdminModeCheck('AddTimingBeams')
def is_AddTimingBeams_allowed(self):
return self._is_subarray_composition_allowed()
@command(
dtype_in='DevVarUShortArray',
doc_in="The list of TimingBeam Capability IDs to assign to the CSP sub-array.",
)
@DebugIt()
@ObsStateCheck('addresources')
@SubarrayRejectCmd('RemoveTimingBeams', 'Configure')
def AddTimingBeams(self, argin):
# PROTECTED REGION ID(CspSubarray.AddTimingBeams) ENABLED START #
"""
Add the specified TimingBeam Capability IDs to the CSP sub-array.
:param argin: the list of TimingBeam Capability IDs to assign to the CSP sub-array.
:type: 'DevVarUShortArray'
:return: None
"""
# read the CSP Master list of CSP TimingBeams addresses
# get the CSP TimingBeams addresses from IDs
# map timing beams ids to PST Beams ids
# write the CSP TimingBeams membership
# get the PSTBeams addresses
self._cmd_execution_state['addtimingbeams'] = CmdExecState.RUNNING
pass
# PROTECTED REGION END # // CspSubarray.AddTimingBeams
@AdminModeCheck('AddSearchBeams')
def is_AddSearchBeams_allowed(self):
return self._is_subarray_composition_allowed()
@command(
dtype_in='DevVarUShortArray',
doc_in="The list of SearchBeam Capability IDs to assign to the CSP sub-array.",
)
@DebugIt()
@ObsStateCheck('addresources')
@SubarrayRejectCmd('RemoveSearchBeams', 'Configure')
def AddSearchBeams(self, argin):
# PROTECTED REGION ID(CspSubarray.AddSearchBeams) ENABLED START #
"""
Add the specified SeachBeam Capability IDs o the CSP sub-array.
:param argin: the list of SearchBeam Capability IDs to assign to the\
CSP sub-array.
:param argintype: 'DevVarUShortArray'
:return: None
"""
# read the CSP Master list of CSP SearchBeams addresses
# get the CSP SearchBeams addresses from IDs
# map search beams ids to PSS beams IDs
# issue the AddSearchBeams command on PSS sub-array
# wait until PSS list of beams is equal to the sent one
self._cmd_execution_state['addsearchbeams'] = CmdExecState.RUNNING
pass
# PROTECTED REGION END # // CspSubarray.AddSearchBeams
@AdminModeCheck('RemoveSearchBeams')
def is_RemoveSearchBeams_allowed(self):
return self._is_subarray_composition_allowed()
@command(
dtype_in='DevVarUShortArray',
doc_in="The list of SearchBeam Capability IDs to remove from the CSP sub-array.",
)
@DebugIt()
@ObsStateCheck('removeresources')
@SubarrayRejectCmd('AddSearchBeams', 'Configure')
def RemoveSearchBeamsID(self, argin):
# PROTECTED REGION ID(CspSubarray.RemoveSearchBeamsID) ENABLED START #
"""
Remove the specified Search Beam Capability IDs from the CSP sub-array.
:param argin: the list of SearchBeam Capability IDs to remove from the\
CSP sub-array.
:type: 'DevVarUShortArray'
:return:None
"""
self._cmd_execution_state['removesearchbeams'] = CmdExecState.RUNNING
pass
# PROTECTED REGION END # // CspSubarray.RemoveSearchBeamsID
@AdminModeCheck('RemoveTimingBeams')
def is_RemoveTimingBeams_allowed(self):
return self._is_subarray_composition_allowed()
@command(
dtype_in='DevVarUShortArray',
doc_in="The list of Timing Beams IDs to remove from the sub-array.",
)
@DebugIt()
@ObsStateCheck('removeresources')
@SubarrayRejectCmd('AddTimingBeams', 'Configure')
def RemoveTimingBeams(self, argin):
# PROTECTED REGION ID(CspSubarray.RemoveTimingBeams) ENABLED START #
"""
Remove the specified Timing Beams from the sub-array.
:param argin: the list of Timing Beams IDs to remove from the sub-array.
:type: 'DevVarUShortArray'
:return: None
"""
self._cmd_execution_state['removetimingbeams'] = CmdExecState.RUNNING
# PROTECTED REGION END # // CspSubarray.RemoveTimingBeams
@command(
dtype_out='DevVarLongStringArray',
doc_out="(ReturnType, 'informational message')",
)
@DebugIt()
def Abort(self):
# PROTECTED REGION ID(CspSubarray.Abort) ENABLED START #
"""
Change obsState to ABORTED.
:return:'DevVarLongStringArray'
"""
handler = self.get_command_object("Abort")
(result_code, message) = handler()
return [[result_code], [message]]
# PROTECTED REGION END # // CspSubarray.Abort
'''
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
# PROTECTED REGION ID(CspSubarray.main) ENABLED START #
return run((CspSubarray,), args=args, **kwargs)
# PROTECTED REGION END # // CspSubarray.main
if __name__ == '__main__':
main()
CspSubarrayInherentCapability.py 0000664 0000000 0000000 00000010122 13707315520 0033732 0 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/csp_lmc_common # -*- coding: utf-8 -*-
#
# This file is part of the CspSubarrayInherentCapability project
#
# INAF, SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
""" CSP Subarray Inherent Capability Base Class
Parent class for the CSP Subarray Processing Mode Capability devices.
Used as a base for developement of CSP Inherent Capabilities.
"""
# PROTECTED REGION ID (CspSubarrayInherentCapability.standardlibray_import) ENABLED START #
# Python standard library
import sys
import os
# PROTECTED REGION END# //CspSubarrayInherentCapability.standardlibray_import
# PyTango imports
import tango
from tango import DebugIt
from tango.server import run
from tango.server import Device
from tango.server import attribute, command
#from tango.server import device_property
from tango import AttrQuality, DispLevel, DevState
from tango import AttrWriteType, PipeWriteType
# Additional import
# PROTECTED REGION ID(CspSubarrayInherentCapability.additionnal_import) ENABLED START #
#
from ska.base import SKACapability
from ska.base import utils
#
# PROTECTED REGION END # // CspSubarrayInherentCapability.additionnal_import
__all__ = ["CspSubarrayInherentCapability", "main"]
class CspSubarrayInherentCapability(SKACapability):
"""
Parent class for the CSP Subarray Processing Mode Capability devices.
Used as a base for developement of CSP Inherent Capabilities.
**Properties:**
- Device Property
"""
# PROTECTED REGION ID(CspSubarrayInherentCapability.class_variable) ENABLED START #
# PROTECTED REGION END # // CspSubarrayInherentCapability.class_variable
# -----------------
# Device Properties
# -----------------
# ----------
# Attributes
# ----------
# ---------------
# General methods
# ---------------
def init_device(self):
"""Initialises the attributes and properties of the CspSubarrayInherentCapability."""
SKACapability.init_device(self)
# PROTECTED REGION ID(CspSubarrayInherentCapability.init_device) ENABLED START #
# PROTECTED REGION END # // CspSubarrayInherentCapability.init_device
def always_executed_hook(self):
"""Method always executed before any TANGO command is executed."""
# PROTECTED REGION ID(CspSubarrayInherentCapability.always_executed_hook) ENABLED START #
# PROTECTED REGION END # // CspSubarrayInherentCapability.always_executed_hook
def delete_device(self):
"""Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command.
"""
# PROTECTED REGION ID(CspSubarrayInherentCapability.delete_device) ENABLED START #
# PROTECTED REGION END # // CspSubarrayInherentCapability.delete_device
# ------------------
# Attributes methods
# ------------------
# --------
# Commands
# --------
@command(
)
@DebugIt()
def On(self):
# PROTECTED REGION ID(CspSubarrayInherentCapability.On) ENABLED START #
"""
Enable the CSP Subarray inherent Capability setting its State to ON.
State at initialization is OFF
:return:None
"""
pass
# PROTECTED REGION END # // CspSubarrayInherentCapability.On
@command(
)
@DebugIt()
def Off(self):
# PROTECTED REGION ID(CspSubarrayInherentCapability.Off) ENABLED START #
"""
Disable the CspSubarray inherent Capability
setting the State to OFF.
:return:None
"""
pass
# PROTECTED REGION END # // CspSubarrayInherentCapability.Off
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
# PROTECTED REGION ID(CspSubarrayInherentCapability.main) ENABLED START #
return run((CspSubarrayInherentCapability,), args=args, **kwargs)
# PROTECTED REGION END # // CspSubarrayInherentCapability.main
if __name__ == '__main__':
main()
CspSubarrayProcModeCorrelation.py 0000664 0000000 0000000 00000007047 13707315520 0034102 0 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/csp_lmc_common # -*- coding: utf-8 -*-
#
# This file is part of the CspSubarrayProcModeCorrelation project
#
# INAF-SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
""" CSP Subarray Processing Mode Correlation Capability
The class exposes parameters nd commands required for monitor and
control of the correlator functions for a single subarray.
It is used as a base for the development of LOW and MID specific
capabilities.
"""
# PROTECTED REGION ID (CspSubarrayProcModeCorrelation.standardlibray_import) ENABLED START #
# Python standard library
import sys
import os
# PROTECTED REGION END# //CspSubarrayIProcModeCorrelation.standardlibray_import
# PyTango imports
import tango
from tango import DebugIt
from tango.server import run
from tango.server import Device
from tango.server import attribute, command
from tango.server import device_property
from tango import AttrQuality, DispLevel, DevState
from tango import AttrWriteType, PipeWriteType
# Additional import
# PROTECTED REGION ID(CspSubarrayProcModeCorrelation.additionnal_import) ENABLED START #
from .CspSubarrayInherentCapability import CspSubarrayInherentCapability
# PROTECTED REGION END # // CspSubarrayProcModeCorrelation.additionnal_import
__all__ = ["CspSubarrayProcModeCorrelation", "main"]
class CspSubarrayProcModeCorrelation(CspSubarrayInherentCapability):
"""
The class exposes parameters nd commands required for monitor and
control of the correlator functions for a single subarray.
It is used as a base for the development of LOW and MID specific
capabilities.
**Properties:**
- Device Property
"""
# PROTECTED REGION ID(CspSubarrayProcModeCorrelation.class_variable) ENABLED START #
# PROTECTED REGION END # // CspSubarrayProcModeCorrelation.class_variable
# -----------------
# Device Properties
# -----------------
# ----------
# Attributes
# ----------
# ---------------
# General methods
# ---------------
def init_device(self):
"""Initialises the attributes and properties of the CspSubarrayProcModeCorrelation."""
CspSubarrayInherentCapability.init_device(self)
# PROTECTED REGION ID(CspSubarrayProcModeCorrelation.init_device) ENABLED START #
# PROTECTED REGION END # // CspSubarrayProcModeCorrelation.init_device
def always_executed_hook(self):
"""Method always executed before any TANGO command is executed."""
# PROTECTED REGION ID(CspSubarrayProcModeCorrelation.always_executed_hook) ENABLED START #
# PROTECTED REGION END # // CspSubarrayProcModeCorrelation.always_executed_hook
def delete_device(self):
"""Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command.
"""
# PROTECTED REGION ID(CspSubarrayProcModeCorrelation.delete_device) ENABLED START #
# PROTECTED REGION END # // CspSubarrayProcModeCorrelation.delete_device
# ------------------
# Attributes methods
# ------------------
# --------
# Commands
# --------
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
# PROTECTED REGION ID(CspSubarrayProcModeCorrelation.main) ENABLED START #
return run((CspSubarrayProcModeCorrelation,), args=args, **kwargs)
# PROTECTED REGION END # // CspSubarrayProcModeCorrelation.main
if __name__ == '__main__':
main()
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/csp_lmc_common/CspSubarrayProcModePss.py 0000664 0000000 0000000 00000006614 13707315520 0032444 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
#
# This file is part of the CspSubarrayProcModePss project
#
# INAF-SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
""" CSP Subarray PSS Capability
The class exposes parameters and commands required
for monitor and control of the Procesing Mode PSS in a
single subarray.
It is used as base for developement of LOW and MID
specific capabilities.
"""
# PROTECTED REGION ID (CspSubarrayProcModePss.standardlibray_import) ENABLED START #
# Python standard library
import sys
import os
# PROTECTED REGION END# //CspSubarrayIProcModePss.standardlibray_import
# PyTango imports
import tango
from tango import DebugIt
from tango.server import run
from tango.server import Device
from tango.server import attribute, command
from tango.server import device_property
from tango import AttrQuality, DispLevel, DevState
from tango import AttrWriteType, PipeWriteType
# Additional import
# PROTECTED REGION ID(CspSubarrayProcModePss.additionnal_import) ENABLED START #
from .CspSubarrayInherentCapability import CspSubarrayInherentCapability
# PROTECTED REGION END # // CspSubarrayProcModePss.additionnal_import
__all__ = ["CspSubarrayProcModePss", "main"]
class CspSubarrayProcModePss(CspSubarrayInherentCapability):
"""
The class exposes parameters and commands required
for monitor and control of the Procesing Mode PSS in a
single subarray.
It is used as base for developement of LOW and MID
specific capabilities.
**Properties:**
- Device Property
"""
# PROTECTED REGION ID(CspSubarrayProcModePss.class_variable) ENABLED START #
# PROTECTED REGION END # // CspSubarrayProcModePss.class_variable
# -----------------
# Device Properties
# -----------------
# ----------
# Attributes
# ----------
# ---------------
# General methods
# ---------------
def init_device(self):
"""Initialises the attributes and properties of the CspSubarrayProcModePss."""
CspSubarrayInherentCapability.init_device(self)
# PROTECTED REGION ID(CspSubarrayProcModePss.init_device) ENABLED START #
# PROTECTED REGION END # // CspSubarrayProcModePss.init_device
def always_executed_hook(self):
"""Method always executed before any TANGO command is executed."""
# PROTECTED REGION ID(CspSubarrayProcModePss.always_executed_hook) ENABLED START #
# PROTECTED REGION END # // CspSubarrayProcModePss.always_executed_hook
def delete_device(self):
"""Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command.
"""
# PROTECTED REGION ID(CspSubarrayProcModePss.delete_device) ENABLED START #
# PROTECTED REGION END # // CspSubarrayProcModePss.delete_device
# ------------------
# Attributes methods
# ------------------
# --------
# Commands
# --------
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
# PROTECTED REGION ID(CspSubarrayProcModePss.main) ENABLED START #
return run((CspSubarrayProcModePss,), args=args, **kwargs)
# PROTECTED REGION END # // CspSubarrayProcModePss.main
if __name__ == '__main__':
main()
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/csp_lmc_common/CspSubarrayProcModePst.py 0000664 0000000 0000000 00000006601 13707315520 0032441 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
#
# This file is part of the CspSubarrayProcModePst project
#
# INAF-SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
""" CSP Subarray PST Capability
The class exposes parameters and commands required
for monitor and control of the Procesing Mode PST in a
single subarray.
It is used as base for developement of LOW and MID
specific capabilities.
"""
# PROTECTED REGION ID (CspSubarrayProcModePst.standardlibray_import) ENABLED START #
# Python standard library
import sys
import os
# PROTECTED REGION END# //CspSubarrayIProcModePst.standardlibray_import
# PyTango imports
import tango
from tango import DebugIt
from tango.server import run
from tango.server import Device
from tango.server import attribute, command
from tango.server import device_property
from tango import AttrQuality, DispLevel, DevState
from tango import AttrWriteType, PipeWriteType
# Additional import
# PROTECTED REGION ID(CspSubarrayProcModePst.additionnal_import) ENABLED START #
from .CspSubarrayInherentCapability import CspSubarrayInherentCapability
# PROTECTED REGION END # // CspSubarrayProcModePst.additionnal_import
__all__ = ["CspSubarrayProcModePst", "main"]
class CspSubarrayProcModePst(CspSubarrayInherentCapability):
"""
The class exposes parameters and commands required
for monitor and control of the Procesing Mode PST in a
single subarray.
It is used as base for developement of LOW and MID
specific capabilities.
**Properties:**
- Device Property
"""
# PROTECTED REGION ID(CspSubarrayProcModePst.class_variable) ENABLED START #
# PROTECTED REGION END # // CspSubarrayProcModePst.class_variable
# -----------------
# Device Properties
# -----------------
# ----------
# Attributes
# ----------
# ---------------
# General methods
# ---------------
def init_device(self):
"""Initialises the attributes and properties of the CspSubarrayProcModePst."""
CspSubarrayInherentCapability.init_device(self)
# PROTECTED REGION ID(CspSubarrayProcModePst.init_device) ENABLED START #
# PROTECTED REGION END # // CspSubarrayProcModePst.init_device
def always_executed_hook(self):
"""Method always executed before any TANGO command is executed."""
# PROTECTED REGION ID(CspSubarrayProcModePst.always_executed_hook) ENABLED START #
# PROTECTED REGION END # // CspSubarrayProcModePst.always_executed_hook
def delete_device(self):
"""Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command.
"""
# PROTECTED REGION ID(CspSubarrayProcModePst.delete_device) ENABLED START #
# PROTECTED REGION END # // CspSubarrayProcModePst.delete_device
# ------------------
# Attributes methods
# ------------------
# --------
# Commands
# --------
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
# PROTECTED REGION ID(CspSubarrayProcModePst.main) ENABLED START #
return run((CspSubarrayProcModePst,), args=args, **kwargs)
# PROTECTED REGION END # // CspSubarrayProcModePst.main
if __name__ == '__main__':
main()
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/csp_lmc_common/CspSubarrayProcModeVlbi.py 0000664 0000000 0000000 00000006631 13707315520 0032572 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
#
# This file is part of the CspSubarrayProcModeVlbi project
#
# INAF-SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
""" CSP Subarray VLBI Capability
The class exposes parameters and commands required
for monitor and control of the Procesing Mode VLBI in a
single subarray.
It is used as base for developement of LOW and MID
specific capabilities.
"""
# PROTECTED REGION ID (CspSubarrayProcModeVlbi.standardlibray_import) ENABLED START #
# Python standard library
import sys
import os
# PROTECTED REGION END# //CspSubarrayIProcModeVlbi.standardlibray_import
# PyTango imports
import tango
from tango import DebugIt
from tango.server import run
from tango.server import Device
from tango.server import attribute, command
from tango.server import device_property
from tango import AttrQuality, DispLevel, DevState
from tango import AttrWriteType, PipeWriteType
# Additional import
# PROTECTED REGION ID(CspSubarrayProcModeVlbi.additionnal_import) ENABLED START #
from .CspSubarrayInherentCapability import CspSubarrayInherentCapability
# PROTECTED REGION END # // CspSubarrayProcModeVlbi.additionnal_import
__all__ = ["CspSubarrayProcModeVlbi", "main"]
class CspSubarrayProcModeVlbi(CspSubarrayInherentCapability):
"""
The class exposes parameters and commands required
for monitor and control of the Procesing Mode VLBI in a
single subarray.
It is used as base for developement of LOW and MID
specific capabilities.
**Properties:**
- Device Property
"""
# PROTECTED REGION ID(CspSubarrayProcModeVlbi.class_variable) ENABLED START #
# PROTECTED REGION END # // CspSubarrayProcModeVlbi.class_variable
# -----------------
# Device Properties
# -----------------
# ----------
# Attributes
# ----------
# ---------------
# General methods
# ---------------
def init_device(self):
"""Initialises the attributes and properties of the CspSubarrayProcModeVlbi."""
CspSubarrayInherentCapability.init_device(self)
# PROTECTED REGION ID(CspSubarrayProcModeVlbi.init_device) ENABLED START #
# PROTECTED REGION END # // CspSubarrayProcModeVlbi.init_device
def always_executed_hook(self):
"""Method always executed before any TANGO command is executed."""
# PROTECTED REGION ID(CspSubarrayProcModeVlbi.always_executed_hook) ENABLED START #
# PROTECTED REGION END # // CspSubarrayProcModeVlbi.always_executed_hook
def delete_device(self):
"""Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command.
"""
# PROTECTED REGION ID(CspSubarrayProcModeVlbi.delete_device) ENABLED START #
# PROTECTED REGION END # // CspSubarrayProcModeVlbi.delete_device
# ------------------
# Attributes methods
# ------------------
# --------
# Commands
# --------
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
# PROTECTED REGION ID(CspSubarrayProcModeVlbi.main) ENABLED START #
return run((CspSubarrayProcModeVlbi,), args=args, **kwargs)
# PROTECTED REGION END # // CspSubarrayProcModeVlbi.main
if __name__ == '__main__':
main()
CspSubarrayResourcesMonitor.py 0000664 0000000 0000000 00000023767 13707315520 0033521 0 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/csp_lmc_common # -*- coding: utf-8 -*-
#
# This file is part of the CspSubarrayResourcesMonitor project
#
# INAF, SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
""" CSP Subarray Resource Monitor
The class implementes the monitoring of all the resources
allocated to the CSP Subarray.
"""
# tango imports
import tango
from tango import DebugIt
from tango.server import run
from tango.server import Device
from tango.server import attribute, command
from tango.server import device_property
from tango import AttrQuality, DispLevel, DevState
from tango import AttrWriteType, PipeWriteType
# Additional import
# PROTECTED REGION ID(CspSubarrayResourcesMonitor.additionnal_import) ENABLED START #
from ska.base import SKABaseDevice
from ska.base.control_model import HealthState, AdminMode, ObsState, ObsMode
# PROTECTED REGION END # // CspSubarrayResourcesMonitor.additionnal_import
__all__ = ["CspSubarrayResourcesMonitor", "main"]
class CspSubarrayResourcesMonitor(SKABaseDevice):
"""
The class implementes the monitoring of all the resources
allocated to the CSP Subarray.
**Properties:**
- Device Property
"""
# PROTECTED REGION ID(CspSubarrayResourcesMonitor.class_variable) ENABLED START #
# PROTECTED REGION END # // CspSubarrayResourcesMonitor.class_variable
# -----------------
# Device Properties
# -----------------
# ----------
# Attributes
# ----------
assignedSearchBeamsState = attribute(
dtype=('DevState',),
max_dim_x=1500,
label="Assigned SearchBeams State",
polling_period=3000,
doc="State of the assigned SearchBeams",
)
assignedTimingBeamsState = attribute(
dtype=('DevState',),
max_dim_x=16,
label="Assigned TimingBeams State",
polling_period=3000,
doc="State of the assigned TimingBeams",
)
assignedVlbiBeamsState = attribute(
dtype=('DevState',),
max_dim_x=20,
label="Assigned VlbiBeams State",
polling_period=3000,
doc="State of the assigned VlbiBeams",
)
assignedSearchBeamsHealthState = attribute(
dtype=('DevState',),
max_dim_x=1500,
label="Assigned SearchBeams HealthState",
polling_period=3000,
doc="HealthState of the assigned SearchBeams",
)
assignedTimingBeamsHealthState = attribute(
dtype=('DevState',),
max_dim_x=16,
label="Assigned TimingBeams HealthState",
polling_period=3000,
doc="HealthState of the assigned TimingBeams",
)
assignedVlbiBeamsHealthState = attribute(
dtype=('DevState',),
max_dim_x=20,
label="Assigned VlbiBeams HealthState",
polling_period=3000,
doc="HealthState of the assigned VlbiBeams",
)
assignedSearchBeamsObsState = attribute(
dtype=('DevState',),
max_dim_x=1500,
label="Assigned SearchBeams ObsState",
polling_period=3000,
doc="ObsState of the assigned SearchBeams",
)
assignedTimingBeamsObsState = attribute(
dtype=('DevState',),
max_dim_x=16,
label="Assigned TimingBeams ObsState",
polling_period=3000,
doc="ObsState of the assigned TimingBeams",
)
assignedVlbiBeamsObsState = attribute(
dtype=('DevState',),
max_dim_x=20,
label="Assigned VlbiBeams ObsState",
polling_period=3000,
doc="ObsState of the assigned VlbiBeams",
)
assignedSearchBeamsAdminMode = attribute(
dtype=('DevState',),
max_dim_x=1500,
label="Assigned SearchBeams AdminMode",
polling_period=3000,
doc="AdminMode of the assigned SearchBeams",
)
assignedTimingBeamsAdminMode = attribute(
dtype=('DevState',),
max_dim_x=16,
label="Assigned TimingBeams AdminMode",
polling_period=3000,
doc="AdminMode of the assigned TimingBeams",
)
assignedVlbiBeamsAdminMode = attribute(
dtype=('DevState',),
max_dim_x=20,
label="Assigned VlbiBeams AdminMode",
polling_period=3000,
doc="AdminMode of the assigned VlbiBeams",
)
# ---------------
# General methods
# ---------------
def init_device(self):
"""Initialises the attributes and properties of the CspSubarrayResourcesMonitor."""
SKABaseDevice.init_device(self)
# PROTECTED REGION ID(CspSubarrayResourcesMonitor.init_device) ENABLED START #
# PROTECTED REGION END # // CspSubarrayResourcesMonitor.init_device
def always_executed_hook(self):
"""Method always executed before any TANGO command is executed."""
# PROTECTED REGION ID(CspSubarrayResourcesMonitor.always_executed_hook) ENABLED START #
# PROTECTED REGION END # // CspSubarrayResourcesMonitor.always_executed_hook
def delete_device(self):
"""Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command.
"""
# PROTECTED REGION ID(CspSubarrayResourcesMonitor.delete_device) ENABLED START #
# PROTECTED REGION END # // CspSubarrayResourcesMonitor.delete_device
# ------------------
# Attributes methods
# ------------------
def read_assignedSearchBeamsState(self):
# PROTECTED REGION ID(CspSubarrayResourcesMonitor.assignedSearchBeamsState_read) ENABLED START #
"""Return the assignedSearchBeamsState attribute."""
return (tango.DevState.UNKNOWN,)
# PROTECTED REGION END # // CspSubarrayResourcesMonitor.assignedSearchBeamsState_read
def read_assignedTimingBeamsState(self):
# PROTECTED REGION ID(CspSubarrayResourcesMonitor.assignedTimingBeamsState_read) ENABLED START #
"""Return the assignedTimingBeamsState attribute."""
return (tango.DevState.UNKNOWN,)
# PROTECTED REGION END # // CspSubarrayResourcesMonitor.assignedTimingBeamsState_read
def read_assignedVlbiBeamsState(self):
# PROTECTED REGION ID(CspSubarrayResourcesMonitor.assignedVlbiBeamsState_read) ENABLED START #
"""Return the assignedVlbiBeamsState attribute."""
return (tango.DevState.UNKNOWN,)
# PROTECTED REGION END # // CspSubarrayResourcesMonitor.assignedVlbiBeamsState_read
def read_assignedSearchBeamsHealthState(self):
# PROTECTED REGION ID(CspSubarrayResourcesMonitor.assignedSearchBeamsHealthState_read) ENABLED START #
"""Return the assignedSearchBeamsHealthState attribute."""
return (tango.DevState.UNKNOWN,)
# PROTECTED REGION END # // CspSubarrayResourcesMonitor.assignedSearchBeamsHealthState_read
def read_assignedTimingBeamsHealthState(self):
# PROTECTED REGION ID(CspSubarrayResourcesMonitor.assignedTimingBeamsHealthState_read) ENABLED START #
"""Return the assignedTimingBeamsHealthState attribute."""
return (tango.DevState.UNKNOWN,)
# PROTECTED REGION END # // CspSubarrayResourcesMonitor.assignedTimingBeamsHealthState_read
def read_assignedVlbiBeamsHealthState(self):
# PROTECTED REGION ID(CspSubarrayResourcesMonitor.assignedVlbiBeamsHealthState_read) ENABLED START #
"""Return the assignedVlbiBeamsHealthState attribute."""
return (tango.DevState.UNKNOWN,)
# PROTECTED REGION END # // CspSubarrayResourcesMonitor.assignedVlbiBeamsHealthState_read
def read_assignedSearchBeamsObsState(self):
# PROTECTED REGION ID(CspSubarrayResourcesMonitor.assignedSearchBeamsObsState_read) ENABLED START #
"""Return the assignedSearchBeamsObsState attribute."""
return (tango.DevState.UNKNOWN,)
# PROTECTED REGION END # // CspSubarrayResourcesMonitor.assignedSearchBeamsObsState_read
def read_assignedTimingBeamsObsState(self):
# PROTECTED REGION ID(CspSubarrayResourcesMonitor.assignedTimingBeamsObsState_read) ENABLED START #
"""Return the assignedTimingBeamsObsState attribute."""
return (tango.DevState.UNKNOWN,)
# PROTECTED REGION END # // CspSubarrayResourcesMonitor.assignedTimingBeamsObsState_read
def read_assignedVlbiBeamsObsState(self):
# PROTECTED REGION ID(CspSubarrayResourcesMonitor.assignedVlbiBeamsObsState_read) ENABLED START #
"""Return the assignedVlbiBeamsObsState attribute."""
return (tango.DevState.UNKNOWN,)
# PROTECTED REGION END # // CspSubarrayResourcesMonitor.assignedVlbiBeamsObsState_read
def read_assignedSearchBeamsAdminMode(self):
# PROTECTED REGION ID(CspSubarrayResourcesMonitor.assignedSearchBeamsAdminMode_read) ENABLED START #
"""Return the assignedSearchBeamsAdminMode attribute."""
return (tango.DevState.UNKNOWN,)
# PROTECTED REGION END # // CspSubarrayResourcesMonitor.assignedSearchBeamsAdminMode_read
def read_assignedTimingBeamsAdminMode(self):
# PROTECTED REGION ID(CspSubarrayResourcesMonitor.assignedTimingBeamsAdminMode_read) ENABLED START #
"""Return the assignedTimingBeamsAdminMode attribute."""
return (tango.DevState.UNKNOWN,)
# PROTECTED REGION END # // CspSubarrayResourcesMonitor.assignedTimingBeamsAdminMode_read
def read_assignedVlbiBeamsAdminMode(self):
# PROTECTED REGION ID(CspSubarrayResourcesMonitor.assignedVlbiBeamsAdminMode_read) ENABLED START #
"""Return the assignedVlbiBeamsAdminMode attribute."""
return (tango.DevState.UNKNOWN,)
# PROTECTED REGION END # // CspSubarrayResourcesMonitor.assignedVlbiBeamsAdminMode_read
# --------
# Commands
# --------
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
# PROTECTED REGION ID(CspSubarrayResourcesMonitor.main) ENABLED START #
return run((CspSubarrayResourcesMonitor,), args=args, **kwargs)
# PROTECTED REGION END # // CspSubarrayResourcesMonitor.main
if __name__ == '__main__':
main()
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/csp_lmc_common/CspTimingBeamCapability.py 0000664 0000000 0000000 00000010246 13707315520 0032547 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
#
# This file is part of the CspTimingBeamCapability project
#
# INAF-SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
""" CSP TimingBeam Capability
The class models the Capability TimingBeam exsposing
the attributes and commands used to monitor and control beamforming
and PST processing in a single beam.
In particular it maps components used for beamforming with those
that perform PST processing.
Used for development of LOW and MID specific devices.
"""
# PROTECTED REGION ID (CspTimingBeamCapability.standardlibray_import) ENABLED START #
# Python standard library
# PROTECTED REGION END# //CspTimingBeamCapability.standardlibray_import
# PyTango imports
# PyTango imports
import tango
from tango import DebugIt
from tango.server import run
from tango.server import Device
from tango.server import attribute, command
from tango.server import device_property
from tango import AttrQuality, DispLevel, DevState
from tango import AttrWriteType, PipeWriteType
# Additional import
# PROTECTED REGION ID(CspTimingBeamCapability.additionnal_import) ENABLED START #
from ska.base import SKACapability
from ska.base.control_model import HealthState, AdminMode, ObsState, ObsMode
# PROTECTED REGION END # // CspTimingBeamCapability.additionnal_import
__all__ = ["CspTimingBeamCapability", "main"]
class CspTimingBeamCapability(SKACapability):
"""
The class models the Capability TimingBeam exsposing
the attributes and commands used to monitor and control beamforming
and PST processing in a single beam.
In particular it maps components used for beamforming with those
that perform PST processing.
Used for development of LOW and MID specific devices.
**Properties:**
- Device Property
"""
# PROTECTED REGION ID(CspTimingBeamCapability.class_variable) ENABLED START #
# PROTECTED REGION END # // CspTimingBeamCapability.class_variable
# -----------------
# Device Properties
# -----------------
# ----------
# Attributes
# ----------
subarrayMembership = attribute(
dtype='DevUShort',
label="The Beam Capability subarray affiliation.",
doc="The subarray ID the CSP Beam Capability belongs to.",
)
# ---------------
# General methods
# ---------------
def init_device(self):
"""Initialises the attributes and properties of the CspTimingBeamCapability."""
SKACapability.init_device(self)
# PROTECTED REGION ID(CspTimingBeamCapability.init_device) ENABLED START #
# PROTECTED REGION END # // CspTimingBeamCapability.init_device
def always_executed_hook(self):
"""Method always executed before any TANGO command is executed."""
# PROTECTED REGION ID(CspTimingBeamCapability.always_executed_hook) ENABLED START #
# PROTECTED REGION END # // CspTimingBeamCapability.always_executed_hook
def delete_device(self):
"""Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command.
"""
# PROTECTED REGION ID(CspTimingBeamCapability.delete_device) ENABLED START #
# PROTECTED REGION END # // CspTimingBeamCapability.delete_device
# ------------------
# Attributes methods
# ------------------
def read_subarrayMembership(self):
# PROTECTED REGION ID(CspTimingBeamCapability.subarrayMembership_read) ENABLED START #
"""Return the subarrayMembership attribute."""
return 0
# PROTECTED REGION END # // CspTimingBeamCapability.subarrayMembership_read
# --------
# Commands
# --------
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
"""Main function of the CspTimingBeamCapability module."""
# PROTECTED REGION ID(CspTimingBeamCapability.main) ENABLED START #
return run((CspTimingBeamCapability,), args=args, **kwargs)
# PROTECTED REGION END # // CspTimingBeamCapability.main
if __name__ == '__main__':
main()
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/csp_lmc_common/CspVlbiBeamCapability.py 0000664 0000000 0000000 00000007636 13707315520 0032225 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
#
# This file is part of the CspVlbiBeamCapability project
#
# INAF-SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
""" CSP TimingBeam Capability
The class models the Capability VlbiBeam exsposing
the attributes and commands used to monitor and control beamforming
and VLBI processing in a single beam.
Used for development of LOW and MID specific devices.
"""
# PROTECTED REGION ID (CspVlbiBeamCapability.standardlibray_import) ENABLED START #
# Python standard library
# PROTECTED REGION END# //CspVlbiBeamCapability.standardlibray_import
# PyTango imports
import tango
from tango import DebugIt
from tango.server import run
from tango.server import Device
from tango.server import attribute, command
from tango.server import device_property
from tango import AttrQuality, DispLevel, DevState
from tango import AttrWriteType, PipeWriteType
# Additional import
# PROTECTED REGION ID(CspVlbiBeamCapability.additionnal_import) ENABLED START #
from ska.base import SKACapability
from ska.base.control_model import HealthState, AdminMode, ObsState, ObsMode
# PROTECTED REGION END # // CspVlbiBeamCapability.additionnal_import
__all__ = ["CspVlbiBeamCapability", "main"]
class CspVlbiBeamCapability(SKACapability):
"""
The class models the Capability VlbiBeam exsposing
the attributes and commands used to monitor and control beamforming
and VLBI processing in a single beam.
Used for development of LOW and MID specific devices.
**Properties:**
- Device Property
"""
# PROTECTED REGION ID(CspVlbiBeamCapability.class_variable) ENABLED START #
# PROTECTED REGION END # // CspVlbiBeamCapability.class_variable
# -----------------
# Device Properties
# -----------------
# ----------
# Attributes
# ----------
subarrayMembership = attribute(
dtype='DevUShort',
label="The Beam Capability subarray affiliation.",
doc="The subarray ID the CSP Beam Capability belongs to.",
)
# ---------------
# General methods
# ---------------
def init_device(self):
"""Initialises the attributes and properties of the CspVlbiBeamCapability."""
SKACapability.init_device(self)
# PROTECTED REGION ID(CspVlbiBeamCapability.init_device) ENABLED START #
# PROTECTED REGION END # // CspVlbiBeamCapability.init_device
def always_executed_hook(self):
"""Method always executed before any TANGO command is executed."""
# PROTECTED REGION ID(CspVlbiBeamCapability.always_executed_hook) ENABLED START #
# PROTECTED REGION END # // CspVlbiBeamCapability.always_executed_hook
def delete_device(self):
"""Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command.
"""
# PROTECTED REGION ID(CspVlbiBeamCapability.delete_device) ENABLED START #
# PROTECTED REGION END # // CspVlbiBeamCapability.delete_device
# ------------------
# Attributes methods
# ------------------
def read_subarrayMembership(self):
# PROTECTED REGION ID(CspVlbiBeamCapability.subarrayMembership_read) ENABLED START #
"""Return the subarrayMembership attribute."""
return 0
# PROTECTED REGION END # // CspVlbiBeamCapability.subarrayMembership_read
# --------
# Commands
# --------
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
"""Main function of the CspVlbiBeamCapability module."""
# PROTECTED REGION ID(CspVlbiBeamCapability.main) ENABLED START #
return run((CspVlbiBeamCapability,), args=args, **kwargs)
# PROTECTED REGION END # // CspVlbiBeamCapability.main
if __name__ == '__main__':
main()
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/csp_lmc_common/__init__.py 0000664 0000000 0000000 00000000000 13707315520 0027605 0 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/csp_lmc_common/release.py 0000775 0000000 0000000 00000001024 13707315520 0027500 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
#
# This file is part of the CentralNode project
#
#
#
# Distributed under the terms of the BSD-3-Clause license.
# See LICENSE.txt for more info.
"""Release information for Python Package"""
name = """csp-lmc-common"""
version = "0.6.4"
version_info = version.split(".")
description = """SKA CSP.LMC Common Software"""
author = "INAF-OAA"
author_email = "elisabetta.giani@inaf.it"
license = """BSD-3-Clause"""
url = """https://gitlab.com/ska-telescope/csp-lmc.git"""
copyright = """INAF, SKA Telescope"""
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/csp_lmc_common/utils/ 0000775 0000000 0000000 00000000000 13707315520 0026646 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/csp_lmc_common/utils/__init__.py 0000664 0000000 0000000 00000000000 13707315520 0030745 0 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/csp_lmc_common/utils/cspcommons.py 0000664 0000000 0000000 00000000222 13707315520 0031375 0 ustar 00root root 0000000 0000000 from enum import IntEnum, unique
@unique
class CmdExecState(IntEnum):
IDLE = 0
RUNNING = 1
QUEUED = 2
TIMEOUT = 3
FAILED = 4
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/csp_lmc_common/utils/decorators.py 0000664 0000000 0000000 00000042612 13707315520 0031372 0 ustar 00root root 0000000 0000000 import sys
import os
import tango
from .cspcommons import CmdExecState
from ska.base.control_model import AdminMode,ObsState
import functools
class AdminModeCheck(object):
"""
Class designed to be a decorator for the CspMaster methods.
It checks the adminMode attribute value: if not ONLINE or
MAINTENANCE it throws an exception.
"""
def __init__(self, cmd_to_execute):
self._cmd_to_execute = cmd_to_execute
def __call__(self, f):
@functools.wraps(f)
def admin_mode_check(*args, **kwargs):
# get the device instance
dev_instance = args[0]
dev_instance.logger.debug(
"Command to execute: {}".format(self._cmd_to_execute))
# Check the AdminMode value: the command is callable only if the
# the administration mode is ONLINE or MAINTENACE
if dev_instance._admin_mode not in [AdminMode.ONLINE, AdminMode.MAINTENANCE]:
# NOTE: when adminMode is not ONLINE/MAINTENANCE the device State has to be
# DISABLE
# Add only a check on State value to log a warning message if it
# is different from DISABLE
msg_args = (self._cmd_to_execute, dev_instance.get_state(
), AdminMode(dev_instance._admin_mode).name)
if dev_instance.get_state() != tango.DevState.DISABLE:
dev_instance.logger.warn("Command {}: incoherent device State {} "
" with adminMode {}".format(*msg_args))
err_msg = ("{} command can't be issued when State is {} and"
" adminMode is {} ".format(*msg_args))
tango.Except.throw_exception("Invalid adminMode value",
err_msg,
"AdminModeCheck decorator",
tango.ErrSeverity.ERR)
return f(*args, **kwargs)
return admin_mode_check
VALID_OBS_STATE = {'reset': [ObsState.ABORTED],
'configscan': [ObsState.IDLE, ObsState.READY],
'scan': [ObsState.READY],
'endscan': [ObsState.SCANNING],
'gotoidle': [ObsState.READY, ObsState.IDLE],
'addresources': [ObsState.IDLE],
'removeresources': [ObsState.IDLE]
}
class ObsStateCheck(object):
"""
Class designed to be a decorator for the CspMaster methods.
It checks the obsMode attribute value
"""
def __init__(self, args=False, kwargs=False):
self._args = args
self._kwargs = kwargs
def __call__(self, f):
@functools.wraps(f)
def obs_state_check(*args, **kwargs):
# get the device instance
dev_instance = args[0]
cmd_type = self._args
dev_instance.logger.info("device obs_state: {}".format(dev_instance._obs_state))
# Check the obsState attribute value: valid values for the command to
# execute are defined by VALID_OBS_STATE dictionary
if dev_instance._obs_state not in VALID_OBS_STATE[cmd_type]:
msg_args = (f.__name__, ObsState(dev_instance._obs_state).name)
err_msg = ("{} command can't be issued when the"
" obsState is {} ".format(*msg_args))
tango.Except.throw_exception("Command not executable",
err_msg,
"ObsStateCheck decorator",
tango.ErrSeverity.ERR)
return f(*args, **kwargs)
return obs_state_check
class CmdInputArgsCheck(object):
"""
Class designed to be a decorator for the CspMaster methods.
The *decorator function* performs a check on the function input argument,
detecting if the corresponding servers are running and the
administrative mode of the devices has the right value to execute a command (i.e
ONLINE/MAINTENACE)
The *decorator function* accepts some parameters as input to customize
its functionality
"""
def __init__(self, *args, **kwargs):
# store the decorators parameters:
# args: the list of sub-element attributes to subscribe, to track the
# sub-element command progress and detect a command timeout
# kwargs: a dictionary: key ="cmd_name",
# value = command to execute ('on', 'off'...)
#
self._args = args
self._kwargs = kwargs
def __call__(self, f):
@functools.wraps(f)
def input_args_check(*args, **kwargs):
# the CspMaster device instance
dev_instance = args[0]
# get the information passed as arguments to the decorator
attrs_to_subscribe = self._args
try:
cmd_to_exec = self._kwargs['cmd_name']
except KeyError as key_err:
msg = ("No key found for {}".format(str(key_err)))
dev_instance.logger.warn(msg)
tango.Except.throw_exception("Command failure",
"Error in input decorator args",
"CmdInputArgsCheck decorator",
tango.ErrSeverity.ERR)
input_arg = args[1]
device_list = input_arg
# Note: device list is a reference to args[1]: changing
# device_list content, args[1] changes accordingly!
num_of_devices = len(input_arg)
if num_of_devices == 0:
# no input argument -> switch on all sub-elements
num_of_devices = len(dev_instance._se_fqdn)
# !!Note!!:
# need to copy inside device_list to maintain the reference to args[1]
# if we do
# device_list = dev_instance._se_fqdn
# we get a new variable address and we lose the reference to args[1]
for fqdn in dev_instance._se_fqdn:
device_list.append(fqdn)
else:
if num_of_devices > len(dev_instance._se_fqdn):
# too many devices specified-> log the warning but go on
# with command execution
dev_instance.logger.warn("Too many input parameters")
dev_instance.logger.debug(
"Devices {} to check:".format(device_list))
# If a sub-element device is already executing a power command, an exception is
# thrown only when the requested command is different from the one
# already running (power commands have to be executed sequentially).
# TODO:
# What to do if the required device is performing a software upgrade or is changing its
# adminMode? How can CSP.LMC detect this condition?
dev_instance.logger.info("Command to execute:{}".format(cmd_to_exec))
dev_instance.logger.info("_cmd_execution_state: {}".format(dev_instance._cmd_execution_state.items()))
list_of_running_cmd = [cmd_name for cmd_name, cmd_state in dev_instance._cmd_execution_state.items()
if cmd_state == CmdExecState.RUNNING]
dev_instance.logger.info("list of running commands: {}".format(list_of_running_cmd))
if list_of_running_cmd:
# if a command is running, check if its the requested one
if len(list_of_running_cmd) > 1:
# should not happen!! throw an exception
err_msg = "{} power commands are running. Something strange!".format(
len(list_of_running_cmd))
tango.Except.throw_exception("Command failure",
err_msg,
"CmdInputArgsCheck decorator",
tango.ErrSeverity.ERR)
if list_of_running_cmd[0] == cmd_to_exec:
# the requested command is already running
# return with no exception (see SKA Guidelines)
msg = ("Command {} is already running".format(cmd_to_exec))
dev_instance.logger.info(msg)
return
else:
# another power command is already running
err_msg = ("Can't execute command {}:"
" power command {} is already running".format(cmd_to_exec, list_of_running_cmd[0]))
tango.Except.throw_exception("Command failure",
err_msg,
"CmdInputArgsCheck decorator",
tango.ErrSeverity.ERR)
# check for devices that are not ONLINE/MAINTENANCE
device_to_remove = []
for device in device_list:
dev_instance.logger.debug(
"CmdInputArgsCheack-processing device:{}".format(device))
# if the sub-element device server is not running or the adminMode
# attribute is not ONLINE or MAINTENANCE:
# - schedule the device for removing from the input arg list
# - skip to next device and
if (not dev_instance._is_device_running(device, dev_instance._se_proxies) or
dev_instance._se_admin_mode[device] not in [AdminMode.ONLINE,
AdminMode.MAINTENANCE]):
if device == dev_instance.CspCbf:
msg = ("Can't execute command {} with "
"device {} {}".format(cmd_to_exec,
device,
AdminMode(dev_instance._se_admin_mode[device]).name))
tango.Except.throw_exception("Command failure",
msg,
"CmdInputArgsCheck decorator",
tango.ErrSeverity.ERR)
device_to_remove.append(device)
dev_instance.logger.debug(
"Devices to remove from the list:{}".format(device_to_remove))
continue
for device in device_to_remove:
device_list.remove(device)
if not device_list:
dev_instance.logger.info("No device to power on")
return
command_timeout = 0
# build the sub-element attribute name storing the command duration
# expected value.
cmd_time_attr_name = cmd_to_exec + "DurationExpected"
for device in device_list:
dev_instance.logger.debug("Processing device: {}".format(device))
# set to QUEUED. This state can be useful in case of command abort.
dev_instance._se_cmd_execution_state[device][cmd_to_exec] = CmdExecState.QUEUED
# reset the timeout and failure attribute content
dev_instance._timeout_expired[cmd_to_exec] = False
# TODO: how check if the failure condition has been reset by AlarmHandler?
dev_instance._failure_raised[cmd_to_exec] = False
device_proxy = dev_instance._se_proxies[device]
try:
# get the sub-element value for the onCommandDurationExpected attribute.
# If this attribute is not implemented at sub-element level,
# the default value is used.
# Note: if onCmdDurationExpected attribute is not implemented, the
# call device_proxy.onCmdDurationExpected throws an AttributeError exception
# (not tango.DevFailed)
#dev_instance._se_cmd_duration_expected[device][cmd_to_exec] = device_proxy.onCmdDurationExpected
# read_Attribute returns a DeviceAttribute object
device_attr = device_proxy.read_attribute(
cmd_time_attr_name)
dev_instance._se_cmd_duration_expected[device][cmd_to_exec] = device_attr.value
except tango.DevFailed as tango_err:
# we get here if the attribute is not implemented
dev_instance.logger.info(tango_err.args[0].desc)
for attr in attrs_to_subscribe:
try:
if dev_instance._se_event_id[device][attr.lower()] == 0:
evt_id = device_proxy.subscribe_event(attr, tango.EventType.CHANGE_EVENT,
dev_instance._attributes_change_evt_cb, stateless=False)
dev_instance._se_event_id[device][attr.lower(
)] = evt_id
except tango.DevFailed as tango_err:
dev_instance.logger.info(tango_err.args[0].desc)
# evaluate the total timeout value to execute the whole command
# note: if the xxxDurationExpected attribute read fails, it is used the default value
# (xxxDurationExpected initialized as defaultdict)
command_timeout += dev_instance._se_cmd_duration_expected[device][cmd_to_exec]
# device loop end
# use the greatest value for the onCommand duration expected.
if command_timeout > dev_instance._cmd_duration_expected[cmd_to_exec]:
dev_instance._cmd_duration_expected[cmd_to_exec] = command_timeout
dev_instance.logger.info(
"Modified the {} command Duration Expected value!!".format(cmd_to_exec))
return f(*args, **kwargs)
return input_args_check
class SubarrayRejectCmd(object):
"""
Class designed to be a decorator for the CspSubarray methods.
The *decorator function* controls if the execution of a sub-array
command to assign/remove/configure resources conflicts with a command already
running.
The *decorator function* accepts some parameters as input to customize
its functionality.
"""
def __init__(self, *args, **kwargs):
# store the decorators parameters:
# args: the list of command to reject
#
self._args = args
self._kwargs = kwargs
def __call__(self, f):
@functools.wraps(f)
def input_args_check(*args, **kwargs):
# the CspSubarray device instance
dev_instance = args[0]
cmd_to_exec = f.__name__
commands_to_reject = self._args
dev_instance.logger.info(
"Command to execute: {}".format(f.__name__))
dev_instance.logger.info(
"Device state : {} obs_state: {}".format(dev_instance.get_state(), dev_instance._obs_state))
# If a sub-array is executing an AddXXX (RemoveXX) command, an exception is
# thown only when the requested command is RemoveXXX (AddXXX)remove/add resources or ConfigureScan.
# If the requested command is already running, the decorator returns.
list_of_running_cmd = [cmd_name for cmd_name, cmd_state in dev_instance._cmd_execution_state.items()
if cmd_state == CmdExecState.RUNNING]
dev_instance.logger.info("list of running commands: {}".format(list_of_running_cmd))
if list_of_running_cmd:
dev_instance.logger.info("Commands {} are running".format(list_of_running_cmd))
if cmd_to_exec.lower() in list_of_running_cmd:
# the requested command is already running
# return with no exception (see SKA Guidelines)
msg = ("Command {} is already running".format(cmd_to_exec))
dev_instance.logger.info(msg)
return
# Change the name of commands to reject in lower-case letters to match
# the name of the running commands (if any)
commands_to_reject = map(str.lower, commands_to_reject)
if any(cmd_name in commands_to_reject for cmd_name in list_of_running_cmd):
err_msg = ("Can't execute command {}:"
" command {} is already running".format(cmd_to_exec, list_of_running_cmd))
dev_instance.logger.error(err_msg)
tango.Except.throw_exception("Command failure",
err_msg,
"SubarrayRejectCmd decorator",
tango.ErrSeverity.ERR)
# reset failure/timeout condition
if dev_instance._failure_raised:
dev_instance.logger.info(
"A previous failure condition is present")
dev_instance._failure_raised = False
if dev_instance._timeout_expired:
dev_instance.logger.info(
"A previous timeout condition is present")
dev_instance._timeout_expired = False
# TODO: how check if the failure condition has been reset by AlarmHandler?
return f(*args, **kwargs)
return input_args_check
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/docker/ 0000775 0000000 0000000 00000000000 13707315520 0023765 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/docker/.make/ 0000775 0000000 0000000 00000000000 13707315520 0024760 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/docker/.make/.make-release-support 0000664 0000000 0000000 00000005067 13707315520 0031036 0 ustar 00root root 0000000 0000000 #!/bin/bash
#
# Copyright 2015 Xebia Nederland B.V.
# Modifications copyright 2019 SKA Organisation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
function hasChanges() {
test -n "$(git status -s .)"
}
function getRelease() {
awk -F= '/^release=/{print $2}' .release
}
function getBaseTag() {
sed -n -e "s/^tag=\(.*\)$(getRelease)\$/\1/p" .release
}
function getTag() {
if [ -z "$1" ] ; then
awk -F= '/^tag/{print $2}' .release
else
echo "$(getBaseTag)$1"
fi
}
function setRelease() {
if [ -n "$1" ] ; then
sed -i.x -e "s/^tag=.*/tag=$(getTag $1)/" .release
sed -i.x -e "s/^release=.*/release=$1/g" .release
rm -f .release.x
runPreTagCommand "$1"
else
echo "ERROR: missing release version parameter " >&2
return 1
fi
}
function runPreTagCommand() {
if [ -n "$1" ] ; then
COMMAND=$(sed -n -e "s/@@RELEASE@@/$1/g" -e 's/^pre_tag_command=\(.*\)/\1/p' .release)
if [ -n "$COMMAND" ] ; then
if ! OUTPUT=$(bash -c "$COMMAND" 2>&1) ; then echo $OUTPUT >&2 && exit 1 ; fi
fi
else
echo "ERROR: missing release version parameter " >&2
return 1
fi
}
function tagExists() {
tag=${1:-$(getTag)}
test -n "$tag" && test -n "$(git tag | grep "^$tag\$")"
}
function differsFromRelease() {
tag=$(getTag)
! tagExists $tag || test -n "$(git diff --shortstat -r $tag .)"
}
function getVersion() {
result=$(getRelease)
if differsFromRelease; then
result="$result-$(git log -n 1 --format=%h .)"
fi
if hasChanges ; then
result="$result-dirty"
fi
echo $result
}
function nextPatchLevel() {
version=${1:-$(getRelease)}
major_and_minor=$(echo $version | cut -d. -f1,2)
patch=$(echo $version | cut -d. -f3)
version=$(printf "%s.%d" $major_and_minor $(($patch + 1)))
echo $version
}
function nextMinorLevel() {
version=${1:-$(getRelease)}
major=$(echo $version | cut -d. -f1);
minor=$(echo $version | cut -d. -f2);
version=$(printf "%d.%d.0" $major $(($minor + 1))) ;
echo $version
}
function nextMajorLevel() {
version=${1:-$(getRelease)}
major=$(echo $version | cut -d. -f1);
version=$(printf "%d.0.0" $(($major + 1)))
echo $version
}
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/docker/.make/Makefile.mk 0000664 0000000 0000000 00000011200 13707315520 0027020 0 ustar 00root root 0000000 0000000 #
# Copyright 2015 Xebia Nederland B.V.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
ifeq ($(strip $(PROJECT)),)
NAME=$(shell basename $(CURDIR))
else
NAME=$(PROJECT)
endif
RELEASE_SUPPORT := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))/.make-release-support
ifeq ($(strip $(DOCKER_REGISTRY_HOST)),)
DOCKER_REGISTRY_HOST = nexus.engageska-portugal.pt
endif
ifeq ($(strip $(DOCKER_REGISTRY_USER)),)
DOCKER_REGISTRY_USER = ska-docker
endif
IMAGE=$(DOCKER_REGISTRY_HOST)/$(DOCKER_REGISTRY_USER)/$(NAME)
#VERSION = release version + git sha
VERSION=$(shell . $(RELEASE_SUPPORT) ; getVersion)
#BASE_VERSION
BASE_VERSION=$(shell . $(RELEASE_SUPPORT) ; getRelease)
#TAG = project name + release version
TAG=$(shell . $(RELEASE_SUPPORT); getTag)
#DEFAULT_TAG = image name + BASE_VERSION
DEFAULT_TAG=$(IMAGE):$(BASE_VERSION)
SHELL=/bin/bash
DOCKER_BUILD_CONTEXT=..
DOCKER_FILE_PATH=Dockerfile
.PHONY: pre-build docker-build post-build build release patch-release minor-release major-release tag check-status check-release showver \
push pre-push do-push post-push
build: pre-build docker-build post-build ## build the application image
pre-build:
post-build:
pre-push:
post-push:
docker-build: .release
@echo "Building image: $(IMAGE):$(VERSION)"
@echo "NAME: $(NAME)"
docker build $(DOCKER_BUILD_ARGS) -t $(IMAGE):$(VERSION) $(DOCKER_BUILD_CONTEXT) -f $(DOCKER_FILE_PATH) --build-arg DOCKER_REGISTRY_HOST=$(DOCKER_REGISTRY_HOST) --build-arg DOCKER_REGISTRY_USER=$(DOCKER_REGISTRY_USER)
@DOCKER_MAJOR=$(shell docker -v | sed -e 's/.*version //' -e 's/,.*//' | cut -d\. -f1) ; \
DOCKER_MINOR=$(shell docker -v | sed -e 's/.*version //' -e 's/,.*//' | cut -d\. -f2) ; \
if [ $$DOCKER_MAJOR -eq 1 ] && [ $$DOCKER_MINOR -lt 10 ] ; then \
echo docker tag -f $(IMAGE):$(VERSION) $(IMAGE):latest ;\
docker tag -f $(IMAGE):$(VERSION) $(IMAGE):latest ;\
else \
echo docker tag $(IMAGE):$(VERSION) $(IMAGE):latest ;\
docker tag $(IMAGE):$(VERSION) $(IMAGE):latest ; \
fi
release: check-status check-release build push
push: pre-push do-push post-push ## push the image to the Docker registry
do-push: ## Push the image tagged as $(IMAGE):$(VERSION) and $(DEFAULT_TAG)
@echo -e "Tagging: $(IMAGE):$(VERSION) -> $(DEFAULT_TAG)"
docker tag $(IMAGE):$(VERSION) $(DEFAULT_TAG)
@echo -e "Pushing: $(IMAGE):$(VERSION)"
docker push $(IMAGE):$(VERSION)
@echo -e "Pushing: $(DEFAULT_TAG)"
docker push $(DEFAULT_TAG)
tag_latest: do-push ## Tag the images as latest
@echo "Tagging: $(DEFAULT_TAG) -> $(IMAGE):latest"
@docker tag $(DEFAULT_TAG) $(IMAGE):latest
push_latest: tag_latest ## Push the image tagged as :latest
@echo "Pushing: $(IMAGE):latest"
@docker push $(IMAGE):latest
snapshot: build push
showver: .release
@. $(RELEASE_SUPPORT); getVersion
bump-patch-release: VERSION := $(shell . $(RELEASE_SUPPORT); nextPatchLevel)
bump-patch-release: .release tag
bump-minor-release: VERSION := $(shell . $(RELEASE_SUPPORT); nextMinorLevel)
bump-minor-release: .release tag
bump-major-release: VERSION := $(shell . $(RELEASE_SUPPORT); nextMajorLevel)
bump-major-release: .release tag
patch-release: tag-patch-release release
@echo $(VERSION)
minor-release: tag-minor-release release
@echo $(VERSION)
major-release: tag-major-release release
@echo $(VERSION)
tag: TAG=$(shell . $(RELEASE_SUPPORT); getTag $(VERSION))
tag: check-status
# @. $(RELEASE_SUPPORT) ; ! tagExists $(TAG) || (echo "ERROR: tag $(TAG) for version $(VERSION) already tagged in git" >&2 && exit 1) ;
@. $(RELEASE_SUPPORT) ; setRelease $(VERSION)
# git add .
# git commit -m "bumped to version $(VERSION)" ;
# git tag $(TAG) ;
# @ if [ -n "$(shell git remote -v)" ] ; then git push --tags ; else echo 'no remote to push tags to' ; fi
check-status:
@. $(RELEASE_SUPPORT) ; ! hasChanges || (echo "ERROR: there are still outstanding changes" >&2 && exit 1) ;
check-release: .release
@. $(RELEASE_SUPPORT) ; tagExists $(TAG) || (echo "ERROR: version not yet tagged in git. make [minor,major,patch]-release." >&2 && exit 1) ;
@. $(RELEASE_SUPPORT) ; ! differsFromRelease $(TAG) || (echo "ERROR: current directory differs from tagged $(TAG). make [minor,major,patch]-release." ; exit 1)
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/docker/.release 0000664 0000000 0000000 00000001017 13707315520 0025405 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
#
# This file is part of the CSP.LMC prototype project
#
#
# Distributed under the terms of the BSD-3-Clause license.
# See LICENSE.txt for more info.
"""Release information for Python Package"""
name = """csplmc-common"""
version = "0.6.4"
version_info = version.split(".")
description = """SKA CSP.LMC Common Classe"""
author = "E.G"
author_email = "elisabetta.giani@inaf.it"
license = """BSD-3-Clause"""
url = """www.tango-controls.org"""
copyright = """"""
release=0.6.4
tag=csp-lmc-common-0.6.4
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/docker/Dockerfile 0000664 0000000 0000000 00000001104 13707315520 0025753 0 ustar 00root root 0000000 0000000 FROM nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:9.3.2 AS buildenv
FROM nexus.engageska-portugal.pt/ska-docker/ska-python-runtime:9.3.2 AS runtime
# create ipython profile to so that itango doesn't fail if ipython hasn't run yet
RUN ipython profile create
#RUN python3 -m pip install --user pytest-forked
ENV PATH=/home/tango/.local/bin:$PATH
#install csp-lmc-common with dependencies
RUN python3 -m pip install -e . --user --extra-index-url https://nexus.engageska-portugal.pt/repository/pypi/simple
CMD ["/venv/bin/python", "/app/csp_lmc_common/CspMaster.py" ]
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/docker/Makefile 0000664 0000000 0000000 00000016715 13707315520 0025437 0 ustar 00root root 0000000 0000000 #
# Project makefile for a Tango project. You should normally only need to modify
# DOCKER_REGISTRY_USER and PROJECT below.
#
#
# DOCKER_REGISTRY_HOST, DOCKER_REGISTRY_USER and PROJECT are combined to define
# the Docker tag for this project. The definition below inherits the standard
# value for DOCKER_REGISTRY_HOST (=rnexus.engageska-portugal.pt) and overwrites
# DOCKER_REGISTRY_USER and PROJECT to give a final Docker tag of
# nexus.engageska-portugal.pt/tango-example/csplmc
#
DOCKER_REGISTRY_USER:=ska-docker
PROJECT = csp-lmc-common
#
# include makefile to pick up the standard Make targets, e.g., 'make build'
# build, 'make push' docker push procedure, etc. The other Make targets
# ('make interactive', 'make test', etc.) are defined in this file.
#
include .make/Makefile.mk
#
# IMAGE_TO_TEST defines the tag of the Docker image to test
#
IMAGE_TO_TEST = $(DOCKER_REGISTRY_HOST)/$(DOCKER_REGISTRY_USER)/$(PROJECT):latest
#
# CACHE_VOLUME is the name of the Docker volume used to cache eggs and wheels
# used during the test procedure. The volume is not used during the build
# procedure
#
CACHE_VOLUME = $(PROJECT)-test-cache
# optional docker run-time arguments
DOCKER_RUN_ARGS =
#
# Never use the network=host mode when running CI jobs, and add extra
# distinguishing identifiers to the network name and container names to
# prevent collisions with jobs from the same project running at the same
# time.
#
ifneq ($(CI_JOB_ID),)
NETWORK_MODE := tangonet-$(CI_JOB_ID)
CONTAINER_NAME_PREFIX := $(PROJECT)-$(CI_JOB_ID)-
else
CONTAINER_NAME_PREFIX := $(PROJECT)-
endif
COMPOSE_FILES := $(wildcard *.yml)
COMPOSE_FILE_ARGS := $(foreach yml,$(COMPOSE_FILES),-f $(yml))
ifeq ($(OS),Windows_NT)
$(error Sorry, Windows is not supported yet)
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
DISPLAY ?= :0.0
NETWORK_MODE ?= host
XAUTHORITY_MOUNT := /tmp/.X11-unix:/tmp/.X11-unix
XAUTHORITY ?= /hosthome/.Xauthority
# /bin/sh (=dash) does not evaluate 'docker network' conditionals correctly
SHELL := /bin/bash
endif
ifeq ($(UNAME_S),Darwin)
IF_INTERFACE := $(shell netstat -nr | awk '{ if ($$1 ~/default/) { print $$6} }')
DISPLAY := $(shell ifconfig $(IF_INTERFACE) | awk '{ if ($$1 ~/inet$$/) { print $$2} }'):0
# network_mode = host doesn't work on MacOS, so fix to the internal network
NETWORK_MODE := tangonet
XAUTHORITY_MOUNT := $(HOME):/hosthome:ro
XAUTHORITY := /hosthome/.Xauthority
endif
endif
#
# When running in network=host mode, point devices at a port on the host
# machine rather than at the container.
#
ifeq ($(NETWORK_MODE),host)
TANGO_HOST := $(shell hostname):10000
MYSQL_HOST := $(shell hostname):3306
else
# distinguish the bridge network from others by adding the project name
NETWORK_MODE := $(NETWORK_MODE)-$(PROJECT)
TANGO_HOST := $(CONTAINER_NAME_PREFIX)databaseds:10000
MYSQL_HOST := $(CONTAINER_NAME_PREFIX)tangodb:3306
endif
DOCKER_COMPOSE_ARGS := DISPLAY=$(DISPLAY) XAUTHORITY=$(XAUTHORITY) TANGO_HOST=$(TANGO_HOST) \
NETWORK_MODE=$(NETWORK_MODE) XAUTHORITY_MOUNT=$(XAUTHORITY_MOUNT) MYSQL_HOST=$(MYSQL_HOST) \
DOCKER_REGISTRY_HOST=$(DOCKER_REGISTRY_HOST) DOCKER_REGISTRY_USER=$(DOCKER_REGISTRY_USER) \
CONTAINER_NAME_PREFIX=$(CONTAINER_NAME_PREFIX) COMPOSE_IGNORE_ORPHANS=true
#
# Defines a default make target so that help is printed if make is called
# without a target
#
.DEFAULT_GOAL := help
#
# defines a function to copy the ./test-harness directory into the container
# and then runs the requested make target in the container. The container is:
#
# 1. attached to the network of the docker-compose test system
# 2. uses a persistent volume to cache Python eggs and wheels so that fewer
# downloads are required
# 3. uses a transient volume as a working directory, in which untarred files
# and test output can be written in the container and subsequently copied
# to the host
#
make = tar -c test-harness/ | \
docker run -i --rm --network=$(NETWORK_MODE) \
-e TANGO_HOST=$(TANGO_HOST) \
-v $(CACHE_VOLUME):/home/tango/.cache \
--volumes-from=$(CONTAINER_NAME_PREFIX)rsyslog-csplmc:rw \
-v /build -w /build -u tango $(DOCKER_RUN_ARGS) $(IMAGE_TO_TEST) \
bash -c "sudo chown -R tango:tango /build && \
tar x --strip-components 1 --warning=all && \
make TANGO_HOST=$(TANGO_HOST) $1"
test: DOCKER_RUN_ARGS = --volumes-from=$(BUILD)
test: build up ## test the application
@echo "BUILD: $(BUILD)"
$(INIT_CACHE)
$(call make,test); \
status=$$?; \
rm -fr build; \
#docker-compose $(COMPOSE_FILE_ARGS) logs;
docker cp $(BUILD):/build .; \
docker rm -f -v $(BUILD); \
$(MAKE) down; \
exit $$status
lint: DOCKER_RUN_ARGS = --volumes-from=$(BUILD)
lint: build up ## lint the application (static code analysis)
$(INIT_CACHE)
$(call make,lint); \
status=$$?; \
docker cp $(BUILD):/build .; \
$(MAKE) down; \
exit $$status
pull: ## download the application image
docker pull $(IMAGE_TO_TEST)
up: build ## start develop/test environment
ifneq ($(NETWORK_MODE),host)
docker network inspect $(NETWORK_MODE) &> /dev/null || ([ $$? -ne 0 ] && docker network create $(NETWORK_MODE))
endif
#$(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) pull
#to pull only the mid-cbf-mcs image remove comment on row below.
#docker pull $(DOCKER_REGISTRY_HOST)/$(DOCKER_REGISTRY_USER)/mid-cbf-mcs:latest
$(DOCKER_COMPOSE_ARGS) docker-compose -f csp-tangodb.yml up -d
# put a sleep to wait TANGO DB
@sleep 10
$(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) up -d
piplock: build ## overwrite Pipfile.lock with the image version
docker run $(IMAGE_TO_TEST) cat /app/Pipfile.lock > $(CURDIR)/Pipfile.lock
interactive: up
interactive: ## start an interactive session using the project image (caution: R/W mounts source directory to /app)
docker run --rm -it -p 3000:3000 --name=$(CONTAINER_NAME_PREFIX)dev -e TANGO_HOST=$(TANGO_HOST) --network=$(NETWORK_MODE) \
-v $(CURDIR):/app $(IMAGE_TO_TEST) /bin/bash
down: ## stop develop/test environment and any interactive session
docker ps | grep $(CONTAINER_NAME_PREFIX)dev && docker stop $(PROJECT)-dev || true
$(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) down
ifneq ($(NETWORK_MODE),host)
docker network inspect $(NETWORK_MODE) &> /dev/null && ([ $$? -eq 0 ] && docker network rm $(NETWORK_MODE)) || true
endif
dsconfigdump: up ## dump the entire configuration to the file dsconfig.json
docker exec -it $(CONTAINER_NAME_PREFIX)dsconfigdump python -m dsconfig.dump
docker exec -it $(CONTAINER_NAME_PREFIX)dsconfigdump python -m dsconfig.dump > dsconfig.json
dsconfigadd: up ## Add a configuration json file (environment variable DSCONFIG_JSON_FILE) to the database
-docker exec -it $(CONTAINER_NAME_PREFIX)dsconfigdump json2tango -u -w -a $(DSCONFIG_JSON_FILE)
dsconfigcheck: up ## check a json file (environment variable DSCONFIG_JSON_FILE) according to the project lib-maxiv-dsconfig json schema
-docker exec -it $(CONTAINER_NAME_PREFIX)dsconfigdump json2tango -a $(DSCONFIG_JSON_FILE)
help: ## show this help.
@grep -hE '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: all test up down help
# Creates Docker volume for use as a cache, if it doesn't exist already
INIT_CACHE = \
docker volume ls | grep $(CACHE_VOLUME) || \
docker create --name $(CACHE_VOLUME) -v $(CACHE_VOLUME):/cache $(IMAGE_TO_TEST)
# http://cakoose.com/wiki/gnu_make_thunks
BUILD_GEN = $(shell docker create -v /build $(IMAGE_TO_TEST))
BUILD = $(eval BUILD := $(BUILD_GEN))$(BUILD)
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/docker/config/ 0000775 0000000 0000000 00000000000 13707315520 0025232 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/docker/config/csplmc_dsconfig.json 0000664 0000000 0000000 00000042144 13707315520 0031267 0 ustar 00root root 0000000 0000000 {
"classes": {
"CspSubarray": {
"properties": {
"PstBeam": [
"mid_csp_pst/sub_elt/beam_01"
]
}
}
},
"servers": {
"CspMaster": {
"commaster": {
"CspMaster": {
"common/elt/master": {
"attribute_properties": {
"adminMode": {
"abs_change": [
"-1",
"1"
],
"__value": [
"0"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"reportSearchBeamState": {
"__root_att": [
"common/elt/search_beams_monitor/capabilityState"
]
},
"reportTimingBeamState": {
"__root_att": [
"common/elt/timing_beams_monitor/capabilityState"
]
},
"reportVlbiBeamState": {
"__root_att": [
"common/elt/vlbi_beams_monitor/capabilityState"
]
},
"reportSearchBeamHealthState": {
"__root_att": [
"common/elt/search_beams_monitor/capabilityHealthState"
]
},
"reportTimingBeamHealthState":{
"__root_att": [
"common/elt/timing_beams_monitor/capabilityHealthState"
]
},
"reportVlbiBeamHealthState": {
"__root_att": [
"common/elt/vlbi_beams_monitor/capabilityHealthState"
]
},
"reportSearchBeamObsState": {
"__root_att": [
"common/elt/search_beams_monitor/capabilityObsState"
]
},
"reportTimingBeamObsState":{
"__root_att": [
"common/elt/timing_beams_monitor/capabilityObsState"
]
},
"reportVlbiBeamObsState": {
"__root_att": [
"common/elt/vlbi_beams_monitor/capabilityObsState"
]
},
"reportSearchBeamAdminMode": {
"__root_att": [
"common/elt/search_beams_monitor/capabilityAdminMode"
]
},
"reportTimingBeamAdminMode":{
"__root_att": [
"common/elt/timing_beams_monitor/capabilityAdminMode"
]
},
"reportVlbiBeamAdminMode": {
"__root_att": [
"common/elt/vlbi_beams_monitor/capabilityAdminMode"
]
},
"unassignedSearchBeamIDs": {
"__root_att": [
"common/elt/search_beams_monitor/unassignedIDs"
]
},
"unassignedTimingBeamIDs": {
"__root_att": [
"common/elt/timing_beams_monitor/unassignedIDs"
]
},
"unassignedVlbiBeamIDs": {
"__root_att": [
"common/elt/vlbi_beams_monitor/unassignedIDs"
]
},
"numOfUnassignedSearchBeams": {
"__root_att": [
"common/elt/search_beams_monitor/numOfUnassignedIDs"
]
},
"numOfUnassignedTimingBeams": {
"__root_att": [
"common/elt/timing_beams_monitor/numOfUnassignedIDs"
]
},
"numOfUnassignedVlbiBeams": {
"__root_att": [
"common/elt/vlbi_beams_monitor/numOfUnassignedIDs"
]
},
"searchBeamMembership": {
"__root_att": [
"common/elt/search_beams_monitor/capabilityMembership"
]
},
"timingBeamMembership": {
"__root_att": [
"common/elt/timing_beams_monitor/capabilityMembership"
]
},
"vlbiBeamMembership": {
"__root_att": [
"common/elt/vlbi_beams_monitor/capabilityMembership"
]
}
},
"properties": {
"CspCbf": [
"mid_csp_cbf/sub_elt/master"
],
"CspPss": [
"mid_csp_pss/sub_elt/master"
],
"CspPst": [
"mid_csp_pst/sub_elt/master"
],
"SearchBeamsMonitor":[
"common/elt/search_beams_monitor"
],
"TimingBeamsMonitor":[
"common/elt/timing_beams_monitor"
],
"VlbiBeamsMonitor":[
"common/elt/vlbi_beams_monitor"
],
"CspSubarrays": [
"common/elt/subarray_01",
"common/elt/subarray_02"
],
"MaxCapabilities": [
"Subarray:16",
"VlbiBeam:20",
"TimingBeam:16",
"SearchBeam:1500"
],
"polled_attr": [
"healthstate",
"1000",
"adminmode",
"1000",
"state",
"1000",
"csppststate",
"1000",
"cspcbfstate",
"1000",
"csppsthealthstate",
"1000",
"pssadminmode",
"1000",
"cbfadminmode",
"1000",
"csppssstate",
"1000",
"pstadminmode",
"1000",
"oncommandprogress",
"2000",
"offcommandprogress",
"2000",
"standbycommandprogress",
"2000",
"oncmdtimeoutexpired",
"1000",
"offcmdtimeoutexpired",
"1000",
"standbycmdtimeoutexpired",
"1000",
"oncmdfailure",
"1000",
"offcmdfailure",
"1000",
"standbycmdfailure",
"1000",
"cspcbfhealthstate",
"1000",
"csppsshealthstate",
"1000"
]
}
}
}
}
},
"PssMasterSimulator": {
"pss": {
"PssMasterSimulator": {
"mid_csp_pss/sub_elt/master": {
"attribute_properties": {
"adminMode": {
"abs_change": [
"-1",
"1"
],
"__value": [
"3"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"onDurationExpected": {
"__value": [
"10"
]
},
"offDurationExpected": {
"__value": [
"12"
]
},
"standbyDurationExpected": {
"__value": [
"5"
]
},
"onCommandProgress": {
"abs_change": [
"-5",
"5"
]
},
"offCommandProgress": {
"abs_change": [
"-5",
"5"
]
},
"standbyCommandProgress": {
"abs_change": [
"-5",
"5"
]
}
},
"properties": {
"polled_attr": [
"state",
"1000",
"healthstate",
"1000",
"adminmode",
"1000",
"onCommandProgress",
"1000",
"offCommandProgress",
"1000",
"standbyCommandProgress",
"1000"
]
}
}
}
}
},
"CspCapabilityMonitor": {
"searchbeams": {
"CspCapabilityMonitor": {
"common/elt/search_beams_monitor": {
"attribute_properties": {
"adminMode": {
"__value": [
"0"
]
}
},
"properties": {
"CapabilityDevices": [
"common/search_beams/0001",
"common/search_beams/0002",
"common/search_beams/0003"
]
}
}
}
},
"timingbeams": {
"CspCapabilityMonitor": {
"common/elt/timing_beams_monitor": {
"attribute_properties": {
"adminMode": {
"__value": [
"0"
]
}
},
"properties": {
"CapabilityDevices": [
"common/timing_beams/01",
"common/timing_beams/02",
"common/timing_beams/03"
]
}
}
}
},
"vlbibeams": {
"CspCapabilityMonitor": {
"common/elt/vlbi_beams_monitor": {
"attribute_properties": {
"adminMode": {
"__value": [
"0"
]
}
},
"properties": {
"CapabilityDevices": [
"common/vlbi_beams/01",
"common/vlbi_beams/02",
"common/vlbi_beams/03"
]
}
}
}
}
},
"CspSubarray": {
"comsub1": {
"CspSubarray": {
"common/elt/subarray_01": {
"attribute_properties": {
"adminMode": {
"abs_change": [
"-1",
"1"
],
"__value": [
"0"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"obsState": {
"abs_change": [
"-1",
"1"
]
},
"cbfOutputLink": {
"__root_att": [
"mid_csp_cbf/sub_elt/subarray_01/outputLinksDistribution"
]
}
},
"properties": {
"CspMaster": [
"common/elt/master"
],
"CbfSubarray": [
"mid_csp_cbf/sub_elt/subarray_01"
],
"PssSubarray": [
"mid_csp_pss/sub_elt/subarray_01"
],
"SubID": [
"1"
],
"polled_attr": [
"state",
"1000",
"healthstate",
"1000",
"adminmode",
"1000",
"obsstate",
"1000",
"obsmode",
"1000"
]
}
}
}
},
"comsub2": {
"CspSubarray": {
"common/elt/subarray_02": {
"attribute_properties": {
"adminMode": {
"abs_change": [
"-1",
"1"
],
"__value": [
"0"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"obsState": {
"abs_change": [
"-1",
"1"
]
},
"cbfOutputLink": {
"__root_att": [
"mid_csp_cbf/sub_elt/subarray_02/outputLinksDistribution"
]
}
},
"properties": {
"CspMaster": [
"common/elt/master"
],
"SubID": [
"2"
],
"CbfSubarray": [
"mid_csp_cbf/sub_elt/subarray_02"
],
"PssSubarray": [
"mid_csp_pss/sub_elt/subarray_02"
],
"polled_attr": [
"state",
"1000",
"healthstate",
"1000",
"adminmode",
"1000",
"obsstate",
"1000",
"obsmode",
"1000"
]
}
}
}
}
},
"DataBaseds": {
"2": {
"DataBase": {
"sys/database/2": {}
}
}
},
"TangoAccessControl": {
"1": {
"TangoAccessControl": {
"sys/access_control/1": {}
}
}
},
"TangoTest": {
"test": {
"TangoTest": {
"sys/tg_test/1": {}
}
}
}
}
}
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/docker/config/csplmc_dsconfig.json.sav 0000664 0000000 0000000 00000034112 13707315520 0032053 0 ustar 00root root 0000000 0000000 {
"classes": {
"CspSubarray": {
"properties": {
"PstBeam": [
"mid_csp_pst/sub_elt/beam_01"
]
}
}
},
"servers": {
"CspMaster": {
"commaster": {
"CspMaster": {
"common/elt/master": {
"attribute_properties": {
"adminMode": {
"abs_change": [
"-1",
"1"
],
"__value": [
"0"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"reportSearchBeamState": {
"__root_att": [
"common/elt/search_beams_monitor/capabilityState"
]
},
"reportTimingBeamState": {
"__root_att": [
"common/elt/timing_beams_monitor/capabilityState"
]
},
"reportVlbiBeamState": {
"__root_att": [
"common/elt/vlbi_beams_monitor/capabilityState"
]
},
"reportSearchBeamHealthState": {
"__root_att": [
"common/elt/search_beams_monitor/capabilityHealthState"
]
},
"reportTimingBeamHealthState":{
"__root_att": [
"common/elt/timing_beams_monitor/capabilityHealthState"
]
},
"reportVlbiBeamHealthState": {
"__root_att": [
"common/elt/vlbi_beams_monitor/capabilityHealthState"
]
},
"reportSearchBeamObsState": {
"__root_att": [
"common/elt/search_beams_monitor/capabilityObsState"
]
},
"reportTimingBeamObsState":{
"__root_att": [
"common/elt/timing_beams_monitor/capabilityObsState"
]
},
"reportVlbiBeamObsState": {
"__root_att": [
"common/elt/vlbi_beams_monitor/capabilityObsState"
]
},
"reportSearchBeamAdminMode": {
"__root_att": [
"common/elt/search_beams_monitor/capabilityAdminMode"
]
},
"reportTimingBeamAdminMode":{
"__root_att": [
"common/elt/timing_beams_monitor/capabilityAdminMode"
]
},
"reportVlbiBeamAdminMode": {
"__root_att": [
"common/elt/vlbi_beams_monitor/capabilityAdminMode"
]
},
"searchBeamAddresses": {
"__root_att": [
"common/elt/search_beams_monitor/capabilityAddresses"
]
},
"timingBeamAddresses": {
"__root_att": [
"common/elt/timing_beams_monitor/capabilityAddresses"
]
},
"vlbiBeamAddresses": {
"__root_att": [
"common/elt/vlbi_beams_monitor/capabilityAddresses"
]
},
"reservedSearchBeamIDs": {
"__root_att": [
"common/elt/search_beams_monitor/reservedIDs"
]
},
"unassignedSearchBeamIDs": {
"__root_att": [
"common/elt/search_beams_monitor/unassignedIDs"
]
},
"unassignedTimingBeamIDs": {
"__root_att": [
"common/elt/timing_beams_monitor/unassignedIDs"
]
},
"unassignedVlbiBeamIDs": {
"__root_att": [
"common/elt/vlbi_beams_monitor/unassignedIDs"
]
},
"searchBeamMembership": {
"__root_att": [
"common/elt/search_beams_monitor/capabilityMembership"
]
},
"timingBeamMembership": {
"__root_att": [
"common/elt/timing_beams_monitor/capabilityMembership"
]
},
"vlbiBeamMembership": {
"__root_att": [
"common/elt/vlbi_beams_monitor/capabilityMembership"
]
}
},
"properties": {
"CspCbf": [
"mid_csp_cbf/sub_elt/master"
],
"CspPss": [
"mid_csp_pss/sub_elt/master"
],
"CspPst": [
"mid_csp_pst/sub_elt/master"
],
"SearchBeamsMonitor":[
"common/elt/search_beams_monitor"
],
"TimingBeamsMonitor":[
"common/elt/timing_beams_monitor"
],
"VlbiBeamsMonitor":[
"common/elt/vlbi_beams_monitor"
],
"CspSubarrays": [
"common/elt/subarray_01",
"common/elt/subarray_02"
],
"MaxCapabilities": [
"Subarray:16",
"VlbiBeam:20",
"TimingBeam:16",
"SearchBeam:1500"
],
"polled_attr": [
"healthstate",
"1000",
"adminmode",
"1000",
"state",
"1000",
"csppststate",
"1000",
"cspcbfstate",
"1000",
"csppsthealthstate",
"1000",
"pssadminmode",
"1000",
"cbfadminmode",
"1000",
"csppssstate",
"1000",
"pstadminmode",
"1000",
"commandprogress",
"3000",
"cspcbfhealthstate",
"1000",
"csppsshealthstate",
"1000"
]
}
}
}
}
},
"CspCapabilityMonitor": {
"searchbeams": {
"CspCapabilityMonitor": {
"common/elt/search_beams_monitor": {
"attribute_properties": {
"adminMode": {
"__value": [
"0"
]
}
},
"properties": {
"CapabilityDevices": [
"common/search_beams/0001",
"common/search_beams/0002",
"common/search_beams/0003"
]
}
}
}
},
"timingbeams": {
"CspCapabilityMonitor": {
"common/elt/timing_beams_monitor": {
"attribute_properties": {
"adminMode": {
"__value": [
"0"
]
}
},
"properties": {
"CapabilityDevices": [
"common/timing_beams/01",
"common/timing_beams/02",
"common/timing_beams/03"
]
}
}
}
},
"vlbibeams": {
"CspCapabilityMonitor": {
"common/elt/vlbi_beams_monitor": {
"attribute_properties": {
"adminMode": {
"__value": [
"0"
]
}
},
"properties": {
"CapabilityDevices": [
"VlbiBeams": [
"common/vlbi_beams/01",
"common/vlbi_beams/02",
"common/vlbi_beams/03"
]
}
}
}
}
},
"CspSubarray": {
"comsub1": {
"CspSubarray": {
"common/elt/subarray_01": {
"attribute_properties": {
"adminMode": {
"abs_change": [
"-1",
"1"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"obsState": {
"abs_change": [
"-1",
"1"
]
},
"cbfOutputLink": {
"__root_att": [
"mid_csp_cbf/sub_elt/subarray_01/outputLinksDistribution"
]
}
},
"properties": {
"CspMaster": [
"common/elt/master"
],
"CbfSubarray": [
"mid_csp_cbf/sub_elt/subarray_01"
],
"PssSubarray": [
"mid_csp_pss/sub_elt/subarray_01"
],
"SubID": [
"1"
],
"polled_attr": [
"state",
"1000",
"healthstate",
"1000",
"adminmode",
"1000",
"obsstate",
"1000",
"obsmode",
"1000"
]
}
}
}
},
"comsub2": {
"CspSubarray": {
"common/elt/subarray_02": {
"attribute_properties": {
"adminMode": {
"abs_change": [
"-1",
"1"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"obsState": {
"abs_change": [
"-1",
"1"
]
},
"cbfOutputLink": {
"__root_att": [
"mid_csp_cbf/sub_elt/subarray_02/outputLinksDistribution"
]
}
},
"properties": {
"CspMaster": [
"common/elt/master"
],
"SubID": [
"2"
],
"CbfSubarray": [
"mid_csp_cbf/sub_elt/subarray_02"
],
"PssSubarray": [
"mid_csp_pss/sub_elt/subarray_02"
],
"polled_attr": [
"state",
"1000",
"healthstate",
"1000",
"adminmode",
"1000",
"obsstate",
"1000",
"obsmode",
"1000"
]
}
}
}
}
},
"DataBaseds": {
"2": {
"DataBase": {
"sys/database/2": {}
}
}
},
"TangoAccessControl": {
"1": {
"TangoAccessControl": {
"sys/access_control/1": {}
}
}
},
"TangoTest": {
"test": {
"TangoTest": {
"sys/tg_test/1": {}
}
}
}
}
}
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/docker/config/midcbf_dsconfig.json 0000664 0000000 0000000 00000156134 13707315520 0031237 0 ustar 00root root 0000000 0000000 {
"servers": {
"CbfMaster": {
"master": {
"CbfMaster": {
"mid_csp_cbf/sub_elt/master": {
"attribute_properties": {
"adminMode": {
"abs_change": [
"-1",
"1"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
}
},
"properties": {
"CbfSubarray": [
"mid_csp_cbf/sub_elt/subarray_01",
"mid_csp_cbf/sub_elt/subarray_02"
],
"FSP": [
"mid_csp_cbf/fsp/01",
"mid_csp_cbf/fsp/02",
"mid_csp_cbf/fsp/03",
"mid_csp_cbf/fsp/04"
],
"MaxCapabilities": [
"VCC:4",
"FSP:4",
"Subarray:2"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
],
"polled_attr": [
"reportfspstate",
"1000",
"reportvccadminmode",
"1000",
"reportvcchealthstate",
"1000",
"receptortovcc",
"1000",
"reportvccsubarraymembership",
"1000",
"reportfspCorrSubarraymembership",
"1000",
"reportfsphealthstate",
"1000",
"healthstate",
"1000",
"adminmode",
"1000",
"subarrayconfigid",
"1000",
"reportfspadminmode",
"1000",
"commandprogress",
"2000",
"reportsubarrayhealthstate",
"1000",
"reportvccstate",
"1000",
"reportsubarrayadminmode",
"1000",
"vcctoreceptor",
"3000",
"reportsubarraystate",
"3000",
"state",
"1000"
]
}
}
}
}
},
"CbfSubarrayMulti": {
"cbfSubarray-01": {
"CbfSubarray": {
"mid_csp_cbf/sub_elt/subarray_01": {
"attribute_properties": {
"adminMode": {
"abs_change": [
"-1",
"1"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"obsState": {
"abs_change": [
"-1",
"1"
]
},
"scanID": {
"abs_change": [
"-1",
"1"
]
}
},
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"FSP": [
"mid_csp_cbf/fsp/01",
"mid_csp_cbf/fsp/02",
"mid_csp_cbf/fsp/03",
"mid_csp_cbf/fsp/04"
],
"FspCorrSubarray": [
"mid_csp_cbf/fspCorrSubarray/01_01",
"mid_csp_cbf/fspCorrSubarray/02_01",
"mid_csp_cbf/fspCorrSubarray/03_01",
"mid_csp_cbf/fspCorrSubarray/04_01"
],
"FspPssSubarray": [
"mid_csp_cbf/fspPssSubarray/01_01",
"mid_csp_cbf/fspPssSubarray/02_01",
"mid_csp_cbf/fspPssSubarray/03_01",
"mid_csp_cbf/fspPssSubarray/04_01"
],
"SW1Address": [
"mid_csp_cbf/sw1/01"
],
"SW2Address": [
"mid_csp_cbf/sw2/01"
],
"PssConfigAddress": [
"mid_csp_cbf/pssconfig/01"
],
"CorrConfigAddress": [
"mid_csp_cbf/corrconfig/01"
],
"SubID": [
"1"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
],
"polled_attr": [
"state",
"1000",
"healthstate",
"1000",
"adminmode",
"1000",
"fsphealthstate",
"1000",
"fspstate",
"1000",
"vccstate",
"1000",
"vcchealthstate",
"1000",
"obsstate",
"1000",
"configid",
"1000",
"fspList",
"1000",
"outputLinksDistribution",
"1000"
]
}
}
},
"SearchWindow": {
"mid_csp_cbf/sw1/01": {},
"mid_csp_cbf/sw2/01": {}
},
"CbfSubarrayPssConfig": {
"mid_csp_cbf/pssConfig/01": {
"properties": {
"FspPssSubarray": [
"mid_csp_cbf/fspPssSubarray/01_01",
"mid_csp_cbf/fspPssSubarray/02_01",
"mid_csp_cbf/fspPssSubarray/03_01",
"mid_csp_cbf/fspPssSubarray/04_01"
],
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
]
}
}
},
"CbfSubarrayCorrConfig": {
"mid_csp_cbf/corrConfig/01": {
"properties": {
"FspCorrSubarray": [
"mid_csp_cbf/fspCorrSubarray/01_01",
"mid_csp_cbf/fspCorrSubarray/02_01",
"mid_csp_cbf/fspCorrSubarray/03_01",
"mid_csp_cbf/fspCorrSubarray/04_01"
],
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
]
}
}
},
"SendConfig": {
"mid_csp_cbf/SendConfig/01": {
"properties": {
"SubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_01"
]
}
}
}
},
"cbfSubarray-02": {
"CbfSubarray": {
"mid_csp_cbf/sub_elt/subarray_02": {
"attribute_properties": {
"adminMode": {
"abs_change": [
"-1",
"1"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"obsState": {
"abs_change": [
"-1",
"1"
]
},
"scanID": {
"abs_change": [
"-1",
"1"
]
}
},
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"FSP": [
"mid_csp_cbf/fsp/01",
"mid_csp_cbf/fsp/02",
"mid_csp_cbf/fsp/03",
"mid_csp_cbf/fsp/04"
],
"FspCorrSubarray": [
"mid_csp_cbf/fspCorrSubarray/01_02",
"mid_csp_cbf/fspCorrSubarray/02_02",
"mid_csp_cbf/fspCorrSubarray/03_02",
"mid_csp_cbf/fspCorrSubarray/04_02"
],
"FspPssSubarray": [
"mid_csp_cbf/fspPssSubarray/01_02",
"mid_csp_cbf/fspPssSubarray/02_02",
"mid_csp_cbf/fspPssSubarray/03_02",
"mid_csp_cbf/fspPssSubarray/04_02"
],
"SW1Address": [
"mid_csp_cbf/sw1/02"
],
"SW2Address": [
"mid_csp_cbf/sw2/02"
],
"PssConfigAddress": [
"mid_csp_cbf/pssconfig/02"
],
"CorrConfigAddress": [
"mid_csp_cbf/corrconfig/01"
],
"SubID": [
"2"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
],
"polled_attr": [
"configid",
"1000",
"healthstate",
"1000",
"state",
"1000",
"obsstate",
"1000",
"vcchealthstate",
"1000",
"adminmode",
"1000",
"fspstate",
"1000",
"fspList",
"1000",
"fsphealthstate",
"1000",
"vccstate",
"1000",
"outputLinksDistribution",
"1000"
]
}
}
},
"SearchWindow": {
"mid_csp_cbf/sw1/02": {},
"mid_csp_cbf/sw2/02": {}
},
"CbfSubarrayPssConfig": {
"mid_csp_cbf/pssConfig/02": {
"properties": {
"FspPssSubarray": [
"mid_csp_cbf/fspPssSubarray/01_02",
"mid_csp_cbf/fspPssSubarray/02_02",
"mid_csp_cbf/fspPssSubarray/03_02",
"mid_csp_cbf/fspPssSubarray/04_02"
],
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
]
}
}
},
"CbfSubarrayCorrConfig": {
"mid_csp_cbf/corrConfig/02": {
"properties": {
"FspCorrSubarray": [
"mid_csp_cbf/fspCorrSubarray/01_02",
"mid_csp_cbf/fspCorrSubarray/02_02",
"mid_csp_cbf/fspCorrSubarray/03_02",
"mid_csp_cbf/fspCorrSubarray/04_02"
],
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
]
}
}
},
"SendConfig": {
"mid_csp_cbf/SendConfig/02": {
"properties": {
"SubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_02"
]
}
}
}
}
},
"DataBaseds": {
"2": {
"DataBase": {
"sys/database/2": {}
}
}
},
"FspMulti": {
"fsp-01": {
"Fsp": {
"mid_csp_cbf/fsp/01": {
"attribute_properties": {
"adminMode": {
"abs_change": [
"-1",
"1"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"subarrayMembership": {
"abs_change": [
"-1",
"1"
]
}
},
"properties": {
"CorrelationAddress": [
"mid_csp_cbf/fsp_corr/01"
],
"FspID": [
"1"
],
"PSSAddress": [
"mid_csp_cbf/fsp_pss/01"
],
"PSTAddress": [
"mid_csp_cbf/fsp_pst/01"
],
"VLBIAddress": [
"mid_csp_cbf/fsp_vlbi/01"
],
"FspCorrSubarray": [
"mid_csp_cbf/fspCorrSubarray/01_01",
"mid_csp_cbf/fspCorrSubarray/01_02"
],
"FspPssSubarray": [
"mid_csp_cbf/fspPssSubarray/01_01",
"mid_csp_cbf/fspPssSubarray/01_02"
],
"polled_attr": [
"adminmode",
"1000",
"healthstate",
"1000",
"state",
"1000",
"subarraymembership",
"1000"
]
}
}
},
"FspCorr": {
"mid_csp_cbf/fsp_corr/01": {}
},
"FspPss": {
"mid_csp_cbf/fsp_pss/01": {}
},
"FspPst": {
"mid_csp_cbf/fsp_pst/01": {}
},
"FspCorrSubarray": {
"mid_csp_cbf/fspCorrSubarray/01_01": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_01"
],
"FspID": [
"1"
],
"SubID": [
"1"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
},
"mid_csp_cbf/fspCorrSubarray/01_02": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_02"
],
"FspID": [
"1"
],
"SubID": [
"2"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
}
},
"FspPssSubarray": {
"mid_csp_cbf/fspPssSubarray/01_01": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_01"
],
"FspID": [
"1"
],
"SubID": [
"1"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
},
"mid_csp_cbf/fspPssSubarray/01_02": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_02"
],
"FspID": [
"1"
],
"SubID": [
"2"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
}
},
"FspVlbi": {
"mid_csp_cbf/fsp_vlbi/01": {}
}
},
"fsp-02": {
"Fsp": {
"mid_csp_cbf/fsp/02": {
"attribute_properties": {
"adminMode": {
"abs_change": [
"-1",
"1"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"subarrayMembership": {
"abs_change": [
"-1",
"1"
]
}
},
"properties": {
"CorrelationAddress": [
"mid_csp_cbf/fsp_corr/02"
],
"FspID": [
"2"
],
"PSSAddress": [
"mid_csp_cbf/fsp_pss/02"
],
"PSTAddress": [
"mid_csp_cbf/fsp_pst/02"
],
"VLBIAddress": [
"mid_csp_cbf/fsp_vlbi/02"
],
"FspCorrSubarray": [
"mid_csp_cbf/fspCorrSubarray/02_01",
"mid_csp_cbf/fspCorrSubarray/02_02"
],
"FspPssSubarray": [
"mid_csp_cbf/fspPssSubarray/02_01",
"mid_csp_cbf/fspPssSubarray/02_02"
],
"polled_attr": [
"adminmode",
"1000",
"healthstate",
"1000",
"state",
"1000",
"subarraymembership",
"1000"
]
}
}
},
"FspCorr": {
"mid_csp_cbf/fsp_corr/02": {}
},
"FspPss": {
"mid_csp_cbf/fsp_pss/02": {}
},
"FspPst": {
"mid_csp_cbf/fsp_pst/02": {}
},
"FspCorrSubarray": {
"mid_csp_cbf/fspCorrSubarray/02_01": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_01"
],
"FspID": [
"2"
],
"SubID": [
"1"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
},
"mid_csp_cbf/fspCorrSubarray/02_02": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_02"
],
"FspID": [
"2"
],
"SubID": [
"2"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
}
},
"FspPssSubarray": {
"mid_csp_cbf/fspPssSubarray/02_01": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_01"
],
"FspID": [
"2"
],
"SubID": [
"1"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
},
"mid_csp_cbf/fspPssSubarray/02_02": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_02"
],
"FspID": [
"2"
],
"SubID": [
"2"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
}
},
"FspVlbi": {
"mid_csp_cbf/fsp_vlbi/02": {}
}
},
"fsp-03": {
"Fsp": {
"mid_csp_cbf/fsp/03": {
"attribute_properties": {
"adminMode": {
"abs_change": [
"-1",
"1"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"subarrayMembership": {
"abs_change": [
"-1",
"1"
]
}
},
"properties": {
"CorrelationAddress": [
"mid_csp_cbf/fsp_corr/03"
],
"FspID": [
"3"
],
"PSSAddress": [
"mid_csp_cbf/fsp_pss/03"
],
"PSTAddress": [
"mid_csp_cbf/fsp_pst/03"
],
"VLBIAddress": [
"mid_csp_cbf/fsp_vlbi/03"
],
"FspCorrSubarray": [
"mid_csp_cbf/fspCorrSubarray/03_01",
"mid_csp_cbf/fspCorrSubarray/03_02"
],
"FspPssSubarray": [
"mid_csp_cbf/fspPssSubarray/03_01",
"mid_csp_cbf/fspPssSubarray/03_02"
],
"polled_attr": [
"adminmode",
"1000",
"healthstate",
"1000",
"state",
"1000",
"subarraymembership",
"1000"
]
}
}
},
"FspCorr": {
"mid_csp_cbf/fsp_corr/03": {}
},
"FspPss": {
"mid_csp_cbf/fsp_pss/03": {}
},
"FspPst": {
"mid_csp_cbf/fsp_pst/03": {}
},
"FspCorrSubarray": {
"mid_csp_cbf/fspCorrSubarray/03_01": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_01"
],
"FspID": [
"3"
],
"SubID": [
"1"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
},
"mid_csp_cbf/fspCorrSubarray/03_02": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_02"
],
"FspID": [
"3"
],
"SubID": [
"2"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
}
},
"FspPssSubarray": {
"mid_csp_cbf/fspPssSubarray/03_01": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_01"
],
"FspID": [
"3"
],
"SubID": [
"1"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
},
"mid_csp_cbf/fspPssSubarray/03_02": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_02"
],
"FspID": [
"3"
],
"SubID": [
"2"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
}
},
"FspVlbi": {
"mid_csp_cbf/fsp_vlbi/03": {}
}
},
"fsp-04": {
"Fsp": {
"mid_csp_cbf/fsp/04": {
"attribute_properties": {
"adminMode": {
"abs_change": [
"-1",
"1"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"subarrayMembership": {
"abs_change": [
"-1",
"1"
]
}
},
"properties": {
"CorrelationAddress": [
"mid_csp_cbf/fsp_corr/04"
],
"FspID": [
"4"
],
"PSSAddress": [
"mid_csp_cbf/fsp_pss/04"
],
"PSTAddress": [
"mid_csp_cbf/fsp_pst/04"
],
"VLBIAddress": [
"mid_csp_cbf/fsp_vlbi/04"
],
"FspCorrSubarray": [
"mid_csp_cbf/fspCorrSubarray/04_01",
"mid_csp_cbf/fspCorrSubarray/04_02"
],
"FspPssSubarray": [
"mid_csp_cbf/fspPssSubarray/04_01",
"mid_csp_cbf/fspPssSubarray/04_02"
],
"polled_attr": [
"adminmode",
"1000",
"healthstate",
"1000",
"state",
"1000",
"subarraymembership",
"1000"
]
}
}
},
"FspCorr": {
"mid_csp_cbf/fsp_corr/04": {}
},
"FspPss": {
"mid_csp_cbf/fsp_pss/04": {}
},
"FspPst": {
"mid_csp_cbf/fsp_pst/04": {}
},
"FspCorrSubarray": {
"mid_csp_cbf/fspCorrSubarray/04_01": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_01"
],
"FspID": [
"4"
],
"SubID": [
"1"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
},
"mid_csp_cbf/fspCorrSubarray/04_02": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_02"
],
"FspID": [
"4"
],
"SubID": [
"2"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
}
},
"FspPssSubarray": {
"mid_csp_cbf/fspPssSubarray/04_01": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_01"
],
"FspID": [
"4"
],
"SubID": [
"1"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
},
"mid_csp_cbf/fspPssSubarray/04_02": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_02"
],
"FspID": [
"4"
],
"SubID": [
"2"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
}
},
"FspVlbi": {
"mid_csp_cbf/fsp_vlbi/04": {}
}
}
},
"TangoAccessControl": {
"1": {
"TangoAccessControl": {
"sys/access_control/1": {}
}
}
},
"TangoTest": {
"test": {
"TangoTest": {
"sys/tg_test/1": {}
}
}
},
"VccMulti": {
"vcc-001": {
"Vcc": {
"mid_csp_cbf/vcc/001": {
"attribute_properties": {
"adminMode": {
"abs_change": [
"-1",
"1"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"subarrayMembership": {
"abs_change": [
"-1",
"1"
]
}
},
"properties": {
"Band1And2Address": [
"mid_csp_cbf/vcc_band12/001"
],
"Band3Address": [
"mid_csp_cbf/vcc_band3/001"
],
"Band4Address": [
"mid_csp_cbf/vcc_band4/001"
],
"Band5Address": [
"mid_csp_cbf/vcc_band5/001"
],
"SW1Address": [
"mid_csp_cbf/vcc_sw1/001"
],
"SW2Address": [
"mid_csp_cbf/vcc_sw2/001"
],
"VccID": [
"1"
],
"polled_attr": [
"state",
"1000",
"healthstate",
"1000",
"adminmode",
"1000",
"subarraymembership",
"1000"
]
}
}
},
"VccBand1And2": {
"mid_csp_cbf/vcc_band12/001": {}
},
"VccBand3": {
"mid_csp_cbf/vcc_band3/001": {}
},
"VccBand4": {
"mid_csp_cbf/vcc_band4/001": {}
},
"VccBand5": {
"mid_csp_cbf/vcc_band5/001": {}
},
"VccSearchWindow": {
"mid_csp_cbf/vcc_sw1/001": {},
"mid_csp_cbf/vcc_sw2/001": {}
}
},
"vcc-002": {
"Vcc": {
"mid_csp_cbf/vcc/002": {
"attribute_properties": {
"adminMode": {
"abs_change": [
"-1",
"1"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"subarrayMembership": {
"abs_change": [
"-1",
"1"
]
}
},
"properties": {
"Band1And2Address": [
"mid_csp_cbf/vcc_band12/002"
],
"Band3Address": [
"mid_csp_cbf/vcc_band3/002"
],
"Band4Address": [
"mid_csp_cbf/vcc_band4/002"
],
"Band5Address": [
"mid_csp_cbf/vcc_band5/002"
],
"SW1Address": [
"mid_csp_cbf/vcc_sw1/002"
],
"SW2Address": [
"mid_csp_cbf/vcc_sw2/002"
],
"VccID": [
"2"
],
"polled_attr": [
"state",
"1000",
"healthstate",
"1000",
"adminmode",
"1000",
"subarraymembership",
"1000"
]
}
}
},
"VccBand1And2": {
"mid_csp_cbf/vcc_band12/002": {}
},
"VccBand3": {
"mid_csp_cbf/vcc_band3/002": {}
},
"VccBand4": {
"mid_csp_cbf/vcc_band4/002": {}
},
"VccBand5": {
"mid_csp_cbf/vcc_band5/002": {}
},
"VccSearchWindow": {
"mid_csp_cbf/vcc_sw1/002": {},
"mid_csp_cbf/vcc_sw2/002": {}
}
},
"vcc-003": {
"Vcc": {
"mid_csp_cbf/vcc/003": {
"attribute_properties": {
"adminMode": {
"abs_change": [
"-1",
"1"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"subarrayMembership": {
"abs_change": [
"-1",
"1"
]
}
},
"properties": {
"Band1And2Address": [
"mid_csp_cbf/vcc_band12/003"
],
"Band3Address": [
"mid_csp_cbf/vcc_band3/003"
],
"Band4Address": [
"mid_csp_cbf/vcc_band4/003"
],
"Band5Address": [
"mid_csp_cbf/vcc_band5/003"
],
"SW1Address": [
"mid_csp_cbf/vcc_sw1/003"
],
"SW2Address": [
"mid_csp_cbf/vcc_sw2/003"
],
"VccID": [
"3"
],
"polled_attr": [
"state",
"1000",
"healthstate",
"1000",
"adminmode",
"1000",
"subarraymembership",
"1000"
]
}
}
},
"VccBand1And2": {
"mid_csp_cbf/vcc_band12/003": {}
},
"VccBand3": {
"mid_csp_cbf/vcc_band3/003": {}
},
"VccBand4": {
"mid_csp_cbf/vcc_band4/003": {}
},
"VccBand5": {
"mid_csp_cbf/vcc_band5/003": {}
},
"VccSearchWindow": {
"mid_csp_cbf/vcc_sw1/003": {},
"mid_csp_cbf/vcc_sw2/003": {}
}
},
"vcc-004": {
"Vcc": {
"mid_csp_cbf/vcc/004": {
"attribute_properties": {
"adminMode": {
"abs_change": [
"-1",
"1"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"subarrayMembership": {
"abs_change": [
"-1",
"1"
]
}
},
"properties": {
"Band1And2Address": [
"mid_csp_cbf/vcc_band12/004"
],
"Band3Address": [
"mid_csp_cbf/vcc_band3/004"
],
"Band4Address": [
"mid_csp_cbf/vcc_band4/004"
],
"Band5Address": [
"mid_csp_cbf/vcc_band5/004"
],
"SW1Address": [
"mid_csp_cbf/vcc_sw1/004"
],
"SW2Address": [
"mid_csp_cbf/vcc_sw2/004"
],
"VccID": [
"4"
],
"polled_attr": [
"state",
"1000",
"healthstate",
"1000",
"adminmode",
"1000",
"subarraymembership",
"1000"
]
}
}
},
"VccBand1And2": {
"mid_csp_cbf/vcc_band12/004": {}
},
"VccBand3": {
"mid_csp_cbf/vcc_band3/004": {}
},
"VccBand4": {
"mid_csp_cbf/vcc_band4/004": {}
},
"VccBand5": {
"mid_csp_cbf/vcc_band5/004": {}
},
"VccSearchWindow": {
"mid_csp_cbf/vcc_sw1/004": {},
"mid_csp_cbf/vcc_sw2/004": {}
}
}
},
"TmCspSubarrayLeafNodeTest": {
"tm": {
"TmCspSubarrayLeafNodeTest": {
"ska_mid/tm_leaf_node/csp_subarray_01": {
"attribute_properties": {
"dopplerPhaseCorrection": {
"abs_change": [
"-1",
"1"
]
}
},
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_01"
],
"polled_attr": [
"delaymodel",
"1000",
"visdestinationaddress",
"1000",
"dopplerphasecorrection",
"1000"
]
}
}
}
}
}
}
}
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/docker/csp-lmc.yml 0000664 0000000 0000000 00000011265 13707315520 0026053 0 ustar 00root root 0000000 0000000 #
# Docker compose file for TANGO database and database device server
#
# Defines:
# - tangodb: MariaDB database with TANGO schema
# - databaseds: TANGO database device server
# - rsyslog-csplmc: rsyslog service for logger
# - cspmaster: CspMaster device
#
# Requires:
# - None
#
version: '2.2'
services:
csp_dsconfig:
image: nexus.engageska-portugal.pt/ska-docker/tango-dsconfig:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}csp_dsconfig
depends_on:
- databaseds
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
json2tango -w -a -u csplmc/config/csplmc_dsconfig.json && sleep infinity"
volumes:
- .:/csplmc
cspsubarray01:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/csp-lmc-common:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}cspsubarray01
depends_on:
- csp_dsconfig
- cspmaster
- rsyslog-csplmc
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=30 --strict --
retry --max=5 -- tango_admin --ping-device common/elt/master &&\
/venv/bin/python -m csp_lmc_common.CspSubarray comsub1"
volumes_from:
- rsyslog-csplmc:rw
cspsubarray02:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/csp-lmc-common:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}cspsubarray02
depends_on:
- csp_dsconfig
- cspmaster
- rsyslog-csplmc
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=30 --strict --
retry --max=5 -- tango_admin --ping-device common/elt/master &&\
/venv/bin/python -m csp_lmc_common.CspSubarray comsub2"
volumes_from:
- rsyslog-csplmc:rw
cspmaster:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/csp-lmc-common:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}cspmaster
depends_on:
- csp_dsconfig
- cbfmaster
- rsyslog-csplmc
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=30 --strict --
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/sub_elt/master &&\
/venv/bin/python -m csp_lmc_common.CspMaster commaster"
volumes_from:
- rsyslog-csplmc:rw
searchbeam:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/csp-lmc-common:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}searchbeam
depends_on:
- csp_dsconfig
- rsyslog-csplmc
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=30 --strict --
/venv/bin/python -m csp_lmc_common.CspCapabilityMonitor searchbeams"
volumes_from:
- rsyslog-csplmc:rw
timingbeam:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/csp-lmc-common:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}timingbeam
depends_on:
- csp_dsconfig
- rsyslog-csplmc
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=30 --strict --
/venv/bin/python -m csp_lmc_common.CspCapabilityMonitor timingbeams"
volumes_from:
- rsyslog-csplmc:rw
vlbibeam:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/csp-lmc-common:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}vlbibeam
depends_on:
- csp_dsconfig
- rsyslog-csplmc
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=30 --strict --
/venv/bin/python -m csp_lmc_common.CspCapabilityMonitor vlbibeams"
volumes_from:
- rsyslog-csplmc:rw
# Re-enable next lines to test CSP.LMC with PSS Master simulator
# pssmaster:
# image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/csp-lmc-common:latest
# network_mode: ${NETWORK_MODE}
# container_name: ${CONTAINER_NAME_PREFIX}pssmaster
# depends_on:
# - csp_dsconfig
# - rsyslog-csplmc
# environment:
# - TANGO_HOST=${TANGO_HOST}
# command: >
# sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=30 --strict --
# /venv/bin/python /app/simulators/DeviceTestMaster/PssMasterSimulator.py pss"
# volumes_from:
# - rsyslog-csplmc:rw
rsyslog-csplmc:
image: jumanjiman/rsyslog
container_name: ${CONTAINER_NAME_PREFIX}rsyslog-csplmc
network_mode: ${NETWORK_MODE}
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/docker/csp-tangodb.yml 0000664 0000000 0000000 00000002321 13707315520 0026707 0 ustar 00root root 0000000 0000000 #
# Docker compose file for TANGO database and database device server
#
# Defines:
# - tangodb: MariaDB database with TANGO schema
# - databaseds: TANGO database device server
#
# Requires:
# - None
#
version: '2.2'
volumes:
common-tangodb: {}
services:
tangodb:
image: nexus.engageska-portugal.pt/ska-docker/tango-db:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}tangodb
environment:
- MYSQL_ROOT_PASSWORD=secret
- MYSQL_DATABASE=tango
- MYSQL_USER=tango
- MYSQL_PASSWORD=tango
- MYSQL_INITDB_SKIP_TZINFO=1
volumes:
- common-tangodb:/var/lib/mysql
databaseds:
image: nexus.engageska-portugal.pt/ska-docker/tango-cpp:latest
depends_on:
- tangodb
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}databaseds
environment:
- MYSQL_HOST=${MYSQL_HOST}
- MYSQL_DATABASE=tango
- MYSQL_USER=tango
- MYSQL_PASSWORD=tango
- TANGO_HOST=${TANGO_HOST}
entrypoint:
- /usr/local/bin/wait-for-it.sh
- ${MYSQL_HOST}
- --timeout=70
- --strict
- --
- /usr/local/bin/DataBaseds
- "2"
- -ORBendPoint
- giop:tcp::10000
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/docker/mid-cbf-mcs.yml 0000664 0000000 0000000 00000023212 13707315520 0026571 0 ustar 00root root 0000000 0000000 #
# Docker compose file for TANGO database and database device server
#
# Defines:
# - tangodb: MariaDB database with TANGO schema
# - databaseds: TANGO database device server
# - rsyslog-cbf-csplmc: rsyslog-cbf service for logger
# - cspmaster: CspMaster device
#
# Requires:
# - None
#
version: '2.2'
services:
cbf_dsconfig:
image: nexus.engageska-portugal.pt/ska-docker/tango-dsconfig:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}cbf_dsconfig
depends_on:
- databaseds
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
json2tango -w -a -u csplmc/config/midcbf_dsconfig.json && sleep infinity"
volumes:
- .:/csplmc
cbfmaster:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:0.4.1-7ec0bbf
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}cbfmaster
depends_on:
- databaseds
- cbf_dsconfig
- vcc001
- vcc002
- vcc003
- vcc004
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/vcc/001 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/vcc/002 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/vcc/003 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/vcc/004 &&\
/venv/bin/python /app/tangods/CbfMaster/CbfMaster/CbfMaster.py master"
volumes_from:
- rsyslog-cbf:rw
cbfsubarray01:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:0.4.1-7ec0bbf
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}cbfsubarray01
depends_on:
- cbf_dsconfig
- vcc001
- vcc002
- vcc003
- vcc004
- cbfmaster
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/sub_elt/master &&\
/venv/bin/python /app/tangods/CbfSubarray/CbfSubarrayMulti/CbfSubarrayMulti.py cbfSubarray-01"
volumes_from:
- rsyslog-cbf:rw
cbfsubarray02:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:0.4.1-7ec0bbf
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}cbfsubarray02
depends_on:
- cbf_dsconfig
- vcc001
- vcc002
- vcc003
- vcc004
- cbfmaster
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/sub_elt/master &&\
/venv/bin/python /app/tangods/CbfSubarray/CbfSubarrayMulti/CbfSubarrayMulti.py cbfSubarray-02"
volumes_from:
- rsyslog-cbf:rw
vcc001:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:0.4.1-7ec0bbf
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}vcc001
depends_on:
- databaseds
- cbf_dsconfig
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/01 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/02 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/03 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/04 &&\
/venv/bin/python /app/tangods/Vcc/VccMulti/VccMulti.py vcc-001"
volumes_from:
- rsyslog-cbf:rw
vcc002:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:0.4.1-7ec0bbf
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}vcc002
depends_on:
- databaseds
- cbf_dsconfig
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/01 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/02 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/03 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/04 &&\
/venv/bin/python /app/tangods/Vcc/VccMulti/VccMulti.py vcc-002"
volumes_from:
- rsyslog-cbf:rw
vcc003:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:0.4.1-7ec0bbf
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}vcc003
depends_on:
- databaseds
- cbf_dsconfig
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/01 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/02 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/03 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/04 &&\
/venv/bin/python /app/tangods/Vcc/VccMulti/VccMulti.py vcc-003"
volumes_from:
- rsyslog-cbf:rw
vcc004:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:0.4.1-7ec0bbf
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}vcc004
depends_on:
- databaseds
- cbf_dsconfig
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/01 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/02 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/03 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/04 &&\
/venv/bin/python /app/tangods/Vcc/VccMulti/VccMulti.py vcc-004"
volumes_from:
- rsyslog-cbf:rw
fsp01:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:0.4.1-7ec0bbf
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}fsp01
depends_on:
- databaseds
- cbf_dsconfig
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
/venv/bin/python /app/tangods/Fsp/FspMulti/FspMulti.py fsp-01"
volumes_from:
- rsyslog-cbf:rw
fsp02:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:0.4.1-7ec0bbf
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}fsp02
depends_on:
- databaseds
- cbf_dsconfig
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
/venv/bin/python /app/tangods/Fsp/FspMulti/FspMulti.py fsp-02"
volumes_from:
- rsyslog-cbf:rw
fsp03:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:0.4.1-7ec0bbf
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}fsp03
depends_on:
- databaseds
- cbf_dsconfig
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
/venv/bin/python /app/tangods/Fsp/FspMulti/FspMulti.py fsp-03"
volumes_from:
- rsyslog-cbf:rw
fsp04:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:0.4.1-7ec0bbf
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}fsp04
depends_on:
- databaseds
- cbf_dsconfig
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
/venv/bin/python /app/tangods/Fsp/FspMulti/FspMulti.py fsp-04"
volumes_from:
- rsyslog-cbf:rw
tmcspsubarrayleafnodetest:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:0.4.1-7ec0bbf
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}tmcspsubarrayleafnodetest
depends_on:
- cspmaster
- databaseds
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
retry --max=10 -- tango_admin --ping-device mid_csp_cbf/sub-elt/subarray_01 &&
/venv/bin/python /app/tangods/TmCspSubarrayLeafNodeTest/TmCspSubarrayLeafNodeTest.py tm"
volumes_from:
- rsyslog-cbf:rw
tmcspsubarrayleafnodetest2:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:0.4.1-7ec0bbf
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}tmcspsubarrayleafnodetest2
depends_on:
- cspmaster
- databaseds
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
retry --max=10 -- tango_admin --ping-device mid_csp_cbf/sub-elt/subarray_02 &&
/venv/bin/python /app/tangods/TmCspSubarrayLeafNodeTest/TmCspSubarrayLeafNodeTest.py tm2"
volumes_from:
- rsyslog-cbf:rw
rsyslog-cbf:
image: jumanjiman/rsyslog
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}rsyslog-cbf
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/docker/test-harness/ 0000775 0000000 0000000 00000000000 13707315520 0026405 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/docker/test-harness/Makefile 0000664 0000000 0000000 00000003234 13707315520 0030047 0 ustar 00root root 0000000 0000000 # Use bash shell with pipefail option enabled so that the return status of a
# piped command is the value of the last (rightmost) commnand to exit with a
# non-zero status. This lets us pipe output into tee but still exit on test
# failures.
SHELL = /bin/bash
.SHELLFLAGS = -o pipefail -c
all: test lint
# wait for the device to be available before beginning the test
# A temporary volume is mounted at /build when 'make test' is executing.
# The following steps copy across useful output to this volume which can
# then be extracted to form the CI summary for the test procedure.
test:
retry --max=10 -- tango_admin --ping-device mid_csp_cbf/sub_elt/master
retry --max=10 -- tango_admin --ping-device mid_csp_cbf/sub_elt/subarray_01
retry --max=10 -- tango_admin --ping-device mid_csp_cbf/sub_elt/subarray_02
retry --max=10 -- tango_admin --ping-device common/elt/master
retry --max=10 -- tango_admin --ping-device common/elt/subarray_01
retry --max=10 -- tango_admin --ping-device common/elt/subarray_02
cd /app && python setup.py test | tee setup_py_test.stdout
mkdir -p /build/reports && \
if [ -d /build ]; then \
mv /app/setup_py_test.stdout /build/csp-lmc-common-setup-test.stdout; \
mv /app/htmlcov /build/csp-lmc-common_htmlcov; \
mv /app/coverage.xml /build; \
fi;
lint:
pip3 install pylint2junit; \
mkdir -p /build/reports; \
cd /app && pylint --output-format=parseable csp_lmc_common | tee /build/csp_lmc_common-code-analysis.stdout; \
cd /app && pylint --output-format=pylint2junit.JunitReporter csp_lmc_common > /build/reports/csp-lmc-common-linting.xml;
.PHONY: all test lint
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/docker/test-harness/README.md 0000664 0000000 0000000 00000000237 13707315520 0027666 0 ustar 00root root 0000000 0000000 This directory is uploaded to the container when 'make test' is executed. Files
in this directory will be found inside /build once uploaded to the container.
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/pogo/ 0000775 0000000 0000000 00000000000 13707315520 0023462 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/pogo/CspBeamCapabilityBaseClass.xmi 0000664 0000000 0000000 00000055530 13707315520 0031306 0 ustar 00root root 0000000 0000000
4
4
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/pogo/CspCapabilityMonitor.xmi 0000664 0000000 0000000 00000057200 13707315520 0030304 0 ustar 00root root 0000000 0000000
4
4
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/pogo/CspMaster.xmi 0000664 0000000 0000000 00000177055 13707315520 0026121 0 ustar 00root root 0000000 0000000
4
16
4
OK
DEGRADED
FAILED
UNKNOWN
OK
DEGRADED
FAILED
UNKNOWN
OK
DEGRADED
FAILED
UNKNOWN
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/pogo/CspSearchBeamCapability.xmi 0000664 0000000 0000000 00000071056 13707315520 0030654 0 ustar 00root root 0000000 0000000
4
4
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/pogo/CspSubarray.xmi 0000664 0000000 0000000 00000234367 13707315520 0026456 0 ustar 00root root 0000000 0000000
4
4
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/pogo/CspSubarrayInherentCapability.xmi 0000664 0000000 0000000 00000056170 13707315520 0032147 0 ustar 00root root 0000000 0000000
4
4
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/pogo/CspSubarrayProcModeCorrelation.xmi 0000664 0000000 0000000 00000055233 13707315520 0032302 0 ustar 00root root 0000000 0000000
4
4
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/pogo/CspSubarrayProcModePss.xmi 0000664 0000000 0000000 00000055173 13707315520 0030571 0 ustar 00root root 0000000 0000000
4
4
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/pogo/CspSubarrayProcModePst.xmi 0000664 0000000 0000000 00000055170 13707315520 0030567 0 ustar 00root root 0000000 0000000
4
4
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/pogo/CspSubarrayProcModeVlbi.xmi 0000664 0000000 0000000 00000055173 13707315520 0030720 0 ustar 00root root 0000000 0000000
4
4
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/pogo/CspSubarrayResourcesMonitor.xmi 0000664 0000000 0000000 00000061014 13707315520 0031704 0 ustar 00root root 0000000 0000000
4
4
console::cout
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/pogo/CspTimingBeamCapability.xmi 0000664 0000000 0000000 00000055755 13707315520 0030706 0 ustar 00root root 0000000 0000000
4
4
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/pogo/CspVlbiBeamCapability.xmi 0000664 0000000 0000000 00000055603 13707315520 0030343 0 ustar 00root root 0000000 0000000
4
4
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/setup.cfg 0000664 0000000 0000000 00000001512 13707315520 0024336 0 ustar 00root root 0000000 0000000 [metadata]
description-file = README.md
[aliases]
# Define `python setup.py test`
test=pytest
[coverage:run]
branch = True
#relative_files = True
source = csp-lmc-common
#data_file = csp-lmc-common_coverage
#debug = dataio,dataop
#[coverage:paths]
#source =
# /app
# ./csp-lmc/csp-lmc-common
[tool:pytest]
testpaths = tests
addopts = --forked
--verbose
--cov=csp_lmc_common
--json-report
--json-report-file=htmlcov/report.json
--cov-report=term
--cov-report=html
--cov-report=xml
--junitxml=/build/reports/csp-lmc-common-unit-tests.xml
console_output_style = progress
junit_family=legacy
filterwarnings =
ignore::DeprecationWarning
# Define `python setup.py build_sphinx`
[build_sphinx]
source-dir = docs
build-dir = docs/_build
all_files = 1
builder = html
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/setup.py 0000664 0000000 0000000 00000003666 13707315520 0024243 0 ustar 00root root 0000000 0000000 #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of the CSP.LMC project
#
# Distributed under the terms of the BSD-3-Clause license.
# See LICENSE.txt for more info.
import os
import sys
from setuptools import setup, find_packages
setup_dir = os.path.dirname(os.path.abspath(__file__))
# make sure we use latest info from local code
sys.path.insert(0, setup_dir)
INFO = {}
with open("README.md") as file:
long_description = file.read()
RELEASE_FILENAME = os.path.join(setup_dir, 'csp_lmc_common','release.py')
exec(open(RELEASE_FILENAME).read(), INFO)
setup(
name=INFO['name'],
version=INFO['version'],
description=INFO['description'],
author=INFO['author'],
author_email=INFO['author_email'],
packages=find_packages(),
license=INFO['license'],
url=INFO['url'],
long_description=long_description,
keywords="csp lmc ska tango",
platforms="All Platforms",
include_package_data=True,
install_requires = [
'pytango >9.3.1',
'future',
'lmcbaseclasses==0.6.3'
],
setup_requires=[
'pytest-runner',
'sphinx',
'recommonmark'
],
test_suite="test",
entry_points={'console_scripts':[
'CspMaster = csp_lmc_common.CspMaster:main',
'CspSubarray=csp_lmc_common.CspSubarray:main']},
classifiers=[
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3",
"Operating System :: POSIX :: Linux",
"Intended Audience :: Developers",
"License :: Other/Proprietary License",
"Topic::Scientific/Enineering :: Astronomy",
],
tests_require=[
'pytest',
'coverage',
'pytest-json-report',
'pycodestyle',
'pytest-forked',
'mock'
],
)
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/simulators/ 0000775 0000000 0000000 00000000000 13707315520 0024720 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/simulators/DeviceTestMaster/ 0000775 0000000 0000000 00000000000 13707315520 0030133 5 ustar 00root root 0000000 0000000 DeviceTestMaster.py 0000664 0000000 0000000 00000030750 13707315520 0033646 0 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/simulators/DeviceTestMaster # -*- coding: utf-8 -*-
#
# This file is part of the DeviceTestMaster project
#
#
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
""" CSP.LMC subelement Test Master Tango device prototype
Test TANGO device class to test connection with the CSPMaster prototype.
It simulates the CbfMaster sub-element.
"""
import sys
from collections import defaultdict
import os
import time
import threading
# Tango imports
import tango
from tango import DebugIt
from tango.server import run
from tango.server import Device, DeviceMeta
from tango.server import attribute, command
from tango.server import device_property
from tango import AttrQuality, DispLevel, DevState
from tango import AttrWriteType, PipeWriteType
# Additional import
# PROTECTED REGION ID(DeviceTestMaster.additionnal_import) ENABLED START #
from ska.base.control_model import HealthState, AdminMode
from ska.base import SKAMaster
# PROTECTED REGION END # // DeviceTestMaster.additionnal_import
__all__ = ["DeviceTestMaster", "main"]
class DeviceTestMaster(SKAMaster):
"""
DeviceTestMaster TANGO device class to test connection with the CSPMaster prototype
"""
# PROTECTED REGION ID(DeviceTestMaster.class_variable) ENABLED START #
# PROTECTED REGION END # // DeviceTestMaster.class_variable
# -----------------
# Device Properties
# -----------------
# ----------
# Attributes
# ----------
onCommandProgress = attribute(
dtype='DevUShort',
label="Command progress percentage",
polling_period=1000,
abs_change=5,
max_value=100,
min_value=0,
doc="Percentage progress implemented for commands that result in state/mode transitions for a large \nnumber of components and/or are executed in stages (e.g power up, power down)",
)
offCommandProgress = attribute(
dtype='DevDouble',
polling_period=1000,
abs_change=5,
)
standbyCommandProgress = attribute(
dtype='DevDouble',
polling_period=1000,
abs_change=5,
)
onDurationExpected = attribute(
dtype='DevUShort',
access=AttrWriteType.READ_WRITE,
memorized=True,
)
offDurationExpected = attribute(
dtype='DevUShort',
access=AttrWriteType.READ_WRITE,
memorized=True,
)
standbyDurationExpected = attribute(
dtype='DevUShort',
access=AttrWriteType.READ_WRITE,
memorized=True,
)
# ---------------
# General methods
# ---------------
def init_subelement(self):
"""
Simulate the sub-element device initialization
"""
time.sleep(3)
self.set_state(tango.DevState.STANDBY)
def on_subelement(self):
"""
Simulate the sub-element transition from STANDBY to ON
"""
print("Executing the On command...wait")
while True:
elapsed_time = time.time() - self._start_time
if elapsed_time > self._duration_expected['on']:
break
if elapsed_time > 1:
self._cmd_progress['on'] = elapsed_time* 100/self._duration_expected['on']
print(self._cmd_progress['on'])
self.push_change_event("onCommandProgress", int(self._cmd_progress['on']))
time.sleep(1)
self.set_state(tango.DevState.ON)
self._health_state = HealthState.DEGRADED
self.push_change_event("onCommandProgress", 100)
print("Final state:", self.get_state())
print("End On command...wait")
def standby_subelement(self):
"""
Simulate the sub-element transition from ON to STANDBY
"""
print("Executing the Standby command...wait")
while True:
elapsed_time = time.time() - self._start_time
if elapsed_time > self._duration_expected['standby']:
break
if elapsed_time > 1:
self._cmd_progress['standby'] = elapsed_time* 100/self._duration_expected['standby']
print(self._cmd_progress['standby'])
self.push_change_event("standbyCommandProgress", int(self._cmd_progress['standby']))
time.sleep(1)
self.set_state(tango.DevState.STANDBY)
self.push_change_event("standbyCommandProgress", 100)
print("End Standby command...wait")
def off_subelement(self):
"""
Simulate the sub-element transition from STANDBY to OFF
"""
while True:
elapsed_time = time.time() - self._start_time
if elapsed_time > self._duration_expected['off']:
break
if elapsed_time > 1:
self._cmd_progress['off'] = elapsed_time* 100/self._duration_expected['ff']
self.push_change_event("offCommandProgress", int(self._cmd_progress['off']))
time.sleep(1)
self._health_state = HealthState.UNKNOWN
self.set_state(tango.DevState.OFF)
self.push_change_event("offCommandProgress", 100)
def init_device(self):
SKAMaster.init_device(self)
# PROTECTED REGION ID(DeviceTestMaster.init_device) ENABLED START #
self.set_state(tango.DevState.INIT)
self._health_state = HealthState.UNKNOWN
self._admin_mode = AdminMode.NOT_FITTED
self._duration_expected = defaultdict(lambda:10)
self._cmd_progress = defaultdict(lambda:0)
csp_tango_db = tango.Database()
# read the CSP memorized attributes from the TANGO DB.
# Note: a memorized attribute has defined the attribute
# property '__value'
attribute_properties = csp_tango_db.get_device_attribute_property(self.get_name(),
{'adminMode': ['__value'],
'on': ['__value'],
'elementLoggingLevel': ['__value'],
'centralLoggingLevel': ['__value'],})
self._admin_mode = int(attribute_properties['adminMode']['__value'][0])
# start a timer to simulate device intialization
thread = threading.Timer(1, self.init_subelement)
thread.start()
# PROTECTED REGION END # // DeviceTestMaster.init_device
def always_executed_hook(self):
# PROTECTED REGION ID(DeviceTestMaster.always_executed_hook) ENABLED START #
pass
# PROTECTED REGION END # // DeviceTestMaster.always_executed_hook
def delete_device(self):
# PROTECTED REGION ID(DeviceTestMaster.delete_device) ENABLED START #
pass
# PROTECTED REGION END # // DeviceTestMaster.delete_device
# ------------------
# Attributes methods
# ------------------
def read_onCommandProgress(self):
# PROTECTED REGION ID(DeviceTestMaster.onCommandProgress_read) ENABLED START #
"""Return the onCommandProgress attribute."""
return int(self._cmd_progress['on'])
# PROTECTED REGION END # // DeviceTestMaster.onCommandProgress_read
def read_offCommandProgress(self):
# PROTECTED REGION ID(DeviceTestMaster.offCommandProgress_read) ENABLED START #
"""Return the offCommandProgress attribute."""
return int(self._cmd_progress['off'])
# PROTECTED REGION END # // DeviceTestMaster.offCommandProgress_read
def read_standbyCommandProgress(self):
# PROTECTED REGION ID(DeviceTestMaster.standbyCommandProgress_read) ENABLED START #
"""Return the standbyCommandProgress attribute."""
return int(self._cmd_progress['standby'])
# PROTECTED REGION END # // DeviceTestMaster.standbyCommandProgress_read
def read_onDurationExpected(self):
# PROTECTED REGION ID(DeviceTestMaster.onDurationExpected_read) ENABLED START #
"""Return the onDurationExpected attribute."""
return self._duration_expected['on']
# PROTECTED REGION END # // DeviceTestMaster.onDurationExpected_read
def write_onDurationExpected(self, value):
# PROTECTED REGION ID(DeviceTestMaster.onDurationExpected_write) ENABLED START #
"""Set the onDurationExpected attribute."""
self._duration_expected['on'] = value
# PROTECTED REGION END # // DeviceTestMaster.onDurationExpected_write
def read_offDurationExpected(self):
# PROTECTED REGION ID(DeviceTestMaster.offDurationExpected_read) ENABLED START #
"""Return the offDurationExpected attribute."""
return self._duration_expected['off']
# PROTECTED REGION END # // DeviceTestMaster.offDurationExpected_read
def write_offDurationExpected(self, value):
# PROTECTED REGION ID(DeviceTestMaster.offDurationExpected_write) ENABLED START #
"""Set the offDurationExpected attribute."""
self._duration_expected['off'] = value
# PROTECTED REGION END # // DeviceTestMaster.offDurationExpected_write
def read_standbyDurationExpected(self):
# PROTECTED REGION ID(DeviceTestMaster.standbyDurationExpected_read) ENABLED START #
"""Return the standbyDurationExpected attribute."""
return self._duration_expected['standby']
# PROTECTED REGION END # // DeviceTestMaster.standbyDurationExpected_read
def write_standbyDurationExpected(self, value):
# PROTECTED REGION ID(DeviceTestMaster.standbyDurationExpected_write) ENABLED START #
"""Set the standbyDurationExpected attribute."""
elf._duration_expected['standby'] = value
# PROTECTED REGION END # // DeviceTestMaster.standbyDurationExpected_write
# --------
# Commands
# --------
@command(
doc_in="If the array length is0, the command apllies to the whole\nCSP Element.\nIf the array length is > 1, each array element specifies the FQDN of the\nCSP SubElement to switch ON.",
)
@DebugIt()
def On(self):
# PROTECTED REGION ID(DeviceTestMaster.On) ENABLED START #
print("Processing On command")
self._cmd_progress['on'] = 0
self._start_time = time.time()
thread = threading.Timer(2, self.on_subelement)
thread.start()
# PROTECTED REGION END # // DeviceTestMaster.On
@command(
dtype_in=('str',),
doc_in="If the array length is0, the command apllies to the whole\nCSP Element.\nIf the array length is > 1, each array element specifies the FQDN of the\nCSP SubElement to switch OFF.",
)
@DebugIt()
def Off(self):
# PROTECTED REGION ID(DeviceTestMaster.Off) ENABLED START #
self._cmd_progress['off'] = 0
self._start_time = time.time()
thread = threading.Timer(1, self.off_subelement)
thread.start()
# PROTECTED REGION END # // DeviceTestMaster.Off
@command(
doc_in="If the array length is0, the command apllies to the whole\nCSP Element.\n\
If the array length is > 1, each array element specifies the FQDN of the\n\
CSP SubElement to switch OFF.",
)
@DebugIt()
def Standby(self):
# PROTECTED REGION ID(DeviceTestMaster.Standby) ENABLED START #
self._cmd_progress['standby'] = 0
self._start_time = time.time()
thread = threading.Timer(2, self.standby_subelement)
thread.start()
# PROTECTED REGION END # // DeviceTestMaster.Standby
def is_Off_allowed(self):
# PROTECTED REGION ID(DeviceTestMaster.is_Off_allowed) ENABLED START #
if self.get_state() not in [DevState.STANDBY]:
return False
return True
# PROTECTED REGION END # // DeviceTestMaster.is_Off_allowed.
def is_Standby_allowed(self):
# PROTECTED REGION ID(DeviceTestMaster.is_Standby_allowed) ENABLED START #
if self.get_state() not in [DevState.ON, DevState.OFF]:
return False
return True
# PROTECTED REGION END # // DeviceTestMaster.is_Standby_allowed
def is_On_allowed(self):
# PROTECTED REGION ID(DeviceTestMaster.is_On_allowed) ENABLED START #
if self.get_state() not in [DevState.STANDBY]:
return False
return True
# PROTECTED REGION END # // DeviceTestMaster.is_On_allowed
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
# PROTECTED REGION ID(DeviceTestMaster.main) ENABLED START #
return run((DeviceTestMaster,), args=args, **kwargs)
# PROTECTED REGION END # // DeviceTestMaster.main
if __name__ == '__main__':
main()
PssMasterSimulator.py 0000664 0000000 0000000 00000005741 13707315520 0034256 0 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/simulators/DeviceTestMaster # -*- coding: utf-8 -*-
#
# This file is part of the PssMasterSimulator project
#
# INAF-SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
""" PssMaster Class simulator
"""
from __future__ import absolute_import
import sys
from collections import defaultdict
import os
import time
# Tango imports
import tango
from tango import DebugIt
from tango.server import run
from tango.server import Device
from tango.server import attribute, command
from tango.server import device_property
from tango import AttrQuality, DispLevel, DevState
from tango import AttrWriteType, PipeWriteType
# Additional import
# PROTECTED REGION ID(DeviceTestMaster.additionnal_import) ENABLED START #
import threading
from ska.base.control_model import HealthState, AdminMode
#from csp_lmc_common.util.cspcommons import HealthState, AdminMode
from DeviceTestMaster import DeviceTestMaster
# PROTECTED REGION END # // DeviceTestMaster.additionnal_import
__all__ = ["PssMasterSimulator", "main"]
class PssMasterSimulator(DeviceTestMaster):
"""
**Properties:**
- Device Property
"""
# PROTECTED REGION ID(PssMasterSimulator.class_variable) ENABLED START #
# PROTECTED REGION END # // PssMasterSimulator.class_variable
# -----------------
# Device Properties
# -----------------
# ----------
# Attributes
# ----------
# ---------------
# General methods
# ---------------
def init_device(self):
"""Initialises the attributes and properties of the PssMasterSimulator."""
DeviceTestMaster.init_device(self)
self._health_state = HealthState.OK
self._duration_expected = defaultdict(lambda:4)
# PROTECTED REGION ID(PssMasterSimulator.init_device) ENABLED START #
# PROTECTED REGION END # // PssMasterSimulator.init_device
def always_executed_hook(self):
"""Method always executed before any TANGO command is executed."""
# PROTECTED REGION ID(PssMasterSimulator.always_executed_hook) ENABLED START #
# PROTECTED REGION END # // PssMasterSimulator.always_executed_hook
def delete_device(self):
"""Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command.
"""
# PROTECTED REGION ID(PssMasterSimulator.delete_device) ENABLED START #
# PROTECTED REGION END # // PssMasterSimulator.delete_device
# ------------------
# Attributes methods
# ------------------
# --------
# Commands
# --------
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
# PROTECTED REGION ID(PssMasterSimulator.main) ENABLED START #
return run((PssMasterSimulator,), args=args, **kwargs)
# PROTECTED REGION END # // PssMasterSimulator.main
if __name__ == '__main__':
main()
PstMasterSimulator.py 0000664 0000000 0000000 00000006136 13707315520 0034256 0 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/simulators/DeviceTestMaster # -*- coding: utf-8 -*-
#
# This file is part of the PssMasterSimulator project
#
# INAF-SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
""" PssMaster Class simulator
"""
from __future__ import absolute_import
import sys
from collections import defaultdict
import os
import time
file_path = os.path.dirname(os.path.abspath(__file__))
print(file_path)
module_path = os.path.abspath(os.path.join(file_path, os.pardir)) + "/../utils"
print(module_path)
sys.path.insert(0, module_path)
# Tango imports
import tango
from tango import DebugIt
from tango.server import run
from tango.server import Device, DeviceMeta
from tango.server import attribute, command
from tango.server import device_property
from tango import AttrQuality, DispLevel, DevState
from tango import AttrWriteType, PipeWriteType
# Additional import
# PROTECTED REGION ID(DeviceTestMaster.additionnal_import) ENABLED START #
from future.utils import with_metaclass
import threading
from csp_lmc_common.utils.cspcommons import HealthState, AdminMode
from DeviceTestMaster import DeviceTestMaster
# PROTECTED REGION END # // DeviceTestMaster.additionnal_import
__all__ = ["PstMasterSimulator", "main"]
class PssMasterSimulator(with_metaclass(DeviceMeta,DeviceTestMaster)):
"""
**Properties:**
- Device Property
"""
# PROTECTED REGION ID(PssMasterSimulator.class_variable) ENABLED START #
# PROTECTED REGION END # // PssMasterSimulator.class_variable
# -----------------
# Device Properties
# -----------------
# ----------
# Attributes
# ----------
# ---------------
# General methods
# ---------------
def init_device(self):
"""Initialises the attributes and properties of the PssMasterSimulator."""
DeviceTestMaster.init_device(self)
# PROTECTED REGION ID(PssMasterSimulator.init_device) ENABLED START #
# PROTECTED REGION END # // PssMasterSimulator.init_device
def always_executed_hook(self):
"""Method always executed before any TANGO command is executed."""
# PROTECTED REGION ID(PssMasterSimulator.always_executed_hook) ENABLED START #
# PROTECTED REGION END # // PssMasterSimulator.always_executed_hook
def delete_device(self):
"""Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command.
"""
# PROTECTED REGION ID(PssMasterSimulator.delete_device) ENABLED START #
# PROTECTED REGION END # // PssMasterSimulator.delete_device
# ------------------
# Attributes methods
# ------------------
# --------
# Commands
# --------
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
# PROTECTED REGION ID(PssMasterSimulator.main) ENABLED START #
return run((PssMasterSimulator,), args=args, **kwargs)
# PROTECTED REGION END # // PssMasterSimulator.main
if __name__ == '__main__':
main()
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/simulators/DeviceTestMaster/README.md 0000664 0000000 0000000 00000000364 13707315520 0031415 0 ustar 00root root 0000000 0000000 This device is no more supported.
It was implemented at the beginning of the project to test the
basic CSP.LMC functionalities.
The mid-csp-mcs project provides the Mid-CBF TANGO Devices that are
now currently used by the CSP.LMC prototype.
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/simulators/pogo/ 0000775 0000000 0000000 00000000000 13707315520 0025664 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/simulators/pogo/DeviceTestMaster.py 0000664 0000000 0000000 00000021727 13707315520 0031462 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
#
# This file is part of the DeviceTestMaster project
#
#
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
""" CSP.LMC subelement Test Master Tango device prototype
Test TANGO device class to test connection with the CSPMaster prototype.
It simulates the CbfMaster sub-element.
"""
# PyTango imports
import tango
from tango import DebugIt
from tango.server import run
from tango.server import Device, DeviceMeta
from tango.server import attribute, command
from tango.server import device_property
from tango import AttrQuality, DispLevel, DevState
from tango import AttrWriteType, PipeWriteType
from SKAMaster import SKAMaster
# Additional import
# PROTECTED REGION ID(DeviceTestMaster.additionnal_import) ENABLED START #
# PROTECTED REGION END # // DeviceTestMaster.additionnal_import
__all__ = ["DeviceTestMaster", "main"]
class DeviceTestMaster(SKAMaster):
"""
Test TANGO device class to test connection with the CSPMaster prototype.
It simulates the CbfMaster sub-element.
**Properties:**
- Device Property
"""
__metaclass__ = DeviceMeta
# PROTECTED REGION ID(DeviceTestMaster.class_variable) ENABLED START #
# PROTECTED REGION END # // DeviceTestMaster.class_variable
# -----------------
# Device Properties
# -----------------
# ----------
# Attributes
# ----------
onCommandProgress = attribute(
dtype='DevUShort',
label="Command progress percentage",
polling_period=1000,
abs_change=5,
max_value=100,
min_value=0,
doc="Percentage progress implemented for commands that result in state/mode transitions for a large \nnumber of components and/or are executed in stages (e.g power up, power down)",
)
offCommandProgress = attribute(
dtype='DevDouble',
polling_period=1000,
abs_change=5,
)
standbyCommandProgress = attribute(
dtype='DevDouble',
polling_period=1000,
abs_change=5,
)
onDurationExpected = attribute(
dtype='DevUShort',
access=AttrWriteType.READ_WRITE,
memorized=True,
)
offDurationExpected = attribute(
dtype='DevUShort',
access=AttrWriteType.READ_WRITE,
memorized=True,
)
standbyDurationExpected = attribute(
dtype='DevUShort',
access=AttrWriteType.READ_WRITE,
memorized=True,
)
# ---------------
# General methods
# ---------------
def init_device(self):
"""Initialises the attributes and properties of the DeviceTestMaster."""
SKAMaster.init_device(self)
# PROTECTED REGION ID(DeviceTestMaster.init_device) ENABLED START #
# PROTECTED REGION END # // DeviceTestMaster.init_device
def always_executed_hook(self):
"""Method always executed before any TANGO command is executed."""
# PROTECTED REGION ID(DeviceTestMaster.always_executed_hook) ENABLED START #
# PROTECTED REGION END # // DeviceTestMaster.always_executed_hook
def delete_device(self):
"""Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command.
"""
# PROTECTED REGION ID(DeviceTestMaster.delete_device) ENABLED START #
# PROTECTED REGION END # // DeviceTestMaster.delete_device
# ------------------
# Attributes methods
# ------------------
def read_onCommandProgress(self):
# PROTECTED REGION ID(DeviceTestMaster.onCommandProgress_read) ENABLED START #
"""Return the onCommandProgress attribute."""
return 0
# PROTECTED REGION END # // DeviceTestMaster.onCommandProgress_read
def read_offCommandProgress(self):
# PROTECTED REGION ID(DeviceTestMaster.offCommandProgress_read) ENABLED START #
"""Return the offCommandProgress attribute."""
return 0.0
# PROTECTED REGION END # // DeviceTestMaster.offCommandProgress_read
def read_standbyCommandProgress(self):
# PROTECTED REGION ID(DeviceTestMaster.standbyCommandProgress_read) ENABLED START #
"""Return the standbyCommandProgress attribute."""
return 0.0
# PROTECTED REGION END # // DeviceTestMaster.standbyCommandProgress_read
def read_onDurationExpected(self):
# PROTECTED REGION ID(DeviceTestMaster.onDurationExpected_read) ENABLED START #
"""Return the onDurationExpected attribute."""
return 0
# PROTECTED REGION END # // DeviceTestMaster.onDurationExpected_read
def write_onDurationExpected(self, value):
# PROTECTED REGION ID(DeviceTestMaster.onDurationExpected_write) ENABLED START #
"""Set the onDurationExpected attribute."""
pass
# PROTECTED REGION END # // DeviceTestMaster.onDurationExpected_write
def read_offDurationExpected(self):
# PROTECTED REGION ID(DeviceTestMaster.offDurationExpected_read) ENABLED START #
"""Return the offDurationExpected attribute."""
return 0
# PROTECTED REGION END # // DeviceTestMaster.offDurationExpected_read
def write_offDurationExpected(self, value):
# PROTECTED REGION ID(DeviceTestMaster.offDurationExpected_write) ENABLED START #
"""Set the offDurationExpected attribute."""
pass
# PROTECTED REGION END # // DeviceTestMaster.offDurationExpected_write
def read_standbyDurationExpected(self):
# PROTECTED REGION ID(DeviceTestMaster.standbyDurationExpected_read) ENABLED START #
"""Return the standbyDurationExpected attribute."""
return 0
# PROTECTED REGION END # // DeviceTestMaster.standbyDurationExpected_read
def write_standbyDurationExpected(self, value):
# PROTECTED REGION ID(DeviceTestMaster.standbyDurationExpected_write) ENABLED START #
"""Set the standbyDurationExpected attribute."""
pass
# PROTECTED REGION END # // DeviceTestMaster.standbyDurationExpected_write
# --------
# Commands
# --------
@command(
dtype_in='DevVarStringArray',
doc_in="If the array length is0, the command apllies to the whole\nCSP Element.\nIf the array length is > 1, each array element specifies the FQDN of the\nCSP SubElement to switch ON.",
)
@DebugIt()
def On(self, argin):
# PROTECTED REGION ID(DeviceTestMaster.On) ENABLED START #
"""
Transit CSP or one or more CSP SubElements fromSTANDBY to ON
:param argin: 'DevVarStringArray'
If the array length is0, the command apllies to the whole
CSP Element.
If the array length is > 1, each array element specifies the FQDN of the
CSP SubElement to switch ON.
:return:None
"""
pass
# PROTECTED REGION END # // DeviceTestMaster.On
@command(
dtype_in='DevVarStringArray',
doc_in="If the array length is0, the command apllies to the whole\nCSP Element.\nIf the array length is > 1, each array element specifies the FQDN of the\nCSP SubElement to switch OFF.",
)
@DebugIt()
def Off(self, argin):
# PROTECTED REGION ID(DeviceTestMaster.Off) ENABLED START #
"""
Transit CSP or one or more CSP SubElements from ON to OFF.
:param argin: 'DevVarStringArray'
If the array length is0, the command apllies to the whole
CSP Element.
If the array length is > 1, each array element specifies the FQDN of the
CSP SubElement to switch OFF.
:return:None
"""
pass
# PROTECTED REGION END # // DeviceTestMaster.Off
@command(
dtype_in='DevVarStringArray',
doc_in="If the array length is0, the command apllies to the whole\nCSP Element.\nIf the array length is > 1, each array element specifies the FQDN of the\nCSP SubElement to put in STANDBY mode.",
)
@DebugIt()
def Standby(self, argin):
# PROTECTED REGION ID(DeviceTestMaster.Standby) ENABLED START #
"""
Transit CSP or one or more CSP SubElements from ON/OFF to
STANDBY.
:param argin: 'DevVarStringArray'
If the array length is0, the command apllies to the whole
CSP Element.
If the array length is > 1, each array element specifies the FQDN of the
CSP SubElement to put in STANDBY mode.
:return:None
"""
pass
# PROTECTED REGION END # // DeviceTestMaster.Standby
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
# PROTECTED REGION ID(DeviceTestMaster.main) ENABLED START #
return run((DeviceTestMaster,), args=args, **kwargs)
# PROTECTED REGION END # // DeviceTestMaster.main
if __name__ == '__main__':
main()
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/simulators/pogo/DeviceTestMaster.xmi 0000664 0000000 0000000 00000072177 13707315520 0031634 0 ustar 00root root 0000000 0000000
4
localhost
16
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/simulators/pogo/PssMasterSimulator.py 0000664 0000000 0000000 00000005370 13707315520 0032064 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
#
# This file is part of the PssMasterSimulator project
#
# INAF-SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
""" PssMaster Class simulator
"""
# PyTango imports
import tango
from tango import DebugIt
from tango.server import run
from tango.server import Device, DeviceMeta
from tango.server import attribute, command
from tango.server import device_property
from tango import AttrQuality, DispLevel, DevState
from tango import AttrWriteType, PipeWriteType
from DeviceTestMaster import DeviceTestMaster
# Additional import
# PROTECTED REGION ID(PssMasterSimulator.additionnal_import) ENABLED START #
# PROTECTED REGION END # // PssMasterSimulator.additionnal_import
__all__ = ["PssMasterSimulator", "main"]
class PssMasterSimulator(DeviceTestMaster):
"""
**Properties:**
- Device Property
"""
__metaclass__ = DeviceMeta
# PROTECTED REGION ID(PssMasterSimulator.class_variable) ENABLED START #
# PROTECTED REGION END # // PssMasterSimulator.class_variable
# -----------------
# Device Properties
# -----------------
# ----------
# Attributes
# ----------
# ---------------
# General methods
# ---------------
def init_device(self):
"""Initialises the attributes and properties of the PssMasterSimulator."""
DeviceTestMaster.init_device(self)
# PROTECTED REGION ID(PssMasterSimulator.init_device) ENABLED START #
# PROTECTED REGION END # // PssMasterSimulator.init_device
def always_executed_hook(self):
"""Method always executed before any TANGO command is executed."""
# PROTECTED REGION ID(PssMasterSimulator.always_executed_hook) ENABLED START #
# PROTECTED REGION END # // PssMasterSimulator.always_executed_hook
def delete_device(self):
"""Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command.
"""
# PROTECTED REGION ID(PssMasterSimulator.delete_device) ENABLED START #
# PROTECTED REGION END # // PssMasterSimulator.delete_device
# ------------------
# Attributes methods
# ------------------
# --------
# Commands
# --------
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
# PROTECTED REGION ID(PssMasterSimulator.main) ENABLED START #
return run((PssMasterSimulator,), args=args, **kwargs)
# PROTECTED REGION END # // PssMasterSimulator.main
if __name__ == '__main__':
main()
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/simulators/pogo/PssMasterSimulator.xmi 0000664 0000000 0000000 00000071033 13707315520 0032230 0 ustar 00root root 0000000 0000000
4
localhost
16
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/tests/ 0000775 0000000 0000000 00000000000 13707315520 0023660 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/tests/CspMaster_test.py 0000775 0000000 0000000 00000017216 13707315520 0027204 0 ustar 00root root 0000000 0000000 #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of the csp-lmc project
#
#
#
# Distributed under the terms of the BSD-3-Clause license.
# See LICENSE.txt for more info.
"""Contain the tests for the CspMaster."""
# Standard imports
import sys
import os
import time
import numpy as np
# Tango imports
import tango
from tango import DevState
from tango.test_context import DeviceTestContext
import pytest
#Local imports
from csp_lmc_common.CspMaster import CspMaster
from ska.base.control_model import AdminMode, HealthState
# Device test case
@pytest.mark.usefixtures("tango_context", "cbf_master")
class TestCspMaster(object):
properties = {'SkaLevel': '2',
'CspCbf': 'mid_csp_cbf/sub_elt/master',
'CspPss': 'mid_csp_pss/sub_elt/master',
'CspPst': 'mid_csp_pst/sub_elt/master',
}
def test_State(self, cbf_master, tango_context):
"""Test for State after initialization
NOTE: the CspMaster device state is ALARM because
this device relies on several forwarded attributes.
"""
# reinitalize Csp Master and CbfMaster devices
cbf_master.Init()
time.sleep(2)
csp_state = tango_context.device.state()
assert csp_state not in [DevState.FAULT, DevState.DISABLE]
def test_adminMode_offline(self, tango_context):
""" Test the adminMode attribute w/r"""
tango_context.device.adminMode = AdminMode.OFFLINE
time.sleep(3)
assert tango_context.device.adminMode.value == AdminMode.OFFLINE
def test_adminMode_online(self, tango_context):
""" Test the adminMode attribute w/r"""
tango_context.device.adminMode = AdminMode.ONLINE
time.sleep(3)
assert tango_context.device.adminMode.value == AdminMode.ONLINE
def test_write_invalid_admin_mode(self, tango_context):
with pytest.raises(tango.DevFailed) as df:
tango_context.device.adminMode = 7
assert "Set value for attribute adminMode is negative or above the maximun authorized" in str(df.value.args[0].desc)
def test_cspHealthState(self, tango_context):
""" Test the CSP initial healthState.
NOTE: to build the CSP healthState, the sub-elements
not ONLINE or MAINTENACE are not taken into account.
"""
assert tango_context.device.healthState == HealthState.OK
def test_cbfAdminMode(self, tango_context):
""" Test the CBF adminMode attribute w/r"""
tango_context.device.cspCbfAdminMode = AdminMode.ONLINE
time.sleep(3)
assert tango_context.device.cspCbfAdminMode.value == AdminMode.ONLINE
def test_cbfHealthState(self, tango_context):
""" Test the CBF initial healthState """
tango_context.device.cspCbfHealthState == HealthState.OK
def test_pssState(self, tango_context):
""" Test the PSS initial State """
assert tango_context.device.cspPssState == DevState.DISABLE
def test_pssHealthState(self, tango_context):
""" Test the PSS initial healthState """
assert tango_context.device.cspPssHealthState == HealthState.UNKNOWN
def test_pssAdminMode(self, tango_context):
""" Test the PSS initial adminMode """
pss_admin = tango_context.device.cspPssAdminMode
assert pss_admin == AdminMode.NOT_FITTED
def test_write_adminMode_of_not_running_device(self, tango_context):
assert tango_context.device.cspPssAdminMode == AdminMode.NOT_FITTED
tango_context.device.cspPssAdminMode == AdminMode.ONLINE
time.sleep(3)
assert tango_context.device.cspPssAdminMode == AdminMode.NOT_FITTED
def test_pstState(self, tango_context):
""" Test the PST initial State """
assert tango_context.device.cspPstState == DevState.DISABLE
def test_pstHealthState(self, tango_context):
""" Test the PST initial healthState """
assert tango_context.device.cspPstHealthState == HealthState.UNKNOWN
def test_pstAdminMode(self, tango_context):
""" Test the PST initial adminMode """
assert tango_context.device.cspPstAdminMode == AdminMode.NOT_FITTED
def test_subelement_cbf_address(self, tango_context):
"""Test the cbfMasterAdress value"""
cbf_addr = tango_context.device.cbfMasterAddress
cbf_addr_property = self.properties['CspCbf']
assert cbf_addr == cbf_addr_property
def test_subelement_pss_address(self, tango_context):
"""Test the pssMasterAdress value"""
pss_addr = tango_context.device.pssMasterAddress
pss_addr_property = self.properties['CspPss']
assert pss_addr == pss_addr_property
def test_subelement_pst_address(self, tango_context):
"""Test the pstMasterAdress value"""
pst_addr = tango_context.device.pstMasterAddress
pst_addr_property = self.properties['CspPst']
assert pst_addr == pst_addr_property
def test_configure_On_command_duration_time(self, tango_context):
tango_context.device.onCmdDurationExpected = 3
assert tango_context.device.onCmdDurationExpected == 3
def test_configure_Off_command_duration_time(self, tango_context):
tango_context.device.offCmdDurationExpected = 3
assert tango_context.device.offCmdDurationExpected == 3
def test_configure_Standby_command_duration_time(self, tango_context):
tango_context.device.standbyCmdDurationExpected = 3
assert tango_context.device.standbyCmdDurationExpected == 3
def test_On_valid_state(self, tango_context, cbf_master):
"""
Test to execute the On command on the CbfMaster and to verify the
attributes related dto command execution: execution measured time,
timeout, command progress.
"""
#reinit CSP and CBFTest master devices
cbf_master.Init()
# sleep for a while to wait state transition
time.sleep(3)
# check CspMstar state
assert tango_context.device.cspCbfState == DevState.STANDBY
# issue the "On" command on CbfTestMaster device
argin = [tango_context.device.cbfMasterAddress,]
tango_context.device.On(argin)
time.sleep(4)
assert tango_context.device.cspCbfState == DevState.ON
time_measured = tango_context.device.onCmdDurationMeasured
assert time_measured >= 0
# verify the command does not timeout
on_timeout = tango_context.device.onCmdTimeoutExpired
assert not on_timeout
# verify the command progress is 100
assert tango_context.device.onCommandProgress == 100
failure = tango_context.device.onCmdFailure
assert not failure
failure_message = tango_context.device.onFailureMessage
assert failure_message ==''
def test_Standby_valid_state(self, tango_context, cbf_master):
assert tango_context.device.cspCbfState == DevState.ON
# issue the "On" command on CbfTestMaster device
argin = [tango_context.device.cbfMasterAddress,]
tango_context.device.Standby(argin)
time.sleep(4)
assert tango_context.device.cspCbfState == DevState.STANDBY
standby_timeout = tango_context.device.standbyCmdTimeoutExpired
assert not standby_timeout
assert tango_context.device.standbyCommandProgress == 100
num_of_task = tango_context.device.numOfDevCompletedTask
assert num_of_task == 1
list_of_task = tango_context.device.listOfDevCompletedTask
assert tango_context.device.cbfMasterAddress in list_of_task
time_measured = tango_context.device.standbyCmdDurationMeasured
assert time_measured >= 0
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/tests/CspSubarray_test.py 0000775 0000000 0000000 00000010221 13707315520 0027526 0 ustar 00root root 0000000 0000000 #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of the csp-lmc project
#
#
#
# Distributed under the terms of the BSD-3-Clause license.
# See LICENSE.txt for more info.
"""Contain the tests for the CspMaster."""
# Standard imports
import sys
import os
import time
import pytest
# Tango imports
import tango
from tango import DevState
from tango.test_context import DeviceTestContext
#Local imports
from csp_lmc_common.CspSubarray import CspSubarray
from ska.base.control_model import AdminMode, ObsState, HealthState
# Device test case
@pytest.mark.usefixtures("tango_context", "csp_master")
class TestCspSubarray(object):
properties = {'CspMaster': 'common/elt/master',
'CbfSubarray': 'mid_csp_cbf/sub_elt/subarray_01',
'PssSubarray': 'mid_csp_pss/sub_elt/subarray_01',
'SubID': 1,
}
@classmethod
def mocking(cls):
"""Mock external libraries."""
# Example : Mock numpy
# cls.numpy = SKASubarray.numpy = MagicMock()
# PROTECTED REGION ID(SKASubarray.test_mocking) ENABLED START #
# PROTECTED REGION END # // SKASubarray.test_mocking
def test_init_State(self, tango_context):
"""Test for State at initialization """
state = tango_context.device.state()
assert state not in [DevState.FAULT]
def test_cbfsubarray_state(self, tango_context):
assert tango_context.device.cbfSubarrayState == DevState.DISABLE
def test_cbfsubarray_adminMode(self, tango_context):
assert tango_context.device.cbfSubarrayAdminMode == AdminMode.ONLINE
def test_cbfsubarray_healthState(self, tango_context):
assert tango_context.device.cbfSubarrayHealthState == HealthState.OK
def test_psssubarray_state(self, tango_context):
assert tango_context.device.pssSubarrayState == DevState.DISABLE
def test_psssubarray_adminMode(self, tango_context):
assert tango_context.device.pssSubarrayAdminMode == AdminMode.NOT_FITTED
def test_psssubarray_healthState(self, tango_context):
assert tango_context.device.pssSubarrayHealthState == HealthState.UNKNOWN
def test_psssubarray_obsState(self, tango_context):
assert tango_context.device.pssSubarrayObsState == ObsState.IDLE
def test_init_obsState(self, tango_context):
"""Test the obsState value at initialization """
obs_state = tango_context.device.obsState
assert obs_state == ObsState.EMPTY
def test_commands_progress(self, tango_context):
"""Test xxCmdProgress attributes """
assert tango_context.device.scanCmdProgress == 0
assert tango_context.device.endScanCmdProgress == 0
assert tango_context.device.goToIdleCmdProgress == 0
'''
def test_configure_invalid_state(self, tango_context):
""" Test Configure command execution when subarray
State is not ON
"""
with pytest.raises(tango.DevFailed) as df:
tango_context.device.Configure("")
assert "Command Configure not allowed" in df.value.args[0].desc
def test_subarray_off(self, tango_context, csp_master):
""" Test subarray state after power-on
NOTE: this is a wrong behaviour of CbfSubarray that
starts in DISABLE state with adminMode = ONLINE and
it moves to OFF only after a power-on.
The CbfSubarray has to start in OFF State when it is
ONLINE and there is no need to power-on it.
This behavior has to be changed
"""
csp_master.On(["mid_csp_cbf/sub_elt/master",])
time.sleep(4)
csp_state = csp_master.State()
state = tango_context.device.cbfSubarrayState
assert state == DevState.OFF
'''
#def test_remove_timing_beams_while_add_is_running_state(self, tango_context):
# """ Test the execution of the RemovingTimingBeams" while
# the AddTimingBeams is already running
# """
# tango_context.device.AddTimingBeams([1,2,3])
# with pytest.raises(tango.DevFailed) as df:
# tango_context.device.RemoveTimingBeams([1,2])
# assert "Can't execute command" in df.value.args[0].desc
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/tests/config.json 0000664 0000000 0000000 00000004330 13707315520 0026020 0 ustar 00root root 0000000 0000000 {
"scanID": 1,
"frequencyBand": "5a",
"band5Tuning": [5.85, 7.25],
"frequencyBandOffsetStream1": 0,
"frequencyBandOffsetStream2": 0,
"dopplerPhaseCorrSubscriptionPoint": "ska_mid/tm_leaf_node/csp_subarray_01/dopplerPhaseCorrection",
"delayModelSubscriptionPoint": "ska_mid/tm_leaf_node/csp_subarray_01/delayModel",
"visDestinationAddressSubscriptionPoint": "ska_mid/tm_leaf_node/csp_subarray_01/visDestinationAddress",
"rfiFlaggingMask": {},
"searchWindow": [
{
"searchWindowID": 1,
"searchWindowTuning": 6000000000,
"tdcEnable": false,
"tdcNumBits": 8,
"tdcPeriodBeforeEpoch": 5,
"tdcPeriodAfterEpoch": 25,
"tdcDestinationAddress": [
{
"receptorID": 4,
"tdcDestinationAddress": ["foo", "bar", "8080"]
},
{
"receptorID": 1,
"tdcDestinationAddress": ["fizz", "buzz", "80"]
}
]
},
{
"searchWindowID": 2,
"searchWindowTuning": 7000000000,
"tdcEnable": false
}
],
"fsp": [
{
"fspID": 1,
"functionMode": "CORR",
"receptors": [4],
"frequencySliceID": 1,
"corrBandwidth": 1,
"zoomWindowTuning": 4700000,
"integrationTime": 140,
"channelAveragingMap": [
[1, 8],
[745, 0],
[1489, 0],
[2233, 0],
[2977, 0],
[3721, 0],
[4465, 0],
[5209, 0],
[5953, 0],
[6697, 0],
[7441, 0],
[8185, 0],
[8929, 0],
[9673, 0],
[10417, 0],
[11161, 0],
[11905, 0],
[12649, 0],
[13393, 0],
[14137, 0]
]
},
{
"fspID": 2,
"functionMode": "CORR",
"frequencySliceID": 20,
"corrBandwidth": 0,
"integrationTime": 1400
}
]
}
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/tests/unit/ 0000775 0000000 0000000 00000000000 13707315520 0024637 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/tests/unit/cspmaster_unit_test.py 0000664 0000000 0000000 00000005427 13707315520 0031320 0 ustar 00root root 0000000 0000000 import contextlib
import importlib
import sys
import mock
from mock import Mock
from ska.base.control_model import HealthState
from tango.test_context import DeviceTestContext
from tango import DevState
from csp_lmc_common.CspMaster import CspMaster
def test_cspmaster_state_after_init():
device_under_test = CspMaster
cbf_master_fqdn = 'mid_csp_cbf/sub_elt/master'
pss_master_fqdn = 'mid_csp_pss/sub_elt/master'
pst_master_fqdn = 'mid_csp_pst/sub_elt/master'
cbf_master_state_attr = 'State'
dut_properties = {
'CspCbf': cbf_master_fqdn,
'CspPss': pss_master_fqdn,
'CspPst': pst_master_fqdn
}
event_subscription_map = {}
cbf_master_device_proxy_mock = Mock()
cbf_master_device_proxy_mock.subscribe_event.side_effect = (
lambda attr_name, event_type, callback, *args, **kwargs: event_subscription_map.update({attr_name: callback}))
proxies_to_mock = {
cbf_master_fqdn: cbf_master_device_proxy_mock
}
with fake_tango_system(device_under_test, initial_dut_properties=dut_properties, proxies_to_mock=proxies_to_mock) as tango_context:
dummy_event = create_dummy_event(cbf_master_fqdn)
event_subscription_map[cbf_master_state_attr](dummy_event)
# next check is not passed because the CspMaster device is in ALARM
# for the missing forwarded attributes configuration
#assert tango_context.device.State() == DevState.STANDBY
assert tango_context.device.cspCbfState == DevState.STANDBY
def mock_event_dev_name(device_name):
return device_name
def create_dummy_event(cbf_master_fqdn):
fake_event = Mock()
fake_event.err = False
fake_event.attr_name = f"{cbf_master_fqdn}/state"
fake_event.attr_value.value = DevState.STANDBY
fake_event.attr_value.name = 'State'
fake_event.device.name = cbf_master_fqdn
fake_event.device.dev_name.side_effect=(lambda *args, **kwargs: mock_event_dev_name(cbf_master_fqdn))
return fake_event
@contextlib.contextmanager
def fake_tango_system(device_under_test, initial_dut_properties={}, proxies_to_mock={},
device_proxy_import_path='tango.DeviceProxy'):
with mock.patch(device_proxy_import_path) as patched_constructor:
patched_constructor.side_effect = lambda device_fqdn: proxies_to_mock.get(device_fqdn, Mock())
patched_module = importlib.reload(sys.modules[device_under_test.__module__])
print("patched_module:", patched_module)
print("device_under_test.__name__:", device_under_test.__name__)
device_under_test = getattr(patched_module, device_under_test.__name__)
device_test_context = DeviceTestContext(device_under_test, properties=initial_dut_properties)
device_test_context.start()
yield device_test_context
device_test_context.stop()
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-common/tests/unit/cspsubarray_unit_test.py 0000664 0000000 0000000 00000020505 13707315520 0031647 0 ustar 00root root 0000000 0000000 import contextlib
import importlib
import sys
import mock
import pytest
import tango
from mock import Mock, MagicMock
from ska.base.control_model import HealthState, ObsState
from ska.base.commands import ResultCode
from tango.test_context import DeviceTestContext
from tango import DevState, DevFailed
from csp_lmc_common.CspSubarray import CspSubarray
def test_cspsubarray_state_and_obstate_value_after_initialization():
"""
Test the State and obsState values for the CpSubarray at the
end of the initialization process.
"""
device_under_test = CspSubarray
cbf_subarray_fqdn = 'mid_csp_cbf/sub_elt/subarray_01'
cbf_subarray_state_attr = 'State'
dut_properties = {
'CspMaster':'mid_csp/elt/master',
'CbfSubarray': cbf_subarray_fqdn,
'PssSubarray': 'mid_csp_pss/sub_elt/subarray_01',
'PstSubarray': 'mid_csp_pst/sub_elt/subarray_01',
}
event_subscription_map = {}
cbf_subarray_device_proxy_mock = Mock()
cbf_subarray_device_proxy_mock.subscribe_event.side_effect = (
lambda attr_name, event_type, callback, *args, **kwargs: event_subscription_map.update({attr_name: callback}))
proxies_to_mock = {
cbf_subarray_fqdn: cbf_subarray_device_proxy_mock
}
with fake_tango_system(device_under_test, initial_dut_properties=dut_properties, proxies_to_mock=proxies_to_mock) as tango_context:
dummy_event = create_dummy_event(cbf_subarray_fqdn, DevState.OFF)
event_subscription_map[cbf_subarray_state_attr](dummy_event)
assert tango_context.device.State() == DevState.OFF
assert tango_context.device.obsState == ObsState.EMPTY
def test_cspsbarray_state_after_On_WITH_exception_raised_by_subelement_subarray():
"""
Test the behavior of the CspSubarray when one of the sub-element subarray
raises a DevFailed exception.
"""
device_under_test = CspSubarray
cbf_subarray_fqdn = 'mid_csp_cbf/sub_elt/subarray_01'
pss_subarray_fqdn = 'mid_csp_pss/sub_elt/subarray_01'
dut_properties = {
'CbfSubarray': cbf_subarray_fqdn,
'PssSubarray': pss_subarray_fqdn
}
cbf_subarray_device_proxy_mock = Mock()
pss_subarray_device_proxy_mock = Mock()
proxies_to_mock = {
cbf_subarray_fqdn: cbf_subarray_device_proxy_mock,
pss_subarray_fqdn: pss_subarray_device_proxy_mock
}
with fake_tango_system(device_under_test, initial_dut_properties=dut_properties, proxies_to_mock=proxies_to_mock) as tango_context:
cbf_subarray_device_proxy_mock.On.side_effect = raise_devfailed_exception
pss_subarray_device_proxy_mock.On.side_effect = return_ok
tango_context.device.On()
assert tango_context.device.State() == DevState.FAULT
assert tango_context.device.obsState == ObsState.EMPTY
def test_cspsbarray_state_after_On_WITH_command_failed_code_returned_by_subelement_subarray():
"""
Test the behavior of the CspSubarray when on the sub-element subarray
return a FAILED code.
"""
device_under_test = CspSubarray
cbf_subarray_fqdn = 'mid_csp_cbf/sub_elt/subarray_01'
pss_subarray_fqdn = 'mid_csp_pss/sub_elt/subarray_01'
dut_properties = {
'CbfSubarray': cbf_subarray_fqdn,
'PssSubarray': pss_subarray_fqdn,
}
cbf_subarray_device_proxy_mock = Mock()
pss_subarray_device_proxy_mock = Mock()
proxies_to_mock = {
cbf_subarray_fqdn: cbf_subarray_device_proxy_mock,
pss_subarray_fqdn: pss_subarray_device_proxy_mock,
}
with fake_tango_system(device_under_test, initial_dut_properties=dut_properties, proxies_to_mock=proxies_to_mock) as tango_context:
cbf_subarray_device_proxy_mock.On.side_effect = return_failed
pss_subarray_device_proxy_mock.On.side_effect = return_ok
tango_context.device.On()
assert tango_context.device.State() == DevState.FAULT
assert tango_context.device.obsState == ObsState.EMPTY
def test_cspsbarray_state_after_On_WITH_command_failed_code_returned_by_pss_subarray():
"""
Test the behavior of the CspSubarray when on the sub-element subarray
return a FAILED code.
"""
device_under_test = CspSubarray
cbf_subarray_fqdn = 'mid_csp_cbf/sub_elt/subarray_01'
pss_subarray_fqdn = 'mid_csp_pss/sub_elt/subarray_01'
dut_properties = {
'CbfSubarray': cbf_subarray_fqdn,
'PssSubarray': pss_subarray_fqdn,
}
cbf_subarray_device_proxy_mock = Mock()
pss_subarray_device_proxy_mock = Mock()
proxies_to_mock = {
cbf_subarray_fqdn: cbf_subarray_device_proxy_mock,
pss_subarray_fqdn: pss_subarray_device_proxy_mock
}
with fake_tango_system(device_under_test, initial_dut_properties=dut_properties, proxies_to_mock=proxies_to_mock) as tango_context:
cbf_subarray_device_proxy_mock.On.side_effect = return_ok
pss_subarray_device_proxy_mock.On.side_effect = return_failed
tango_context.device.On()
assert tango_context.device.State() == DevState.ON
assert tango_context.device.obsState == ObsState.EMPTY
assert tango_context.device.healthState == HealthState.DEGRADED
def test_cspsbarray_state_after_On_forwarded_to_subelement_subarray():
"""
Test the behavior of the CspSubarray when on the sub-element subarray
return a FAILED code.
"""
device_under_test = CspSubarray
cbf_subarray_fqdn = 'mid_csp_cbf/sub_elt/subarray_01'
pss_subarray_fqdn = 'mid_csp_pss/sub_elt/subarray_01'
dut_properties = {
'CbfSubarray': cbf_subarray_fqdn,
'PssSubarray': pss_subarray_fqdn,
}
cbf_subarray_device_proxy_mock = Mock()
pss_subarray_device_proxy_mock = Mock()
proxies_to_mock = {
cbf_subarray_fqdn: cbf_subarray_device_proxy_mock,
pss_subarray_fqdn: pss_subarray_device_proxy_mock,
}
with fake_tango_system(device_under_test, initial_dut_properties=dut_properties, proxies_to_mock=proxies_to_mock) as tango_context:
cbf_subarray_device_proxy_mock.On.side_effect = return_ok
pss_subarray_device_proxy_mock.On.side_effect = return_ok
tango_context.device.On()
assert tango_context.device.State() == DevState.ON
assert tango_context.device.obsState == ObsState.EMPTY
def return_ok():
"""
Return a FAILED code in the execution of a device method.
"""
message = "CBF Subarray Oncommand OK"
return (ResultCode.OK, message)
def return_failed():
"""
Return a FAILED code in the execution of a device method.
"""
print("return failed")
return (ResultCode.FAILED, "On Command failed")
def raise_devfailed_exception():
"""
Raise an exception to test the failure of a device command
"""
tango.Except.throw_exception("Commandfailed", "This is error message for devfailed",
" ", tango.ErrSeverity.ERR)
def mock_event_dev_name(device_name):
return device_name
def create_dummy_event(cbf_subarray_fqdn, event_value):
"""
Create a mocked event object to test the event callback method
associate to the attribute at subscription.
param: cbf_subarray_fqdn the CBF Subarray FQDN
event_value the expected value
return: the fake event
"""
fake_event = Mock()
fake_event.err = False
fake_event.attr_name = f"{cbf_subarray_fqdn}/state"
fake_event.attr_value.value = event_value
fake_event.attr_value.name = 'State'
fake_event.device.name = cbf_subarray_fqdn
fake_event.device.dev_name.side_effect=(lambda *args, **kwargs: mock_event_dev_name(cbf_subarray_fqdn))
return fake_event
@contextlib.contextmanager
def fake_tango_system(device_under_test, initial_dut_properties={}, proxies_to_mock={},
device_proxy_import_path='tango.DeviceProxy'):
with mock.patch(device_proxy_import_path) as patched_constructor:
patched_constructor.side_effect = lambda device_fqdn: proxies_to_mock.get(device_fqdn, Mock())
patched_module = importlib.reload(sys.modules[device_under_test.__module__])
print("patched_module:", patched_module)
print("device_under_test.__name__:", device_under_test.__name__)
device_under_test = getattr(patched_module, device_under_test.__name__)
device_test_context = DeviceTestContext(device_under_test, properties=initial_dut_properties)
device_test_context.start()
yield device_test_context
device_test_context.stop()
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-low/ 0000775 0000000 0000000 00000000000 13707315520 0022027 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-low/CspLowMaster_test.py 0000664 0000000 0000000 00000000000 13707315520 0026011 0 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-low/README.md 0000664 0000000 0000000 00000000000 13707315520 0023274 0 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-low/csp_lmc_low/ 0000775 0000000 0000000 00000000000 13707315520 0024330 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-low/csp_lmc_low/__init__.py 0000664 0000000 0000000 00000000000 13707315520 0026427 0 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-low/setup.cfg 0000664 0000000 0000000 00000000725 13707315520 0023654 0 ustar 00root root 0000000 0000000 [metadata]
description-file = README.md
[aliases]
# Define `python setup.py test`
test=pytest
[coverage:run]
branch = True
source = ska_python_skeleton
[tool:pytest]
testpaths = tests
addopts = --cov --json-report --json-report-file=htmlcov/report.json --cov-report term --cov-report html --cov-report xml --pylint --pylint-error-types=EF
# Define `python setup.py build_sphinx`
[build_sphinx]
source-dir = docs
build-dir = docs/_build
all_files = 1
builder = html
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-low/setup.py 0000664 0000000 0000000 00000002760 13707315520 0023546 0 ustar 00root root 0000000 0000000 #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
with open('README.md') as readme_file:
readme = readme_file.read()
setup(
name='ska_python_skeleton',
version='0.0.0',
description="",
long_description=readme + '\n\n',
author="Your Name",
author_email='your.email@mail.com',
url='https://github.com/ska-telescope/ska-python-skeleton',
packages=[
'ska_python_skeleton',
],
package_dir={'ska_python_skeleton':
'ska_python_skeleton'},
include_package_data=True,
license="BSD license",
zip_safe=False,
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
],
test_suite='tests',
install_requires=[], # FIXME: add your package's dependencies to this list
setup_requires=[
# dependency for `python setup.py test`
'pytest-runner',
# dependencies for `python setup.py build_sphinx`
'sphinx',
'recommonmark'
],
tests_require=[
'pytest',
'pytest-cov',
'pytest-json-report',
'pycodestyle',
],
extras_require={
'dev': ['prospector[with_pyroma]', 'yapf', 'isort'],
}
)
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/ 0000775 0000000 0000000 00000000000 13707315520 0021777 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/.gitlab-ci.yml 0000664 0000000 0000000 00000007565 13707315520 0024450 0 ustar 00root root 0000000 0000000 # Local Gitlab-CI file for csp-lmc-mid project
#
# Build csp-lmc-mid python packages
#
.build_python:
stage: build
image: nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:latest
dependencies: []
tags:
- docker-executor
artifacts:
paths:
- ./$BUILD_PATH/dist/
.build_python_dev:
extends: .build_python
dependencies: []
script:
- cd $BUILD_PATH
- python setup.py egg_info -b+dev.$CI_COMMIT_SHORT_SHA sdist bdist_wheel
.build_python_release:
extends: .build_python
script:
- cd $BUILD_PATH
- python setup.py egg_info -b+$CI_COMMIT_SHORT_SHA sdist bdist_wheel
build:csp-lmc-mid_pkg_dev: # Executed on a commit
extends: .build_python_dev
variables:
BUILD_PATH: csp-lmc-mid
build:csp-lmc-mid_pkg:
extends: .build_python_release
variables:
BUILD_PATH: csp-lmc-mid
only: [master]
#
# Build csp-lmc-mid image
#
build:csp-lmc-mid_image:
image: nexus.engageska-portugal.pt/ska-docker/tango-builder:latest
before_script:
- docker login -u $DOCKER_REGISTRY_USERNAME -p $DOCKER_REGISTRY_PASSWORD $DOCKER_REGISTRY_HOST
tags:
- docker-executor
stage: build
script:
- cd $BUILD_PATH
- make build
variables:
BUILD_PATH: csp-lmc-mid/docker
# test:csp-lmc-mid:
# stage: test
# image: nexus.engageska-portugal.pt/ska-docker/tango-builder:latest
# before_script:
# - docker login -u $DOCKER_REGISTRY_USERNAME -p $DOCKER_REGISTRY_PASSWORD $DOCKER_REGISTRY_HOST
# - *install_pip
# tags:
# - docker-executor
# script:
# - echo $(ls -d ./dist/*.whl | grep $CI_COMMIT_SHORT_SHA)
# - pip3 install -U $(ls -d ./csp-lmc-mid/dist/*.whl | grep $CI_COMMIT_SHORT_SHA) --extra-index-url https://nexus.engageska-portugal.pt/repository/pypi/simple
# - cd csp-lmc-mid/docker
# - make test
# artifacts:
# paths:
# - build
#
# Test csp-lmc-mid project
#
.test:
image: nexus.engageska-portugal.pt/ska-docker/tango-builder:latest
before_script:
- docker login -u $DOCKER_REGISTRY_USERNAME -p $DOCKER_REGISTRY_PASSWORD $DOCKER_REGISTRY_HOST
tags:
- docker-executor
artifacts:
paths:
- ./$BUILD_PATH/build/
variables:
BUILD_PATH: csp-lmc-mid/docker
test:csp-lmc-mid:
extends: .test
stage: test
script:
- cd $BUILD_PATH
- make test
# linting stage
.linting:
extends: .test
stage: linting
dependencies: []
script:
- apt-get -y update
- apt-get install -y python3-pip python3-setuptools python3-wheel --no-install-recommends
- cd $BUILD_PATH
- make lint
linting:csp-lmc-mid:
extends: .linting
dependencies: []
#
# Publish csp-lmc-mid python package
#
.publish_python:
stage: publish
image: nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:latest
variables:
TWINE_USERNAME: $TWINE_USERNAME
TWINE_PASSWORD: $TWINE_PASSWORD
tags:
- docker-executor
before_script:
- pip install twine
.publish_python_dev:
extends: .publish_python
except: [master]
script:
- cd $BUILD_PATH
- twine upload --repository-url $PYPI_REPOSITORY_URL dist/* || true
when: manual
.publish_python_release:
extends: .publish_python
only: [master]
script:
- cd $BUILD_PATH
- twine upload --repository-url $PYPI_REPOSITORY_URL dist/* || true
- twine upload --skip-existing -u $PYPI_USER -p $PYPI_PASS dist/* || true
publish:csp-lmc-mid_dev:
extends: .publish_python_dev
dependencies:
- build:csp-lmc-mid_pkg_dev
variables:
BUILD_PATH: csp-lmc-mid
publish:csp-lmc-mid:
extends: .publish_python_release
dependencies:
- build:csp-lmc-mid_pkg
variables:
BUILD_PATH: csp-lmc-mid
#
# Release csp-lmc-mid image on nexus
#
release csp-lmc-mid image:
tags:
- docker-executor
stage: release
dependencies:
- build:csp-lmc-mid_image
script:
- cd $BUILD_PATH
- make push
when: manual
only:
refs:
- master
variables:
BUILD_PATH: csp-lmc-mid/docker
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/.pylintrc 0000664 0000000 0000000 00000022124 13707315520 0023645 0 ustar 00root root 0000000 0000000 [MASTER]
# Specify a configuration file.
#rcfile=
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook='
# Profiled execution.
profile=no
# Add files or directories to the blacklist. They should be base names, not
# paths.
ignore=CVS
# Pickle collected data for later comparisons.
persistent=yes
# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
load-plugins=
[MESSAGES CONTROL]
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time. See also the "--disable" option for examples.
enable=unreachable,
duplicate-key,
unnecessary-semicolon,
global-variable-not-assigned,
unused-variable,
binary-op-exception,
bad-format-string,
anomalous-backslash-in-string,
bad-open-mode
# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once).You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable= R,C,W,
no-member,
access-member-before-definition
[REPORTS]
# Set the output format. Available formats are text, parseable, colorized, msvs
# (visual studio) and html. You can also give a reporter class, eg
# mypackage.mymodule.MyReporterClass.
#output-format=parseable
output-format=parseable
# Put messages in a separate file for each module / package specified on the
# command line instead of printing them on stdout. Reports (if any) will be
# written in a file name "pylint_global.[txt|html]".
files-output=no
# Tells whether to display a full report or only the messages
reports=yes
# Activate the evaluation score.
score=yes
# Python expression which should return a note less than 10 (10 is the highest
# note). You have access to the variables errors warning, statement which
# respectively contain the number of errors / warnings messages and the total
# number of statements analyzed. This is used by the global evaluation report
# (RP0004).
evaluation= 10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
# Add a comment according to your evaluation note. This is used by the global
# evaluation report (RP0004).
comment=no
# Template used to display messages. This is a python new-style format string
# used to format the message information. See doc for all details
#msg-template=
[SIMILARITIES]
# Minimum lines number of a similarity.
min-similarity-lines=4
# Ignore comments when computing similarities.
ignore-comments=yes
# Ignore docstrings when computing similarities.
ignore-docstrings=yes
# Ignore imports when computing similarities.
ignore-imports=no
[TYPECHECK]
# Tells whether missing members accessed in mixin class should be ignored. A
# mixin class is detected if its name ends with "mixin" (case insensitive).
ignore-mixin-members=yes
# List of classes names for which member attributes should not be checked
# (useful for classes with attributes dynamically set).
ignored-classes=SQLObject
# Show a hint with possible names when a member name was not found. The aspect
# of finding the hint is based on edit distance.
missing-member-hint=yes
# When zope mode is activated, add a predefined set of Zope acquired attributes
# to generated-members.
zope=no
# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E0201 when accessed. Python regular
# expressions are accepted.
generated-members=REQUEST,acl_users,aq_parent
[VARIABLES]
# Tells whether we should check for unused import in __init__ files.
init-import=no
# A regular expression matching the beginning of the name of dummy variables
# (i.e. not used).
dummy-variables-rgx=_$|dummy
# List of additional names supposed to be defined in builtins. Remember that
# you should avoid to define new builtins when possible.
additional-builtins=
# Tells whether unused global variables should be treated as a violation.
allow-global-unused-variables=yes
[FORMAT]
# Maximum number of characters on a single line.
max-line-length=100
# Regexp for a line that is allowed to be longer than the limit.
ignore-long-lines=^\s*(# )??$
# Allow the body of an if to be on the same line as the test if there is no
# else.
single-line-if-stmt=no
# List of optional constructs for which whitespace checking is disabled
no-space-check=trailing-comma,dict-separator
# Maximum number of lines in a module
max-module-lines=1000
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
# tab).
indent-string=' '
[BASIC]
# Required attributes for module, separated by a comma
required-attributes=
# List of builtins function names that should not be used, separated by a comma
bad-functions=map,filter,apply,input
# Regular expression which should only match correct module names
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
# Regular expression which should only match correct module level names
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
# Regular expression which should only match correct class names
class-rgx=[A-Z_][a-zA-Z0-9]+$
# Regular expression which should only match correct function names
function-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct method names
method-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct instance attribute names
attr-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct argument names
argument-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct variable names
variable-rgx=[a-z_][a-z0-9_]{2,30}$
# Regular expression which should only match correct attribute names in class
# bodies
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
# Regular expression which should only match correct list comprehension /
# generator expression variable names
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
# Good variable names which should always be accepted, separated by a comma
good-names=i,j,k,ex,Run,_
# Bad variable names which should always be refused, separated by a comma
bad-names=foo,bar,baz,toto,tutu,tata
# Regular expression which should only match function or class names that do
# not require a docstring.
no-docstring-rgx=__.*__
# Minimum line length for functions/classes that require docstrings, shorter
# ones are exempt.
docstring-min-length=-1
[MISCELLANEOUS]
# List of note tags to take in consideration, separated by a comma.
notes=FIXME,
XXX,
TODO
[IMPORTS]
# Deprecated modules which should not be used, separated by a comma
deprecated-modules=regsub,TERMIOS,Bastion,rexec
# Create a graph of every (i.e. internal and external) dependencies in the
# given file (report RP0402 must not be disabled)
import-graph=
# Create a graph of external dependencies in the given file (report RP0402 must
# not be disabled)
ext-import-graph=
# Create a graph of internal dependencies in the given file (report RP0402 must
# not be disabled)
int-import-graph=
[CLASSES]
# List of interface methods to ignore, separated by a comma. This is used for
# instance to not check methods defines in Zope's Interface base class.
ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
# List of method names used to declare (i.e. assign) instance attributes.
defining-attr-methods=__init__,__new__,setUp
# List of valid names for the first argument in a class method.
valid-classmethod-first-arg=cls
# List of valid names for the first argument in a metaclass class method.
valid-metaclass-classmethod-first-arg=mcs
[DESIGN]
# Maximum number of arguments for function / method
max-args=5
# Argument names that match this expression will be ignored. Default to name
# with leading underscore
ignored-argument-names=_.*
# Maximum number of locals for function / method body
max-locals=20
# Maximum number of return / yield for function / method body
max-returns=6
# Maximum number of branch for function / method body
max-branches=15
# Maximum number of statements in function / method body
max-statements=50
# Maximum number of parents for a class (see R0901).
max-parents=7
# Maximum number of attributes for a class (see R0902).
max-attributes=20
# Minimum number of public methods for a class (see R0903).
min-public-methods=2
# Maximum number of public methods for a class (see R0904).
max-public-methods=40
[EXCEPTIONS]
# Exceptions that will emit a warning when being caught. Defaults to
# "Exception"
overgeneral-exceptions=Exception
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/HISTORY 0000664 0000000 0000000 00000004170 13707315520 0023065 0 ustar 00root root 0000000 0000000 0.6.4:
- use csp-lmc-common version 0.6.4
- Receptor class uses the assignedReceptors attribute (exported by the MidCspSubarray)
to get the number of assigned receptors. No more use of receptorMembership: this value sometimes
has some delays due to the use of events to build it
0.6.3
- use ska-python-buildenv and runtime 9.3.2
- use csp-lmc-common version 0.6.3
- fix a bug in receptors regarding the receptorId
- devlepoed unit tests with mock devices
0.6.2
- use csp-lmc-common version 0.6.2
0.6.1
- use csp-lmc-common version 0.6.1
0.6.0
- start implementing lmcbaseclasses 0.6.0
0.5.9
- use csp-lmc-common version 0.5.11
- removed the cbfOutputLink forwarded attribute from the
TANGO DB configuration file
0.5.8
- use csp-lmc-common package 0.5.9
- implemented the ADR-4 and ADR-10 decisions:
- the json file contains the unique configuration ID
and the list of the outputlinks, channelAverageMap and
received addresses for CBF
- the Scan command specifies as argument the scan Id
0.5.7
- use csp-lmc-common package 0.5.8
- updated decorator arguments for Configure method.
- decreased polling period (from 1 to 0.1 sec) during
command execution monitoring.
0.5.6
- update to csp-lmc-common 0.5.7
- removed the problem with forwarded attributes of array of strings.
When the root attribute of a forwarded attribute is an array of
strings the devices crashes.
0.5.5
- update to csp-lmc-common 0.5.6
0.5.4
- update to csp-lmc-common 0.5.5
0.5.3
- Use lmcbaseclasses = 0.5.0
- Moved ConfigureScan command to Configure.
- Moved EndSB() method to GoToIdle().
- Install in editable mode the csp-lmc-common package to install also
lmcbaseclasses package and its dependencies.
- Modified .gitlab-ci.yml file to execute linting and generate metrics.
- Still not resolved the issue to combine coverage outputs of
the different repository projects (csp-lmc-common and csp-lmc-mid).
- Moved logger.warn (deprecated) to logger.warning
0.4.0
- Use lmcbaseclasses = 0.4.1
- ska-python-buildenv 9.3.1
- ska-python-runtime 9.3.1
- Use csp-lmc-common = 0.4.0
0.3.0
- Use lmcbaseclasses version >=0.2.0
- Use csp-lmc-common >= 0.3.0
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/Pipfile 0000664 0000000 0000000 00000002021 13707315520 0023305 0 ustar 00root root 0000000 0000000 [[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[[source]]
url = "https://nexus.engageska-portugal.pt/repository/pypi/simple"
verify_ssl = true
name = "nexus-hosted"
[packages]
# numpy and pytango versions must match those in the ska-python-builder image,
# otherwise pytango will be recompiled.
numpy = "==1.17.2"
pytango = "==9.3.1"
csp-lmc-common = "> 0.5.0"
# itango is added to make it easier to exercise the device in a CLI session,
# but it's not mandatory. If you remove itango, you should also remove the
# 'RUN ipython profile create' line from Dockerfile.
itango = "*"
# If you want to debug devices running in containers, add pydevd to the dependencies
# pydevd = "*"
[dev-packages]
docutils = "*"
MarkupSafe = "*"
Pygments = "*"
pylint = "*"
pylint-junit = "*"
pytest = "*"
pytest-cov = "*"
pytest-pylint = "*"
pytest-json-report = "*"
python-dotenv = ">=0.5.1"
ptvsd = "*"
Sphinx = "*"
sphinx_rtd_theme = "*"
sphinx-autobuild = "*"
sphinxcontrib-websupport = "*"
[requires]
python_version = "3"
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/Pipfile.lock 0000664 0000000 0000000 00000107342 13707315520 0024250 0 ustar 00root root 0000000 0000000 {
"_meta": {
"hash": {
"sha256": "45dff9e198e39f569586fd3b272c050d6af8fd5fa49413ded0981613d5ac36af"
},
"pipfile-spec": 6,
"requires": {
"python_version": "3"
},
"sources": [
{
"name": "pypi",
"url": "https://pypi.org/simple",
"verify_ssl": true
}
]
},
"default": {
"backcall": {
"hashes": [
"sha256:38ecd85be2c1e78f77fd91700c76e14667dc21e2713b63876c0eb901196e01e4",
"sha256:bbbf4b1e5cd2bdb08f915895b51081c041bac22394fdfcfdfbe9f14b77c08bf2"
],
"version": "==0.1.0"
},
"decorator": {
"hashes": [
"sha256:54c38050039232e1db4ad7375cfce6748d7b41c29e95a081c8a6d2c30364a2ce",
"sha256:5d19b92a3c8f7f101c8dd86afd86b0f061a8ce4540ab8cd401fa2542756bce6d"
],
"version": "==4.4.1"
},
"enum34": {
"hashes": [
"sha256:2d81cbbe0e73112bdfe6ef8576f2238f2ba27dd0d55752a776c41d38b7da2850",
"sha256:644837f692e5f550741432dd3f223bbb9852018674981b1664e5dc339387588a",
"sha256:6bd0f6ad48ec2aa117d3d141940d484deccda84d4fcd884f5c3d93c23ecd8c79",
"sha256:8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1"
],
"version": "==1.1.6"
},
"ipython": {
"hashes": [
"sha256:d9459e7237e2e5858738ff9c3e26504b79899b58a6d49e574d352493d80684c6",
"sha256:f6689108b1734501d3b59c84427259fd5ac5141afe2e846cfa8598eb811886c9"
],
"version": "==7.12.0"
},
"ipython-genutils": {
"hashes": [
"sha256:72dd37233799e619666c9f639a9da83c34013a73e8bbc79a7a6348d93c61fab8",
"sha256:eb2e116e75ecef9d4d228fdc66af54269afa26ab4463042e33785b887c628ba8"
],
"version": "==0.2.0"
},
"itango": {
"hashes": [
"sha256:b81d58319e88494d40105dd4b4e2cf6840deeb2dffa74bd9a977396a17306640"
],
"index": "pypi",
"version": "==0.1.6"
},
"jedi": {
"hashes": [
"sha256:b4f4052551025c6b0b0b193b29a6ff7bdb74c52450631206c262aef9f7159ad2",
"sha256:d5c871cb9360b414f981e7072c52c33258d598305280fef91c6cae34739d65d5"
],
"version": "==0.16.0"
},
"numpy": {
"hashes": [
"sha256:05dbfe72684cc14b92568de1bc1f41e5f62b00f714afc9adee42f6311738091f",
"sha256:0d82cb7271a577529d07bbb05cb58675f2deb09772175fab96dc8de025d8ac05",
"sha256:10132aa1fef99adc85a905d82e8497a580f83739837d7cbd234649f2e9b9dc58",
"sha256:12322df2e21f033a60c80319c25011194cd2a21294cc66fee0908aeae2c27832",
"sha256:16f19b3aa775dddc9814e02a46b8e6ae6a54ed8cf143962b4e53f0471dbd7b16",
"sha256:3d0b0989dd2d066db006158de7220802899a1e5c8cf622abe2d0bd158fd01c2c",
"sha256:438a3f0e7b681642898fd7993d38e2bf140a2d1eafaf3e89bb626db7f50db355",
"sha256:5fd214f482ab53f2cea57414c5fb3e58895b17df6e6f5bca5be6a0bb6aea23bb",
"sha256:73615d3edc84dd7c4aeb212fa3748fb83217e00d201875a47327f55363cef2df",
"sha256:7bd355ad7496f4ce1d235e9814ec81ee3d28308d591c067ce92e49f745ba2c2f",
"sha256:7d077f2976b8f3de08a0dcf5d72083f4af5411e8fddacd662aae27baa2601196",
"sha256:a4092682778dc48093e8bda8d26ee8360153e2047826f95a3f5eae09f0ae3abf",
"sha256:b458de8624c9f6034af492372eb2fee41a8e605f03f4732f43fc099e227858b2",
"sha256:e70fc8ff03a961f13363c2c95ef8285e0cf6a720f8271836f852cc0fa64e97c8",
"sha256:ee8e9d7cad5fe6dde50ede0d2e978d81eafeaa6233fb0b8719f60214cf226578",
"sha256:f4a4f6aba148858a5a5d546a99280f71f5ee6ec8182a7d195af1a914195b21a2"
],
"index": "pypi",
"version": "==1.17.2"
},
"parso": {
"hashes": [
"sha256:56b2105a80e9c4df49de85e125feb6be69f49920e121406f15e7acde6c9dfc57",
"sha256:951af01f61e6dccd04159042a0706a31ad437864ec6e25d0d7a96a9fbb9b0095"
],
"version": "==0.6.1"
},
"pexpect": {
"hashes": [
"sha256:0b48a55dcb3c05f3329815901ea4fc1537514d6ba867a152b581d69ae3710937",
"sha256:fc65a43959d153d0114afe13997d439c22823a27cefceb5ff35c2178c6784c0c"
],
"markers": "sys_platform != 'win32'",
"version": "==4.8.0"
},
"pickleshare": {
"hashes": [
"sha256:87683d47965c1da65cdacaf31c8441d12b8044cdec9aca500cd78fc2c683afca",
"sha256:9649af414d74d4df115d5d718f82acb59c9d418196b7b4290ed47a12ce62df56"
],
"version": "==0.7.5"
},
"prompt-toolkit": {
"hashes": [
"sha256:a402e9bf468b63314e37460b68ba68243d55b2f8c4d0192f85a019af3945050e",
"sha256:c93e53af97f630f12f5f62a3274e79527936ed466f038953dfa379d4941f651a"
],
"version": "==3.0.3"
},
"ptyprocess": {
"hashes": [
"sha256:923f299cc5ad920c68f2bc0bc98b75b9f838b93b599941a6b63ddbc2476394c0",
"sha256:d7cc528d76e76342423ca640335bd3633420dc1366f258cb31d05e865ef5ca1f"
],
"version": "==0.6.0"
},
"pygments": {
"hashes": [
"sha256:2a3fe295e54a20164a9df49c75fa58526d3be48e14aceba6d6b1e8ac0bfd6f1b",
"sha256:98c8aa5a9f778fcd1026a17361ddaf7330d1b7c62ae97c3bb0ae73e0b9b6b0fe"
],
"version": "==2.5.2"
},
"pytango": {
"hashes": [
"sha256:254348ca5f17ed5b79cb653eeb46d87ac3d7347fc17b4b2185c4618fc4c000d7",
"sha256:54bdca5091fb351be984f71738ce0e2f8ba90c3ac6a50be20dfc7d4cad054806",
"sha256:618008d84d9ed34749f61e9e5232d0bbb9c7ad295e79b83407bbb0876c41cd7b",
"sha256:89647522eb85e676fbfdf442de28eb8154ea3130cb2be6edfbf13b966ed1aeaa",
"sha256:8e61617c1ba98d7abecc6c939a3b6bed6ad5ff00d515d29ea030347755a59200",
"sha256:cccf547b34d48cd7ef99aa1279d47784da1c1cb582b6cbc546ca4e280cbd2459",
"sha256:de4f7280df1d0c3194be5b59bc2c23aa9b4b84985d696a145073d71a057a6bb9"
],
"index": "pypi",
"version": "==9.3.1"
},
"six": {
"hashes": [
"sha256:236bdbdce46e6e6a3d61a337c0f8b763ca1e8717c03b369e87a7ec7ce1319c0a",
"sha256:8f3cd2e254d8f793e7f3d6d9df77b92252b52637291d0f0da013c76ea2724b6c"
],
"version": "==1.14.0"
},
"traitlets": {
"hashes": [
"sha256:70b4c6a1d9019d7b4f6846832288f86998aa3b9207c6821f3578a6a6a467fe44",
"sha256:d023ee369ddd2763310e4c3eae1ff649689440d4ae59d7485eb4cfbbe3e359f7"
],
"version": "==4.3.3"
},
"wcwidth": {
"hashes": [
"sha256:8fd29383f539be45b20bd4df0dc29c20ba48654a41e661925e612311e9f3c603",
"sha256:f28b3e8a6483e5d49e7f8949ac1a78314e740333ae305b4ba5defd3e74fb37a8"
],
"version": "==0.1.8"
}
},
"develop": {
"alabaster": {
"hashes": [
"sha256:446438bdcca0e05bd45ea2de1668c1d9b032e1a9154c2c259092d77031ddd359",
"sha256:a661d72d58e6ea8a57f7a86e37d86716863ee5e92788398526d58b26a4e4dc02"
],
"version": "==0.7.12"
},
"argh": {
"hashes": [
"sha256:a9b3aaa1904eeb78e32394cd46c6f37ac0fb4af6dc488daa58971bdc7d7fcaf3",
"sha256:e9535b8c84dc9571a48999094fda7f33e63c3f1b74f3e5f3ac0105a58405bb65"
],
"version": "==0.26.2"
},
"astroid": {
"hashes": [
"sha256:71ea07f44df9568a75d0f354c49143a4575d90645e9fead6dfb52c26a85ed13a",
"sha256:840947ebfa8b58f318d42301cf8c0a20fd794a33b61cc4638e28e9e61ba32f42"
],
"version": "==2.3.3"
},
"attrs": {
"hashes": [
"sha256:08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c",
"sha256:f7b7ce16570fe9965acd6d30101a28f62fb4a7f9e926b3bbc9b61f8b04247e72"
],
"version": "==19.3.0"
},
"babel": {
"hashes": [
"sha256:1aac2ae2d0d8ea368fa90906567f5c08463d98ade155c0c4bfedd6a0f7160e38",
"sha256:d670ea0b10f8b723672d3a6abeb87b565b244da220d76b4dba1b66269ec152d4"
],
"version": "==2.8.0"
},
"certifi": {
"hashes": [
"sha256:017c25db2a153ce562900032d5bc68e9f191e44e9a0f762f373977de9df1fbb3",
"sha256:25b64c7da4cd7479594d035c08c2d809eb4aab3a26e5a990ea98cc450c320f1f"
],
"version": "==2019.11.28"
},
"chardet": {
"hashes": [
"sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae",
"sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"
],
"version": "==3.0.4"
},
"coverage": {
"hashes": [
"sha256:15cf13a6896048d6d947bf7d222f36e4809ab926894beb748fc9caa14605d9c3",
"sha256:1daa3eceed220f9fdb80d5ff950dd95112cd27f70d004c7918ca6dfc6c47054c",
"sha256:1e44a022500d944d42f94df76727ba3fc0a5c0b672c358b61067abb88caee7a0",
"sha256:25dbf1110d70bab68a74b4b9d74f30e99b177cde3388e07cc7272f2168bd1477",
"sha256:3230d1003eec018ad4a472d254991e34241e0bbd513e97a29727c7c2f637bd2a",
"sha256:3dbb72eaeea5763676a1a1efd9b427a048c97c39ed92e13336e726117d0b72bf",
"sha256:5012d3b8d5a500834783689a5d2292fe06ec75dc86ee1ccdad04b6f5bf231691",
"sha256:51bc7710b13a2ae0c726f69756cf7ffd4362f4ac36546e243136187cfcc8aa73",
"sha256:527b4f316e6bf7755082a783726da20671a0cc388b786a64417780b90565b987",
"sha256:722e4557c8039aad9592c6a4213db75da08c2cd9945320220634f637251c3894",
"sha256:76e2057e8ffba5472fd28a3a010431fd9e928885ff480cb278877c6e9943cc2e",
"sha256:77afca04240c40450c331fa796b3eab6f1e15c5ecf8bf2b8bee9706cd5452fef",
"sha256:7afad9835e7a651d3551eab18cbc0fdb888f0a6136169fbef0662d9cdc9987cf",
"sha256:9bea19ac2f08672636350f203db89382121c9c2ade85d945953ef3c8cf9d2a68",
"sha256:a8b8ac7876bc3598e43e2603f772d2353d9931709345ad6c1149009fd1bc81b8",
"sha256:b0840b45187699affd4c6588286d429cd79a99d509fe3de0f209594669bb0954",
"sha256:b26aaf69713e5674efbde4d728fb7124e429c9466aeaf5f4a7e9e699b12c9fe2",
"sha256:b63dd43f455ba878e5e9f80ba4f748c0a2156dde6e0e6e690310e24d6e8caf40",
"sha256:be18f4ae5a9e46edae3f329de2191747966a34a3d93046dbdf897319923923bc",
"sha256:c312e57847db2526bc92b9bfa78266bfbaabac3fdcd751df4d062cd4c23e46dc",
"sha256:c60097190fe9dc2b329a0eb03393e2e0829156a589bd732e70794c0dd804258e",
"sha256:c62a2143e1313944bf4a5ab34fd3b4be15367a02e9478b0ce800cb510e3bbb9d",
"sha256:cc1109f54a14d940b8512ee9f1c3975c181bbb200306c6d8b87d93376538782f",
"sha256:cd60f507c125ac0ad83f05803063bed27e50fa903b9c2cfee3f8a6867ca600fc",
"sha256:d513cc3db248e566e07a0da99c230aca3556d9b09ed02f420664e2da97eac301",
"sha256:d649dc0bcace6fcdb446ae02b98798a856593b19b637c1b9af8edadf2b150bea",
"sha256:d7008a6796095a79544f4da1ee49418901961c97ca9e9d44904205ff7d6aa8cb",
"sha256:da93027835164b8223e8e5af2cf902a4c80ed93cb0909417234f4a9df3bcd9af",
"sha256:e69215621707119c6baf99bda014a45b999d37602cb7043d943c76a59b05bf52",
"sha256:ea9525e0fef2de9208250d6c5aeeee0138921057cd67fcef90fbed49c4d62d37",
"sha256:fca1669d464f0c9831fd10be2eef6b86f5ebd76c724d1e0706ebdff86bb4adf0"
],
"version": "==5.0.3"
},
"docutils": {
"hashes": [
"sha256:0c5b78adfbf7762415433f5515cd5c9e762339e23369dbe8000d84a4bf4ab3af",
"sha256:c2de3a60e9e7d07be26b7f2b00ca0309c207e06c100f9cc2a94931fc75a478fc"
],
"index": "pypi",
"version": "==0.16"
},
"idna": {
"hashes": [
"sha256:c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407",
"sha256:ea8b7f6188e6fa117537c3df7da9fc686d485087abf6ac197f9c46432f7e4a3c"
],
"version": "==2.8"
},
"imagesize": {
"hashes": [
"sha256:6965f19a6a2039c7d48bca7dba2473069ff854c36ae6f19d2cde309d998228a1",
"sha256:b1f6b5a4eab1f73479a50fb79fcf729514a900c341d8503d62a62dbc4127a2b1"
],
"version": "==1.2.0"
},
"importlib-metadata": {
"hashes": [
"sha256:06f5b3a99029c7134207dd882428a66992a9de2bef7c2b699b5641f9886c3302",
"sha256:b97607a1a18a5100839aec1dc26a1ea17ee0d93b20b0f008d80a5a050afb200b"
],
"markers": "python_version < '3.8'",
"version": "==1.5.0"
},
"isort": {
"hashes": [
"sha256:54da7e92468955c4fceacd0c86bd0ec997b0e1ee80d97f67c35a78b719dccab1",
"sha256:6e811fcb295968434526407adb8796944f1988c5b65e8139058f2014cbe100fd"
],
"version": "==4.3.21"
},
"jinja2": {
"hashes": [
"sha256:93187ffbc7808079673ef52771baa950426fd664d3aad1d0fa3e95644360e250",
"sha256:b0eaf100007721b5c16c1fc1eecb87409464edc10469ddc9a22a27a99123be49"
],
"version": "==2.11.1"
},
"junit-xml": {
"hashes": [
"sha256:602f1c480a19d64edb452bf7632f76b5f2cb92c1938c6e071dcda8ff9541dc21"
],
"version": "==1.8"
},
"lazy-object-proxy": {
"hashes": [
"sha256:0c4b206227a8097f05c4dbdd323c50edf81f15db3b8dc064d08c62d37e1a504d",
"sha256:194d092e6f246b906e8f70884e620e459fc54db3259e60cf69a4d66c3fda3449",
"sha256:1be7e4c9f96948003609aa6c974ae59830a6baecc5376c25c92d7d697e684c08",
"sha256:4677f594e474c91da97f489fea5b7daa17b5517190899cf213697e48d3902f5a",
"sha256:48dab84ebd4831077b150572aec802f303117c8cc5c871e182447281ebf3ac50",
"sha256:5541cada25cd173702dbd99f8e22434105456314462326f06dba3e180f203dfd",
"sha256:59f79fef100b09564bc2df42ea2d8d21a64fdcda64979c0fa3db7bdaabaf6239",
"sha256:8d859b89baf8ef7f8bc6b00aa20316483d67f0b1cbf422f5b4dc56701c8f2ffb",
"sha256:9254f4358b9b541e3441b007a0ea0764b9d056afdeafc1a5569eee1cc6c1b9ea",
"sha256:9651375199045a358eb6741df3e02a651e0330be090b3bc79f6d0de31a80ec3e",
"sha256:97bb5884f6f1cdce0099f86b907aa41c970c3c672ac8b9c8352789e103cf3156",
"sha256:9b15f3f4c0f35727d3a0fba4b770b3c4ebbb1fa907dbcc046a1d2799f3edd142",
"sha256:a2238e9d1bb71a56cd710611a1614d1194dc10a175c1e08d75e1a7bcc250d442",
"sha256:a6ae12d08c0bf9909ce12385803a543bfe99b95fe01e752536a60af2b7797c62",
"sha256:ca0a928a3ddbc5725be2dd1cf895ec0a254798915fb3a36af0964a0a4149e3db",
"sha256:cb2c7c57005a6804ab66f106ceb8482da55f5314b7fcb06551db1edae4ad1531",
"sha256:d74bb8693bf9cf75ac3b47a54d716bbb1a92648d5f781fc799347cfc95952383",
"sha256:d945239a5639b3ff35b70a88c5f2f491913eb94871780ebfabb2568bd58afc5a",
"sha256:eba7011090323c1dadf18b3b689845fd96a61ba0a1dfbd7f24b921398affc357",
"sha256:efa1909120ce98bbb3777e8b6f92237f5d5c8ea6758efea36a473e1d38f7d3e4",
"sha256:f3900e8a5de27447acbf900b4750b0ddfd7ec1ea7fbaf11dfa911141bc522af0"
],
"version": "==1.4.3"
},
"livereload": {
"hashes": [
"sha256:78d55f2c268a8823ba499305dcac64e28ddeb9a92571e12d543cd304faf5817b",
"sha256:89254f78d7529d7ea0a3417d224c34287ebfe266b05e67e51facaf82c27f0f66"
],
"version": "==2.6.1"
},
"markupsafe": {
"hashes": [
"sha256:00bc623926325b26bb9605ae9eae8a215691f33cae5df11ca5424f06f2d1f473",
"sha256:09027a7803a62ca78792ad89403b1b7a73a01c8cb65909cd876f7fcebd79b161",
"sha256:09c4b7f37d6c648cb13f9230d847adf22f8171b1ccc4d5682398e77f40309235",
"sha256:1027c282dad077d0bae18be6794e6b6b8c91d58ed8a8d89a89d59693b9131db5",
"sha256:13d3144e1e340870b25e7b10b98d779608c02016d5184cfb9927a9f10c689f42",
"sha256:24982cc2533820871eba85ba648cd53d8623687ff11cbb805be4ff7b4c971aff",
"sha256:29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b",
"sha256:43a55c2930bbc139570ac2452adf3d70cdbb3cfe5912c71cdce1c2c6bbd9c5d1",
"sha256:46c99d2de99945ec5cb54f23c8cd5689f6d7177305ebff350a58ce5f8de1669e",
"sha256:500d4957e52ddc3351cabf489e79c91c17f6e0899158447047588650b5e69183",
"sha256:535f6fc4d397c1563d08b88e485c3496cf5784e927af890fb3c3aac7f933ec66",
"sha256:596510de112c685489095da617b5bcbbac7dd6384aeebeda4df6025d0256a81b",
"sha256:62fe6c95e3ec8a7fad637b7f3d372c15ec1caa01ab47926cfdf7a75b40e0eac1",
"sha256:6788b695d50a51edb699cb55e35487e430fa21f1ed838122d722e0ff0ac5ba15",
"sha256:6dd73240d2af64df90aa7c4e7481e23825ea70af4b4922f8ede5b9e35f78a3b1",
"sha256:717ba8fe3ae9cc0006d7c451f0bb265ee07739daf76355d06366154ee68d221e",
"sha256:79855e1c5b8da654cf486b830bd42c06e8780cea587384cf6545b7d9ac013a0b",
"sha256:7c1699dfe0cf8ff607dbdcc1e9b9af1755371f92a68f706051cc8c37d447c905",
"sha256:88e5fcfb52ee7b911e8bb6d6aa2fd21fbecc674eadd44118a9cc3863f938e735",
"sha256:8defac2f2ccd6805ebf65f5eeb132adcf2ab57aa11fdf4c0dd5169a004710e7d",
"sha256:98c7086708b163d425c67c7a91bad6e466bb99d797aa64f965e9d25c12111a5e",
"sha256:9add70b36c5666a2ed02b43b335fe19002ee5235efd4b8a89bfcf9005bebac0d",
"sha256:9bf40443012702a1d2070043cb6291650a0841ece432556f784f004937f0f32c",
"sha256:ade5e387d2ad0d7ebf59146cc00c8044acbd863725f887353a10df825fc8ae21",
"sha256:b00c1de48212e4cc9603895652c5c410df699856a2853135b3967591e4beebc2",
"sha256:b1282f8c00509d99fef04d8ba936b156d419be841854fe901d8ae224c59f0be5",
"sha256:b2051432115498d3562c084a49bba65d97cf251f5a331c64a12ee7e04dacc51b",
"sha256:ba59edeaa2fc6114428f1637ffff42da1e311e29382d81b339c1817d37ec93c6",
"sha256:c8716a48d94b06bb3b2524c2b77e055fb313aeb4ea620c8dd03a105574ba704f",
"sha256:cd5df75523866410809ca100dc9681e301e3c27567cf498077e8551b6d20e42f",
"sha256:cdb132fc825c38e1aeec2c8aa9338310d29d337bebbd7baa06889d09a60a1fa2",
"sha256:e249096428b3ae81b08327a63a485ad0878de3fb939049038579ac0ef61e17e7",
"sha256:e8313f01ba26fbbe36c7be1966a7b7424942f670f38e666995b88d012765b9be"
],
"index": "pypi",
"version": "==1.1.1"
},
"mccabe": {
"hashes": [
"sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42",
"sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"
],
"version": "==0.6.1"
},
"more-itertools": {
"hashes": [
"sha256:5dd8bcf33e5f9513ffa06d5ad33d78f31e1931ac9a18f33d37e77a180d393a7c",
"sha256:b1ddb932186d8a6ac451e1d95844b382f55e12686d51ca0c68b6f61f2ab7a507"
],
"version": "==8.2.0"
},
"packaging": {
"hashes": [
"sha256:170748228214b70b672c581a3dd610ee51f733018650740e98c7df862a583f73",
"sha256:e665345f9eef0c621aa0bf2f8d78cf6d21904eef16a93f020240b704a57f1334"
],
"version": "==20.1"
},
"pathtools": {
"hashes": [
"sha256:7c35c5421a39bb82e58018febd90e3b6e5db34c5443aaaf742b3f33d4655f1c0"
],
"version": "==0.1.2"
},
"pluggy": {
"hashes": [
"sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0",
"sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"
],
"version": "==0.13.1"
},
"port-for": {
"hashes": [
"sha256:b16a84bb29c2954db44c29be38b17c659c9c27e33918dec16b90d375cc596f1c"
],
"version": "==0.3.1"
},
"ptvsd": {
"hashes": [
"sha256:10745fbb788001959b4de405198d8bd5243611a88fb5a2e2c6800245bc0ddd74",
"sha256:1d3d82ecc82186d099992a748556e6e54037f5c5e4d3fc9bba3e2302354be0d4",
"sha256:20f48ffed42a6beb879c250d82662e175ad59cc46a29c95c6a4472ae413199c5",
"sha256:22b699369a18ff28d4d1aa6a452739e50c7b7790cb16c6312d766e023c12fe27",
"sha256:2bbc121bce3608501998afbe742f02b80e7d26b8fecd38f78b903f22f52a81d9",
"sha256:3b05c06018fdbce5943c50fb0baac695b5c11326f9e21a5266c854306bda28ab",
"sha256:3f839fe91d9ddca0d6a3a0afd6a1c824be1768498a737ab9333d084c5c3f3591",
"sha256:459137736068bb02515040b2ed2738169cb30d69a38e0fd5dffcba255f41e68d",
"sha256:58508485a1609a495dd45829bd6d219303cf9edef5ca1f01a9ed8ffaa87f390c",
"sha256:612948a045fcf9c8931cd306972902440278f34de7ca684b49d4caeec9f1ec62",
"sha256:70260b4591c07bff95566d49b6a5dc3051d8558035c43c847bad9a954def46bb",
"sha256:72d114baa5737baf29c8068d1ccdd93cbb332d2030601c888eed0e3761b588d7",
"sha256:90cbd082e7a9089664888d0d94aca760202f080133fca8f3fe65c48ed6b9e39d",
"sha256:92d26aa7c8f7ffe41cb4b50a00846027027fa17acdf2d9dd8c24de77b25166c6",
"sha256:b9970e3dc987eb2a6001af6c9d2f726dd6455cfc6d47e0f51925cbdee7ea2157",
"sha256:c01204e3f025c3f7252c79c1a8a028246d29e3ef339e1a01ddf652999f47bdea",
"sha256:c893fb9d1c2ef8f980cc00ced3fd90356f86d9f59b58ee97e0e7e622b8860f76",
"sha256:c97c71835dde7e67fc7b06398bee1c012559a0784ebda9cf8acaf176c7ae766c",
"sha256:ccc5c533135305709461f545feed5061c608714db38fa0f58e3f848a127b7fde",
"sha256:cf09fd4d90c4c42ddd9bf853290f1a80bc2128993a3923bd3b96b68cc1acd03f",
"sha256:d2662ec37ee049c0f8f2f9a378abeb7e570d9215c19eaf0a6d7189464195009f",
"sha256:d9337ebba4d099698982e090b203e85670086c4b29cf1185b2e45cd353a8053e",
"sha256:de5234bec74c47da668e1a1a21bcc9821af0cbb28b5153df78cd5abc744b29a2",
"sha256:eda10ecd43daacc180a6fbe524992be76a877c3559e2b78016b4ada8fec10273",
"sha256:fad06de012a78f277318d0c308dd3d7cc1f67167f3b2e1e2f7c6caf04c03440c"
],
"index": "pypi",
"version": "==4.3.2"
},
"py": {
"hashes": [
"sha256:5e27081401262157467ad6e7f851b7aa402c5852dbcb3dae06768434de5752aa",
"sha256:c20fdd83a5dbc0af9efd622bee9a5564e278f6380fffcacc43ba6f43db2813b0"
],
"version": "==1.8.1"
},
"pygments": {
"hashes": [
"sha256:2a3fe295e54a20164a9df49c75fa58526d3be48e14aceba6d6b1e8ac0bfd6f1b",
"sha256:98c8aa5a9f778fcd1026a17361ddaf7330d1b7c62ae97c3bb0ae73e0b9b6b0fe"
],
"version": "==2.5.2"
},
"pylint": {
"hashes": [
"sha256:3db5468ad013380e987410a8d6956226963aed94ecb5f9d3a28acca6d9ac36cd",
"sha256:886e6afc935ea2590b462664b161ca9a5e40168ea99e5300935f6591ad467df4"
],
"index": "pypi",
"version": "==2.4.4"
},
"pylint-junit": {
"hashes": [
"sha256:1189343c93e40b5728d0d4294fa609b446ed09f72d2e7de861ef63c38f828714"
],
"index": "pypi",
"version": "==0.2.0"
},
"pyparsing": {
"hashes": [
"sha256:4c830582a84fb022400b85429791bc551f1f4871c33f23e44f353119e92f969f",
"sha256:c342dccb5250c08d45fd6f8b4a559613ca603b57498511740e65cd11a2e7dcec"
],
"version": "==2.4.6"
},
"pytest": {
"hashes": [
"sha256:0d5fe9189a148acc3c3eb2ac8e1ac0742cb7618c084f3d228baaec0c254b318d",
"sha256:ff615c761e25eb25df19edddc0b970302d2a9091fbce0e7213298d85fb61fef6"
],
"index": "pypi",
"version": "==5.3.5"
},
"pytest-cov": {
"hashes": [
"sha256:cc6742d8bac45070217169f5f72ceee1e0e55b0221f54bcf24845972d3a47f2b",
"sha256:cdbdef4f870408ebdbfeb44e63e07eb18bb4619fae852f6e760645fa36172626"
],
"index": "pypi",
"version": "==2.8.1"
},
"pytest-json-report": {
"hashes": [
"sha256:08182e00de9eb1735274fe4b91b0cf7314e138c0dac7e4ae424c3ec469787a2b",
"sha256:628b2a3a8f6edf069bf502ad8f65694ce6f2e4f86e73db442f18122389dafc38"
],
"index": "pypi",
"version": "==1.2.1"
},
"pytest-metadata": {
"hashes": [
"sha256:2071a59285de40d7541fde1eb9f1ddea1c9db165882df82781367471238b66ba",
"sha256:c29a1fb470424926c63154c1b632c02585f2ba4282932058a71d35295ff8c96d"
],
"version": "==1.8.0"
},
"pytest-pylint": {
"hashes": [
"sha256:3996a55ba66ce8ddf150754d8549567a4b067d63fa4513fdfd3325c7553c8075",
"sha256:b3f83f4525b2cbd019e9e46b4ee9c4ccee82bde66edf9872690ccfdc75456703"
],
"index": "pypi",
"version": "==0.15.0"
},
"python-dotenv": {
"hashes": [
"sha256:8429f459fc041237d98c9ff32e1938e7e5535b5ff24388876315a098027c3a57",
"sha256:ca9f3debf2262170d6f46571ce4d6ca1add60bb93b69c3a29dcb3d1a00a65c93"
],
"index": "pypi",
"version": "==0.11.0"
},
"pytz": {
"hashes": [
"sha256:1c557d7d0e871de1f5ccd5833f60fb2550652da6be2693c1e02300743d21500d",
"sha256:b02c06db6cf09c12dd25137e563b31700d3b80fcc4ad23abb7a315f2789819be"
],
"version": "==2019.3"
},
"pyyaml": {
"hashes": [
"sha256:059b2ee3194d718896c0ad077dd8c043e5e909d9180f387ce42012662a4946d6",
"sha256:1cf708e2ac57f3aabc87405f04b86354f66799c8e62c28c5fc5f88b5521b2dbf",
"sha256:24521fa2890642614558b492b473bee0ac1f8057a7263156b02e8b14c88ce6f5",
"sha256:4fee71aa5bc6ed9d5f116327c04273e25ae31a3020386916905767ec4fc5317e",
"sha256:70024e02197337533eef7b85b068212420f950319cc8c580261963aefc75f811",
"sha256:74782fbd4d4f87ff04159e986886931456a1894c61229be9eaf4de6f6e44b99e",
"sha256:940532b111b1952befd7db542c370887a8611660d2b9becff75d39355303d82d",
"sha256:cb1f2f5e426dc9f07a7681419fe39cee823bb74f723f36f70399123f439e9b20",
"sha256:dbbb2379c19ed6042e8f11f2a2c66d39cceb8aeace421bfc29d085d93eda3689",
"sha256:e3a057b7a64f1222b56e47bcff5e4b94c4f61faac04c7c4ecb1985e18caa3994",
"sha256:e9f45bd5b92c7974e59bcd2dcc8631a6b6cc380a904725fce7bc08872e691615"
],
"version": "==5.3"
},
"requests": {
"hashes": [
"sha256:11e007a8a2aa0323f5a921e9e6a2d7e4e67d9877e85773fba9ba6419025cbeb4",
"sha256:9cf5292fcd0f598c671cfc1e0d7d1a7f13bb8085e9a590f48c010551dc6c4b31"
],
"version": "==2.22.0"
},
"six": {
"hashes": [
"sha256:236bdbdce46e6e6a3d61a337c0f8b763ca1e8717c03b369e87a7ec7ce1319c0a",
"sha256:8f3cd2e254d8f793e7f3d6d9df77b92252b52637291d0f0da013c76ea2724b6c"
],
"version": "==1.14.0"
},
"snowballstemmer": {
"hashes": [
"sha256:209f257d7533fdb3cb73bdbd24f436239ca3b2fa67d56f6ff88e86be08cc5ef0",
"sha256:df3bac3df4c2c01363f3dd2cfa78cce2840a79b9f1c2d2de9ce8d31683992f52"
],
"version": "==2.0.0"
},
"sphinx": {
"hashes": [
"sha256:525527074f2e0c2585f68f73c99b4dc257c34bbe308b27f5f8c7a6e20642742f",
"sha256:543d39db5f82d83a5c1aa0c10c88f2b6cff2da3e711aa849b2c627b4b403bbd9"
],
"index": "pypi",
"version": "==2.4.2"
},
"sphinx-autobuild": {
"hashes": [
"sha256:66388f81884666e3821edbe05dd53a0cfb68093873d17320d0610de8db28c74e",
"sha256:e60aea0789cab02fa32ee63c7acae5ef41c06f1434d9fd0a74250a61f5994692"
],
"index": "pypi",
"version": "==0.7.1"
},
"sphinx-rtd-theme": {
"hashes": [
"sha256:00cf895504a7895ee433807c62094cf1e95f065843bf3acd17037c3e9a2becd4",
"sha256:728607e34d60456d736cc7991fd236afb828b21b82f956c5ea75f94c8414040a"
],
"index": "pypi",
"version": "==0.4.3"
},
"sphinxcontrib-applehelp": {
"hashes": [
"sha256:edaa0ab2b2bc74403149cb0209d6775c96de797dfd5b5e2a71981309efab3897",
"sha256:fb8dee85af95e5c30c91f10e7eb3c8967308518e0f7488a2828ef7bc191d0d5d"
],
"version": "==1.0.1"
},
"sphinxcontrib-devhelp": {
"hashes": [
"sha256:6c64b077937330a9128a4da74586e8c2130262f014689b4b89e2d08ee7294a34",
"sha256:9512ecb00a2b0821a146736b39f7aeb90759834b07e81e8cc23a9c70bacb9981"
],
"version": "==1.0.1"
},
"sphinxcontrib-htmlhelp": {
"hashes": [
"sha256:4670f99f8951bd78cd4ad2ab962f798f5618b17675c35c5ac3b2132a14ea8422",
"sha256:d4fd39a65a625c9df86d7fa8a2d9f3cd8299a3a4b15db63b50aac9e161d8eff7"
],
"version": "==1.0.2"
},
"sphinxcontrib-jsmath": {
"hashes": [
"sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178",
"sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8"
],
"version": "==1.0.1"
},
"sphinxcontrib-qthelp": {
"hashes": [
"sha256:513049b93031beb1f57d4daea74068a4feb77aa5630f856fcff2e50de14e9a20",
"sha256:79465ce11ae5694ff165becda529a600c754f4bc459778778c7017374d4d406f"
],
"version": "==1.0.2"
},
"sphinxcontrib-serializinghtml": {
"hashes": [
"sha256:c0efb33f8052c04fd7a26c0a07f1678e8512e0faec19f4aa8f2473a8b81d5227",
"sha256:db6615af393650bf1151a6cd39120c29abaf93cc60db8c48eb2dddbfdc3a9768"
],
"version": "==1.1.3"
},
"sphinxcontrib-websupport": {
"hashes": [
"sha256:50fb98fcb8ff2a8869af2afa6b8ee51b3baeb0b17dacd72505105bf15d506ead",
"sha256:bad3fbd312bc36a31841e06e7617471587ef642bdacdbdddaa8cc30cf251b5ea"
],
"index": "pypi",
"version": "==1.2.0"
},
"tornado": {
"hashes": [
"sha256:349884248c36801afa19e342a77cc4458caca694b0eda633f5878e458a44cb2c",
"sha256:398e0d35e086ba38a0427c3b37f4337327231942e731edaa6e9fd1865bbd6f60",
"sha256:4e73ef678b1a859f0cb29e1d895526a20ea64b5ffd510a2307b5998c7df24281",
"sha256:559bce3d31484b665259f50cd94c5c28b961b09315ccd838f284687245f416e5",
"sha256:abbe53a39734ef4aba061fca54e30c6b4639d3e1f59653f0da37a0003de148c7",
"sha256:c845db36ba616912074c5b1ee897f8e0124df269468f25e4fe21fe72f6edd7a9",
"sha256:c9399267c926a4e7c418baa5cbe91c7d1cf362d505a1ef898fde44a07c9dd8a5"
],
"version": "==6.0.3"
},
"typed-ast": {
"hashes": [
"sha256:0666aa36131496aed8f7be0410ff974562ab7eeac11ef351def9ea6fa28f6355",
"sha256:0c2c07682d61a629b68433afb159376e24e5b2fd4641d35424e462169c0a7919",
"sha256:249862707802d40f7f29f6e1aad8d84b5aa9e44552d2cc17384b209f091276aa",
"sha256:24995c843eb0ad11a4527b026b4dde3da70e1f2d8806c99b7b4a7cf491612652",
"sha256:269151951236b0f9a6f04015a9004084a5ab0d5f19b57de779f908621e7d8b75",
"sha256:4083861b0aa07990b619bd7ddc365eb7fa4b817e99cf5f8d9cf21a42780f6e01",
"sha256:498b0f36cc7054c1fead3d7fc59d2150f4d5c6c56ba7fb150c013fbc683a8d2d",
"sha256:4e3e5da80ccbebfff202a67bf900d081906c358ccc3d5e3c8aea42fdfdfd51c1",
"sha256:6daac9731f172c2a22ade6ed0c00197ee7cc1221aa84cfdf9c31defeb059a907",
"sha256:715ff2f2df46121071622063fc7543d9b1fd19ebfc4f5c8895af64a77a8c852c",
"sha256:73d785a950fc82dd2a25897d525d003f6378d1cb23ab305578394694202a58c3",
"sha256:8c8aaad94455178e3187ab22c8b01a3837f8ee50e09cf31f1ba129eb293ec30b",
"sha256:8ce678dbaf790dbdb3eba24056d5364fb45944f33553dd5869b7580cdbb83614",
"sha256:aaee9905aee35ba5905cfb3c62f3e83b3bec7b39413f0a7f19be4e547ea01ebb",
"sha256:bcd3b13b56ea479b3650b82cabd6b5343a625b0ced5429e4ccad28a8973f301b",
"sha256:c9e348e02e4d2b4a8b2eedb48210430658df6951fa484e59de33ff773fbd4b41",
"sha256:d205b1b46085271b4e15f670058ce182bd1199e56b317bf2ec004b6a44f911f6",
"sha256:d43943ef777f9a1c42bf4e552ba23ac77a6351de620aa9acf64ad54933ad4d34",
"sha256:d5d33e9e7af3b34a40dc05f498939f0ebf187f07c385fd58d591c533ad8562fe",
"sha256:fc0fea399acb12edbf8a628ba8d2312f583bdbdb3335635db062fa98cf71fca4",
"sha256:fe460b922ec15dd205595c9b5b99e2f056fd98ae8f9f56b888e7a17dc2b757e7"
],
"markers": "implementation_name == 'cpython' and python_version < '3.8'",
"version": "==1.4.1"
},
"urllib3": {
"hashes": [
"sha256:2f3db8b19923a873b3e5256dc9c2dedfa883e33d87c690d9c7913e1f40673cdc",
"sha256:87716c2d2a7121198ebcb7ce7cccf6ce5e9ba539041cfbaeecfb641dc0bf6acc"
],
"version": "==1.25.8"
},
"watchdog": {
"hashes": [
"sha256:c560efb643faed5ef28784b2245cf8874f939569717a4a12826a173ac644456b"
],
"version": "==0.10.2"
},
"wcwidth": {
"hashes": [
"sha256:8fd29383f539be45b20bd4df0dc29c20ba48654a41e661925e612311e9f3c603",
"sha256:f28b3e8a6483e5d49e7f8949ac1a78314e740333ae305b4ba5defd3e74fb37a8"
],
"version": "==0.1.8"
},
"wrapt": {
"hashes": [
"sha256:565a021fd19419476b9362b05eeaa094178de64f8361e44468f9e9d7843901e1"
],
"version": "==1.11.2"
},
"zipp": {
"hashes": [
"sha256:12248a63bbdf7548f89cb4c7cda4681e537031eda29c02ea29674bc6854460c2",
"sha256:7c0f8e91abc0dc07a5068f315c52cb30c66bfbc581e5b50704c8a2f6ebae794a"
],
"version": "==3.0.0"
}
}
}
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/README.md 0000664 0000000 0000000 00000000000 13707315520 0023244 0 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/conftest.py 0000775 0000000 0000000 00000007337 13707315520 0024213 0 ustar 00root root 0000000 0000000 """
A module defining a list of fixture functions that are shared across all the skabase
tests.
"""
#from __future__ import absolute_import
#import mock
import pytest
#sys.path.insert(0, "../commons")
import tango
#from tango.test_context import DeviceTestContext
#import global_enum
@pytest.fixture(scope="class")
def midcsp_master():
"""Create DeviceProxy for the MidCspMaster device
to test the device with the TANGO DB
"""
database = tango.Database()
instance_list = database.get_device_exported_for_class('MidCspMasterBase')
for instance in instance_list.value_string:
try:
return tango.DeviceProxy(instance)
except tango.DevFailed:
continue
@pytest.fixture(scope="class")
def midcsp_subarray01():
"""Create DeviceProxy for the CspMaster device
to test the device with the TANGO DB
"""
database = tango.Database()
instance_list = database.get_device_exported_for_class('MidCspSubarrayBase')
for instance in instance_list.value_string:
try:
if "subarray_01" in instance:
return tango.DeviceProxy(instance)
except tango.DevFailed:
continue
@pytest.fixture(scope="class")
def midcsp_subarray02():
"""Create DeviceProxy for the CspMaster device
to test the device with the TANGO DB
"""
database = tango.Database()
instance_list = database.get_device_exported_for_class('MidCspSubarrayBase')
for instance in instance_list.value_string:
try:
if "subarray_02" in instance:
return tango.DeviceProxy(instance)
except tango.DevFailed:
continue
@pytest.fixture(scope="class")
def cbf_subarray01():
"""Create DeviceProxy for the CspMaster device
to test the device with the TANGO DB
"""
database = tango.Database()
instance_list = database.get_device_exported_for_class('CbfSubarray')
for instance in instance_list.value_string:
try:
if "subarray_01" in instance:
return tango.DeviceProxy(instance)
except tango.DevFailed:
continue
@pytest.fixture(scope="class")
def cbf_subarray02():
"""Create DeviceProxy for the CspMaster device
to test the device with the TANGO DB
"""
database = tango.Database()
instance_list = database.get_device_exported_for_class('CbfSubarray')
for instance in instance_list.value_string:
try:
if "subarray_02" in instance:
return tango.DeviceProxy(instance)
except tango.DevFailed:
continue
@pytest.fixture(scope="class")
def cbf_master():
"""Create DeviceProxy for the CspMaster device
to test the device with the TANGO DB
"""
database = tango.Database()
instance_list = database.get_device_exported_for_class('CbfMaster')
for instance in instance_list.value_string:
try:
return tango.DeviceProxy(instance)
except tango.DevFailed:
continue
@pytest.fixture(scope="class")
def tm1_telstate_proxy():
database = tango.Database()
instance_list = database.get_device_exported_for_class('TmCspSubarrayLeafNodeTest')
for instance in instance_list.value_string:
try:
if "subarray_01" in instance:
return tango.DeviceProxy(instance)
except tango.DevFailed:
continue
@pytest.fixture(scope="class")
def tm2_telstate_proxy():
database = tango.Database()
instance_list = database.get_device_exported_for_class('TmCspSubarrayLeafNodeTest')
for instance in instance_list.value_string:
try:
if "subarray_02" in instance:
return tango.DeviceProxy(instance)
except tango.DevFailed:
continue
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/csp_lmc_mid/ 0000775 0000000 0000000 00000000000 13707315520 0024250 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/csp_lmc_mid/MidCspCapabilityMonitor.py 0000664 0000000 0000000 00000000515 13707315520 0031354 0 ustar 00root root 0000000 0000000 from tango.server import run
from csp_lmc_common.CspCapabilityMonitor import CspCapabilityMonitor
from csp_lmc_common.CspSearchBeamsMonitor import CspSearchBeamsMonitor
def main(args=None, **kwargs):
return run(classes=(CspCapabilityMonitor, CspSearchBeamsMonitor), args=args, **kwargs)
if __name__ == '__main__':
main()
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/csp_lmc_mid/MidCspMaster.py 0000664 0000000 0000000 00000000324 13707315520 0027154 0 ustar 00root root 0000000 0000000 from tango.server import run
from MidCspMasterBase import MidCspMasterBase
def main(args=None, **kwargs):
return run(classes=(MidCspMasterBase,), args=args, **kwargs)
if __name__ == '__main__':
main()
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/csp_lmc_mid/MidCspMasterBase.py 0000664 0000000 0000000 00000056752 13707315520 0027767 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
#
# This file is part of the MidCspMasterBase project
#
# INAF-SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
""" MidCspMasterBase class
The base class for MID CspMAster.
Fuctionality to monitor CSP.LMC Capabilities are
implemented in separate TANGO Devices.
"""
# PROTECTED REGION ID (CspMaster.standardlibray_import) ENABLED START #
# Python standard library
import sys
import os
from collections import defaultdict
# PROTECTED REGION END# //CspMaster.standardlibray_import
# tango imports
import tango
from tango import DebugIt
from tango.server import run
from tango.server import Device
from tango.server import attribute, command
from tango.server import device_property
from tango import AttrQuality, EventType, DevState
from tango import AttrWriteType, DeviceProxy
# Additional import
# PROTECTED REGION ID(MidCspMaster.additional_import) ENABLED START #
#
from ska.base import SKAMaster
from ska.base import utils
from ska.base.control_model import HealthState, AdminMode
# import CSP.LMC Common package
from csp_lmc_common.CspMaster import CspMaster
# PROTECTED REGION END # // MidCspMaster.additionnal_import
__all__ = ["MidCspMasterBase", "main"]
class MidCspMasterBase(CspMaster):
"""
The base class for MID CspMAster.
Fuctionality to monitor CSP.LMC Capabilities are
implemented in separate TANGO Devices.
**Properties:**
- Device Property
VCCsMonitor
- TANGO Device to monitor the Mid.CSP VCCs Capabilities\ndevices.
- Type:'DevString'
FSPsMonitor
- TANGO Device to monitor the Mid.CSP FSPs Capabilities\ndevices.
- Type:'DevString'
"""
# PROTECTED REGION ID(MidCspMasterBase.class_variable) ENABLED START #
# PROTECTED REGION END # // MidCspMasterBase.class_variable
# -----------------
# Device Properties
# -----------------
VCCsMonitor = device_property(
dtype='DevString', default_value="mid_csp/capability_monitor/vcc"
)
FSPsMonitor = device_property(
dtype='DevString', default_value="mid_csp/capability_monitor/fsp"
)
# ----------
# Attributes
# ----------
availableCapabilities = attribute(
dtype=('DevString',),
max_dim_x=20,
doc="A list of available number of instances of each capability type, e.g. `CORRELATOR:512`, `PSS-BEAMS:4`.",
)
"""
*Class attribute*
The list of available instances of each capability type.
Note:
This attribute is defined in SKAMaster Class from which CspMaster class inherits.\
To override the attribute *read* method, the *availableCapabilities* attribute \
is added again\
("overload" button enabled in POGO).
"""
receptorMembership = attribute(
dtype=('DevUShort',),
max_dim_x=197,
label="Receptor Memebership",
doc="The receptors affiliation to MID CSP sub-arrays.",
)
unassignedReceptorIDs = attribute(
dtype=('DevUShort',),
max_dim_x=197,
label="Unassigned receptors IDs",
doc="The list of available receptors IDs.",
)
vccCapabilitiesAddresses = attribute(
dtype=('DevString',),
max_dim_x=197,
label="VCC Capabilities Addresses",
doc="The list of VCC Capabilities FQDNs",
)
fspCapabilitiesAddresses = attribute(
dtype=('DevString',),
max_dim_x=27,
label="FSP Capabilities Addresses",
doc="The list of FSP Capabilites FQDNs",
)
reportSearchBeamState = attribute(name="reportSearchBeamState",
label="SearchBeam Capabilities State",
forwarded=True
)
reportSearchBeamHealthState = attribute(name="reportSearchBeamHealthState",
label="SearchBeam Capabilities healthState",
forwarded=True
)
reportSearchBeamObsState = attribute(name="reportSearchBeamObsState",
label="SearchBeam Capabilities obsState",
forwarded=True
)
reportSearchBeamAdminMode = attribute(name="reportSearchBeamAdminMode",
label="SearchBeam Capabilities adminMode",
forwarded=True
)
reportTimingBeamState = attribute(name="reportTimingBeamState",
label="TimingBeam Capabilities State",
forwarded=True
)
reportTimingBeamHealthState = attribute(name="reportTimingBeamHealthState",
label="TimingBeam Capabilities healthState",
forwarded=True
)
reportTimingBeamObsState = attribute(name="reportTimingBeamObsState",
label="TimingBeam Capabilities obsState",
forwarded=True
)
reportTimingBeamAdminMode = attribute(name="reportTimingBeamAdminMode",
label="TimingBeam Capabilities adminMode",
forwarded=True
)
reportVlbiBeamState = attribute(name="reportVlbiBeamState",
label="VlbiBeam Capabilities State",
forwarded=True
)
reportVlbiBeamHealthState = attribute(name="reportVlbiBeamHealthState",
label="VlbiBeam Capabilities healthState",
forwarded=True
)
reportVlbiBeamObsState = attribute(name="reportVlbiBeamObsState",
label="VlbiBeam Capabilities obsState",
forwarded=True
)
reportVlbiBeamAdminMode = attribute(name="reportVlbiBeamAdminMode",
label="VlbiBeam Capabilities adminMode",
forwarded=True
)
unassignedVlbiBeamIDs = attribute(name="unassignedVlbiBeamIDs",
label="Unassigned VlbiBeam Capabilities IDs",
forwarded=True
)
unassignedTimingBeamIDs = attribute(name="unassignedTimingBeamIDs",
label="Unassigned TimingBeam Capabilities IDs",
forwarded=True
)
unassignedSearchBeamIDs = attribute(name="unassignedSearchBeamIDs",
label="Unassigned SeachBeam Capabilities IDs",
forwarded=True
)
numOfUnassignedVlbiBeams = attribute(name="numOfUnassignedVlbiBeams",
label="Num of onassigned VlbiBeam Capabilities IDs",
forwarded=True
)
numOfUnassignedTimingBeams = attribute(name="numOfUnassignedTimingBeams",
label="Num of unassigned TimingBeam Capabilities IDs",
forwarded=True
)
numOfUnassignedSearchBeams = attribute(name="numOfUnassignedSearchBeams",
label="Num of unassigned SeachBeam Capabilities IDs",
forwarded=True
)
numOfReservedSearchBeams = attribute(name="numOfReservedSearchBeams",
label="Number of reserved SeachBeam Capabilities",
forwarded=True
)
searchBeamMembership = attribute(name="searchBeamMembership",
label="SearchBeam Membership",
forwarded=True
)
timingBeamMembership = attribute(name="timingBeamMembership",
label="TimingBeam Membership",
forwarded=True
)
vlbiBeamMembership = attribute(name="vlbiBeamMembership",
label="VlbiBeam Membership",
forwarded=True
)
reportVCCState = attribute(name="reportVCCState",
label="reportVCCState",
forwarded=True
)
reportVCCHealthState = attribute(name="reportVCCHealthState",
label="reportVCCHealthState",
forwarded=True
)
reportVCCAdminMode = attribute(name="reportVCCAdminMode",
label="reportVCCAdminMode",
forwarded=True
)
reportFSPState = attribute(name="reportFSPState",
label="reportFSPState",
forwarded=True
)
reportFSPHealthState = attribute(name="reportFSPHealthState",
label="reportFSPHealthState",
forwarded=True
)
reportFSPAdminMode = attribute(name="reportFSPAdminMode",
label="reportFSPAdminMode",
forwarded=True
)
#fspMembership = attribute(name="fspMembership",
# label="fspMembership",
# forwarded=True
#)
vccMembership = attribute(name="vccMembership",
label="vccMembership",
forwarded=True
)
#
# Class private methods
#
def __get_maxnum_of_receptors(self):
"""
Get the maximum number of receptors that can be used for observations.
This number can be less than 197.
"""
capability_dict = {}
if self._is_device_running(self.CspCbf, self._se_proxies):
try:
proxy = self._se_proxies[self.CspCbf]
vcc_to_receptor = proxy.vccToReceptor
self._vcc_to_receptor_map = dict([int(ID) for ID in pair.split(":")]
for pair in vcc_to_receptor)
# get the number of each Capability type allocated by CBF
cbf_max_capabilities = proxy.maxCapabilities
for capability in cbf_max_capabilities:
cap_type, cap_num = capability.split(':')
capability_dict[cap_type] = int(cap_num)
self._receptors_maxnum = capability_dict["VCC"]
self._receptorsMembership = [0]* self._receptors_maxnum
except KeyError as key_err:
log_msg = "Error: no key found for {}".format(str(key_err))
self.logger.error(log_msg)
except AttributeError as attr_err:
log_msg = "Error reading{}: {}".format(str(attr_err.args[0]),
attr_err.__doc__)
self.logger.error(log_msg)
except tango.DevFailed as df:
log_msg = "Error: " + str(df.args[0].reason)
self.logger.error(log_msg)
# ---------------
# General methods
# ---------------
def init_device(self):
"""Initialises the attributes and properties of the MidCspMasterBase."""
CspMaster.init_device(self)
# start CSP Capabilities monitoring
self._capability_monitor_fqdn = []
self._capability_monitor_fqdn.append(self.VCCsMonitor)
self._capability_monitor_fqdn.append(self.SearchBeamsMonitor)
self._capability_monitor_fqdn.append(self.TimingBeamsMonitor)
self._capability_monitor_fqdn.append(self.VlbiBeamsMonitor)
self.logger.info("MidCspMaster: call to self._connect_capabilities_monitor()")
self._connect_capabilities_monitor()
# PROTECTED REGION ID(MidCspMasterBase.init_device) ENABLED START #
# NOTE: VCC (Receptors) and FSP capabilities are implemented at
# CBF sub-element level. Need to evaluate if these capabilities
# have to be implemented also at CSP level.
# To retieve the information on the number of instances provided
# by CBF the CSP master has to connect to the Cbf Master. For this
# reason the __get_maxnum_of_receptors() method has to be called
# after connection.
self._vcc_to_receptor_map = {}
self._receptorsMembership = [0] * self._max_capabilities["VCC"]
self._available_capabilities = defaultdict(lambda:0)
self._unassigned_receptor_id = []
# read the mapping between VCC IDs and receptor IDs
if self._is_device_running(self.CspCbf, self._se_proxies):
proxy = self._se_proxies[self.CspCbf]
vcc_to_receptor = proxy.vccToReceptor
self._vcc_to_receptor_map = dict([int(ID) for ID in pair.split(":")]
for pair in vcc_to_receptor)
# PROTECTED REGION END # // MidCspMasterBase.init_device
def always_executed_hook(self):
"""Method always executed before any TANGO command is executed."""
# PROTECTED REGION ID(MidCspMasterBase.always_executed_hook) ENABLED START #
# PROTECTED REGION END # // MidCspMasterBase.always_executed_hook
def delete_device(self):
"""Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command.
"""
# PROTECTED REGION ID(MidCspMasterBase.delete_device) ENABLED START #
CspMaster.delete_device(self)
self._vcc_to_receptor_map.clear()
self._receptorsMembership.clear()
# PROTECTED REGION END # // MidCspMasterBase.delete_device
# ------------------
# Attributes methods
# ------------------
def read_availableCapabilities(self):
# PROTECTED REGION ID(MidCspMasterBase.availableCapabilities_read) ENABLED START #
"""
Override read attribute method.
:return:
A list of strings with the number of available resources for each
capability/resource type.
Example:
["VCC:95", "SearchBeam:1000", "TimingBeam:16", "VlbiBeam:20"]
:raises:
tango.DevFailed
"""
# PROTECTED REGION ID(CspMaster.availableCapabilities_read) ENABLED START #
try:
cap_type = [keys for keys,values in self._max_capabilities.items()]
self.logger.info(cap_type)
# TODO: when Receptors Capability devices are implemented, remove next lines.
# The number of unassignedReceptor is read from the ReceptorsMonitor
# device.
proxy = tango.DeviceProxy(self.get_name())
unassigned_receptors = proxy.unassignedReceptorIDs
# NOTE: if there is no available receptor, this call returns an array
# [0] whose length is 1 (not 0)
if len(unassigned_receptors) >= 1:
if unassigned_receptors[0] == 0:
self._available_capabilities["VCC"] = 0
else:
self._available_capabilities["VCC"] = len(unassigned_receptors)
for index, fqdn in enumerate(self._capability_monitor_fqdn):
if cap_type[index] == "VCC":
continue;
if self._is_device_running(fqdn, self._capability_monitor_proxy):
self._available_capabilities[cap_type[index]] = self._capability_monitor_proxy[fqdn].numOfUnassignedIDs
except tango.DevFailed as df:
msg = "Attribute reading failure: {}".format(df.args[0].desc)
self.dev_logger.error(msg)
tango.Except.throw_exception("Attribute reading failure",
df.args[0].desc,
"read_availableCapabilities",
tango.ErrSeverity.ERR)
except AttributeError as attr_err:
msg = "Error in reading {}: {} ".format(str(attr_err.args[0]),
attr_err.__doc__)
tango.Except.throw_exception("Attribute reading failure",
msg,
"read_availableCapabilities",
tango.ErrSeverity.ERR)
return utils.convert_dict_to_list(self._available_capabilities)
# PROTECTED REGION END # // MidCspMasterBase.availableCapabilities_read
def read_receptorMembership(self):
# PROTECTED REGION ID(MidCspMasterBase.receptorMembership_read) ENABLED START #
"""
Class attribute method.
:return:
The subarray affiliation of the receptors.
"""
# PROTECTED REGION ID(CspMaster.receptorMembership_read) ENABLED START #
if self._is_device_running(self.CspCbf, self._se_proxies):
try:
proxy = self._se_proxies[self.CspCbf]
vcc_membership = proxy.reportVccSubarrayMembership
for vcc_id, receptorID in self._vcc_to_receptor_map.items():
self._receptorsMembership[receptorID - 1] = vcc_membership[vcc_id - 1]
except tango.DevFailed as df:
tango.Except.re_throw_exception(df,
"CommandFailed",
"read_receptorsMembership failed",
"Command()")
except KeyError as key_err:
msg = "Can't retrieve the information of key {}".format(key_err)
self.logger.error(msg)
tango.Except.throw_exception("Attribute reading failure",
msg,
"read_receptorMembership",
tango.ErrSeverity.ERR)
except AttributeError as attr_err:
msg = "Error in reading {}: {} ".format(str(attr_err.args[0]), attr_err.__doc__)
tango.Except.throw_exception("Attribute reading failure",
msg,
"read_receptorMembership",
tango.ErrSeverity.ERR)
return self._receptorsMembership
# PROTECTED REGION END # // CspMaster.receptorMembership_read
# PROTECTED REGION END # // MidCspMasterBase.receptorMembership_read
def read_unassignedReceptorIDs(self):
# PROTECTED REGION ID(MidCspMasterBase.unassignedReceptorIDs_read) ENABLED START #
"""
Class attribute method.
Returns:
The list of the available receptors IDs.
The list includes all the receptors that are not assigned to any subarray and,
from the side of CSP, are considered "full working". This means:\n
* a valid link connection receptor-VCC\n
* the connected VCC healthState OK
*Type*: array of DevUShort
Raises:
tango.DevFailed: if there is no DeviceProxy providing interface to the\
CBF sub-element Master Device or an error is caught during\
command execution.
"""
# PROTECTED REGION ID(CspMaster.availableReceptorIDs_read) ENABLED START #
self._unassigned_receptor_id.clear()
if not self._is_device_running(self.CspCbf, self._se_proxies):
return [0]
#return self._unassigned_receptor_id[0]
try:
proxy = self._se_proxies[self.CspCbf]
# get the State and sub-array affiliation of the VCC
# Note: Mid CBF should also provide information about receptors!
vcc_state = proxy.reportVCCState
vcc_membership = proxy.reportVccSubarrayMembership
# check if the VCC-receptor map is already defined
if not self._vcc_to_receptor_map:
vcc_to_receptor = proxy.vccToReceptor
self._vcc_to_receptor_map = dict([int(ID) for ID in pair.split(":")]
for pair in vcc_to_receptor)
# get the list with the IDs of the available VCC
for vcc_id, receptorID in self._vcc_to_receptor_map.items():
try:
if vcc_state[vcc_id - 1] not in [tango.DevState.UNKNOWN]:
# skip the vcc already assigned to a sub-array
if vcc_membership[vcc_id - 1] != 0:
continue
# OSS: valid receptorIDs are in [1,197] range
# receptorID = 0 means the link connection between
# the receptor and the VCC is off
if receptorID > 0:
self._unassigned_receptor_id.append(receptorID)
else:
log_msg = ("Link problem with receptor connected"
" to Vcc {}".format(vcc_id + 1))
self.dev_logging(log_msg, tango.LogLevel.LOG_WARN)
except KeyError as key_err:
log_msg = ("No key {} found while accessing VCC {}".format(str(key_err),
vcc_id))
self.dev_logging(log_msg, tango.LogLevel.LOG_WARN)
except IndexError as idx_error:
log_msg = ("Error accessing VCC"
" element {}: {}".format(vcc_id,
str(idx_error)))
self.dev_logging(log_msg, tango.LogLevel.LOG_WARN)
except KeyError as key_err:
log_msg = "Can't retrieve the information of key {}".format(key_err)
tango.Except.throw_exception("Attribute reading failure",
log_msg,
"read_availableReceptorIDs",
tango.ErrSeverity.ERR)
except tango.DevFailed as df:
log_msg = "Error in read_unassignedReceptorIDs: {}".format(df.args[0].reason)
self.dev_logging(log_msg, int(tango.LogLevel.LOG_ERROR))
tango.Except.throw_exception("Attribute reading failure",
log_msg,
"read_unassignedReceptorIDs",
tango.ErrSeverity.ERR)
except AttributeError as attr_err:
msg = "Error in reading {}: {} ".format(str(attr_err.args[0]),
attr_err.__doc__)
tango.Except.throw_exception("Attribute reading failure",
msg,
"read_unassignedReceptorIDs",
tango.ErrSeverity.ERR)
if not len(self._unassigned_receptor_id):
return [0]
return self._unassigned_receptor_id
# PROTECTED REGION END # // MidCspMasterBase.unassignedReceptorIDs_read
def read_vccCapabilitiesAddresses(self):
# PROTECTED REGION ID(MidCspMasterBase.vccCapabilitiesAddresses_read) ENABLED START #
"""Return the vccCapabilitiesAddresses attribute."""
if not self._is_device_running(self.VCCsMonitor, self._capability_monitor_proxy):
return ('',)
try:
proxy = self._capability_monitor_proxy[self.VCCsMonitor]
return proxy.capabilityAddresses
except tango.DevFailed as tango_err:
msg = "Attribute reading failure: {}".format(tango_err.args[0].desc)
self.logger.error(msg)
tango.Except.throw_exception("Attribute reading failure", msg,
"read_vccCapabilityAddresses", tango.ErrSeverity.ERR)
# PROTECTED REGION END # // MidCspMasterBase.vccCapabilitiesAddresses_read
def read_fspCapabilitiesAddresses(self):
# PROTECTED REGION ID(MidCspMasterBase.fspCapabilitiesAddresses_read) ENABLED START #
"""Return the fspCapabilitiesAddresses attribute."""
if not self._is_device_running(self.FSPsMonitor, self._capability_monitor_proxy):
return ('',)
try:
proxy = self._capability_monitor_proxy[self.FSPsMonitor]
return proxy.capabilityAddresses
except tango.DevFailed as tango_err:
msg = "Attribute reading failure: {}".format(tango_err.args[0].desc)
self.logger.error(msg)
tango.Except.throw_exception("Attribute reading failure", msg,
"read_fspCapabilityAddresses", tango.ErrSeverity.ERR)
# PROTECTED REGION END # // MidCspMasterBase.fspCapabilitiesAddresses_read
# --------
# Commands
# --------
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
# PROTECTED REGION ID(MidCspMasterBase.main) ENABLED START #
return run((MidCspMasterBase,), args=args, **kwargs)
# PROTECTED REGION END # // MidCspMasterBase.main
if __name__ == '__main__':
main()
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/csp_lmc_mid/MidCspSubarray.py 0000664 0000000 0000000 00000001176 13707315520 0027517 0 ustar 00root root 0000000 0000000 from tango.server import run
from MidCspSubarrayBase import MidCspSubarrayBase
from MidCspSubarrayProcModeCorrelation import MidCspSubarrayProcModeCorrelation
from MidCspSubarrayProcModePss import MidCspSubarrayProcModePss
from MidCspSubarrayProcModePst import MidCspSubarrayProcModePst
from MidCspSubarrayProcModeVlbi import MidCspSubarrayProcModeVlbi
def main(args=None, **kwargs):
return run(classes=(MidCspSubarrayProcModeCorrelation,
MidCspSubarrayProcModePss, MidCspSubarrayProcModePst,
MidCspSubarrayProcModeVlbi,MidCspSubarrayBase), args=args, **kwargs)
if __name__ == '__main__':
main()
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/csp_lmc_mid/MidCspSubarrayBase.py 0000664 0000000 0000000 00000123035 13707315520 0030311 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
#
# This file is part of the MidCspSubarrayBase project
#
# INAF, SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
""" MidCspSubarrayBase
The base class for MID CspSubarray.
Fuctionality to monitor assigned CSP.LMC Capabilities,
as well as inherent Capabilities, are implemented in
separate TANGO Devices.
"""
# PROTECTED REGION ID (MidCspSubarrayBase.standardlibray_import) ENABLED START #
# Python standard library
import sys
import os
import threading
import time
import json
from collections import defaultdict
import logging
# PROTECTED REGION END# //MidCspSubarrayBase.standardlibray_import
# tango imports
import tango
from tango import DebugIt
from tango.server import run
from tango.server import Device, DeviceMeta
from tango.server import attribute, command
from tango.server import device_property
from tango import AttrQuality, EventType, DevState
from tango import AttrWriteType, DeviceProxy
# Additional import
# PROTECTED REGION ID(MidCspSubarray.additional_import) ENABLED START #
#from ska.base import SKAMaster
from ska.base import SKASubarray, SKASubarrayStateModel
from ska.base.commands import ActionCommand, ResponseCommand, ResultCode
from ska.base.faults import CapabilityValidationError
from ska.base.control_model import HealthState, AdminMode, ObsState
# import CSP.LMC Common package
from csp_lmc_common.utils.cspcommons import CmdExecState
#from csp_lmc_common.utils.decorators import AdminModeCheck, ObsStateCheck, SubarrayRejectCmd
from csp_lmc_common.CspSubarray import CspSubarray, CspSubarrayStateModel
from csp_lmc_mid.receptors import Receptors
# PROTECTED REGION END # // MidCspSubarrayBase.additionnal_import
__all__ = ["MidCspSubarrayBase", "main"]
class MidCspSubarrayBase(CspSubarray):
"""
The base class for MID CspSubarray.
Fuctionality to monitor assigned CSP.LMC Capabilities,
as well as inherent Capabilities, are implemented in
separate TANGO Devices.
**Properties:**
- Class Property
- Device Property
"""
# PROTECTED REGION ID(MidCspSubarrayBase.class_variable) ENABLED START #
# PROTECTED REGION END # // MidCspSubarrayBase.class_variable
# PROTECTED REGION ID(MidCspSubarrayBase.private_methods) ENABLED START #
class InitCommand(CspSubarray.InitCommand):
"""
A class for the SKASubarray's init_device() "command".
"""
def do(self):
"""
Stateless hook for device initialisation.
:return: A tuple containing a return code and a string
message indicating status. The message is for
information purpose only.
:rtype: (ResultCode, str)
"""
(result_code, message) = super().do()
device = self.target
device._assigned_vcc = []
device._assigned_fsp = []
#device._receptor_to_vcc_map = {}
#device._receptor_id_list = []
device._receptors = Receptors(device.CspMaster)
message = "MidCspSubarray Init command completed OK"
self.logger.info(message)
return (result_code, message)
class OnCommand(CspSubarray.OnCommand):
# NOTE: To remove when CBF Subarray implements the correct state
def do(self):
return super().do()
#return (ResultCode.OK, "On command completed OK")
class AddReceptorsCommand(SKASubarray.AssignResourcesCommand):
def do(self, argin):
device = self.target
# check if the CbfSubarray TANGO device is already running
# and the proxy registered
if not device._is_sc_subarray_running(device.CbfSubarray):
return (ResultCode.FAILED, "AddReceptors command FAILED")
proxy = device._sc_subarray_proxies[device.CbfSubarray]
device._reconfiguring = False
if self.state_model._obs_state == ObsState.IDLE:
device._reconfiguring = True
# forward the command to the CbfSubarray
try:
receptor_to_assign = self._validate_receptors_list(argin)
if not any(receptor_to_assign):
return (ResultCode.OK, "AddReceptors end OK")
device._timeout_expired = False
device._failure_raised = False
proxy.command_inout_asynch("AddReceptors", receptor_to_assign, device._cmd_ended_cb)
device._command_thread['addreceptors'] = threading.Thread(target=device._monitor_add_receptors,
name="Thread-AddReceptors",
args=(receptor_to_assign,))
device._sc_subarray_cmd_starting_time[device.CbfSubarray] = time.time()
if device._cmd_execution_state['addreceptors'] != CmdExecState.FAILED:
device._cmd_execution_state['addreceptors'] = CmdExecState.RUNNING
device._command_thread['addreceptors'].start()
return (ResultCode.STARTED, "AddReceptors Started")
except tango.DevFailed as tango_err:
#tango.Except.throw_exception("Command failed",
# tango_err.args[0].desc,
# "AddReceptors",
# tango.ErrSeverity.ERR)
return (ResultCode.FAILED, "Failure in AddReceptors")
def _validate_receptors_list(self, argin):
"""
Validate the list of the receptor IDs.
The method check if:
- the receptor Ids are valid that is are within the [1, 198] range
- the receptor Ids are not already allocated to other subarray
"""
# PROTECTED REGION ID(CspSubarray.AddReceptors) ENABLED START #
# Each vcc_id map to a vcc_fqdn inside CbfMaster, for example:
# vcc_id = 1 -> mid_csp_cbf/vcc/vcc_001
# vcc_id = 2 -> mid_csp_cbf/vcc/vcc_002
# .....
# vcc_id = 17 -> mid_csp_cbf/vcc/vcc_017
# vcc_id and receptor_id is not the same. The map between vcc_id and receptor_id
# is built by CbfMaster and exported as attribute.
# The max number of VCC allocated is defined by the VCC property of the CBF Master.
device = self.target
available_receptors = []
# the list of receptor to assign to the subarray
receptor_to_assign = []
#receptors = Receptors(device.CspMaster)
try:
available_receptors = device._receptors.unassigned_ids()
self.logger.info("available_receptors: {}".format(available_receptors))
if not any(available_receptors):
log_msg = "No available receptor to add to subarray {}".format( device.SubID)
self.logger.info(log_msg)
return []
# the list of available receptor IDs. This number is mantained by the CspMaster
# and reported on request.
receptor_id_list = device._receptors.list_of_ids()
self.logger.info("receptor_list:{}".format(receptor_id_list))
receptor_membership = device._receptors.subarray_affiliation()
except tango.DevFailed as df:
msg = "Failure in getting receptors information:" + \
str(df.args[0].reason)
tango.Except.throw_exception("Command failed", msg,
"AddReceptors", tango.ErrSeverity.ERR)
for receptorId in argin:
# check if the specified receptor id is a valid number (that is, belongs to the list
# of provided receptors)
if receptorId in receptor_id_list:
# check if the receptor id is one of the available receptor Ids
if receptorId in available_receptors:
receptor_to_assign.append(receptorId)
else:
# retrieve the subarray owner
sub_id = receptor_membership[receptorId - 1]
log_msg = "Receptor {} already assigned to subarray {}".format(str(receptorId),
str(sub_id))
self.logger.info(log_msg)
else:
log_msg = "Invalid receptor id: {}".format(str(receptorId))
self.logger.warning(log_msg)
# check if the list of receptors to assign is empty
if not receptor_to_assign:
log_msg = "No receptors to assign to the subarray"
self.logger.info(log_msg)
return []
# remove possible receptor repetition
tmp = set(receptor_to_assign)
receptor_to_assign = list(tmp)
return receptor_to_assign
# PROTECTED REGION END # // MidCspSubarrayBase.AddReceptors
#def succeeded(self):
# self.logger.info("Eccomi")
# action = "add_receptors_succeeded"
# self.state_model.perform_action(action)
# self.logger.info("ObsState:{}".format(self.state_model.obs_state))
class RemoveReceptorsCommand(SKASubarray.ReleaseResourcesCommand):
def do(self, argin):
device = self.target
# check if the CspSubarray is already connected to the CbfSubarray
if not device._is_sc_subarray_running(device.CbfSubarray):
log_msg = "Subarray {} not registered!".format( str(device.CbfSubarray))
self.logger.error(log_msg)
return (ResultCode.FAILED, log_msg)
try:
proxy = device._sc_subarray_proxies[device.CbfSubarray]
# read from CbfSubarray the list of assigned receptors
# failure in reading attribute raises an AttributeError (not tangoDevFailed!!)
#receptors = proxy.receptors
receptors = device._receptors.assigned_to_subarray(device.SubID)
#!!!!!!!!!!!!!!!!!
# 2019-09-20: New images for TANGO and PyTango images has been released. PyTango
# is now compiled with th numpy support. In this case the proxy.receptors call
# does no more return an empty tuple but an empty numpy array.
# Checks on receptors content need to be changed (see below)
# NB: the receptors attribute implemented by the CbfSubarray is declared as RW.
# In this case the read method returns an empty numpy array ([]) whose length is 0.
#!!!!!!!!!!!!!!!!!
# check if the list of assigned receptors is empty
if len(receptors):
receptors_to_remove = []
# check if the receptors to remove belong to the subarray
for receptor_id in argin:
if receptor_id in receptors:
receptors_to_remove.append(receptor_id)
if any(receptors_to_remove):
# TODO: add reading of CbfSubarray removeReceptorsCmdDurationExpected
# attribute, if implemented, otherwise use the default value
# subscribes attributes to track progress and timeout: if these
# attributes are not implemented at CbfSubarray level, the warning
# is only logged because is not a fatal error.
for attr in ['removeReceptorsCmdProgress', 'timeoutExpiredFlag']:
try:
if device._sc_subarray_event_id[device.CbfSubarray][attr.lower()] == 0:
evt_id = proxy.subscribe_event(attr, tango.EventType.CHANGE_EVENT,
device._attributes_change_evt_cb, stateless=False)
device._sc_subarray_event_id[device.CbfSubarray][attr.lower()] = evt_id
except tango.DevFailed as tango_err:
self.logger.debug(tango_err.args[0].desc)
device._timeout_expired = False
device._failure_raised = False
# forward the command to CbfSubarray
proxy.command_inout_asynch("RemoveReceptors", receptors_to_remove, device._cmd_ended_cb)
if device._cmd_execution_state['removereceptors'] != CmdExecState.FAILED:
device._cmd_execution_state['removereceptors'] = CmdExecState.RUNNING
device._sc_subarray_cmd_starting_time[device.CbfSubarray] = time.time()
# Note: rembember to put the comma in args=(receptors_to_remove,) otherwise
# the list is received as a numpy array!
device._command_thread['removereceptors'] = threading.Thread(target=device._monitor_remove_receptors,
name="Thread-RemoveReceptors",
args=(receptors_to_remove,))
device._command_thread['removereceptors'].start()
else :
return (ResultCode.OK, f"No receptor to remove from subarray {device.get_name()}")
device._cmd_execution_state['removereceptors'] = CmdExecState.IDLE
return (ResultCode.STARTED, "RemoveReceptor started")
except tango.DevFailed as tango_err:
#tango.Except.throw_exception("Command failed",
# tango_err.args[0].desc,
# "RemoveReceptors",
# tango.ErrSeverity.ERR)
message = str(tango_err.args[0].desc)
except AttributeError as attr_err:
#log_msg = "RemoveReceptors:" + str(attr_err)
#self.logger.error(log_msg)
#tango.Except.throw_exception("Command failed",
# str(attr_err),
# "RemoveReceptors",
# tango.ErrSeverity.ERR)
message = str(attr_err)
return (ResultCode.FAILED, message)
class RemoveAllReceptorsCommand(SKASubarray.ReleaseAllResourcesCommand):
def do(self):
self.logger.info("RemoveAllReceptorsCommand")
device = self.target
try:
if len(device):
#receptors = device._get_cbfsubarray_assigned_receptors()
receptors = device._receptors.assigned_to_subarray(device.SubID)
self.logger.info("assigned receptors:{}".format(receptors))
return device._removereceptors_cmd_obj.do(receptors[:])
return (ResultCode.OK, "No receptor to remove")
except tango.DevFailed as df:
log_msg = ("RemoveAllReceptors failure. Reason: {} "
"Desc: {}".format(df.args[0].reason,
df.args[0].desc))
self.logger.error(log_msg)
return (ResultCode.FAILED, log_msg)
class ConfigureCommand(CspSubarray.ConfigureCommand):
def do(self,argin):
self.logger.info("Call Mid CspSubarray Configure")
try:
return super().do(argin)
except tango.DevFailed as tango_err:
log_msg = ("Configure Command failure. Reason: {} "
"Desc: {}".format(tango_err.args[0].reason,
tango_err.args[0].desc))
#tango.Except.throw_exception("Command failed",
# log_msg,
# "ConfigureScan execution",
# tango.ErrSeverity.ERR)
self.logger.error(log_msg)
return (ResultCode.FAILED, log_msg)
def validate_scan_configuration(self, argin):
"""
Overwritten method.
Validate the MID scan configuration file.
Currently it only copies the received configuration because it does not
still exist any "cbf" block inside the JSON script.
:param json_config: the input JSON formatted string with the configuration
for a scan
"""
'''
TODO:
- look for the sub-element entries
- add eventual information to the sub-element blocks (for example for PSS add the
addresses of the PSS pipelines or the IDs of the SearchBeams)
- set the observing mode for each sub-element sub-array/PSTBeam
json_config = {}
try:
json_config = json.loads(argin)
except json.JSONDecodeError as e: # argument not a valid JSON object
# this is a fatal error
msg = ("Scan configuration object is not a valid JSON object."
"Aborting configuration:{}".format(str(e)))
self.logger.error(msg)
tango.Except.throw_exception("Command failed",
msg,
"ConfigureScan execution",
tango.ErrSeverity.ERR)
if "cbf" in json_config:
if self._sc_subarray_state[self.CbfSubarray] != tango.DevState.ON:
pass
# throw exception
self._sc_subarray_obs_mode[self.CbfSubarray] = ObsMode.CORRELATION
self._sc_scan_configuration[self.CbfSubarray] = json.dumps(json_config["cbf"])
self._sc_subarray_assigned_fqdn.append(self.CbfSubarray)
if "pss" in json_config:
if self._sc_subarray_state[self.PssSubarray] != tango.DevState.ON:
pass
# throw exception
#self._sc_subarray_obs_mode[self.PssSubarray] = ??
self._sc_subarray_assigned_fqdn.append(self.PssSubarray)
pss_json = json_config["pss"]
if "searchbeams" not in self._sc_scan_configuration[self.PssSubarray]:
pss_json["searchbeams"] = self._assigned_search_beams
self._sc_scan_configuration[self.PssSubarray] = json.dumps(pss_json)
if "pst" in json_config:
....
'''
self.logger.info("Mid CspSubarray validate_scan")
device = self.target
device._sc_subarray_assigned_fqdn.clear()
device._sc_subarray_assigned_fqdn.append(device.CbfSubarray)
json_dict = {}
try:
#CspSubarray.validate_scan_configuration(self, argin)
super().validate_scan_configuration(argin)
json_dict = json.loads(argin)
except json.JSONDecodeError as e: # argument not a valid JSON object
# this is a fatal error
msg = ("Scan configuration object is not a valid JSON object."
"Aborting configuration:{}".format(str(e)))
self.logger.error(msg)
tango.Except.throw_exception("Command failed",
msg,
"ConfigureScan execution",
tango.ErrSeverity.ERR)
# TODO:
# validate some entries of json_dict
self.logger.debug("Validate scan configuration for MID CSP")
#self._sc_subarray_obs_mode[self.CbfSubarray] = ObsMode.IMAGING
#self._sc_scan_configuration[self.CbfSubarray] = json_config["cbf"]
device._sc_subarray_scan_configuration[device.CbfSubarray] = argin
self.logger.debug("Validate scan: {}".format(device._sc_subarray_assigned_fqdn))
def __len__(self):
assigned_receptors = self._receptors.assigned_to_subarray(int(self.SubID))
self.logger.debug("len assigned_receptors:{}".format(assigned_receptors))
return len(assigned_receptors)
def update_subarray_state(self):
"""
Class protected method.
Retrieve the State attribute values of the CSP sub-elements and aggregate
them to build up the CSP global state.
:param: None
:return: None
"""
if CspSubarray.update_subarray_state(self):
if self.get_state() == DevState.ON:
if self._sc_subarray_obs_state[self.CbfSubarray] == ObsState.IDLE:
self._addreceptors_cmd_obj.succeeded()
if self._sc_subarray_obs_state[self.CbfSubarray] == ObsState.EMPTY:
self._removereceptors_cmd_obj.succeeded()
self.logger.info("MidCsp subarray state: {} obsState: {}".format(self.get_state(), self.state_model._obs_state))
return True
def _open_connection(self, fqdn):
device_proxy = DeviceProxy(fqdn)
return device_proxy
'''
def _get_cbfsubarray_assigned_receptors(self):
"""
:param device_proxy: DeviceProxy of the CBF Sub-element subarray
:return: the list of receptors Id on success, otherwise []
"""
receptors = []
try:
# Note: with numpy support in PyTango, receptors is a
# numpy array
device_proxy = self._sc_subarray_proxies[self.CbfSubarray]
receptors = device_proxy.receptors
except tango.DevFailed as tango_err:
self.logger.warning("__monitor_add_receptors:{}".format(tango_err.args[0].desc))
return receptors
'''
def _monitor_add_receptors(self, receptors_to_be_added, args_dict=None):
cmd_name = 'addreceptors'
device = self.CbfSubarray
self._num_dev_completed_task[cmd_name] = 0
self._list_dev_completed_task[cmd_name] = []
self._cmd_progress[cmd_name] = 0
self._cmd_duration_measured[cmd_name] = 0
# sub-component command execution measured time
self._sc_subarray_cmd_progress[device][cmd_name] = 0
self._failure_message[cmd_name] = ''
device_proxy = self._sc_subarray_proxies[device]
self.logger.info("Going to assign receptors {}".format(receptors_to_be_added))
while True:
self.logger.info("device {} obs_state:{}".format(device, self._sc_subarray_obs_state[device]))
if self._sc_subarray_obs_state[device] == ObsState.IDLE:
self.logger.info("Reconfiguring is:{}".format(self._reconfiguring))
assigned_receptors = self._receptors.assigned_to_subarray(self.SubID)
self.logger.info("assigned_receptors:{}".format(assigned_receptors))
if not self._reconfiguring:
self._num_dev_completed_task[cmd_name] = len(assigned_receptors)
self.logger.info("All required receptors assigned!!")
self._sc_subarray_cmd_progress[device][cmd_name] = 100
# calculate the real execution time for the command
self._cmd_duration_measured[cmd_name] = (
time.time() - self._sc_subarray_cmd_starting_time[device])
break
if self._sc_subarray_obs_state[device] == ObsState.RESOURCING:
self._reconfiguring = False
self.logger.info("Reconfiguring is:{}".format(self._reconfiguring))
# check if sub-element command ended throwing an exception: in this case the
# 'cmd_ended_cb' callback is invoked.
if self._sc_subarray_cmd_exec_state[device][cmd_name] == CmdExecState.FAILED or\
self._sc_subarray_obs_state[device] == ObsState.FAULT:
self._failure_raised = True
break
elapsed_time = time.time() - \
self._sc_subarray_cmd_starting_time[device]
if (elapsed_time > self._sc_subarray_cmd_duration_expected[device][cmd_name] or
self._sc_subarray_cmd_exec_state[device][cmd_name] == CmdExecState.TIMEOUT):
self._timeout_expired = True
msg = ("Timeout executing {} command on device {}".format(cmd_name, device))
self.logger.warning(msg)
self._sc_subarray_cmd_exec_state[device][cmd_name] = CmdExecState.TIMEOUT
break
# update the progress counter inside the loop taking into account the number of devices
# executing the command
self._cmd_progress[cmd_name] = self._sc_subarray_cmd_progress[device][cmd_name]
time.sleep(0.1)
# end of the while loop
self._last_executed_command = cmd_name
# update the progress counter at the end of the loop
self._cmd_progress[cmd_name] = self._sc_subarray_cmd_progress[device][cmd_name]
self._sc_subarray_cmd_exec_state[device][cmd_name] = CmdExecState.IDLE
self._cmd_execution_state[cmd_name] = CmdExecState.IDLE
# check for error conditions
self.logger.info("CspSubarray failure flag:{}".format(self._failure_raised))
self.logger.info("CspSubarray timeout flag:{}".format(self._timeout_expired))
if self._timeout_expired or self._failure_raised:
return self._addreceptors_cmd_obj.failed()
# reset the command execution state
self.logger.info("AddReceptors ends with success")
return self._addreceptors_cmd_obj.succeeded()
# PROTECTED REGION END # // MidCspSubarrayBase.private_methods
def _monitor_remove_receptors(self, receptor_list, args_dict=None):
cmd_name = 'removereceptors'
device = self.CbfSubarray
self._num_dev_completed_task[cmd_name] = 0
self._list_dev_completed_task[cmd_name] = []
self._cmd_progress[cmd_name] = 0
self._cmd_duration_measured[cmd_name] = 0
# sub-component command execution measured time
self._sc_subarray_cmd_progress[device][cmd_name] = 0
self._failure_message[cmd_name] = ''
device_proxy = self._sc_subarray_proxies[device]
while True:
# read the list of receptor IDs assigned to the CbfSubarray
try:
receptors = device_proxy.receptors
except AttributeError as attr_err:
self.logger.warning("RemoveReceptors:{}".format(str(attr_err)))
if len(receptors):
# get the ids in receptor_list that are no more present in receptors
receptors_removed = [
value for value in receptor_list if value not in receptors]
self._num_dev_completed_task[cmd_name] = len(
receptors) - len(receptor_list)
if len(receptors_removed) == len(receptor_list):
self._sc_subarray_cmd_progress[device][cmd_name] = 100
# calculate the real execution time for the command
self._cmd_duration_measured[cmd_name] = (
time.time() - self._sc_subarray_cmd_starting_time[device])
self.logger.info(
"Receptors {} have been successfully removed".format(receptor_list))
break
else:
self.logger.info("Receptors already successfully removed")
self._sc_subarray_cmd_progress[device][cmd_name] = 100
break
# check if sub-element command ended throwing an exception: in this case the
# 'cmd_ended_cb' callback is invoked.
if self._sc_subarray_cmd_exec_state[device][cmd_name] == CmdExecState.FAILED:
break
elapsed_time = time.time() - \
self._sc_subarray_cmd_starting_time[device]
if (elapsed_time > self._sc_subarray_cmd_duration_expected[device][cmd_name] or
self._sc_subarray_cmd_exec_state[device][cmd_name] == CmdExecState.TIMEOUT):
msg = ("Timeout executing {} command on device {}".format(
cmd_name, device))
self.logger.warning(msg)
self._sc_subarray_cmd_exec_state[device][cmd_name] = CmdExecState.TIMEOUT
break
# update the progress counter inside the loop taking into account the number of devices
# executing the command
self._cmd_progress[cmd_name] = self._sc_subarray_cmd_progress[device][cmd_name]
time.sleep(0.1)
# end of the while loop
self._last_executed_command = cmd_name
# update the progress counter at the end of the loop
self._cmd_progress[cmd_name] = self._sc_subarray_cmd_progress[device][cmd_name]
self.logger.info("CspSubarray failure flag:{}".format(self._failure_raised))
self.logger.info("CspSubarray timeout flag:{}".format(self._timeout_expired))
# check for error conditions
if self._sc_subarray_cmd_exec_state[device][cmd_name] == CmdExecState.FAILED:
self._failure_raised = True
if self._sc_subarray_state[self.CbfSubarray] not in [tango.DevState.OFF,
tango.DevState.ON]:
self._failure_message[cmd_name] += ("Device {} is in {} State".format(device,
self._sc_subarray_state[self.CbfSubarray]))
self.logger.warning(self._failure_message[device])
self._failure_raised = True
return (ResultCode.FAILED, "RemoveReceptors ended with failure")
if self._sc_subarray_cmd_exec_state[device][cmd_name] == CmdExecState.TIMEOUT:
self._timeout_expired = True
return (ResultCode.FAILED, "RemoveReceptors ended with timeout")
# reset the command exeuction state
self._sc_subarray_cmd_exec_state[device][cmd_name] = CmdExecState.IDLE
self._cmd_execution_state[cmd_name] = CmdExecState.IDLE
self.logger.info("Receptors removed with success")
return self._removereceptors_cmd_obj.succeeded()
#@command(
# dtype_in='DevString',
# doc_in="A Json-encoded string with the scan configuration.",
#)
#@DebugIt()
#def Configure(self, argin):
# CspSubarray.Configure(self, argin)
def init_command_objects(self):
"""
Sets up the command objects
"""
super().init_command_objects()
args = (self, self.state_model, self.logger)
self._addreceptors_cmd_obj = self.AddReceptorsCommand(*args)
self._removereceptors_cmd_obj = self.RemoveReceptorsCommand(*args)
self._removereceptors_cmd_obj = self.RemoveReceptorsCommand(*args)
self.register_command_object("AddReceptors", self.AddReceptorsCommand(*args))
self.register_command_object("RemoveReceptors", self.RemoveReceptorsCommand(*args))
self.register_command_object("RemoveAllReceptors", self.RemoveAllReceptorsCommand(*args))
# PROTECTED REGION END # // MidCspSubarrayBase.private_methods
# ----------------
# Class Properties
# ----------------
# -----------------
# Device Properties
# -----------------
# ----------
# Attributes
# ----------
assignedFsp = attribute(
dtype=('DevUShort',),
max_dim_x=27,
label="List of assigned FSPs",
doc="List of assigned FSPs.",
)
assignedVcc = attribute(
dtype=('DevUShort',),
max_dim_x=197,
label="List of assigned VCCs",
doc="List of assigned VCCs.",
)
addReceptorsCmdProgress = attribute(
dtype='DevUShort',
label="AddReceptors command progress percentage",
polling_period=1500,
doc="The progress percentage for the AddReceptors command.",
)
removeReceptorsCmdProgress = attribute(
dtype='DevUShort',
label="RemoveReceptors command progress percentage",
polling_period=1500,
doc="The progress percentage for the RemoveReceptors command.",
)
assignedVccState = attribute(name="assignedVccState",
label="State of the assigned VCC",
forwarded=True
)
assignedVccHealthState = attribute(name="assignedVccHealthState",
label="HealthState of the assigned VCC",
forwarded=True
)
assignedFspState = attribute(name="assignedFspState",
label="State of the assigned FSPs",
forwarded=True
)
assignedFspHealthState = attribute(name="assignedFspHealthState",
label="HealthState of the assigned FSPs.",
forwarded=True
)
assignedReceptors = attribute(name="assignedReceptors",
label="The list of assigned receptor IDs.",
forwarded=True
)
# TODO: implement the root attributes on CbfSubarray
# assignedVccObsState = attribute(name="assignedVccObsState",
# label="ObsState of the assigned VCCs",
# forwarded=True
# )
# assignedFspObsState = attribute(name="assignedFspObsState",
# label="ObsState of the assigned FSPs.",
# forwarded=True
# )
# assignedVccAdminMode = attribute(name="assignedVccAdminMode",
# label="AdminMode of the assigned VCCs.",
# forwarded=True
# )
# assignedFspAdminMode = attribute(name="assignedFspAdminMode",
# label="AdminMode of the assigned FSPs.",
# forwarded=True
# )
# ---------------
# General methods
# ---------------
def always_executed_hook(self):
"""Method always executed before any TANGO command is executed."""
# PROTECTED REGION ID(MidCspSubarrayBase.always_executed_hook) ENABLED START #
# PROTECTED REGION END # // MidCspSubarrayBase.always_executed_hook
def delete_device(self):
"""Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command.
"""
# PROTECTED REGION ID(MidCspSubarrayBase.delete_device) ENABLED START #
CspSubarray.delete_device(self)
# PROTECTED REGION END # // MidCspSubarrayBase.delete_device
# ------------------
# Attributes methods
# ------------------
def read_addReceptorsCmdProgress(self):
# PROTECTED REGION ID(MidCspSubarrayBase.addReceptorsCmdProgress_read) ENABLED START #
"""Return the addReceptorsCmdProgress attribute."""
return self._cmd_progress['addreceptors']
# PROTECTED REGION END # // MidCspSubarrayBase.addReceptorsCmdProgress_read
def read_removeReceptorsCmdProgress(self):
# PROTECTED REGION ID(MidCspSubarrayBase.removeReceptorsCmdProgress_read) ENABLED START #
"""Return the removeReceptorsCmdProgress attribute."""
return self._cmd_progress['removereceptors']
# PROTECTED REGION END # // MidCspSubarrayBase.removeReceptorsCmdProgress_read
def read_assignedFsp(self):
# PROTECTED REGION ID(MidCspSubarrayBase.assignedFsp_read) ENABLED START #
"""Return the assignedFsp attribute."""
return (0,)
# PROTECTED REGION END # // MidCspSubarrayBase.assignedFsp_read
def read_assignedVcc(self):
# PROTECTED REGION ID(MidCspSubarrayBase.assignedVcc_read) ENABLED START #
"""
*Attribute method*
:returns:
The list of VCC IDs assigned to the subarray.
*Type*: array of DevUShort.
"""
# PROTECTED REGION ID(CspSubarray.vcc_read) ENABLED START #
self._assigned_vcc.clear()
# get the map VCC-receptor from CspMaster
#receptor_id_list = self._receptors.list_of_ids()
'''
if not self._receptor_to_vcc_map:
try:
csp_proxy = tango.DeviceProxy(self.CspMaster)
csp_proxy.ping()
cbf_master_addr = csp_proxy.cbfMasterAddress
cbf_master_proxy = tango.DeviceProxy(cbf_master_addr)
cbf_master_proxy.ping()
# build the list of receptor ids
receptor_to_vcc = cbf_master_proxy.receptorToVcc
self._receptor_to_vcc_map = dict([int(ID) for ID in pair.split(":")]
for pair in receptor_to_vcc)
# build the list of the installed receptors
self._receptor_id_list = list(self._receptor_to_vcc_map.keys())
except tango.DevFailed as tango_err:
self.logger.warning(tango_err.args[0].desc)
'''
try:
#assigned_receptors = self._sc_subarray_proxies[self.CbfSubarray].receptors
assigned_receptors = self._receptors.assigned_to_subarray(self.SubID)
# NOTE: if receptors attribute is empty, assigned_receptors is an empty numpy array
# and it will just be skipped by the for loop
receptor_to_vcc_map = self._receptors.receptor_to_vcc_map
for receptor_id in assigned_receptors:
vcc_id = receptor_to_vcc_map[receptor_id]
self._assigned_vcc.append(vcc_id)
except KeyError as key_err:
msg = "No {} found".format(key_err)
tango.Except.throw_exception("Read attribute failure",
msg,
"read_vcc",
tango.ErrSeverity.ERR)
except tango.DevFailed as df:
tango.Except.throw_exception("Read attribute failure",
df.args[0].desc,
"read_vcc",
tango.ErrSeverity.ERR)
return self._assigned_vcc
# PROTECTED REGION END # // MidCspSubarrayBase.assignedVcc_read
# --------
# Commands
# --------
@command(
dtype_in='DevVarUShortArray',
doc_in="List of the receptor IDs to add to the subarray.",
dtype_out='DevVarLongStringArray',
)
@DebugIt()
def AddReceptors(self, argin):
# PROTECTED REGION ID(MidCspSubarrayBase.AddReceptors) ENABLED START #
"""
*Class method*
Add the specified receptor IDs to the subarray.
The command can be executed only if the CspSubarray *ObsState* is *IDLE*.
:param argin: the list of receptor IDs
:type: array of DevUShort
:return:
None
:raises:
tango.DevFailed: if the CbfSubarray is not available or if an exception\
is caught during command execution.
"""
handler = self.get_command_object("AddReceptors")
(result_code, message) = handler(argin)
return [[result_code], [message]]
@command(
dtype_in='DevVarUShortArray',
doc_in="The list with the receptor IDs to remove",
dtype_out='DevVarLongStringArray',
)
@DebugIt()
def RemoveReceptors(self, argin):
# PROTECTED REGION ID(MidCspSubarrayBase.RemoveReceptors) ENABLED START #
"""
Remove the receptor IDs from the subarray.
:param argin: The list of the receptor IDs to remove from the subarray.
Type: array of DevUShort
:returns:
None
:raises:
tango.DevFailed: raised if the subarray *obState* attribute is not IDLE, or \
when an exception is caught during command execution.
"""
# PROTECTED REGION ID(CspSubarray.RemoveReceptors) ENABLED START #
self.logger.info("Call to RemoveReceptors")
handler = self.get_command_object("RemoveReceptors")
(result_code, message) = handler(argin)
return [[result_code], [message]]
# PROTECTED REGION END # // MidCspSubarrayBase.RemoveReceptors
@command(
dtype_out='DevVarLongStringArray',
)
@DebugIt()
def RemoveAllReceptors(self):
# PROTECTED REGION ID(MidCspSubarrayBase.RemoveAllReceptors) ENABLED START #
"""
*Class method.*
Remove all the assigned receptors from the subarray.
Returns:
None
Raises:
tango.DevFailed: raised if the subarray *obState* attribute is not IDLE or READY, or \
when an exception is caught during command execution.
"""
# PROTECTED REGION ID(CspSubarray.RemoveAllReceptors) ENABLED START #
self.logger.info("Call to RemoveAllReceptors")
handler = self.get_command_object("RemoveAllReceptors")
(result_code, message) = handler()
return [[result_code], [message]]
# PROTECTED REGION END # // MidCspSubarrayBase.RemoveAllReceptors
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
# PROTECTED REGION ID(MidCspSubarrayBase.main) ENABLED START #
return run((MidCspSubarrayBase,), args=args, **kwargs)
# PROTECTED REGION END # // MidCspSubarrayBase.main
if __name__ == '__main__':
main()
MidCspSubarrayProcModeCorrelation.py 0000664 0000000 0000000 00000006436 13707315520 0033277 0 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/csp_lmc_mid # -*- coding: utf-8 -*-
#
# This file is part of the MidCspSubarrayProcModeCorrelation project
#
# INAF-SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
""" MID CSP Subarray Processing Mode Correlation Capability
The class exposes parameters nd commands required for monitor and
control of the correlator functions for a single MID Csp Subarray.
"""
# PyTango imports
import tango
from tango import DebugIt
from tango.server import run
from tango.server import Device
from tango.server import attribute, command
from tango.server import device_property
from tango import AttrQuality, DispLevel, DevState
from tango import AttrWriteType, PipeWriteType
from csp_lmc_common.CspSubarrayProcModeCorrelation import CspSubarrayProcModeCorrelation
# Additional import
# PROTECTED REGION ID(MidCspSubarrayProcModeCorrelation.additionnal_import) ENABLED START #
# PROTECTED REGION END # // MidCspSubarrayProcModeCorrelation.additionnal_import
__all__ = ["MidCspSubarrayProcModeCorrelation", "main"]
class MidCspSubarrayProcModeCorrelation(CspSubarrayProcModeCorrelation):
"""
The class exposes parameters nd commands required for monitor and
control of the correlator functions for a single MID Csp Subarray.
**Properties:**
- Device Property
"""
# PROTECTED REGION ID(MidCspSubarrayProcModeCorrelation.class_variable) ENABLED START #
# PROTECTED REGION END # // MidCspSubarrayProcModeCorrelation.class_variable
# -----------------
# Device Properties
# -----------------
# ----------
# Attributes
# ----------
# ---------------
# General methods
# ---------------
def init_device(self):
"""Initialises the attributes and properties of the MidCspSubarrayProcModeCorrelation."""
CspSubarrayProcModeCorrelation.init_device(self)
# PROTECTED REGION ID(MidCspSubarrayProcModeCorrelation.init_device) ENABLED START #
# PROTECTED REGION END # // MidCspSubarrayProcModeCorrelation.init_device
def always_executed_hook(self):
"""Method always executed before any TANGO command is executed."""
# PROTECTED REGION ID(MidCspSubarrayProcModeCorrelation.always_executed_hook) ENABLED START #
# PROTECTED REGION END # // MidCspSubarrayProcModeCorrelation.always_executed_hook
def delete_device(self):
"""Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command.
"""
# PROTECTED REGION ID(MidCspSubarrayProcModeCorrelation.delete_device) ENABLED START #
# PROTECTED REGION END # // MidCspSubarrayProcModeCorrelation.delete_device
# ------------------
# Attributes methods
# ------------------
# --------
# Commands
# --------
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
# PROTECTED REGION ID(MidCspSubarrayProcModeCorrelation.main) ENABLED START #
return run((MidCspSubarrayProcModeCorrelation,), args=args, **kwargs)
# PROTECTED REGION END # // MidCspSubarrayProcModeCorrelation.main
if __name__ == '__main__':
main()
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/csp_lmc_mid/MidCspSubarrayProcModePss.py 0000664 0000000 0000000 00000006144 13707315520 0031636 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
#
# This file is part of the MidCspSubarrayProcModePss project
#
# INAF-SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
""" MID CSP Subarray Processing Mode PSS Capability
The class exposes parameters and commands required for monitor and
control of the Processing PSS Mode for a single MID Csp Subarray.
"""
# PyTango imports
import tango
from tango import DebugIt
from tango.server import run
from tango.server import Device
from tango.server import attribute, command
from tango.server import device_property
from tango import AttrQuality, DispLevel, DevState
from tango import AttrWriteType, PipeWriteType
from csp_lmc_common.CspSubarrayProcModePss import CspSubarrayProcModePss
# Additional import
# PROTECTED REGION ID(MidCspSubarrayProcModePss.additionnal_import) ENABLED START #
# PROTECTED REGION END # // MidCspSubarrayProcModePss.additionnal_import
__all__ = ["MidCspSubarrayProcModePss", "main"]
class MidCspSubarrayProcModePss(CspSubarrayProcModePss):
"""
The class exposes parameters and commands required for monitor and
control of the Processing PSS Mode for a single MID Csp Subarray.
**Properties:**
- Device Property
"""
# PROTECTED REGION ID(MidCspSubarrayProcModePss.class_variable) ENABLED START #
# PROTECTED REGION END # // MidCspSubarrayProcModePss.class_variable
# -----------------
# Device Properties
# -----------------
# ----------
# Attributes
# ----------
# ---------------
# General methods
# ---------------
def init_device(self):
"""Initialises the attributes and properties of the MidCspSubarrayProcModePss."""
CspSubarrayProcModePss.init_device(self)
# PROTECTED REGION ID(MidCspSubarrayProcModePss.init_device) ENABLED START #
# PROTECTED REGION END # // MidCspSubarrayProcModePss.init_device
def always_executed_hook(self):
"""Method always executed before any TANGO command is executed."""
# PROTECTED REGION ID(MidCspSubarrayProcModePss.always_executed_hook) ENABLED START #
# PROTECTED REGION END # // MidCspSubarrayProcModePss.always_executed_hook
def delete_device(self):
"""Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command.
"""
# PROTECTED REGION ID(MidCspSubarrayProcModePss.delete_device) ENABLED START #
# PROTECTED REGION END # // MidCspSubarrayProcModePss.delete_device
# ------------------
# Attributes methods
# ------------------
# --------
# Commands
# --------
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
# PROTECTED REGION ID(MidCspSubarrayProcModePss.main) ENABLED START #
return run((MidCspSubarrayProcModePss,), args=args, **kwargs)
# PROTECTED REGION END # // MidCspSubarrayProcModePss.main
if __name__ == '__main__':
main()
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/csp_lmc_mid/MidCspSubarrayProcModePst.py 0000664 0000000 0000000 00000006065 13707315520 0031641 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
#
# This file is part of the MidCspSubarrayProcModePst project
#
# INAF-SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
""" MID CSP Subarray Processing Mode PST Capability
The class exposes parameters and commands required for monitor and
control the Processing Mode PST for a single MID Csp Subarray.
"""
# PyTango imports
import tango
from tango import DebugIt
from tango.server import run
from tango.server import Device
from tango.server import attribute, command
from tango.server import device_property
from tango import AttrQuality, DispLevel, DevState
from tango import AttrWriteType, PipeWriteType
from csp_lmc_common.CspSubarrayProcModePst import CspSubarrayProcModePst
# Additional import
# PROTECTED REGION ID(MidCspSubarrayProcModePst.additionnal_import) ENABLED START #
# PROTECTED REGION END # // MidCspSubarrayProcModePst.additionnal_import
__all__ = ["MidCspSubarrayProcModePst", "main"]
class MidCspSubarrayProcModePst(CspSubarrayProcModePst):
"""
The class exposes parameters and commands required for monitor and
control the Processing Mode PST for a single MID Csp Subarray.
**Properties:**
- Device Property
"""
# PROTECTED REGION ID(MidCspSubarrayProcModePst.class_variable) ENABLED START #
# PROTECTED REGION END # // MidCspSubarrayProcModePst.class_variable
# -----------------
# Device Properties
# -----------------
# ----------
# Attributes
# ----------
# General methods
# ---------------
def init_device(self):
"""Initialises the attributes and properties of the MidCspSubarrayProcModePst."""
CspSubarrayProcModePst.init_device(self)
# PROTECTED REGION ID(MidCspSubarrayProcModePst.init_device) ENABLED START #
# PROTECTED REGION END # // MidCspSubarrayProcModePst.init_device
def always_executed_hook(self):
"""Method always executed before any TANGO command is executed."""
# PROTECTED REGION ID(MidCspSubarrayProcModePst.always_executed_hook) ENABLED START #
# PROTECTED REGION END # // MidCspSubarrayProcModePst.always_executed_hook
def delete_device(self):
"""Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command.
"""
# PROTECTED REGION ID(MidCspSubarrayProcModePst.delete_device) ENABLED START #
# PROTECTED REGION END # // MidCspSubarrayProcModePst.delete_device
# ------------------
# Attributes methods
# ------------------
# --------
# Commands
# --------
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
# PROTECTED REGION ID(MidCspSubarrayProcModePst.main) ENABLED START #
return run((MidCspSubarrayProcModePst,), args=args, **kwargs)
# PROTECTED REGION END # // MidCspSubarrayProcModePst.main
if __name__ == '__main__':
main()
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/csp_lmc_mid/MidCspSubarrayProcModeVlbi.py 0000664 0000000 0000000 00000006200 13707315520 0031756 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
#
# This file is part of the MidCspSubarrayProcModeVlbi project
#
# INAF-SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
""" MID CSP Subarray Processing Mode Correlation Capability
The class exposes parameters nd commands required for monitor and
control of the Processing Mode VLBI for a single MID Csp Subarray.
"""
# PyTango imports
import tango
from tango import DebugIt
from tango.server import run
from tango.server import Device
from tango.server import attribute, command
from tango.server import device_property
from tango import AttrQuality, DispLevel, DevState
from tango import AttrWriteType, PipeWriteType
from csp_lmc_common.CspSubarrayProcModeVlbi import CspSubarrayProcModeVlbi
# Additional import
# PROTECTED REGION ID(MidCspSubarrayProcModeVlbi.additionnal_import) ENABLED START #
# PROTECTED REGION END # // MidCspSubarrayProcModeVlbi.additionnal_import
__all__ = ["MidCspSubarrayProcModeVlbi", "main"]
class MidCspSubarrayProcModeVlbi(CspSubarrayProcModeVlbi):
"""
The class exposes parameters nd commands required for monitor and
control of the Processing Mode VLBI for a single MID Csp Subarray.
**Properties:**
- Device Property
"""
# PROTECTED REGION ID(MidCspSubarrayProcModeVlbi.class_variable) ENABLED START #
# PROTECTED REGION END # // MidCspSubarrayProcModeVlbi.class_variable
# -----------------
# Device Properties
# -----------------
# ----------
# Attributes
# ----------
# ---------------
# General methods
# ---------------
def init_device(self):
"""Initialises the attributes and properties of the MidCspSubarrayProcModeVlbi."""
CspSubarrayProcModeVlbi.init_device(self)
# PROTECTED REGION ID(MidCspSubarrayProcModeVlbi.init_device) ENABLED START #
# PROTECTED REGION END # // MidCspSubarrayProcModeVlbi.init_device
def always_executed_hook(self):
"""Method always executed before any TANGO command is executed."""
# PROTECTED REGION ID(MidCspSubarrayProcModeVlbi.always_executed_hook) ENABLED START #
# PROTECTED REGION END # // MidCspSubarrayProcModeVlbi.always_executed_hook
def delete_device(self):
"""Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command.
"""
# PROTECTED REGION ID(MidCspSubarrayProcModeVlbi.delete_device) ENABLED START #
# PROTECTED REGION END # // MidCspSubarrayProcModeVlbi.delete_device
# ------------------
# Attributes methods
# ------------------
# --------
# Commands
# --------
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
# PROTECTED REGION ID(MidCspSubarrayProcModeVlbi.main) ENABLED START #
return run((MidCspSubarrayProcModeVlbi,), args=args, **kwargs)
# PROTECTED REGION END # // MidCspSubarrayProcModeVlbi.main
if __name__ == '__main__':
main()
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/csp_lmc_mid/__init__.py 0000664 0000000 0000000 00000000000 13707315520 0026347 0 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/csp_lmc_mid/docker/ 0000775 0000000 0000000 00000000000 13707315520 0025517 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/csp_lmc_mid/docker/.make/ 0000775 0000000 0000000 00000000000 13707315520 0026512 5 ustar 00root root 0000000 0000000 .make-release-support 0000664 0000000 0000000 00000005067 13707315520 0032511 0 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/csp_lmc_mid/docker/.make #!/bin/bash
#
# Copyright 2015 Xebia Nederland B.V.
# Modifications copyright 2019 SKA Organisation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
function hasChanges() {
test -n "$(git status -s .)"
}
function getRelease() {
awk -F= '/^release=/{print $2}' .release
}
function getBaseTag() {
sed -n -e "s/^tag=\(.*\)$(getRelease)\$/\1/p" .release
}
function getTag() {
if [ -z "$1" ] ; then
awk -F= '/^tag/{print $2}' .release
else
echo "$(getBaseTag)$1"
fi
}
function setRelease() {
if [ -n "$1" ] ; then
sed -i.x -e "s/^tag=.*/tag=$(getTag $1)/" .release
sed -i.x -e "s/^release=.*/release=$1/g" .release
rm -f .release.x
runPreTagCommand "$1"
else
echo "ERROR: missing release version parameter " >&2
return 1
fi
}
function runPreTagCommand() {
if [ -n "$1" ] ; then
COMMAND=$(sed -n -e "s/@@RELEASE@@/$1/g" -e 's/^pre_tag_command=\(.*\)/\1/p' .release)
if [ -n "$COMMAND" ] ; then
if ! OUTPUT=$(bash -c "$COMMAND" 2>&1) ; then echo $OUTPUT >&2 && exit 1 ; fi
fi
else
echo "ERROR: missing release version parameter " >&2
return 1
fi
}
function tagExists() {
tag=${1:-$(getTag)}
test -n "$tag" && test -n "$(git tag | grep "^$tag\$")"
}
function differsFromRelease() {
tag=$(getTag)
! tagExists $tag || test -n "$(git diff --shortstat -r $tag .)"
}
function getVersion() {
result=$(getRelease)
if differsFromRelease; then
result="$result-$(git log -n 1 --format=%h .)"
fi
if hasChanges ; then
result="$result-dirty"
fi
echo $result
}
function nextPatchLevel() {
version=${1:-$(getRelease)}
major_and_minor=$(echo $version | cut -d. -f1,2)
patch=$(echo $version | cut -d. -f3)
version=$(printf "%s.%d" $major_and_minor $(($patch + 1)))
echo $version
}
function nextMinorLevel() {
version=${1:-$(getRelease)}
major=$(echo $version | cut -d. -f1);
minor=$(echo $version | cut -d. -f2);
version=$(printf "%d.%d.0" $major $(($minor + 1))) ;
echo $version
}
function nextMajorLevel() {
version=${1:-$(getRelease)}
major=$(echo $version | cut -d. -f1);
version=$(printf "%d.0.0" $(($major + 1)))
echo $version
}
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/csp_lmc_mid/docker/.make/Makefile.mk 0000664 0000000 0000000 00000011200 13707315520 0030552 0 ustar 00root root 0000000 0000000 #
# Copyright 2015 Xebia Nederland B.V.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
ifeq ($(strip $(PROJECT)),)
NAME=$(shell basename $(CURDIR))
else
NAME=$(PROJECT)
endif
RELEASE_SUPPORT := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))/.make-release-support
ifeq ($(strip $(DOCKER_REGISTRY_HOST)),)
DOCKER_REGISTRY_HOST = nexus.engageska-portugal.pt
endif
ifeq ($(strip $(DOCKER_REGISTRY_USER)),)
DOCKER_REGISTRY_USER = ska-docker
endif
IMAGE=$(DOCKER_REGISTRY_HOST)/$(DOCKER_REGISTRY_USER)/$(NAME)
#VERSION = release version + git sha
VERSION=$(shell . $(RELEASE_SUPPORT) ; getVersion)
#BASE_VERSION
BASE_VERSION=$(shell . $(RELEASE_SUPPORT) ; getRelease)
#TAG = project name + release version
TAG=$(shell . $(RELEASE_SUPPORT); getTag)
#DEFAULT_TAG = image name + BASE_VERSION
DEFAULT_TAG=$(IMAGE):$(BASE_VERSION)
SHELL=/bin/bash
DOCKER_BUILD_CONTEXT=..
DOCKER_FILE_PATH=Dockerfile
.PHONY: pre-build docker-build post-build build release patch-release minor-release major-release tag check-status check-release showver \
push pre-push do-push post-push
build: pre-build docker-build post-build ## build the application image
pre-build:
post-build:
pre-push:
post-push:
docker-build: .release
@echo "Building image: $(IMAGE):$(VERSION)"
@echo "NAME: $(NAME)"
docker build $(DOCKER_BUILD_ARGS) -t $(IMAGE):$(VERSION) $(DOCKER_BUILD_CONTEXT) -f $(DOCKER_FILE_PATH) --build-arg DOCKER_REGISTRY_HOST=$(DOCKER_REGISTRY_HOST) --build-arg DOCKER_REGISTRY_USER=$(DOCKER_REGISTRY_USER)
@DOCKER_MAJOR=$(shell docker -v | sed -e 's/.*version //' -e 's/,.*//' | cut -d\. -f1) ; \
DOCKER_MINOR=$(shell docker -v | sed -e 's/.*version //' -e 's/,.*//' | cut -d\. -f2) ; \
if [ $$DOCKER_MAJOR -eq 1 ] && [ $$DOCKER_MINOR -lt 10 ] ; then \
echo docker tag -f $(IMAGE):$(VERSION) $(IMAGE):latest ;\
docker tag -f $(IMAGE):$(VERSION) $(IMAGE):latest ;\
else \
echo docker tag $(IMAGE):$(VERSION) $(IMAGE):latest ;\
docker tag $(IMAGE):$(VERSION) $(IMAGE):latest ; \
fi
release: check-status check-release build push
push: pre-push do-push post-push ## push the image to the Docker registry
do-push: ## Push the image tagged as $(IMAGE):$(VERSION) and $(DEFAULT_TAG)
@echo -e "Tagging: $(IMAGE):$(VERSION) -> $(DEFAULT_TAG)"
docker tag $(IMAGE):$(VERSION) $(DEFAULT_TAG)
@echo -e "Pushing: $(IMAGE):$(VERSION)"
docker push $(IMAGE):$(VERSION)
@echo -e "Pushing: $(DEFAULT_TAG)"
docker push $(DEFAULT_TAG)
tag_latest: do-push ## Tag the images as latest
@echo "Tagging: $(DEFAULT_TAG) -> $(IMAGE):latest"
@docker tag $(DEFAULT_TAG) $(IMAGE):latest
push_latest: tag_latest ## Push the image tagged as :latest
@echo "Pushing: $(IMAGE):latest"
@docker push $(IMAGE):latest
snapshot: build push
showver: .release
@. $(RELEASE_SUPPORT); getVersion
bump-patch-release: VERSION := $(shell . $(RELEASE_SUPPORT); nextPatchLevel)
bump-patch-release: .release tag
bump-minor-release: VERSION := $(shell . $(RELEASE_SUPPORT); nextMinorLevel)
bump-minor-release: .release tag
bump-major-release: VERSION := $(shell . $(RELEASE_SUPPORT); nextMajorLevel)
bump-major-release: .release tag
patch-release: tag-patch-release release
@echo $(VERSION)
minor-release: tag-minor-release release
@echo $(VERSION)
major-release: tag-major-release release
@echo $(VERSION)
tag: TAG=$(shell . $(RELEASE_SUPPORT); getTag $(VERSION))
tag: check-status
# @. $(RELEASE_SUPPORT) ; ! tagExists $(TAG) || (echo "ERROR: tag $(TAG) for version $(VERSION) already tagged in git" >&2 && exit 1) ;
@. $(RELEASE_SUPPORT) ; setRelease $(VERSION)
# git add .
# git commit -m "bumped to version $(VERSION)" ;
# git tag $(TAG) ;
# @ if [ -n "$(shell git remote -v)" ] ; then git push --tags ; else echo 'no remote to push tags to' ; fi
check-status:
@. $(RELEASE_SUPPORT) ; ! hasChanges || (echo "ERROR: there are still outstanding changes" >&2 && exit 1) ;
check-release: .release
@. $(RELEASE_SUPPORT) ; tagExists $(TAG) || (echo "ERROR: version not yet tagged in git. make [minor,major,patch]-release." >&2 && exit 1) ;
@. $(RELEASE_SUPPORT) ; ! differsFromRelease $(TAG) || (echo "ERROR: current directory differs from tagged $(TAG). make [minor,major,patch]-release." ; exit 1)
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/csp_lmc_mid/docker/.release 0000664 0000000 0000000 00000001023 13707315520 0027134 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
#
# This file is part of the CSP.LMC prototype project
#
#
# Distributed under the terms of the BSD-3-Clause license.
# See LICENSE.txt for more info.
"""Release information for Python Package"""
name = """tangods-cspmaster"""
version = "0.4.1"
version_info = version.split(".")
description = """SKA CSP.LMC Common Classe"""
author = "E.G"
author_email = "elisabetta.giani@inaf.it"
license = """BSD-3-Clause"""
url = """www.tango-controls.org"""
copyright = """"""
release=0.4.1
tag=csp-lmc-common-0.4.1
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/csp_lmc_mid/docker/Dockerfile 0000664 0000000 0000000 00000001041 13707315520 0027505 0 ustar 00root root 0000000 0000000 FROM nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:0.2.2 AS buildenv
FROM nexus.engageska-portugal.pt/ska-docker/ska-python-runtime:0.2.2 AS runtime
# create ipython profile to so that itango doesn't fail if ipython hasn't run yet
RUN ipython profile create
#install lmc-base-classes
USER root
RUN DEBIAN_FRONTEND=noninteractive pip3 install https://nexus.engageska-portugal.pt/repository/pypi/packages/lmcbaseclasses/0.2.0+6bb55a6e/lmcbaseclasses-0.2.0+6bb55a6e.tar.gz
CMD ["/venv/bin/python", "-m"," csp_lmc_common.CspMaster" ]
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/csp_lmc_mid/docker/Makefile 0000664 0000000 0000000 00000016713 13707315520 0027167 0 ustar 00root root 0000000 0000000 #
# Project makefile for a Tango project. You should normally only need to modify
# DOCKER_REGISTRY_USER and PROJECT below.
#
#
# DOCKER_REGISTRY_HOST, DOCKER_REGISTRY_USER and PROJECT are combined to define
# the Docker tag for this project. The definition below inherits the standard
# value for DOCKER_REGISTRY_HOST (=rnexus.engageska-portugal.pt) and overwrites
# DOCKER_REGISTRY_USER and PROJECT to give a final Docker tag of
# nexus.engageska-portugal.pt/tango-example/csplmc
#
DOCKER_REGISTRY_USER:=ska-docker
PROJECT = csp-lmc-common
#
# include makefile to pick up the standard Make targets, e.g., 'make build'
# build, 'make push' docker push procedure, etc. The other Make targets
# ('make interactive', 'make test', etc.) are defined in this file.
#
include .make/Makefile.mk
#
# IMAGE_TO_TEST defines the tag of the Docker image to test
#
IMAGE_TO_TEST = $(DOCKER_REGISTRY_HOST)/$(DOCKER_REGISTRY_USER)/$(PROJECT):latest
#
# CACHE_VOLUME is the name of the Docker volume used to cache eggs and wheels
# used during the test procedure. The volume is not used during the build
# procedure
#
CACHE_VOLUME = $(PROJECT)-test-cache
# optional docker run-time arguments
DOCKER_RUN_ARGS =
#
# Never use the network=host mode when running CI jobs, and add extra
# distinguishing identifiers to the network name and container names to
# prevent collisions with jobs from the same project running at the same
# time.
#
ifneq ($(CI_JOB_ID),)
NETWORK_MODE := tangonet-$(CI_JOB_ID)
CONTAINER_NAME_PREFIX := $(PROJECT)-$(CI_JOB_ID)-
else
CONTAINER_NAME_PREFIX := $(PROJECT)-
endif
COMPOSE_FILES := $(wildcard *.yml)
COMPOSE_FILE_ARGS := $(foreach yml,$(COMPOSE_FILES),-f $(yml))
ifeq ($(OS),Windows_NT)
$(error Sorry, Windows is not supported yet)
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
DISPLAY ?= :0.0
NETWORK_MODE ?= host
XAUTHORITY_MOUNT := /tmp/.X11-unix:/tmp/.X11-unix
XAUTHORITY ?= /hosthome/.Xauthority
# /bin/sh (=dash) does not evaluate 'docker network' conditionals correctly
SHELL := /bin/bash
endif
ifeq ($(UNAME_S),Darwin)
IF_INTERFACE := $(shell netstat -nr | awk '{ if ($$1 ~/default/) { print $$6} }')
DISPLAY := $(shell ifconfig $(IF_INTERFACE) | awk '{ if ($$1 ~/inet$$/) { print $$2} }'):0
# network_mode = host doesn't work on MacOS, so fix to the internal network
NETWORK_MODE := tangonet
XAUTHORITY_MOUNT := $(HOME):/hosthome:ro
XAUTHORITY := /hosthome/.Xauthority
endif
endif
#
# When running in network=host mode, point devices at a port on the host
# machine rather than at the container.
#
ifeq ($(NETWORK_MODE),host)
TANGO_HOST := $(shell hostname):10000
MYSQL_HOST := $(shell hostname):3306
else
# distinguish the bridge network from others by adding the project name
NETWORK_MODE := $(NETWORK_MODE)-$(PROJECT)
TANGO_HOST := $(CONTAINER_NAME_PREFIX)databaseds:10000
MYSQL_HOST := $(CONTAINER_NAME_PREFIX)tangodb:3306
endif
DOCKER_COMPOSE_ARGS := DISPLAY=$(DISPLAY) XAUTHORITY=$(XAUTHORITY) TANGO_HOST=$(TANGO_HOST) \
NETWORK_MODE=$(NETWORK_MODE) XAUTHORITY_MOUNT=$(XAUTHORITY_MOUNT) MYSQL_HOST=$(MYSQL_HOST) \
DOCKER_REGISTRY_HOST=$(DOCKER_REGISTRY_HOST) DOCKER_REGISTRY_USER=$(DOCKER_REGISTRY_USER) \
CONTAINER_NAME_PREFIX=$(CONTAINER_NAME_PREFIX) COMPOSE_IGNORE_ORPHANS=true
#
# Defines a default make target so that help is printed if make is called
# without a target
#
.DEFAULT_GOAL := help
#
# defines a function to copy the ./test-harness directory into the container
# and then runs the requested make target in the container. The container is:
#
# 1. attached to the network of the docker-compose test system
# 2. uses a persistent volume to cache Python eggs and wheels so that fewer
# downloads are required
# 3. uses a transient volume as a working directory, in which untarred files
# and test output can be written in the container and subsequently copied
# to the host
#
make = tar -c test-harness/ | \
docker run -i --rm --network=$(NETWORK_MODE) \
-e TANGO_HOST=$(TANGO_HOST) \
-v $(CACHE_VOLUME):/home/tango/.cache \
--volumes-from=$(CONTAINER_NAME_PREFIX)rsyslog-csplmc:rw \
-v /build -w /build -u tango $(DOCKER_RUN_ARGS) $(IMAGE_TO_TEST) \
bash -c "sudo chown -R tango:tango /build && \
tar x --strip-components 1 --warning=all && \
make TANGO_HOST=$(TANGO_HOST) $1"
test: DOCKER_RUN_ARGS = --volumes-from=$(BUILD)
test: build up ## test the application
@echo "BUILD: $(BUILD)"
$(INIT_CACHE)
$(call make,test); \
status=$$?; \
rm -fr build; \
#docker-compose $(COMPOSE_FILE_ARGS) logs;
docker cp $(BUILD):/build .; \
docker rm -f -v $(BUILD); \
$(MAKE) down; \
exit $$status
lint: DOCKER_RUN_ARGS = --volumes-from=$(BUILD)
lint: build up ## lint the application (static code analysis)
$(INIT_CACHE)
$(call make,lint); \
status=$$?; \
docker cp $(BUILD):/build .; \
$(MAKE) down; \
exit $$status
pull: ## download the application image
docker pull $(IMAGE_TO_TEST)
up: build ## start develop/test environment
ifneq ($(NETWORK_MODE),host)
docker network inspect $(NETWORK_MODE) &> /dev/null || ([ $$? -ne 0 ] && docker network create $(NETWORK_MODE))
endif
#$(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) pull
#to pull only the mid-cbf-mcs image remove comment on row below.
#docker pull $(DOCKER_REGISTRY_HOST)/$(DOCKER_REGISTRY_USER)/mid-cbf-mcs:latest
$(DOCKER_COMPOSE_ARGS) docker-compose -f csp-tangodb.yml up -d
# put a sleep to wait TANGO DB
@sleep 10
$(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) up
piplock: build ## overwrite Pipfile.lock with the image version
docker run $(IMAGE_TO_TEST) cat /app/Pipfile.lock > $(CURDIR)/Pipfile.lock
interactive: up
interactive: ## start an interactive session using the project image (caution: R/W mounts source directory to /app)
docker run --rm -it -p 3000:3000 --name=$(CONTAINER_NAME_PREFIX)dev -e TANGO_HOST=$(TANGO_HOST) --network=$(NETWORK_MODE) \
-v $(CURDIR):/app $(IMAGE_TO_TEST) /bin/bash
down: ## stop develop/test environment and any interactive session
docker ps | grep $(CONTAINER_NAME_PREFIX)dev && docker stop $(PROJECT)-dev || true
$(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) down
ifneq ($(NETWORK_MODE),host)
docker network inspect $(NETWORK_MODE) &> /dev/null && ([ $$? -eq 0 ] && docker network rm $(NETWORK_MODE)) || true
endif
dsconfigdump: up ## dump the entire configuration to the file dsconfig.json
docker exec -it $(CONTAINER_NAME_PREFIX)dsconfigdump python -m dsconfig.dump
docker exec -it $(CONTAINER_NAME_PREFIX)dsconfigdump python -m dsconfig.dump > dsconfig.json
dsconfigadd: up ## Add a configuration json file (environment variable DSCONFIG_JSON_FILE) to the database
-docker exec -it $(CONTAINER_NAME_PREFIX)dsconfigdump json2tango -u -w -a $(DSCONFIG_JSON_FILE)
dsconfigcheck: up ## check a json file (environment variable DSCONFIG_JSON_FILE) according to the project lib-maxiv-dsconfig json schema
-docker exec -it $(CONTAINER_NAME_PREFIX)dsconfigdump json2tango -a $(DSCONFIG_JSON_FILE)
help: ## show this help.
@grep -hE '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: all test up down help
# Creates Docker volume for use as a cache, if it doesn't exist already
INIT_CACHE = \
docker volume ls | grep $(CACHE_VOLUME) || \
docker create --name $(CACHE_VOLUME) -v $(CACHE_VOLUME):/cache $(IMAGE_TO_TEST)
# http://cakoose.com/wiki/gnu_make_thunks
BUILD_GEN = $(shell docker create -v /build $(IMAGE_TO_TEST))
BUILD = $(eval BUILD := $(BUILD_GEN))$(BUILD)
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/csp_lmc_mid/docker/csp-lmc.yml 0000664 0000000 0000000 00000011160 13707315520 0027577 0 ustar 00root root 0000000 0000000 #
# Docker compose file for TANGO database and database device server
#
# Defines:
# - tangodb: MariaDB database with TANGO schema
# - databaseds: TANGO database device server
# - rsyslog-csplmc: rsyslog service for logger
# - cspmaster: CspMaster device
#
# Requires:
# - None
#
version: '2.2'
services:
csp_dsconfig:
image: nexus.engageska-portugal.pt/ska-docker/tango-dsconfig:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}csp_dsconfig
depends_on:
- databaseds
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
json2tango -w -a -u csplmc/config/csplmc_dsconfig.json && sleep infinity"
volumes:
- .:/csplmc
cspsubarray01:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/csp-lmc-common:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}cspsubarray01
depends_on:
- csp_dsconfig
- cspmaster
- rsyslog-csplmc
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=30 --strict --
retry --max=5 -- tango_admin --ping-device common/elt/master &&\
/venv/bin/python /app/csp_lmc_common/CspSubarray.py comsub1"
volumes_from:
- rsyslog-csplmc:rw
cspsubarray02:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/csp-lmc-common:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}cspsubarray02
depends_on:
- csp_dsconfig
- cspmaster
- rsyslog-csplmc
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=30 --strict --
retry --max=5 -- tango_admin --ping-device common/elt/master &&\
/venv/bin/python /app/csp_lmc_common/CspSubarray.py comsub2"
volumes_from:
- rsyslog-csplmc:rw
cspmaster:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/csp-lmc-common:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}cspmaster
depends_on:
- csp_dsconfig
- cbfmaster
- rsyslog-csplmc
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=30 --strict --
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/sub_elt/master &&\
/venv/bin/python -m csp_lmc_common.CspMaster commaster"
volumes_from:
- rsyslog-csplmc:rw
searchbeam:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/csp-lmc-common:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}searchbeam
depends_on:
- csp_dsconfig
- rsyslog-csplmc
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=30 --strict --
/venv/bin/python -m csp_lmc_common.CspCapabilityMonitor searchbeams"
volumes_from:
- rsyslog-csplmc:rw
timingbeam:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/csp-lmc-common:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}timingbeam
depends_on:
- csp_dsconfig
- rsyslog-csplmc
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=30 --strict --
/venv/bin/python -m csp_lmc_common.CspCapabilityMonitor timingbeams"
volumes_from:
- rsyslog-csplmc:rw
vlbibeam:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/csp-lmc-common:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}vlbibeam
depends_on:
- csp_dsconfig
- rsyslog-csplmc
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=30 --strict --
/venv/bin/python -m csp_lmc_common.CspCapabilityMonitor vlbibeams"
volumes_from:
- rsyslog-csplmc:rw
pssmaster:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/csp-lmc-common:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}pssmaster
depends_on:
- csp_dsconfig
- rsyslog-csplmc
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=30 --strict --
/venv/bin/python /app/simulators/DeviceTestMaster/PssMasterSimulator.py pss"
volumes_from:
- rsyslog-csplmc:rw
rsyslog-csplmc:
image: jumanjiman/rsyslog
container_name: ${CONTAINER_NAME_PREFIX}rsyslog-csplmc
network_mode: ${NETWORK_MODE}
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/csp_lmc_mid/docker/csp-tangodb.yml 0000664 0000000 0000000 00000002240 13707315520 0030441 0 ustar 00root root 0000000 0000000 #
# Docker compose file for TANGO database and database device server
#
# Defines:
# - tangodb: MariaDB database with TANGO schema
# - databaseds: TANGO database device server
#
# Requires:
# - None
#
version: '2.2'
volumes:
tangodb: {}
services:
tangodb:
image: nexus.engageska-portugal.pt/ska-docker/tango-db:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}tangodb
environment:
- MYSQL_ROOT_PASSWORD=secret
- MYSQL_DATABASE=tango
- MYSQL_USER=tango
- MYSQL_PASSWORD=tango
volumes:
- tangodb:/var/lib/mysql
databaseds:
image: nexus.engageska-portugal.pt/ska-docker/tango-cpp:latest
depends_on:
- tangodb
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}databaseds
environment:
- MYSQL_HOST=${MYSQL_HOST}
- MYSQL_DATABASE=tango
- MYSQL_USER=tango
- MYSQL_PASSWORD=tango
- TANGO_HOST=${TANGO_HOST}
entrypoint:
- /usr/local/bin/wait-for-it.sh
- ${MYSQL_HOST}
- --timeout=70
- --strict
- --
- /usr/local/bin/DataBaseds
- "2"
- -ORBendPoint
- giop:tcp::10000
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/csp_lmc_mid/docker/mid-cbf-mcs.yml 0000664 0000000 0000000 00000023037 13707315520 0030330 0 ustar 00root root 0000000 0000000 #
# Docker compose file for TANGO database and database device server
#
# Defines:
# - tangodb: MariaDB database with TANGO schema
# - databaseds: TANGO database device server
# - rsyslog-cbf-csplmc: rsyslog-cbf service for logger
# - cspmaster: CspMaster device
#
# Requires:
# - None
#
version: '2.2'
services:
cbf_dsconfig:
image: nexus.engageska-portugal.pt/ska-docker/tango-dsconfig:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}cbf_dsconfig
depends_on:
- databaseds
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
json2tango -w -a -u csplmc/config/midcbf_dsconfig.json && sleep infinity"
volumes:
- .:/csplmc
cbfmaster:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}cbfmaster
depends_on:
- databaseds
- cbf_dsconfig
- vcc001
- vcc002
- vcc003
- vcc004
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/vcc/001 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/vcc/002 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/vcc/003 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/vcc/004 &&\
/venv/bin/python /app/tangods/CbfMaster/CbfMaster/CbfMaster.py master"
volumes_from:
- rsyslog-cbf:rw
cbfsubarray01:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}cbfsubarray01
depends_on:
- cbf_dsconfig
- vcc001
- vcc002
- vcc003
- vcc004
- cbfmaster
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/sub_elt/master &&\
/venv/bin/python /app/tangods/CbfSubarray/CbfSubarrayMulti/CbfSubarrayMulti.py cbfSubarray-01"
volumes_from:
- rsyslog-cbf:rw
cbfsubarray02:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}cbfsubarray02
depends_on:
- cbf_dsconfig
- vcc001
- vcc002
- vcc003
- vcc004
- cbfmaster
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/sub_elt/master &&\
/venv/bin/python /app/tangods/CbfSubarray/CbfSubarrayMulti/CbfSubarrayMulti.py cbfSubarray-02"
volumes_from:
- rsyslog-cbf:rw
vcc001:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}vcc001
depends_on:
- databaseds
- cbf_dsconfig
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/01 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/02 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/03 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/04 &&\
/venv/bin/python /app/tangods/Vcc/VccMulti/VccMulti.py vcc-001"
volumes_from:
- rsyslog-cbf:rw
vcc002:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}vcc002
depends_on:
- databaseds
- cbf_dsconfig
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/01 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/02 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/03 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/04 &&\
/venv/bin/python /app/tangods/Vcc/VccMulti/VccMulti.py vcc-002"
volumes_from:
- rsyslog-cbf:rw
vcc003:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}vcc003
depends_on:
- databaseds
- cbf_dsconfig
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/01 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/02 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/03 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/04 &&\
/venv/bin/python /app/tangods/Vcc/VccMulti/VccMulti.py vcc-003"
volumes_from:
- rsyslog-cbf:rw
vcc004:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}vcc004
depends_on:
- databaseds
- cbf_dsconfig
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/01 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/02 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/03 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/04 &&\
/venv/bin/python /app/tangods/Vcc/VccMulti/VccMulti.py vcc-004"
volumes_from:
- rsyslog-cbf:rw
fsp01:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}fsp01
depends_on:
- databaseds
- cbf_dsconfig
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
/venv/bin/python /app/tangods/Fsp/FspMulti/FspMulti.py fsp-01"
volumes_from:
- rsyslog-cbf:rw
fsp02:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}fsp02
depends_on:
- databaseds
- cbf_dsconfig
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
/venv/bin/python /app/tangods/Fsp/FspMulti/FspMulti.py fsp-02"
volumes_from:
- rsyslog-cbf:rw
fsp03:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}fsp03
depends_on:
- databaseds
- cbf_dsconfig
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
/venv/bin/python /app/tangods/Fsp/FspMulti/FspMulti.py fsp-03"
volumes_from:
- rsyslog-cbf:rw
fsp04:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}fsp04
depends_on:
- databaseds
- cbf_dsconfig
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
/venv/bin/python /app/tangods/Fsp/FspMulti/FspMulti.py fsp-04"
volumes_from:
- rsyslog-cbf:rw
tmcspsubarrayleafnodetest:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}tmcspsubarrayleafnodetest
depends_on:
- cspmaster
- databaseds
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
retry --max=10 -- tango_admin --ping-device mid_csp/elt/subarray_01 &&
/venv/bin/python /app/tangods/TmCspSubarrayLeafNodeTest/TmCspSubarrayLeafNodeTest.py tm"
volumes_from:
- rsyslog-cbf:rw
tmcspsubarrayleafnodetest2:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}tmcspsubarrayleafnodetest2
depends_on:
- cspmaster
- databaseds
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
retry --max=10 -- tango_admin --ping-device mid_csp/elt/subarray_02 &&
/venv/bin/python /app/tangods/TmCspSubarrayLeafNodeTest/TmCspSubarrayLeafNodeTest.py tm2"
volumes_from:
- rsyslog-cbf:rw
rsyslog-cbf:
image: jumanjiman/rsyslog
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}rsyslog-cbf
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/csp_lmc_mid/receptors.py 0000664 0000000 0000000 00000012205 13707315520 0026630 0 ustar 00root root 0000000 0000000 import tango
import logging
import time
from tango import DeviceProxy
LOGGER = logging.getLogger(__name__)
class Receptors:
"""
Class to handle information about the Mid receptors.
"""
def __init__(self, csp_master_fqdn):
self._csp_master_fqdn = csp_master_fqdn
def cbf_master_address(self):
"""
Return the address of the MID CspMaster holding the
information about receptors.
"""
try:
proxy = self.connect(self._csp_master_fqdn)
return proxy.cbfMasterAddress
except tango.DevFailed as tango_err:
tango.Except.re_throw_exception(tango_err,
"Connection failed",
"Receptors class",
tango.ErrSeverity.ERR)
def connect(self, fqdn):
"""
Establish the connection with the specified
TANGO device
"""
try:
proxy = DeviceProxy(fqdn)
proxy.ping()
return proxy
except tango.DevFailed as tango_ex:
LOGGER.error(tango_ex.args[0].desc)
tango.Except.re_throw_exception(tango_ex,
"Connection failed",
"Receptors class",
tango.ErrSeverity.ERR)
def receptor_vcc_map(self):
"""
Return the dictionary with the map of VCC ids and
receptors ids.
"""
receptor_to_vcc_map= {}
try:
cbf_master_addr = self.cbf_master_address()
proxy = self.connect(cbf_master_addr)
receptor_to_vcc = proxy.receptorToVcc
receptor_to_vcc_map = dict([int(ID) for ID in pair.split(":")]
for pair in receptor_to_vcc)
return receptor_to_vcc_map
except tango.DevFailed as tango_ex:
LOGGER.error(tango_ex.args[0].desc)
tango.Except.re_throw_exception(tango_ex,
"Connection failed",
"Receptors class",
tango.ErrSeverity.ERR)
def list_of_ids(self):
"""
Return the list of the receptor ids deployed by the
system.
"""
try:
value = self.receptor_vcc_map()
return list(value.keys())
except tango.DevFailed as tango_ex:
self.logging.error(tango_ex.args[0].desc)
tango.Except.re_throw_exception(tango_ex,
"Connection failed",
"Receptors class",
tango.ErrSeverity.ERR)
def unassigned_ids(self):
"""
Return the list of the receptor ids not assigned to any
subarray.
"""
value = []
try:
proxy = self.connect(self._csp_master_fqdn)
value = proxy.unassignedReceptorIDs
return value
except tango.DevFailed as tango_ex:
LOGGER.error(tango_ex.args[0].desc)
tango.Except.re_throw_exception(tango_ex,
"Connection failed",
"Receptors class",
tango.ErrSeverity.ERR)
def subarray_affiliation(self):
"""
Return the list with the subarray affilition for each
receptor.
"""
value = []
try:
proxy = self.connect(self._csp_master_fqdn)
value = proxy.receptorMembership
LOGGER.debug("receptorMembership:{}".format(value))
return value
except tango.DevFailed as tango_ex:
LOGGER.error(tango_ex.args[0].desc)
tango.Except.re_throw_exception(tango_ex,
"Connection failed",
"Receptors class",
tango.ErrSeverity.ERR)
def assigned_to_subarray(self, _sub_id):
"""
Return the list of the assigned receptors to the subarray.
"""
assigned_receptors = []
sub_id = int(_sub_id)
try:
proxy = self.connect(self._csp_master_fqdn)
subarray_addrs = proxy.cspSubarrayAddresses
#receptor_membership = self.subarray_affiliation()
#assigned_receptors = [receptor_id + 1 for receptor_id, e in enumerate(receptor_membership) if e == int(sub_id)]
proxy = self.connect(subarray_addrs[sub_id - 1])
assigned_receptors = proxy.assignedReceptors
LOGGER.debug(assigned_receptors)
return assigned_receptors
except tango.DevFailed as tango_ex:
LOGGER.error(tango_ex.args[0].desc)
tango.Except.re_throw_exception(tango_ex,
"Connection failed",
"Receptors class",
tango.ErrSeverity.ERR)
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/csp_lmc_mid/release.py 0000775 0000000 0000000 00000001005 13707315520 0026241 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
#
# This file is part of the CentralNode project
#
#
#
# Distributed under the terms of the BSD-3-Clause license.
# See LICENSE.txt for more info.
"""Release information for Python Package"""
name = """mid-csp-lmc"""
version = "0.6.4"
version_info = version.split(".")
description = """SKA MID CSP.LMC"""
author = "INAF-OAA"
author_email = "elisabetta.giani@inaf.it"
license = """BSD-3-Clause"""
url = """https://gitlab.com/ska-telescope/csp-lmc.git"""
copyright = """INAF, SKA Telescope"""
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/docker/ 0000775 0000000 0000000 00000000000 13707315520 0023246 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/docker/.make/ 0000775 0000000 0000000 00000000000 13707315520 0024241 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/docker/.make/.make-release-support 0000664 0000000 0000000 00000005534 13707315520 0030316 0 ustar 00root root 0000000 0000000 #!/bin/bash
#
# Copyright 2015 Xebia Nederland B.V.
# Modifications copyright 2019 SKA Organisation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
function hasChanges() {
test -n "$(git status -s .)"
}
function getRelease() {
awk -F= '/^release=/{print $2}' .release
}
function getBaseTag() {
sed -n -e "s/^tag=\(.*\)$(getRelease)\$/\1/p" .release
}
function getTag() {
if [ -z "$1" ] ; then
awk -F= '/^tag/{print $2}' .release
else
echo "$(getBaseTag)$1"
fi
}
function setRelease() {
if [ -n "$1" ] ; then
sed -i.x -e "s/^tag=.*/tag=$(getTag $1)/" .release
sed -i.x -e "s/^release=.*/release=$1/g" .release
rm -f .release.x
runPreTagCommand "$1"
else
echo "ERROR: missing release version parameter " >&2
return 1
fi
}
function runPreTagCommand() {
if [ -n "$1" ] ; then
COMMAND=$(sed -n -e "s/@@RELEASE@@/$1/g" -e 's/^pre_tag_command=\(.*\)/\1/p' .release)
if [ -n "$COMMAND" ] ; then
if ! OUTPUT=$(bash -c "$COMMAND" 2>&1) ; then echo $OUTPUT >&2 && exit 1 ; fi
fi
else
echo "ERROR: missing release version parameter " >&2
return 1
fi
}
function tagExists() {
tag=${1:-$(getTag)}
test -n "$tag" && test -n "$(git tag | grep "^$tag\$")"
}
function differsFromRelease() {
tag=$(getTag)
! tagExists $tag || test -n "$(git diff --shortstat -r $tag .)"
}
function getVersion() {
result=$(getRelease)
if differsFromRelease; then
result="$result-$(git log -n 1 --format=%h .)"
fi
if hasChanges ; then
result="$result-dirty"
fi
echo $result
}
function nextPatchLevel() {
version=${1:-$(getRelease)}
major_and_minor=$(echo $version | cut -d. -f1,2)
patch=$(echo $version | cut -d. -f3)
version=$(printf "%s.%d" $major_and_minor $(($patch + 1)))
echo $version
}
function nextMinorLevel() {
version=${1:-$(getRelease)}
major=$(echo $version | cut -d. -f1);
minor=$(echo $version | cut -d. -f2);
version=$(printf "%d.%d.0" $major $(($minor + 1))) ;
echo $version
}
function nextMajorLevel() {
version=${1:-$(getRelease)}
major=$(echo $version | cut -d. -f1);
version=$(printf "%d.0.0" $(($major + 1)))
echo $version
}
function getProjectGitTag() {
proj_name=$(git config --local remote.origin.url|sed -n 's#.*/\([^.]*\)\.git#\1#p')
if [ -n "$(git tag)" ]; then
tag_version=$(git tag | sed -e "s/^$proj_name-//")
echo $tag_version
else
tag_version=$(getVersion)
echo $tag_version
fi
}
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/docker/.make/.make-release-support.katversion0000664 0000000 0000000 00000005067 13707315520 0032503 0 ustar 00root root 0000000 0000000 #!/bin/bash
#
# Copyright 2015 Xebia Nederland B.V.
# Modifications copyright 2019 SKA Organisation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
function hasChanges() {
test -n "$(git status -s .)"
}
function getRelease() {
awk -F= '/^release=/{print $2}' .release
}
function getBaseTag() {
sed -n -e "s/^tag=\(.*\)$(getRelease)\$/\1/p" .release
}
function getTag() {
if [ -z "$1" ] ; then
awk -F= '/^tag/{print $2}' .release
else
echo "$(getBaseTag)$1"
fi
}
function setRelease() {
if [ -n "$1" ] ; then
sed -i.x -e "s/^tag=.*/tag=$(getTag $1)/" .release
sed -i.x -e "s/^release=.*/release=$1/g" .release
rm -f .release.x
runPreTagCommand "$1"
else
echo "ERROR: missing release version parameter " >&2
return 1
fi
}
function runPreTagCommand() {
if [ -n "$1" ] ; then
COMMAND=$(sed -n -e "s/@@RELEASE@@/$1/g" -e 's/^pre_tag_command=\(.*\)/\1/p' .release)
if [ -n "$COMMAND" ] ; then
if ! OUTPUT=$(bash -c "$COMMAND" 2>&1) ; then echo $OUTPUT >&2 && exit 1 ; fi
fi
else
echo "ERROR: missing release version parameter " >&2
return 1
fi
}
function tagExists() {
tag=${1:-$(getTag)}
test -n "$tag" && test -n "$(git tag | grep "^$tag\$")"
}
function differsFromRelease() {
tag=$(getTag)
! tagExists $tag || test -n "$(git diff --shortstat -r $tag .)"
}
function getVersion() {
result=$(getRelease)
if differsFromRelease; then
result="$result-$(git log -n 1 --format=%h .)"
fi
if hasChanges ; then
result="$result-dirty"
fi
echo $result
}
function nextPatchLevel() {
version=${1:-$(getRelease)}
major_and_minor=$(echo $version | cut -d. -f1,2)
patch=$(echo $version | cut -d. -f3)
version=$(printf "%s.%d" $major_and_minor $(($patch + 1)))
echo $version
}
function nextMinorLevel() {
version=${1:-$(getRelease)}
major=$(echo $version | cut -d. -f1);
minor=$(echo $version | cut -d. -f2);
version=$(printf "%d.%d.0" $major $(($minor + 1))) ;
echo $version
}
function nextMajorLevel() {
version=${1:-$(getRelease)}
major=$(echo $version | cut -d. -f1);
version=$(printf "%d.0.0" $(($major + 1)))
echo $version
}
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/docker/.make/Makefile.mk 0000664 0000000 0000000 00000011246 13707315520 0026313 0 ustar 00root root 0000000 0000000 #
# Copyright 2015 Xebia Nederland B.V.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
ifeq ($(strip $(PROJECT)),)
NAME=$(shell basename $(CURDIR))
else
NAME=$(PROJECT)
endif
RELEASE_SUPPORT := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST))))/.make-release-support
ifeq ($(strip $(DOCKER_REGISTRY_HOST)),)
DOCKER_REGISTRY_HOST = nexus.engageska-portugal.pt
endif
ifeq ($(strip $(DOCKER_REGISTRY_USER)),)
DOCKER_REGISTRY_USER = ska-docker
endif
IMAGE=$(DOCKER_REGISTRY_HOST)/$(DOCKER_REGISTRY_USER)/$(NAME)
#VERSION = release version + git sha
VERSION=$(shell . $(RELEASE_SUPPORT) ; getVersion)
#BASE_VERSION
BASE_VERSION=$(shell . $(RELEASE_SUPPORT) ; getRelease)
#TAG = project name + git tag version
GIT_TAG=$(shell . $(RELEASE_SUPPORT); getProjectGitTag)
#DEFAULT_TAG = image name + BASE_VERSION
DEFAULT_TAG=$(IMAGE):$(GIT_TAG)
SHELL=/bin/bash
DOCKER_BUILD_CONTEXT=..
DOCKER_FILE_PATH=Dockerfile
.PHONY: pre-build docker-build post-build build release patch-release minor-release major-release tag check-status check-release showver \
push pre-push do-push post-push
build: pre-build docker-build post-build ## build the application image
pre-build:
post-build:
pre-push:
post-push:
docker-build: .release
@echo "VERSION: $(VERSION)"
@echo "Building image: $(IMAGE):$(VERSION)"
@echo "NAME: $(NAME)"
docker build $(DOCKER_BUILD_ARGS) -t $(IMAGE):$(VERSION) $(DOCKER_BUILD_CONTEXT) -f $(DOCKER_FILE_PATH) --build-arg DOCKER_REGISTRY_HOST=$(DOCKER_REGISTRY_HOST) --build-arg DOCKER_REGISTRY_USER=$(DOCKER_REGISTRY_USER)
@DOCKER_MAJOR=$(shell docker -v | sed -e 's/.*version //' -e 's/,.*//' | cut -d\. -f1) ; \
DOCKER_MINOR=$(shell docker -v | sed -e 's/.*version //' -e 's/,.*//' | cut -d\. -f2) ; \
if [ $$DOCKER_MAJOR -eq 1 ] && [ $$DOCKER_MINOR -lt 10 ] ; then \
echo docker tag -f $(IMAGE):$(VERSION) $(IMAGE):latest ;\
docker tag -f $(IMAGE):$(VERSION) $(IMAGE):latest ;\
else \
echo docker tag $(IMAGE):$(VERSION) $(IMAGE):latest ;\
docker tag $(IMAGE):$(VERSION) $(IMAGE):latest ; \
fi
release: check-status check-release build push
push: pre-push do-push post-push ## push the image to the Docker registry
do-push: ## Push the image tagged as $(IMAGE):$(VERSION) and $(DEFAULT_TAG)
@echo -e "Tagging: $(IMAGE):$(VERSION) -> $(DEFAULT_TAG)"
docker tag $(IMAGE):$(VERSION) $(DEFAULT_TAG)
@echo -e "Pushing: $(IMAGE):$(VERSION)"
docker push $(IMAGE):$(VERSION)
@echo -e "Pushing: $(DEFAULT_TAG)"
docker push $(DEFAULT_TAG)
tag_latest: do-push ## Tag the images as latest
@echo "Tagging: $(DEFAULT_TAG) -> $(IMAGE):latest"
@docker tag $(DEFAULT_TAG) $(IMAGE):latest
push_latest: tag_latest ## Push the image tagged as :latest
@echo "Pushing: $(IMAGE):latest"
@docker push $(IMAGE):latest
snapshot: build push
showver: .release
@. $(RELEASE_SUPPORT); getVersion
bump-patch-release: VERSION := $(shell . $(RELEASE_SUPPORT); nextPatchLevel)
bump-patch-release: .release tag
bump-minor-release: VERSION := $(shell . $(RELEASE_SUPPORT); nextMinorLevel)
bump-minor-release: .release tag
bump-major-release: VERSION := $(shell . $(RELEASE_SUPPORT); nextMajorLevel)
bump-major-release: .release tag
patch-release: tag-patch-release release
@echo $(VERSION)
minor-release: tag-minor-release release
@echo $(VERSION)
major-release: tag-major-release release
@echo $(VERSION)
tag: TAG=$(shell . $(RELEASE_SUPPORT); getTag $(VERSION))
tag: check-status
# @. $(RELEASE_SUPPORT) ; ! tagExists $(TAG) || (echo "ERROR: tag $(TAG) for version $(VERSION) already tagged in git" >&2 && exit 1) ;
@. $(RELEASE_SUPPORT) ; setRelease $(VERSION)
# git add .
# git commit -m "bumped to version $(VERSION)" ;
# git tag $(TAG) ;
# @ if [ -n "$(shell git remote -v)" ] ; then git push --tags ; else echo 'no remote to push tags to' ; fi
check-status:
@. $(RELEASE_SUPPORT) ; ! hasChanges || (echo "ERROR: there are still outstanding changes" >&2 && exit 1) ;
check-release: .release
@. $(RELEASE_SUPPORT) ; tagExists $(TAG) || (echo "ERROR: version not yet tagged in git. make [minor,major,patch]-release." >&2 && exit 1) ;
@. $(RELEASE_SUPPORT) ; ! differsFromRelease $(TAG) || (echo "ERROR: current directory differs from tagged $(TAG). make [minor,major,patch]-release." ; exit 1)
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/docker/.release 0000664 0000000 0000000 00000001010 13707315520 0024657 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
#
# This file is part of the CSP.LMC prototype project
#
#
# Distributed under the terms of the BSD-3-Clause license.
# See LICENSE.txt for more info.
"""Release information for Python Package"""
name = """MID CSP.LMC"""
version = "0.6.4"
version_info = version.split(".")
description = """SKA MID CSP.LMC Classes"""
author = "E.G"
author_email = "elisabetta.giani@inaf.it"
license = """BSD-3-Clause"""
url = """www.tango-controls.org"""
copyright = """"""
release=0.6.4
tag=mid-csp-lmc-0.6.4
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/docker/Dockerfile 0000664 0000000 0000000 00000000736 13707315520 0025246 0 ustar 00root root 0000000 0000000 FROM nexus.engageska-portugal.pt/ska-docker/ska-python-buildenv:9.3.2 AS buildenv
FROM nexus.engageska-portugal.pt/ska-docker/ska-python-runtime:9.3.2 AS runtime
# create ipython profile to so that itango doesn't fail if ipython hasn't run yet
RUN ipython profile create
ENV PATH=/home/tango/.local/bin:$PATH
RUN python3 -m pip install . --extra-index-url https://nexus.engageska-portugal.pt/repository/pypi/simple
CMD ["/venv/bin/python","/app/csp_lmc_mid/MidCspMaster.py"]
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/docker/Makefile 0000664 0000000 0000000 00000016757 13707315520 0024726 0 ustar 00root root 0000000 0000000 #
# Project makefile for a Tango project. You should normally only need to modify
# DOCKER_REGISTRY_USER and PROJECT below.
#
#
# DOCKER_REGISTRY_HOST, DOCKER_REGISTRY_USER and PROJECT are combined to define
# the Docker tag for this project. The definition below inherits the standard
# value for DOCKER_REGISTRY_HOST (=rnexus.engageska-portugal.pt) and overwrites
# DOCKER_REGISTRY_USER and PROJECT to give a final Docker tag of
# nexus.engageska-portugal.pt/tango-example/csplmc
#
DOCKER_REGISTRY_USER:=ska-docker
PROJECT = mid-csp-lmc
#
# include makefile to pick up the standard Make targets, e.g., 'make build'
# build, 'make push' docker push procedure, etc. The other Make targets
# ('make interactive', 'make test', etc.) are defined in this file.
#
include .make/Makefile.mk
#
# IMAGE_TO_TEST defines the tag of the Docker image to test
#
IMAGE_TO_TEST = $(DOCKER_REGISTRY_HOST)/$(DOCKER_REGISTRY_USER)/$(PROJECT):latest
#
# CACHE_VOLUME is the name of the Docker volume used to cache eggs and wheels
# used during the test procedure. The volume is not used during the build
# procedure
#
CACHE_VOLUME = $(PROJECT)-test-cache
# optional docker run-time arguments
DOCKER_RUN_ARGS =
#
# Never use the network=host mode when running CI jobs, and add extra
# distinguishing identifiers to the network name and container names to
# prevent collisions with jobs from the same project running at the same
# time.
#
ifneq ($(CI_JOB_ID),)
NETWORK_MODE := tangonet-$(CI_JOB_ID)
CONTAINER_NAME_PREFIX := $(PROJECT)-$(CI_JOB_ID)-
else
CONTAINER_NAME_PREFIX := $(PROJECT)-
endif
COMPOSE_FILES := $(wildcard *.yml)
COMPOSE_FILE_ARGS := $(foreach yml,$(COMPOSE_FILES),-f $(yml))
ifeq ($(OS),Windows_NT)
$(error Sorry, Windows is not supported yet)
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
DISPLAY ?= :0.0
NETWORK_MODE ?= host
XAUTHORITY_MOUNT := /tmp/.X11-unix:/tmp/.X11-unix
XAUTHORITY ?= /hosthome/.Xauthority
# /bin/sh (=dash) does not evaluate 'docker network' conditionals correctly
SHELL := /bin/bash
endif
ifeq ($(UNAME_S),Darwin)
IF_INTERFACE := $(shell netstat -nr | awk '{ if ($$1 ~/default/) { print $$6} }')
DISPLAY := $(shell ifconfig $(IF_INTERFACE) | awk '{ if ($$1 ~/inet$$/) { print $$2} }'):0
# network_mode = host doesn't work on MacOS, so fix to the internal network
NETWORK_MODE := tangonet
XAUTHORITY_MOUNT := $(HOME):/hosthome:ro
XAUTHORITY := /hosthome/.Xauthority
endif
endif
#
# When running in network=host mode, point devices at a port on the host
# machine rather than at the container.
#
ifeq ($(NETWORK_MODE),host)
TANGO_HOST := $(shell hostname):10000
MYSQL_HOST := $(shell hostname):3306
else
# distinguish the bridge network from others by adding the project name
NETWORK_MODE := $(NETWORK_MODE)-$(PROJECT)
TANGO_HOST := $(CONTAINER_NAME_PREFIX)databaseds:10000
MYSQL_HOST := $(CONTAINER_NAME_PREFIX)tangodb:3306
endif
DOCKER_COMPOSE_ARGS := DISPLAY=$(DISPLAY) XAUTHORITY=$(XAUTHORITY) TANGO_HOST=$(TANGO_HOST) \
NETWORK_MODE=$(NETWORK_MODE) XAUTHORITY_MOUNT=$(XAUTHORITY_MOUNT) MYSQL_HOST=$(MYSQL_HOST) \
DOCKER_REGISTRY_HOST=$(DOCKER_REGISTRY_HOST) DOCKER_REGISTRY_USER=$(DOCKER_REGISTRY_USER) \
CONTAINER_NAME_PREFIX=$(CONTAINER_NAME_PREFIX) COMPOSE_IGNORE_ORPHANS=true
#
# Defines a default make target so that help is printed if make is called
# without a target
#
.DEFAULT_GOAL := help
#
# defines a function to copy the ./test-harness directory into the container
# and then runs the requested make target in the container. The container is:
#
# 1. attached to the network of the docker-compose test system
# 2. uses a persistent volume to cache Python eggs and wheels so that fewer
# downloads are required
# 3. uses a transient volume as a working directory, in which untarred files
# and test output can be written in the container and subsequently copied
# to the host
#
make = tar -c test-harness/ | \
docker run -i --rm --network=$(NETWORK_MODE) \
-e TANGO_HOST=$(TANGO_HOST) \
-v $(CACHE_VOLUME):/home/tango/.cache \
--volumes-from=$(CONTAINER_NAME_PREFIX)rsyslog-csplmc:rw \
-v /build -w /build -u tango $(DOCKER_RUN_ARGS) $(IMAGE_TO_TEST) \
bash -c "sudo chown -R tango:tango /build && \
tar x --strip-components 1 --warning=all && \
make TANGO_HOST=$(TANGO_HOST) $1"
test: DOCKER_RUN_ARGS = --volumes-from=$(BUILD)
test: build up ## test the application
@echo "BUILD: $(BUILD)"
$(INIT_CACHE)
$(call make,test); \
status=$$?; \
rm -fr build; \
#docker-compose $(COMPOSE_FILE_ARGS) logs;
docker cp $(BUILD):/build .; \
docker rm -f -v $(BUILD); \
$(MAKE) down; \
exit $$status
lint: DOCKER_RUN_ARGS = --volumes-from=$(BUILD)
lint: build up ## lint the application (static code analysis)
$(INIT_CACHE)
$(call make,lint); \
status=$$?; \
docker cp $(BUILD):/build .; \
$(MAKE) down; \
exit $$status
pull: ## download the application image
docker pull $(IMAGE_TO_TEST)
up: build ## start develop/test environment
ifneq ($(NETWORK_MODE),host)
docker network inspect $(NETWORK_MODE) &> /dev/null || ([ $$? -ne 0 ] && docker network create $(NETWORK_MODE))
endif
#$(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) pull
#to pull only the mid-cbf-mcs image remove comment on row below.
#docker pull $(DOCKER_REGISTRY_HOST)/$(DOCKER_REGISTRY_USER)/mid-cbf-mcs:latest
$(DOCKER_COMPOSE_ARGS) docker-compose -f mid-csp-tangodb.yml up -d
# put a sleep to wait TANGO DB
@sleep 5
$(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) up -d
piplock: build ## overwrite Pipfile.lock with the image version
@echo "CURDIR: $(CURDIR)"
docker run $(IMAGE_TO_TEST) cat /app/Pipfile.lock > $(CURDIR)/../Pipfile.lock
interactive: up
interactive: ## start an interactive session using the project image (caution: R/W mounts source directory to /app)
docker run --rm -it -p 3000:3000 --name=$(CONTAINER_NAME_PREFIX)dev -e TANGO_HOST=$(TANGO_HOST) --network=$(NETWORK_MODE) \
-v $(CURDIR)/..:/app $(IMAGE_TO_TEST) /bin/bash
down: ## stop develop/test environment and any interactive session
docker ps | grep $(CONTAINER_NAME_PREFIX)dev && docker stop $(PROJECT)-dev || true
$(DOCKER_COMPOSE_ARGS) docker-compose $(COMPOSE_FILE_ARGS) down
ifneq ($(NETWORK_MODE),host)
docker network inspect $(NETWORK_MODE) &> /dev/null && ([ $$? -eq 0 ] && docker network rm $(NETWORK_MODE)) || true
endif
dsconfigdump: up ## dump the entire configuration to the file dsconfig.json
docker exec -it $(CONTAINER_NAME_PREFIX)dsconfigdump python -m dsconfig.dump
docker exec -it $(CONTAINER_NAME_PREFIX)dsconfigdump python -m dsconfig.dump > dsconfig.json
dsconfigadd: up ## Add a configuration json file (environment variable DSCONFIG_JSON_FILE) to the database
-docker exec -it $(CONTAINER_NAME_PREFIX)dsconfigdump json2tango -u -w -a $(DSCONFIG_JSON_FILE)
dsconfigcheck: up ## check a json file (environment variable DSCONFIG_JSON_FILE) according to the project lib-maxiv-dsconfig json schema
-docker exec -it $(CONTAINER_NAME_PREFIX)dsconfigdump json2tango -a $(DSCONFIG_JSON_FILE)
help: ## show this help.
@grep -hE '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: all test up down help
# Creates Docker volume for use as a cache, if it doesn't exist already
INIT_CACHE = \
docker volume ls | grep $(CACHE_VOLUME) || \
docker create --name $(CACHE_VOLUME) -v $(CACHE_VOLUME):/cache $(IMAGE_TO_TEST)
# http://cakoose.com/wiki/gnu_make_thunks
BUILD_GEN = $(shell docker create -v /build $(IMAGE_TO_TEST))
BUILD = $(eval BUILD := $(BUILD_GEN))$(BUILD)
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/docker/acceptance_test.mk 0000664 0000000 0000000 00000006213 13707315520 0026726 0 ustar 00root root 0000000 0000000 #
# Project makefile for a Tango project. You should normally only need to modify
# DOCKER_REGISTRY_USER and PROJECT below.
#
#
# DOCKER_REGISTRY_HOST, DOCKER_REGISTRY_USER and PROJECT are combined to define
# the Docker tag for this project. The definition below inherits the standard
# value for DOCKER_REGISTRY_HOST (=rnexus.engageska-portugal.pt) and overwrites
# DOCKER_REGISTRY_USER and PROJECT to give a final Docker tag of
# nexus.engageska-portugal.pt/tango-example/csplmc
#
DOCKER_REGISTRY_USER:=ska-docker
PROJECT = mid-csp-lmc
#
# include makefile to pick up the standard Make targets, e.g., 'make build'
# build, 'make push' docker push procedure, etc. The other Make targets
# ('make interactive', 'make test', etc.) are defined in this file.
#
include .make/Makefile.mk
#
# IMAGE_TO_TEST defines the tag of the Docker image to test
#
IMAGE_TO_TEST = $(DOCKER_REGISTRY_HOST)/$(DOCKER_REGISTRY_USER)/$(PROJECT):latest
#IMAGE_TO_TEST ?= nexus.engageska-portugal.pt/ska-docker/tango-vscode:0.2.4
#
# CACHE_VOLUME is the name of the Docker volume used to cache eggs and wheels
# used during the test procedure. The volume is not used during the build
# procedure
#
CACHE_VOLUME = $(PROJECT)-test-cache
# optional docker run-time arguments
DOCKER_RUN_ARGS =
#
# Never use the network=host mode when running CI jobs, and add extra
# distinguishing identifiers to the network name and container names to
# prevent collisions with jobs from the same project running at the same
# time.
#
ifneq ($(CI_JOB_ID),)
NETWORK_MODE := tangonet-$(CI_JOB_ID)
CONTAINER_NAME_PREFIX := $(PROJECT)-$(CI_JOB_ID)-
else
CONTAINER_NAME_PREFIX := $(PROJECT)-
NETWORK_MODE := host
endif
#
# When running in network=host mode, point devices at a port on the host
# machine rather than at the container.
#
ifeq ($(NETWORK_MODE),host)
TANGO_HOST := $(shell hostname):10000
MYSQL_HOST := $(shell hostname):3306
else
# distinguish the bridge network from others by adding the project name
NETWORK_MODE := $(NETWORK_MODE)-$(PROJECT)
TANGO_HOST := $(CONTAINER_NAME_PREFIX)databaseds:10000
MYSQL_HOST := $(CONTAINER_NAME_PREFIX)tangodb:3306
endif
# here we copy the content of the acceptance_tests directory into the
# container running the test and then we run the requested make target
# into the container.
# In particular the directory is copied on itself so that we don't need to
# re-run all the containers if something change in the test source code.
make = tar -c ../tests/acceptance_tests | \
docker run -i --rm --network=$(NETWORK_MODE) \
-e TANGO_HOST=$(TANGO_HOST) \
-v /build -w /build -u tango --name midcsp-tester $(IMAGE_TO_TEST) \
bash -c "sudo chown -R tango:tango /build && tar xv --directory /app/tests --strip-components 1 --warning=all && \
cd /app/tests/acceptance_tests && make TANGO_HOST=$(TANGO_HOST) $1"
test: DOCKER_RUN_ARGS = --volumes-from=$(BUILD)
test: ## test the application
$(call make,test); \
status=$$?; \
rm -fr build; \
docker cp $(BUILD):/build .; \
docker rm -f -v $(BUILD); \
exit $$status
# http://cakoose.com/wiki/gnu_make_thunks
BUILD_GEN = $(shell docker create -v /build $(IMAGE_TO_TEST))
BUILD = $(eval BUILD := $(BUILD_GEN))$(BUILD)
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/docker/config/ 0000775 0000000 0000000 00000000000 13707315520 0024513 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/docker/config/midcbf_dsconfig.json 0000664 0000000 0000000 00000155321 13707315520 0030515 0 ustar 00root root 0000000 0000000 {
"servers": {
"CbfMaster": {
"master": {
"CbfMaster": {
"mid_csp_cbf/sub_elt/master": {
"attribute_properties": {
"adminMode": {
"abs_change": [
"-1",
"1"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
}
},
"properties": {
"CbfSubarray": [
"mid_csp_cbf/sub_elt/subarray_01",
"mid_csp_cbf/sub_elt/subarray_02"
],
"FSP": [
"mid_csp_cbf/fsp/01",
"mid_csp_cbf/fsp/02",
"mid_csp_cbf/fsp/03",
"mid_csp_cbf/fsp/04"
],
"MaxCapabilities": [
"VCC:4",
"FSP:4",
"Subarray:2"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
],
"polled_attr": [
"reportfspstate",
"1000",
"reportvccadminmode",
"1000",
"reportvcchealthstate",
"1000",
"receptortovcc",
"1000",
"reportfspCorrSubarraymembership",
"1000",
"reportfsphealthstate",
"1000",
"healthstate",
"1000",
"adminmode",
"1000",
"subarrayconfigid",
"1000",
"reportfspadminmode",
"1000",
"commandprogress",
"2000",
"reportsubarrayhealthstate",
"1000",
"reportvccstate",
"1000",
"reportsubarrayadminmode",
"1000",
"vcctoreceptor",
"3000",
"reportsubarraystate",
"3000",
"state",
"1000"
]
}
}
}
}
},
"CbfSubarrayMulti": {
"cbfSubarray-01": {
"CbfSubarray": {
"mid_csp_cbf/sub_elt/subarray_01": {
"attribute_properties": {
"adminMode": {
"abs_change": [
"-1",
"1"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"obsState": {
"abs_change": [
"-1",
"1"
]
},
"scanID": {
"abs_change": [
"-1",
"1"
]
}
},
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"FSP": [
"mid_csp_cbf/fsp/01",
"mid_csp_cbf/fsp/02",
"mid_csp_cbf/fsp/03",
"mid_csp_cbf/fsp/04"
],
"FspCorrSubarray": [
"mid_csp_cbf/fspCorrSubarray/01_01",
"mid_csp_cbf/fspCorrSubarray/02_01",
"mid_csp_cbf/fspCorrSubarray/03_01",
"mid_csp_cbf/fspCorrSubarray/04_01"
],
"FspPssSubarray": [
"mid_csp_cbf/fspPssSubarray/01_01",
"mid_csp_cbf/fspPssSubarray/02_01",
"mid_csp_cbf/fspPssSubarray/03_01",
"mid_csp_cbf/fspPssSubarray/04_01"
],
"SW1Address": [
"mid_csp_cbf/sw1/01"
],
"SW2Address": [
"mid_csp_cbf/sw2/01"
],
"PssConfigAddress": [
"mid_csp_cbf/pssconfig/01"
],
"CorrConfigAddress": [
"mid_csp_cbf/corrconfig/01"
],
"SubID": [
"1"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
],
"polled_attr": [
"state",
"1000",
"obsstate",
"1000",
"healthstate",
"1000",
"adminmode",
"1000",
"fsphealthstate",
"1000",
"fspstate",
"1000",
"vccstate",
"1000",
"vcchealthstate",
"1000",
"obsstate",
"1000",
"configid",
"1000",
"fspList",
"1000",
"outputLinksDistribution",
"1000"
]
}
}
},
"SearchWindow": {
"mid_csp_cbf/sw1/01": {},
"mid_csp_cbf/sw2/01": {}
},
"CbfSubarrayPssConfig": {
"mid_csp_cbf/pssConfig/01": {
"properties": {
"FspPssSubarray": [
"mid_csp_cbf/fspPssSubarray/01_01",
"mid_csp_cbf/fspPssSubarray/02_01",
"mid_csp_cbf/fspPssSubarray/03_01",
"mid_csp_cbf/fspPssSubarray/04_01"
],
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
]
}
}
},
"CbfSubarrayCorrConfig": {
"mid_csp_cbf/corrConfig/01": {
"properties": {
"FspCorrSubarray": [
"mid_csp_cbf/fspCorrSubarray/01_01",
"mid_csp_cbf/fspCorrSubarray/02_01",
"mid_csp_cbf/fspCorrSubarray/03_01",
"mid_csp_cbf/fspCorrSubarray/04_01"
],
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
]
}
}
},
"SendConfig": {
"mid_csp_cbf/SendConfig/01": {
"properties": {
"SubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_01"
]
}
}
}
},
"cbfSubarray-02": {
"CbfSubarray": {
"mid_csp_cbf/sub_elt/subarray_02": {
"attribute_properties": {
"adminMode": {
"abs_change": [
"-1",
"1"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"obsState": {
"abs_change": [
"-1",
"1"
]
},
"scanID": {
"abs_change": [
"-1",
"1"
]
}
},
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"FSP": [
"mid_csp_cbf/fsp/01",
"mid_csp_cbf/fsp/02",
"mid_csp_cbf/fsp/03",
"mid_csp_cbf/fsp/04"
],
"FspCorrSubarray": [
"mid_csp_cbf/fspCorrSubarray/01_02",
"mid_csp_cbf/fspCorrSubarray/02_02",
"mid_csp_cbf/fspCorrSubarray/03_02",
"mid_csp_cbf/fspCorrSubarray/04_02"
],
"FspPssSubarray": [
"mid_csp_cbf/fspPssSubarray/01_02",
"mid_csp_cbf/fspPssSubarray/02_02",
"mid_csp_cbf/fspPssSubarray/03_02",
"mid_csp_cbf/fspPssSubarray/04_02"
],
"SW1Address": [
"mid_csp_cbf/sw1/02"
],
"SW2Address": [
"mid_csp_cbf/sw2/02"
],
"PssConfigAddress": [
"mid_csp_cbf/pssconfig/02"
],
"CorrConfigAddress": [
"mid_csp_cbf/corrconfig/01"
],
"SubID": [
"2"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
],
"polled_attr": [
"configid",
"1000",
"healthstate",
"1000",
"state",
"1000",
"obsstate",
"1000",
"vcchealthstate",
"1000",
"adminmode",
"1000",
"fspstate",
"1000",
"fspList",
"1000",
"fsphealthstate",
"1000",
"vccstate",
"1000",
"outputLinksDistribution",
"1000"
]
}
}
},
"SearchWindow": {
"mid_csp_cbf/sw1/02": {},
"mid_csp_cbf/sw2/02": {}
},
"CbfSubarrayPssConfig": {
"mid_csp_cbf/pssConfig/02": {
"properties": {
"FspPssSubarray": [
"mid_csp_cbf/fspPssSubarray/01_02",
"mid_csp_cbf/fspPssSubarray/02_02",
"mid_csp_cbf/fspPssSubarray/03_02",
"mid_csp_cbf/fspPssSubarray/04_02"
],
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
]
}
}
},
"CbfSubarrayCorrConfig": {
"mid_csp_cbf/corrConfig/02": {
"properties": {
"FspCorrSubarray": [
"mid_csp_cbf/fspCorrSubarray/01_02",
"mid_csp_cbf/fspCorrSubarray/02_02",
"mid_csp_cbf/fspCorrSubarray/03_02",
"mid_csp_cbf/fspCorrSubarray/04_02"
],
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
]
}
}
},
"SendConfig": {
"mid_csp_cbf/SendConfig/02": {
"properties": {
"SubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_02"
]
}
}
}
}
},
"DataBaseds": {
"2": {
"DataBase": {
"sys/database/2": {}
}
}
},
"FspMulti": {
"fsp-01": {
"Fsp": {
"mid_csp_cbf/fsp/01": {
"attribute_properties": {
"adminMode": {
"abs_change": [
"-1",
"1"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"subarrayMembership": {
"abs_change": [
"-1",
"1"
]
}
},
"properties": {
"CorrelationAddress": [
"mid_csp_cbf/fsp_corr/01"
],
"FspID": [
"1"
],
"PSSAddress": [
"mid_csp_cbf/fsp_pss/01"
],
"PSTAddress": [
"mid_csp_cbf/fsp_pst/01"
],
"VLBIAddress": [
"mid_csp_cbf/fsp_vlbi/01"
],
"FspCorrSubarray": [
"mid_csp_cbf/fspCorrSubarray/01_01",
"mid_csp_cbf/fspCorrSubarray/01_02"
],
"FspPssSubarray": [
"mid_csp_cbf/fspPssSubarray/01_01",
"mid_csp_cbf/fspPssSubarray/01_02"
],
"polled_attr": [
"adminmode",
"1000",
"healthstate",
"1000",
"state",
"1000",
"subarraymembership",
"1000"
]
}
}
},
"FspCorr": {
"mid_csp_cbf/fsp_corr/01": {}
},
"FspPss": {
"mid_csp_cbf/fsp_pss/01": {}
},
"FspPst": {
"mid_csp_cbf/fsp_pst/01": {}
},
"FspCorrSubarray": {
"mid_csp_cbf/fspCorrSubarray/01_01": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_01"
],
"FspID": [
"1"
],
"SubID": [
"1"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
},
"mid_csp_cbf/fspCorrSubarray/01_02": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_02"
],
"FspID": [
"1"
],
"SubID": [
"2"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
}
},
"FspPssSubarray": {
"mid_csp_cbf/fspPssSubarray/01_01": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_01"
],
"FspID": [
"1"
],
"SubID": [
"1"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
},
"mid_csp_cbf/fspPssSubarray/01_02": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_02"
],
"FspID": [
"1"
],
"SubID": [
"2"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
}
},
"FspVlbi": {
"mid_csp_cbf/fsp_vlbi/01": {}
}
},
"fsp-02": {
"Fsp": {
"mid_csp_cbf/fsp/02": {
"attribute_properties": {
"adminMode": {
"abs_change": [
"-1",
"1"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"subarrayMembership": {
"abs_change": [
"-1",
"1"
]
}
},
"properties": {
"CorrelationAddress": [
"mid_csp_cbf/fsp_corr/02"
],
"FspID": [
"2"
],
"PSSAddress": [
"mid_csp_cbf/fsp_pss/02"
],
"PSTAddress": [
"mid_csp_cbf/fsp_pst/02"
],
"VLBIAddress": [
"mid_csp_cbf/fsp_vlbi/02"
],
"FspCorrSubarray": [
"mid_csp_cbf/fspCorrSubarray/02_01",
"mid_csp_cbf/fspCorrSubarray/02_02"
],
"FspPssSubarray": [
"mid_csp_cbf/fspPssSubarray/02_01",
"mid_csp_cbf/fspPssSubarray/02_02"
],
"polled_attr": [
"adminmode",
"1000",
"healthstate",
"1000",
"state",
"1000",
"subarraymembership",
"1000"
]
}
}
},
"FspCorr": {
"mid_csp_cbf/fsp_corr/02": {}
},
"FspPss": {
"mid_csp_cbf/fsp_pss/02": {}
},
"FspPst": {
"mid_csp_cbf/fsp_pst/02": {}
},
"FspCorrSubarray": {
"mid_csp_cbf/fspCorrSubarray/02_01": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_01"
],
"FspID": [
"2"
],
"SubID": [
"1"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
},
"mid_csp_cbf/fspCorrSubarray/02_02": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_02"
],
"FspID": [
"2"
],
"SubID": [
"2"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
}
},
"FspPssSubarray": {
"mid_csp_cbf/fspPssSubarray/02_01": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_01"
],
"FspID": [
"2"
],
"SubID": [
"1"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
},
"mid_csp_cbf/fspPssSubarray/02_02": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_02"
],
"FspID": [
"2"
],
"SubID": [
"2"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
}
},
"FspVlbi": {
"mid_csp_cbf/fsp_vlbi/02": {}
}
},
"fsp-03": {
"Fsp": {
"mid_csp_cbf/fsp/03": {
"attribute_properties": {
"adminMode": {
"abs_change": [
"-1",
"1"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"subarrayMembership": {
"abs_change": [
"-1",
"1"
]
}
},
"properties": {
"CorrelationAddress": [
"mid_csp_cbf/fsp_corr/03"
],
"FspID": [
"3"
],
"PSSAddress": [
"mid_csp_cbf/fsp_pss/03"
],
"PSTAddress": [
"mid_csp_cbf/fsp_pst/03"
],
"VLBIAddress": [
"mid_csp_cbf/fsp_vlbi/03"
],
"FspCorrSubarray": [
"mid_csp_cbf/fspCorrSubarray/03_01",
"mid_csp_cbf/fspCorrSubarray/03_02"
],
"FspPssSubarray": [
"mid_csp_cbf/fspPssSubarray/03_01",
"mid_csp_cbf/fspPssSubarray/03_02"
],
"polled_attr": [
"adminmode",
"1000",
"healthstate",
"1000",
"state",
"1000",
"subarraymembership",
"1000"
]
}
}
},
"FspCorr": {
"mid_csp_cbf/fsp_corr/03": {}
},
"FspPss": {
"mid_csp_cbf/fsp_pss/03": {}
},
"FspPst": {
"mid_csp_cbf/fsp_pst/03": {}
},
"FspCorrSubarray": {
"mid_csp_cbf/fspCorrSubarray/03_01": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_01"
],
"FspID": [
"3"
],
"SubID": [
"1"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
},
"mid_csp_cbf/fspCorrSubarray/03_02": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_02"
],
"FspID": [
"3"
],
"SubID": [
"2"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
}
},
"FspPssSubarray": {
"mid_csp_cbf/fspPssSubarray/03_01": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_01"
],
"FspID": [
"3"
],
"SubID": [
"1"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
},
"mid_csp_cbf/fspPssSubarray/03_02": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_02"
],
"FspID": [
"3"
],
"SubID": [
"2"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
}
},
"FspVlbi": {
"mid_csp_cbf/fsp_vlbi/03": {}
}
},
"fsp-04": {
"Fsp": {
"mid_csp_cbf/fsp/04": {
"attribute_properties": {
"adminMode": {
"abs_change": [
"-1",
"1"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"subarrayMembership": {
"abs_change": [
"-1",
"1"
]
}
},
"properties": {
"CorrelationAddress": [
"mid_csp_cbf/fsp_corr/04"
],
"FspID": [
"4"
],
"PSSAddress": [
"mid_csp_cbf/fsp_pss/04"
],
"PSTAddress": [
"mid_csp_cbf/fsp_pst/04"
],
"VLBIAddress": [
"mid_csp_cbf/fsp_vlbi/04"
],
"FspCorrSubarray": [
"mid_csp_cbf/fspCorrSubarray/04_01",
"mid_csp_cbf/fspCorrSubarray/04_02"
],
"FspPssSubarray": [
"mid_csp_cbf/fspPssSubarray/04_01",
"mid_csp_cbf/fspPssSubarray/04_02"
],
"polled_attr": [
"adminmode",
"1000",
"healthstate",
"1000",
"state",
"1000",
"subarraymembership",
"1000"
]
}
}
},
"FspCorr": {
"mid_csp_cbf/fsp_corr/04": {}
},
"FspPss": {
"mid_csp_cbf/fsp_pss/04": {}
},
"FspPst": {
"mid_csp_cbf/fsp_pst/04": {}
},
"FspCorrSubarray": {
"mid_csp_cbf/fspCorrSubarray/04_01": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_01"
],
"FspID": [
"4"
],
"SubID": [
"1"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
},
"mid_csp_cbf/fspCorrSubarray/04_02": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_02"
],
"FspID": [
"4"
],
"SubID": [
"2"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
}
},
"FspPssSubarray": {
"mid_csp_cbf/fspPssSubarray/04_01": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_01"
],
"FspID": [
"4"
],
"SubID": [
"1"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
},
"mid_csp_cbf/fspPssSubarray/04_02": {
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_02"
],
"FspID": [
"4"
],
"SubID": [
"2"
],
"VCC": [
"mid_csp_cbf/vcc/001",
"mid_csp_cbf/vcc/002",
"mid_csp_cbf/vcc/003",
"mid_csp_cbf/vcc/004"
]
}
}
},
"FspVlbi": {
"mid_csp_cbf/fsp_vlbi/04": {}
}
}
},
"TangoAccessControl": {
"1": {
"TangoAccessControl": {
"sys/access_control/1": {}
}
}
},
"TangoTest": {
"test": {
"TangoTest": {
"sys/tg_test/1": {}
}
}
},
"VccMulti": {
"vcc-001": {
"Vcc": {
"mid_csp_cbf/vcc/001": {
"attribute_properties": {
"adminMode": {
"abs_change": [
"-1",
"1"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"subarrayMembership": {
"abs_change": [
"-1",
"1"
]
}
},
"properties": {
"Band1And2Address": [
"mid_csp_cbf/vcc_band12/001"
],
"Band3Address": [
"mid_csp_cbf/vcc_band3/001"
],
"Band4Address": [
"mid_csp_cbf/vcc_band4/001"
],
"Band5Address": [
"mid_csp_cbf/vcc_band5/001"
],
"SW1Address": [
"mid_csp_cbf/vcc_sw1/001"
],
"SW2Address": [
"mid_csp_cbf/vcc_sw2/001"
],
"VccID": [
"1"
],
"polled_attr": [
"state",
"1000",
"healthstate",
"1000",
"adminmode",
"1000"
]
}
}
},
"VccBand1And2": {
"mid_csp_cbf/vcc_band12/001": {}
},
"VccBand3": {
"mid_csp_cbf/vcc_band3/001": {}
},
"VccBand4": {
"mid_csp_cbf/vcc_band4/001": {}
},
"VccBand5": {
"mid_csp_cbf/vcc_band5/001": {}
},
"VccSearchWindow": {
"mid_csp_cbf/vcc_sw1/001": {},
"mid_csp_cbf/vcc_sw2/001": {}
}
},
"vcc-002": {
"Vcc": {
"mid_csp_cbf/vcc/002": {
"attribute_properties": {
"adminMode": {
"abs_change": [
"-1",
"1"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"subarrayMembership": {
"abs_change": [
"-1",
"1"
]
}
},
"properties": {
"Band1And2Address": [
"mid_csp_cbf/vcc_band12/002"
],
"Band3Address": [
"mid_csp_cbf/vcc_band3/002"
],
"Band4Address": [
"mid_csp_cbf/vcc_band4/002"
],
"Band5Address": [
"mid_csp_cbf/vcc_band5/002"
],
"SW1Address": [
"mid_csp_cbf/vcc_sw1/002"
],
"SW2Address": [
"mid_csp_cbf/vcc_sw2/002"
],
"VccID": [
"2"
],
"polled_attr": [
"state",
"1000",
"healthstate",
"1000",
"adminmode",
"1000"
]
}
}
},
"VccBand1And2": {
"mid_csp_cbf/vcc_band12/002": {}
},
"VccBand3": {
"mid_csp_cbf/vcc_band3/002": {}
},
"VccBand4": {
"mid_csp_cbf/vcc_band4/002": {}
},
"VccBand5": {
"mid_csp_cbf/vcc_band5/002": {}
},
"VccSearchWindow": {
"mid_csp_cbf/vcc_sw1/002": {},
"mid_csp_cbf/vcc_sw2/002": {}
}
},
"vcc-003": {
"Vcc": {
"mid_csp_cbf/vcc/003": {
"attribute_properties": {
"adminMode": {
"abs_change": [
"-1",
"1"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"subarrayMembership": {
"abs_change": [
"-1",
"1"
]
}
},
"properties": {
"Band1And2Address": [
"mid_csp_cbf/vcc_band12/003"
],
"Band3Address": [
"mid_csp_cbf/vcc_band3/003"
],
"Band4Address": [
"mid_csp_cbf/vcc_band4/003"
],
"Band5Address": [
"mid_csp_cbf/vcc_band5/003"
],
"SW1Address": [
"mid_csp_cbf/vcc_sw1/003"
],
"SW2Address": [
"mid_csp_cbf/vcc_sw2/003"
],
"VccID": [
"3"
],
"polled_attr": [
"state",
"1000",
"healthstate",
"1000",
"adminmode",
"1000"
]
}
}
},
"VccBand1And2": {
"mid_csp_cbf/vcc_band12/003": {}
},
"VccBand3": {
"mid_csp_cbf/vcc_band3/003": {}
},
"VccBand4": {
"mid_csp_cbf/vcc_band4/003": {}
},
"VccBand5": {
"mid_csp_cbf/vcc_band5/003": {}
},
"VccSearchWindow": {
"mid_csp_cbf/vcc_sw1/003": {},
"mid_csp_cbf/vcc_sw2/003": {}
}
},
"vcc-004": {
"Vcc": {
"mid_csp_cbf/vcc/004": {
"attribute_properties": {
"adminMode": {
"abs_change": [
"-1",
"1"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"subarrayMembership": {
"abs_change": [
"-1",
"1"
]
}
},
"properties": {
"Band1And2Address": [
"mid_csp_cbf/vcc_band12/004"
],
"Band3Address": [
"mid_csp_cbf/vcc_band3/004"
],
"Band4Address": [
"mid_csp_cbf/vcc_band4/004"
],
"Band5Address": [
"mid_csp_cbf/vcc_band5/004"
],
"SW1Address": [
"mid_csp_cbf/vcc_sw1/004"
],
"SW2Address": [
"mid_csp_cbf/vcc_sw2/004"
],
"VccID": [
"4"
],
"polled_attr": [
"state",
"1000",
"healthstate",
"1000",
"adminmode",
"1000"
]
}
}
},
"VccBand1And2": {
"mid_csp_cbf/vcc_band12/004": {}
},
"VccBand3": {
"mid_csp_cbf/vcc_band3/004": {}
},
"VccBand4": {
"mid_csp_cbf/vcc_band4/004": {}
},
"VccBand5": {
"mid_csp_cbf/vcc_band5/004": {}
},
"VccSearchWindow": {
"mid_csp_cbf/vcc_sw1/004": {},
"mid_csp_cbf/vcc_sw2/004": {}
}
}
},
"TmCspSubarrayLeafNodeTest": {
"tm": {
"TmCspSubarrayLeafNodeTest": {
"ska_mid/tm_leaf_node/csp_subarray_01": {
"attribute_properties": {
"dopplerPhaseCorrection": {
"abs_change": [
"-1",
"1"
]
}
},
"properties": {
"CbfMasterAddress": [
"mid_csp_cbf/sub_elt/master"
],
"CbfSubarrayAddress": [
"mid_csp_cbf/sub_elt/subarray_01"
],
"polled_attr": [
"delaymodel",
"1000",
"visdestinationaddress",
"1000",
"dopplerphasecorrection",
"1000"
]
}
}
}
}
}
}
}
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/docker/config/midcsplmc_dsconfig.json 0000664 0000000 0000000 00000100751 13707315520 0031241 0 ustar 00root root 0000000 0000000 {
"servers": {
"DataBaseds": {
"2": {
"DataBase": {
"sys/database/2": {}
}
}
},
"MidCspCapabilityMonitor": {
"monitor": {
"CspCapabilityMonitor": {
"mid_csp/capability_monitor/vcc": {
"properties": {
"CapabilityDevices": [
"mid_csp/vcc/004",
"mid_csp/vcc/003",
"mid_csp/vcc/002",
"mid_csp/vcc/001"
],
"SkaLevel": [
"2"
]
}
},
"mid_csp/capability_monitor/timing_beams": {
"properties": {
"CapabilityDevices": [
"mid_csp/timing_beams/04",
"mid_csp/timing_beams/03",
"mid_csp/timing_beams/01",
"mid_csp/timing_beams/02"
],
"SkaLevel": [
"2"
]
}
},
"mid_csp/capability_monitor/vlbi_beams": {
"properties": {
"CapabilityDevices": [
"mid_csp/vlbi_beams/03",
"mid_csp/vlbi_beams/04",
"mid_csp/vlbi_beams/02",
"mid_csp/vlbi_beams/01"
],
"SkaLevel": [
"2"
]
}
}
},
"CspSearchBeamsMonitor": {
"mid_csp/capability_monitor/search_beams": {
"properties": {
"CapabilityDevices": [
"mid_csp/search_beams/04",
"mid_csp/search_beams/03",
"mid_csp/search_beams/01",
"mid_csp/search_beams/02"
],
"SkaLevel": [
"2"
]
}
}
}
}
},
"MidCspMaster": {
"master": {
"MidCspMasterBase": {
"mid_csp/elt/master": {
"attribute_properties": {
"adminMode": {
"__value": [
"0"
],
"abs_change": [
"-1",
"1"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"reportFSPAdminMode": {
"__root_att": [
"mid_csp_cbf/sub_elt/master/reportFSPAdminMode"
]
},
"reportFSPHealthState": {
"__root_att": [
"mid_csp_cbf/sub_elt/master/reportFSPHealthState"
]
},
"reportFSPState": {
"__root_att": [
"mid_csp_cbf/sub_elt/master/reportFSPState"
]
},
"reportSearchBeamAdminMode": {
"__root_att": [
"mid_csp/capability_monitor/search_beams/capabilityAdminMode"
]
},
"reportSearchBeamHealthState": {
"__root_att": [
"mid_csp/capability_monitor/search_beams/capabilityHealthState"
]
},
"reportSearchBeamObsState": {
"__root_att": [
"mid_csp/capability_monitor/search_beams/capabilityObsState"
]
},
"reportSearchBeamState": {
"__root_att": [
"mid_csp/capability_monitor/search_beams/capabilityState"
]
},
"reportTimingBeamAdminMode": {
"__root_att": [
"mid_csp/capability_monitor/timing_beams/capabilityAdminMode"
]
},
"reportTimingBeamHealthState": {
"__root_att": [
"mid_csp/capability_monitor/timing_beams/capabilityHealthState"
]
},
"reportTimingBeamObsState": {
"__root_att": [
"mid_csp/capability_monitor/timing_beams/capabilityObsState"
]
},
"reportTimingBeamState": {
"__root_att": [
"mid_csp/capability_monitor/timing_beams/capabilityState"
]
},
"reportVCCAdminMode": {
"__root_att": [
"mid_csp_cbf/sub_elt/master/reportVCCAdminMode"
]
},
"reportVCCHealthState": {
"__root_att": [
"mid_csp_cbf/sub_elt/master/reportVCCHealthState"
]
},
"reportVCCState": {
"__root_att": [
"mid_csp_cbf/sub_elt/master/reportVCCState"
]
},
"reportVlbiBeamAdminMode": {
"__root_att": [
"mid_csp/capability_monitor/vlbi_beams/capabilityAdminMode"
]
},
"reportVlbiBeamHealthState": {
"__root_att": [
"mid_csp/capability_monitor/vlbi_beams/capabilityHealthState"
]
},
"reportVlbiBeamObsState": {
"__root_att": [
"mid_csp/capability_monitor/vlbi_beams/capabilityObsState"
]
},
"reportVlbiBeamState": {
"__root_att": [
"mid_csp/capability_monitor/vlbi_beams/capabilityState"
]
},
"searchBeamMembership": {
"__root_att": [
"mid_csp/capability_monitor/search_beams/capabilityMembership"
]
},
"timingBeamMembership": {
"__root_att": [
"mid_csp/capability_monitor/timing_beams/capabilityMembership"
]
},
"unassignedSearchBeamIDs": {
"__root_att": [
"mid_csp/capability_monitor/search_beams/unassignedIDs"
]
},
"numOfUnassignedSearchBeams": {
"__root_att": [
"mid_csp/capability_monitor/search_beams/numOfUnassignedIDs"
]
},
"numOfReservedSearchBeams": {
"__root_att": [
"mid_csp/capability_monitor/search_beams/numOfReservedIDs"
]
},
"unassignedTimingBeamIDs": {
"__root_att": [
"mid_csp/capability_monitor/timing_beams/unassignedIDs"
]
},
"numOfUnassignedTimingBeams": {
"__root_att": [
"mid_csp/capability_monitor/timing_beams/numOfUnassignedIDs"
]
},
"numOfUnassignedVlbiBeams": {
"__root_att": [
"mid_csp/capability_monitor/vlbi_beams/numOfUnassignedIDs"
]
},
"unassignedVlbiBeamIDs": {
"__root_att": [
"mid_csp/capability_monitor/vlbi_beams/unassignedIDs"
]
},
"vccMembership": {
"__root_att": [
"mid_csp_cbf/sub_elt/master/reportVCCSubarrayMembership"
]
},
"vlbiBeamMembership": {
"__root_att": [
"mid_csp/capability_monitor/vlbi_beams/capabilityMembership"
]
}
},
"properties": {
"CspCbf": [
"mid_csp_cbf/sub_elt/master"
],
"CspPss": [
"mid_csp_pss/sub_elt/master"
],
"CspPst": [
"mid_csp_pst/sub_elt/master"
],
"CspSubarrays": [
"mid_csp/elt/subarray_01",
"mid_csp/elt/subarray_02"
],
"MaxCapabilities": [
"VCC:4",
"FSP:27",
"SearchBeams:1500",
"TimingBeams:16",
"VlbiBeams:20"
],
"SkaLevel": [
"1"
],
"SearchBeamsMonitor": [
"mid_csp/capability_monitor/search_beams"
],
"TimingBeamsMonitor": [
"mid_csp/capability_monitor/timing_beams"
],
"VCCsMonitor": [
"mid_csp/capability_monitor/vcc"
],
"VlbiBeamsMonitor": [
"mid_csp/capability_monitor/vlbi_beams"
],
"polled_attr": [
"csppssadminmode",
"1000",
"csppstadminmode",
"1000",
"cspcbfadminmode",
"1000",
"standbycmdalarm",
"1000",
"offcmdalarm",
"1000",
"adminmode",
"1000",
"oncommandprogress",
"3000",
"offcommandprogress",
"3000",
"offcmddurationexpected",
"3000",
"standbycommandprogress",
"3000",
"oncmddurationexpected",
"3000",
"standbycmddurationexpected",
"3000",
"oncmddurationmeasured",
"3000",
"offcmddurationmeasured",
"3000",
"standbycmddurationmeasured",
"3000",
"offcmdtimeoutexpired",
"3000",
"oncmdtimeoutexpired",
"2000",
"csppssstate",
"2000",
"standbycmdtimeoutexpired",
"1000",
"csppststate",
"1000",
"cspcbfhealthstate",
"1000",
"csppsshealthstate",
"1000",
"csppsthealthstate",
"1000",
"cspcbfadminmode",
"1000",
"oncmdfailure",
"2000",
"offcmdfailure",
"2000",
"standbycmdfailure",
"2000",
"cspcbfstate",
"3000"
]
}
}
}
}
},
"MidCspSubarray": {
"subarray1": {
"MidCspSubarrayBase": {
"mid_csp/elt/subarray_01": {
"attribute_properties": {
"assignedFspHealthState": {
"__root_att": [
"mid_csp_cbf/sub_elt/subarray_01/fspHealthState"
]
},
"assignedFspState": {
"__root_att": [
"mid_csp_cbf/sub_elt/subarray_01/fspState"
]
},
"assignedReceptors": {
"__root_att": [
"mid_csp_cbf/sub_elt/subarray_01/receptors"
]
},
"assignedVccHealthState": {
"__root_att": [
"mid_csp_cbf/sub_elt/subarray_01/vccHealthState"
]
},
"assignedVccState": {
"__root_att": [
"mid_csp_cbf/sub_elt/subarray_01/vccState"
]
}
},
"properties": {
"CbfSubarray": [
"mid_csp_cbf/sub_elt/subarray_01"
],
"CspMaster": [
"mid_csp/elt/master"
],
"PssSubarray": [
"mid_csp_pss/sub_elt/subarray_01"
],
"SkaLevel": [
"2"
],
"SubID": [
"1"
],
"SubarrayProcModeCorrelation": [
"mid_csp/elt/correlation-01"
],
"SubarrayProcModePss": [
"mid_csp/elt/pss-01"
],
"SubarrayProcModePst": [
"mid_csp/elt/pst-01"
],
"SubarrayProcModeVlbi": [
"mid_csp/elt/cvlbi-01"
],
"polled_attr": [
"alarmraisedflag",
"1000",
"timeoutexpiredflag",
"1000",
"scancmdprogress",
"1500",
"removeresourcescmdprogress",
"1500",
"addresourcescmdprogress",
"1500",
"endscancmdprogress",
"1500",
"endsbcmdprogress",
"1500"
]
}
}
},
"MidCspSubarrayProcModeCorrelation": {
"mid_csp/elt/correlation-01": {
"properties": {
"CapID": [
"1"
],
"CapType": [
"CORRELATION"
],
"subID": [
"1"
]
}
}
},
"MidCspSubarrayProcModePss": {
"mid_csp/elt/pss-01": {
"properties": {
"CapID": [
"1"
],
"CapType": [
"PSS"
],
"subID": [
"1"
]
}
}
},
"MidCspSubarrayProcModePst": {
"mid_csp/elt/pst-01": {
"properties": {
"CapID": [
"1"
],
"CapType": [
"PST"
],
"subID": [
"1"
]
}
}
},
"MidCspSubarrayProcModeVlbi": {
"mid_csp/elt/vlbi-01": {
"properties": {
"CapID": [
"1"
],
"CapType": [
"VLBI"
],
"subID": [
"1"
]
}
}
}
},
"subarray2": {
"MidCspSubarrayBase": {
"mid_csp/elt/subarray_02": {
"attribute_properties": {
"assignedFspHealthState": {
"__root_att": [
"mid_csp_cbf/sub_elt/subarray_02/fspHealthState"
]
},
"assignedFspState": {
"__root_att": [
"mid_csp_cbf/sub_elt/subarray_02/fspState"
]
},
"assignedReceptors": {
"__root_att": [
"mid_csp_cbf/sub_elt/subarray_02/receptors"
]
},
"assignedVccHealthState": {
"__root_att": [
"mid_csp_cbf/sub_elt/subarray_02/vccHealthState"
]
},
"assignedVccState": {
"__root_att": [
"mid_csp_cbf/sub_elt/subarray_02/vccState"
]
}
},
"properties": {
"CbfSubarray": [
"mid_csp_cbf/sub_elt/subarray_02"
],
"CspMaster": [
"mid_csp/elt/master"
],
"PssSubarray": [
"mid_csp_pss/sub_elt/subarray_02"
],
"SkaLevel": [
"2"
],
"SubID": [
"2"
],
"SubarrayProcModeCorrelation": [
"mid_csp/elt/correlation-02"
],
"SubarrayProcModePss": [
"mid_csp/elt/pss-02"
],
"SubarrayProcModePst": [
"mid_csp/elt/pst-02"
],
"SubarrayProcModeVlbi": [
"mid_csp/elt/cvlbi-02"
],
"polled_attr": [
"alarmraisedflag",
"1000",
"timeoutexpiredflag",
"1500",
"scancmdprogress",
"1500",
"removeresourcescmdprogress",
"1500",
"addresourcescmdprogress",
"1500",
"endscancmdprogress",
"1500",
"endsbcmdprogress",
"1500"
]
}
}
},
"MidCspSubarrayProcModeCorrelation": {
"mid_csp/elt/correlation-02": {
"properties": {
"CapID": [
"1"
],
"CapType": [
"CORRELATION"
],
"subID": [
"2"
]
}
}
},
"MidCspSubarrayProcModePss": {
"mid_csp/elt/pss-02": {
"properties": {
"CapID": [
"1"
],
"CapType": [
"PSS"
],
"subID": [
"2"
]
}
}
},
"MidCspSubarrayProcModePst": {
"mid_csp/elt/pst-02": {
"properties": {
"CapID": [
"1"
],
"CapType": [
"PST"
],
"subID": [
"2"
]
}
}
},
"MidCspSubarrayProcModeVlbi": {
"mid_csp/elt/vlbi-02": {
"properties": {
"CapID": [
"1"
],
"CapType": [
"VLBI"
],
"subID": [
"2"
]
}
}
}
}
},
"PssMasterSimulator": {
"midpss": {
"PssMasterSimulator": {
"mid_csp_pss/sub_elt/master": {
"attribute_properties": {
"adminMode": {
"__value": [
"3"
],
"abs_change": [
"-1",
"1"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"offCommandProgress": {
"abs_change": [
"-5",
"5"
]
},
"offDurationExpected": {
"__value": [
"12"
]
},
"onCommandProgress": {
"abs_change": [
"-5",
"5"
]
},
"onDurationExpected": {
"__value": [
"10"
]
},
"standbyCommandProgress": {
"abs_change": [
"-5",
"5"
]
},
"standbyDurationExpected": {
"__value": [
"5"
]
}
},
"properties": {
"polled_attr": [
"state",
"1000",
"healthstate",
"1000",
"adminmode",
"1000",
"onCommandProgress",
"1000",
"offCommandProgress",
"1000",
"standbyCommandProgress",
"1000"
]
}
}
}
}
},
"PstMasterSimulator": {
"pst": {
"PstMasterSimulator": {
"mid_csp_pst/sub_elt/master": {
"attribute_properties": {
"adminMode": {
"__value": [
"3"
],
"abs_change": [
"-1",
"1"
]
},
"healthState": {
"abs_change": [
"-1",
"1"
]
},
"offCommandProgress": {
"abs_change": [
"-5",
"5"
]
},
"offDurationExpected": {
"__value": [
"12"
]
},
"onCommandProgress": {
"abs_change": [
"-5",
"5"
]
},
"onDurationExpected": {
"__value": [
"10"
]
},
"standbyCommandProgress": {
"abs_change": [
"-5",
"5"
]
},
"standbyDurationExpected": {
"__value": [
"5"
]
}
},
"properties": {
"polled_attr": [
"state",
"1000",
"healthstate",
"1000",
"adminmode",
"1000",
"onCommandProgress",
"1000",
"offCommandProgress",
"1000",
"standbyCommandProgress",
"1000"
]
}
}
}
}
},
"TangoAccessControl": {
"1": {
"TangoAccessControl": {
"sys/access_control/1": {}
}
}
},
"TangoRestServer": {
"rest": {
"TangoRestServer": {
"sys/rest/0": {}
}
}
},
"TangoTest": {
"test": {
"TangoTest": {
"sys/tg_test/1": {}
}
}
}
}
}
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/docker/mid-cbf-mcs.yml 0000664 0000000 0000000 00000023222 13707315520 0026053 0 ustar 00root root 0000000 0000000 #
# Docker compose file for TANGO database and database device server
#
# Defines:
# - tangodb: MariaDB database with TANGO schema
# - databaseds: TANGO database device server
# - rsyslog-cbf-csplmc: rsyslog-cbf service for logger
# - cspmaster: CspMaster device
#
# Requires:
# - None
#
version: '2.2'
services:
cbf_dsconfig:
image: nexus.engageska-portugal.pt/ska-docker/tango-dsconfig:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}cbf_dsconfig
depends_on:
- databaseds
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
json2tango -w -a -u csplmc/config/midcbf_dsconfig.json && sleep infinity"
volumes:
- .:/csplmc
cbfmaster:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:0.4.4-bb69bb4
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}cbfmaster
depends_on:
- databaseds
- cbf_dsconfig
- vcc001
- vcc002
- vcc003
- vcc004
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/vcc/001 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/vcc/002 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/vcc/003 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/vcc/004 &&\
/venv/bin/python /app/tangods/CbfMaster/CbfMaster/CbfMaster.py master"
volumes_from:
- rsyslog-cbf:rw
cbfsubarray01:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:0.4.4-bb69bb4
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}cbfsubarray01
depends_on:
- cbf_dsconfig
- vcc001
- vcc002
- vcc003
- vcc004
- cbfmaster
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/sub_elt/master &&\
/venv/bin/python /app/tangods/CbfSubarray/CbfSubarrayMulti/CbfSubarrayMulti.py cbfSubarray-01"
volumes_from:
- rsyslog-cbf:rw
cbfsubarray02:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:0.4.4-bb69bb4
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}cbfsubarray02
depends_on:
- cbf_dsconfig
- vcc001
- vcc002
- vcc003
- vcc004
- cbfmaster
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/sub_elt/master &&\
/venv/bin/python /app/tangods/CbfSubarray/CbfSubarrayMulti/CbfSubarrayMulti.py cbfSubarray-02"
volumes_from:
- rsyslog-cbf:rw
vcc001:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:0.4.4-bb69bb4
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}vcc001
depends_on:
- databaseds
- cbf_dsconfig
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/01 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/02 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/03 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/04 &&\
/venv/bin/python /app/tangods/Vcc/VccMulti/VccMulti.py vcc-001"
volumes_from:
- rsyslog-cbf:rw
vcc002:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:0.4.4-bb69bb4
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}vcc002
depends_on:
- databaseds
- cbf_dsconfig
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/01 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/02 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/03 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/04 &&\
/venv/bin/python /app/tangods/Vcc/VccMulti/VccMulti.py vcc-002"
volumes_from:
- rsyslog-cbf:rw
vcc003:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:0.4.4-bb69bb4
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}vcc003
depends_on:
- databaseds
- cbf_dsconfig
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/01 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/02 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/03 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/04 &&\
/venv/bin/python /app/tangods/Vcc/VccMulti/VccMulti.py vcc-003"
volumes_from:
- rsyslog-cbf:rw
vcc004:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:0.4.4-bb69bb4
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}vcc004
depends_on:
- databaseds
- cbf_dsconfig
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/01 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/02 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/03 &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/fsp/04 &&\
/venv/bin/python /app/tangods/Vcc/VccMulti/VccMulti.py vcc-004"
volumes_from:
- rsyslog-cbf:rw
fsp01:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:0.4.4-bb69bb4
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}fsp01
depends_on:
- databaseds
- cbf_dsconfig
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
/venv/bin/python /app/tangods/Fsp/FspMulti/FspMulti.py fsp-01"
volumes_from:
- rsyslog-cbf:rw
fsp02:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:0.4.4-bb69bb4
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}fsp02
depends_on:
- databaseds
- cbf_dsconfig
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
/venv/bin/python /app/tangods/Fsp/FspMulti/FspMulti.py fsp-02"
volumes_from:
- rsyslog-cbf:rw
fsp03:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:0.4.4-bb69bb4
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}fsp03
depends_on:
- databaseds
- cbf_dsconfig
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
/venv/bin/python /app/tangods/Fsp/FspMulti/FspMulti.py fsp-03"
volumes_from:
- rsyslog-cbf:rw
fsp04:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:0.4.4-bb69bb4
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}fsp04
depends_on:
- databaseds
- cbf_dsconfig
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
/venv/bin/python /app/tangods/Fsp/FspMulti/FspMulti.py fsp-04"
volumes_from:
- rsyslog-cbf:rw
tmcspsubarrayleafnodetest:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:0.4.4-bb69bb4
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}tmcspsubarrayleafnodetest
depends_on:
- cbfsubarray01
- databaseds
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
retry --max=10 -- tango_admin --ping-device mid_csp_cbf/sub_elt/subarray_01 &&
/venv/bin/python /app/tangods/TmCspSubarrayLeafNodeTest/TmCspSubarrayLeafNodeTest.py tm"
volumes_from:
- rsyslog-cbf:rw
tmcspsubarrayleafnodetest2:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-cbf-mcs:0.4.4-bb69bb4
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}tmcspsubarrayleafnodetest2
depends_on:
- cbfsubarray02
- databaseds
- rsyslog-cbf
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
retry --max=10 -- tango_admin --ping-device mid_csp_cbf/sub_elt/subarray_02 &&
/venv/bin/python /app/tangods/TmCspSubarrayLeafNodeTest/TmCspSubarrayLeafNodeTest.py tm2"
volumes_from:
- rsyslog-cbf:rw
rsyslog-cbf:
image: jumanjiman/rsyslog
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}rsyslog-cbf
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/docker/mid-csp-lmc.yml 0000664 0000000 0000000 00000011222 13707315520 0026074 0 ustar 00root root 0000000 0000000 #
# Docker compose file for TANGO database and database device server
#
# Defines:
# - tangodb: MariaDB database with TANGO schema
# - databaseds: TANGO database device server
# - rsyslog-csplmc: rsyslog service for logger
# - midcspmaster: MidCspMaster device
#
# Requires:
# - None
#
version: '2.2'
services:
midcsp_dsconfig:
image: nexus.engageska-portugal.pt/ska-docker/tango-dsconfig:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}mid-csp_dsconfig
depends_on:
- databaseds
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
json2tango -w -a -u csplmc/config/midcsplmc_dsconfig.json && sleep infinity"
volumes:
- .:/csplmc
midcsp_dumpdsconfig:
image: nexus.engageska-portugal.pt/ska-docker/tango-dsconfig:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}midcsp_dumpdsconfig
depends_on:
- databaseds
- midcspsubarray01
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=60 --strict --
python -m dsconfig.dump > csplmc/config/config_result.json && sleep infinity "
volumes:
- .:/csplmc
midcspsubarray01:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-csp-lmc:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}midcspsubarray01
depends_on:
- midcsp_dsconfig
- midcspmaster
- rsyslog-csplmc
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=30 --strict --
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/sub_elt/master &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/sub_elt/subarray_01 &&\
retry --max=5 -- tango_admin --ping-device mid_csp/elt/master &&\
/venv/bin/python /app/csp_lmc_mid/MidCspSubarray.py subarray1"
volumes_from:
- rsyslog-csplmc:rw
midcspsubarray02:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-csp-lmc:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}midcspsubarray02
depends_on:
- midcsp_dsconfig
- midcspmaster
- rsyslog-csplmc
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=30 --strict --
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/sub_elt/master &&\
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/sub_elt/subarray_02 &&\
retry --max=5 -- tango_admin --ping-device mid_csp/elt/master &&\
/venv/bin/python /app/csp_lmc_mid/MidCspSubarray.py subarray2"
volumes_from:
- rsyslog-csplmc:rw
midcspmaster:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-csp-lmc:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}midcspmaster
depends_on:
- midcsp_dsconfig
- cbfmaster
- rsyslog-csplmc
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=30 --strict --
retry --max=5 -- tango_admin --ping-device mid_csp_cbf/sub_elt/master &&\
retry --max=5 -- tango_admin --ping-device mid_csp/capability_monitor/search_beams &&\
/venv/bin/python /app/csp_lmc_mid/MidCspMaster.py master"
volumes_from:
- rsyslog-csplmc:rw
midcapabilitymonitor:
image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/mid-csp-lmc:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}midcapabilitymonitor
depends_on:
- midcsp_dsconfig
- rsyslog-csplmc
environment:
- TANGO_HOST=${TANGO_HOST}
command: >
sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=30 --strict --
/venv/bin/python /app/csp_lmc_mid/MidCspCapabilityMonitor.py monitor"
volumes_from:
- rsyslog-csplmc:rw
# midpssmaster:
# image: ${DOCKER_REGISTRY_HOST}/${DOCKER_REGISTRY_USER}/csp-lmc-common:latest
# network_mode: ${NETWORK_MODE}
# container_name: ${CONTAINER_NAME_PREFIX}midpssmaster
# depends_on:
# - midcsp_dsconfig
# - rsyslog-csplmc
# environment:
# - TANGO_HOST=${TANGO_HOST}
# command: >
# sh -c "wait-for-it.sh ${TANGO_HOST} --timeout=30 --strict --
# /venv/bin/python /app/simulators/DeviceTestMaster/PssMasterSimulator.py midpss"
# volumes_from:
# - rsyslog-csplmc:rw
rsyslog-csplmc:
image: jumanjiman/rsyslog
container_name: ${CONTAINER_NAME_PREFIX}rsyslog-csplmc
network_mode: ${NETWORK_MODE}
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/docker/mid-csp-tangodb.yml 0000664 0000000 0000000 00000002260 13707315520 0026741 0 ustar 00root root 0000000 0000000 #
# Docker compose file for TANGO database and database device server
#
# Defines:
# - tangodb: MariaDB database with TANGO schema
# - databaseds: TANGO database device server
#
# Requires:
# - None
#
version: '2.2'
volumes:
mid-csp_tangodb: {}
services:
tangodb:
image: nexus.engageska-portugal.pt/ska-docker/tango-db:latest
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}tangodb
environment:
- MYSQL_ROOT_PASSWORD=secret
- MYSQL_DATABASE=tango
- MYSQL_USER=tango
- MYSQL_PASSWORD=tango
volumes:
- mid-csp_tangodb:/var/lib/mysql
databaseds:
image: nexus.engageska-portugal.pt/ska-docker/tango-cpp:latest
depends_on:
- tangodb
network_mode: ${NETWORK_MODE}
container_name: ${CONTAINER_NAME_PREFIX}databaseds
environment:
- MYSQL_HOST=${MYSQL_HOST}
- MYSQL_DATABASE=tango
- MYSQL_USER=tango
- MYSQL_PASSWORD=tango
- TANGO_HOST=${TANGO_HOST}
entrypoint:
- /usr/local/bin/wait-for-it.sh
- ${MYSQL_HOST}
- --timeout=70
- --strict
- --
- /usr/local/bin/DataBaseds
- "2"
- -ORBendPoint
- giop:tcp::10000
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/docker/scripts/ 0000775 0000000 0000000 00000000000 13707315520 0024735 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/docker/scripts/kat-get-version.py 0000775 0000000 0000000 00000003235 13707315520 0030334 0 ustar 00root root 0000000 0000000 #!/venv/bin/python
################################################################################
# Copyright (c) 2014-2018, National Research Foundation (Square Kilometre Array)
#
# Licensed under the BSD 3-Clause License (the "License"); you may not use
# this file except in compliance with the License. You may obtain a copy
# of the License at
#
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
################################################################################
"""Script to get the current version string of a Python package."""
import os
import argparse
from katversion.version import get_version_from_file, get_git_cleaned_branch_name, get_version_from_module
from katversion import get_version
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('-p', '--path', dest='path', action='store',
help='Path of SCM checkout. If not given the'
' current directory is used.')
args = parser.parse_args()
if args.path:
path = args.path
else:
# If path was not given us the current working directory. This is the
# way git smudge uses this file.
path = os.getcwd()
print("UFFA")
print(get_version(path, "mid-csp-lmc"))
print(get_git_cleaned_branch_name(path))
print(get_version_from_module("csp-lmc"))
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/docker/test-harness/ 0000775 0000000 0000000 00000000000 13707315520 0025666 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/docker/test-harness/Makefile 0000664 0000000 0000000 00000003421 13707315520 0027326 0 ustar 00root root 0000000 0000000 # Use bash shell with pipefail option enabled so that the return status of a
# piped command is the value of the last (rightmost) commnand to exit with a
# non-zero status. This lets us pipe output into tee but still exit on test
# failures.
SHELL = /bin/bash
.SHELLFLAGS = -o pipefail -c
all: test lint
# wait for the device to be available before beginning the test
# A temporary volume is mounted at /build when 'make test' is executing.
# The following steps copy across useful output to this volume which can
# then be extracted to form the CI summary for the test procedure.
test:
retry --max=10 -- tango_admin --ping-device mid_csp_cbf/sub_elt/master
retry --max=10 -- tango_admin --ping-device mid_csp_cbf/sub_elt/subarray_01
retry --max=10 -- tango_admin --ping-device mid_csp_cbf/sub_elt/subarray_02
retry --max=10 -- tango_admin --ping-device mid_csp/elt/master
retry --max=10 -- tango_admin --ping-device mid_csp/elt/subarray_01
retry --max=10 -- tango_admin --ping-device mid_csp/elt/subarray_02
cd /app && python setup.py test --addopts='-k-acceptance_tests'| tee setup_py_test.stdout
mkdir -p /build/reports && \
if [ -d /build ]; then \
mv /app/setup_py_test.stdout /build/csp-lmc-mid-setup-test.stdout; \
mv /app/htmlcov /build/csp-lmc-mid_htmlcov; \
cp /app/coverage.xml /build/coverage-csp-lmc-mid.xml; \
fi;
#cd /build && coverage combine csp-lmc-mid_coverage csp-lmc-common_coverage && coverage xml
#cd /build && mv coverage.xml ./reports/code-coverage.xml
lint:
pip3 install pylint2junit; \
mkdir -p /build/reports; \
cd /app && pylint --output-format=parseable csp_lmc_mid | tee /build/csp-lmc-mid-code-analysis.stdout; \
cd /app && pylint --output-format=pylint2junit.JunitReporter csp_lmc_mid > /build/reports/csp-lmc-mid-linting.xml;
.PHONY: all test lint
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/docker/test-harness/README.md 0000664 0000000 0000000 00000000237 13707315520 0027147 0 ustar 00root root 0000000 0000000 This directory is uploaded to the container when 'make test' is executed. Files
in this directory will be found inside /build once uploaded to the container.
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/pogo/ 0000775 0000000 0000000 00000000000 13707315520 0022743 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/pogo/MidCspMasterBase.py 0000664 0000000 0000000 00000030576 13707315520 0026456 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
#
# This file is part of the MidCspMasterBase project
#
# INAF-SKA Telescope
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
""" MidCspMasterBase class
The base class for MID CspMAster.
Fuctionality to monitor CSP.LMC Capabilities are
implemented in separate TANGO Devices.
"""
# PyTango imports
import tango
from tango import DebugIt
from tango.server import run
from tango.server import Device, DeviceMeta
from tango.server import attribute, command
from tango.server import device_property
from tango import AttrQuality, DispLevel, DevState
from tango import AttrWriteType, PipeWriteType
import enum
from CspMaster import CspMaster
# Additional import
# PROTECTED REGION ID(MidCspMasterBase.additionnal_import) ENABLED START #
# PROTECTED REGION END # // MidCspMasterBase.additionnal_import
__all__ = ["MidCspMasterBase", "main"]
class HealthState(enum.IntEnum):
"""Python enumerated type for HealthState attribute."""
class AdminMode(enum.IntEnum):
"""Python enumerated type for AdminMode attribute."""
class ControlMode(enum.IntEnum):
"""Python enumerated type for ControlMode attribute."""
class SimulationMode(enum.IntEnum):
"""Python enumerated type for SimulationMode attribute."""
class TestMode(enum.IntEnum):
"""Python enumerated type for TestMode attribute."""
class CspCbfHealthState(enum.IntEnum):
"""Python enumerated type for CspCbfHealthState attribute."""
class CspPssHealthState(enum.IntEnum):
"""Python enumerated type for CspPssHealthState attribute."""
class CspPstHealthState(enum.IntEnum):
"""Python enumerated type for CspPstHealthState attribute."""
class CspCbfAdminMode(enum.IntEnum):
"""Python enumerated type for CspCbfAdminMode attribute."""
class CspPssAdminMode(enum.IntEnum):
"""Python enumerated type for CspPssAdminMode attribute."""
class CspPstAdminMode(enum.IntEnum):
"""Python enumerated type for CspPstAdminMode attribute."""
class LoggingLevel(enum.IntEnum):
"""Python enumerated type for LoggingLevel attribute."""
class MidCspMasterBase(CspMaster):
"""
The base class for MID CspMAster.
Fuctionality to monitor CSP.LMC Capabilities are
implemented in separate TANGO Devices.
**Properties:**
- Device Property
VCCsMonitor
- TANGO Device to monitor the Mid.CSP VCCs Capabilities\ndevices.
- Type:'DevString'
FSPsMonitor
- TANGO Device to monitor the Mid.CSP FSPs Capabilities\ndevices.
- Type:'DevString'
"""
__metaclass__ = DeviceMeta
# PROTECTED REGION ID(MidCspMasterBase.class_variable) ENABLED START #
# PROTECTED REGION END # // MidCspMasterBase.class_variable
# -----------------
# Device Properties
# -----------------
VCCsMonitor = device_property(
dtype='DevString', default_value="mid_csp/capability_monitor/receptors"
)
FSPsMonitor = device_property(
dtype='DevString', default_value="mid_csp/capability_monitor/fsps"
)
# ----------
# Attributes
# ----------
availableCapabilities = attribute(
dtype=('DevString',),
max_dim_x=20,
doc="A list of available number of instances of each capability type, e.g. `CORRELATOR:512`, `PSS-BEAMS:4`.",
)
receptorMembership = attribute(
dtype=('DevUShort',),
max_dim_x=197,
label="Receptor Memebership",
doc="The receptors affiliation to MID CSP sub-arrays.",
)
unassignedReceptorIDs = attribute(
dtype=('DevUShort',),
max_dim_x=197,
label="Unassigned receptors IDs",
doc="The list of available receptors IDs.",
)
timingBeamsAddresses = attribute(
dtype=('DevString',),
max_dim_x=16,
label="Timing Beams Capability Addresses",
doc="The list of Timing Beam Capabilities FQDNs",
)
vccCapabilitiesAddresses = attribute(
dtype=('DevString',),
max_dim_x=197,
label="VCC Capabilities Addresses",
doc="The list of VCC Capabilities FQDNs",
)
fspCapabilitiesAddresses = attribute(
dtype=('DevString',),
max_dim_x=27,
label="FSP Capabilities Addresses",
doc="The list of FSP Capabilites FQDNs",
)
reportSearchBeamState = attribute(
name="reportSearchBeamState",
label="SearchBeam Capabilities State",
forwarded=True
)
reportSearchBeamHealthState = attribute(
name="reportSearchBeamHealthState",
label="SearchBeam Capabilities healthState",
forwarded=True
)
reportSearchBeamObsState = attribute(
name="reportSearchBeamObsState",
label="SearchBeam Capabilities obsState",
forwarded=True
)
reportSearchBeamAdminMode = attribute(
name="reportSearchBeamAdminMode",
label="SearchBeam Capabilities adminMode",
forwarded=True
)
reportTimingBeamState = attribute(
name="reportTimingBeamState",
label="TimingBeam Capabilities State",
forwarded=True
)
reportTimingBeamHealthState = attribute(
name="reportTimingBeamHealthState",
label="TimingBeam Capabilities healthState",
forwarded=True
)
reportTimingBeamObsState = attribute(
name="reportTimingBeamObsState",
label="TimingBeam Capabilities obsState",
forwarded=True
)
reportTimingBeamAdminMode = attribute(
name="reportTimingBeamAdminMode",
label="TimingBeam Capabilities adminMode",
forwarded=True
)
reportVlbiBeamState = attribute(
name="reportVlbiBeamState",
label="VlbiBeam Capabilities State",
forwarded=True
)
reportVlbiBeamHealthState = attribute(
name="reportVlbiBeamHealthState",
label="VlbiBeam Capabilities healthState",
forwarded=True
)
reportVlbiBeamObsState = attribute(
name="reportVlbiBeamObsState",
label="VlbiBeam Capabilities obsState",
forwarded=True
)
reportVlbiBeamAdminMode = attribute(
name="reportVlbiBeamAdminMode",
label="VlbiBeam Capabilities adminMode",
forwarded=True
)
reservedSearchBeamIDs = attribute(
name="reservedSearchBeamIDs",
label="IDs of reserved SeachBeam Capabilities",
forwarded=True
)
unassignedVlbiBeamIDs = attribute(
name="unassignedVlbiBeamIDs",
label="Unassigned VlbiBeam Capabilities IDs",
forwarded=True
)
unassignedTimingBeamIDs = attribute(
name="unassignedTimingBeamIDs",
label="Unassigned TimingBeam Capabilities IDs",
forwarded=True
)
unassignedSearchBeamIDs = attribute(
name="unassignedSearchBeamIDs",
label="Unassigned SeachBeam Capabilities IDs",
forwarded=True
)
reservedSearchBeamNum = attribute(
name="reservedSearchBeamNum",
label="Number of reserved SeachBeam Capabilities",
forwarded=True
)
searchBeamMembership = attribute(
name="searchBeamMembership",
label="SearchBeam Membership",
forwarded=True
)
timingBeamMembership = attribute(
name="timingBeamMembership",
label="TimingBeam Membership",
forwarded=True
)
vlbiBeamMembership = attribute(
name="vlbiBeamMembership",
label="VlbiBeam Membership",
forwarded=True
)
reportVCCState = attribute(
name="reportVCCState",
label="reportVCCState",
forwarded=True
)
reportVCCHealthState = attribute(
name="reportVCCHealthState",
label="reportVCCHealthState",
forwarded=True
)
reportVCCAdminMode = attribute(
name="reportVCCAdminMode",
label="reportVCCAdminMode",
forwarded=True
)
reportFSPState = attribute(
name="reportFSPState",
label="reportFSPState",
forwarded=True
)
reportFSPHealthState = attribute(
name="reportFSPHealthState",
label="reportFSPHealthState",
forwarded=True
)
reportFSPAdminMode = attribute(
name="reportFSPAdminMode",
label="reportFSPAdminMode",
forwarded=True
)
fspMembership = attribute(
name="fspMembership",
label="fspMembership",
forwarded=True
)
vccMembership = attribute(
name="vccMembership",
label="vccMembership",
forwarded=True
)
numOfUnassignedVlbiBeams = attribute(
name="numOfUnassignedVlbiBeams",
label="Num of onassigned VlbiBeam Capabilities IDs",
forwarded=True
)
numOfUnassignedTimingBeams = attribute(
name="numOfUnassignedTimingBeams",
label="Num of unassigned TimingBeam Capabilities IDs",
forwarded=True
)
numOfUnassignedSearchBeams = attribute(
name="numOfUnassignedSearchBeams",
label="Num of unassigned SeachBeam Capabilities IDs",
forwarded=True
)
numOfReservedSearchBeams = attribute(
name="numOfReservedSearchBeams",
label="Number of reserved SeachBeam Capabilities",
forwarded=True
)
# ---------------
# General methods
# ---------------
def init_device(self):
"""Initialises the attributes and properties of the MidCspMasterBase."""
CspMaster.init_device(self)
# PROTECTED REGION ID(MidCspMasterBase.init_device) ENABLED START #
# PROTECTED REGION END # // MidCspMasterBase.init_device
def always_executed_hook(self):
"""Method always executed before any TANGO command is executed."""
# PROTECTED REGION ID(MidCspMasterBase.always_executed_hook) ENABLED START #
# PROTECTED REGION END # // MidCspMasterBase.always_executed_hook
def delete_device(self):
"""Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command.
"""
# PROTECTED REGION ID(MidCspMasterBase.delete_device) ENABLED START #
# PROTECTED REGION END # // MidCspMasterBase.delete_device
# ------------------
# Attributes methods
# ------------------
def read_availableCapabilities(self):
# PROTECTED REGION ID(MidCspMasterBase.availableCapabilities_read) ENABLED START #
"""Return the availableCapabilities attribute."""
return ('',)
# PROTECTED REGION END # // MidCspMasterBase.availableCapabilities_read
def read_receptorMembership(self):
# PROTECTED REGION ID(MidCspMasterBase.receptorMembership_read) ENABLED START #
"""Return the receptorMembership attribute."""
return (0,)
# PROTECTED REGION END # // MidCspMasterBase.receptorMembership_read
def read_unassignedReceptorIDs(self):
# PROTECTED REGION ID(MidCspMasterBase.unassignedReceptorIDs_read) ENABLED START #
"""Return the unassignedReceptorIDs attribute."""
return (0,)
# PROTECTED REGION END # // MidCspMasterBase.unassignedReceptorIDs_read
def read_timingBeamsAddresses(self):
# PROTECTED REGION ID(MidCspMasterBase.timingBeamsAddresses_read) ENABLED START #
"""Return the timingBeamsAddresses attribute."""
return ('',)
# PROTECTED REGION END # // MidCspMasterBase.timingBeamsAddresses_read
def read_vccCapabilitiesAddresses(self):
# PROTECTED REGION ID(MidCspMasterBase.vccCapabilitiesAddresses_read) ENABLED START #
"""Return the vccCapabilitiesAddresses attribute."""
return ('',)
# PROTECTED REGION END # // MidCspMasterBase.vccCapabilitiesAddresses_read
def read_fspCapabilitiesAddresses(self):
# PROTECTED REGION ID(MidCspMasterBase.fspCapabilitiesAddresses_read) ENABLED START #
"""Return the fspCapabilitiesAddresses attribute."""
return ('',)
# PROTECTED REGION END # // MidCspMasterBase.fspCapabilitiesAddresses_read
# --------
# Commands
# --------
# ----------
# Run server
# ----------
def main(args=None, **kwargs):
"""Main function of the MidCspMasterBase module."""
# PROTECTED REGION ID(MidCspMasterBase.main) ENABLED START #
return run((MidCspMasterBase,), args=args, **kwargs)
# PROTECTED REGION END # // MidCspMasterBase.main
if __name__ == '__main__':
main()
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/pogo/MidCspMasterBase.xmi 0000664 0000000 0000000 00000205412 13707315520 0026614 0 ustar 00root root 0000000 0000000
4
localhost
16
4
mid_csp/capability_monitor/receptors
mid_csp/capability_monitor/fsps
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/pogo/MidCspSubarrayBase.xmi 0000664 0000000 0000000 00000245425 13707315520 0027161 0 ustar 00root root 0000000 0000000
4
4
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/pogo/MidCspSubarrayProcModeCorrelation.xmi 0000664 0000000 0000000 00000055317 13707315520 0032220 0 ustar 00root root 0000000 0000000
4
4
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/pogo/MidCspSubarrayProcModePss.xmi 0000664 0000000 0000000 00000055267 13707315520 0030510 0 ustar 00root root 0000000 0000000
4
4
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/pogo/MidCspSubarrayProcModePst.xmi 0000664 0000000 0000000 00000055274 13707315520 0030507 0 ustar 00root root 0000000 0000000
4
4
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/pogo/MidCspSubarrayProcModeVlbi.xmi 0000664 0000000 0000000 00000055310 13707315520 0030624 0 ustar 00root root 0000000 0000000
4
4
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/setup.cfg 0000664 0000000 0000000 00000001554 13707315520 0023625 0 ustar 00root root 0000000 0000000 [metadata]
description-file = README.md
[aliases]
# Define `python setup.py test`
test=pytest
[coverage:run]
branch = True
#relative_files = True
source = csp-lmc-mid
#data_file = csp-lmc-mid_coverage
#debug = dataio,dataop
[tool:pytest]
testpaths = tests
log_cli = True
log_cli_level = INFO
log_file = pytest-logs.txt
log_file_level = INFO
addopts = --forked
--verbose
--cov=csp_lmc_mid
--json-report
--json-report-file=htmlcov/report.json
--cov-report=term
--cov-report=html
--cov-report=xml
--junitxml=/build/reports/csp-lmc-mid-unit-tests.xml
console_output_style = progress
junit_family=legacy
filterwarnings =
ignore::DeprecationWarning
#[coverage:report]
#show_missing = True
# Define `python setup.py build_sphinx`
[build_sphinx]
source-dir = docs/src
build-dir = docs/build
all_files = 1
builder = html
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/setup.py 0000664 0000000 0000000 00000003763 13707315520 0023522 0 ustar 00root root 0000000 0000000 #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of the CSP.LMC project
#
# Distributed under the terms of the BSD-3-Clause license.
# See LICENSE.txt for more info.
import os
import sys
from setuptools import setup, find_packages
setup_dir = os.path.dirname(os.path.abspath(__file__))
# make sure we use latest info from local code
sys.path.insert(0, setup_dir)
INFO = {}
with open("README.md") as file:
long_description = file.read()
RELEASE_FILENAME = os.path.join(setup_dir, 'csp_lmc_mid','release.py')
exec(open(RELEASE_FILENAME).read(), INFO)
setup(
name=INFO['name'],
version=INFO['version'],
description=INFO['description'],
author=INFO['author'],
author_email=INFO['author_email'],
packages=find_packages(),
license=INFO['license'],
url=INFO['url'],
long_description=long_description,
keywords="csp lmc ska tango",
platforms="All Platforms",
include_package_data=True,
install_requires = [
'pytango >=9.3.1',
'future',
'csp-lmc-common>0.6.3'
],
setup_requires=[
'pytest-runner',
'sphinx',
'recommonmark'
],
test_suite="tests",
entry_points={'console_scripts':['MidCspMaster = MidCspMaster:main']},
classifiers=[
"Development Status :: 3 - Alpha",
"Programming Language :: Python :: 3",
"Operating System :: POSIX :: Linux",
"Intended Audience :: Developers",
"License :: Other/Proprietary License",
"Topic::Scientific/Enineering :: Astronomy",
],
tests_require=[
'pytest',
'pytest-cov',
'pytest-json-report',
'pycodestyle',
'assertpy',
'pytest-forked',
'mock',
'mid-csp-lmc'
],
extras_require={
'dev': ['prospector[with_pyroma]', 'yapf', 'isort']
})
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/tests/ 0000775 0000000 0000000 00000000000 13707315520 0023141 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/tests/MidCspMaster_test.py 0000664 0000000 0000000 00000012600 13707315520 0027104 0 ustar 00root root 0000000 0000000 #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of the csp-lmc-prototype project
#
#
#
# Distributed under the terms of the BSD-3-Clause license.
# See LICENSE.txt for more info.
"""Contain the tests for the CspMaster."""
# Standard imports
import sys
import os
import time
import logging
import numpy as np
# Tango imports
import tango
from tango import DevState
#from tango.test_context import DeviceTestContext
import pytest
# Path
file_path = os.path.dirname(os.path.abspath(__file__))
# insert base package directory to import global_enum
# module in commons folder
commons_pkg_path = os.path.abspath(os.path.join(file_path, "./csp-lmc-mid"))
sys.path.insert(0, commons_pkg_path)
path = os.path.join(os.path.dirname(__file__), os.pardir)
sys.path.insert(0, os.path.abspath(path))
print(commons_pkg_path)
#Local imports
from ska.base.control_model import AdminMode
LOGGER = logging.getLogger(__name__)
# Device test case
@pytest.mark.usefixtures("cbf_master", "midcsp_master", "cbf_subarray01", "midcsp_subarray01", "midcsp_subarray02")
class TestCspMaster(object):
def test_State(self, midcsp_master, cbf_master):
"""Test for State after initialization """
# reinitalize Csp Master and CbfMaster devices
cbf_master.Init()
time.sleep(2)
midcsp_master.Init()
time.sleep(2)
csp_state = midcsp_master.state()
assert csp_state in [DevState.STANDBY, DevState.INIT, DevState.DISABLE]
def test_adminMode(self, midcsp_master):
""" Test the adminMode attribute w/r"""
midcsp_master.adminMode = AdminMode.OFFLINE
time.sleep(3)
assert midcsp_master.adminMode == AdminMode.OFFLINE
assert midcsp_master.cspCbfAdminMode == AdminMode.OFFLINE
midcsp_master.adminMode = AdminMode.ONLINE
time.sleep(3)
assert midcsp_master.adminMode == AdminMode.ONLINE
assert midcsp_master.cspCbfAdminMode == AdminMode.ONLINE
def test_properties(self, midcsp_master):
""" Test the device property MaxCapability"""
capability_list = ['FSP:27', 'VCC:4','SearchBeams:1500', 'TimingBeams:16', 'VlbiBeams:20']
capability_list.sort()
#Oss: maxCapability returns a tuple
assert midcsp_master.maxCapabilities == tuple(capability_list)
def test_forwarded_attributes(self, midcsp_master, cbf_master):
""" Test the reportVCCState forwarded attribute"""
vcc_state = midcsp_master.reportVCCState
vcc_state_cbf = cbf_master.reportVCCState
assert np.array_equal(vcc_state, vcc_state_cbf)
def test_receptors_unassiged_ids(self, midcsp_master):
""" Test the reading of availableReceptorIDs attribute """
list_of_receptors = midcsp_master.unassignedReceptorIDs
LOGGER.info("list of receptors:".format(list_of_receptors))
assert any(list_of_receptors)
def test_read_capabilities_addresses(self, midcsp_master):
""" Test the reading of availableCapabilities attribute """
vcc_addresses = midcsp_master.vccCapabilitiesAddresses
assert vcc_addresses
searchbeams_addresses = midcsp_master.searchBeamsAddresses
assert searchbeams_addresses
timingbeams_addresses = midcsp_master.timingBeamsAddresses
assert timingbeams_addresses
vlbi_addresses = midcsp_master.vlbiBeamsAddresses
assert vlbi_addresses
def test_available_capabilities(self, midcsp_master, ):
""" Test the reading of availableCapabilities attribute """
available_cap = midcsp_master.availableCapabilities
assert available_cap
def test_On_valid_state(self, midcsp_master, cbf_master, midcsp_subarray01, midcsp_subarray02):
"""
Test for execution of On command when the CbfMaster is in the right state
"""
#reinit CSP and CBF master devices
cbf_master.Init()
time.sleep(2)
# sleep for a while to wait state transition
# check CspMaster state
midcsp_master.Init()
assert midcsp_master.State() == DevState.STANDBY
# issue the "On" command on CbfMaster device
argin = ["mid_csp_cbf/sub_elt/master",]
midcsp_master.On(argin)
time.sleep(3)
LOGGER.info(" midcsp_subarray01.state:{}".format( midcsp_subarray01.state()))
LOGGER.info(" midcsp_subarray02.state:{}".format( midcsp_subarray02.state()))
assert midcsp_master.state() == DevState.ON
assert midcsp_subarray01.state() == DevState.ON
assert midcsp_subarray02.state() == DevState.ON
def test_Standby_valid_state(self, midcsp_master, midcsp_subarray01, midcsp_subarray02):
"""
Test for execution of On command when the CbfTestMaster is in the right state
"""
assert midcsp_master.State() == DevState.ON
# issue the "Standby" command on CbfMaster device
argin = ["mid_csp_cbf/sub_elt/master",]
midcsp_master.Standby(argin)
time.sleep(3)
assert midcsp_master.state() == DevState.STANDBY
assert midcsp_subarray01.state() == DevState.OFF
assert midcsp_subarray02.state() == DevState.OFF
def test_reinit_midcsp_master(self, midcsp_master, cbf_master):
""" Test CspMaster reinitialization """
#reinit CSP and CBFTest master devices
cbf_master.Init()
time.sleep(2)
midcsp_master.Init()
time.sleep(2)
assert midcsp_master.State() == DevState.STANDBY
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/tests/MidCspSubarray_test.py 0000775 0000000 0000000 00000061710 13707315520 0027452 0 ustar 00root root 0000000 0000000 #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of the csp-lmc-prototype project
#
#
#
# Distributed under the terms of the BSD-3-Clause license.
# See LICENSE.txt for more info.
"""Contain the tests for the CspSubarray."""
# Standard imports
import sys
import os
import time
import random
import numpy as np
import logging
import unittest
import pytest
# Tango imports
import tango
from tango import DevState
from assertpy import assert_that
# Path
file_path = os.path.dirname(os.path.abspath(__file__))
# insert base package directory to import global_enum
# module in commons folder
print(file_path)
data_pkg_path = os.path.abspath(os.path.join(file_path, "./tests"))
sys.path.insert(0, data_pkg_path)
path = os.path.join(os.path.dirname(__file__), os.pardir)
sys.path.insert(0, os.path.abspath(path))
#Local imports
from ska.base.control_model import ObsState
from acceptance_tests.utils import Probe, Poller
LOGGER = logging.getLogger(__name__)
# Device test case
@pytest.mark.usefixtures("midcsp_master", "midcsp_subarray01", "midcsp_subarray02", "cbf_subarray01")
# Device test case
@pytest.mark.usefixtures("midcsp_master", "midcsp_subarray01", "cbf_subarray01")
class TestBase(unittest.TestCase):
fixture_names = ()
@pytest.fixture(autouse=True)
def auto_injector_fixture(self, request):
names = self.fixture_names
for name in names:
setattr(self, name, request.getfixturevalue(name))
class TestCspSubarray(TestBase):
fixture_names = ("midcsp_master", "midcsp_subarray01", "cbf_subarray01")
def _setup_subarray(self):
"""
Set the subarray state to ON-EMPTY
"""
master_state = self.midcsp_master.State()
if master_state == DevState.STANDBY:
self.midcsp_master.On("")
prober_subarray_state = Probe(self.midcsp_subarray01, "State", DevState.OFF, f"CSP Master not ON")
Poller(4, 0.2).check(prober_subarray_state)
subarray_state = self.midcsp_subarray01.State()
if subarray_state == DevState.OFF:
self.midcsp_subarray01.On()
prober_subarray_state = Probe(self.midcsp_subarray01, "State", DevState.ON, f"CSP Master not ON")
Poller(4, 0.2).check(prober_subarray_state)
subarray_state = self.midcsp_subarray01.State()
obs_state = self.midcsp_subarray01.obsState
if subarray_state == DevState.ON:
if obs_state == ObsState.FAULT:
self.midcsp_subarray01.ObsReset()
prober_obs_state = Probe(self.midcsp_subarray01, "obsState", ObsState.IDLE, f"CSP Subarray not IDLE")
Poller(4, 0.2).check(prober_obs_state)
obs_state = self.midcsp_subarray01.obsState
if obs_state == ObsState.EMPTY:
return
if obs_state == ObsState.READY:
self._goto_idle()
obs_state = self.midcsp_subarray01.obsState
if obs_state == ObsState.IDLE:
self._release_all_receptors()
def _setup_subarray_off(self):
subarray_state = self.midcsp_subarray01.State()
if subarray_state == DevState.OFF:
return
if subarray_state == DevState.ON:
obs_state = self.midcsp_subarray01.obsState
if obs_state == ObsState.READY:
self._goto_idle()
obs_state = self.midcsp_subarray01.obsState
if obs_state == ObsState.IDLE:
self._release_all_receptors()
subarray_state = self.midcsp_subarray01.State()
obs_state = self.midcsp_subarray01.obsState
self.midcsp_subarray01.Off()
prober_subarray_state = Probe(self.midcsp_subarray01, "State", DevState.OFF, f"CSP Master not ON")
Poller(4, 0.2).check(prober_subarray_state)
def _assign_receptors(self):
"""
Assign all available receptors to the subarray.
The final subarray state is ON-IDLE
"""
receptor_list = self.midcsp_master.unassignedReceptorIDs
# assert the array is not empty
assert receptor_list.any()
# assign all available receptors to the subarray
state = self.midcsp_subarray01.State()
obs_state = self.midcsp_subarray01.obsState
self.midcsp_subarray01.AddReceptors(receptor_list.tolist())
# wait for the transition to IDLE
prober_obs_state = Probe(self.midcsp_subarray01, 'obsState', ObsState.RESOURCING,
f"Wrong CSP Subarray obsState is not RESOURCING")
Poller(10, 0.2).check(prober_obs_state)
prober_obs_state = Probe(self.midcsp_subarray01, 'obsState', ObsState.IDLE,
f"Wrong CSP Subarray obsState is not IDLE")
Poller(10, 0.2).check(prober_obs_state)
receptors = self.midcsp_subarray01.assignedReceptors
assert len(receptors) > 1
def _release_all_receptors(self):
"""
Remove all the receptors from the subarray.
The final subarray state is ON-EMPTY
"""
obs_state = self.midcsp_subarray01.obsState
assert obs_state == ObsState.IDLE
try:
self.midcsp_subarray01.RemoveAllReceptors()
except Exception as e:
LOGGER.info(str(e))
# wait for the transition to EMPTY
prober_obs_state = Probe(self.midcsp_subarray01, "obsState", ObsState.EMPTY, f"CSP Subarray is not EMPTY")
Poller(4, 0.2).check(prober_obs_state)
# Note: here we sleep for a while to let the system update the vccMemebership attribute. This has to
# configured to push event fro the device (not with polling)
#time.sleep(0.2)
receptor_list = self.midcsp_master.unassignedReceptorIDs
#if self.midcsp_subarray01.State() == DevState.OFF:
# self.midcsp_subarray01.On()
def _goto_idle(self):
"""
"""
obs_state = self.midcsp_subarray01.obsState
assert obs_state == ObsState.READY
self.midcsp_subarray01.GoToIdle()
# wait for the transition to IDLE
prober_obs_state = Probe(self.midcsp_subarray01, "obsState", ObsState.IDLE, f"CSP Subarray is not IDLE")
Poller(4, 0.2).check(prober_obs_state)
def _configure_scan(self):
self._setup_subarray()
self._assign_receptors()
f = open(file_path + "/acceptance_tests/test_ConfigureScan_ADR4.json")
(result_code, msg) = self.midcsp_subarray01.Configure(f.read().replace("\n", ""))
f.close()
prober_subarray_obstate = Probe(self.midcsp_subarray01, 'obsState', ObsState.READY,
f"Wrong CSP Subarray obsState {self.midcsp_subarray01.obsState}")
Poller(5, 0.2).check(prober_subarray_obstate)
def test_AFTER_initialization(self):
"""
Test for State after CSP startup.
The CspSubarray State at start is OFF.
"""
state = self.midcsp_subarray01.State()
LOGGER.info("subarray state:{}".format(state))
prober_subarray_state = Probe(self.midcsp_subarray01, "State", DevState.OFF, f"CSP Subarray not OFF")
Poller(4, 0.2).check(prober_subarray_state)
prober_subarray_obsstate = Probe(self.midcsp_subarray01, "obsState", ObsState.EMPTY, f"CSP Subarray not EMPTY")
Poller(4, 0.2).check(prober_subarray_obsstate)
def test_subarray_state_AFTER_on_command_execution(self):
"""
Test for State after CSP startup.
The CspSubarray State at start is OFF.
"""
self._setup_subarray_off()
subarray_state = self.midcsp_subarray01.State()
obs_state = self.midcsp_subarray01.obsState
#time.sleep(1)
LOGGER.debug("CSPSubarray state before test:{}-{}".format(subarray_state, obs_state))
subarray_state = self.midcsp_subarray01.State()
self.midcsp_subarray01.On()
prober_subarray_state = Probe(self.midcsp_subarray01, "State", DevState.ON, f"CSP Subarray not OFF")
Poller(4, 0.2).check(prober_subarray_state)
def test_add_receptors_WITH_invalid_id(self):
"""
Test the assignment of a number of invalid receptor IDs to
a CspSubarray.
The AddReceptors method fails raising a tango.DevFailed exception.
"""
self._setup_subarray()
receptors_list = self.midcsp_master.unassignedReceptorIDs
# receptor_list is a numpy array
# all(): test whether all array elements evaluate to True.
assert receptors_list.all(), f"No available receptors to add to the subarray"
invalid_receptor_to_assign = []
# try to add 3 invalid receptors
for id_num in range(190, 198):
if id_num not in receptors_list:
invalid_receptor_to_assign.append(id_num)
if len(invalid_receptor_to_assign) > 3:
break
self.midcsp_subarray01.AddReceptors(invalid_receptor_to_assign)
prober_obs_state = Probe(self.midcsp_subarray01, "obsState", ObsState.EMPTY, f"CSP Subarray is not EMPTY")
Poller(4, 0.2).check(prober_obs_state)
receptors = self.midcsp_subarray01.assignedReceptors
# receptors is a numpy array. In this test the returned array has to be
# empty (no receptor assigned)
#
# Note:
# any returns True if any value is True. Otherwise False
# all returns True if no value is False. Otherwise True
# In the case of np.array([]).any() or any([]), there are no True values, because you have
# a 0-dimensional array or a 0-length list. Therefore, the result is False.
# In the case of np.array([]).all() or all([]), there are no False values, because you have
# a 0-dimensional array or a 0-length list. Therefore, the result is True.
assert not receptors.any(), f"CSP Subarray is not empty"
def test_add_receptors_WITH_valid_id(self):
"""
Test the assignment of valid receptors to a CspSubarray
"""
# Setup the system in ON-EMPTY state
self._setup_subarray()
# get the list of available receptorIDs (the read operation
# returns a numpy array)
receptor_list = self.midcsp_master.unassignedReceptorIDs
# assert the array is not empty
assert receptor_list.any()
# Exercise the system: issue the AddREceptors command
self.midcsp_subarray01.AddReceptors(receptor_list)
# check the final subarray obstate
prober_obs_state = Probe(self.midcsp_subarray01, 'obsState', ObsState.IDLE,
f"Wrong CSP Subarray obsState")
Poller(10, 0.2).check(prober_obs_state)
# read the list of assigned receptors
receptors = self.midcsp_subarray01.assignedReceptors
assert set(receptor_list) == set(receptors)
def test_add_receptors_ALREADY_belonging_to_subarray(self):
"""
Test the assignment of already assigned receptors to a CspSubarray
"""
# Setup the system
self._setup_subarray()
self._assign_receptors()
# get the list of receptors belonging to the subarray
assigned_receptors = self.midcsp_subarray01.assignedReceptors
LOGGER.info(f"receptors belonging to subarray:{assigned_receptors}")
# Exercise: try to re-assign one of the subarray receptors
LOGGER.info(f"Try to assign receptor:{assigned_receptors[0]}")
self.midcsp_subarray01.AddReceptors([assigned_receptors[0],])
# check
prober_obs_state = Probe(self.midcsp_subarray01, 'obsState', ObsState.IDLE,
f"Wrong CSP Subarray obsState")
Poller(10, 0.2).check(prober_obs_state)
receptors = self.midcsp_subarray01.assignedReceptors
# check the array read first and the array read last are equal
assert np.array_equal(receptors, assigned_receptors)
def test_subarray_state_AFTER_receptors_assignment(self):
"""
Test the CspSubarray State after receptors assignment.
After assignment State is ON
"""
# read the list of assigned receptors and check it's not
# empty
self._setup_subarray()
subarray_state = self.midcsp_subarray01.State()
obs_state = self.midcsp_subarray01.obsState
LOGGER.debug("CSPSubarray state before test:{}-{}".format(subarray_state, obs_state))
self._assign_receptors()
assigned_receptors = self.midcsp_subarray01.assignedReceptors
prober_obs_state = Probe(self.midcsp_subarray01, 'obsState', ObsState.IDLE,
f"Wrong CSP Subarray obsState")
Poller(10, 0.2).check(prober_obs_state)
def test_partial_remove_of_receptors_FROM_the_subarray(self):
"""
Test the partial deallocation of receptors from a
CspSubarray.
"""
# Setup the system
self._setup_subarray()
self._assign_receptors()
obs_state = self.midcsp_subarray01.obsState
state = self.midcsp_subarray01.State()
LOGGER.info("CSP Subarray State before exercise :{}-{}".format(state, ObsState(obs_state).name))
assigned_receptors = self.midcsp_subarray01.assignedReceptors
init_number_of_receptors = len(assigned_receptors)
i = random.randrange(1, 4, 1)
receptor_to_remove = []
receptor_to_remove.append(i)
# Exercise the system: remove only one receptor (with a random ID)
LOGGER.info(f"Remove one receptor from CSP subarray01")
self.midcsp_subarray01.RemoveReceptors(receptor_to_remove)
# check
prober_obs_state = Probe(self.midcsp_subarray01, 'obsState', ObsState.IDLE,
f"Wrong CSP Subarray obsState")
Poller(10, 0.1).check(prober_obs_state)
assigned_receptors = self.midcsp_subarray01.assignedReceptors
final_number_of_receptors = len(assigned_receptors)
assert (init_number_of_receptors - final_number_of_receptors) == 1
def test_remove_all_receptors_FROM_subarray(self):
"""
Test the complete deallocation of receptors from a
CspSubarray.
Final CspSubarray state is OFF
"""
self._setup_subarray()
self._assign_receptors()
obs_state = self.midcsp_subarray01.obsState
state = self.midcsp_subarray01.State()
LOGGER.info("CSP Subarray State before exercise :{}-{}".format(state, ObsState(obs_state).name))
# read the list of assigned receptors and check it's not
# empty
assigned_receptors = self.midcsp_subarray01.assignedReceptors
assert assigned_receptors.any()
LOGGER.info(f"Remove all receptors from CSP subarray01")
self.midcsp_subarray01.RemoveAllReceptors()
prober_obs_state = Probe(self.midcsp_subarray01, 'obsState', ObsState.EMPTY,
f"Wrong CSP Subarray obsState")
Poller(10, 0.2).check(prober_obs_state)
assigned_receptors = self.midcsp_subarray01.assignedReceptors
# check the array is empty (any() in this case returns False)
assert not assigned_receptors.any()
def test_configure_WHEN_subarray_is_in_wrong_state(self):
"""
Test that the Configure() command fails if the Subarray
state is not ON
"""
self._setup_subarray()
obs_state = self.midcsp_subarray01.obsState
state = self.midcsp_subarray01.State()
LOGGER.info("CSP Subarray State before exercise :{}-{}".format(state, ObsState(obs_state).name))
filename = os.path.join(data_pkg_path, "test_ConfigureScan_basic.json")
f = open(file_path + "/test_ConfigureScan_basic.json")
LOGGER.info(f"Configuring CSP subarray01")
with pytest.raises(tango.DevFailed) as df:
self.midcsp_subarray01.Configure(f.read().replace("\n", ""))
if df:
err_msg = str(df.value.args[0].desc)
LOGGER.error(err_msg)
obs_state = self.midcsp_subarray01.obsState
assert obs_state == ObsState.EMPTY, f"CSP Subarray obsState is not EMPTY"
def test_configure_WHITH_wrong_configuration(self):
"""
Test that the Configure() command fails if the Subarray
state is not ON
"""
self._setup_subarray()
self._assign_receptors()
obs_state = self.midcsp_subarray01.obsState
state = self.midcsp_subarray01.State()
LOGGER.info("CSP Subarray State before exercise :{}-{}".format(state, ObsState(obs_state).name))
f = open(file_path + "/acceptance_tests/test_ConfigureScan_without_configID.json")
LOGGER.info(f"Configuring CSP subarray01")
self.midcsp_subarray01.Configure(f.read().replace("\n", ""))
# check
obs_state = self.midcsp_subarray01.obsState
assert_that(obs_state).described_as("CSP Subarray obsState has wrong value ({obs_state}").is_equal_to(ObsState.FAULT)
def test_send_configure_to_cbf_and_json_stored(self):
"""
Configure the CSP Subarray with a JSon string including
the new ADR4 fields.
"""
self._setup_subarray()
self._assign_receptors()
state = self.midcsp_subarray01.State()
obs_state = self.midcsp_subarray01.obsState
LOGGER.info("CSP Subarray State before exercise :{}-{}".format(state, ObsState(obs_state).name))
# exercise the device
LOGGER.info(f"Configuring CSP subarray01")
f = open(file_path + "/acceptance_tests/test_ConfigureScan_ADR4.json")
(result_code, msg) = self.midcsp_subarray01.Configure(f.read().replace("\n", ""))
f.close()
# check
prober_subarray_obstate = Probe(self.midcsp_subarray01, 'obsState', ObsState.READY,
f"Wrong CSP Subarray obsState {self.midcsp_subarray01.obsState}")
Poller(5, 0.2).check(prober_subarray_obstate)
obs_state = self.midcsp_subarray01.obsState
#json_dict = json.loads(configuration_string)
#configID = json_dict["id"]
#stored_id = self.midcsp_subarray01.configurationID
#assert stored_id == configID
def test_start_end_scan(self):
"""
Test that a subarray is able to process the
Scan command when its ObsState is READY
"""
self._configure_scan()
state = self.midcsp_subarray01.State()
obs_state = self.midcsp_subarray01.obsState
LOGGER.info("CSP Subarray State before exercise :{}-{}".format(state, ObsState(obs_state).name))
LOGGER.info("Issue the Scan command")
self.midcsp_subarray01.Scan("11")
prober_obs_state = Probe(self.midcsp_subarray01, 'obsState', ObsState.SCANNING,
f"Wrong CSP Subarray obsState")
Poller(10, 0.2).check(prober_obs_state)
obs_state = self.midcsp_subarray01.obsState
LOGGER.info("Issue the EndScan command")
self.midcsp_subarray01.EndScan()
time.sleep(1)
prober_obs_state = Probe(self.midcsp_subarray01, 'obsState', ObsState.READY,
f"Wrong CSP Subarray obsState")
Poller(10, 0.2).check(prober_obs_state)
obs_state = self.midcsp_subarray01.obsState
def test_obsreset_cbf_AFTER_invalid_configuration(self):
"""
CSP Subarray sends an invalid json configuration to
CBF Subarray.
"""
# setup the test: Subarray DISABLE-IDLE
self._setup_subarray()
self._assign_receptors()
f = open(file_path + "/acceptance_tests/test_ConfigureScan_invalid_cbf_json.json")
# print the subarray stat/obsState
init_state = self.midcsp_subarray01.State()
obs_state = self.midcsp_subarray01.obsState
LOGGER.info("CSP Subarray State before exercise :{}-{}".format(init_state, ObsState(obs_state).name))
# exercise the device
LOGGER.info(f"Configuring CSP subarray01")
self.midcsp_subarray01.Configure(f.read().replace("\n", ""))
# check
# Subarray final ObsState IDLE
prober_subarray_flag = Probe(self.midcsp_subarray01, 'failureRaisedFlag', True, f"Failure flag is false")
Poller(7, 0.2).check(prober_subarray_flag)
obs_state = self.midcsp_subarray01.obsState
end_state = self.midcsp_subarray01.State()
assert obs_state == ObsState.FAULT, f"Current ObsState should be FAULT"
self.midcsp_subarray01.ObsReset()
prober_obs_state = Probe(self.midcsp_subarray01, "obsState", ObsState.IDLE, f"CSP Subarray not IDLE")
Poller(4, 0.2).check(prober_obs_state)
'''
def test_configureScan_with_subarray_ready(self, midcsp_subarray01, midcsp_master):
"""
Test that the Configure() command is issued when the Subarray
state already READY
"""
obs_state = midcsp_subarray01.obsState
assert obs_state == ObsState.READY
f = open(file_path +"/test_ConfigureScan_basic.json")
obs_state = midcsp_subarray01.obsState
try:
midcsp_subarray01.Configure(f.read().replace("\n", ""))
except tango.DevFailed as tango_err:
print("configure error:", tango_err.args[0].desc)
obs_state = midcsp_subarray01.obsState
f.close()
time.sleep(5)
obs_state = midcsp_subarray01.obsState
assert obs_state == ObsState.READY
def test_remove_receptors_when_ready(self, midcsp_subarray01):
"""
Test that the complete deallocation of receptors fails
when the CspSubarray ObsMode is READY.
Receptors can be removed only when the subarray
ObsState is IDLE!
"""
obs_state = midcsp_subarray01.obsState
assert obs_state == ObsState.READY
with pytest.raises(tango.DevFailed) as df:
midcsp_subarray01.RemoveAllReceptors()
if df:
err_msg = str(df.value.args[0].desc)
assert "RemoveAllReceptors command can't be issued when the obsState is READY" in err_msg
def test_remove_receptors_when_idle(self, midcsp_subarray01):
"""
Test the complete deallocation of receptors from a
CspSubarray when the subarray is IDLE.
"""
obs_state = midcsp_subarray01.obsState
assert obs_state == ObsState.READY
# command transition to IDLE
midcsp_subarray01.GoToIdle()
time.sleep(3)
obs_state = midcsp_subarray01.obsState
assert obs_state == ObsState.IDLE
midcsp_subarray01.RemoveAllReceptors()
time.sleep(3)
subarray_state = midcsp_subarray01.state()
assert subarray_state == tango.DevState.OFF
assert obs_state == ObsState.IDLE
def test_two_subarrays_configureScan(self, midcsp_subarray01, midcsp_subarray02, midcsp_master, tm1_telstate_proxy):
"""
Test that the Configure() command is issued when the Subarray
state is ON and ObsState is IDLE or READY
"""
midcsp_subarray01.Init()
time.sleep(5)
# reinitialize TmTelState simulator to have success
# in configurin the subarray_01
tm1_telstate_proxy.Init()
obs_state1 = midcsp_subarray01.obsState
obs_state2 = midcsp_subarray02.obsState
assert ((obs_state1 == 0) and (obs_state2 == 0))
receptor_membership = midcsp_master.receptorMembership
receptor_list = midcsp_master.unassignedReceptorIDs
midcsp_subarray01.AddReceptors([1,4])
midcsp_subarray02.AddReceptors([2,3])
time.sleep(2)
start_time = time.time()
timeout = False
while True:
sub1_state = midcsp_subarray01.state()
sub2_state = midcsp_subarray02.state()
if ((sub1_state == tango.DevState.ON) and (sub2_state == tango.DevState.ON)):
break
else:
time.sleep(0.2)
elapsed_time = time.time() - start_time
if elapsed_time > 3:
timeout = True
break
assert not timeout
obs_state1 = midcsp_subarray01.obsState
obs_state2 = midcsp_subarray02.obsState
file_path = os.path.dirname(os.path.abspath(__file__))
f1 = open(file_path + "/configScan_sub1.json")
f2 = open(file_path + "/configScan_sub2.json")
midcsp_subarray01.Configure(f1.read().replace("\n", ""))
time.sleep(2)
midcsp_subarray02.Configure(f2.read().replace("\n", ""))
f1.close()
f2.close()
start_time = time.time()
while True:
obs_state1 = midcsp_subarray01.obsState
obs_state2 = midcsp_subarray02.obsState
if ((obs_state1 == 2) and (obs_state2 == 2)):
break
else:
time.sleep(0.2)
elapsed_time = time.time() - start_time
# use the default value for the configureDelayExpected
# need to do some work on setting this value
if elapsed_time > 10:
break
assert ((obs_state2 == 2) and (obs_state1 == 2))
time.sleep(1)
assert not midcsp_subarray01.timeoutExpiredFlag
midcsp_subarray01.GoToIdle()
midcsp_subarray02.GoToIdle()
time.sleep(3)
'''
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/tests/acceptance_tests/ 0000775 0000000 0000000 00000000000 13707315520 0026451 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/tests/acceptance_tests/Makefile 0000664 0000000 0000000 00000001030 13707315520 0030103 0 ustar 00root root 0000000 0000000 # Use bash shell with pipefail option enabled so that the return status of a
# piped command is the value of the last (rightmost) commnand to exit with a
# non-zero status. This lets us pipe output into tee but still exit on test
# failures.
SHELL = /bin/bash
.SHELLFLAGS = -o pipefail -c
all: test
test: install
mkdir -p /build/reports && \
pytest --no-cov --disable-pytest-warnings MidCspSubarrayConfiguration_test.py| tee out-stdout; \
status=$$?; \
exit $$status
install:
pip3 install -r test_requirements.txt
.PHONY: test
MidCspSubarrayConfiguration_test.py 0000664 0000000 0000000 00000043573 13707315520 0035437 0 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/tests/acceptance_tests """Tests for ADR-4 and ADR-10 implementation into CSP.LMC Subarray."""
# Standard imports
import sys
import os
import time
import logging
import pytest
import unittest
from pytest import fail
# Tango imports
import tango
from tango import DevState, EventType
# Local imports
import json
from ska.base.control_model import ObsState
from utils import Poller, Probe
from assertpy import assert_that
file_path = os.path.dirname(os.path.abspath(__file__))
LOGGER = logging.getLogger(__name__)
def prepare_configuration_string(filename="test_ConfigureScan_ADR4.json"):
"""Create the config string for CSP-CBF"""
try:
file_to_load = filename
file_path = os.path.dirname(os.path.abspath(__file__))
LOGGER.info(f" Reading configuration from {file_to_load}")
json_file = open(file_path + "/" + file_to_load)
configuration_string = json_file.read().replace("\n", "")
return configuration_string
except Exception as e:
LOGGER.warning(f"Unable to locate file {filename}")
# Device test case
@pytest.mark.usefixtures("midcsp_master", "midcsp_subarray01", "cbf_subarray01")
class TestBase(unittest.TestCase):
fixture_names = ()
@pytest.fixture(autouse=True)
def auto_injector_fixture(self, request):
names = self.fixture_names
for name in names:
setattr(self, name, request.getfixturevalue(name))
class TestCspSubarrayConfiguration(TestBase):
fixture_names = ("midcsp_master", "midcsp_subarray01", "cbf_subarray01")
def __set_csp_subarray_to_on(self):
"""
Set the CSP Subarray to ON state.
"""
# read from the CSP Master the list of available receptors
unassigned_receptors = self.midcsp_master.unassignedReceptorIDs
# assign the first one to the CSP subarray to force
# the transition to ON
receptor_to_add = unassigned_receptors[0]
LOGGER.debug("Set CSP Subarray adding receptor:{}".format(receptor_to_add))
self.midcsp_subarray01.AddReceptors([receptor_to_add, ])
prober_cmd_in_progress = Probe(self.midcsp_subarray01, 'isCmdInProgress', False,
f"Wrong value for command in progress")
Poller(10, 0.2).check(prober_cmd_in_progress)
prober_subarray_state = Probe(self.midcsp_subarray01, 'state', DevState.ON,
f"Wrong CspSubarray state")
Poller(10, 0.2).check(prober_subarray_state)
state = self.midcsp_subarray01.State()
assert state == DevState.ON
def _set_cspsubarray_to_idle_state(self):
obs_state = self.midcsp_subarray01.obsState
if obs_state == ObsState.READY:
self.midcsp_subarray01.GoToIdle()
prober_obs_state = Probe(self.midcsp_subarray01, 'obsState', ObsState.IDLE, f"CSP Subarray not IDLE")
Poller(7, 0.2).check(prober_obs_state)
def _reset_subarray_to_disable_state(self):
try:
state = self.midcsp_subarray01.State()
LOGGER.debug("CSP Subarray initial State:{}".format(state))
if state == DevState.DISABLE:
return
if state == DevState.ON:
self._set_cspsubarray_to_idle_state()
LOGGER.debug("Remove all receptors")
self.midcsp_subarray01.RemoveAllReceptors()
# wait for the transition of the CSP sub-array to OFF
prober_subarray_state = Probe(self.midcsp_subarray01, 'state', DevState.OFF,
f"Wrong CSP Subarray state")
Poller(7, 0.2).check(prober_subarray_state)
# Set the CSP subarray to OFF issuing the Standby command
# o CSP Master
state = self.midcsp_subarray01.State()
if state == DevState.OFF:
LOGGER.debug("CSP Subarray State is OFF...going to execute Standby")
# wait until Master is ON
prober_master_state = Probe(self.midcsp_master, 'state', DevState.ON, f"Wrong CSP Master state")
Poller(7, 0.2).check(prober_master_state)
self.midcsp_master.Standby("")
prober_subarray_state = Probe(self.midcsp_subarray01, 'state', DevState.DISABLE,
f"Wrong CSP Subarray state")
Poller(5, 0.2).check(prober_subarray_state)
prober_master_state = Probe(self.midcsp_master, 'state', DevState.STANDBY,
f"Wrong CSP Master state")
Poller(7, 0.2).check(prober_master_state)
return
except tango.DevFailed as tango_err:
LOGGER.warning(f"Unable to reset subarray to init state")
def _setup_csp_subarray(self):
"""
Set the CSP Subarray state to ON
"""
LOGGER.info("Setup subarray")
self._reset_subarray_to_disable_state()
# switch-on the CspMaster to force CSP Subarray
# transition to OFF
LOGGER.debug("Set CSP Subarray to OFF")
self.midcsp_master.On("")
# wait for the transition of the CSP subarray to OFF
prober_master_state = Probe(self.midcsp_master, 'state', DevState.ON, f"Wrong CSP Master state")
Poller(10, 0.2).check(prober_master_state)
# wait for the transition of the CSP subarray to OFF
prober_subarray_state = Probe(self.midcsp_subarray01, 'state', DevState.OFF, f"Wrong CSP Subarray state")
Poller(10, 0.2).check(prober_subarray_state)
state = self.midcsp_subarray01.State()
assert state in [DevState.OFF], "assuming that mid_csp_subarray_01 is OFF"
self.__set_csp_subarray_to_on()
state = self.midcsp_subarray01.State()
@pytest.mark.csp_k8s
def test_send_configure_to_cbf_and_json_stored(self):
"""
Configure the CSP Subarray with a JSon string including
the new ADR4 fields.
"""
self._setup_csp_subarray()
configuration_string = prepare_configuration_string()
state = self.midcsp_subarray01.State()
assert state == DevState.ON, "assume the CSP subarray State is ON"
# exercise the device
obs_state = self.midcsp_subarray01.obsState
LOGGER.info("CSP Subarray State before exercise :{}-{}".format(state, ObsState(obs_state).name))
LOGGER.debug(f"sending configure:{configuration_string}")
LOGGER.info(f"Configuring CSP subarray01")
self.midcsp_subarray01.Configure(configuration_string)
# check
prober_subarray_obstate = Probe(self.midcsp_subarray01, 'obsState', ObsState.READY,
f"Wrong CSP Subarray obsState {self.midcsp_subarray01.obsState}")
Poller(5, 0.2).check(prober_subarray_obstate)
stored_json = self.midcsp_subarray01.validScanConfiguration
assert stored_json == configuration_string
json_dict = json.loads(configuration_string)
configID = json_dict["id"]
stored_id = self.midcsp_subarray01.configurationID
assert stored_id == configID
@pytest.mark.csp_k8s
def test_configure_cspsubarray_WITH_json_missing_configId(self):
"""
Configure the CSP Subarray sending a json configuration script
without the configID entry.
"""
# setup the test
# Set the CSP Subarray to ON-IDLE state
self._setup_csp_subarray()
configuration_string = prepare_configuration_string("test_ConfigureScan_without_configID.json")
# exercise the device
state = self.midcsp_subarray01.State()
obs_state = self.midcsp_subarray01.obsState
LOGGER.info("CSP Subarray State before exercise :{}-{}".format(state, ObsState(obs_state).name))
LOGGER.info(f"Configuring CSP subarray01")
with pytest.raises(tango.DevFailed) as tango_err:
self.midcsp_subarray01.Configure(configuration_string)
if tango_err:
err_msg = str(tango_err.value.args[0].desc)
# TODO: aggiungere quale device fallisce
LOGGER.warning(f"Command configure failed on {self.midcsp_subarray01.dev_name()} with error: {err_msg}")
# check
obs_state = self.midcsp_subarray01.obsState
#assert obs_state == ObsState.IDLE, f"CSP Subarray obsState has wrong value ({obs_state})"
assert_that(obs_state).described_as("CSP Subarray obsState has wrong value ({obs_state}").is_equal_to(ObsState.IDLE)
@pytest.mark.csp_k8s
def test_configure_cspsubarray_WHEN_in_wrong_state(self):
"""
Set the CSP Subarray in a wrong state and issue the
Configure command on it.
"""
# setup the test: Subarray DISABLE-IDLE
self._setup_csp_subarray()
LOGGER.info("Force CSP Subarray to an invalid state to accept Configure")
self._reset_subarray_to_disable_state()
configuration_string = prepare_configuration_string()
init_state = self.midcsp_subarray01.State()
# exercise the device
state = self.midcsp_subarray01.State()
obs_state = self.midcsp_subarray01.obsState
LOGGER.info("CSP Subarray State before exercise :{}-{}".format(state, ObsState(obs_state).name))
LOGGER.info(f"Configuring CSP subarray01")
with pytest.raises(tango.DevFailed) as df:
self.midcsp_subarray01.Configure(configuration_string)
#assert_that(self.midcsp_subarray01.Configure).raises(tango.DevFailed).when_called_with(configuration_string)
if df:
err_msg = str(df.value.args[0].desc)
# TODO: aggiungere quale device fallisce
LOGGER.error(f"Command configure failed on {self.midcsp_subarray01.dev_name()} with error: {err_msg}")
# check
# Subarray final ObsState=IDLE
obs_state = self.midcsp_subarray01.obsState
end_state = self.midcsp_subarray01.State()
assert obs_state == ObsState.IDLE, f"Current ObsState should be IDLE"
assert end_state == init_state, f"Current State should be the initial one"
#assert_that(obs_state).described_by("Current ObsState should be IDLE").is_not_equal_to(ObsState.IDLE)
@pytest.mark.csp_k8s
def test_configure_cbf_WITHOUT_outputlink_information(self):
"""
CSP Subarray sends an invalid json configuration to
CBF Subarray.
"""
# setup the test: Subarray DISABLE-IDLE
self._setup_csp_subarray()
configuration_string = prepare_configuration_string("test_ConfigureScan_without_outputlink.json")
# print the subarray stat/obsState
init_state = self.midcsp_subarray01.State()
obs_state = self.midcsp_subarray01.obsState
LOGGER.info("CSP Subarray State before exercise :{}-{}".format(init_state, ObsState(obs_state).name))
# exercise the device
LOGGER.info(f"Configuring CSP subarray01")
self.midcsp_subarray01.Configure(configuration_string)
# check
# Subarray final ObsState IDLE
prober_subarray_flag = Probe(self.midcsp_subarray01, 'failureRaisedFlag', True, f"Failure flag is false")
Poller(7, 0.2).check(prober_subarray_flag)
obs_state = self.midcsp_subarray01.obsState
end_state = self.midcsp_subarray01.State()
assert obs_state == ObsState.IDLE, f"Current ObsState should be IDLE"
assert end_state == init_state, f"Current State should be the initial one"
@pytest.mark.csp_k8s
def test_configure_cbf_WITH_invalid_json(self):
"""
CSP Subarray sends an invalid json configuration to
CBF Subarray.
"""
# setup the test: Subarray DISABLE-IDLE
self._setup_csp_subarray()
configuration_string = prepare_configuration_string("test_ConfigureScan_invalid_cbf_json.json")
# print the subarray stat/obsState
init_state = self.midcsp_subarray01.State()
obs_state = self.midcsp_subarray01.obsState
LOGGER.info("CSP Subarray State before exercise :{}-{}".format(init_state, ObsState(obs_state).name))
# exercise the device
LOGGER.info(f"Configuring CSP subarray01")
self.midcsp_subarray01.Configure(configuration_string)
# check
# Subarray final ObsState IDLE
prober_subarray_flag = Probe(self.midcsp_subarray01, 'failureRaisedFlag', True, f"Failure flag is false")
Poller(7, 0.2).check(prober_subarray_flag)
obs_state = self.midcsp_subarray01.obsState
end_state = self.midcsp_subarray01.State()
assert obs_state == ObsState.IDLE, f"Current ObsState should be IDLE"
assert end_state == init_state, f"Current State should be the initial one"
@pytest.mark.csp_k8s
def test_cspsubarray_scan_WITH_invalid_string_id(self):
"""
CSP Subarray receives the Scan command with an invalid
scanId number
"""
# setup the test: Subarray DISABLE-IDLE
self._setup_csp_subarray()
configuration_string = prepare_configuration_string("test_ConfigureScan_ADR4.json")
LOGGER.info(f"Configuring CSP subarray01")
self.midcsp_subarray01.Configure(configuration_string)
prober_obs_state = Probe(self.midcsp_subarray01, 'obsState', ObsState.READY, f"CSP Subarray not configured")
Poller(7, 0.2).check(prober_obs_state)
LOGGER.info(f"Issue the Scan command sending the invalid string \"abcd\" as input")
# exercise the device
state = self.midcsp_subarray01.State()
obs_state = self.midcsp_subarray01.obsState
LOGGER.info("CSP Subarray State before exercise :{}-{}".format(state, ObsState(obs_state).name))
with pytest.raises(tango.DevFailed) as df:
self.midcsp_subarray01.Scan("abcd")
if df:
err_msg = str(df.value.args[0].desc)
LOGGER.error(f"Command Scan failed on {self.midcsp_subarray01.dev_name()} with error: {err_msg}")
# check
obs_state = self.midcsp_subarray01.obsState
assert obs_state == ObsState.READY
@pytest.mark.csp_k8s
def test_cspsubarray_scan_WITH_no_argument(self):
"""
CSP Subarray receives the Scan command with no
input argument
"""
# setup the test: Subarray DISABLE-IDLE
self._setup_csp_subarray()
configuration_string = prepare_configuration_string("test_ConfigureScan_ADR4.json")
LOGGER.info(f"Configuring CSP subarray01")
self.midcsp_subarray01.Configure(configuration_string)
prober_obs_state = Probe(self.midcsp_subarray01, 'obsState', ObsState.READY, f"CSP Subarray not configured")
Poller(7, 0.2).check(prober_obs_state)
LOGGER.info(f"Issue the Scan command with no input argument")
# exercise the device
state = self.midcsp_subarray01.State()
obs_state = self.midcsp_subarray01.obsState
LOGGER.info("CSP Subarray State before exercise :{}-{}".format(state, ObsState(obs_state).name))
with pytest.raises(tango.DevFailed) as df:
self.midcsp_subarray01.Scan()
if df:
err_msg = str(df.value.args[0].desc)
LOGGER.error(f"Command configure failed on {self.midcsp_subarray01.dev_name()} with error: {err_msg}")
# check
obs_state = self.midcsp_subarray01.obsState
assert obs_state == ObsState.READY
@pytest.mark.csp_k8s
def test_cspsubarray_scan_WITH_int_argument(self):
"""
CSP Subarray receives the Scan command with an invalid
argument data type
"""
# setup the test: Subarray DISABLE-IDLE
self._setup_csp_subarray()
configuration_string = prepare_configuration_string("test_ConfigureScan_ADR4.json")
LOGGER.info(f"Configuring CSP subarray01")
self.midcsp_subarray01.Configure(configuration_string)
prober_obs_state = Probe(self.midcsp_subarray01, 'obsState', ObsState.READY, f"CSP Subarray not configured")
Poller(7, 0.2).check(prober_obs_state)
LOGGER.info(f"Issue the Scan command sending an int as input")
# exercise the device
state = self.midcsp_subarray01.State()
obs_state = self.midcsp_subarray01.obsState
LOGGER.info("CSP Subarray State before exercise :{}-{}".format(state, ObsState(obs_state).name))
with pytest.raises(tango.DevFailed) as df:
self.midcsp_subarray01.Scan(1)
if df:
err_msg = str(df.value.args[0].desc)
LOGGER.error(f"Command Scan failed on {self.midcsp_subarray01.dev_name()} with error: {err_msg}")
# check
obs_state = self.midcsp_subarray01.obsState
assert obs_state == ObsState.READY
@pytest.mark.csp_k8s
def test_cspsubarray_scan_WITH_valid_scan_id(self):
"""
CSP Subarray receives the Scan command with a valid
input argument
"""
# setup the test: Subarray DISABLE-IDLE
self._setup_csp_subarray()
configuration_string = prepare_configuration_string("test_ConfigureScan_ADR4.json")
LOGGER.info(f"Configuring CSP subarray01")
self.midcsp_subarray01.Configure(configuration_string)
prober_obs_state = Probe(self.midcsp_subarray01, 'obsState', ObsState.READY, f"CSP Subarray not configured")
Poller(7, 0.2).check(prober_obs_state)
LOGGER.info(f"Issue the Scan command")
# exercise the device
state = self.midcsp_subarray01.State()
obs_state = self.midcsp_subarray01.obsState
LOGGER.info("CSP Subarray State before exercise :{}-{}".format(state, ObsState(obs_state).name))
scan_argin = "11"
self.midcsp_subarray01.Scan([scan_argin,])
# check
prober_obs_state = Probe(self.midcsp_subarray01, 'obsState', ObsState.SCANNING, f"CSP Subarray wrong obstate")
Poller(7, 0.2).check(prober_obs_state)
# end the scan
self.midcsp_subarray01.EndScan()
prober_obs_state = Probe(self.midcsp_subarray01, 'obsState', ObsState.READY, f"CSP Subarray wrong obstate")
Poller(7, 0.2).check(prober_obs_state)
assert int(scan_argin) == self.midcsp_subarray01.scanID
test_ConfigureScan_ADR4.json 0000664 0000000 0000000 00000003667 13707315520 0033640 0 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/tests/acceptance_tests {
"id": "sbi-mvp01-20200325-00002-science_A",
"frequencyBand": "1",
"delayModelSubscriptionPoint": "ska_mid/tm_leaf_node/csp_subarray_01/delayModel",
"fsp": [
{
"fspID": 1,
"functionMode": "CORR",
"frequencySliceID": 1,
"corrBandwidth": 0,
"integrationTime": 140,
"fspChannelOffset": 0,
"channelAveragingMap": [
[0, 1],
[744, 1],
[1488, 1],
[2232, 1],
[2976, 1],
[3720, 1],
[4464, 1],
[5208, 1],
[5952, 1],
[6696, 1],
[7440, 1],
[8184, 1],
[8928, 1],
[9672, 1],
[10416, 1],
[11160, 1],
[11904, 1],
[12648, 1],
[13392, 1],
[14136, 1]
],
"outputLinkMap": [
[0, 4],
[744, 8],
[1480, 12],
[2234, 16],
[2978, 20],
[3722, 24],
[4466, 28],
[5208, 32],
[5952, 36],
[6696, 40],
[7440, 44],
[8184, 48],
[8928, 52],
[9672, 56],
[10416, 60],
[11160, 64],
[11904, 68],
[12648, 72],
[13392, 76],
[14136, 80]
],
"outputHost": [[0, "192.168.0.1"], [8184, "192.168.0.2"]],
"outputMac": [[0, "06-00-00-00-00-01"]],
"outputPort": [[0, 9000, 1], [8184, 9000, 1]]
},
{
"fspID":2,
"functionMode":"CORR",
"frequencySliceID":2,
"integrationTime":1400,
"corrBandwidth":1,
"channelAveragingMap":[[0,2],[744,0]],
"fspChannelOffset":744,
"outputLinkMap":[[0,4],[200,5]],
"zoomWindowTuning":650000
}
]
}
test_ConfigureScan_basic.json 0000664 0000000 0000000 00000004013 13707315520 0034211 0 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/tests/acceptance_tests {
"id": "sbi-mvp01-20200325-00001-science_A",
"scanID": 1,
"frequencyBand": "5a",
"band5Tuning": [5.85, 7.25],
"frequencyBandOffsetStream1": 0,
"frequencyBandOffsetStream2": 0,
"dopplerPhaseCorrSubscriptionPoint": "ska_mid/tm_leaf_node/csp_subarray_01/dopplerPhaseCorrection",
"delayModelSubscriptionPoint": "ska_mid/tm_leaf_node/csp_subarray_01/delayModel",
"visDestinationAddressSubscriptionPoint": "ska_mid/tm_leaf_node/csp_subarray_01/visDestinationAddress",
"rfiFlaggingMask": {},
"searchWindow": [
{
"searchWindowID": 1,
"searchWindowTuning": 6000000000,
"tdcEnable": true,
"tdcNumBits": 8,
"tdcPeriodBeforeEpoch": 5,
"tdcPeriodAfterEpoch": 25,
"tdcDestinationAddress": [
{
"tdcDestinationAddress": ["foo", "bar", "8080"]
},
{
"receptorID": 1,
"tdcDestinationAddress": ["fizz", "buzz", "80"]
}
]
},
{
"searchWindowID": 2,
"searchWindowTuning": 7000000000,
"tdcEnable": false
}
],
"fsp": [
{
"fspID": 1,
"functionMode": "CORR",
"frequencySliceID": 1,
"corrBandwidth": 1,
"zoomWindowTuning": 4700000,
"integrationTime": 140,
"channelAveragingMap": [
[1, 8],
[745, 0],
[1489, 0],
[2233, 0],
[2977, 0],
[3721, 0],
[4465, 0],
[5209, 0],
[5953, 0],
[6697, 0],
[7441, 0],
[8185, 0],
[8929, 0],
[9673, 0],
[10417, 0],
[11161, 0],
[11905, 0],
[12649, 0],
[13393, 0],
[14137, 0]
]
}
]
}
test_ConfigureScan_invalid_cbf_json.json 0000664 0000000 0000000 00000003300 13707315520 0036417 0 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/tests/acceptance_tests {
"id": "sbi-mvp01-20200325-00001-science_A",
"frequencyBand": "6",
"delayModelSubscriptionPoint": "ska_mid/tm_leaf_node/csp_subarray_01/delayModel",
"fsp": [
{
"fspID": 1,
"functionMode": "CORR",
"frequencySliceID": 1,
"corrBandwidth": 0,
"integrationTime": 140,
"fspChannelOffset": 0,
"channelAveragingMap": [
[0, 1],
[744, 1],
[1488, 1],
[2232, 1],
[2976, 1],
[3720, 1],
[4464, 1],
[5208, 1],
[5952, 1],
[6696, 1],
[7440, 1],
[8184, 1],
[8928, 1],
[9672, 1],
[10416, 1],
[11160, 1],
[11904, 1],
[12648, 1],
[13392, 1],
[14136, 1]
],
"outputLinkMap": [
[0, 4],
[744, 8],
[1480, 12],
[2234, 16],
[2978, 20],
[3722, 24],
[4466, 28],
[5208, 32],
[5952, 36],
[6696, 40],
[7440, 44],
[8184, 48],
[8928, 52],
[9672, 56],
[10416, 60],
[11160, 64],
[11904, 68],
[12648, 72],
[13392, 76],
[14136, 80]
],
"outputHost": [[0, "192.168.0.1"], [8184, "192.168.0.2"]],
"outputMac": [[0, "06-00-00-00-00-01"]],
"outputPort": [[0, 9000, 1], [8184, 9000, 1]]
}
]
}
test_ConfigureScan_without_configID.json 0000664 0000000 0000000 00000003220 13707315520 0036374 0 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/tests/acceptance_tests {
"frequencyBand": "1",
"delayModelSubscriptionPoint": "ska_mid/tm_leaf_node/csp_subarray_01/delayModel",
"fsp": [
{
"fspID": 1,
"functionMode": "CORR",
"frequencySliceID": 1,
"corrBandwidth": 0,
"integrationTime": 140,
"fspChannelOffset": 0,
"channelAveragingMap": [
[0, 1],
[744, 1],
[1488, 1],
[2232, 1],
[2976, 1],
[3720, 1],
[4464, 1],
[5208, 1],
[5952, 1],
[6696, 1],
[7440, 1],
[8184, 1],
[8928, 1],
[9672, 1],
[10416, 1],
[11160, 1],
[11904, 1],
[12648, 1],
[13392, 1],
[14136, 1]
],
"outputLinkMap": [
[0, 4],
[744, 8],
[1480, 12],
[2234, 16],
[2978, 20],
[3722, 24],
[4466, 28],
[5208, 32],
[5952, 36],
[6696, 40],
[7440, 44],
[8184, 48],
[8928, 52],
[9672, 56],
[10416, 60],
[11160, 64],
[11904, 68],
[12648, 72],
[13392, 76],
[14136, 80]
],
"outputHost": [[0, "192.168.0.1"], [8184, "192.168.0.2"]],
"outputMac": [[0, "06-00-00-00-00-01"]],
"outputPort": [[0, 9000, 1], [8184, 9000, 1]]
}
]
}
test_ConfigureScan_without_outputlink.json 0000664 0000000 0000000 00000002167 13707315520 0037141 0 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/tests/acceptance_tests {
"id": "sbi-mvp01-20200325-00001-science_A",
"frequencyBand": "1",
"delayModelSubscriptionPoint": "ska_mid/tm_leaf_node/csp_subarray_01/delayModel",
"fsp": [
{
"fspID": 1,
"functionMode": "CORR",
"frequencySliceID": 1,
"corrBandwidth": 0,
"integrationTime": 140,
"fspChannelOffset": 0,
"channelAveragingMap": [
[0, 1],
[744, 1],
[1488, 1],
[2232, 1],
[2976, 1],
[3720, 1],
[4464, 1],
[5208, 1],
[5952, 1],
[6696, 1],
[7440, 1],
[8184, 1],
[8928, 1],
[9672, 1],
[10416, 1],
[11160, 1],
[11904, 1],
[12648, 1],
[13392, 1],
[14136, 1]
],
"outputHost": [[0, "192.168.0.1"], [8184, "192.168.0.2"]],
"outputMac": [[0, "06-00-00-00-00-01"]],
"outputPort": [[0, 9000, 1], [8184, 9000, 1]]
}
]
}
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/tests/acceptance_tests/test_requirements.txt 0000664 0000000 0000000 00000000107 13707315520 0032772 0 ustar 00root root 0000000 0000000 pytest-json-report
pycodestyle
pytest-ordering
importlib
assertpy
mock
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/tests/acceptance_tests/utils.py 0000664 0000000 0000000 00000003627 13707315520 0030173 0 ustar 00root root 0000000 0000000 import time
import logging
import numpy
from tango import DeviceProxy, DevState
LOGGER = logging.getLogger(__name__)
class Timeout:
def __init__(self, duration):
self.endtime = time.time() + duration
def has_expired(self):
return time.time() > self.endtime
class Probe:
def __init__(self, proxy, attr_name, expected_state, message):
"""
"""
self.proxy = proxy
self.attr_name = attr_name
self.expected_state = expected_state
self.message = message
self.current_state = DevState.DISABLE
def get_attribute(self):
return self.attr_name
def sample(self):
"""
extract the state of client and store it
"""
device_attr = self.proxy.read_attribute(self.attr_name)
self.current_state = device_attr.value
LOGGER.debug("attr_name: {} current_state:{}".format(self.attr_name, self.current_state))
def is_satisfied(self):
"""
Check if the state satisfies this test condition
"""
if isinstance(self.current_state, numpy.ndarray):
return (self.expected_state == self.current_state).all()
return self.expected_state == self.current_state
class Poller:
def __init__(self, timeout, interval):
self.timeout = timeout
self.interval = interval
def check(self, probe: Probe):
"""
Repeatedly check if the probe is satisfied.
Assert false when the timeout expires.
"""
timer = Timeout(self.timeout)
probe.sample()
while not probe.is_satisfied():
if timer.has_expired():
LOGGER.debug("Check Timeout on:{}".format(probe.get_attribute()))
assert False, probe.message
time.sleep(self.interval)
probe.sample()
LOGGER.debug("Check success on: {}".format(probe.get_attribute()))
assert True
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/tests/configScan_sub1.json 0000664 0000000 0000000 00000003300 13707315520 0027034 0 ustar 00root root 0000000 0000000 {
"id": "sbi-mvp01-20200325-00001-science_A",
"frequencyBand": "1",
"delayModelSubscriptionPoint": "ska_mid/tm_leaf_node/csp_subarray_01/delayModel",
"fsp": [
{
"fspID": 1,
"functionMode": "CORR",
"frequencySliceID": 1,
"corrBandwidth": 0,
"integrationTime": 140,
"fspChannelOffset": 0,
"channelAveragingMap": [
[0, 1],
[744, 1],
[1488, 1],
[2232, 1],
[2976, 1],
[3720, 1],
[4464, 1],
[5208, 1],
[5952, 1],
[6696, 1],
[7440, 1],
[8184, 1],
[8928, 1],
[9672, 1],
[10416, 1],
[11160, 1],
[11904, 1],
[12648, 1],
[13392, 1],
[14136, 1]
],
"outputLinkMap": [
[0, 4],
[744, 8],
[1480, 12],
[2234, 16],
[2978, 20],
[3722, 24],
[4466, 28],
[5208, 32],
[5952, 36],
[6696, 40],
[7440, 44],
[8184, 48],
[8928, 52],
[9672, 56],
[10416, 60],
[11160, 64],
[11904, 68],
[12648, 72],
[13392, 76],
[14136, 80]
],
"outputHost": [[0, "192.168.0.1"], [8184, "192.168.0.2"]],
"outputMac": [[0, "06-00-00-00-00-01"]],
"outputPort": [[0, 9000, 1], [8184, 9000, 1]]
}
]
}
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/tests/configScan_sub2.json 0000664 0000000 0000000 00000003300 13707315520 0027035 0 ustar 00root root 0000000 0000000 {
"id": "sbi-mvp01-20200325-00001-science_A",
"frequencyBand": "2",
"delayModelSubscriptionPoint": "ska_mid/tm_leaf_node/csp_subarray_01/delayModel",
"fsp": [
{
"fspID": 1,
"functionMode": "CORR",
"frequencySliceID": 1,
"corrBandwidth": 0,
"integrationTime": 140,
"fspChannelOffset": 0,
"channelAveragingMap": [
[0, 1],
[744, 1],
[1488, 1],
[2232, 1],
[2976, 1],
[3720, 1],
[4464, 1],
[5208, 1],
[5952, 1],
[6696, 1],
[7440, 1],
[8184, 1],
[8928, 1],
[9672, 1],
[10416, 1],
[11160, 1],
[11904, 1],
[12648, 1],
[13392, 1],
[14136, 1]
],
"outputLinkMap": [
[0, 4],
[744, 8],
[1480, 12],
[2234, 16],
[2978, 20],
[3722, 24],
[4466, 28],
[5208, 32],
[5952, 36],
[6696, 40],
[7440, 44],
[8184, 48],
[8928, 52],
[9672, 56],
[10416, 60],
[11160, 64],
[11904, 68],
[12648, 72],
[13392, 76],
[14136, 80]
],
"outputHost": [[0, "192.168.0.3"], [8184, "192.168.0.4"]],
"outputMac": [[0, "06-00-00-00-00-01"]],
"outputPort": [[0, 9000, 1], [8184, 9000, 1]]
}
]
}
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/tests/test_ConfigureScan_basic.json 0000664 0000000 0000000 00000003300 13707315520 0030756 0 ustar 00root root 0000000 0000000 {
"id": "sbi-mvp01-20200325-00001-science_A",
"frequencyBand": "1",
"delayModelSubscriptionPoint": "ska_mid/tm_leaf_node/csp_subarray_01/delayModel",
"fsp": [
{
"fspID": 1,
"functionMode": "CORR",
"frequencySliceID": 1,
"corrBandwidth": 0,
"integrationTime": 140,
"fspChannelOffset": 0,
"channelAveragingMap": [
[0, 1],
[744, 1],
[1488, 1],
[2232, 1],
[2976, 1],
[3720, 1],
[4464, 1],
[5208, 1],
[5952, 1],
[6696, 1],
[7440, 1],
[8184, 1],
[8928, 1],
[9672, 1],
[10416, 1],
[11160, 1],
[11904, 1],
[12648, 1],
[13392, 1],
[14136, 1]
],
"outputLinkMap": [
[0, 4],
[744, 8],
[1480, 12],
[2234, 16],
[2978, 20],
[3722, 24],
[4466, 28],
[5208, 32],
[5952, 36],
[6696, 40],
[7440, 44],
[8184, 48],
[8928, 52],
[9672, 56],
[10416, 60],
[11160, 64],
[11904, 68],
[12648, 72],
[13392, 76],
[14136, 80]
],
"outputHost": [[0, "192.168.0.1"], [8184, "192.168.0.2"]],
"outputMac": [[0, "06-00-00-00-00-01"]],
"outputPort": [[0, 9000, 1], [8184, 9000, 1]]
}
]
}
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/tests/unit/ 0000775 0000000 0000000 00000000000 13707315520 0024120 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/tests/unit/midcspsubarray_unit_test.py 0000664 0000000 0000000 00000100675 13707315520 0031631 0 ustar 00root root 0000000 0000000 import contextlib
import importlib
import sys
import os
import mock
import pytest
import tango
import time
from mock import Mock, MagicMock
from ska.base.control_model import HealthState, ObsState
from ska.base.commands import ResultCode
from tango.test_context import DeviceTestContext
from tango import DevState, DevFailed, DeviceProxy
import csp_lmc_common
import csp_lmc_mid
from utils import Probe, Poller
from csp_lmc_common.CspSubarray import CspSubarray
from csp_lmc_mid.MidCspSubarrayBase import MidCspSubarrayBase
file_path = os.path.dirname(os.path.abspath(__file__))
def test_midcspsubarray_state_and_obstate_value_AFTER_initialization():
"""
Test the State and obsState values for the CpSubarray at the
end of the initialization process.
"""
device_under_test = MidCspSubarrayBase
cbf_subarray_fqdn = 'mid_csp_cbf/sub_elt/subarray_01'
cbf_subarray_state_attr = 'State'
dut_properties = {
'CspMaster':'mid_csp/elt/master',
'CbfSubarray': cbf_subarray_fqdn,
'PssSubarray': 'mid_csp_pss/sub_elt/subarray_01',
'PstSubarray': 'mid_csp_pst/sub_elt/subarray_01',
}
event_subscription_map = {}
cbf_subarray_device_proxy_mock = Mock()
cbf_subarray_device_proxy_mock.subscribe_event.side_effect = (
lambda attr_name, event_type, callback, *args, **kwargs: event_subscription_map.update({attr_name: callback}))
proxies_to_mock = {
cbf_subarray_fqdn: cbf_subarray_device_proxy_mock
}
with fake_tango_system(device_under_test, initial_dut_properties=dut_properties, proxies_to_mock=proxies_to_mock) as tango_context:
dummy_event = create_dummy_event(cbf_subarray_fqdn, 'state', DevState.OFF)
event_subscription_map[cbf_subarray_state_attr](dummy_event)
# Note: the state is in ALARM because the device uses forwarded attributes.
#assert tango_context.device.State() == DevState.OFF
assert tango_context.device.obsState == ObsState.EMPTY
def test_midcspsubarray_state_AFTER_On_WITH_exception_raised_by_subelement_subarray():
"""
Test the behavior of the CspSubarray when one of the sub-element subarray
raises a DevFailed exception.
"""
device_under_test = MidCspSubarrayBase
cbf_subarray_fqdn = 'mid_csp_cbf/sub_elt/subarray_01'
pss_subarray_fqdn = 'mid_csp_pss/sub_elt/subarray_01'
dut_properties = {
'CbfSubarray': cbf_subarray_fqdn,
'PssSubarray': pss_subarray_fqdn,
'CspMaster':'mid_csp/elt/master',
}
cbf_subarray_device_proxy_mock = Mock()
pss_subarray_device_proxy_mock = Mock()
proxies_to_mock = {
cbf_subarray_fqdn: cbf_subarray_device_proxy_mock,
pss_subarray_fqdn: pss_subarray_device_proxy_mock
}
with fake_tango_system(device_under_test, initial_dut_properties=dut_properties,
proxies_to_mock=proxies_to_mock) as tango_context:
cbf_subarray_device_proxy_mock.On.side_effect = raise_devfailed_exception
pss_subarray_device_proxy_mock.On.side_effect = return_ok
tango_context.device.On()
# Note: the state is in ALARM because the device uses forwarded attributes.
#assert tango_context.device.State() == DevState.FAULT
assert tango_context.device.obsState == ObsState.EMPTY
def test_midcspsubarray_state_AFTER_On_command_WITH_failed_code_returned_by_subelement_subarray():
"""
Test the behavior of the CspSubarray when on the sub-element subarray
return a FAILED code.
"""
device_under_test = MidCspSubarrayBase
cbf_subarray_fqdn = 'mid_csp_cbf/sub_elt/subarray_01'
pss_subarray_fqdn = 'mid_csp_pss/sub_elt/subarray_01'
dut_properties = {
'CbfSubarray': cbf_subarray_fqdn,
'PssSubarray': pss_subarray_fqdn,
'CspMaster':'mid_csp/elt/master',
}
cbf_subarray_device_proxy_mock = Mock()
pss_subarray_device_proxy_mock = Mock()
proxies_to_mock = {
cbf_subarray_fqdn: cbf_subarray_device_proxy_mock,
pss_subarray_fqdn: pss_subarray_device_proxy_mock,
}
with fake_tango_system(device_under_test, initial_dut_properties=dut_properties,
proxies_to_mock=proxies_to_mock) as tango_context:
cbf_subarray_device_proxy_mock.On.side_effect = return_failed
pss_subarray_device_proxy_mock.On.side_effect = return_ok
tango_context.device.On()
#assert tango_context.device.State() == DevState.FAULT
assert tango_context.device.obsState == ObsState.EMPTY
def test_midcspsubarray_state_AFTER_On_command_WITH_failed_code_returned_by_pss_subarray():
"""
Test the behavior of the CspSubarray when on the sub-element subarray
return a FAILED code.
"""
device_under_test = MidCspSubarrayBase
cbf_subarray_fqdn = 'mid_csp_cbf/sub_elt/subarray_01'
pss_subarray_fqdn = 'mid_csp_pss/sub_elt/subarray_01'
dut_properties = {
'CbfSubarray': cbf_subarray_fqdn,
'PssSubarray': pss_subarray_fqdn,
'CspMaster':'mid_csp/elt/master',
}
cbf_subarray_device_proxy_mock = Mock()
pss_subarray_device_proxy_mock = Mock()
proxies_to_mock = {
cbf_subarray_fqdn: cbf_subarray_device_proxy_mock,
pss_subarray_fqdn: pss_subarray_device_proxy_mock
}
with fake_tango_system(device_under_test, initial_dut_properties=dut_properties,
proxies_to_mock=proxies_to_mock) as tango_context:
cbf_subarray_device_proxy_mock.On.side_effect = return_ok
pss_subarray_device_proxy_mock.On.side_effect = return_failed
tango_context.device.On()
#assert tango_context.device.State() == DevState.ON
assert tango_context.device.obsState == ObsState.EMPTY
assert tango_context.device.healthState == HealthState.DEGRADED
def test_midcspsubarray_state_after_On_forwarded_to_subelement_subarray():
"""
Test the behavior of the CspSubarray when on the sub-element subarray
return a FAILED code.
"""
device_under_test = MidCspSubarrayBase
cbf_subarray_fqdn = 'mid_csp_cbf/sub_elt/subarray_01'
pss_subarray_fqdn = 'mid_csp_pss/sub_elt/subarray_01'
dut_properties = {
'CbfSubarray': cbf_subarray_fqdn,
'PssSubarray': pss_subarray_fqdn,
'CspMaster':'mid_csp/elt/master',
}
cbf_subarray_device_proxy_mock = Mock()
pss_subarray_device_proxy_mock = Mock()
proxies_to_mock = {
cbf_subarray_fqdn: cbf_subarray_device_proxy_mock,
pss_subarray_fqdn: pss_subarray_device_proxy_mock,
}
with fake_tango_system(device_under_test, initial_dut_properties=dut_properties,
proxies_to_mock=proxies_to_mock) as tango_context:
cbf_subarray_device_proxy_mock.On.side_effect = return_ok
pss_subarray_device_proxy_mock.On.side_effect = return_ok
tango_context.device.On()
#assert tango_context.device.State() == DevState.ON
assert tango_context.device.obsState == ObsState.EMPTY
def test_midcspsubarray_obsstate_AFTER_add_receptors_return_failed():
"""
Test the behavior of the MidCspSubarray when receptors are added to the
CBF Subarray.
Expected result: state = ON obsState=IDLE
"""
device_under_test = MidCspSubarrayBase
cbf_subarray_fqdn = 'mid_csp_cbf/sub_elt/subarray_01'
pss_subarray_fqdn = 'mid_csp_pss/sub_elt/subarray_01'
cbf_subarray_state_attr = 'obsState'
dut_properties = {
'CbfSubarray': cbf_subarray_fqdn,
'PssSubarray': pss_subarray_fqdn,
'CspMaster':'mid_csp/elt/master',
'SubID': '1',
}
event_subscription_map = {}
cbf_subarray_device_proxy_mock = Mock()
pss_subarray_device_proxy_mock = Mock()
proxies_to_mock = {
cbf_subarray_fqdn: cbf_subarray_device_proxy_mock,
pss_subarray_fqdn: pss_subarray_device_proxy_mock,
}
cbf_subarray_device_proxy_mock.command_inout_asynch.side_effect = (
lambda command_name, argument, callback, *args,
**kwargs: event_subscription_map.update({command_name: callback}))
cbf_subarray_device_proxy_mock.subscribe_event.side_effect = (
lambda attr_name, event_type, callback, *args, **kwargs: event_subscription_map.update({attr_name: callback}))
with fake_tango_system(device_under_test, initial_dut_properties=dut_properties,
proxies_to_mock=proxies_to_mock) as tango_context:
with mock.patch('csp_lmc_mid.receptors.Receptors.assigned_to_subarray') as mock_assigned_to_subarray, \
mock.patch('csp_lmc_mid.receptors.Receptors.unassigned_ids') as mock_unassigned_ids:
cbf_subarray_device_proxy_mock.On.side_effect = return_ok
pss_subarray_device_proxy_mock.On.side_effect = return_ok
tango_context.device.On()
dummy_event = create_dummy_event(cbf_subarray_fqdn, 'obsstate',ObsState.EMPTY)
event_subscription_map[cbf_subarray_state_attr](dummy_event)
mock_assigned_to_subarray.return_value = []
mock_unassigned_ids.return_value = [1,2]
tango_context.device.AddReceptors([1,2,11,17,21,23])
dummy_event = command_callback_with_event_error("AddReceptors", cbf_subarray_fqdn)
event_subscription_map["AddReceptors"](dummy_event)
prober_obs_state = Probe(tango_context.device, 'obsState', ObsState.FAULT, f"Wrong CspSubarray state")
Poller(3, 0.1).check(prober_obs_state)
def test_midcspsubarray_obsstate_AFTER_add_receptors_to_cbf_subarray():
"""
Test the behavior of the MidCspSubarray when receptors are added to the
CBF Subarray.
Expected result: state = ON obsState=IDLE
"""
device_under_test = MidCspSubarrayBase
cbf_subarray_fqdn = 'mid_csp_cbf/sub_elt/subarray_01'
pss_subarray_fqdn = 'mid_csp_pss/sub_elt/subarray_01'
cbf_subarray_state_attr = 'obsState'
dut_properties = {
'CbfSubarray': cbf_subarray_fqdn,
'PssSubarray': pss_subarray_fqdn,
'CspMaster':'mid_csp/elt/master',
'SubID': '1',
}
event_subscription_map = {}
cbf_subarray_device_proxy_mock = Mock()
pss_subarray_device_proxy_mock = Mock()
cbf_subarray_device_proxy_mock.subscribe_event.side_effect = (
lambda attr_name, event_type, callback, *args, **kwargs: event_subscription_map.update({attr_name: callback}))
proxies_to_mock = {
cbf_subarray_fqdn: cbf_subarray_device_proxy_mock,
pss_subarray_fqdn: cbf_subarray_device_proxy_mock,
}
with fake_tango_system(device_under_test, initial_dut_properties=dut_properties,
proxies_to_mock=proxies_to_mock) as tango_context:
cbf_subarray_device_proxy_mock.On.side_effect = return_ok
pss_subarray_device_proxy_mock.On.side_effect = return_ok
tango_context.device.On()
dummy_event = create_dummy_event(cbf_subarray_fqdn, 'obstate',ObsState.IDLE)
event_subscription_map[cbf_subarray_state_attr](dummy_event)
with mock.patch('csp_lmc_mid.receptors.Receptors.list_of_ids') as mock_list_of_ids, \
mock.patch('csp_lmc_mid.receptors.Receptors.unassigned_ids') as mock_unassigned_ids, \
mock.patch('csp_lmc_mid.receptors.Receptors.assigned_to_subarray') as mock_assigned_to_subarray,\
mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.__len__') as mock_len:
mock_list_of_ids.return_value = [1,2,3,4]
mock_unassigned_ids.return_value = [1,2]
mock_assigned_to_subarray.return_value = [1,2]
mock_len.return_value = len([1,2])
tango_context.device.AddReceptors([1,2])
dummy_event = create_dummy_event(cbf_subarray_fqdn, 'obsstate',ObsState.RESOURCING)
event_subscription_map[cbf_subarray_state_attr](dummy_event)
dummy_event = create_dummy_event(cbf_subarray_fqdn, 'obsstate',ObsState.IDLE)
event_subscription_map[cbf_subarray_state_attr](dummy_event)
assert tango_context.device.obsState == ObsState.IDLE
'''
def test_midcspsubarray_obsstate_AFTER_configure():
"""
Test the behavior of the MidCspSubarray when the command Configure
is issued on the CBF Subarray.
Expected result: state = ON obsState=READY
"""
device_under_test = MidCspSubarrayBase
cbf_subarray_fqdn = 'mid_csp_cbf/sub_elt/subarray_01'
pss_subarray_fqdn = 'mid_csp_pss/sub_elt/subarray_01'
cbf_subarray_state_attr = 'obsState'
dut_properties = {
'CbfSubarray': cbf_subarray_fqdn,
'PssSubarray': pss_subarray_fqdn,
'CspMaster':'mid_csp/elt/master',
'SubID': '1',
}
event_subscription_map = {}
cbf_subarray_device_proxy_mock = Mock()
pss_subarray_device_proxy_mock = Mock()
cbf_subarray_device_proxy_mock.subscribe_event.side_effect = (
lambda attr_name, event_type, callback, *args, **kwargs: event_subscription_map.update({attr_name: callback}))
proxies_to_mock = {
cbf_subarray_fqdn: cbf_subarray_device_proxy_mock,
pss_subarray_fqdn: cbf_subarray_device_proxy_mock,
}
receptor_list = [1,2,3]
with fake_tango_system(device_under_test, initial_dut_properties=dut_properties,
proxies_to_mock=proxies_to_mock) as tango_context:
with mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.AddReceptorsCommand.do') as mock_do,\
mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.OnCommand.do') as mock_on_do,\
mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase._get_expected_delay') as mock_delay_expected,\
mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.__len__') as mock_len:
mock_len.return_value = len(receptor_list)
mock_do.return_value = (ResultCode.OK, "AddReceptors OK")
mock_on_do.return_value = (ResultCode.OK, "On command OK")
mock_delay_expected.return_value = 2
tango_context.device.On()
tango_context.device.AddReceptors(receptor_list)
#assert tango_context.device.obsState == ObsState.IDLE
cbf_subarray_device_proxy_mock.configureDelay.return_value = 10
configuration_string = load_json_file("test_ConfigureScan_ADR4.json")
tango_context.device.Configure(configuration_string)
#assert tango_context.device.obsState == ObsState.CONFIGURING
dummy_event = create_dummy_event(cbf_subarray_fqdn, 'obsstate',ObsState.READY)
event_subscription_map[cbf_subarray_state_attr](dummy_event)
prober_obs_state = Probe(tango_context.device, 'obsState', ObsState.READY, f"Wrong CspSubarray state")
Poller(3, 0.1).check(prober_obs_state)
assert tango_context.device.obsState == ObsState.READY
'''
def test_midcspsubarray_obsstate_AFTER_configure_WITH_wrong_json():
"""
Test the behavior of the MidCspSubarray when the command Configure
is issued a wrong configuration file.
Expected result: state = ON obsState=IDLE
"""
device_under_test = MidCspSubarrayBase
cbf_subarray_fqdn = 'mid_csp_cbf/sub_elt/subarray_01'
pss_subarray_fqdn = 'mid_csp_pss/sub_elt/subarray_01'
dut_properties = {
'CbfSubarray': cbf_subarray_fqdn,
'PssSubarray': pss_subarray_fqdn,
'CspMaster':'mid_csp/elt/master',
'SubID': '1',
}
cbf_subarray_device_proxy_mock = Mock()
pss_subarray_device_proxy_mock = Mock()
proxies_to_mock = {
cbf_subarray_fqdn: cbf_subarray_device_proxy_mock,
pss_subarray_fqdn: cbf_subarray_device_proxy_mock,
}
receptor_list = [1,2,3]
with fake_tango_system(device_under_test, initial_dut_properties=dut_properties,
proxies_to_mock=proxies_to_mock) as tango_context:
with mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.AddReceptorsCommand.do') as mock_do,\
mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.OnCommand.do') as mock_on_do,\
mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.__len__') as mock_len:
mock_len.return_value = len(receptor_list)
mock_do.return_value = (ResultCode.OK, "AddReceptors OK")
mock_on_do.return_value = (ResultCode.OK, "On command OK")
tango_context.device.On()
tango_context.device.AddReceptors(receptor_list)
configuration_string = load_json_file("test_ConfigureScan_without_configID.json")
tango_context.device.Configure(configuration_string)
assert tango_context.device.obsState == ObsState.FAULT
def test_midcspsubarray_obsstate_AFTER_configure_WITH_timeout():
"""
Test the behavior of the MidCspSubarray when the command Configure
detect a timeout condition.
Expected result: state = ON obsState=FAULT
"""
device_under_test = MidCspSubarrayBase
cbf_subarray_fqdn = 'mid_csp_cbf/sub_elt/subarray_01'
pss_subarray_fqdn = 'mid_csp_pss/sub_elt/subarray_01'
cbf_subarray_state_attr = 'obsState'
dut_properties = {
'CbfSubarray': cbf_subarray_fqdn,
'PssSubarray': pss_subarray_fqdn,
'CspMaster':'mid_csp/elt/master',
'SubID': '1',
}
event_subscription_map = {}
cbf_subarray_device_proxy_mock = Mock()
pss_subarray_device_proxy_mock = Mock()
cbf_subarray_device_proxy_mock.subscribe_event.side_effect = (
lambda attr_name, event_type, callback, *args, **kwargs: event_subscription_map.update({attr_name: callback}))
proxies_to_mock = {
cbf_subarray_fqdn: cbf_subarray_device_proxy_mock,
pss_subarray_fqdn: cbf_subarray_device_proxy_mock,
}
receptor_list = [1,2,3]
with fake_tango_system(device_under_test, initial_dut_properties=dut_properties,
proxies_to_mock=proxies_to_mock) as tango_context:
cbf_subarray_device_proxy_mock.Configure.side_effect = return_failed
with mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.AddReceptorsCommand.do') as mock_do,\
mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.OnCommand.do') as mock_on_do,\
mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase._get_expected_delay') as mock_delay_expected,\
mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.__len__') as mock_len:
mock_len.return_value = len(receptor_list)
mock_do.return_value = (ResultCode.OK, "AddReceptors OK")
mock_on_do.return_value = (ResultCode.OK, "On command OK")
mock_delay_expected.return_value = 2
tango_context.device.On()
tango_context.device.AddReceptors(receptor_list)
#assert tango_context.device.obsState == ObsState.IDLE
configuration_string = load_json_file("test_ConfigureScan_ADR4.json")
tango_context.device.Configure(configuration_string)
#assert tango_context.device.obsState == ObsState.CONFIGURING
prober_obs_state = Probe(tango_context.device, 'timeoutExpiredFlag', True, f"Wrong CspSubarray state")
Poller(3, 0.1).check(prober_obs_state)
assert tango_context.device.obsState == ObsState.FAULT
def test_midcspsubarray_obsstate_AFTER_configure_WITH_cbf_in_FAULT():
"""
Test the behavior of the MidCspSubarray when the command Configure
detect a failure condition.
Expected result: state = ON obsState=FAULT
"""
device_under_test = MidCspSubarrayBase
cbf_subarray_fqdn = 'mid_csp_cbf/sub_elt/subarray_01'
pss_subarray_fqdn = 'mid_csp_pss/sub_elt/subarray_01'
cbf_subarray_state_attr = 'obsState'
dut_properties = {
'CbfSubarray': cbf_subarray_fqdn,
'PssSubarray': pss_subarray_fqdn,
'CspMaster':'mid_csp/elt/master',
'SubID': '1',
}
event_subscription_map = {}
cbf_subarray_device_proxy_mock = Mock()
pss_subarray_device_proxy_mock = Mock()
cbf_subarray_device_proxy_mock.subscribe_event.side_effect = (
lambda attr_name, event_type, callback, *args, **kwargs: event_subscription_map.update({attr_name: callback}))
proxies_to_mock = {
cbf_subarray_fqdn: cbf_subarray_device_proxy_mock,
pss_subarray_fqdn: cbf_subarray_device_proxy_mock,
}
receptor_list = [1,2,3]
with fake_tango_system(device_under_test, initial_dut_properties=dut_properties,
proxies_to_mock=proxies_to_mock) as tango_context:
cbf_subarray_device_proxy_mock.Configure.side_effect = return_failed
with mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.AddReceptorsCommand.do') as mock_do,\
mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.OnCommand.do') as mock_on_do,\
mock.patch('csp_lmc_common.CspSubarray.CspSubarray._get_expected_delay') as mock_delay_expected,\
mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.__len__') as mock_len:
mock_len.return_value = len(receptor_list)
mock_do.return_value = (ResultCode.OK, "AddReceptors OK")
mock_on_do.return_value = (ResultCode.OK, "On command OK")
mock_delay_expected.return_value = 2
tango_context.device.On()
tango_context.device.AddReceptors(receptor_list)
configuration_string = load_json_file("test_ConfigureScan_ADR4.json")
tango_context.device.Configure(configuration_string)
dummy_event = create_dummy_event(cbf_subarray_fqdn, 'obsstate',ObsState.FAULT)
event_subscription_map[cbf_subarray_state_attr](dummy_event)
prober_obs_state = Probe(tango_context.device, 'failureRaisedFlag', True, f"Wrong CspSubarray state")
Poller(3, 0.1).check(prober_obs_state)
assert tango_context.device.obsState == ObsState.FAULT
'''
def test_midcspsubarray_obsstate_AFTER_configure_WITH_cbf_returning_FAULT():
"""
Test the behavior of the MidCspSubarray when the command Configure
detect a failure condition.
Expected result: state = ON obsState=FAULT
"""
device_under_test = MidCspSubarrayBase
cbf_subarray_fqdn = 'mid_csp_cbf/sub_elt/subarray_01'
pss_subarray_fqdn = 'mid_csp_pss/sub_elt/subarray_01'
cbf_subarray_state_attr = 'obsState'
dut_properties = {
'CbfSubarray': cbf_subarray_fqdn,
'PssSubarray': pss_subarray_fqdn,
'CspMaster':'mid_csp/elt/master',
'SubID': '1',
}
event_subscription_map = {}
cbf_subarray_device_proxy_mock = Mock()
pss_subarray_device_proxy_mock = Mock()
cbf_subarray_device_proxy_mock.command_inout_asynch.side_effect = (
lambda command_name, argument, callback, *args,
**kwargs: event_subscription_map.update({command_name: callback}))
proxies_to_mock = {
cbf_subarray_fqdn: cbf_subarray_device_proxy_mock,
pss_subarray_fqdn: cbf_subarray_device_proxy_mock,
}
receptor_list = [1,2,3]
with fake_tango_system(device_under_test, initial_dut_properties=dut_properties, proxies_to_mock=proxies_to_mock) as tango_context:
with mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.AddReceptorsCommand.do') as mock_do,\
mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.OnCommand.do') as mock_on_do,\
mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.__len__') as mock_len:
mock_len.return_value = len(receptor_list)
mock_do.return_value = (ResultCode.OK, "AddReceptors OK")
mock_on_do.return_value = (ResultCode.OK, "On command OK")
tango_context.device.On()
tango_context.device.AddReceptors(receptor_list)
configuration_string = load_json_file("test_ConfigureScan_ADR4.json")
tango_context.device.Configure(configuration_string)
dummy_event = command_callback_with_event_error("ConfigureScan", cbf_subarray_fqdn)
event_subscription_map["ConfigureScan"](dummy_event)
prober_obs_state = Probe(tango_context.device, 'failureRaisedFlag', True, f"Wrong CspSubarray state")
Poller(3, 0.1).check(prober_obs_state)
assert tango_context.device.obsState == ObsState.FAULT
def test_midcspsubarray_obsstate_AFTER_end_scan():
"""
Test the behavior of the MidCspSubarray when the command Configure
is issued on the CBF Subarray.
Expected result: state = ON obsState=READY
"""
device_under_test = MidCspSubarrayBase
cbf_subarray_fqdn = 'mid_csp_cbf/sub_elt/subarray_01'
pss_subarray_fqdn = 'mid_csp_pss/sub_elt/subarray_01'
cbf_subarray_state_attr = 'obsState'
dut_properties = {
'CbfSubarray': cbf_subarray_fqdn,
'PssSubarray': pss_subarray_fqdn,
'CspMaster':'mid_csp/elt/master',
'SubID': '1',
}
event_subscription_map = {}
cbf_subarray_device_proxy_mock = Mock()
pss_subarray_device_proxy_mock = Mock()
cbf_subarray_device_proxy_mock.subscribe_event.side_effect = (
lambda attr_name, event_type, callback, *args, **kwargs: event_subscription_map.update({attr_name: callback}))
proxies_to_mock = {
cbf_subarray_fqdn: cbf_subarray_device_proxy_mock,
pss_subarray_fqdn: cbf_subarray_device_proxy_mock,
}
receptor_list = [1,2,3]
cbf_subarray_device_proxy_mock.Scan.side_effect = return_started
#cbf_subarray_device_proxy_mock.Scan.side_effect = return_ok
with fake_tango_system(device_under_test, initial_dut_properties=dut_properties, proxies_to_mock=proxies_to_mock) as tango_context:
with mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.AddReceptorsCommand.do') as mock_do,\
mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.OnCommand.do') as mock_on_do,\
mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.__len__') as mock_len:
mock_len.return_value = len(receptor_list)
mock_do.return_value = (ResultCode.OK, "AddReceptors OK")
mock_on_do.return_value = (ResultCode.OK, "On command OK")
#mock_configure_do.return_value = (ResultCode.OK, "Configure command OK")
tango_context.device.On()
tango_context.device.AddReceptors(receptor_list)
configuration_string = load_json_file("test_ConfigureScan_ADR4.json")
tango_context.device.Configure(configuration_string)
dummy_event = create_dummy_event(cbf_subarray_fqdn, 'obsstate',ObsState.READY)
event_subscription_map[cbf_subarray_state_attr](dummy_event)
prober_obs_state = Probe(tango_context.device, 'obsState', ObsState.READY, f"Wrong CspSubarray state")
Poller(3, 0.1).check(prober_obs_state)
tango_context.device.Scan("1")
time.sleep(1)
tango_context.device.EndScan()
dummy_event = create_dummy_event(cbf_subarray_fqdn, 'obsstate',ObsState.READY)
event_subscription_map[cbf_subarray_state_attr](dummy_event)
prober_obs_state = Probe(tango_context.device, 'obsState', ObsState.READY, f"Wrong CspSubarray state")
Poller(3, 0.1).check(prober_obs_state)
assert tango_context.device.obsState == ObsState.READY
def test_midcspsubarray_obsreset():
"""
Test the behavior of the MidCspSubarray when the command ObsReset
is issued.
Expected result: state = ON obsState=IDLE
"""
device_under_test = MidCspSubarrayBase
cbf_subarray_fqdn = 'mid_csp_cbf/sub_elt/subarray_01'
pss_subarray_fqdn = 'mid_csp_pss/sub_elt/subarray_01'
dut_properties = {
'CbfSubarray': cbf_subarray_fqdn,
'PssSubarray': pss_subarray_fqdn,
'CspMaster':'mid_csp/elt/master',
'SubID': '1',
}
event_subscription_map = {}
cbf_subarray_device_proxy_mock = Mock()
pss_subarray_device_proxy_mock = Mock()
cbf_subarray_device_proxy_mock.subscribe_event.side_effect = (
lambda attr_name, event_type, callback, *args, **kwargs: event_subscription_map.update({attr_name: callback}))
proxies_to_mock = {
cbf_subarray_fqdn: cbf_subarray_device_proxy_mock,
pss_subarray_fqdn: cbf_subarray_device_proxy_mock,
}
receptor_list = [1,2,3]
with fake_tango_system(device_under_test, initial_dut_properties=dut_properties, proxies_to_mock=proxies_to_mock) as tango_context:
with mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.AddReceptorsCommand.do') as mock_do,\
mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.OnCommand.do') as mock_on_do,\
mock.patch('csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase.__len__') as mock_len:
mock_len.return_value = len(receptor_list)
mock_do.return_value = (ResultCode.OK, "AddReceptors OK")
mock_on_do.return_value = (ResultCode.OK, "On command OK")
tango_context.device.On()
tango_context.device.AddReceptors(receptor_list)
configuration_string = load_json_file("test_ConfigureScan_ADR4.json")
tango_context.device.Configure(configuration_string)
dummy_event = create_dummy_event(cbf_subarray_fqdn, 'obsstate',ObsState.FAULT)
event_subscription_map['obsState'](dummy_event)
prober_obs_state = Probe(tango_context.device, 'obsState', ObsState.FAULT, f"Wrong CspSubarray state")
Poller(3, 0.1).check(prober_obs_state)
tango_context.device.ObsReset()
assert tango_context.device.obsState == ObsState.RESETTING
'''
def return_ok():
"""
Return a FAILED code in the execution of a device method.
"""
message = "CBF Subarray Oncommand OK"
return (ResultCode.OK, message)
def return_started():
"""
Return a FAILED code in the execution of a device method.
"""
message = "CBF Subarray Oncommand OK"
return (ResultCode.STARTED, message)
def return_failed():
"""
Return a FAILED code in the execution of a device method.
"""
print("return failed")
return (ResultCode.FAILED, "On Command failed")
def raise_devfailed_exception():
"""
Raise an exception to test the failure of a device command
"""
print("raise_devfailed_exception")
tango.Except.throw_exception("Commandfailed", "This is error message for devfailed",
" ", tango.ErrSeverity.ERR)
def mock_event_dev_name(device_name):
return device_name
def create_dummy_event(cbf_subarray_fqdn, attr_name, event_value):
"""
Create a mocked event object to test the event callback method
associate to the attribute at subscription.
param: cbf_subarray_fqdn the CBF Subarray FQDN
event_value the expected value
return: the fake event
"""
fake_event = Mock()
fake_event.err = False
fake_event.attr_name = f"{cbf_subarray_fqdn}/{attr_name}"
fake_event.attr_value.value = event_value
fake_event.attr_value.name = attr_name
fake_event.device.name = cbf_subarray_fqdn
fake_event.device.dev_name.side_effect=(lambda *args, **kwargs: mock_event_dev_name(cbf_subarray_fqdn))
return fake_event
def command_callback_with_event_error(command_name, cbf_subarray_fqdn):
print("command_callback_with_event_error:{}".format(command_name, cbf_subarray_fqdn))
fake_event = MagicMock()
fake_event.err = False
fake_event.cmd_name = f"{command_name}"
fake_event.device.dev_name.side_effect=(lambda *args, **kwargs: mock_event_dev_name(cbf_subarray_fqdn))
fake_event.argout = [ResultCode.FAILED, "Command Failed"]
return fake_event
def raise_exception(command_name):
return raise_devfailed_exception()
def load_json_file(file_name):
print(file_path)
print(os.path.dirname(__file__))
path= os.path.join(os.path.dirname(__file__), '../acceptance_tests' , file_name)
with open(path, 'r') as f:
configuration_string = f.read().replace("\n", "")
return configuration_string
@contextlib.contextmanager
def fake_tango_system(device_under_test, initial_dut_properties={}, proxies_to_mock={},
device_proxy_import_path='tango.DeviceProxy'):
with mock.patch(device_proxy_import_path) as patched_constructor:
patched_constructor.side_effect = lambda device_fqdn: proxies_to_mock.get(device_fqdn, Mock())
patched_module = importlib.reload(sys.modules[device_under_test.__module__])
device_under_test = getattr(patched_module, device_under_test.__name__)
device_test_context = DeviceTestContext(device_under_test, properties=initial_dut_properties)
device_test_context.start()
yield device_test_context
device_test_context.stop()
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/csp-lmc-mid/tests/unit/utils.py 0000664 0000000 0000000 00000003626 13707315520 0025641 0 ustar 00root root 0000000 0000000 import time
import logging
import numpy
from tango import DeviceProxy, DevState
LOGGER = logging.getLogger(__name__)
class Timeout:
def __init__(self, duration):
self.endtime = time.time() + duration
def has_expired(self):
return time.time() > self.endtime
class Probe:
def __init__(self, proxy, attr_name, expected_state, message):
"""
"""
self.proxy = proxy
self.attr_name = attr_name
self.expected_state = expected_state
self.message = message
self.current_state = DevState.DISABLE
def get_attribute(self):
return self.attr_name
def sample(self):
"""
extract the state of client and store it
"""
device_attr = self.proxy.read_attribute(self.attr_name)
self.current_state = device_attr.value
LOGGER.info("attr_name: {} current_state:{}".format(self.attr_name, self.current_state))
def is_satisfied(self):
"""
Check if the state satisfies this test condition
"""
if isinstance(self.current_state, numpy.ndarray):
return (self.expected_state == self.current_state).all()
return self.expected_state == self.current_state
class Poller:
def __init__(self, timeout, interval):
self.timeout = timeout
self.interval = interval
def check(self, probe: Probe):
"""
Repeatedly check if the probe is satisfied.
Assert false when the timeout expires.
"""
timer = Timeout(self.timeout)
probe.sample()
while not probe.is_satisfied():
if timer.has_expired():
LOGGER.debug("Check Timeout on:{}".format(probe.get_attribute()))
assert False, probe.message
time.sleep(self.interval)
probe.sample()
LOGGER.debug("Check success on: {}".format(probe.get_attribute()))
assert True
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/docker-requirements.txt 0000664 0000000 0000000 00000000266 13707315520 0024427 0 ustar 00root root 0000000 0000000 docutils
markupsafe
pygments
pylint
pytest
pytest-cov
pytest-pylint
python-dotenv>=0.5.1
setuptools
sphinx
sphinx_rtd_theme
sphinx-autobuild
sphinx-rtd-theme
sphinxcontrib-websupport csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/docs/ 0000775 0000000 0000000 00000000000 13707315520 0020622 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/docs/Makefile 0000664 0000000 0000000 00000001224 13707315520 0022261 0 ustar 00root root 0000000 0000000 SHELL := /bin/bash
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
#SPHINXBUILD = python -msphinx
SPHINXBUILD = sphinx-build
SPHINXPROJ = skeleton
SOURCEDIR = src
BUILDDIR = build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/docs/src/ 0000775 0000000 0000000 00000000000 13707315520 0021411 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/docs/src/CspCapability.inc 0000664 0000000 0000000 00000005524 13707315520 0024641 0 ustar 00root root 0000000 0000000 Capabilities represent the CSP schedulable resources and provide API that can be used to
configure, monitor and control resources that implement signal processing functionality.
During normal operations, TM uses the sub-array API to assign capabilities to the sub-array, configure
sub-array Processing Mode, start and stop scan. |br|
The CSP.LMC Common Package implements the capabilities that are shared between LOW and MID instances. |br|
These are:
* :ref:`CSP Search Beam Capability `
* :ref:`CSP Timing Beam Capability `
* :ref:`CSP VLBI Beam Capability `
.. _CSP-SearchBeam-Capability:
CSP.LMC Search Beam Capability
==============================
The Search Beam Capability exposes the attributes and commands to monitor and control beamforming and PSS
processing in a single beam. |br|
The mapping between an instance of the CSP Search Beam and the internal CSP Sub-element components performing
beamforming and search is established at initialization and is permanent.
CSP.LMC SearchBeamCapability API Documentation
-----------------------------------------------
.. autoclass:: csp_lmc_common.CspSearchBeamCapability.CspSearchBeamCapability
:members:
:member-order:
:private-members:
:show-inheritance:
:undoc-members:
.. _CSP-TimingBeam-Capability:
CSP.LMC Timing Beam Capability
==============================
The Timing Beam Capability exposes the attributes and commands to monitor and control beamforming and PST
processing in a single beam. |br|
The mapping between an instance of the CSP Search Beam and the internal CSP Sub-element components performing
beamforming and search is established at initialization and is permanent.
CSP.LMC TimingBeamCapability API Documentation
----------------------------------------------
.. autoclass:: csp_lmc_common.CspTimingBeamCapability.CspTimingBeamCapability
:members:
:member-order:
:noindex:
:private-members:
:show-inheritance:
:undoc-members:
.. _CSP-VlbiBeam-Capability:
CSP.LMC VLBI Beam Capability
============================
The VLBI Beam Capability exposes the attributes and commands to monitor and control beamforming and VLBI
processing in a single beam. |br|
CSP.LMC VlbiBeamCapability API Documentation
--------------------------------------------
.. autoclass:: csp_lmc_common.CspVlbiBeamCapability.CspVlbiBeamCapability
:members:
:private-members:
:special-members:
:show-inheritance:
:undoc-members:
:noindex:
.. _CSP-CapabilityMonitor:
CSP.LMC CapabilityMonitor
=========================
This device...
CSP.LMC CapabilityMonitor API Documentation
-------------------------------------------
.. autoclass:: csp_lmc_common.CspCapabilityMonitor.CspCapabilityMonitor
:members:
:private-members:
:special-members:
:show-inheritance:
:undoc-members:
:noindex:
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/docs/src/CspLmcCommon.rst 0000664 0000000 0000000 00000005107 13707315520 0024500 0 ustar 00root root 0000000 0000000 .. Documentation
.. |br| raw:: html
######################
CSP.LMC Common Package
######################
General requirements for the monitor and control functionality are the same in both telescopes.
In addition two of three other CSP Sub-elements, namely PSS and PST, have the same functionality and use the same
design for both the telescopes. |br|
Functionality common to Low and Mid CSP.LMC includes: communication framework, logging, archiving, alarm generation,
subarraying, some of the functionality realated to handling observing mode changes, Pulsar Search and
Pulsar Timing, and to some extent Very Long Baseline Interferometry (VLBI). |br|
The difference between LOW and MID CSP.LMC is mostly due to the different receivers (dishes vs stations) and different
CBF functionality and design. More than the 50% of the CSP.LMC functionality is common for both
telescopes. |br|
The CSP.LMC Common Package comprises all the software components and functionality common to LOW and MID CSP.LMC
and is used as a base for development of the Low CSP.LMC and Mid CSP.LMC software. |br|
The *CSP.LMC Common Package* is delivered as a part of each CSP.LMC release, via a Python package that can be used as
required for maintenance and upgrade. |br|
CSP.LMC implements a high level interface (API) that Telescope Manager (TM), or other authorized
client, can use to monitor and control CSP as a single instrument. |br|
At the same time, CSP.LMC provides high level commands that the TM can use to sub-divide the array
into up to 16 sub-arrays, i.e. to assign station/receptors to sub-arrays, and to operate each
sub-array independently and conccurently with all othe sub-arrays. |br|
The top-level software components provided by CSP.LMC API are:
* :ref:`Csp Master `
* :ref:`Csp Subarray `
* CSP Alarm Handler
* CSP Logger
* CSP TANGO Facility Database
* Input processor Capability (receptors/stations)
* :ref:`Search Beam Capability `
* :ref:`Timing Beam Capability `
* :ref:`VLBI Beam Capability `
Components listed above are implemented as TANGO devices, i.e. classes that implement standard TANGO API.
The CSP.LMC TANGO devices are based on the standard SKA1 TANGO Element Devices provided via the *SKA Base Classes package*.
.. _CSP-Master:
**************
CSP.LMC Master
**************
.. include:: CspMaster.inc
.. _CSP-Subarray:
****************
CSP.LMC Subarray
****************
.. include:: CspSubarray.inc
.. _CSP-Capability:
********************
CSP.LMC Capabilities
********************
.. include:: CspCapability.inc
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/docs/src/CspMaster.inc 0000664 0000000 0000000 00000001102 13707315520 0023777 0 ustar 00root root 0000000 0000000 The CSP Master provides API for monitor and control the CSP Element. CSP Master implements CSP Element-level
status indicators, configuration parameters, housekeeping commands. |br|
CSP Master is the primary point of access for CSP Monitor and Control. |br|
CSP Master maintains the pool of schedulable resources, and it can relies on the
CSP CapabilityMonitor device, as needed.
CspMaster API Documentation
============================
.. autoclass:: csp_lmc_common.CspMaster.CspMaster
:members:
:noindex:
:undoc-members:
:member-order:
:show-inheritance:
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/docs/src/CspSubarray.inc 0000664 0000000 0000000 00000004551 13707315520 0024347 0 ustar 00root root 0000000 0000000 The core CSP functionality, configuration and execution of signal processing, is configured, controlled
and monitored via subarrays. |br|
CSP Subarray makes provision to TM to configure a subarray, select Processing Mode and related parameters,
specify when to start/stop signal processing and/or generation of output products.
TM accesses directly a CSP Subarray to:
* Assign resources
* Configure a scan
* Control and monitor states/operations
Resources assignment
====================
The assignment of Capabilities to a subarray (*subarray composition*) is performed
in advance of a scan configuration.
Assignable Capabilities for CSP Subarrays are:
* receptors (MID) or stations (LOW)
* tied-array beams: Search Beams, Timing Beams and Vlbi Beams.
In general resource assignment to a subarray is exclusive, but in some cases the same Capability instance
may be used in shared manner by more then one subarray.
Inherent Capabilities
---------------------
Each CSP subarray has also a set of permanently assigned *inherent Capabilities*: the number and type is different
for LOW and MID instance. |br|
Only the Inherent Capabilities related to the Processing Mode are common to both instances. |br|
These are:
* Correlation
* PSS
* PST
* VLBI
An inherent Capability can be enabled or disabled, but cannot assigned or removed to/from a subarray.
Scan configuration
==================
TM provides a complete scan configuration to a subarray via an ASCII JSON encoded string.
Parameters specified via a JSON string are implemented as TANGO Device attributes
and can be accessed and modified directly using the buil-in TANGO method *write_attribute*.
When a complete and coherent scan configuration is received and the subarray configuration
(or re-configuration) completed, the subarray it's ready to observe.
Control and Monitoring
======================
Each CSP Subarray maintains and report the status and state transitions for the
CSP subarray as a whole and for individual assigned resources. |br|
In addition to pre-configured status reporting, a CSP subarray makes provision for the TM and any authorized client, to obtain the value of any subarray attribute.
CspSubarray Class API Documentation
====================================
.. autoclass:: csp_lmc_common.CspSubarray.CspSubarray
:members:
:member-order:
:noindex:
:private-members:
:undoc-members:
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/docs/src/LowCspMaster.rst 0000664 0000000 0000000 00000000304 13707315520 0024523 0 ustar 00root root 0000000 0000000 .. Documentation
CspMaster Class Documentation
================================
.. automodule:: csp_lmc_common.CspMaster
:members:
:undoc-members:
:show-inheritance:
:member-order:
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/docs/src/LowCspSubarray.rst 0000664 0000000 0000000 00000004534 13707315520 0025071 0 ustar 00root root 0000000 0000000 ####################
LOW CSP.LMC Subarray
####################
The core CSP functionality, configuration and execution of signal processing, is configured, controlled
and monitored via subarrays.
CSP Subarray makes provision to TM to configure a subarray, select Processing Mode and related parameters,
specify when to start/stop signal processing and/or generation of output products.
TM accesses directly a CSP Subarray to:
* Assign resources
* Configure a scan
* Control and monitor states/operations
Resources assignment
=====================
The assignment of Capabilities to a subarray (*subarray composition*) is performed
in advance of a scan configuration.
Assignable Capabilities for LOW CSP.LMC Subarrays are:
* stations
* station beams
* tied-array beams: Search Beams, Timing Beams and Vlbi Beams.
In general resource assignment to a subarray is exclusive, but in some cases the same Capability instance
may be used in shared manner by more then one subarray.
Inherent Capabilities
---------------------
Each CSP subarray has also five permanently assigned *inherent Capabilities*:
* Station Beam
* Correlation
* PSS
* PST
* VLBI
An inherent Capability can be enabled or disabled, but cannot assigned or removed to/from a subarray.
They correspond to the CSP Low Processing Modes and are configured via a scan configuration.
Scan configuration
==================
TM provides a complete scan configuration to a subarray via an ASCII JSON encoded string.
Parameters specified via a JSON string are implemented as TANGO Device attributes
and can be accessed and modified directly using the buil-in TANGO method *write_attribute*.
When a complete and coherent scan configuration is received and the subarray configuration
(or re-configuration) completed, the subarray it's ready to observe.
Control and Monitoring
======================
Each Low CSP.LMC Subarray maintains and report the status and state transitions for the
CSP subarray as a whole and for the individual assigned resources.
In addition to pre-configured status reporting, a CSP Subarray makes provision for the TM and any authorized client,
to obtain the value of any subarray attribute.
Low CspSubarray Class Documentation
===================================
.. autoclass:: csp_lmc_common.CspSubarray.CspSubarray
:members:
:undoc-members:
:show-inheritance:
:member-order:
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/docs/src/MidCspMaster.rst 0000664 0000000 0000000 00000000345 13707315520 0024500 0 ustar 00root root 0000000 0000000 .. Documentation
CspMaster Class Documentation
================================
.. autoclass:: csp_lmc_mid.MidCspMasterBase.MidCspMasterBase
:members:
:undoc-members:
:show-inheritance:
:member-order:
:noindex:
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/docs/src/MidCspSubarray.rst 0000664 0000000 0000000 00000005577 13707315520 0025051 0 ustar 00root root 0000000 0000000 .. Documentation
####################
Mid CSP.LMC Subarray
####################
.. |br| raw:: html
CSP_Mid signal processing configuration and control is via sub-arrays and scans.|br|
The CSP_Mid sub-array receives configuration per scan. |br|
The following CSP_Mid sub-array parameters must be set in advance of a scan (before the
command *Configure* is received):
* Receptors that belong to sub-arrays. In order for a CSP_Mid sub-array to accept a scan configuration,
at least one receptor must be assigned to the sub-arrays. If no receptors are assigned to a sub-array, the sub-array is
empty and its state is *OFF*.
* Tied-array beams to be used by the sub-array. Search Beams, Timing Beams and Vlbi Beams are assigned via the CSP_Mid sub-array.
TM may specify the number of beams to be used or, alternatively, identify the Capability instances to be used
via their TANGO Fully Qualified Domain Name (FQDN). Search Beams must be assigned in advance of a scan that requires
PSS processing. The same for Timing and Vlbi Beams.
Receptors assignment
=====================
The assignment of receptors to a MID subarray is performed in advance of a scan configuration. |br|
Up to 197 receptors can be assigned to one sub-array. |br|
Receptors assignment to a subarray is exclusive: one receptor can be assigned only to one subarray. |br|
During assignement, the CSP_Mid subarray checks if the requested receptor is already assigned
to another sub-arry, and in this case it logs a warning message.
Inherent Capabilities
---------------------
Each Mid CSP.LMC subarray has also four permanently assigned *inherent Capabilities*:
* Correlation
* PSS
* PST
* VLBI
An inherent Capability can be enabled or disabled, but cannot assigned or removed to/from a subarray.
They correspond to the CSP Mid Processing Modes and are configured via a scan configuration.
Scan configuration
====================
TM provides a complete scan configuration to a subarray via an ASCII JSON encoded string.
Parameters specified via a JSON string are implemented as TANGO Device attributes
and can be accessed and modified directly using the buil-in TANGO method *write_attribute*.
When a complete and coherent scan configuration is received and the subarray configuration
(or re-configuration) completed, the subarray it's ready to observe.
Control and Monitoring
======================
Each CSP Subarray maintains and report the status and state transitions for the
CSP subarray as a whole and for the individual assigned resources.
In addition to pre-configured status reporting, a CSP Subarray makes provision for the TM and any authorized client,
to obtain the value of any subarray attribute.
MidCspSubarray Class Documentation
==================================
.. autoclass:: csp_lmc_mid.MidCspSubarrayBase.MidCspSubarrayBase
:members:
:undoc-members:
:show-inheritance:
:member-order:
:noindex:
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/docs/src/README.md 0000777 0000000 0000000 00000000000 13707315520 0024570 2../../README.md ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/docs/src/_static/ 0000775 0000000 0000000 00000000000 13707315520 0023037 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/docs/src/_static/css/ 0000775 0000000 0000000 00000000000 13707315520 0023627 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/docs/src/_static/css/custom.css 0000664 0000000 0000000 00000003332 13707315520 0025654 0 ustar 00root root 0000000 0000000 /*
Following SKA brand guidelines colors are defined as
SKA Sky Blue: rgb(0, 174, 239)
SKA Ocean Blue: rgb(0, 84, 164)
SKA Teal Blue: rgb(0, 104, 138)
SKA Burnt Sun: rgb(236, 134, 35)
SKA Earth Green: rgb(166, 206, 57)
*/
.wy-nav-side{
background-color: rgb(0, 84, 164);
color: white;
}
.wy-side-nav-search{
padding-top: 0px;
/*background-color: rgb(0, 174, 239);*/
background-color: rgb(0, 84, 164);
text-align: center;
}
.wy-menu-vertical p.caption{
color: rgb(236, 134, 35);
}
.wy-menu {
color: white;
}
.wy-menu-vertical a{
color: white;
}
.local-toc ul li a:hover {
background-color: rgb(0, 174, 239);
}
.wy-side-nav-search a{
padding-top: 0px;
}
.wy-side-nav-search a img.logo{
background-color: rgb(255, 255, 255);
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
padding-top: 40px;
}
.ska-logo, ska-logo:hover{
background-attachment: scroll;
background-clip: border-box;
background-color: rgb(255, 255, 255);
background-image: url("https://www.skatelescope.org/wp-content/themes/skatelescope.org-theme/img/img-logo3.png");
background-origin: padding-box;
background-position: 22px 35px;
background-position-x: 22px;
background-position-y: 35px;
background-repeat: no-repeat;
background-size: 153px 98px;
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
/*color: rgb(0, 86, 120);
float: left;
font-family: "Eurostile LT W01 Demi", sans-serif;
font-size: 44.8px;
font-weight: 400;
line-height: 60px;
list-style-image: none;
list-style-position: outside;
list-style-type: none;*/
margin-bottom: 0px;
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
width: 186px;
height: 135px;
}
csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/docs/src/_static/img/ 0000775 0000000 0000000 00000000000 13707315520 0023613 5 ustar 00root root 0000000 0000000 csp-lmc-old-csp-lmc-common-0.6.4-mid-0.6.4/docs/src/_static/img/favicon.ico 0000664 0000000 0000000 00000002576 13707315520 0025746 0 ustar 00root root 0000000 0000000 h ( ֤+ A ) Ƭ^ Ħ l Ϡy Õ U ӱv Ĝ Ƣ ~B ] B Ģw b T ҧk ӧk ۷ ؽ F ͗N |= ٳ} ʦ ӠW ͯ ̘~ ɓ^ ª װ~ ̒ ױ ٴ ڶ ٴ ( {<