diff --git a/.release b/.release index 05e9522e520fd7378d36f9906b34967bdedef8ed..5632f9454246b9bb3e9bf7e959df679054af1358 100644 --- a/.release +++ b/.release @@ -1,2 +1,2 @@ -release=0.6.0 -tag=lmcbaseclasses-0.6.0 +release=0.6.1 +tag=lmcbaseclasses-0.6.1 diff --git a/README.md b/README.md index aab1c1081d7b94f89247294ebae4bc66723b3d6f..fb3c242b0cc599ff2d621676f70a30c3634f14b0 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,13 @@ The lmc-base-classe repository contains set of eight classes as mentioned in SKA ## Version History +#### 0.6.1 +- Add ON state to SKABaseDeviceStateModel. +- Move On() and Off() commands to SKABaseDevice. +- Add event pushing for device state, device status, admin mode and obs state + (change and archive events). +- Disable all attribute polling. + #### 0.6.0 - Breaking change: State management - SKABaseDevice implements a simple state machine with states diff --git a/pogo/SKAAlarmHandler.xmi b/pogo/SKAAlarmHandler.xmi index a6813c57a0939f69dc2fe50e4c5e48efdb163804..78984bcc97fc230b8d2aee9b262da6cf2334a255 100644 --- a/pogo/SKAAlarmHandler.xmi +++ b/pogo/SKAAlarmHandler.xmi @@ -113,7 +113,7 @@ </argout> <status abstract="false" inherited="true" concrete="true"/> </commands> - <attributes name="statsNrAlerts" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <attributes name="statsNrAlerts" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> <dataType xsi:type="pogoDsl:IntType"/> <changeEvent fire="false" libCheckCriteria="false"/> <archiveEvent fire="false" libCheckCriteria="false"/> @@ -121,7 +121,7 @@ <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> <properties description="Number of active Alerts" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> </attributes> - <attributes name="statsNrAlarms" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <attributes name="statsNrAlarms" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> <dataType xsi:type="pogoDsl:IntType"/> <changeEvent fire="false" libCheckCriteria="false"/> <archiveEvent fire="false" libCheckCriteria="false"/> @@ -129,7 +129,7 @@ <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> <properties description="Number of active Alarms" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> </attributes> - <attributes name="statsNrNewAlarms" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <attributes name="statsNrNewAlarms" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> <dataType xsi:type="pogoDsl:IntType"/> <changeEvent fire="false" libCheckCriteria="false"/> <archiveEvent fire="false" libCheckCriteria="false"/> @@ -137,7 +137,7 @@ <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> <properties description="Number of New active alarms" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> </attributes> - <attributes name="statsNrUnackAlarms" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <attributes name="statsNrUnackAlarms" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> <dataType xsi:type="pogoDsl:DoubleType"/> <changeEvent fire="false" libCheckCriteria="false"/> <archiveEvent fire="false" libCheckCriteria="false"/> @@ -145,7 +145,7 @@ <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> <properties description="Number of unacknowledged alarms" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> </attributes> - <attributes name="statsNrRtnAlarms" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <attributes name="statsNrRtnAlarms" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> <dataType xsi:type="pogoDsl:DoubleType"/> <changeEvent fire="false" libCheckCriteria="false"/> <archiveEvent fire="false" libCheckCriteria="false"/> @@ -153,63 +153,64 @@ <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> <properties description="Number of returned alarms" 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"> + <attributes name="buildState" 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="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"> + <attributes name="versionId" 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="Build state of this device" label="" 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"> + <attributes name="loggingLevel" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" 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"> + <attributes name="healthState" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" 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"> + <attributes name="adminMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true"> <dataType xsi:type="pogoDsl:EnumType"/> - <changeEvent fire="false" libCheckCriteria="false"/> - <archiveEvent fire="false" libCheckCriteria="false"/> + <changeEvent fire="true" libCheckCriteria="true"/> + <archiveEvent fire="true" libCheckCriteria="true"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> <status abstract="false" inherited="true" concrete="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"> + <attributes name="controlMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true"> <dataType xsi:type="pogoDsl:EnumType"/> <changeEvent fire="false" libCheckCriteria="false"/> <archiveEvent fire="false" libCheckCriteria="false"/> <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"> + <attributes name="simulationMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true"> <dataType xsi:type="pogoDsl:EnumType"/> <changeEvent fire="false" libCheckCriteria="false"/> <archiveEvent fire="false" libCheckCriteria="false"/> <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"> + <attributes name="testMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true"> <dataType xsi:type="pogoDsl:EnumType"/> <changeEvent fire="false" libCheckCriteria="false"/> <archiveEvent fire="false" libCheckCriteria="false"/> <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="activeAlerts" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="10000" maxY="" allocReadMember="true" isDynamic="false"> + <attributes name="activeAlerts" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="10000" maxY="" allocReadMember="true" isDynamic="false"> <dataType xsi:type="pogoDsl:StringType"/> <changeEvent fire="false" libCheckCriteria="false"/> <archiveEvent fire="false" libCheckCriteria="false"/> @@ -217,7 +218,7 @@ <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> <properties description="List of active alerts" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> </attributes> - <attributes name="activeAlarms" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="10000" maxY="" allocReadMember="true" isDynamic="false"> + <attributes name="activeAlarms" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="10000" maxY="" allocReadMember="true" isDynamic="false"> <dataType xsi:type="pogoDsl:StringType"/> <changeEvent fire="false" libCheckCriteria="false"/> <archiveEvent fire="false" libCheckCriteria="false"/> diff --git a/pogo/SKABaseDevice.xmi b/pogo/SKABaseDevice.xmi index a04e519cfccea1c30e0cf38d025f9edfbe4b1874..22f06e55291b4ad8408291e4fda2cbd1aa8e8e82 100644 --- a/pogo/SKABaseDevice.xmi +++ b/pogo/SKABaseDevice.xmi @@ -59,19 +59,19 @@ </argout> <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> </commands> - <attributes name="buildState" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="60000" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <attributes name="buildState" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> <dataType xsi:type="pogoDsl:StringType"/> <dataReadyEvent fire="false" libCheckCriteria="true"/> <status abstract="false" inherited="false" concrete="true" concreteHere="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" isDynamic="false"> + <attributes name="versionId" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> <dataType xsi:type="pogoDsl:StringType"/> <dataReadyEvent fire="false" libCheckCriteria="true"/> <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> <properties description="Version Id of this device" label="" 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" isDynamic="false"> + <attributes name="loggingLevel" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> <dataType xsi:type="pogoDsl:EnumType"/> <changeEvent fire="false" libCheckCriteria="false"/> <archiveEvent fire="false" libCheckCriteria="false"/> @@ -85,7 +85,7 @@ <enumLabels>INFO</enumLabels> <enumLabels>DEBUG</enumLabels> </attributes> - <attributes name="healthState" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <attributes name="healthState" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> <dataType xsi:type="pogoDsl:EnumType"/> <dataReadyEvent fire="false" libCheckCriteria="true"/> <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> @@ -95,8 +95,10 @@ <enumLabels>FAILED</enumLabels> <enumLabels>UNKNOWN</enumLabels> </attributes> - <attributes name="adminMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" memorized="true" allocReadMember="true" isDynamic="false"> + <attributes name="adminMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true" isDynamic="false"> <dataType xsi:type="pogoDsl:EnumType"/> + <changeEvent fire="true" libCheckCriteria="true"/> + <archiveEvent fire="true" libCheckCriteria="true"/> <dataReadyEvent fire="false" libCheckCriteria="true"/> <status abstract="false" inherited="false" 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=""/> @@ -106,7 +108,7 @@ <enumLabels>NOT_FITTED</enumLabels> <enumLabels>RESERVED</enumLabels> </attributes> - <attributes name="controlMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" memorized="true" allocReadMember="true" isDynamic="false"> + <attributes name="controlMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true" isDynamic="false"> <dataType xsi:type="pogoDsl:EnumType"/> <dataReadyEvent fire="false" libCheckCriteria="true"/> <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> @@ -114,7 +116,7 @@ <enumLabels>REMOTE</enumLabels> <enumLabels>LOCAL</enumLabels> </attributes> - <attributes name="simulationMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" memorized="true" allocReadMember="true" isDynamic="false"> + <attributes name="simulationMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true" isDynamic="false"> <dataType xsi:type="pogoDsl:EnumType"/> <dataReadyEvent fire="false" libCheckCriteria="true"/> <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> @@ -122,7 +124,7 @@ <enumLabels>FALSE</enumLabels> <enumLabels>TRUE</enumLabels> </attributes> - <attributes name="testMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" memorized="true" allocReadMember="true" isDynamic="false"> + <attributes name="testMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true" isDynamic="false"> <dataType xsi:type="pogoDsl:EnumType"/> <dataReadyEvent fire="false" libCheckCriteria="true"/> <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> diff --git a/pogo/SKACapability.xmi b/pogo/SKACapability.xmi index 7ffc297955514b6c6f9c5207d4f2d7e94a609a32..f2f78caa181eb4516724c8253a676f083eb086d3 100644 --- a/pogo/SKACapability.xmi +++ b/pogo/SKACapability.xmi @@ -81,7 +81,7 @@ </argout> <status abstract="false" inherited="true" concrete="true"/> </commands> - <attributes name="activationTime" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <attributes name="activationTime" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> <dataType xsi:type="pogoDsl:DoubleType"/> <changeEvent fire="false" libCheckCriteria="false"/> <archiveEvent fire="false" libCheckCriteria="false"/> @@ -91,6 +91,9 @@ </attributes> <attributes name="obsState" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true"> <dataType xsi:type="pogoDsl:EnumType"/> + <changeEvent fire="true" libCheckCriteria="true"/> + <archiveEvent fire="true" libCheckCriteria="true"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> <status abstract="false" inherited="true" concrete="true"/> <properties description="Observing State" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> </attributes> @@ -109,17 +112,17 @@ <status abstract="false" inherited="true" concrete="true"/> <properties description="Configuration delay expected in seconds" label="" unit="seconds" 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"> + <attributes name="buildState" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true"> <dataType xsi:type="pogoDsl:StringType"/> <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"> + <attributes name="versionId" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true"> <dataType xsi:type="pogoDsl:StringType"/> <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="loggingLevel" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" allocReadMember="true"> + <attributes name="loggingLevel" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true"> <dataType xsi:type="pogoDsl:EnumType"/> <changeEvent fire="false" libCheckCriteria="false"/> <archiveEvent fire="false" libCheckCriteria="false"/> @@ -133,6 +136,9 @@ </attributes> <attributes name="adminMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true"> <dataType xsi:type="pogoDsl:EnumType"/> + <changeEvent fire="true" libCheckCriteria="true"/> + <archiveEvent fire="true" libCheckCriteria="true"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> <status abstract="false" inherited="true" concrete="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> @@ -151,7 +157,7 @@ <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="configuredInstances" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="100" maxY="" allocReadMember="true" isDynamic="false"> + <attributes name="configuredInstances" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="100" maxY="" allocReadMember="true" isDynamic="false"> <dataType xsi:type="pogoDsl:UShortType"/> <changeEvent fire="false" libCheckCriteria="false"/> <archiveEvent fire="false" libCheckCriteria="false"/> @@ -166,7 +172,7 @@ <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="usedComponents" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="100" maxY="" allocReadMember="true" isDynamic="false"> + <attributes name="usedComponents" 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"/> @@ -199,14 +205,5 @@ <status abstract="false" inherited="true" concrete="true"/> </states> <preferences docHome="./doc_html" makefileHome="/usr/local/share/pogo/preferences"/> - <overlodedPollPeriodObject name="obsState" type="attribute" pollPeriod="0"/> - <overlodedPollPeriodObject name="obsMode" type="attribute" pollPeriod="0"/> - <overlodedPollPeriodObject name="configurationProgress" type="attribute" pollPeriod="0"/> - <overlodedPollPeriodObject name="configurationDelayExpected" type="attribute" pollPeriod="0"/> - <overlodedPollPeriodObject name="healthState" type="attribute" pollPeriod="0"/> - <overlodedPollPeriodObject name="adminMode" type="attribute" pollPeriod="0"/> - <overlodedPollPeriodObject name="controlMode" type="attribute" pollPeriod="0"/> - <overlodedPollPeriodObject name="simulationMode" type="attribute" pollPeriod="0"/> - <overlodedPollPeriodObject name="testMode" type="attribute" pollPeriod="0"/> </classes> </pogoDsl:PogoSystem> diff --git a/pogo/SKALogger.xmi b/pogo/SKALogger.xmi index f5b5b10f65b4464193c8b2d5de6bc40760be2115..54a9a28b19d30a732fe01ff4c2885ae267bdda73 100644 --- a/pogo/SKALogger.xmi +++ b/pogo/SKALogger.xmi @@ -69,44 +69,47 @@ </argout> <status abstract="false" inherited="true" concrete="true"/> </commands> - <attributes name="buildState" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="60000" maxX="" maxY="" allocReadMember="true"> + <attributes name="buildState" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true"> <dataType xsi:type="pogoDsl:StringType"/> <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"> + <attributes name="versionId" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true"> <dataType xsi:type="pogoDsl:StringType"/> <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="loggingLevel" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" allocReadMember="true"> + <attributes name="loggingLevel" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" 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"> + <attributes name="healthState" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true"> <dataType xsi:type="pogoDsl:EnumType"/> <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"> + <attributes name="adminMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true"> <dataType xsi:type="pogoDsl:EnumType"/> + <changeEvent fire="true" libCheckCriteria="true"/> + <archiveEvent fire="true" libCheckCriteria="true"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> <status abstract="false" inherited="true" concrete="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"> + <attributes name="controlMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true"> <dataType xsi:type="pogoDsl:EnumType"/> <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"> + <attributes name="simulationMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true"> <dataType xsi:type="pogoDsl:EnumType"/> <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"> + <attributes name="testMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true"> <dataType xsi:type="pogoDsl:EnumType"/> <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=""/> diff --git a/pogo/SKAMaster.xmi b/pogo/SKAMaster.xmi index 6b37e806bf8709964adc1df9b04979fe1f688f59..14a44e17bcf256e3a5d6aa559372b879302725e3 100644 --- a/pogo/SKAMaster.xmi +++ b/pogo/SKAMaster.xmi @@ -82,7 +82,7 @@ </argout> <status abstract="false" inherited="true" concrete="true"/> </commands> - <attributes name="elementLoggerAddress" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="60000" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <attributes name="elementLoggerAddress" 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"/> @@ -90,7 +90,7 @@ <status abstract="false" inherited="false" concrete="true" concreteHere="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" isDynamic="false"> + <attributes name="elementAlarmAddress" 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"/> @@ -98,7 +98,7 @@ <status abstract="false" inherited="false" concrete="true" concreteHere="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" isDynamic="false"> + <attributes name="elementTelStateAddress" 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"/> @@ -106,7 +106,7 @@ <status abstract="false" inherited="false" concrete="true" concreteHere="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" isDynamic="false"> + <attributes name="elementDatabaseAddress" 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"/> @@ -114,63 +114,64 @@ <status abstract="false" inherited="false" concrete="true" concreteHere="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"> + <attributes name="buildState" 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" concreteHere="false"/> <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"> + <attributes name="versionId" 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" concreteHere="false"/> <properties description="Build state of this device" label="" 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"> + <attributes name="loggingLevel" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" 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"> + <attributes name="healthState" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" 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" concreteHere="false"/> <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"> + <attributes name="adminMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true"> <dataType xsi:type="pogoDsl:EnumType"/> - <changeEvent fire="false" libCheckCriteria="false"/> - <archiveEvent fire="false" libCheckCriteria="false"/> + <changeEvent fire="true" libCheckCriteria="true"/> + <archiveEvent fire="true" libCheckCriteria="true"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> <status abstract="false" inherited="true" concrete="true" concreteHere="false"/> <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"> + <attributes name="controlMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true"> <dataType xsi:type="pogoDsl:EnumType"/> <changeEvent fire="false" libCheckCriteria="false"/> <archiveEvent fire="false" libCheckCriteria="false"/> <status abstract="false" inherited="true" concrete="true" concreteHere="false"/> <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"> + <attributes name="simulationMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true"> <dataType xsi:type="pogoDsl:EnumType"/> <changeEvent fire="false" libCheckCriteria="false"/> <archiveEvent fire="false" libCheckCriteria="false"/> <status abstract="false" inherited="true" concrete="true" concreteHere="false"/> <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"> + <attributes name="testMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true"> <dataType xsi:type="pogoDsl:EnumType"/> <changeEvent fire="false" libCheckCriteria="false"/> <archiveEvent fire="false" libCheckCriteria="false"/> <status abstract="false" inherited="true" concrete="true" concreteHere="false"/> <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="maxCapabilities" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="20" maxY="" allocReadMember="true" isDynamic="false"> + <attributes name="maxCapabilities" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="20" maxY="" allocReadMember="true" isDynamic="false"> <dataType xsi:type="pogoDsl:StringType"/> <changeEvent fire="false" libCheckCriteria="false"/> <archiveEvent fire="false" libCheckCriteria="false"/> @@ -178,7 +179,7 @@ <status abstract="false" inherited="false" concrete="true" concreteHere="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" isDynamic="false"> + <attributes name="availableCapabilities" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="20" maxY="" allocReadMember="true" isDynamic="false"> <dataType xsi:type="pogoDsl:StringType"/> <changeEvent fire="false" libCheckCriteria="false"/> <archiveEvent fire="false" libCheckCriteria="false"/> diff --git a/pogo/SKAObsDevice.xmi b/pogo/SKAObsDevice.xmi index 866600078e08168344fe9f256666f1229bde28f7..913619b061faf73d80373d73739f911c90040d6a 100644 --- a/pogo/SKAObsDevice.xmi +++ b/pogo/SKAObsDevice.xmi @@ -60,8 +60,10 @@ </argout> <status abstract="false" inherited="true" concrete="true"/> </commands> - <attributes name="obsState" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <attributes name="obsState" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> <dataType xsi:type="pogoDsl:EnumType"/> + <changeEvent fire="true" libCheckCriteria="true"/> + <archiveEvent fire="true" libCheckCriteria="true"/> <dataReadyEvent fire="false" libCheckCriteria="true"/> <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> <properties description="Observing State" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> @@ -77,7 +79,7 @@ <enumLabels>FAULT</enumLabels> <enumLabels>RESTARTING</enumLabels> </attributes> - <attributes name="obsMode" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <attributes name="obsMode" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> <dataType xsi:type="pogoDsl:EnumType"/> <changeEvent fire="false" libCheckCriteria="false"/> <archiveEvent fire="false" libCheckCriteria="false"/> @@ -93,56 +95,59 @@ <enumLabels>VLBI</enumLabels> <enumLabels>CALIBRATION</enumLabels> </attributes> - <attributes name="configurationProgress" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <attributes name="configurationProgress" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> <dataType xsi:type="pogoDsl:UShortType"/> <dataReadyEvent fire="false" libCheckCriteria="true"/> <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> <properties description="Percentage configuration progress" label="" unit="%" standardUnit="" displayUnit="" format="" maxValue="100" minValue="0" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> </attributes> - <attributes name="configurationDelayExpected" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <attributes name="configurationDelayExpected" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> <dataType xsi:type="pogoDsl:UShortType"/> <dataReadyEvent fire="false" libCheckCriteria="true"/> <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> <properties description="Configuration delay expected in seconds" label="" unit="seconds" 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"> + <attributes name="buildState" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true"> <dataType xsi:type="pogoDsl:StringType"/> <status abstract="false" inherited="true" concrete="true" concreteHere="false"/> <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"> + <attributes name="versionId" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true"> <dataType xsi:type="pogoDsl:StringType"/> <status abstract="false" inherited="true" concrete="true" concreteHere="false"/> <properties description="Build state of this device" label="" 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"> + <attributes name="loggingLevel" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" 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"> + <attributes name="healthState" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true"> <dataType xsi:type="pogoDsl:EnumType"/> <status abstract="false" inherited="true" concrete="true" concreteHere="false"/> <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"> + <attributes name="adminMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true"> <dataType xsi:type="pogoDsl:EnumType"/> + <changeEvent fire="true" libCheckCriteria="true"/> + <archiveEvent fire="true" libCheckCriteria="true"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> <status abstract="false" inherited="true" concrete="true" concreteHere="false"/> <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"> + <attributes name="controlMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true"> <dataType xsi:type="pogoDsl:EnumType"/> <status abstract="false" inherited="true" concrete="true" concreteHere="false"/> <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"> + <attributes name="simulationMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true"> <dataType xsi:type="pogoDsl:EnumType"/> <status abstract="false" inherited="true" concrete="true" concreteHere="false"/> <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"> + <attributes name="testMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true"> <dataType xsi:type="pogoDsl:EnumType"/> <status abstract="false" inherited="true" concrete="true" concreteHere="false"/> <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=""/> diff --git a/pogo/SKASubarray.xmi b/pogo/SKASubarray.xmi index 3622127756242079c7f33346303d1722c8daaee9..63f592dee757e089f81d369e7b7ea3b26018da27 100644 --- a/pogo/SKASubarray.xmi +++ b/pogo/SKASubarray.xmi @@ -158,7 +158,7 @@ </argout> <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> </commands> - <attributes name="activationTime" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" allocReadMember="true" isDynamic="false"> + <attributes name="activationTime" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false"> <dataType xsi:type="pogoDsl:DoubleType"/> <changeEvent fire="false" libCheckCriteria="false"/> <archiveEvent fire="false" libCheckCriteria="false"/> @@ -168,10 +168,13 @@ </attributes> <attributes name="adminMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true"> <dataType xsi:type="pogoDsl:EnumType"/> + <changeEvent fire="true" libCheckCriteria="true"/> + <archiveEvent fire="true" libCheckCriteria="true"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> <status abstract="false" inherited="true" concrete="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="buildState" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="60000" maxX="" maxY="" allocReadMember="true"> + <attributes name="buildState" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true"> <dataType xsi:type="pogoDsl:StringType"/> <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=""/> @@ -196,7 +199,7 @@ <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="loggingLevel" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" allocReadMember="true"> + <attributes name="loggingLevel" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true"> <dataType xsi:type="pogoDsl:EnumType"/> <changeEvent fire="false" libCheckCriteria="false"/> <archiveEvent fire="false" libCheckCriteria="false"/> @@ -210,6 +213,9 @@ </attributes> <attributes name="obsState" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true"> <dataType xsi:type="pogoDsl:EnumType"/> + <changeEvent fire="true" libCheckCriteria="true"/> + <archiveEvent fire="true" libCheckCriteria="true"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> <status abstract="false" inherited="true" concrete="true"/> <properties description="Observing State" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> </attributes> @@ -223,12 +229,12 @@ <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="versionId" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="60000" maxX="" maxY="" allocReadMember="true"> + <attributes name="versionId" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true"> <dataType xsi:type="pogoDsl:StringType"/> <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="assignedResources" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="100" maxY="" allocReadMember="true" isDynamic="false"> + <attributes name="assignedResources" 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"/> @@ -236,7 +242,7 @@ <status abstract="false" inherited="false" concrete="true" concreteHere="true"/> <properties description="The list of resources assigned to the subarray." label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/> </attributes> - <attributes name="configuredCapabilities" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="1000" maxX="10" maxY="" allocReadMember="true" isDynamic="false"> + <attributes name="configuredCapabilities" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="10" maxY="" allocReadMember="true" isDynamic="false"> <dataType xsi:type="pogoDsl:StringType"/> <changeEvent fire="false" libCheckCriteria="false"/> <archiveEvent fire="false" libCheckCriteria="false"/> @@ -276,14 +282,5 @@ <status abstract="false" inherited="true" concrete="true"/> </states> <preferences docHome="./doc_html" makefileHome="$(TANGO_HOME)"/> - <overlodedPollPeriodObject name="adminMode" type="attribute" pollPeriod="0"/> - <overlodedPollPeriodObject name="configurationDelayExpected" type="attribute" pollPeriod="0"/> - <overlodedPollPeriodObject name="configurationProgress" type="attribute" pollPeriod="0"/> - <overlodedPollPeriodObject name="controlMode" type="attribute" pollPeriod="0"/> - <overlodedPollPeriodObject name="healthState" type="attribute" pollPeriod="0"/> - <overlodedPollPeriodObject name="obsMode" type="attribute" pollPeriod="0"/> - <overlodedPollPeriodObject name="obsState" type="attribute" pollPeriod="0"/> - <overlodedPollPeriodObject name="simulationMode" type="attribute" pollPeriod="0"/> - <overlodedPollPeriodObject name="testMode" type="attribute" pollPeriod="0"/> </classes> </pogoDsl:PogoSystem> diff --git a/pogo/SKATelState.xmi b/pogo/SKATelState.xmi index 0aebc36fa558f5f0a056b05f4c07f5b4cdb86fd3..5307aa9c9f8b27c0a4a2b6c7b1a22531cd1871d1 100644 --- a/pogo/SKATelState.xmi +++ b/pogo/SKATelState.xmi @@ -64,44 +64,47 @@ </argout> <status abstract="false" inherited="true" concrete="true"/> </commands> - <attributes name="buildState" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="60000" maxX="" maxY="" allocReadMember="true"> + <attributes name="buildState" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true"> <dataType xsi:type="pogoDsl:StringType"/> <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"> + <attributes name="versionId" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true"> <dataType xsi:type="pogoDsl:StringType"/> <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="loggingLevel" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="1000" maxX="" maxY="" allocReadMember="true"> + <attributes name="loggingLevel" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" 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"> + <attributes name="healthState" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true"> <dataType xsi:type="pogoDsl:EnumType"/> <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"> + <attributes name="adminMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true"> <dataType xsi:type="pogoDsl:EnumType"/> + <changeEvent fire="true" libCheckCriteria="true"/> + <archiveEvent fire="true" libCheckCriteria="true"/> + <dataReadyEvent fire="false" libCheckCriteria="true"/> <status abstract="false" inherited="true" concrete="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"> + <attributes name="controlMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true"> <dataType xsi:type="pogoDsl:EnumType"/> <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"> + <attributes name="simulationMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true"> <dataType xsi:type="pogoDsl:EnumType"/> <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"> + <attributes name="testMode" attType="Scalar" rwType="READ_WRITE" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" memorized="true" allocReadMember="true"> <dataType xsi:type="pogoDsl:EnumType"/> <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=""/> diff --git a/src/ska/base/base_device.py b/src/ska/base/base_device.py index 63f9c63b21059ac4307104354eaeb83943248ea0..e44dddfd72f12e236c3fd52b2f1a77b031fed9f5 100644 --- a/src/ska/base/base_device.py +++ b/src/ska/base/base_device.py @@ -472,19 +472,40 @@ class SKABaseDeviceStateModel(DeviceStateModel): "FAULT (ENABLED)", lambda self: self._set_dev_state(DevState.FAULT) ), + ('OFF', 'on_succeeded'): ( + "ON", + lambda self: self._set_dev_state(DevState.ON) + ), + ('OFF', 'on_failed'): ( + "FAULT", + lambda self: self._set_dev_state(DevState.FAULT) + ), + ('ON', 'off_succeeded'): ( + "OFF", + lambda self: self._set_dev_state(DevState.OFF) + ), + ('ON', 'off_failed'): ( + "FAULT", + lambda self: self._set_dev_state(DevState.FAULT) + ), + } - def __init__(self, dev_state_callback=None): + def __init__(self, dev_state_callback=None, admin_mode_callback=None): """ Initialises the state model. :param dev_state_callback: A callback to be called when a transition implies a change to device state - :type dev_state_callback: tango.DevState + :type dev_state_callback: callable + :param admin_mode_callback: A callback to be called when a + transition causes a change to device admin_mode + :type admin_mode_callback: callable """ super().__init__(self.__transitions, "UNINITIALISED") self._admin_mode = None + self._admin_mode_callback = admin_mode_callback self._dev_state = None self._dev_state_callback = dev_state_callback @@ -505,7 +526,10 @@ class SKABaseDeviceStateModel(DeviceStateModel): :param admin_mode: the new admin_mode value :type admin_mode: AdminMode """ - self._admin_mode = admin_mode + if self._admin_mode != admin_mode: + self._admin_mode = admin_mode + if self._admin_mode_callback is not None: + self._admin_mode_callback(self._admin_mode) @property def dev_state(self): @@ -572,6 +596,13 @@ class SKABaseDevice(Device): """ device = self.target + device.set_change_event("adminMode", True, True) + device.set_archive_event("adminMode", True, True) + device.set_change_event("state", True, True) + device.set_archive_event("state", True, True) + device.set_change_event("status", True, True) + device.set_archive_event("status", True, True) + device._health_state = HealthState.OK device._control_mode = ControlMode.REMOTE device._simulation_mode = SimulationMode.FALSE @@ -768,6 +799,17 @@ class SKABaseDevice(Device): # General methods # --------------- + def _update_admin_mode(self, admin_mode): + """ + Helper method for changing admin_mode; passed to the state model as a + callback + + :param admin_mode: the new admin_mode value + :type admin_mode: AdminMode + """ + self.push_change_event("adminMode", admin_mode) + self.push_archive_event("adminMode", admin_mode) + def _update_state(self, state): """ Helper method for changing state; passed to the state model as a @@ -783,6 +825,16 @@ class SKABaseDevice(Device): self.set_state(state) self.set_status(f"The device is in {state} state.") + def set_state(self, state): + super().set_state(state) + self.push_change_event('state') + self.push_archive_event('state') + + def set_status(self, status): + super().set_status(status) + self.push_change_event('status') + self.push_archive_event('status') + def init_device(self): """ Initializes the tango device after startup. @@ -818,7 +870,8 @@ class SKABaseDevice(Device): Creates the state model for the device """ self.state_model = SKABaseDeviceStateModel( - dev_state_callback=self._update_state + dev_state_callback=self._update_state, + admin_mode_callback=self._update_admin_mode ) def register_command_object(self, command_name, command_object): @@ -828,12 +881,14 @@ class SKABaseDevice(Device): return self._command_objects[command_name] def init_command_objects(self): - self.register_command_object( - "Reset", self.ResetCommand(self, self.state_model, self.logger) - ) + device_args = (self, self.state_model, self.logger) + + self.register_command_object("On", self.OnCommand(*device_args)) + self.register_command_object("Off", self.OffCommand(*device_args)) + self.register_command_object("Reset", self.ResetCommand(*device_args)) self.register_command_object( "GetVersionInfo", - self.GetVersionInfoCommand(self, self.state_model, self.logger) + self.GetVersionInfoCommand(*device_args) ) def always_executed_hook(self): @@ -1163,6 +1218,134 @@ class SKABaseDevice(Device): (return_code, message) = command() return [[return_code], [message]] + class OnCommand(ActionCommand): + """ + A class for the SKABaseDevice's On() command. + """ + def __init__(self, target, state_model, logger=None): + """ + Constructor for OnCommand + + :param target: the object that this command acts upon; for + example, the SKABaseDevice for which this class + implements the command + :type target: object + :param state_model: the state model that this command uses + to check that it is allowed to run, and that it drives + with actions. + :type state_model: SKABaseClassStateModel or a subclass of + same + :param logger: the logger to be used by this Command. If not + provided, then a default module logger will be used. + :type logger: a logger that implements the standard library + logger interface + """ + super().__init__(target, state_model, "on", logger=logger) + + def do(self): + """ + Stateless hook for On() command functionality. + + :return: A tuple containing a return code and a string + message indicating status. The message is for + information purpose only. + :rtype: (ResultCode, str) + """ + message = "On command completed OK" + self.logger.info(message) + return (ResultCode.OK, message) + + def is_On_allowed(self): + """ + Check if command `On` is allowed in the current device state. + + :raises ``tango.DevFailed``: if the command is not allowed + :return: ``True`` if the command is allowed + :rtype: boolean + """ + command = self.get_command_object("On") + return command.check_allowed() + + @command( + dtype_out='DevVarLongStringArray', + doc_out="(ReturnType, 'informational message')", + ) + @DebugIt() + def On(self): + """ + Turn device on + + To modify behaviour for this command, modify the do() method of + the command class. + """ + command = self.get_command_object("On") + (return_code, message) = command() + return [[return_code], [message]] + + class OffCommand(ActionCommand): + """ + A class for the SKABaseDevice's Off() command. + """ + def __init__(self, target, state_model, logger=None): + """ + Constructor for OffCommand + + :param target: the object that this command acts upon; for + example, the SKABaseDevice for which this class + implements the command + :type target: object + :param state_model: the state model that this command uses + to check that it is allowed to run, and that it drives + with actions. + :type state_model: SKABaseClassStateModel or a subclass of + same + :param logger: the logger to be used by this Command. If not + provided, then a default module logger will be used. + :type logger: a logger that implements the standard library + logger interface + """ + super().__init__(target, state_model, "off", logger=logger) + + def do(self): + """ + Stateless hook for Off() command functionality. + + :return: A tuple containing a return code and a string + message indicating status. The message is for + information purpose only. + :rtype: (ResultCode, str) + """ + message = "Off command completed OK" + self.logger.info(message) + return (ResultCode.OK, message) + + def is_Off_allowed(self): + """ + Check if command `Off` is allowed in the current device state. + + :raises ``tango.DevFailed``: if the command is not allowed + :return: ``True`` if the command is allowed + :rtype: boolean + """ + command = self.get_command_object("Off") + return command.check_allowed() + + @command( + dtype_out='DevVarLongStringArray', + doc_out="(ReturnType, 'informational message')", + ) + @DebugIt() + def Off(self): + """ + Turn the device off + + To modify behaviour for this command, modify the do() method of + the command class. + """ + command = self.get_command_object("Off") + (return_code, message) = command() + return [[return_code], [message]] + # ---------- # Run server diff --git a/src/ska/base/obs_device.py b/src/ska/base/obs_device.py index 90e5d9834ad8e9dde56dfdb5ee899992b3b1fd6b..48245f348788cfcc809d6c15a93dd2de1dcd5feb 100644 --- a/src/ska/base/obs_device.py +++ b/src/ska/base/obs_device.py @@ -30,14 +30,32 @@ class SKAObsDeviceStateModel(SKABaseDeviceStateModel): """ Implements the state model for the SKABaseDevice """ - def __init__(self, dev_state_callback=None): + def __init__( + self, + dev_state_callback=None, + admin_mode_callback=None, + obs_state_callback=None + ): """ Initialises the model. Note that this does not imply moving to INIT state. The INIT state is managed by the model itself. + + :param dev_state_callback: A callback to be called when a + transition implies a change to device state + :type dev_state_callback: callable + :param admin_mode_callback: A callback to be called when a + transition causes a change to device admin_mode + :type admin_mode_callback: callable + :param obs_state_callback: A callback to be called when a + transition causes a change to device obs_state + :type obs_state_callback: callable """ super().__init__( - dev_state_callback=dev_state_callback + dev_state_callback=dev_state_callback, + admin_mode_callback=admin_mode_callback ) + self._obs_state_callback = obs_state_callback + self.update_transitions( { ('UNINITIALISED', 'init_started'): ( @@ -54,12 +72,16 @@ class SKAObsDeviceStateModel(SKABaseDeviceStateModel): def _set_obs_state(self, obs_state): """ - Helper method: set the value of obs_state value + Helper method: set the value of obs_state value, and calls the + obs_state_callback if one exists. :param obs_state: the new obs_state value :type obs_state: ObsState """ - self._obs_state = obs_state + if self._obs_state != obs_state: + self._obs_state = obs_state + if self._obs_state_callback is not None: + self._obs_state_callback(self._obs_state) @property def obs_state(self): @@ -86,6 +108,9 @@ class SKAObsDevice(SKABaseDevice): super().do() device = self.target + device.set_change_event("obsState", True, True) + device.set_archive_event("obsState", True, True) + device._obs_mode = ObsMode.IDLE device._config_progress = 0 device._config_delay_expected = 0 @@ -108,13 +133,11 @@ class SKAObsDevice(SKABaseDevice): obsState = attribute( dtype=ObsState, - polling_period=1000, doc="Observing State", ) obsMode = attribute( dtype=ObsMode, - polling_period=1000, doc="Observing Mode", ) @@ -135,12 +158,25 @@ class SKAObsDevice(SKABaseDevice): # --------------- # General methods # --------------- + def _update_obs_state(self, obs_state): + """ + Helper method for changing obs_state; passed to the state model as a + callback + + :param obs_state: the new obs_state value + :type obs_state: ObsState + """ + self.push_change_event("obsState", obs_state) + self.push_archive_event("obsState", obs_state) + def _init_state_model(self): """ Sets up the state model for the device """ self.state_model = SKAObsDeviceStateModel( dev_state_callback=self._update_state, + admin_mode_callback=self._update_admin_mode, + obs_state_callback=self._update_obs_state ) def always_executed_hook(self): diff --git a/src/ska/base/subarray_device.py b/src/ska/base/subarray_device.py index db105c86e02d60aa1beb4821a6c93e45564fed30..54407ad74c6059d12a6ae22f4f377d519becbb9f 100644 --- a/src/ska/base/subarray_device.py +++ b/src/ska/base/subarray_device.py @@ -219,13 +219,30 @@ class SKASubarrayStateModel(SKAObsDeviceStateModel): ), } - def __init__(self, dev_state_callback=None): + def __init__( + self, + dev_state_callback=None, + admin_mode_callback=None, + obs_state_callback=None + ): """ Initialises the model. Note that this does not imply moving to INIT state. The INIT state is managed by the model itself. + + :param dev_state_callback: A callback to be called when a + transition implies a change to device state + :type dev_state_callback: callable + :param admin_mode_callback: A callback to be called when a + transition causes a change to device admin_mode + :type admin_mode_callback: callable + :param obs_state_callback: A callback to be called when a + transition causes a change to device obs_state + :type obs_state_callback: callable """ super().__init__( dev_state_callback=dev_state_callback, + admin_mode_callback=admin_mode_callback, + obs_state_callback=obs_state_callback ) self.update_transitions(self.__transitions) @@ -337,80 +354,6 @@ class SKASubarray(SKAObsDevice): self.logger.info(message) return (ResultCode.OK, message) - class OnCommand(ActionCommand): - """ - A class for the SKASubarray's On() command. - """ - def __init__(self, target, state_model, logger=None): - """ - Constructor for OnCommand - - :param target: the object that this command acts upon; for - example, the SKASubarray device for which this class - implements the command - :type target: object - :param state_model: the state model that this command uses - to check that it is allowed to run, and that it drives - with actions. - :type state_model: SKABaseClassStateModel or a subclass of - same - :param logger: the logger to be used by this Command. If not - provided, then a default module logger will be used. - :type logger: a logger that implements the standard library - logger interface - """ - super().__init__(target, state_model, "on", logger=logger) - - def do(self): - """ - Stateless hook for On() command functionality. - - :return: A tuple containing a return code and a string - message indicating status. The message is for - information purpose only. - :rtype: (ResultCode, str) - """ - message = "On command completed OK" - self.logger.info(message) - return (ResultCode.OK, message) - - class OffCommand(ActionCommand): - """ - A class for the SKASubarray's Off() command. - """ - def __init__(self, target, state_model, logger=None): - """ - Constructor for OffCommand - - :param target: the object that this command acts upon; for - example, the SKASubarray device for which this class - implements the command - :type target: object - :param state_model: the state model that this command uses - to check that it is allowed to run, and that it drives - with actions. - :type state_model: SKABaseClassStateModel or a subclass of - same - :param logger: the logger to be used by this Command. If not - provided, then a default module logger will be used. - :type logger: a logger that implements the standard library - logger interface - """ - super().__init__(target, state_model, "off", logger=logger) - - def do(self): - """ - Stateless hook for Off() command functionality. - - :return: A tuple containing a return code and a string - message indicating status. The message is for - information purpose only. - :rtype: (ResultCode, str) - """ - message = "Off command completed OK" - self.logger.info(message) - return (ResultCode.OK, message) - class _ResourcingCommand(ActionCommand): """ An abstract base class for SKASubarray's resourcing commands. @@ -886,6 +829,8 @@ class SKASubarray(SKAObsDevice): """ self.state_model = SKASubarrayStateModel( dev_state_callback=self._update_state, + admin_mode_callback=self._update_admin_mode, + obs_state_callback=self._update_obs_state ) def init_command_objects(self): @@ -897,8 +842,6 @@ class SKASubarray(SKAObsDevice): device_args = (self, self.state_model, self.logger) resource_args = (self.resource_manager, self.state_model, self.logger) - self.register_command_object("On", self.OnCommand(*device_args)) - self.register_command_object("Off", self.OffCommand(*device_args)) self.register_command_object( "AssignResources", self.AssignResourcesCommand(*resource_args) @@ -1053,59 +996,6 @@ class SKASubarray(SKAObsDevice): # -------- # Commands # -------- - def is_On_allowed(self): - """ - Check if command `On` is allowed in the current device state. - - :raises ``tango.DevFailed``: if the command is not allowed - :return: ``True`` if the command is allowed - :rtype: boolean - """ - command = self.get_command_object("On") - return command.check_allowed() - - @command( - dtype_out='DevVarLongStringArray', - doc_out="(ReturnType, 'informational message')", - ) - @DebugIt() - def On(self): - """ - Turn subarray on - - To modify behaviour for this command, modify the do() method of - the command class. - """ - command = self.get_command_object("On") - (return_code, message) = command() - return [[return_code], [message]] - - def is_Off_allowed(self): - """ - Check if command `Off` is allowed in the current device state. - - :raises ``tango.DevFailed``: if the command is not allowed - :return: ``True`` if the command is allowed - :rtype: boolean - """ - command = self.get_command_object("Off") - return command.check_allowed() - - @command( - dtype_out='DevVarLongStringArray', - doc_out="(ReturnType, 'informational message')", - ) - @DebugIt() - def Off(self): - """ - Turn the subarray off - - To modify behaviour for this command, modify the do() method of - the command class. - """ - command = self.get_command_object("Off") - (return_code, message) = command() - return [[return_code], [message]] def is_AssignResources_allowed(self): """ diff --git a/tests/conftest.py b/tests/conftest.py index da3a018dbc6ea1b04b50b49e2b5a649fa8d45a85..ebf675836329536662629c16660fdd35f3a4a292 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -3,7 +3,9 @@ A module defining a list of fixtures that are shared across all ska.base tests. """ import importlib import pytest +from queue import Empty, Queue +from tango import EventType from tango.test_context import DeviceTestContext from ska.base import SKASubarrayStateModel @@ -71,3 +73,144 @@ def state_model(): Yields an SKASubarrayStateModel. """ yield SKASubarrayStateModel() + + +@pytest.fixture(scope="function") +def tango_change_event_helper(tango_context): + """ + Helper for testing tango change events. To use it, call the subscribe + method with the name of the attribute for which you want change events. + The returned value will be a callback handler that you can interrogate + with ``assert_not_called``, ``assert_call``, ``assert_calls``, and + ``value`` methods.:: + + .. code-block:: python + + state_callback = tango_change_event_helper.subscribe("state") + state_callback.assert_call(DevState.OFF) + + # Check that we can't turn off a device that isn't on + with pytest.raises(DevFailed): + tango_context.device.Off() + state_callback.assert_not_called() + + # Now turn it on and check that we can turn it off + tango_context.device.On() + state_callback.assert_call(DevState.ON) + + # Or we can test a sequence of events + tango_context.device.Off() + tango_context.device.On() + state_callback.assert_calls([DevState.OFF, DevState.ON]) + + """ + class _Callback: + @staticmethod + def subscribe(attribute_name): + """ + Returns an event subscriber helper object that is subscribed + to change events on the named attribute. + + :param attribute_name: name of the attribute for which + change events will be subscribed + :type attribute_name: str + :return: an event subscriber helper object + :rtype: object + """ + return _Callback(attribute_name) + + def __init__(self, attribute_name): + """ + Creates an event subscriber helper object that is subscribed + to change events on the name attribute + + :param attribute_name: name of the attribute for which + change events will be subscribed + :type attribute_name: str + """ + self._value = None + self._values_queue = Queue() + self._errors = [] + + # Subscription will result in an immediate + # synchronous callback with the current value, + # so keep this as the last step in __init__. + self._id = tango_context.device.subscribe_event( + attribute_name, EventType.CHANGE_EVENT, self + ) + + def __del__(self): + """ + Unsubscribe from events before object is destroyed + """ + if hasattr(self, "_id"): + tango_context.device.unsubscribe_event(self._id) + + def __call__(self, event_data): + """ + Event subscription callback + + :param event_data: data about the change events + :type event_data: tango.EventData + """ + if event_data.err: + error = event_data.errors[0] + self._errors.append("Event callback error: [%s] %s" % (error.reason, error.desc)) + else: + self._values_queue.put(event_data.attr_value.value) + + def _next(self): + """ + Gets the attribute value from the next event if there is + one or if it arrives in time. + + :return: the attribute value reported in next change event, + or None if there is no event + :rtype: same as attribute type + """ + assert not self._errors, f"Some errors: {self._errors}" + try: + return self._values_queue.get(timeout=1.5) + except Empty: + return None + + def assert_not_called(self): + """ + Assert that there are no new callbacks calls. (That is, + there are no callback calls that have not already been + consumed by an ``assert_call`` or ``assert_calls``.) + """ + assert self._values_queue.empty() + + def assert_call(self, value): + """ + Asserts that this callback has been called with a change + event that updates the attribute value to a given value. + + Note that this method consumes a single event, but may leave + other events unconsumed. + + :param value: the value that the attribute is asserted to + have been changed to + :type value: same as the attribute type + """ + assert self._next() == value + + def assert_calls(self, values): + """ + Asserts that this callback has been called with a sequence + of change events that update the attribute values to the + given sequence of values. + + Note that this method consumes the events associated with + the given values, but may leave subsequent events + unconsumed. + + :param values: sequence of values that the attribute + is asserted to have been changed to + :type values: list + """ + for value in values: + self.assert_call(value) + + yield _Callback diff --git a/tests/test_base_device.py b/tests/test_base_device.py index 37d37633ea1971c2a3570d036a5cc2791404a417..b5c47cfe73c5000d7520bfd6860de8e39e44f002 100644 --- a/tests/test_base_device.py +++ b/tests/test_base_device.py @@ -392,6 +392,60 @@ class TestSKABaseDevice(object): tango_context.device.Reset() # PROTECTED REGION END # // SKABaseDevice.test_Reset + def test_On(self, tango_context, tango_change_event_helper): + """ + Test for On command + """ + + state_callback = tango_change_event_helper.subscribe("state") + status_callback = tango_change_event_helper.subscribe("status") + state_callback.assert_call(DevState.OFF) + status_callback.assert_call("The device is in OFF state.") + + # Check that we can turn a freshly initialised device on + tango_context.device.On() + state_callback.assert_call(DevState.ON) + status_callback.assert_call("The device is in ON state.") + + # Check that we can't turn it on when it is already on + with pytest.raises(DevFailed): + tango_context.device.On() + state_callback.assert_not_called() + status_callback.assert_not_called() + + # Now turn it off and check that we can turn it on again. + tango_context.device.Off() + state_callback.assert_call(DevState.OFF) + status_callback.assert_call("The device is in OFF state.") + + tango_context.device.On() + state_callback.assert_call(DevState.ON) + status_callback.assert_call("The device is in ON state.") + + def test_Off(self, tango_context, tango_change_event_helper): + """ + Test for On command + """ + state_callback = tango_change_event_helper.subscribe("state") + status_callback = tango_change_event_helper.subscribe("status") + state_callback.assert_call(DevState.OFF) + status_callback.assert_call("The device is in OFF state.") + + # Check that we can't turn off a device that isn't on + with pytest.raises(DevFailed): + tango_context.device.Off() + state_callback.assert_not_called() + status_callback.assert_not_called() + + # Now turn it on and check that we can turn it off + tango_context.device.On() + state_callback.assert_call(DevState.ON) + status_callback.assert_call("The device is in ON state.") + + tango_context.device.Off() + state_callback.assert_call(DevState.OFF) + status_callback.assert_call("The device is in OFF state.") + # PROTECTED REGION ID(SKABaseDevice.test_buildState_decorators) ENABLED START # # PROTECTED REGION END # // SKABaseDevice.test_buildState_decorators def test_buildState(self, tango_context): @@ -492,10 +546,18 @@ class TestSKABaseDevice(object): # PROTECTED REGION ID(SKABaseDevice.test_adminMode_decorators) ENABLED START # # PROTECTED REGION END # // SKABaseDevice.test_adminMode_decorators - def test_adminMode(self, tango_context): + def test_adminMode(self, tango_context, tango_change_event_helper): """Test for adminMode""" # PROTECTED REGION ID(SKABaseDevice.test_adminMode) ENABLED START # assert tango_context.device.adminMode == AdminMode.MAINTENANCE + + admin_mode_callback = tango_change_event_helper.subscribe("adminMode") + admin_mode_callback.assert_call(AdminMode.MAINTENANCE) + + tango_context.device.adminMode = AdminMode.ONLINE + assert tango_context.device.adminMode == AdminMode.ONLINE + admin_mode_callback.assert_call(AdminMode.ONLINE) + # PROTECTED REGION END # // SKABaseDevice.test_adminMode # PROTECTED REGION ID(SKABaseDevice.test_controlMode_decorators) ENABLED START # diff --git a/tests/test_obs_device.py b/tests/test_obs_device.py index 7d9d1d187e9bf7ff330b9315b95e8f7a7a2be7be..0c1c201167f1e4ace8b2477d0ba2e836f72ec742 100644 --- a/tests/test_obs_device.py +++ b/tests/test_obs_device.py @@ -77,10 +77,15 @@ class TestSKAObsDevice(object): # PROTECTED REGION ID(SKAObsDevice.test_obsState_decorators) ENABLED START # # PROTECTED REGION END # // SKAObsDevice.test_obsState_decorators - def test_obsState(self, tango_context): + def test_obsState(self, tango_context, tango_change_event_helper): """Test for obsState""" # PROTECTED REGION ID(SKAObsDevice.test_obsState) ENABLED START # assert tango_context.device.obsState == ObsState.EMPTY + + # Check that events are working by subscribing and checking for that + # initial event + obs_state_callback = tango_change_event_helper.subscribe("obsState") + obs_state_callback.assert_call(ObsState.EMPTY) # PROTECTED REGION END # // SKAObsDevice.test_obsState # PROTECTED REGION ID(SKAObsDevice.test_obsMode_decorators) ENABLED START # diff --git a/tests/test_subarray_device.py b/tests/test_subarray_device.py index 9058e73db2f2acd75e9fd918207522e231e7b296..8abc50cdfcdc62e63c7d0b673dc31ea24cf2e804 100644 --- a/tests/test_subarray_device.py +++ b/tests/test_subarray_device.py @@ -12,7 +12,7 @@ import itertools import re import pytest -from tango import DevState, DevSource, DevFailed +from tango import DevState, DevFailed # PROTECTED REGION ID(SKASubarray.test_additional_imports) ENABLED START # from ska.base import SKASubarray, SKASubarrayResourceManager @@ -52,29 +52,41 @@ class TestSKASubarray(object): # PROTECTED REGION ID(SKASubarray.test_Abort_decorators) ENABLED START # # PROTECTED REGION END # // SKASubarray.test_Abort_decorators - def test_Abort(self, tango_context): + def test_Abort(self, tango_context, tango_change_event_helper): """Test for Abort""" # PROTECTED REGION ID(SKASubarray.test_Abort) ENABLED START # + tango_context.device.On() tango_context.device.AssignResources('{"example": ["BAND1"]}') tango_context.device.Configure('{"BAND1": 2}') + + obs_state_callback = tango_change_event_helper.subscribe("obsState") + obs_state_callback.assert_call(ObsState.READY) + assert tango_context.device.Abort() == [ [ResultCode.OK], ["Abort command completed OK"] ] + obs_state_callback.assert_calls( + [ObsState.ABORTING, ObsState.ABORTED] + ) # PROTECTED REGION END # // SKASubarray.test_Abort # PROTECTED REGION ID(SKASubarray.test_Configure_decorators) ENABLED START # # PROTECTED REGION END # // SKASubarray.test_Configure_decorators - def test_Configure(self, tango_context): + def test_Configure(self, tango_context, tango_change_event_helper): """Test for Configure""" # PROTECTED REGION ID(SKASubarray.test_Configure) ENABLED START # tango_context.device.On() tango_context.device.AssignResources('{"example": ["BAND1"]}') + + obs_state_callback = tango_change_event_helper.subscribe("obsState") + obs_state_callback.assert_call(ObsState.IDLE) + tango_context.device.Configure('{"BAND1": 2}') - # The obsState attribute is changed by Configure, but - # as it is a polled attribute the value in the cache may be stale, - # so change source to ensure we read directly from the device - tango_context.device.set_source(DevSource.DEV) + + obs_state_callback.assert_calls( + [ObsState.CONFIGURING, ObsState.READY] + ) assert tango_context.device.obsState == ObsState.READY assert tango_context.device.configuredCapabilities == ("BAND1:2", "BAND2:0") # PROTECTED REGION END # // SKASubarray.test_Configure @@ -109,95 +121,154 @@ class TestSKASubarray(object): # PROTECTED REGION ID(SKASubarray.test_AssignResources_decorators) ENABLED START # # PROTECTED REGION END # // SKASubarray.test_AssignResources_decorators - def test_AssignResources(self, tango_context): + def test_AssignResources(self, tango_context, tango_change_event_helper): """Test for AssignResources""" # PROTECTED REGION ID(SKASubarray.test_AssignResources) ENABLED START # tango_context.device.On() + + obs_state_callback = tango_change_event_helper.subscribe("obsState") + obs_state_callback.assert_call(ObsState.EMPTY) + tango_context.device.AssignResources('{"example": ["BAND1", "BAND2"]}') - assert tango_context.device.State() == DevState.ON + + obs_state_callback.assert_calls( + [ObsState.RESOURCING, ObsState.IDLE] + ) + assert tango_context.device.ObsState == ObsState.IDLE assert tango_context.device.assignedResources == ('BAND1', 'BAND2') + tango_context.device.ReleaseAllResources() + obs_state_callback.assert_calls( + [ObsState.RESOURCING, ObsState.EMPTY] + ) + assert tango_context.device.ObsState == ObsState.EMPTY + with pytest.raises(DevFailed): tango_context.device.AssignResources('Invalid JSON') # PROTECTED REGION END # // SKASubarray.test_AssignResources # PROTECTED REGION ID(SKASubarray.test_EndSB_decorators) ENABLED START # # PROTECTED REGION END # // SKASubarray.test_EndSB_decorators - def test_End(self, tango_context): + def test_End(self, tango_context, tango_change_event_helper): """Test for EndSB""" # PROTECTED REGION ID(SKASubarray.test_EndSB) ENABLED START # tango_context.device.On() tango_context.device.AssignResources('{"example": ["BAND1"]}') tango_context.device.Configure('{"BAND1": 2}') + + obs_state_callback = tango_change_event_helper.subscribe("obsState") + obs_state_callback.assert_call(ObsState.READY) + assert tango_context.device.End() == [ [ResultCode.OK], ["End command completed OK"] ] + obs_state_callback.assert_call(ObsState.IDLE) + # PROTECTED REGION END # // SKASubarray.test_EndSB # PROTECTED REGION ID(SKASubarray.test_EndScan_decorators) ENABLED START # # PROTECTED REGION END # // SKASubarray.test_EndScan_decorators - def test_EndScan(self, tango_context): + def test_EndScan(self, tango_context, tango_change_event_helper): """Test for EndScan""" # PROTECTED REGION ID(SKASubarray.test_EndScan) ENABLED START # tango_context.device.On() tango_context.device.AssignResources('{"example": ["BAND1"]}') tango_context.device.Configure('{"BAND1": 2}') tango_context.device.Scan('{"id": 123}') + + obs_state_callback = tango_change_event_helper.subscribe("obsState") + obs_state_callback.assert_call(ObsState.SCANNING) + assert tango_context.device.EndScan() == [ [ResultCode.OK], ["EndScan command completed OK"] ] + + obs_state_callback.assert_call(ObsState.READY) + # PROTECTED REGION END # // SKASubarray.test_EndScan # PROTECTED REGION ID(SKASubarray.test_ReleaseAllResources_decorators) ENABLED START # # PROTECTED REGION END # // SKASubarray.test_ReleaseAllResources_decorators - def test_ReleaseAllResources(self, tango_context): + def test_ReleaseAllResources(self, tango_context, tango_change_event_helper): """Test for ReleaseAllResources""" # PROTECTED REGION ID(SKASubarray.test_ReleaseAllResources) ENABLED START # # assert tango_context.device.ReleaseAllResources() == [""] tango_context.device.On() tango_context.device.AssignResources('{"example": ["BAND1", "BAND2"]}') + + obs_state_callback = tango_change_event_helper.subscribe("obsState") + obs_state_callback.assert_call(ObsState.IDLE) + tango_context.device.ReleaseAllResources() + + obs_state_callback.assert_calls( + [ObsState.RESOURCING, ObsState.EMPTY] + ) assert tango_context.device.assignedResources is None # PROTECTED REGION END # // SKASubarray.test_ReleaseAllResources # PROTECTED REGION ID(SKASubarray.test_ReleaseResources_decorators) ENABLED START # # PROTECTED REGION END # // SKASubarray.test_ReleaseResources_decorators - def test_ReleaseResources(self, tango_context): + def test_ReleaseResources(self, tango_context, tango_change_event_helper): """Test for ReleaseResources""" # PROTECTED REGION ID(SKASubarray.test_ReleaseResources) ENABLED START # tango_context.device.On() tango_context.device.AssignResources('{"example": ["BAND1", "BAND2"]}') + + obs_state_callback = tango_change_event_helper.subscribe("obsState") + obs_state_callback.assert_call(ObsState.IDLE) + tango_context.device.ReleaseResources('{"example": ["BAND1"]}') - assert tango_context.device.State() == DevState.ON and\ - tango_context.device.assignedResources == ('BAND2',) - tango_context.device.ReleaseAllResources() + + obs_state_callback.assert_calls( + [ObsState.RESOURCING, ObsState.IDLE] + ) + assert tango_context.device.ObsState == ObsState.IDLE + assert tango_context.device.assignedResources == ('BAND2',) # PROTECTED REGION END # // SKASubarray.test_ReleaseResources # PROTECTED REGION ID(SKASubarray.test_Reset_decorators) ENABLED START # # PROTECTED REGION END # // SKASubarray.test_Reset_decorators - def test_ObsReset(self, tango_context): + def test_ObsReset(self, tango_context, tango_change_event_helper): """Test for Reset""" # PROTECTED REGION ID(SKASubarray.test_Reset) ENABLED START # tango_context.device.On() tango_context.device.AssignResources('{"example": ["BAND1"]}') tango_context.device.Configure('{"BAND1": 2}') tango_context.device.Abort() + + obs_state_callback = tango_change_event_helper.subscribe("obsState") + obs_state_callback.assert_call(ObsState.ABORTED) + assert tango_context.device.ObsReset() == [ [ResultCode.OK], ["ObsReset command completed OK"] ] + + obs_state_callback.assert_calls( + [ObsState.RESETTING, ObsState.IDLE] + ) + assert tango_context.device.obsState == ObsState.IDLE # PROTECTED REGION END # // SKASubarray.test_Reset # PROTECTED REGION ID(SKASubarray.test_Scan_decorators) ENABLED START # # PROTECTED REGION END # // SKASubarray.test_Scan_decorators - def test_Scan(self, tango_context): + def test_Scan(self, tango_context, tango_change_event_helper): """Test for Scan""" # PROTECTED REGION ID(SKASubarray.test_Scan) ENABLED START # tango_context.device.On() tango_context.device.AssignResources('{"example": ["BAND1"]}') tango_context.device.Configure('{"BAND1": 2}') + + obs_state_callback = tango_change_event_helper.subscribe("obsState") + obs_state_callback.assert_call(ObsState.READY) + assert tango_context.device.Scan('{"id": 123}') == [ [ResultCode.STARTED], ["Scan command STARTED - config {'id': 123}"] ] + + obs_state_callback.assert_call(ObsState.SCANNING) + assert tango_context.device.obsState == ObsState.SCANNING + tango_context.device.EndScan() with pytest.raises(DevFailed): tango_context.device.Scan('Invalid JSON') @@ -213,14 +284,23 @@ class TestSKASubarray(object): # PROTECTED REGION ID(SKASubarray.test_adminMode_decorators) ENABLED START # # PROTECTED REGION END # // SKASubarray.test_adminMode_decorators - def test_adminMode(self, tango_context): + def test_adminMode(self, tango_context, tango_change_event_helper): """Test for adminMode""" # PROTECTED REGION ID(SKASubarray.test_adminMode) ENABLED START # assert tango_context.device.adminMode == AdminMode.MAINTENANCE assert tango_context.device.state() == DevState.OFF + + admin_mode_callback = tango_change_event_helper.subscribe("adminMode") + dev_state_callback = tango_change_event_helper.subscribe("state") + admin_mode_callback.assert_call(AdminMode.MAINTENANCE) + dev_state_callback.assert_call(DevState.OFF) + tango_context.device.adminMode = AdminMode.OFFLINE assert tango_context.device.adminMode == AdminMode.OFFLINE assert tango_context.device.state() == DevState.DISABLE + admin_mode_callback.assert_call(AdminMode.OFFLINE) + dev_state_callback.assert_call(DevState.DISABLE) + # PROTECTED REGION END # // SKASubarray.test_adminMode # PROTECTED REGION ID(SKASubarray.test_buildState_decorators) ENABLED START # @@ -343,8 +423,7 @@ class TestSKASubarray(object): "restart"] ) ) - def test_state_machine(self, tango_context, - state_under_test, action_under_test): + def test_state_machine(self, tango_context, state_under_test, action_under_test): """ Test the subarray state machine: for a given initial state and an action, does execution of that action, from that initial @@ -353,7 +432,6 @@ class TestSKASubarray(object): exception? If the action was allowed, does it result in the correct state transition? """ - states = { "DISABLED": ([AdminMode.NOT_FITTED, AdminMode.OFFLINE], DevState.DISABLE, ObsState.EMPTY), @@ -377,6 +455,9 @@ class TestSKASubarray(object): } def assert_state(state): + """ + Check that the device is in the state we think it should be in + """ (admin_modes, dev_state, obs_state) = states[state] assert tango_context.device.adminMode in admin_modes assert tango_context.device.state() == dev_state @@ -469,18 +550,14 @@ class TestSKASubarray(object): ['on', 'assign', 'abort'], } - # bypass cache for this test because we are testing for a change - # in the polled attribute obsState - tango_context.device.set_source(DevSource.DEV) - - state = "OFF" # debugging only - assert_state(state) # debugging only + # state = "OFF" # debugging only + # assert_state(state) # debugging only # Put the device into the state under test for action in setups[state_under_test]: perform_action(action) - state = transitions[state, action] # debugging only - assert_state(state) # debugging only + # state = transitions[state, action] # debugging only + # assert_state(state) # debugging only # Check that we are in the state under test assert_state(state_under_test)