Commit 45871064 authored by Claudio Scafuri's avatar Claudio Scafuri 💬
Browse files

add reading status bit for each board

parent a6635a4b
......@@ -95,7 +95,6 @@ class DataAcquisitionThread(threading.Thread):
"dev_{0}\0".format(cardid))
self.cards_status[i] = str_to_bool_list(data)
self.fault = False
self.device.board_ok[i] = True
leak_ok = True # at least one board must be correctly acquired in order to detect leak
self.device.debug_stream('read card %d ok, %s' % (i, data))
except socket.error as e:
......@@ -176,6 +175,7 @@ class DataAcquisitionThread(threading.Thread):
self.disconnected_hardware = True
self.device.error_stream('board %d not working' % i)
else:
self.device.board_ok[i] = True
for y in range(3):
bit = y * 2 + 1
if not card[bit + 1]:
......
......@@ -94,6 +94,7 @@ class WaterSensor (PyTango.LatestDeviceImpl):
self.attr_board10_read = [False]
self.attr_board11_read = [False]
self.attr_log_read = [""]
self.attr_board_stat_read = [False]
#----- PROTECTED REGION ID(WaterSensor.init_device) ENABLED START -----#
self.boards = [[False] * 8] * self.NumBoards
self.set_state(PyTango.DevState.INIT)
......@@ -258,6 +259,13 @@ class WaterSensor (PyTango.LatestDeviceImpl):
#----- PROTECTED REGION END -----# // WaterSensor.log_read
def read_board_stat(self, attr):
self.debug_stream("In read_board_stat()")
#----- PROTECTED REGION ID(WaterSensor.board_stat_read) ENABLED START -----#
attr.set_value(self.board_ok)
#----- PROTECTED REGION END -----# // WaterSensor.board_stat_read
......@@ -411,6 +419,13 @@ class WaterSensorClass(PyTango.DeviceClass):
{
'label': "event log",
} ],
'board_stat':
[[PyTango.DevBoolean,
PyTango.SPECTRUM,
PyTango.READ, 12],
{
'label': "board status",
} ],
}
......
......@@ -48,7 +48,7 @@
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="" label="water leak" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="board00" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="8" maxY="" allocReadMember="true" isDynamic="false">
<attributes name="board00" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="8" maxY="" allocReadMember="false" isDynamic="false">
<dataType xsi:type="pogoDsl:BooleanType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
......@@ -56,7 +56,7 @@
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="" label="board 0" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="board01" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="8" maxY="" allocReadMember="true" isDynamic="false">
<attributes name="board01" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="8" maxY="" allocReadMember="false" isDynamic="false">
<dataType xsi:type="pogoDsl:BooleanType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
......@@ -64,7 +64,7 @@
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="" label="board 1" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="board02" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="8" maxY="" allocReadMember="true" isDynamic="false">
<attributes name="board02" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="8" maxY="" allocReadMember="false" isDynamic="false">
<dataType xsi:type="pogoDsl:BooleanType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
......@@ -72,7 +72,7 @@
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="" label="board 2" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="board03" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="8" maxY="" allocReadMember="true" isDynamic="false">
<attributes name="board03" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="8" maxY="" allocReadMember="false" isDynamic="false">
<dataType xsi:type="pogoDsl:BooleanType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
......@@ -80,7 +80,7 @@
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="" label="board 3" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="board04" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="8" maxY="" allocReadMember="true" isDynamic="false">
<attributes name="board04" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="8" maxY="" allocReadMember="false" isDynamic="false">
<dataType xsi:type="pogoDsl:BooleanType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
......@@ -88,7 +88,7 @@
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="" label="board 4" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="board05" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="8" maxY="" allocReadMember="true" isDynamic="false">
<attributes name="board05" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="8" maxY="" allocReadMember="false" isDynamic="false">
<dataType xsi:type="pogoDsl:BooleanType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
......@@ -96,7 +96,7 @@
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="" label="board 5" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="board06" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="8" maxY="" allocReadMember="true" isDynamic="false">
<attributes name="board06" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="8" maxY="" allocReadMember="false" isDynamic="false">
<dataType xsi:type="pogoDsl:BooleanType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
......@@ -104,7 +104,7 @@
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="" label="board 6" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="board07" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="8" maxY="" allocReadMember="true" isDynamic="false">
<attributes name="board07" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="8" maxY="" allocReadMember="false" isDynamic="false">
<dataType xsi:type="pogoDsl:BooleanType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
......@@ -112,7 +112,7 @@
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="" label="board 7" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="board08" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="8" maxY="" allocReadMember="true" isDynamic="false">
<attributes name="board08" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="8" maxY="" allocReadMember="false" isDynamic="false">
<dataType xsi:type="pogoDsl:BooleanType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
......@@ -120,7 +120,7 @@
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="" label="board 8" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="board09" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="8" maxY="" allocReadMember="true" isDynamic="false">
<attributes name="board09" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="8" maxY="" allocReadMember="false" isDynamic="false">
<dataType xsi:type="pogoDsl:BooleanType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
......@@ -128,7 +128,7 @@
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="" label="board 9" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="board10" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="8" maxY="" allocReadMember="true" isDynamic="false">
<attributes name="board10" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="8" maxY="" allocReadMember="false" isDynamic="false">
<dataType xsi:type="pogoDsl:BooleanType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
......@@ -136,7 +136,7 @@
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="" label="board 10" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="board11" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="8" maxY="" allocReadMember="true" isDynamic="false">
<attributes name="board11" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="8" maxY="" allocReadMember="false" isDynamic="false">
<dataType xsi:type="pogoDsl:BooleanType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
......@@ -152,6 +152,14 @@
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="" label="event log" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="board_stat" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="12" maxY="" allocReadMember="false" isDynamic="false">
<dataType xsi:type="pogoDsl:BooleanType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
<dataReadyEvent fire="false" libCheckCriteria="true"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="" label="board status" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<states name="INIT" description="starting and configuring device">
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</states>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment