Ken -
MEDM is supposed to allow use of the Alarm Status in the visibility calc.
I tried to use this feature, and it does not work.
Perusal of the code reveals that Alarm Status changes are not propagated
from a monitored channel into the Record for a display object, which means
this feature has never worked.
Appended below is a patch that produces the correct behavior. The diff is
against medm V2.3.6Beta30, but the relevant code has not changed in
V3.0.2Beta2.
I should also point out that this code (and the similar handling of Alarm
Severity) only works because when records usually call db_post_events()
for .VAL with "DBE_VALUE" as well as "DBE_ALARM".
The code in setMonitorChanged() (in utils.c) only sets monitorValueChanged
for object with V_CALC, when is should also set monitorSeverityChanged
(which should probably be monitorAlarmChanged).
- brian
================
diff -c medm.2.3.6Beta30/medm/medmCA.c medm.2.3.6Beta30/medm/medmCA.c.orig
*** medm.2.3.6Beta30/medm/medmCA.c Tue Nov 26 16:15:30 2002
--- medm.2.3.6Beta30/medm/medmCA.c.orig Tue Sep 25 15:11:58 2001
***************
*** 699,705 ****
static void medmUpdateChannelCb(struct event_handler_args args) {
Channel *pCh = (Channel *)ca_puser(args.chid);
Boolean severityChanged = False;
- Boolean statusChanged = False; /* bgmca */
Boolean zeroAndNoneZeroTransition = False;
Record *pr;
double value;
--- 698,703 ----
***************
*** 844,855 ****
severityChanged = True;
}
- /* Mark status changed - bgmca */
- if(pr->status != ((dataBuf *)(args.dbr))->d.status) {
- pr->status = ((dataBuf *)(args.dbr))->d.status;
- statusChanged = True;
- }
-
/* Set the new value into the record */
pr->value = value;
--- 842,847 ----
***************
*** 862,869 ****
if(pCh->pr->updateValueCb) {
if(pr->monitorValueChanged) {
pr->updateValueCb((XtPointer)pr);
! } else if(pr->monitorSeverityChanged &&
! (statusChanged || severityChanged)) { /* bgmca */
pr->updateValueCb((XtPointer)pr);
} else if(pr->monitorZeroAndNoneZeroTransition &&
zeroAndNoneZeroTransition) {
--- 854,860 ----
if(pCh->pr->updateValueCb) {
if(pr->monitorValueChanged) {
pr->updateValueCb((XtPointer)pr);
! } else if(pr->monitorSeverityChanged && severityChanged) {
pr->updateValueCb((XtPointer)pr);
} else if(pr->monitorZeroAndNoneZeroTransition &&
zeroAndNoneZeroTransition) {
Diff finished at Thu Dec 5 16:52:32
- Navigate by Date:
- Prev:
Re: Building 3.14 on solaris Was: Building 3.13Extensions with 3.14 base Problem. Peter Kurpis
- Next:
Work in sunny California Chestnut, Ronald P.
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
<2002>
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: Building 3.14 on solaris Was: Building 3.13Extensions with 3.14 base Problem. Peter Kurpis
- Next:
Work in sunny California Chestnut, Ronald P.
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
<2002>
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|