Skip to content
This repository was archived by the owner on Jul 8, 2022. It is now read-only.

Commit 3b35b49

Browse files
mliszczbourtemb
authored andcommitted
Early detect missing value for alarmed attribute
If no value was provided for an attribute during read (e.g. exception was thrown), set attribute's quality to invalid to ensure that alarm condition is not evaluated (it is not possible as the value is missing).
1 parent d5de343 commit 3b35b49

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

cppapi/server/attribute.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1681,14 +1681,6 @@ bool Attribute::check_alarm()
16811681
return returned;
16821682
}
16831683

1684-
// Skip alarm evaluation if no value for this attribute was provided during last read.
1685-
1686-
if (!get_value_flag())
1687-
{
1688-
DEV_WARN_STREAM(dev) << "Attribute has no value, skipping alarm evaluation for: " << get_name() << std::endl;
1689-
return false;
1690-
}
1691-
16921684
//
16931685
// Get the monitor protecting device att config
16941686
//

cppapi/server/device.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,6 +1274,14 @@ Tango::DevState DeviceImpl::dev_state()
12741274
}
12751275
catch (Tango::DevFailed &)
12761276
{
1277+
if (!att.get_value_flag())
1278+
{
1279+
WARN_STREAM
1280+
<< "Attribute has no value, forcing INVALID quality for: "
1281+
<< att.get_name() << std::endl;
1282+
att.set_quality(Tango::ATTR_INVALID);
1283+
}
1284+
12771285
for (j = 0; j < i; j++)
12781286
{
12791287
long idx;

0 commit comments

Comments
 (0)