get_alarm_double() inconsistent across record types

Bug #1770292 reported by Ralph Lange on 2018-05-10
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
EPICS Base
Status tracked in 7.0
3.14
Low
Ralph Lange
3.15
Low
Ralph Lange
3.16
Low
Unassigned
7.0
Low
Unassigned

Bug Description

The get_alarm_double() method of the Record Support API is implemented inconsistently across record types.
E.g.

The longin record uses
    if(dbGetFieldIndex(paddr) == indexof(VAL)){
         pad->upper_alarm_limit = prec->hihi;
         pad->upper_warning_limit = prec->high;
         pad->lower_warning_limit = prec->low;
         pad->lower_alarm_limit = prec->lolo;
    } else recGblGetAlarmDouble(paddr,pad);
If the channel is the VAL field, the elements are set from the four fields of the record, NaN otherwise.

The ai record uses
    if (dbGetFieldIndex(paddr) == indexof(VAL)) {
        pad->upper_alarm_limit = prec->hhsv ? prec->hihi : epicsNAN;
        pad->upper_warning_limit = prec->hsv ? prec->high : epicsNAN;
        pad->lower_warning_limit = prec->lsv ? prec->low : epicsNAN;
        pad->lower_alarm_limit = prec->llsv ? prec->lolo : epicsNAN;
    } else recGblGetAlarmDouble(paddr,pad);
If the channel is the VAL field, the elements are filled from the four fields if the appropriate severity is set.

Ralph Lange (ralph-lange) wrote :

The inconsistency was introduced in 3.14.11 by commit c0052ea (https://git.launchpad.net/epics-base/commit/?h=3.14&id=c0052ea44f3befdb99089228a1e57956338a478b) that was changing only the records with double type values.

Ralph Lange (ralph-lange) wrote :
Changed in epics-base:
assignee: nobody → Ralph Lange (ralph-lange)
milestone: none → 3.14.branch
importance: Undecided → Low
status: New → In Progress
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers