Commit 6c66ac54 authored by Elisabetta Giani's avatar Elisabetta Giani
Browse files

AT5-259: renamed attribute to report timeout and alarms flags.

Overwritten Abort command.
Added functionality to configure, start and end a scan.
Added EndSB method.
Temporarily removed forwarded attributes for PSS anad PST.
parent 975d242f
Loading
Loading
Loading
Loading
+415 −122

File changed.

Preview size limit exceeded, changes collapsed.

+11 −3
Original line number Diff line number Diff line
@@ -73,7 +73,7 @@
      <argout description="">
        <type xsi:type="pogoDsl:VoidType"/>
      </argout>
      <status abstract="false" inherited="true" concrete="true"/>
      <status abstract="false" inherited="true" concrete="true" concreteHere="true"/>
    </commands>
    <commands name="ConfigureCapability" description="Configures number of instances for each capability. If the capability exists, &#xA;it increments the configured instances by the number of instances requested, &#xA;otherwise an exception will be raised.&#xA;Note: The two lists arguments must be of equal length or an exception will be raised." execMethod="configure_capability" displayLevel="OPERATOR" polledPeriod="0">
      <argin description="[Number of instances to add][Capability types]">
@@ -632,7 +632,7 @@
      <properties description="he progress percentage for the Scan command." label="Scan percentage progress" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
      <eventCriteria relChange="" absChange="5" period=""/>
    </attributes>
    <attributes name="cmdTimeoutExpired" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" allocReadMember="true" isDynamic="false">
    <attributes name="timeoutExpiredFlag" 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"/>
@@ -640,7 +640,7 @@
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
      <properties description="The timeout flag for a CspSubarray command." label="CspSubarray command execution timeout flag" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
    </attributes>
    <attributes name="cmdAlarmRaised" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" allocReadMember="true" isDynamic="false">
    <attributes name="alarmRaisedFlag" 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"/>
@@ -663,6 +663,14 @@
      <status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
      <properties description="The output link for PST products." label="PST output link" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
    </attributes>
    <attributes name="cmdAlarmMessage" 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="The alarm message on command execution" label="The alarm message" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
    </attributes>
    <attributes name="assignedResources" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="100" maxY="" allocReadMember="true">
      <dataType xsi:type="pogoDsl:StringType"/>
      <changeEvent fire="false" libCheckCriteria="false"/>
