Commit cb028f5d authored by Elisabetta Giani's avatar Elisabetta Giani
Browse files

AT5-262: Update lmcbaseclasses to 0.2.0 version.

parent bf4a086b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
*.sav
*.swp
*.py[cod]
*.egg-info
*.eggs
+3 −3
Original line number Diff line number Diff line
@@ -474,6 +474,7 @@ class CspMaster(with_metaclass(DeviceMeta, SKAMaster)):
        self._num_dev_completed_task[cmd_name] = 0
        self._list_dev_completed_task[cmd_name] = []
        self._cmd_progress[cmd_name] = 0
        self._cmd_duration_measuredcmd_name] = 0
        # sub-element command execution measured time
        se_cmd_duration_measured = defaultdict(lambda:defaultdict(lambda:0))
        # loop on the devices and power-on them sequentially
@@ -517,8 +518,6 @@ class CspMaster(with_metaclass(DeviceMeta, SKAMaster)):
                        self._se_cmd_execution_state[device][cmd_name] = CmdExecState.IDLE
                        se_cmd_duration_measured[device][cmd_name] = (time.time() 
                                                                      - self._se_cmd_starting_time[device])
                        # calculate the real execution time for the command
                        self._cmd_duration_measured[cmd_name] += se_cmd_duration_measured[device][cmd_name]
                        print("measured duration:", se_cmd_duration_measured[device][cmd_name])
                        # The event_id dictionary uses the attribute name in lower case letters as
                        # dictionary key
@@ -567,7 +566,6 @@ class CspMaster(with_metaclass(DeviceMeta, SKAMaster)):
                        self.dev_logging(msg, tango.LogLevel.LOG_WARN)
                        self._se_cmd_execution_state[device][cmd_name] = CmdExecState.TIMEOUT       
                        num_of_failed_device += 1
                        self._se_cmd_execution_state[device][cmd_name] = CmdExecState.IDLE
                        # if the CBF command timeout expires, the CSP power-on is stopped
                        # TODO: verify if this behavior conflicts with ICD
                        print("elapsed_time:{} device {}".format(elapsed_time, device))
@@ -585,6 +583,8 @@ class CspMaster(with_metaclass(DeviceMeta, SKAMaster)):
                    # 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
                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:
+26 −16
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
    <description description="CSP.LMC Common Class for the CSPMaster TANGO Device." title="CSP.LMC Common CspMaster" sourcePath="/home/softir/src/ska-git/csp-lmc/csp-lmc-common/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/skabase/SKABaseDevice"/>
      <inheritances classname="SKAMaster" sourcePath="/home/softir/src/tango/lmc-base-classes/skabase/SKAMaster"/>
      <inheritances classname="SKAMaster" sourcePath="../../../lmc-base-classes/skabase/SKAMaster"/>
      <identification contact="at inaf.it - elisabetta.giani" author="elisabetta.giani" emailDomain="inaf.it" classFamily="SkaCsp" siteSpecific="" platform="Unix Like" bus="Not Applicable" manufacturer="none" reference=""/>
    </description>
    <deviceProperties name="SkaLevel" description="Indication of importance of the device in the SKA hierarchy &#xA;to support drill-down navigation: 1..6, with 1 highest.&#xA;Default is 4, making provision for &#xA;EltMaster, EltAlarms, EltTelState = 1&#xA;SubEltMaster = 2&#xA;Subarray, Capability = 2/3&#xA;Others = 4 (or 5 or 6)">
