From e95d19ec1c33ff4ce153e63641fbde485d4b8561 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 4 Apr 2003 21:55:03 +0000 Subject: [PATCH] Added APST and MPST fields that control whether monitors are fired if the new string is identical to the old one. Default value is "On Change" with behaviour identical to before, set to "Always" to fire monitors every time the record is processed (analagous to setting MDEL=-1 for numeric record types). --- src/rec/stringinRecord.c | 4 ++++ src/rec/stringinRecord.dbd | 16 ++++++++++++++++ src/rec/stringoutRecord.c | 4 ++++ src/rec/stringoutRecord.dbd | 16 ++++++++++++++++ 4 files changed, 40 insertions(+) diff --git a/src/rec/stringinRecord.c b/src/rec/stringinRecord.c index da512420a..c94025c3c 100644 --- a/src/rec/stringinRecord.c +++ b/src/rec/stringinRecord.c @@ -163,6 +163,10 @@ static void monitor(pstringin) monitor_mask |= DBE_VALUE|DBE_LOG; strncpy(pstringin->oval,pstringin->val,sizeof(pstringin->val)); } + if (pstringin->mpst == stringinPOST_Always) + monitor_mask |= DBE_VALUE; + if (pstringin->apst == stringinPOST_Always) + monitor_mask |= DBE_LOG; if(monitor_mask) db_post_events(pstringin,&(pstringin->val[0]),monitor_mask); return; diff --git a/src/rec/stringinRecord.dbd b/src/rec/stringinRecord.dbd index 578aa7ace..acafc8cf4 100644 --- a/src/rec/stringinRecord.dbd +++ b/src/rec/stringinRecord.dbd @@ -7,6 +7,10 @@ # and higher are distributed subject to a Software License Agreement found # in file LICENSE that is included with this distribution. #************************************************************************* +menu(stringinPOST) { + choice(stringinPOST_OnChange,"On Change") + choice(stringinPOST_Always,"Always") +} recordtype(stringin) { include "dbCommon.dbd" field(VAL,DBF_STRING) { @@ -27,6 +31,18 @@ recordtype(stringin) { promptgroup(GUI_INPUTS) interest(1) } + field(MPST,DBF_MENU) { + prompt("Post Value Monitors") + promptgroup(GUI_DISPLAY) + interest(1) + menu(stringinPOST) + } + field(APST,DBF_MENU) { + prompt("Post Archive Monitors") + promptgroup(GUI_DISPLAY) + interest(1) + menu(stringinPOST) + } field(SIOL,DBF_INLINK) { prompt("Sim Input Specifctn") promptgroup(GUI_INPUTS) diff --git a/src/rec/stringoutRecord.c b/src/rec/stringoutRecord.c index e53081009..1559c2437 100644 --- a/src/rec/stringoutRecord.c +++ b/src/rec/stringoutRecord.c @@ -194,6 +194,10 @@ static void monitor(pstringout) monitor_mask |= DBE_VALUE|DBE_LOG; strncpy(pstringout->oval,pstringout->val,sizeof(pstringout->val)); } + if (pstringout->mpst == stringoutPOST_Always) + monitor_mask |= DBE_VALUE; + if (pstringout->apst == stringoutPOST_Always) + monitor_mask |= DBE_LOG; if(monitor_mask) db_post_events(pstringout,&(pstringout->val[0]),monitor_mask); return; diff --git a/src/rec/stringoutRecord.dbd b/src/rec/stringoutRecord.dbd index 89c02562d..25bd2fde9 100644 --- a/src/rec/stringoutRecord.dbd +++ b/src/rec/stringoutRecord.dbd @@ -7,6 +7,10 @@ # and higher are distributed subject to a Software License Agreement found # in file LICENSE that is included with this distribution. #************************************************************************* +menu(stringoutPOST) { + choice(stringoutPOST_OnChange,"On Change") + choice(stringoutPOST_Always,"Always") +} recordtype(stringout) { include "dbCommon.dbd" field(VAL,DBF_STRING) { @@ -38,6 +42,18 @@ recordtype(stringout) { promptgroup(GUI_OUTPUT) interest(1) } + field(MPST,DBF_MENU) { + prompt("Post Value Monitors") + promptgroup(GUI_DISPLAY) + interest(1) + menu(stringoutPOST) + } + field(APST,DBF_MENU) { + prompt("Post Archive Monitors") + promptgroup(GUI_DISPLAY) + interest(1) + menu(stringoutPOST) + } field(SIOL,DBF_OUTLINK) { prompt("Sim Output Specifctn") promptgroup(GUI_INPUTS)