process records when selection index is written, selection mechanism changes, or value is written to choice values

This commit is contained in:
zimoch
2011-12-14 13:43:10 +00:00
parent d40f2ef877
commit b7129e7c3b
3 changed files with 471 additions and 0 deletions

View File

@@ -0,0 +1,457 @@
Index: src/rec/calcoutRecord.c
===================================================================
RCS file: /cvs/G/EPICS/base-3.14.12/src/rec/calcoutRecord.c,v
retrieving revision 1.3
diff -c -r1.3 calcoutRecord.c
*** src/rec/calcoutRecord.c 14 Dec 2011 09:39:53 -0000 1.3
--- src/rec/calcoutRecord.c 14 Dec 2011 13:40:29 -0000
***************
*** 197,202 ****
--- 197,204 ----
callbackSetUser(prec, &prpvt->checkLinkCb);
prpvt->cbScheduled = 0;
+ prec->epvt = eventNameToHandle(prec->oevt);
+
if (pcalcoutDSET->init_record) pcalcoutDSET->init_record(prec);
prec->pval = prec->val;
prec->mlst = prec->val;
***************
*** 357,362 ****
--- 359,367 ----
}
db_post_events(prec, plinkValid, DBE_VALUE);
return 0;
+ case(calcoutRecordOEVT):
+ prec->epvt = eventNameToHandle(prec->oevt);
+ return 0;
default:
recGblDbaddrError(S_db_badChoice, paddr, "calc: special");
return(S_db_badChoice);
***************
*** 540,566 ****
if (prec->nsev < INVALID_ALARM ) {
/* Output the value */
status = writeValue(prec);
! /* post event if output event != 0 */
! if (prec->oevt > 0) {
! post_event((int)prec->oevt);
! }
} else switch (prec->ivoa) {
case menuIvoaContinue_normally:
status = writeValue(prec);
! /* post event if output event != 0 */
! if (prec->oevt > 0) {
! post_event((int)prec->oevt);
! }
break;
case menuIvoaDon_t_drive_outputs:
break;
case menuIvoaSet_output_to_IVOV:
prec->oval = prec->ivov;
status = writeValue(prec);
! /* post event if output event != 0 */
! if (prec->oevt > 0) {
! post_event((int)prec->oevt);
! }
break;
default:
status = -1;
--- 545,565 ----
if (prec->nsev < INVALID_ALARM ) {
/* Output the value */
status = writeValue(prec);
! /* post output event if set */
! if (prec->epvt) postEvent(prec->epvt);
} else switch (prec->ivoa) {
case menuIvoaContinue_normally:
status = writeValue(prec);
! /* post output event if set */
! if (prec->epvt) postEvent(prec->epvt);
break;
case menuIvoaDon_t_drive_outputs:
break;
case menuIvoaSet_output_to_IVOV:
prec->oval = prec->ivov;
status = writeValue(prec);
! /* post output event if set */
! if (prec->epvt) postEvent(prec->epvt);
break;
default:
status = -1;
Index: src/rec/calcoutRecord.dbd
===================================================================
RCS file: /cvs/G/EPICS/base-3.14.12/src/rec/calcoutRecord.dbd,v
retrieving revision 1.3
diff -c -r1.3 calcoutRecord.dbd
*** src/rec/calcoutRecord.dbd 14 Dec 2011 09:39:53 -0000 1.3
--- src/rec/calcoutRecord.dbd 14 Dec 2011 13:40:29 -0000
***************
*** 255,264 ****
prompt("OCAL Valid")
interest(1)
}
! field(OEVT,DBF_USHORT) {
prompt("Event To Issue")
promptgroup(GUI_CLOCK)
asl(ASL0)
}
field(IVOA,DBF_MENU) {
prompt("INVALID output action")
--- 255,273 ----
prompt("OCAL Valid")
interest(1)
}
! field(OEVT,DBF_STRING) {
prompt("Event To Issue")
promptgroup(GUI_CLOCK)
+ special(SPC_MOD)
asl(ASL0)
+ size(40)
+ }
+ %#include "dbScan.h"
+ field(EPVT, DBF_NOACCESS) {
+ prompt("Event private")
+ special(SPC_NOMOD)
+ interest(4)
+ extra("EVENTPVT epvt")
}
field(IVOA,DBF_MENU) {
prompt("INVALID output action")
Index: src/rec/eventRecord.c
===================================================================
RCS file: /cvs/G/EPICS/base-3.14.12/src/rec/eventRecord.c,v
retrieving revision 1.4
diff -c -r1.4 eventRecord.c
*** src/rec/eventRecord.c 14 Dec 2011 09:39:53 -0000 1.4
--- src/rec/eventRecord.c 14 Dec 2011 13:40:29 -0000
***************
*** 32,37 ****
--- 32,38 ----
#include "errMdef.h"
#include "recSup.h"
#include "recGbl.h"
+ #include "special.h"
#include "menuYesNo.h"
#define GEN_SIZE_OFFSET
#include "eventRecord.h"
***************
*** 43,49 ****
#define initialize NULL
static long init_record(eventRecord *, int);
static long process(eventRecord *);
! #define special NULL
static long get_value(eventRecord *, struct valueDes *);
#define cvt_dbaddr NULL
#define get_array_info NULL
--- 44,50 ----
#define initialize NULL
static long init_record(eventRecord *, int);
static long process(eventRecord *);
! static long special(DBADDR *, int);
static long get_value(eventRecord *, struct valueDes *);
#define cvt_dbaddr NULL
#define get_array_info NULL
***************
*** 103,111 ****
}
if (prec->siol.type == CONSTANT) {
! recGblInitConstantLink(&prec->siol,DBF_USHORT,&prec->sval);
}
if( (pdset=(struct eventdset *)(prec->dset)) && (pdset->init_record) )
status=(*pdset->init_record)(prec);
return(status);
--- 104,114 ----
}
if (prec->siol.type == CONSTANT) {
! recGblInitConstantLink(&prec->siol,DBF_STRING,&prec->sval);
}
+ prec->epvt = eventNameToHandle(prec->val);
+
if( (pdset=(struct eventdset *)(prec->dset)) && (pdset->init_record) )
status=(*pdset->init_record)(prec);
return(status);
***************
*** 123,129 ****
if ( !pact && prec->pact ) return(0);
prec->pact = TRUE;
! if(prec->val>0) post_event((int)prec->val);
recGblGetTimeStamp(prec);
--- 126,132 ----
if ( !pact && prec->pact ) return(0);
prec->pact = TRUE;
! postEvent(prec->epvt);
recGblGetTimeStamp(prec);
***************
*** 137,146 ****
return(status);
}
static long get_value(eventRecord *prec, struct valueDes *pvdes)
{
! pvdes->field_type = DBF_USHORT;
pvdes->no_elements=1;
pvdes->pvalue = (void *)(&prec->val);
return(0);
--- 140,160 ----
return(status);
}
+
+ static long special(DBADDR *paddr, int after)
+ {
+ eventRecord *prec = (eventRecord *)paddr->precord;
+
+ if (!after) return 0;
+ if (dbGetFieldIndex(paddr) == eventRecordVAL) {
+ prec->epvt = eventNameToHandle(prec->val);
+ }
+ }
+
static long get_value(eventRecord *prec, struct valueDes *pvdes)
{
! pvdes->field_type = DBF_STRING;
pvdes->no_elements=1;
pvdes->pvalue = (void *)(&prec->val);
return(0);
***************
*** 177,186 ****
return(status);
}
if (prec->simm == menuYesNoYES){
! status=dbGetLink(&(prec->siol),DBR_USHORT,
&(prec->sval),0,0);
if (status==0) {
! prec->val=prec->sval;
prec->udf=FALSE;
}
} else {
--- 191,203 ----
return(status);
}
if (prec->simm == menuYesNoYES){
! status=dbGetLink(&(prec->siol),DBR_STRING,
&(prec->sval),0,0);
if (status==0) {
! if (strcmp(prec->sval, prec->val) != 0) {
! strcpy(prec->val, prec->sval);
! prec->epvt = eventNameToHandle(prec->val);
! }
prec->udf=FALSE;
}
} else {
Index: src/rec/eventRecord.dbd
===================================================================
RCS file: /cvs/G/EPICS/base-3.14.12/src/rec/eventRecord.dbd,v
retrieving revision 1.3
diff -c -r1.3 eventRecord.dbd
*** src/rec/eventRecord.dbd 14 Dec 2011 09:39:53 -0000 1.3
--- src/rec/eventRecord.dbd 14 Dec 2011 13:40:29 -0000
***************
*** 9,18 ****
#*************************************************************************
recordtype(event) {
include "dbCommon.dbd"
! field(VAL,DBF_USHORT) {
! prompt("Event Number To Post")
promptgroup(GUI_INPUTS)
asl(ASL0)
}
field(INP,DBF_INLINK) {
prompt("Input Specification")
--- 9,27 ----
#*************************************************************************
recordtype(event) {
include "dbCommon.dbd"
! field(VAL,DBF_STRING) {
! prompt("Event Name To Post")
promptgroup(GUI_INPUTS)
+ special(SPC_MOD)
asl(ASL0)
+ size(40)
+ }
+ %#include "dbScan.h"
+ field(EPVT, DBF_NOACCESS) {
+ prompt("Event private")
+ special(SPC_NOMOD)
+ interest(4)
+ extra("EVENTPVT epvt")
}
field(INP,DBF_INLINK) {
prompt("Input Specification")
***************
*** 24,31 ****
promptgroup(GUI_INPUTS)
interest(1)
}
! field(SVAL,DBF_USHORT) {
prompt("Simulation Value")
}
field(SIML,DBF_INLINK) {
prompt("Sim Mode Location")
--- 33,41 ----
promptgroup(GUI_INPUTS)
interest(1)
}
! field(SVAL,DBF_STRING) {
prompt("Simulation Value")
+ size(40)
}
field(SIML,DBF_INLINK) {
prompt("Sim Mode Location")
Index: src/rec/selRecord.dbd
===================================================================
RCS file: /cvs/G/EPICS/base-3.14.12/src/rec/selRecord.dbd,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 selRecord.dbd
*** src/rec/selRecord.dbd 29 Nov 2010 10:38:07 -0000 1.1.1.1
--- src/rec/selRecord.dbd 14 Dec 2011 13:40:29 -0000
***************
*** 24,32 ****
--- 24,34 ----
prompt("Select Mechanism")
promptgroup(GUI_INPUTS)
menu(selSELM)
+ pp(TRUE)
}
field(SELN,DBF_USHORT) {
prompt("Index value")
+ pp(TRUE)
}
field(PREC,DBF_SHORT) {
prompt("Display Precision")
Index: src/rec/seqRecord.dbd
===================================================================
RCS file: /cvs/G/EPICS/base-3.14.12/src/rec/seqRecord.dbd,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 seqRecord.dbd
*** src/rec/seqRecord.dbd 29 Nov 2010 10:38:07 -0000 1.1.1.1
--- src/rec/seqRecord.dbd 14 Dec 2011 13:40:29 -0000
***************
*** 24,34 ****
--- 24,36 ----
promptgroup(GUI_INPUTS)
interest(1)
menu(seqSELM)
+ pp(TRUE)
}
field(SELN,DBF_USHORT) {
prompt("Link Selection")
interest(1)
initial("1")
+ pp(TRUE)
}
field(SELL,DBF_INLINK) {
prompt("Link Selection Loc")
***************
*** 53,58 ****
--- 55,61 ----
field(DO1,DBF_DOUBLE) {
prompt("Constant input 1")
interest(1)
+ pp(TRUE)
}
field(LNK1,DBF_OUTLINK) {
prompt("Output Link 1")
***************
*** 72,77 ****
--- 75,81 ----
field(DO2,DBF_DOUBLE) {
prompt("Constant input 2")
interest(1)
+ pp(TRUE)
}
field(LNK2,DBF_OUTLINK) {
prompt("Output Link 2")
***************
*** 91,96 ****
--- 95,101 ----
field(DO3,DBF_DOUBLE) {
prompt("Constant input 3")
interest(1)
+ pp(TRUE)
}
field(LNK3,DBF_OUTLINK) {
prompt("Output Link 3")
***************
*** 110,115 ****
--- 115,121 ----
field(DO4,DBF_DOUBLE) {
prompt("Constant input 4")
interest(1)
+ pp(TRUE)
}
field(LNK4,DBF_OUTLINK) {
prompt("Output Link 4")
***************
*** 129,134 ****
--- 135,141 ----
field(DO5,DBF_DOUBLE) {
prompt("Constant input 5")
interest(1)
+ pp(TRUE)
}
field(LNK5,DBF_OUTLINK) {
prompt("Output Link 5")
***************
*** 148,153 ****
--- 155,161 ----
field(DO6,DBF_DOUBLE) {
prompt("Constant input 6")
interest(1)
+ pp(TRUE)
}
field(LNK6,DBF_OUTLINK) {
prompt("Output Link 6")
***************
*** 167,172 ****
--- 175,181 ----
field(DO7,DBF_DOUBLE) {
prompt("Constant input 7")
interest(1)
+ pp(TRUE)
}
field(LNK7,DBF_OUTLINK) {
prompt("Output Link 7")
***************
*** 186,191 ****
--- 195,201 ----
field(DO8,DBF_DOUBLE) {
prompt("Constant input 8")
interest(1)
+ pp(TRUE)
}
field(LNK8,DBF_OUTLINK) {
prompt("Output Link 8")
***************
*** 205,210 ****
--- 215,221 ----
field(DO9,DBF_DOUBLE) {
prompt("Constant input 9")
interest(1)
+ pp(TRUE)
}
field(LNK9,DBF_OUTLINK) {
prompt("Output Link 9")
***************
*** 224,229 ****
--- 235,241 ----
field(DOA,DBF_DOUBLE) {
prompt("Constant input 10")
interest(1)
+ pp(TRUE)
}
field(LNKA,DBF_OUTLINK) {
prompt("Output Link 10")

View File

@@ -24,9 +24,11 @@ recordtype(sel) {
prompt("Select Mechanism")
promptgroup(GUI_INPUTS)
menu(selSELM)
pp(TRUE)
}
field(SELN,DBF_USHORT) {
prompt("Index value")
pp(TRUE)
}
field(PREC,DBF_SHORT) {
prompt("Display Precision")

View File

@@ -24,11 +24,13 @@ recordtype(seq) {
promptgroup(GUI_INPUTS)
interest(1)
menu(seqSELM)
pp(TRUE)
}
field(SELN,DBF_USHORT) {
prompt("Link Selection")
interest(1)
initial("1")
pp(TRUE)
}
field(SELL,DBF_INLINK) {
prompt("Link Selection Loc")
@@ -53,6 +55,7 @@ recordtype(seq) {
field(DO1,DBF_DOUBLE) {
prompt("Constant input 1")
interest(1)
pp(TRUE)
}
field(LNK1,DBF_OUTLINK) {
prompt("Output Link 1")
@@ -72,6 +75,7 @@ recordtype(seq) {
field(DO2,DBF_DOUBLE) {
prompt("Constant input 2")
interest(1)
pp(TRUE)
}
field(LNK2,DBF_OUTLINK) {
prompt("Output Link 2")
@@ -91,6 +95,7 @@ recordtype(seq) {
field(DO3,DBF_DOUBLE) {
prompt("Constant input 3")
interest(1)
pp(TRUE)
}
field(LNK3,DBF_OUTLINK) {
prompt("Output Link 3")
@@ -110,6 +115,7 @@ recordtype(seq) {
field(DO4,DBF_DOUBLE) {
prompt("Constant input 4")
interest(1)
pp(TRUE)
}
field(LNK4,DBF_OUTLINK) {
prompt("Output Link 4")
@@ -129,6 +135,7 @@ recordtype(seq) {
field(DO5,DBF_DOUBLE) {
prompt("Constant input 5")
interest(1)
pp(TRUE)
}
field(LNK5,DBF_OUTLINK) {
prompt("Output Link 5")
@@ -148,6 +155,7 @@ recordtype(seq) {
field(DO6,DBF_DOUBLE) {
prompt("Constant input 6")
interest(1)
pp(TRUE)
}
field(LNK6,DBF_OUTLINK) {
prompt("Output Link 6")
@@ -167,6 +175,7 @@ recordtype(seq) {
field(DO7,DBF_DOUBLE) {
prompt("Constant input 7")
interest(1)
pp(TRUE)
}
field(LNK7,DBF_OUTLINK) {
prompt("Output Link 7")
@@ -186,6 +195,7 @@ recordtype(seq) {
field(DO8,DBF_DOUBLE) {
prompt("Constant input 8")
interest(1)
pp(TRUE)
}
field(LNK8,DBF_OUTLINK) {
prompt("Output Link 8")
@@ -205,6 +215,7 @@ recordtype(seq) {
field(DO9,DBF_DOUBLE) {
prompt("Constant input 9")
interest(1)
pp(TRUE)
}
field(LNK9,DBF_OUTLINK) {
prompt("Output Link 9")
@@ -224,6 +235,7 @@ recordtype(seq) {
field(DOA,DBF_DOUBLE) {
prompt("Constant input 10")
interest(1)
pp(TRUE)
}
field(LNKA,DBF_OUTLINK) {
prompt("Output Link 10")