Add SIMM=RAW for mbboDirect record
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
#include "special.h"
|
||||
#include "menuOmsl.h"
|
||||
#include "menuIvoa.h"
|
||||
#include "menuYesNo.h"
|
||||
#include "menuSimm.h"
|
||||
|
||||
#define GEN_SIZE_OFFSET
|
||||
#include "mbboDirectRecord.h"
|
||||
@@ -364,14 +364,18 @@ static long writeValue(mbboDirectRecord *prec)
|
||||
}
|
||||
|
||||
switch (prec->simm) {
|
||||
case menuYesNoNO:
|
||||
case menuSimmNO:
|
||||
status = pdset->write_mbbo(prec);
|
||||
break;
|
||||
|
||||
case menuYesNoYES: {
|
||||
case menuSimmYES:
|
||||
case menuSimmRAW:
|
||||
recGblSetSevr(prec, SIMM_ALARM, prec->sims);
|
||||
if (prec->pact || (prec->sdly < 0.)) {
|
||||
status = dbPutLink(&prec->siol, DBR_ULONG, &prec->val, 1);
|
||||
if (prec->simm == menuSimmYES)
|
||||
status = dbPutLink(&prec->siol, DBR_LONG, &prec->val, 1);
|
||||
else /* prec->simm == menuSimmRAW */
|
||||
status = dbPutLink(&prec->siol, DBR_ULONG, &prec->rval, 1);
|
||||
prec->pact = FALSE;
|
||||
} else { /* !prec->pact && delay >= 0. */
|
||||
epicsCallback *pvt = prec->simpvt;
|
||||
@@ -383,7 +387,6 @@ static long writeValue(mbboDirectRecord *prec)
|
||||
prec->pact = TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
recGblSetSevr(prec, SOFT_ALARM, INVALID_ALARM);
|
||||
|
||||
@@ -178,6 +178,7 @@ The following fields are used to operate the record in simulation mode.
|
||||
|
||||
If SIMM (fetched through SIML) is YES, the record is put in SIMS
|
||||
severity and the value is written through SIOL, without conversion.
|
||||
If SIMM is RAW, the value is converted and RVAL is written.
|
||||
SSCN sets a different SCAN mechanism to use in simulation mode.
|
||||
SDLY sets a delay (in sec) that is used for asynchronous simulation
|
||||
processing.
|
||||
@@ -203,7 +204,7 @@ for more information on simulation mode and its fields.
|
||||
prompt("Simulation Mode")
|
||||
special(SPC_MOD)
|
||||
interest(1)
|
||||
menu(menuYesNo)
|
||||
menu(menuSimm)
|
||||
}
|
||||
field(SIMS,DBF_MENU) {
|
||||
prompt("Simulation Mode Severity")
|
||||
|
||||
@@ -67,7 +67,8 @@ static char *rawSupp[] = {
|
||||
"mbbiDirect",
|
||||
"ao",
|
||||
"bo",
|
||||
"mbbo"
|
||||
"mbbo",
|
||||
"mbboDirect"
|
||||
};
|
||||
|
||||
static
|
||||
@@ -84,6 +85,7 @@ static char nameB0[PVNAMELENGTH];
|
||||
static char nameONVL[PVNAMELENGTH];
|
||||
static char nameRVAL[PVNAMELENGTH];
|
||||
static char nameROFF[PVNAMELENGTH];
|
||||
static char nameSHFT[PVNAMELENGTH];
|
||||
static char nameSGNL[PVNAMELENGTH];
|
||||
static char nameSIMM[PVNAMELENGTH];
|
||||
static char nameSIML[PVNAMELENGTH];
|
||||
@@ -106,7 +108,7 @@ static
|
||||
void setNames(const char *name)
|
||||
{
|
||||
SETNAME(VAL); SETNAME(B0); SETNAME(ONVL);
|
||||
SETNAME(RVAL); SETNAME(ROFF); SETNAME(SGNL);
|
||||
SETNAME(RVAL); SETNAME(ROFF); SETNAME(SHFT); SETNAME(SGNL);
|
||||
SETNAME(SVAL); SETNAME(SIMM); SETNAME(SIML); SETNAME(SIOL); SETNAME(SIMS);
|
||||
SETNAME(SCAN); SETNAME(PROC); SETNAME(PACT);
|
||||
SETNAME(STAT); SETNAME(SEVR); SETNAME(TSE);
|
||||
@@ -429,6 +431,11 @@ void testSiolWrite(const char *name,
|
||||
testdbPutFieldOk(nameVAL, DBR_UCHAR, 1);
|
||||
testdbGetFieldEqual(nameRVAL, DBR_ULONG, 5);
|
||||
testdbGetFieldEqual(nameSimval, DBR_UCHAR, 5);
|
||||
} else if (strcmp(name, "mbboDirect") == 0) {
|
||||
testdbPutFieldOk(nameSHFT, DBR_ULONG, 2);
|
||||
testdbPutFieldOk(nameB0, DBR_UCHAR, 1);
|
||||
testdbGetFieldEqual(nameRVAL, DBR_ULONG, 4);
|
||||
testdbGetFieldEqual(nameSimval, DBR_UCHAR, 4);
|
||||
}
|
||||
testdbPutFieldOk(nameSIML, DBR_STRING, nameSimmode);
|
||||
}
|
||||
@@ -550,7 +557,7 @@ void testAllRecTypes(void)
|
||||
|
||||
MAIN(simmTest)
|
||||
{
|
||||
testPlan(1244);
|
||||
testPlan(1267);
|
||||
startSimmTestIoc("simmTest.db");
|
||||
|
||||
testSimmSetup();
|
||||
|
||||
Reference in New Issue
Block a user