+12 −12
Original line number Diff line number Diff line
@@ -172,10 +172,10 @@ class MidCspMasterBase(with_metaclass(DeviceMeta, CspMaster)):
        label="Unassigned SeachBeam Capabilities IDs",
        forwarded=True
    )
    reservedSearchBeamNum = attribute(name="reservedSearchBeamNum",
        label="Number of reserved SeachBeam Capabilities",
        forwarded=True
    )
    #reservedSearchBeamNum = attribute(name="reservedSearchBeamNum",
    #    label="Number of reserved SeachBeam Capabilities",
    #    forwarded=True
    #)
    searchBeamMembership = attribute(name="searchBeamMembership",
        label="SearchBeam Membership",
        forwarded=True
@@ -188,14 +188,14 @@ class MidCspMasterBase(with_metaclass(DeviceMeta, CspMaster)):
        label="VlbiBeam Membership",
        forwarded=True
    )
    vccCapabilityAddress = attribute(name="vccCapabilityAddress",
        label="vccCapabilityAddress",
        forwarded=True
    )
    fspCapabilityAddress = attribute(name="fspCapabilityAddress",
        label="fspCapabilityAddress",
        forwarded=True
    )
    #vccCapabilityAddress = attribute(name="vccCapabilityAddress",
    #    label="vccCapabilityAddress",
    #    forwarded=True
    #)
    #fspCapabilityAddress = attribute(name="fspCapabilityAddress",
    #    label="fspCapabilityAddress",
    #    forwarded=True
    #)
    reportVCCState = attribute(name="reportVCCState",
        label="reportVCCState",
        forwarded=True
+32 −28
Original line number Diff line number Diff line
@@ -174,6 +174,8 @@ class MidCspSubarrayBase(with_metaclass(DeviceMeta, CspSubarray)):
        # update the progress counter at the end of the loop 
        self._cmd_progress[cmd_name] = self._sc_subarray_cmd_progress[device][cmd_name]
        # check for error conditions
        if self._sc_subarray_cmd_exec_state[device][cmd_name] == CmdExecState.FAILED:
            self._alarm_raised = True
        if self._sc_subarray_state[self.CbfSubarray] not in [tango.DevState.OFF, 
                                                             tango.DevState.ON]:
            self._alarm_message[cmd_name] += ("Device {} is in {} State".format(device,
@@ -231,14 +233,16 @@ class MidCspSubarrayBase(with_metaclass(DeviceMeta, CspSubarray)):
        label="cbfOutputLink",
        forwarded=True
    )
    pssOutputLink = attribute(name="pssOutputLink",
        label="cbfOutputLink",
        forwarded=True
    )
    vlbiOutputLink = attribute(name="vlbiOutputLink",
        label="cbfOutputLink",
        forwarded=True
    )
    #
    # TODO: implement PSS Subarray and PSTBeams device
    #pssOutputLink = attribute(name="pssOutputLink",
    #    label="cbfOutputLink",
    #    forwarded=True
    #)
    #vlbiOutputLink = attribute(name="vlbiOutputLink",
    #    label="cbfOutputLink",
    #    forwarded=True
    #)
    assignedVccState = attribute(name="assignedVccState",
        label="State of the assigned VCC",
        forwarded=True
@@ -259,22 +263,23 @@ class MidCspSubarrayBase(with_metaclass(DeviceMeta, CspSubarray)):
        label="The list of assigned receptor IDs.",
        forwarded=True
    )
    assignedVccObsState = attribute(name="assignedVccObsState",
        label="ObsState of the assigned VCCs",
        forwarded=True
    )
    assignedFspObsState = attribute(name="assignedFspObsState",
        label="ObsState of the assigned FSPs.",
        forwarded=True
    )
    assignedVccAdminMode = attribute(name="assignedVccAdminMode",
        label="AdminMode of the assigned VCCs.",
        forwarded=True
    )
    assignedFspAdminMode = attribute(name="assignedFspAdminMode",
        label="AdminMode of the assigned FSPs.",
        forwarded=True
    )
    # TODO: implement the root attributes on CbfSubarray
    #assignedVccObsState = attribute(name="assignedVccObsState",
    #    label="ObsState of the assigned VCCs",
    #    forwarded=True
    #)
    #assignedFspObsState = attribute(name="assignedFspObsState",
    #    label="ObsState of the assigned FSPs.",
    #    forwarded=True
    #)
    #assignedVccAdminMode = attribute(name="assignedVccAdminMode",
    #    label="AdminMode of the assigned VCCs.",
    #    forwarded=True
    #)
    #assignedFspAdminMode = attribute(name="assignedFspAdminMode",
    #    label="AdminMode of the assigned FSPs.",
    #    forwarded=True
    #)
    # ---------------
    # General methods
    # ---------------
@@ -480,11 +485,10 @@ class MidCspSubarrayBase(with_metaclass(DeviceMeta, CspSubarray)):
            receptor_to_assign = list(tmp)
            # forward the command to the CbfSubarray
            proxy.command_inout_asynch("AddReceptors", receptor_to_assign, self._cmd_ended_cb)
            self._sc_subarray_cmd_starting_time['addreceptors'] = time.time()
            self._command_thread['addreceptors'] = threading.Thread(target=self.__monitor_add_receptors,
                                                           name="Thread-AddReceptors",
                                                           args=(receptor_to_assign,))
            self._sc_subarray_cmd_starting_time['addreceptors'] = time.time()
            self._sc_subarray_cmd_starting_time[self.CbfSubarray] = time.time()
            self._command_thread['addreceptors'].start()
        else:
            log_msg = "Device {} is not running!".format(str(self._cbf_subarray_fqdn))
@@ -562,7 +566,7 @@ class MidCspSubarrayBase(with_metaclass(DeviceMeta, CspSubarray)):
                        # forward the command to CbfSubarray
                        proxy.command_inout_asynch("RemoveReceptors", receptors_to_remove, self._cmd_ended_cb)
                        self._cmd_execution_state['removereceptors'] = CmdExecState.RUNNING
                        self._sc_subarray_cmd_starting_time['removereceptors'] = time.time()
                        self._sc_subarray_cmd_starting_time[self.CbfSubarray] = time.time()
                        # Note: rembember to put the comma in args=(receptors_to_remove,) otherwise
                        # the list is received as a numpy array!
                        self._command_thread['removereceptors'] = threading.Thread(target=self.__monitor_remove_receptors,
@@ -570,6 +574,7 @@ class MidCspSubarrayBase(with_metaclass(DeviceMeta, CspSubarray)):
                                                                args=(receptors_to_remove,))
                        
                        self._command_thread['removereceptors'].start()
                        return
                self.logger.info("No receptor to remove from subarray {}".format(self.get_name()))
                self._cmd_execution_state['removereceptors'] = CmdExecState.IDLE
                return
@@ -579,7 +584,6 @@ class MidCspSubarrayBase(with_metaclass(DeviceMeta, CspSubarray)):
                                             "RemoveReceptors",
                                             tango.ErrSeverity.ERR)
            except AttributeError as attr_err:
                print("ATTRERROR")
                log_msg = "RemoveReceptors:" + str(attr_err)
                self.logger.error(log_msg)
                tango.Except.throw_exception("Command failed",
+25 −0
Original line number Diff line number Diff line
@@ -67,6 +67,10 @@
      <type xsi:type="pogoDsl:StringType"/>
      <status abstract="false" inherited="true" concrete="true"/>
    </deviceProperties>
    <deviceProperties name="CspMaster" description="The TANGO address of the CspMaster.">
      <type xsi:type="pogoDsl:StringType"/>
      <status abstract="false" inherited="true" concrete="true"/>
    </deviceProperties>
    <commands name="Abort" description="Change obsState to ABORTED." execMethod="abort" displayLevel="OPERATOR" polledPeriod="0">
      <argin description="">
        <type xsi:type="pogoDsl:VoidType"/>
@@ -682,6 +686,27 @@
      <status abstract="false" inherited="true" concrete="true"/>
      <properties description="The CSP sub-array VLBI Inherent Capability FQDN." label="VLBI Inhernt Capabilityaddress" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
    </attributes>
    <attributes name="timeoutExpiredFlag" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" allocReadMember="true">
      <dataType xsi:type="pogoDsl:BooleanType"/>
      <changeEvent fire="false" libCheckCriteria="false"/>
      <archiveEvent fire="false" libCheckCriteria="false"/>
      <status abstract="false" inherited="true" concrete="true"/>
      <properties description="The timeout flag for a CspSubarray command." label="CspSubarray command execution timeout flag" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
    </attributes>
    <attributes name="alarmRaisedFlag" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" allocReadMember="true">
      <dataType xsi:type="pogoDsl:BooleanType"/>
      <changeEvent fire="false" libCheckCriteria="false"/>
      <archiveEvent fire="false" libCheckCriteria="false"/>
      <status abstract="false" inherited="true" concrete="true"/>
      <properties description="The alarm flag for a CspSubarray command." label="CspSubarray alarm flag" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
    </attributes>
    <attributes name="cmdAlarmMessage" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" 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="The alarm message on command execution" label="The alarm message" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
    </attributes>
    <attributes name="assignedResources" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="100" maxY="" allocReadMember="true">
      <dataType xsi:type="pogoDsl:StringType"/>
      <changeEvent fire="false" libCheckCriteria="false"/>