Skip to content
Snippets Groups Projects
Commit 0ea04080 authored by Carlo Baffa's avatar Carlo Baffa
Browse files

Merge branch 'AT5-370' of gitlab.com:ska-telescope/csp-lmc-subelement into AT5-370

parents 7a3b70bb febf6d4c
Branches
No related tags found
1 merge request!5Request to merge AT5-370 branch with master
Pipeline #11345 failed
......@@ -61,6 +61,7 @@ linting:
- docker-executor
stage: linting
script:
- cd docker
- make lint
when: always
artifacts:
......
__all__ = (
"CspSubElementMaster",
"CspSubElementSubarray"
"CspSubElementMaster"
)
from .subelement_master import CspSubElementMaster
......
......@@ -91,7 +91,7 @@ class IsCommandAllowed(object):
cmd_to_exec = f.__name__
# the command input argument
input_arg = args[1]
device_list = input_arg
#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)
......
......@@ -42,6 +42,9 @@ class CspSubElementMaster(SKAMaster):
**Properties:**
- Device Property
Racks
- The list with the FQDNs of the sub-element racks devices.
- Type:'DevVarStringArray'
"""
# PROTECTED REGION ID(CspSubElementMaster.class_variable) ENABLED START #
# PROTECTED REGION END # // CspSubElementMaster.class_variable
......@@ -50,6 +53,10 @@ class CspSubElementMaster(SKAMaster):
# Device Properties
# -----------------
Racks = device_property(
dtype='DevVarStringArray',
)
# ----------
# Attributes
# ----------
......@@ -63,7 +70,7 @@ class CspSubElementMaster(SKAMaster):
onCmdFailure = attribute(
dtype='DevBoolean',
label="CBF command failure flag",
polling_period=1000,
#polling_period=1000,
doc="Failure flag set when the On command fails with error(s).",
)
......@@ -76,7 +83,6 @@ class CspSubElementMaster(SKAMaster):
offCmdFailure = attribute(
dtype='DevBoolean',
label="Off execution failure flag",
polling_period=1000,
doc="Failure flag set when the Off command fails with error(s).",
)
......@@ -89,7 +95,6 @@ class CspSubElementMaster(SKAMaster):
standbyCmdFailure = attribute(
dtype='DevBoolean',
label="Standby execution failure message",
polling_period=1000,
doc="Failure flag set when the Standby command fails with error(s).",
)
......@@ -102,7 +107,6 @@ class CspSubElementMaster(SKAMaster):
adminMode = attribute(
dtype=AdminMode,
access=AttrWriteType.READ_WRITE,
polling_period=1000,
memorized=True,
doc="The admin mode reported for this device. It may interpret the current device condition \nand condition of all managed devices to set this. Most possibly an aggregate attribute.",
)
......@@ -110,7 +114,6 @@ class CspSubElementMaster(SKAMaster):
onCommandProgress = attribute(
dtype='DevUShort',
label="Progress percentage for the On command",
polling_period=3000,
abs_change=10,
max_value=100,
min_value=0,
......@@ -120,7 +123,6 @@ class CspSubElementMaster(SKAMaster):
offCommandProgress = attribute(
dtype='DevUShort',
label="Progress percentage for the Off command",
polling_period=3000,
abs_change=10,
max_value=100,
min_value=0,
......@@ -130,7 +132,6 @@ class CspSubElementMaster(SKAMaster):
standbyCommandProgress = attribute(
dtype='DevUShort',
label="Progress percentage for the Standby command",
polling_period=3000,
abs_change=10,
max_value=100,
min_value=0,
......@@ -200,21 +201,18 @@ class CspSubElementMaster(SKAMaster):
onCmdTimeoutExpired = attribute(
dtype='DevBoolean',
label="On execution timeout flag",
polling_period=2000,
doc="Signal the occurence of a timeout during the execution of the on command.",
)
offCmdTimeoutExpired = attribute(
dtype='DevBoolean',
label="Off execution timeout flag",
polling_period=2000,
doc="Signal the occurence of a timeout during the execution of the Off command.",
)
standbyCmdTimeoutExpired = attribute(
dtype='DevBoolean',
label="Standby execution timeout flag.",
polling_period=2000,
doc="Signal the occurence of a timeout during the execution of the Standby command.",
)
......
--extra-index-url https://nexus.engageska-portugal.pt/repository/pypi/simple
docutils
markupsafe
pygments
......@@ -14,3 +15,4 @@ sphinx-rtd-theme
sphinxcontrib-websupport
pipdeptree
pylint_junit
csp-lmc-common >= 0.5.3
......@@ -27,32 +27,6 @@
"subelement/rack/02",
"subelement/rack/03",
"subelement/rack/04"
],
"polled_attr": [
"healthstate",
"1000",
"adminmode",
"1000",
"state",
"1000",
"oncommandprogress",
"2000",
"offcommandprogress",
"2000",
"standbycommandprogress",
"2000",
"oncmdtimeoutexpired",
"1000",
"offcmdtimeoutexpired",
"1000",
"standbycmdtimeoutexpired",
"1000",
"oncmdfailure",
"1000",
"offcmdfailure",
"1000",
"standbycmdfailure",
"1000"
]
}
}
......@@ -151,18 +125,6 @@
"properties": {
"SubID": [
"1"
],
"polled_attr": [
"state",
"1000",
"healthstate",
"1000",
"adminmode",
"1000",
"obsstate",
"1000",
"obsmode",
"1000"
]
}
}
......@@ -197,18 +159,6 @@
"properties": {
"SubID": [
"2"
],
"polled_attr": [
"state",
"1000",
"healthstate",
"1000",
"adminmode",
"1000",
"obsstate",
"1000",
"obsmode",
"1000"
]
}
}
......
......@@ -24,7 +24,7 @@ test:
lint:
pip3 install pylint2junit; \
mkdir -p /build/reports; \
cd /app && pylint --output-format=parseable csp_lmc_common | tee /build/csp-lmc-subelement-code-analysis.stdout; \
cd /app && pylint --output-format=parseable cspse/lmc | tee /build/csp-lmc-subelement-code-analysis.stdout; \
cd /app && pylint --output-format=pylint2junit.JunitReporter cspse/lmc > /build/reports/csp-lmc-subelement-linting.xml;
.PHONY: all test lint
......
<?xml version="1.0" encoding="ASCII"?>
<pogoDsl:PogoSystem xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:pogoDsl="http://www.esrf.fr/tango/pogo/PogoDsl">
<classes name="CspSubElementMaster" pogoRevision="9.6">
<description description="A base class for the Master of a SKA Sub-element." title="CSP.LMC Sub-element Master" sourcePath="/home/softir/src/ska-git/csp-lmc-subelement/pogo" language="PythonHL" filestogenerate="XMI file,Code files,Protected Regions" license="GPL" copyright="INAF-SKA Telescope" hasMandatoryProperty="false" hasConcreteProperty="false" hasAbstractCommand="false" hasAbstractAttribute="false">
<description description="A base class for the Master of a SKA Sub-element." title="CSP.LMC Sub-element Master" sourcePath="/home/softir/src/ska-git/csp-lmc-subelement/pogo" language="PythonHL" filestogenerate="XMI file,Code files,Protected Regions" license="GPL" copyright="INAF-SKA Telescope" hasMandatoryProperty="false" hasConcreteProperty="true" hasAbstractCommand="false" hasAbstractAttribute="false">
<inheritances classname="Device_Impl" sourcePath=""/>
<inheritances classname="SKABaseDevice" sourcePath="../../lmc-base-classes/pogo"/>
<inheritances classname="SKAMaster" sourcePath="/home/softir/src/ska-git/lmc-base-classes/pogo"/>
......@@ -38,6 +38,10 @@
<type xsi:type="pogoDsl:StringVectorType"/>
<status abstract="false" inherited="true" concrete="true"/>
</deviceProperties>
<deviceProperties name="Racks" description="The list with the FQDNs of the sub-element racks devices.">
<type xsi:type="pogoDsl:StringVectorType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</deviceProperties>
<commands name="State" description="This command gets the device state (stored in its device_state data member) and returns it to the caller." execMethod="dev_state" displayLevel="OPERATOR" polledPeriod="0">
<argin description="none">
<type xsi:type="pogoDsl:VoidType"/>
......@@ -169,7 +173,7 @@
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="Number of devices that completed the task" label="Number of devices that completed the task" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="onCmdFailure" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" allocReadMember="true" isDynamic="false">
<attributes name="onCmdFailure" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:BooleanType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
......@@ -185,7 +189,7 @@
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="Failure message when the On command fails with error(s)." label="On execution failure message" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="offCmdFailure" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" allocReadMember="true" isDynamic="false">
<attributes name="offCmdFailure" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:BooleanType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
......@@ -201,7 +205,7 @@
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="Failure message when the Off command fails with error(s)." label="Off execution failure message" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="standbyCmdFailure" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" allocReadMember="true" isDynamic="false">
<attributes name="standbyCmdFailure" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:BooleanType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
......@@ -231,7 +235,7 @@
<status abstract="false" inherited="true" concrete="true"/>
<properties description="The health state reported for this device. It interprets the current device condition &#xA;and condition of all managed devices to set this. Most possibly an aggregate attribute." label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="adminMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" memorized="true" allocReadMember="true">
<attributes name="adminMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true">
<dataType xsi:type="pogoDsl:EnumType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
......@@ -259,7 +263,7 @@
<status abstract="false" inherited="true" concrete="true"/>
<properties description="The test mode of the device. &#xA;Either no test mode (empty string) or an indication of the test mode." label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="onCommandProgress" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="3000" maxX="" maxY="" allocReadMember="false" isDynamic="false">
<attributes name="onCommandProgress" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="false" isDynamic="false">
<dataType xsi:type="pogoDsl:UShortType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
......@@ -268,7 +272,7 @@
<properties description="Percentage progress implemented for commands that result in state/mode transitions for a large &#xA;number of components and/or are executed in stages (e.g power up, power down)" label="Progress percentage for the On command" unit="" standardUnit="" displayUnit="" format="" maxValue="100" minValue="0" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
<eventCriteria relChange="" absChange="10" period=""/>
</attributes>
<attributes name="offCommandProgress" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="3000" maxX="" maxY="" allocReadMember="false" isDynamic="false">
<attributes name="offCommandProgress" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="false" isDynamic="false">
<dataType xsi:type="pogoDsl:UShortType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
......@@ -277,7 +281,7 @@
<properties description="Percentage progress implemented for commands that result in state/mode transitions for a large &#xA;number of components and/or are executed in stages (e.g power up, power down)" label="Progress percentage for the Off command" unit="" standardUnit="" displayUnit="" format="" maxValue="100" minValue="0" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
<eventCriteria relChange="" absChange="10" period=""/>
</attributes>
<attributes name="standbyCommandProgress" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="3000" maxX="" maxY="" allocReadMember="false" isDynamic="false">
<attributes name="standbyCommandProgress" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="false" isDynamic="false">
<dataType xsi:type="pogoDsl:UShortType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
......@@ -340,7 +344,7 @@
<properties description="Report the measured duration of the Standby command" label="Measured duration (sec) of the Standby command" unit="" standardUnit="" displayUnit="" format="" maxValue="100" minValue="0" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
<eventCriteria relChange="" absChange="0" period=""/>
</attributes>
<attributes name="onCmdTimeoutExpired" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="2000" maxX="" maxY="" allocReadMember="true" isDynamic="false">
<attributes name="onCmdTimeoutExpired" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:BooleanType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
......@@ -349,7 +353,7 @@
<properties description="Signal the occurence of a timeout during the execution of the on command." label="On execution timeout flag" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
<eventCriteria relChange="" absChange="1" period=""/>
</attributes>
<attributes name="offCmdTimeoutExpired" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="2000" maxX="" maxY="" allocReadMember="true" isDynamic="false">
<attributes name="offCmdTimeoutExpired" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:BooleanType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
......@@ -358,7 +362,7 @@
<properties description="Signal the occurence of a timeout during the execution of the Off command." label="Off execution timeout flag" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
<eventCriteria relChange="" absChange="1" period=""/>
</attributes>
<attributes name="standbyCmdTimeoutExpired" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="2000" maxX="" maxY="" allocReadMember="true" isDynamic="false">
<attributes name="standbyCmdTimeoutExpired" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:BooleanType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
......@@ -429,5 +433,7 @@
<status abstract="false" inherited="true" concrete="true"/>
</states>
<preferences docHome="./doc_html" makefileHome="/usr/local/share/pogo/preferences"/>
<overlodedPollPeriodObject name="adminMode" type="attribute" pollPeriod="0"/>
<overlodedPollPeriodObject name="adminMode" type="attribute" pollPeriod="0"/>
</classes>
</pogoDsl:PogoSystem>
......@@ -11,7 +11,8 @@ source = cspse
[tool:pytest]
testpaths = tests
addopts = --cov=cspse
addopts = --verbose
--cov=cspse
--json-report
--json-report-file=htmlcov/report.json
--cov-report=term
......@@ -21,6 +22,9 @@ addopts = --cov=cspse
junit_family=legacy
console_output_style = progress
[coverage:report]
show_missing = True
# Define `python setup.py build_sphinx`
[build_sphinx]
source-dir = docs
......
......@@ -273,3 +273,15 @@ class TestCspSubElementMaster(object):
assert tango_context.device.offCmdDurationExpected == 30
assert tango_context.device.standbyCmdDurationExpected == 30
def test_set_command_duration_expected(self, tango_context):
"""Test xxxCmdDurationExpected attributes"""
tango_context.device.onCmdDurationExpected = 20
tango_context.device.offCmdDurationExpected = 20
tango_context.device.standbyCmdDurationExpected = 20
# wait to let the polling thread update the attrs value
time.sleep(3)
assert tango_context.device.onCmdDurationExpected == 20
assert tango_context.device.offCmdDurationExpected == 20
assert tango_context.device.standbyCmdDurationExpected == 20
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment