Skip to content

Commit

Permalink
ScalarAlarmSupport::AlarmRange now declares an enum
Browse files Browse the repository at this point in the history
Remove the unused private field by that name.
Make prevAlarmRange use that enum.
  • Loading branch information
anjohnson committed Dec 28, 2023
1 parent f207e51 commit dbc06c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/pv/scalarAlarmSupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ class epicsShareClass ScalarAlarmSupport :
/**
* @brief Honors scalarAlarm fields.
*
*
* @return Returns true is any fields were modified; otherwise false.
* @return true if any fields were modified, otherwise false.
*/
virtual bool process();
/**
Expand All @@ -77,20 +76,20 @@ class epicsShareClass ScalarAlarmSupport :
private:

ScalarAlarmSupport(PVRecordPtr const & pvRecord);
enum {
enum AlarmRange {
range_Lolo = 0,
range_Low,
range_Normal,
range_High,
range_Hihi,
range_Invalid,
range_Undefined
} AlarmRange;
};
void setAlarm(
epics::pvData::PVStructurePtr const & pvAlarm,
int alarmRange);
PVRecordPtr pvRecord;
int prevAlarmRange;
enum AlarmRange prevAlarmRange;
epics::pvData::PVScalarPtr pvValue;
epics::pvData::PVStructurePtr pvAlarm;
epics::pvData::PVStructurePtr pvScalarAlarm;
Expand Down
2 changes: 1 addition & 1 deletion src/support/scalarAlarmSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ bool ScalarAlarmSupport::process()
double highWarningLimit = pvHighWarningLimit->get();
double highAlarmLimit = pvHighAlarmLimit->get();
double hysteresis = pvHysteresis->get();
int alarmRange = range_Normal;
enum AlarmRange alarmRange = range_Normal;
if(highAlarmLimit>lowAlarmLimit) {
if(value>=highAlarmLimit
||(prevAlarmRange==range_Hihi && value>=highAlarmLimit-hysteresis)) {
Expand Down

0 comments on commit dbc06c1

Please sign in to comment.