diff --git a/cspse/__init__.py b/cspse/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/cspse/lmc/__init__.py b/cspse/lmc/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/cspse/lmc/release.py b/cspse/lmc/release.py new file mode 100755 index 0000000000000000000000000000000000000000..4e495d00490bd3ef9f828c5ab710d763585063e4 --- /dev/null +++ b/cspse/lmc/release.py @@ -0,0 +1,20 @@ +# -*- 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-subelement""" +version = "0.1.0" +version_info = version.split(".") +description = """SKA CSP Sub-element 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""" diff --git a/cspse/lmc/subelement_master.py b/cspse/lmc/subelement_master.py new file mode 100644 index 0000000000000000000000000000000000000000..9cabff7db254db6396e58487c3eec14532417408 --- /dev/null +++ b/cspse/lmc/subelement_master.py @@ -0,0 +1,647 @@ +# -*- coding: utf-8 -*- +# +# This file is part of the CspSubElementMaster project +# +# INAF-SKA Telescope +# +# Distributed under the terms of the GPL license. +# See LICENSE.txt for more info. + +""" CSP.LMC Sub-element Master + +A base class for the Master of a SKA Sub-element. +""" + +# 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 collections import defaultdict +# Additional import +# PROTECTED REGION ID(CspSubElementMaster.additionnal_import) ENABLED START # +from ska.base.SKAMaster import SKAMaster +from ska.base.control_model import HealthState, AdminMode, LoggingLevel +from csp_lmc_common.cspcommons.utils import CmdExecState +# PROTECTED REGION END # // CspSubElementMaster.additionnal_import + +__all__ = ["CspSubElementMaster", "main"] + + +class CspSubElementMaster(SKAMaster): + """ + A base class for the Master of a SKA Sub-element. + + **Properties:** + + - Device Property + """ + # PROTECTED REGION ID(CspSubElementMaster.class_variable) ENABLED START # + # PROTECTED REGION END # // CspSubElementMaster.class_variable + + # ----------------- + # Device Properties + # ----------------- + + # ---------- + # Attributes + # ---------- + + 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="Failure flag set when the On command fails with error(s).", + ) + + onFailureMessage = attribute( + dtype='DevString', + label="On execution failure message", + doc="Failure message when the On command fails with error(s).", + ) + + offCmdFailure = attribute( + dtype='DevBoolean', + label="Off execution failure flag", + polling_period=1000, + doc="Failure flag set when the Off command fails with error(s).", + ) + + offFailureMessage = attribute( + dtype='DevString', + label="Off execution failure message", + doc="Failure message when the Off command fails with error(s).", + ) + + standbyCmdFailure = attribute( + dtype='DevBoolean', + label="Standby execution failure message", + polling_period=1000, + doc="Failure flag set when the Standby command fails with error(s).", + ) + + standbyFailureMessage = attribute( + dtype='DevString', + label="Standby execution failure message", + doc="Failure message when the Standby command fails with error(s).", + ) + + 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.", + ) + + 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 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 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 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 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 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 of the Standby command", + ) + + onCmdTimeoutExpired = attribute( + dtype='DevBoolean', + label="On execution timeout flag", + polling_period=2000, + abs_change=1, + 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, + abs_change=1, + 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, + abs_change=1, + doc="Signal the occurence of a timeout during the execution of the Standby command.", + ) + + listOfDevCompletedTask = attribute( + dtype=('DevString',), + max_dim_x=100, + label="List of devices that completed the task", + doc="List of devices that completed the task", + ) + + listOfComponents = attribute( + dtype=('DevString',), + max_dim_x=100, + label="List of sub-element components", + doc="The list o the FQDNs of the sub-element components.", + ) + + # --------------- + # General methods + # --------------- + + def init_device(self): + """Initialises the attributes and properties of the CspSubElementMaster.""" + SKAMaster.init_device(self) + # PROTECTED REGION ID(CspSubElementMaster.init_device) ENABLED START # + # PROTECTED REGION ID(CspSubElementMaster.init_device) ENABLED START # + # _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) + # _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) + + # _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 sub-element 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: []) + + # _list_of_components: report the list of subordinate + # sub-element components. + # Implemented as a dictionary + # keys: the command name ('on', 'off',...) + # values: the list of components + self._list_of_components = defaultdict(lambda: []) + + # _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) + + # the last executed command + self._last_executed_command = "" + + # PROTECTED REGION END # // CspSubElementMaster.init_device + + def always_executed_hook(self): + """Method always executed before any TANGO command is executed.""" + # PROTECTED REGION ID(CspSubElementMaster.always_executed_hook) ENABLED START # + # PROTECTED REGION END # // CspSubElementMaster.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(CspSubElementMaster.delete_device) ENABLED START # + # PROTECTED REGION END # // CspSubElementMaster.delete_device + # ------------------ + # Attributes methods + # ------------------ + + def read_numOfDevCompletedTask(self): + # PROTECTED REGION ID(CspSubElementMaster.numOfDevCompletedTask_read) ENABLED START # + """Return the numOfDevCompletedTask attribute.""" + return self._num_dev_completed_task + # PROTECTED REGION END # // CspSubElementMaster.numOfDevCompletedTask_read + + def read_onCmdFailure(self): + # PROTECTED REGION ID(CspSubElementMaster.onCmdFailure_read) ENABLED START # + """Return the onCmdFailure attribute.""" + return self._failure_raised['on'] + # PROTECTED REGION END # // CspSubElementMaster.onCmdFailure_read + + def read_onFailureMessage(self): + # PROTECTED REGION ID(CspSubElementMaster.onFailureMessage_read) ENABLED START # + """Return the onFailureMessage attribute.""" + return self._failure_message['on'] + # PROTECTED REGION END # // CspSubElementMaster.onFailureMessage_read + + def read_offCmdFailure(self): + # PROTECTED REGION ID(CspSubElementMaster.offCmdFailure_read) ENABLED START # + """Return the offCmdFailure attribute.""" + return self._failure_raised['off'] + # PROTECTED REGION END # // CspSubElementMaster.offCmdFailure_read + + def read_offFailureMessage(self): + # PROTECTED REGION ID(CspSubElementMaster.offFailureMessage_read) ENABLED START # + """Return the offFailureMessage attribute.""" + return self._failure_message['off'] + # PROTECTED REGION END # // CspSubElementMaster.offFailureMessage_read + + def read_standbyCmdFailure(self): + # PROTECTED REGION ID(CspSubElementMaster.standbyCmdFailure_read) ENABLED START # + """Return the standbyCmdFailure attribute.""" + return self._failure_message['standby'] + # PROTECTED REGION END # // CspSubElementMaster.standbyCmdFailure_read + + def read_standbyFailureMessage(self): + # PROTECTED REGION ID(CspSubElementMaster.standbyFailureMessage_read) ENABLED START # + """Return the standbyFailureMessage attribute.""" + return self._failure_message['standby'] + # PROTECTED REGION END # // CspSubElementMaster.standbyFailureMessage_read + + def read_adminMode(self): + # PROTECTED REGION ID(CspSubElementMaster.adminMode_read) ENABLED START # + """Return the adminMode attribute.""" + return self._admin_mode + # PROTECTED REGION END # // CspSubElementMaster.adminMode_read + + def write_adminMode(self, value): + # PROTECTED REGION ID(CspSubElementMaster.adminMode_write) ENABLED START # + """Set the adminMode attribute.""" + self._admin_mode = value + # PROTECTED REGION END # // CspSubElementMaster.adminMode_write + + def read_onCommandProgress(self): + # PROTECTED REGION ID(CspSubElementMaster.onCommandProgress_read) ENABLED START # + """Return the onCommandProgress attribute.""" + return self._cmd_progress['on'] + # PROTECTED REGION END # // CspSubElementMaster.onCommandProgress_read + + def read_offCommandProgress(self): + # PROTECTED REGION ID(CspSubElementMaster.offCommandProgress_read) ENABLED START # + """Return the offCommandProgress attribute.""" + return self._cmd_progress['off'] + # PROTECTED REGION END # // CspSubElementMaster.offCommandProgress_read + + def read_standbyCommandProgress(self): + # PROTECTED REGION ID(CspSubElementMaster.standbyCommandProgress_read) ENABLED START # + """Return the standbyCommandProgress attribute.""" + return self._cmd_progress['standby'] + # PROTECTED REGION END # // CspSubElementMaster.standbyCommandProgress_read + + def read_onCmdDurationExpected(self): + # PROTECTED REGION ID(CspSubElementMaster.onCmdDurationExpected_read) ENABLED START # + """Return the onCmdDurationExpected attribute.""" + return self._cmd_duration_expected['on'] + # PROTECTED REGION END # // CspSubElementMaster.onCmdDurationExpected_read + + def write_onCmdDurationExpected(self, value): + # PROTECTED REGION ID(CspSubElementMaster.onCmdDurationExpected_write) ENABLED START # + """Set the onCmdDurationExpected attribute.""" + self._cmd_duration_expected['on'] = value + # PROTECTED REGION END # // CspSubElementMaster.onCmdDurationExpected_write + + def read_offCmdDurationExpected(self): + # PROTECTED REGION ID(CspSubElementMaster.offCmdDurationExpected_read) ENABLED START # + """Return the offCmdDurationExpected attribute.""" + return self._cmd_duration_expected['off'] + # PROTECTED REGION END # // CspSubElementMaster.offCmdDurationExpected_read + + def write_offCmdDurationExpected(self, value): + # PROTECTED REGION ID(CspSubElementMaster.offCmdDurationExpected_write) ENABLED START # + """Set the offCmdDurationExpected attribute.""" + self._cmd_duration_expected['off'] = value + # PROTECTED REGION END # // CspSubElementMaster.offCmdDurationExpected_write + + def read_standbyCmdDurationExpected(self): + # PROTECTED REGION ID(CspSubElementMaster.standbyCmdDurationExpected_read) ENABLED START # + """Return the standbyCmdDurationExpected attribute.""" + return self._cmd_duration_expected['standby'] + # PROTECTED REGION END # // CspSubElementMaster.standbyCmdDurationExpected_read + + def write_standbyCmdDurationExpected(self, value): + # PROTECTED REGION ID(CspSubElementMaster.standbyCmdDurationExpected_write) ENABLED START # + """Set the standbyCmdDurationExpected attribute.""" + self._cmd_duration_expected['standby'] = value + # PROTECTED REGION END # // CspSubElementMaster.standbyCmdDurationExpected_write + + def read_onCmdDurationMeasured(self): + # PROTECTED REGION ID(CspSubElementMaster.onCmdDurationMeasured_read) ENABLED START # + """Return the onCmdDurationMeasured attribute.""" + return self._cmd_duration_measured['on']return self._cmd_duration_measured['on'] + # PROTECTED REGION END # // CspSubElementMaster.onCmdDurationMeasured_read + + def read_offCmdDurationMeasured(self): + # PROTECTED REGION ID(CspSubElementMaster.offCmdDurationMeasured_read) ENABLED START # + """Return the offCmdDurationMeasured attribute.""" + return self._cmd_duration_measured['off'] + # PROTECTED REGION END # // CspSubElementMaster.offCmdDurationMeasured_read + + def read_standbyCmdDurationMeasured(self): + # PROTECTED REGION ID(CspSubElementMaster.standbyCmdDurationMeasured_read) ENABLED START # + """Return the standbyCmdDurationMeasured attribute.""" + return self._cmd_duration_measured['standby'] + # PROTECTED REGION END # // CspSubElementMaster.standbyCmdDurationMeasured_read + + def read_onCmdTimeoutExpired(self): + # PROTECTED REGION ID(CspSubElementMaster.onCmdTimeoutExpired_read) ENABLED START # + """Return the onCmdTimeoutExpired attribute.""" + return self._timeout_expired['on'] + # PROTECTED REGION END # // CspSubElementMaster.onCmdTimeoutExpired_read + + def read_offCmdTimeoutExpired(self): + # PROTECTED REGION ID(CspSubElementMaster.offCmdTimeoutExpired_read) ENABLED START # + """Return the offCmdTimeoutExpired attribute.""" + return self._timeout_expired['off'] + + # PROTECTED REGION END # // CspSubElementMaster.offCmdTimeoutExpired_read + + def read_standbyCmdTimeoutExpired(self): + # PROTECTED REGION ID(CspSubElementMaster.standbyCmdTimeoutExpired_read) ENABLED START # + """Return the standbyCmdTimeoutExpired attribute.""" + return self._timeout_expired['standby'] + # PROTECTED REGION END # // CspSubElementMaster.standbyCmdTimeoutExpired_read + + def read_listOfDevCompletedTask(self): + # PROTECTED REGION ID(CspSubElementMaster.listOfDevCompletedTask_read) ENABLED START # + """Return the listOfDevCompletedTask attribute.""" + return self._list_dev_completed_task + # PROTECTED REGION END # // CspSubElementMaster.listOfDevCompletedTask_read + + def read_listOfComponents(self): + # PROTECTED REGION ID(CspSubElementMaster.listOfComponents_read) ENABLED START # + """Return the listOfComponents attribute.""" + return self._list_of_components + # PROTECTED REGION END # // CspSubElementMaster.listOfComponents_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="The list of sub-element components FQDNs to switch-on or an empty list to switch-on the whole " + "CSP Sub-element." + " " + "If the array length is 0, the command applies to the whole CSP Sub-Element. If the " + "array length is > 1, each array element specifies the FQDN of the" + "CSP SubElement component to switch ON.", + ) + @DebugIt() + def On(self, argin): + # PROTECTED REGION ID(CspSubElementMaster.On) ENABLED START # + """ + Switch-on the CSP sub-element components specified by the input argument. If no argument is + specified, the command is issued on all the CSP sub-element components. + 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. + + :param argin: 'DevVarStringArray' + The list of sub-element components FQDNs to switch-on or an empty list to switch-on the whole + CSP Sub-element. + + If the array length is 0, the command applies to the whole CSP Sub-Element. If the + array length is > 1, each array element specifies the FQDN of the + CSP SubElement component to switch ON. + + :return:None + """ + pass + # PROTECTED REGION END # // CspSubElementMaster.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 Sub-element." + "If the array length is > 1, each array element specifies the FQDN of the" + "CSP SubElement component to switch OFF.", + ) + @DebugIt() + def Off(self, argin): + # PROTECTED REGION ID(CspSubElementMaster.Off) ENABLED START # + """ + Switch-off the CSP sub-element components specified by the input argument. + If no argument is specified, the command is issued to all the CSP + sub-element components. + + :param argin: 'DevVarStringArray' + If the array length is 0, the command applies to the whole + CSP Sub-element. + If the array length is > 1, each array element specifies the FQDN of the + CSP SubElement component to switch OFF. + + :return:None + """ + pass + # PROTECTED REGION END # // CspSubElementMaster.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 sub-element." + "If the array length is > 1, each array element specifies the FQDN of the" + "CSP SubElement icomponent to put in STANDBY mode.", + ) + @DebugIt() + def Standby(self, argin): + # PROTECTED REGION ID(CspSubElementMaster.Standby) ENABLED START # + """ + Transit the CSP Sub-element or one or more CSP SubElement components from ON/OFF to + STANDBY. + + :param argin: 'DevVarStringArray' + If the array length is 0, the command applies to the whole + CSP sub-element. + If the array length is > 1, each array element specifies the FQDN of the + CSP SubElement icomponent to put in STANDBY mode. + + :return:None + """ + pass + # PROTECTED REGION END # // CspSubElementMaster.Standby + + @command( + ) + @DebugIt() + def Upgrade(self): + # PROTECTED REGION ID(CspSubElementMaster.Upgrade) ENABLED START # + """ + + :return:None + """ + pass + # PROTECTED REGION END # // CspSubElementMaster.Upgrade + +# ---------- +# Run server +# ---------- + + +def main(args=None, **kwargs): + """Main function of the CspSubElementMaster module.""" + # PROTECTED REGION ID(CspSubElementMaster.main) ENABLED START # + return run((CspSubElementMaster,), args=args, **kwargs) + # PROTECTED REGION END # // CspSubElementMaster.main + + +if __name__ == '__main__': + main() diff --git a/pogo/CspSubElementMaster.xmi b/pogo/CspSubElementMaster.xmi new file mode 100644 index 0000000000000000000000000000000000000000..567b8c2bd59b6d334d04ccc23f231cbabdf7f585 --- /dev/null +++ b/pogo/CspSubElementMaster.xmi @@ -0,0 +1,433 @@ +<?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"> + <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"/> + <identification contact="at inaf.it - elisabetta.giani" author="elisabetta.giani" emailDomain="inaf.it" classFamily="SKA Sub-element Classes" siteSpecific="" platform="All Platforms" bus="Not Applicable" manufacturer="INAF-OAA" reference=""/> + </description> + <deviceProperties name="SkaLevel" description="Indication of importance of the device in the SKA hierarchy 
to support drill-down navigation: 1..6, with 1 highest.
Default is 4, making provision for 
EltMaster, EltAlarms, EltTelState = 1
SubEltMaster = 2
Subarray, Capability = 2/3
Others = 4 (or 5 or 6)"> + <type xsi:type="pogoDsl:ShortType"/> + <status abstract="false" inherited="true" concrete="true"/> + <DefaultPropValue>4</DefaultPropValue> + </deviceProperties> + <deviceProperties name="LoggingLevelDefault" description="Default logging level at device startup.
(0=OFF, 1=FATAL, 2=ERROR, 3=WARNING, 4=INFO, 5=DEBUG)"> + <type xsi:type="pogoDsl:UShortType"/> + <status abstract="false" inherited="true" concrete="true"/> + <DefaultPropValue>4</DefaultPropValue> + </deviceProperties> + <deviceProperties name="LoggingTargetsDefault" description="Default logging targets at device startup.
Each item has the format: target_type::target_name.
To log to stdout, use 'console::cout'.
To log to syslog, use 'syslog::<address>',
 where <address> is a file path,
 for example 'syslog::/var/run/rsyslog/dev/log'.
To log to a file, use 'file::<path>',
 where <path> is a file path,
 for example 'file::/tmp/my_dev.log'."> + <type xsi:type="pogoDsl:StringVectorType"/> + <status abstract="false" inherited="true" concrete="true"/> + </deviceProperties> + <deviceProperties name="GroupDefinitions" description="Each string in the list is a JSON serialised dict defining the ``group_name``,
``devices`` and ``subgroups`` in the group. A TANGO Group object is created
for each item in the list, according to the hierarchy defined. This provides
easy access to the managed devices in bulk, or individually.

The general format of the list is as follows, with optional ``devices`` and
``subgroups`` keys:
 [ {``group_name``: ``<name>``,
 ``devices``: [``<dev name>``, ...]},
 {``group_name``: ``<name>``,
 ``devices``: [``<dev name>``, ``<dev name>``, ...],
 ``subgroups`` : [{<nested group>},
 {<nested group>}, ...]},
 ...
 ]

For example, a hierarchy of racks, servers and switches:
 [ {``group_name``: ``servers``,
 ``devices``: [``elt/server/1``, ``elt/server/2``,
 ``elt/server/3``, ``elt/server/4``]},
 {``group_name``: ``switches``,
 ``devices``: [``elt/switch/A``, ``elt/switch/B``]},
 {``group_name``: ``pdus``,
 ``devices``: [``elt/pdu/rackA``, ``elt/pdu/rackB``]},
 {``group_name``: ``racks``,
 ``subgroups``: [
 {``group_name``: ``rackA``,
 ``devices``: [``elt/server/1``, ``elt/server/2``,
 ``elt/switch/A``, ``elt/pdu/rackA``]},
 {``group_name``: ``rackB``,
 ``devices``: [``elt/server/3``, ``elt/server/4``,
 ``elt/switch/B``, ``elt/pdu/rackB``],
 ``subgroups``: []}
 ]} ]"> + <type xsi:type="pogoDsl:StringVectorType"/> + <status abstract="false" inherited="true" concrete="true"/> + </deviceProperties> + <deviceProperties name="NrSubarrays" description="Number of subarrays in the element; Default: 16"> + <type xsi:type="pogoDsl:UShortType"/> + <status abstract="false" inherited="true" concrete="true"/> + <DefaultPropValue>16</DefaultPropValue> + </deviceProperties> + <deviceProperties name="CapabilityTypes" description="Types of capabilities in this Element; e.g. Correlators, PssBeams, PstBeams, VlbiBeams"> + <type xsi:type="pogoDsl:StringVectorType"/> + <status abstract="false" inherited="true" concrete="true"/> + </deviceProperties> + <deviceProperties name="MaxCapabilities" description="List of maximum number of instances per capability type provided by this Element;
CORRELATOR=512, PSS-BEAMS=4, PST-BEAMS=6, VLBI-BEAMS=4 or for DSH it can be: 
BAND-1=1, BAND-2=1, BAND3=0, BAND-4=0, BAND-5=0 (if only bands 1&amp;2 is installed)"> + <type xsi:type="pogoDsl:StringVectorType"/> + <status abstract="false" inherited="true" concrete="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"/> + </argin> + <argout description="Device state"> + <type xsi:type="pogoDsl:StateType"/> + </argout> + <status abstract="true" inherited="true" concrete="true"/> + </commands> + <commands name="Status" description="This command gets the device status (stored in its device_status data member) and returns it to the caller." execMethod="dev_status" displayLevel="OPERATOR" polledPeriod="0"> + <argin description="none"> + <type xsi:type="pogoDsl:VoidType"/> + </argin> + <argout description="Device status"> + <type xsi:type="pogoDsl:ConstStringType"/> + </argout> + <status abstract="true" inherited="true" concrete="true"/> + </commands> + <commands name="GetVersionInfo" description="Array of version strings of all entities modelled by this device. 
(One level down only)
Each string in the array lists the version info for one entity
managed by this device. 
The first entry is version info for this TANGO Device itself.
The entities may be TANGO devices, or hardware LRUs or 
anything else this devices manages/models.
The intention with this command is that it can provide more 
detailed information than can be captured in the versionId 
and buildState attributes, if necessary.
In the minimal case the GetVersionInfo will contain only the 
versionId and buildState attributes of the next lower level
entities." execMethod="get_version_info" displayLevel="OPERATOR" polledPeriod="0"> + <argin description=""> + <type xsi:type="pogoDsl:VoidType"/> + </argin> + <argout description="[ name: EltTelState"> + <type xsi:type="pogoDsl:StringArrayType"/> + </argout> + <status abstract="false" inherited="true" concrete="true"/> + </commands> + <commands name="isCapabilityAchievable" description="" execMethod="is_capability_achievable" displayLevel="OPERATOR" polledPeriod="0"> + <argin description="[nrInstances][Capability types]"> + <type xsi:type="pogoDsl:LongStringArrayType"/> + </argin> + <argout description=""> + <type xsi:type="pogoDsl:BooleanType"/> + </argout> + <status abstract="false" inherited="true" concrete="true"/> + </commands> + <commands name="Reset" description="Reset device to its default state" execMethod="reset" displayLevel="OPERATOR" polledPeriod="0"> + <argin description=""> + <type xsi:type="pogoDsl:VoidType"/> + </argin> + <argout description=""> + <type xsi:type="pogoDsl:VoidType"/> + </argout> + <status abstract="false" inherited="true" concrete="true"/> + </commands> + <commands name="On" description="Switch-on the CSP sub-element components specified by the input argument. If no argument is
specified, the command is issued on all the CSP sub-element components.
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." execMethod="on" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false"> + <argin description="The list of sub-element components FQDNs to switch-on or an empty list to switch-on the whole 
CSP Sub-element.
 
If the array length is 0, the command applies to the whole CSP Sub-Element. If the 
array length is > 1, each array element specifies the FQDN of the
CSP SubElement component to switch ON."> + <type xsi:type="pogoDsl:StringArrayType"/> + </argin> + <argout description=""> + <type xsi:type="pogoDsl:VoidType"/> + </argout> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </commands> + <commands name="Off" description="Switch-off the CSP sub-element components specified by the input argument. 
If no argument is specified, the command is issued to all the CSP 
sub-element components." execMethod="off" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false"> + <argin description="If the array length is 0, the command applies to the whole
CSP Sub-element.
If the array length is > 1, each array element specifies the FQDN of the
CSP SubElement component to switch OFF."> + <type xsi:type="pogoDsl:StringArrayType"/> + </argin> + <argout description=""> + <type xsi:type="pogoDsl:VoidType"/> + </argout> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </commands> + <commands name="Standby" description="Transit the CSP Sub-element or one or more CSP SubElement components from ON/OFF to 
STANDBY." execMethod="standby" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false"> + <argin description="If the array length is 0, the command applies to the whole
CSP sub-element.
If the array length is > 1, each array element specifies the FQDN of the
CSP SubElement icomponent to put in STANDBY mode."> + <type xsi:type="pogoDsl:StringArrayType"/> + </argin> + <argout description=""> + <type xsi:type="pogoDsl:VoidType"/> + </argout> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </commands> + <commands name="Upgrade" description="" execMethod="upgrade" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false"> + <argin description=""> + <type xsi:type="pogoDsl:VoidType"/> + </argin> + <argout description=""> + <type xsi:type="pogoDsl:VoidType"/> + </argout> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + </commands> + <attributes name="elementLoggerAddress" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="60000" maxX="" maxY="" allocReadMember="true"> + <dataType xsi:type="pogoDsl:StringType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <status abstract="false" inherited="true" concrete="true"/> + <properties description="FQDN of Element Logger" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + </attributes> + <attributes name="elementAlarmAddress" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="60000" maxX="" maxY="" allocReadMember="true"> + <dataType xsi:type="pogoDsl:StringType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <status abstract="false" inherited="true" concrete="true"/> + <properties description="FQDN of Element Alarm Handlers" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + </attributes> + <attributes name="elementTelStateAddress" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="60000" maxX="" maxY="" allocReadMember="true"> + <dataType xsi:type="pogoDsl:StringType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <status abstract="false" inherited="true" concrete="true"/> + <properties description="FQDN of Element TelState device" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + </attributes> + <attributes name="elementDatabaseAddress" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="60000" maxX="" maxY="" allocReadMember="true"> + <dataType xsi:type="pogoDsl:StringType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <status abstract="false" inherited="true" concrete="true"/> + <properties description="FQDN of Element Database device" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + </attributes> + <attributes name="buildState" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="60000" maxX="" maxY="" allocReadMember="true"> + <dataType xsi:type="pogoDsl:StringType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <status abstract="false" inherited="true" concrete="true"/> + <properties description="Build state of this device" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + </attributes> + <attributes name="versionId" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="60000" maxX="" maxY="" allocReadMember="true"> + <dataType xsi:type="pogoDsl:StringType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <status abstract="false" inherited="true" concrete="true"/> + <properties description="Build state of this device" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + </attributes> + <attributes name="numOfDevCompletedTask" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:UShortType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <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"> + <dataType xsi:type="pogoDsl:BooleanType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <properties description="Failure flag set when the On command fails with error(s)." label="CBF command failure flag" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + </attributes> + <attributes name="onFailureMessage" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:StringType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <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"> + <dataType xsi:type="pogoDsl:BooleanType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <properties description="Failure flag set when the Off command fails with error(s)." label="Off execution failure flag" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + </attributes> + <attributes name="offFailureMessage" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:StringType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <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"> + <dataType xsi:type="pogoDsl:BooleanType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <properties description="Failure flag set when the Standby command fails with error(s)." label="Standby execution failure message" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + </attributes> + <attributes name="standbyFailureMessage" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:StringType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <properties description="Failure message when the Standby command fails with error(s)." label="Standby execution failure message" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + </attributes> + <attributes name="loggingLevel" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" allocReadMember="true"> + <dataType xsi:type="pogoDsl:EnumType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <status abstract="false" inherited="true" concrete="true"/> + <properties description="Current logging level for this device - initialises to LoggingLevelDefault on startup" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + </attributes> + <attributes name="healthState" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" allocReadMember="true"> + <dataType xsi:type="pogoDsl:EnumType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <status abstract="false" inherited="true" concrete="true"/> + <properties description="The health state reported for this device. It interprets the current device condition 
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"> + <dataType xsi:type="pogoDsl:EnumType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <status abstract="false" inherited="true" concrete="true" concreteHere="true"/> + <properties description="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." label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + </attributes> + <attributes name="controlMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" memorized="true" allocReadMember="true"> + <dataType xsi:type="pogoDsl:EnumType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <status abstract="false" inherited="true" concrete="true"/> + <properties description="The control mode of the device. REMOTE, LOCAL
TANGO Device accepts only from a ‘local’ client and ignores commands and queries received from TM
or any other ‘remote’ clients. The Local clients has to release LOCAL control before REMOTE clients
can take control again." label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + </attributes> + <attributes name="simulationMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" memorized="true" allocReadMember="true"> + <dataType xsi:type="pogoDsl:EnumType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <status abstract="false" inherited="true" concrete="true"/> + <properties description="Reports the simulation mode of the device. Some devices may implement both modes,
while others will have simulators that set simulationMode to True while the real
devices always set simulationMode to False." label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + </attributes> + <attributes name="testMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" memorized="true" allocReadMember="true"> + <dataType xsi:type="pogoDsl:EnumType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <status abstract="false" inherited="true" concrete="true"/> + <properties description="The test mode of the device. 
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"> + <dataType xsi:type="pogoDsl:UShortType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <properties description="Percentage progress implemented for commands that result in state/mode transitions for a large 
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"> + <dataType xsi:type="pogoDsl:UShortType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <properties description="Percentage progress implemented for commands that result in state/mode transitions for a large 
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"> + <dataType xsi:type="pogoDsl:UShortType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <properties description="Percentage progress implemented for commands that result in state/mode transitions for a large 
number of components and/or are executed in stages (e.g power up, power down)" label="Progress percentage for the Standby command" unit="" standardUnit="" displayUnit="" format="" maxValue="100" minValue="0" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <eventCriteria relChange="" absChange="10" period=""/> + </attributes> + <attributes name="onCmdDurationExpected" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="false" isDynamic="false"> + <dataType xsi:type="pogoDsl:UShortType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <properties description="Set/Report the duration expected for the On command execution" label="Expected duration (sec) of the On command execution" unit="" standardUnit="" displayUnit="" format="" maxValue="100" minValue="0" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <eventCriteria relChange="" absChange="0" period=""/> + </attributes> + <attributes name="offCmdDurationExpected" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="false" isDynamic="false"> + <dataType xsi:type="pogoDsl:UShortType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <properties description="Set/Report the duration expected for the Off command execution" label="Expected duration (sec) of the Off command" unit="" standardUnit="" displayUnit="" format="" maxValue="100" minValue="0" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <eventCriteria relChange="" absChange="0" period=""/> + </attributes> + <attributes name="standbyCmdDurationExpected" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="false" isDynamic="false"> + <dataType xsi:type="pogoDsl:UShortType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <properties description="Set/Report the duration expected for the Standby command" label="Expected 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="onCmdDurationMeasured" 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"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <properties description="Report the measured duration of the On command execution" label="Measured duration (sec) of the On command execution" unit="" standardUnit="" displayUnit="" format="" maxValue="100" minValue="0" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <eventCriteria relChange="" absChange="0" period=""/> + </attributes> + <attributes name="offCmdDurationMeasured" 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"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <properties description="Report the measured duration of the Off command execution" label="Measured duration (sec) of the Off command" unit="" standardUnit="" displayUnit="" format="" maxValue="100" minValue="0" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <eventCriteria relChange="" absChange="0" period=""/> + </attributes> + <attributes name="standbyCmdDurationMeasured" 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"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <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"> + <dataType xsi:type="pogoDsl:BooleanType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <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"> + <dataType xsi:type="pogoDsl:BooleanType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <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"> + <dataType xsi:type="pogoDsl:BooleanType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <properties description="Signal the occurence of a timeout during the execution of the Standby command." label="Standby execution timeout flag." unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + <eventCriteria relChange="" absChange="1" period=""/> + </attributes> + <attributes name="maxCapabilities" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="20" maxY="" allocReadMember="true"> + <dataType xsi:type="pogoDsl:StringType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <status abstract="false" inherited="true" concrete="true"/> + <properties description="Maximum number of instances of each capability type, e.g. 'CORRELATOR:512', 'PSS-BEAMS:4'." label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + </attributes> + <attributes name="availableCapabilities" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="20" maxY="" allocReadMember="true"> + <dataType xsi:type="pogoDsl:StringType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <status abstract="false" inherited="true" concrete="true"/> + <properties description="A list of available number of instances of each capability type, e.g. 'CORRELATOR:512', 'PSS-BEAMS:4'." label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + </attributes> + <attributes name="listOfDevCompletedTask" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="100" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:StringType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <properties description="List of devices that completed the task" label="List of devices that completed the task" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + </attributes> + <attributes name="loggingTargets" attType="Spectrum" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="3" maxY="" allocReadMember="true"> + <dataType xsi:type="pogoDsl:StringType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <status abstract="false" inherited="true" concrete="true"/> + <properties description="Logging targets for this device, excluding ska_logging defaults - 
initialises to LoggingTargetsDefault on startup" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + </attributes> + <attributes name="listOfComponents" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="100" maxY="" allocReadMember="true" isDynamic="false"> + <dataType xsi:type="pogoDsl:StringType"/> + <changeEvent fire="false" libCheckCriteria="false"/> + <archiveEvent fire="false" libCheckCriteria="false"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> + <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> + <properties description="The list o the FQDNs of the sub-element components." label="List of sub-element components" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> + </attributes> + <states name="ON" description="This state could have been called OK or OPERATIONAL. It means that the device is in its operational state. (E.g. the power supply is giving its nominal current, th motor is ON and ready to move, the instrument is operating). This state is modified by the Attribute alarm checking of the DeviceImpl:dev_state method. i.e. if the State is ON and one attribute has its quality factor to ATTR_WARNING or ATTR_ALARM, then the State is modified to ALARM."> + <status abstract="false" inherited="true" concrete="true"/> + </states> + <states name="OFF" description="The device is in normal condition but is not active. E.g. the power supply main circuit breaker is open; the RF transmitter has no power etc..."> + <status abstract="false" inherited="true" concrete="true"/> + </states> + <states name="FAULT" description="The device has a major failure that prevents it to work. For instance, A power supply has stopped due to over temperature A motor cannot move because it has fault conditions. Usually we cannot get out from this state without an intervention on the hardware or a reset command."> + <status abstract="false" inherited="true" concrete="true"/> + </states> + <states name="INIT" description="This state is reserved to the starting phase of the device server. It means that the software is not fully operational and that the user must wait"> + <status abstract="false" inherited="true" concrete="true"/> + </states> + <states name="ALARM" description="ALARM - The device is operating but
at least one of the attributes is out of range. It can be linked to alarm conditions set by attribute properties or a specific case. (E.g. temperature alarm on a stepper motor, end switch pressed on a stepper motor, up water level in a tank, etc....). In alarm, usually the device does its job, but the operator has to perform an action to avoid a bigger problem that may switch the state to FAULT."> + <status abstract="false" inherited="true" concrete="true"/> + </states> + <states name="UNKNOWN" description="The device cannot retrieve its state. It is the case when there is a communication problem to the hardware (network cut, broken cable etc...) It could also represent an incoherent situation"> + <status abstract="false" inherited="true" concrete="true"/> + </states> + <states name="STANDBY" description="Equates to LOW-POWER mode. This is the initial transition from INIT if the device supports a low-power mode. The device is not fully active but is ready to operate."> + <status abstract="false" inherited="true" concrete="true"/> + </states> + <states name="DISABLE" description="The device cannot be switched ON for an external reason. E.g. the power supply has its door open, the safety conditions are not satisfactory to allow the device to operate."> + <status abstract="false" inherited="true" concrete="true"/> + </states> + <preferences docHome="./doc_html" makefileHome="/usr/local/share/pogo/preferences"/> + </classes> +</pogoDsl:PogoSystem> diff --git a/setup.cfg b/setup.cfg index 3f0083ccde8be19b671d6e977b83151763b5c1ea..428ca67b3a5faefd4367cd0cd16a75311aee9d45 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,7 +7,7 @@ test=pytest [coverage:run] branch = True -source = ska_python_skeleton +source = cspse [tool:pytest] testpaths = tests diff --git a/setup.py b/setup.py index 9a9bf5815a08e7614932c6c078d1fde0abaa0a1a..0f0f99b65bf5829eea247102e0b000f28d65f84a 100644 --- a/setup.py +++ b/setup.py @@ -6,34 +6,36 @@ from setuptools import setup with open('README.md') as readme_file: readme = readme_file.read() +RELEASE_FILENAME = os.path.join(setup_dir, 'cspse','lmc','release.py') +exec(open(RELEASE_FILENAME).read(), INFO) 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'}, + 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", include_package_data=True, license="BSD license", zip_safe=False, classifiers=[ - 'Development Status :: 2 - Pre-Alpha', + 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', - 'License :: OSI Approved :: BSD License', + 'Operating System :: POSIX :: Linux', + 'License :: Other/Proprietary 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 + install_requires=[ + 'pytango >=9.3.1', + 'future', + 'lmcbaseclasses > 0.5.0', + ], setup_requires=[ # dependency for `python setup.py test` 'pytest-runner', @@ -46,6 +48,7 @@ setup( 'pytest-cov', 'pytest-json-report', 'pycodestyle', + 'mock' ], extras_require={ 'dev': ['prospector[with_pyroma]', 'yapf', 'isort'], diff --git a/ska_python_skeleton/__init__.py b/ska_python_skeleton/__init__.py deleted file mode 100644 index 82e49f1ad3ed1e40ba856944b5ae80363654a869..0000000000000000000000000000000000000000 --- a/ska_python_skeleton/__init__.py +++ /dev/null @@ -1,9 +0,0 @@ -# -*- coding: utf-8 -*- - -"""Module init code.""" - - -__version__ = '0.0.0' - -__author__ = 'Your Name' -__email__ = 'your.email@mail.com' diff --git a/ska_python_skeleton/ska_python_skeleton.py b/ska_python_skeleton/ska_python_skeleton.py deleted file mode 100644 index 7dd613e2c0084d4a358082667939c3fb70b994b7..0000000000000000000000000000000000000000 --- a/ska_python_skeleton/ska_python_skeleton.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- - -#"""Define function placeholders and test function examples.""" - - -# TODO: Replace all the following code with the desired functionality for the package -def function_example(): - """Example: function outside of a class""" - - -# TODO: Replace all the following code with the desired functionality for the package -class SKA: - """Define class, methods etc""" - - something = 0 - - def example(self): - """Example: Define non return function for subsequent test.""" - - def example_2(self): - """Example: Define function for subsequent test with specific return value.""" - return 2