@@ -12,19 +12,6 @@
      <status abstract="false" inherited="true" concrete="true"/>
      <DefaultPropValue>4</DefaultPropValue>
    </deviceProperties>
    <deviceProperties name="CentralLoggingTarget" description="Pre-configured logging target CentralLogger DS">
      <type xsi:type="pogoDsl:StringType"/>
      <status abstract="false" inherited="true" concrete="true"/>
    </deviceProperties>
    <deviceProperties name="ElementLoggingTarget" description="Pre-configured logging target ElementLogger DS">
      <type xsi:type="pogoDsl:StringType"/>
      <status abstract="false" inherited="true" concrete="true"/>
    </deviceProperties>
    <deviceProperties name="StorageLoggingTarget" description="Pre-configured logging target for syslog">
      <type xsi:type="pogoDsl:StringType"/>
      <status abstract="false" inherited="true" concrete="true"/>
      <DefaultPropValue>localhost</DefaultPropValue>
    </deviceProperties>
    <deviceProperties name="GroupDefinitions" description="Each string in the list is a JSON serialised dict defining the ``group_name``,&#xA;``devices`` and ``subgroups`` in the group.  A TANGO Group object is created&#xA;for each item in the list, according to the hierarchy defined.  This provides&#xA;easy access to the managed devices in bulk, or individually.&#xA;&#xA;The general format of the list is as follows, with optional ``devices`` and&#xA;``subgroups`` keys:&#xA;    [ {``group_name``: ``&lt;name>``,&#xA;       ``devices``: [``&lt;dev name>``, ...]},&#xA;      {``group_name``: ``&lt;name>``,&#xA;       ``devices``: [``&lt;dev name>``, ``&lt;dev name>``, ...],&#xA;       ``subgroups`` : [{&lt;nested group>},&#xA;                              {&lt;nested group>}, ...]},&#xA;      ...&#xA;      ]&#xA;&#xA;For example, a hierarchy of racks, servers and switches:&#xA;    [ {``group_name``: ``servers``,&#xA;       ``devices``: [``elt/server/1``, ``elt/server/2``,&#xA;                       ``elt/server/3``, ``elt/server/4``]},&#xA;      {``group_name``: ``switches``,&#xA;       ``devices``: [``elt/switch/A``, ``elt/switch/B``]},&#xA;      {``group_name``: ``pdus``,&#xA;       ``devices``: [``elt/pdu/rackA``, ``elt/pdu/rackB``]},&#xA;      {``group_name``: ``racks``,&#xA;      ``subgroups``: [&#xA;            {``group_name``: ``rackA``,&#xA;             ``devices``: [``elt/server/1``, ``elt/server/2``,&#xA;                               ``elt/switch/A``, ``elt/pdu/rackA``]},&#xA;            {``group_name``: ``rackB``,&#xA;             ``devices``: [``elt/server/3``, ``elt/server/4``,&#xA;                              ``elt/switch/B``, ``elt/pdu/rackB``],&#xA;             ``subgroups``: []}&#xA;       ]} ]">
      <type xsi:type="pogoDsl:StringVectorType"/>
      <status abstract="false" inherited="true" concrete="true"/>
@@ -70,6 +57,16 @@
      <type xsi:type="pogoDsl:StringType"/>
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
    </deviceProperties>
    <deviceProperties name="LoggingLevelDefault" description="Default logging level at device startup.&#xA;(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.&#xA;Each item has the format:  target_type::target_name.&#xA;To log to stdout, use 'console::cout'.&#xA;To log to syslog, use 'syslog::&lt;address>',&#xA;  where &lt;address> is a file path,&#xA;  for example 'syslog::/var/run/rsyslog/dev/log'.&#xA;To log to a file, use 'file::&lt;path>',&#xA;  where &lt;path> is a file path,&#xA;  for example 'file::/tmp/my_dev.log'.">
      <type xsi:type="pogoDsl:StringVectorType"/>
      <status abstract="false" inherited="true" concrete="true"/>
      <DefaultPropValue>console::cout</DefaultPropValue>
    </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"/>
@@ -537,6 +534,13 @@
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
      <properties description="Alarm message when the Standby command fails with error(s)." label="Standby execution alarm 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="maxCapabilities" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="20" maxY="" allocReadMember="true">
      <dataType xsi:type="pogoDsl:StringType"/>
      <changeEvent fire="false" libCheckCriteria="false"/>
@@ -544,11 +548,10 @@
      <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="0" maxX="20" maxY="" allocReadMember="true" isDynamic="false">
    <attributes name="availableCapabilities" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="20" maxY="" allocReadMember="true">
      <dataType xsi:type="pogoDsl:StringType"/>
      <changeEvent fire="false" libCheckCriteria="false"/>
      <archiveEvent fire="false" libCheckCriteria="false"/>
      <dataReadyEvent fire="false" libCheckCriteria="true"/>
      <status abstract="false" inherited="true" concrete="true" concreteHere="false"/>
      <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>
@@ -568,6 +571,13 @@
      <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="Current logging targets for this device - &#xA;initialises to LoggingTargetsDefault on startup" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
    </attributes>
    <forwardedAttributes name="reportSearchBeamState" label="SearchBeam Capabilities State">
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
    </forwardedAttributes>