fixed get_units, get_precision, get_graphic_double, and get_control_double to return meaningful values on non-VAL fields
This commit is contained in:
+36
-11
@@ -191,11 +191,20 @@ static long put_array_info(DBADDR *paddr, long nNew)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define indexof(field) aaiRecord##field
|
||||
|
||||
static long get_units(DBADDR *paddr, char *units)
|
||||
{
|
||||
aaiRecord *prec = (aaiRecord *)paddr->precord;
|
||||
|
||||
strncpy(units, prec->egu, DB_UNITS_SIZE);
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(VAL):
|
||||
if (prec->ftvl == DBF_STRING || prec->ftvl == DBF_ENUM)
|
||||
break;
|
||||
case indexof(HOPR):
|
||||
case indexof(LOPR):
|
||||
strncpy(units,prec->egu,DB_UNITS_SIZE);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -204,8 +213,8 @@ static long get_precision(DBADDR *paddr, long *precision)
|
||||
aaiRecord *prec = (aaiRecord *)paddr->precord;
|
||||
|
||||
*precision = prec->prec;
|
||||
if (paddr->pfield == (void *)prec->bptr) return 0;
|
||||
recGblGetPrec(paddr, precision);
|
||||
if (dbGetFieldIndex(paddr) != indexof(VAL))
|
||||
recGblGetPrec(paddr, precision);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -213,10 +222,18 @@ static long get_graphic_double(DBADDR *paddr, struct dbr_grDouble *pgd)
|
||||
{
|
||||
aaiRecord *prec = (aaiRecord *)paddr->precord;
|
||||
|
||||
if (paddr->pfield == (void *)prec->bptr) {
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
} else recGblGetGraphicDouble(paddr, pgd);
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(VAL):
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
break;
|
||||
case indexof(NORD):
|
||||
pgd->upper_disp_limit = prec->nelm;
|
||||
pgd->lower_disp_limit = 0;
|
||||
break;
|
||||
default:
|
||||
recGblGetGraphicDouble(paddr, pgd);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -224,10 +241,18 @@ static long get_control_double(DBADDR *paddr, struct dbr_ctrlDouble *pcd)
|
||||
{
|
||||
aaiRecord *prec = (aaiRecord *)paddr->precord;
|
||||
|
||||
if (paddr->pfield == (void *)prec->bptr) {
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
} else recGblGetControlDouble(paddr, pcd);
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(VAL):
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
break;
|
||||
case indexof(NORD):
|
||||
pcd->upper_ctrl_limit = prec->nelm;
|
||||
pcd->lower_ctrl_limit = 0;
|
||||
break;
|
||||
default:
|
||||
recGblGetControlDouble(paddr, pcd);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+36
-11
@@ -188,11 +188,20 @@ static long put_array_info(DBADDR *paddr, long nNew)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define indexof(field) aaoRecord##field
|
||||
|
||||
static long get_units(DBADDR *paddr, char *units)
|
||||
{
|
||||
aaoRecord *prec = (aaoRecord *)paddr->precord;
|
||||
|
||||
strncpy(units, prec->egu, DB_UNITS_SIZE);
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(VAL):
|
||||
if (prec->ftvl == DBF_STRING || prec->ftvl == DBF_ENUM)
|
||||
break;
|
||||
case indexof(HOPR):
|
||||
case indexof(LOPR):
|
||||
strncpy(units,prec->egu,DB_UNITS_SIZE);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -201,8 +210,8 @@ static long get_precision(DBADDR *paddr, long *precision)
|
||||
aaoRecord *prec = (aaoRecord *)paddr->precord;
|
||||
|
||||
*precision = prec->prec;
|
||||
if (paddr->pfield == (void *)prec->bptr) return 0;
|
||||
recGblGetPrec(paddr, precision);
|
||||
if (dbGetFieldIndex(paddr) != indexof(VAL))
|
||||
recGblGetPrec(paddr, precision);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -210,10 +219,18 @@ static long get_graphic_double(DBADDR *paddr, struct dbr_grDouble *pgd)
|
||||
{
|
||||
aaoRecord *prec = (aaoRecord *)paddr->precord;
|
||||
|
||||
if (paddr->pfield == (void *)prec->bptr) {
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
} else recGblGetGraphicDouble(paddr,pgd);
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(VAL):
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
break;
|
||||
case indexof(NORD):
|
||||
pgd->upper_disp_limit = prec->nelm;
|
||||
pgd->lower_disp_limit = 0;
|
||||
break;
|
||||
default:
|
||||
recGblGetGraphicDouble(paddr, pgd);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -221,10 +238,18 @@ static long get_control_double(DBADDR *paddr, struct dbr_ctrlDouble *pcd)
|
||||
{
|
||||
aaoRecord *prec = (aaoRecord *)paddr->precord;
|
||||
|
||||
if(paddr->pfield==(void *)prec->bptr){
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
} else recGblGetControlDouble(paddr,pcd);
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(VAL):
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
break;
|
||||
case indexof(NORD):
|
||||
pcd->upper_ctrl_limit = prec->nelm;
|
||||
pcd->lower_ctrl_limit = 0;
|
||||
break;
|
||||
default:
|
||||
recGblGetControlDouble(paddr, pcd);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+46
-24
@@ -217,11 +217,22 @@ static long special(DBADDR *paddr,int after)
|
||||
}
|
||||
}
|
||||
|
||||
#define indexof(field) aiRecord##field
|
||||
|
||||
static long get_units(DBADDR *paddr, char *units)
|
||||
{
|
||||
aiRecord *prec=(aiRecord *)paddr->precord;
|
||||
|
||||
strncpy(units,prec->egu,DB_UNITS_SIZE);
|
||||
if(paddr->pfldDes->field_type == DBF_DOUBLE) {
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(ASLO):
|
||||
case indexof(AOFF):
|
||||
case indexof(SMOO):
|
||||
break;
|
||||
default:
|
||||
strncpy(units,prec->egu,DB_UNITS_SIZE);
|
||||
}
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -230,7 +241,7 @@ static long get_precision(DBADDR *paddr, long *precision)
|
||||
aiRecord *prec=(aiRecord *)paddr->precord;
|
||||
|
||||
*precision = prec->prec;
|
||||
if(paddr->pfield == (void *)&prec->val) return(0);
|
||||
if (dbGetFieldIndex(paddr) == indexof(VAL)) return(0);
|
||||
recGblGetPrec(paddr,precision);
|
||||
return(0);
|
||||
}
|
||||
@@ -238,43 +249,54 @@ static long get_precision(DBADDR *paddr, long *precision)
|
||||
static long get_graphic_double(DBADDR *paddr,struct dbr_grDouble *pgd)
|
||||
{
|
||||
aiRecord *prec=(aiRecord *)paddr->precord;
|
||||
int fieldIndex = dbGetFieldIndex(paddr);
|
||||
|
||||
if(fieldIndex == aiRecordVAL
|
||||
|| fieldIndex == aiRecordHIHI
|
||||
|| fieldIndex == aiRecordHIGH
|
||||
|| fieldIndex == aiRecordLOW
|
||||
|| fieldIndex == aiRecordLOLO
|
||||
|| fieldIndex == aiRecordHOPR
|
||||
|| fieldIndex == aiRecordLOPR) {
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
} else recGblGetGraphicDouble(paddr,pgd);
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(VAL):
|
||||
case indexof(HIHI):
|
||||
case indexof(HIGH):
|
||||
case indexof(LOW):
|
||||
case indexof(LOLO):
|
||||
case indexof(LALM):
|
||||
case indexof(ALST):
|
||||
case indexof(MLST):
|
||||
case indexof(SVAL):
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
break;
|
||||
default:
|
||||
recGblGetGraphicDouble(paddr,pgd);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long get_control_double(DBADDR *paddr,struct dbr_ctrlDouble *pcd)
|
||||
{
|
||||
aiRecord *prec=(aiRecord *)paddr->precord;
|
||||
int fieldIndex = dbGetFieldIndex(paddr);
|
||||
|
||||
if(fieldIndex == aiRecordVAL
|
||||
|| fieldIndex == aiRecordHIHI
|
||||
|| fieldIndex == aiRecordHIGH
|
||||
|| fieldIndex == aiRecordLOW
|
||||
|| fieldIndex == aiRecordLOLO) {
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
} else recGblGetControlDouble(paddr,pcd);
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(VAL):
|
||||
case indexof(HIHI):
|
||||
case indexof(HIGH):
|
||||
case indexof(LOW):
|
||||
case indexof(LOLO):
|
||||
case indexof(LALM):
|
||||
case indexof(ALST):
|
||||
case indexof(MLST):
|
||||
case indexof(SVAL):
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
break;
|
||||
default:
|
||||
recGblGetControlDouble(paddr,pcd);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long get_alarm_double(DBADDR *paddr,struct dbr_alDouble *pad)
|
||||
{
|
||||
aiRecord *prec=(aiRecord *)paddr->precord;
|
||||
int fieldIndex = dbGetFieldIndex(paddr);
|
||||
|
||||
if(fieldIndex == aiRecordVAL) {
|
||||
if (dbGetFieldIndex(paddr) == indexof(VAL)) {
|
||||
pad->upper_alarm_limit = prec->hhsv ? prec->hihi : epicsNAN;
|
||||
pad->upper_warning_limit = prec->hsv ? prec->high : epicsNAN;
|
||||
pad->lower_warning_limit = prec->lsv ? prec->low : epicsNAN;
|
||||
|
||||
+55
-26
@@ -276,11 +276,21 @@ static long special(DBADDR *paddr, int after)
|
||||
}
|
||||
}
|
||||
|
||||
#define indexof(field) aoRecord##field
|
||||
|
||||
static long get_units(DBADDR * paddr,char *units)
|
||||
{
|
||||
aoRecord *prec=(aoRecord *)paddr->precord;
|
||||
|
||||
strncpy(units,prec->egu,DB_UNITS_SIZE);
|
||||
if(paddr->pfldDes->field_type == DBF_DOUBLE) {
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(ASLO):
|
||||
case indexof(AOFF):
|
||||
break;
|
||||
default:
|
||||
strncpy(units,prec->egu,DB_UNITS_SIZE);
|
||||
}
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -289,10 +299,14 @@ static long get_precision(DBADDR *paddr,long *precision)
|
||||
aoRecord *prec=(aoRecord *)paddr->precord;
|
||||
|
||||
*precision = prec->prec;
|
||||
if(paddr->pfield == (void *)&prec->val
|
||||
|| paddr->pfield == (void *)&prec->oval
|
||||
|| paddr->pfield == (void *)&prec->pval) return(0);
|
||||
recGblGetPrec(paddr,precision);
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(VAL):
|
||||
case indexof(OVAL):
|
||||
case indexof(PVAL):
|
||||
break;
|
||||
default:
|
||||
recGblGetPrec(paddr,precision);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -300,16 +314,24 @@ static long get_graphic_double(DBADDR *paddr,struct dbr_grDouble *pgd)
|
||||
{
|
||||
aoRecord *prec=(aoRecord *)paddr->precord;
|
||||
|
||||
if(paddr->pfield==(void *)&prec->val
|
||||
|| paddr->pfield==(void *)&prec->hihi
|
||||
|| paddr->pfield==(void *)&prec->high
|
||||
|| paddr->pfield==(void *)&prec->low
|
||||
|| paddr->pfield==(void *)&prec->lolo
|
||||
|| paddr->pfield==(void *)&prec->oval
|
||||
|| paddr->pfield==(void *)&prec->pval){
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
} else recGblGetGraphicDouble(paddr,pgd);
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(VAL):
|
||||
case indexof(OVAL):
|
||||
case indexof(PVAL):
|
||||
case indexof(HIHI):
|
||||
case indexof(HIGH):
|
||||
case indexof(LOW):
|
||||
case indexof(LOLO):
|
||||
case indexof(LALM):
|
||||
case indexof(ALST):
|
||||
case indexof(MLST):
|
||||
case indexof(IVOV):
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
break;
|
||||
default:
|
||||
recGblGetGraphicDouble(paddr,pgd);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -317,23 +339,30 @@ static long get_control_double(DBADDR *paddr, struct dbr_ctrlDouble *pcd)
|
||||
{
|
||||
aoRecord *prec=(aoRecord *)paddr->precord;
|
||||
|
||||
if(paddr->pfield==(void *)&prec->val
|
||||
|| paddr->pfield==(void *)&prec->hihi
|
||||
|| paddr->pfield==(void *)&prec->high
|
||||
|| paddr->pfield==(void *)&prec->low
|
||||
|| paddr->pfield==(void *)&prec->lolo
|
||||
|| paddr->pfield==(void *)&prec->oval
|
||||
|| paddr->pfield==(void *)&prec->pval){
|
||||
pcd->upper_ctrl_limit = prec->drvh;
|
||||
pcd->lower_ctrl_limit = prec->drvl;
|
||||
} else recGblGetControlDouble(paddr,pcd);
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(VAL):
|
||||
case indexof(OVAL):
|
||||
case indexof(PVAL):
|
||||
case indexof(HIHI):
|
||||
case indexof(HIGH):
|
||||
case indexof(LOW):
|
||||
case indexof(LOLO):
|
||||
case indexof(LALM):
|
||||
case indexof(ALST):
|
||||
case indexof(MLST):
|
||||
pcd->upper_ctrl_limit = prec->drvh;
|
||||
pcd->lower_ctrl_limit = prec->drvl;
|
||||
break;
|
||||
default:
|
||||
recGblGetControlDouble(paddr,pcd);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
static long get_alarm_double(DBADDR *paddr, struct dbr_alDouble *pad)
|
||||
{
|
||||
aoRecord *prec=(aoRecord *)paddr->precord;
|
||||
|
||||
if(paddr->pfield==(void *)&prec->val){
|
||||
if(dbGetFieldIndex(paddr) == indexof(VAL)){
|
||||
pad->upper_alarm_limit = prec->hhsv ? prec->hihi : epicsNAN;
|
||||
pad->upper_warning_limit = prec->hsv ? prec->high : epicsNAN;
|
||||
pad->lower_warning_limit = prec->lsv ? prec->low : epicsNAN;
|
||||
|
||||
+21
-6
@@ -51,13 +51,13 @@ static long process(boRecord *);
|
||||
#define cvt_dbaddr NULL
|
||||
#define get_array_info NULL
|
||||
#define put_array_info NULL
|
||||
#define get_units NULL
|
||||
static long get_units(DBADDR *, char *);
|
||||
static long get_precision(DBADDR *, long *);
|
||||
static long get_enum_str(DBADDR *, char *);
|
||||
static long get_enum_strs(DBADDR *, struct dbr_enumStrs *);
|
||||
static long put_enum_str(DBADDR *, char *);
|
||||
#define get_graphic_double NULL
|
||||
#define get_control_double NULL
|
||||
static long get_control_double(DBADDR *, struct dbr_ctrlDouble *);
|
||||
#define get_alarm_double NULL
|
||||
|
||||
rset boRSET={
|
||||
@@ -268,15 +268,30 @@ static long process(boRecord *prec)
|
||||
return(status);
|
||||
}
|
||||
|
||||
#define indexof(field) boRecord##field
|
||||
|
||||
static long get_units(DBADDR *paddr, char *units)
|
||||
{
|
||||
if(dbGetFieldIndex(paddr) == indexof(HIGH)) strcpy(units, "s");
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long get_precision(DBADDR *paddr, long *precision)
|
||||
{
|
||||
boRecord *prec=(boRecord *)paddr->precord;
|
||||
|
||||
if(paddr->pfield == (void *)&prec->high) *precision=2;
|
||||
if(dbGetFieldIndex(paddr) == indexof(HIGH)) *precision = 2;
|
||||
else recGblGetPrec(paddr,precision);
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long get_control_double(DBADDR *paddr,struct dbr_ctrlDouble *pcd)
|
||||
{
|
||||
recGblGetControlDouble(paddr,pcd);
|
||||
if(dbGetFieldIndex(paddr) == indexof(HIGH)) {
|
||||
pcd->lower_ctrl_limit = 0.0;
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long get_enum_str(DBADDR *paddr, char *pstring)
|
||||
{
|
||||
boRecord *prec=(boRecord *)paddr->precord;
|
||||
@@ -285,7 +300,7 @@ static long get_enum_str(DBADDR *paddr, char *pstring)
|
||||
|
||||
|
||||
index = dbGetFieldIndex(paddr);
|
||||
if(index!=boRecordVAL) {
|
||||
if(index!=indexof(VAL)) {
|
||||
strcpy(pstring,"Illegal_Value");
|
||||
} else if(*pfield==0) {
|
||||
strncpy(pstring,prec->znam,sizeof(prec->znam));
|
||||
|
||||
+79
-55
@@ -54,7 +54,7 @@ static long get_precision(DBADDR *paddr, long *precision);
|
||||
#define get_enum_strs NULL
|
||||
#define put_enum_str NULL
|
||||
static long get_graphic_double(DBADDR *paddr, struct dbr_grDouble *pgd);
|
||||
static long get_ctrl_double(DBADDR *paddr, struct dbr_ctrlDouble *pcd);
|
||||
static long get_control_double(DBADDR *paddr, struct dbr_ctrlDouble *pcd);
|
||||
static long get_alarm_double(DBADDR *paddr, struct dbr_alDouble *pad);
|
||||
|
||||
rset calcRSET={
|
||||
@@ -74,7 +74,7 @@ rset calcRSET={
|
||||
get_enum_strs,
|
||||
put_enum_str,
|
||||
get_graphic_double,
|
||||
get_ctrl_double,
|
||||
get_control_double,
|
||||
get_alarm_double
|
||||
};
|
||||
epicsExportAddress(rset, calcRSET);
|
||||
@@ -148,83 +148,107 @@ static long special(DBADDR *paddr, int after)
|
||||
return S_db_badChoice;
|
||||
}
|
||||
|
||||
#define indexof(field) calcRecord##field
|
||||
|
||||
static long get_units(DBADDR *paddr, char *units)
|
||||
{
|
||||
calcRecord *prec = (calcRecord *)paddr->precord;
|
||||
int index = dbGetFieldIndex(paddr);
|
||||
|
||||
strncpy(units, prec->egu, DB_UNITS_SIZE);
|
||||
if(paddr->pfldDes->field_type == DBF_DOUBLE) {
|
||||
if((index >= indexof(A) && index <= indexof(L))
|
||||
|| (index >= indexof(LA) && index <= indexof(LL))) {
|
||||
/* We need a way to get units for A-L */;
|
||||
} else {
|
||||
strncpy(units,prec->egu,DB_UNITS_SIZE);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static long get_precision(DBADDR *paddr, long *pprecision)
|
||||
{
|
||||
calcRecord *prec = (calcRecord *)paddr->precord;
|
||||
int index = dbGetFieldIndex(paddr);
|
||||
|
||||
if (paddr->pfield == (void *)&prec->val) {
|
||||
*pprecision = prec->prec;
|
||||
} else {
|
||||
recGblGetPrec(paddr, pprecision);
|
||||
*pprecision = prec->prec;
|
||||
if (index == indexof(VAL)) {
|
||||
return 0;
|
||||
}
|
||||
if((index >= indexof(A) && index <= indexof(L))
|
||||
|| (index >= indexof(LA) && index <= indexof(LL))) {
|
||||
/* We need a way to get precision for A-L */;
|
||||
*pprecision=15;
|
||||
}
|
||||
recGblGetPrec(paddr, pprecision);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static long get_graphic_double(DBADDR *paddr, struct dbr_grDouble *pgd)
|
||||
{
|
||||
calcRecord *prec = (calcRecord *)paddr->precord;
|
||||
|
||||
if (paddr->pfield == (void *)&prec->val ||
|
||||
paddr->pfield == (void *)&prec->hihi ||
|
||||
paddr->pfield == (void *)&prec->high ||
|
||||
paddr->pfield == (void *)&prec->low ||
|
||||
paddr->pfield == (void *)&prec->lolo) {
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
return 0;
|
||||
int index = dbGetFieldIndex(paddr);
|
||||
|
||||
switch (index) {
|
||||
case indexof(VAL):
|
||||
case indexof(HIHI):
|
||||
case indexof(HIGH):
|
||||
case indexof(LOW):
|
||||
case indexof(LOLO):
|
||||
case indexof(LALM):
|
||||
case indexof(ALST):
|
||||
case indexof(MLST):
|
||||
#ifdef __GNUC__
|
||||
case indexof(A) ... indexof(L):
|
||||
case indexof(LA) ... indexof(LL):
|
||||
break;
|
||||
default:
|
||||
#else
|
||||
break;
|
||||
default:
|
||||
if((index >= indexof(A) && index <= indexof(L))
|
||||
|| (index >= indexof(LA) && index <= indexof(LL)))
|
||||
break;
|
||||
#endif
|
||||
recGblGetGraphicDouble(paddr,pgd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (paddr->pfield >= (void *)&prec->a &&
|
||||
paddr->pfield <= (void *)&prec->l) {
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
return 0;
|
||||
}
|
||||
if (paddr->pfield >= (void *)&prec->la &&
|
||||
paddr->pfield <= (void *)&prec->ll) {
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
return 0;
|
||||
}
|
||||
recGblGetGraphicDouble(paddr, pgd);
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static long get_ctrl_double(DBADDR *paddr, struct dbr_ctrlDouble *pcd)
|
||||
static long get_control_double(DBADDR *paddr, struct dbr_ctrlDouble *pcd)
|
||||
{
|
||||
calcRecord *prec = (calcRecord *)paddr->precord;
|
||||
|
||||
if (paddr->pfield == (void *)&prec->val ||
|
||||
paddr->pfield == (void *)&prec->hihi ||
|
||||
paddr->pfield == (void *)&prec->high ||
|
||||
paddr->pfield == (void *)&prec->low ||
|
||||
paddr->pfield == (void *)&prec->lolo) {
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
return 0;
|
||||
int index = dbGetFieldIndex(paddr);
|
||||
|
||||
switch (index) {
|
||||
case indexof(VAL):
|
||||
case indexof(HIHI):
|
||||
case indexof(HIGH):
|
||||
case indexof(LOW):
|
||||
case indexof(LOLO):
|
||||
case indexof(LALM):
|
||||
case indexof(ALST):
|
||||
case indexof(MLST):
|
||||
#ifdef __GNUC__
|
||||
case indexof(A) ... indexof(L):
|
||||
case indexof(LA) ... indexof(LL):
|
||||
break;
|
||||
default:
|
||||
#else
|
||||
break;
|
||||
default:
|
||||
if((index >= indexof(A) && index <= indexof(L))
|
||||
|| (index >= indexof(LA) && index <= indexof(LL)))
|
||||
break;
|
||||
#endif
|
||||
recGblGetControlDouble(paddr,pcd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (paddr->pfield >= (void *)&prec->a &&
|
||||
paddr->pfield <= (void *)&prec->l) {
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
return 0;
|
||||
}
|
||||
if (paddr->pfield >= (void *)&prec->la &&
|
||||
paddr->pfield <= (void *)&prec->ll) {
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
return 0;
|
||||
}
|
||||
recGblGetControlDouble(paddr, pcd);
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -232,7 +256,7 @@ static long get_alarm_double(DBADDR *paddr, struct dbr_alDouble *pad)
|
||||
{
|
||||
calcRecord *prec = (calcRecord *)paddr->precord;
|
||||
|
||||
if (paddr->pfield == (void *)&prec->val) {
|
||||
if (dbGetFieldIndex(paddr) == indexof(VAL)) {
|
||||
pad->upper_alarm_limit = prec->hhsv ? prec->hihi : epicsNAN;
|
||||
pad->upper_warning_limit = prec->hsv ? prec->high : epicsNAN;
|
||||
pad->lower_warning_limit = prec->lsv ? prec->low : epicsNAN;
|
||||
|
||||
+92
-54
@@ -59,7 +59,7 @@ static long get_precision(DBADDR *, long *);
|
||||
#define get_enum_strs NULL
|
||||
#define put_enum_str NULL
|
||||
static long get_graphic_double(DBADDR *, struct dbr_grDouble *);
|
||||
static long get_ctrl_double(DBADDR *, struct dbr_ctrlDouble *);
|
||||
static long get_control_double(DBADDR *, struct dbr_ctrlDouble *);
|
||||
static long get_alarm_double(DBADDR *, struct dbr_alDouble *);
|
||||
|
||||
rset calcoutRSET = {
|
||||
@@ -79,7 +79,7 @@ rset calcoutRSET = {
|
||||
get_enum_strs,
|
||||
put_enum_str,
|
||||
get_graphic_double,
|
||||
get_ctrl_double,
|
||||
get_control_double,
|
||||
get_alarm_double
|
||||
};
|
||||
epicsExportAddress(rset, calcoutRSET);
|
||||
@@ -363,23 +363,49 @@ static long special(DBADDR *paddr, int after)
|
||||
}
|
||||
}
|
||||
|
||||
#define indexof(field) calcoutRecord##field
|
||||
|
||||
static long get_units(DBADDR *paddr, char *units)
|
||||
{
|
||||
calcoutRecord *prec = (calcoutRecord *)paddr->precord;
|
||||
int index = dbGetFieldIndex(paddr);
|
||||
|
||||
strncpy(units, prec->egu, DB_UNITS_SIZE);
|
||||
if(index == indexof(ODLY)) {
|
||||
strcpy(units, "s");
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(paddr->pfldDes->field_type == DBF_DOUBLE) {
|
||||
if((index >= indexof(A) && index <= indexof(L))
|
||||
|| (index >= indexof(LA) && index <= indexof(LL))) {
|
||||
/* We need a way to get units for A-L */;
|
||||
} else {
|
||||
strncpy(units,prec->egu,DB_UNITS_SIZE);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static long get_precision(DBADDR *paddr, long *pprecision)
|
||||
{
|
||||
calcoutRecord *prec = (calcoutRecord *)paddr->precord;
|
||||
int index = dbGetFieldIndex(paddr);
|
||||
|
||||
if (paddr->pfield == (void *)&prec->val) {
|
||||
*pprecision = prec->prec;
|
||||
} else {
|
||||
recGblGetPrec(paddr, pprecision);
|
||||
if(index == indexof(ODLY)) {
|
||||
*pprecision = 2;
|
||||
return 0;
|
||||
}
|
||||
|
||||
*pprecision = prec->prec;
|
||||
if (index == indexof(VAL)) {
|
||||
return 0;
|
||||
}
|
||||
if((index >= indexof(A) && index <= indexof(L))
|
||||
|| (index >= indexof(LA) && index <= indexof(LL))) {
|
||||
/* We need a way to get precision for A-L */;
|
||||
*pprecision=15;
|
||||
}
|
||||
recGblGetPrec(paddr, pprecision);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -387,59 +413,71 @@ static long get_graphic_double(DBADDR *paddr, struct dbr_grDouble *pgd)
|
||||
{
|
||||
calcoutRecord *prec = (calcoutRecord *)paddr->precord;
|
||||
|
||||
if (paddr->pfield == (void *)&prec->val ||
|
||||
paddr->pfield == (void *)&prec->hihi ||
|
||||
paddr->pfield == (void *)&prec->high ||
|
||||
paddr->pfield == (void *)&prec->low ||
|
||||
paddr->pfield == (void *)&prec->lolo) {
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
return 0;
|
||||
int index = dbGetFieldIndex(paddr);
|
||||
|
||||
switch (index) {
|
||||
case indexof(ODLY):
|
||||
return 0;
|
||||
case indexof(VAL):
|
||||
case indexof(HIHI):
|
||||
case indexof(HIGH):
|
||||
case indexof(LOW):
|
||||
case indexof(LOLO):
|
||||
case indexof(LALM):
|
||||
case indexof(ALST):
|
||||
case indexof(MLST):
|
||||
#ifdef __GNUC__
|
||||
case indexof(A) ... indexof(L):
|
||||
case indexof(LA) ... indexof(LL):
|
||||
break;
|
||||
default:
|
||||
#else
|
||||
break;
|
||||
default:
|
||||
if((index >= indexof(A) && index <= indexof(L))
|
||||
|| (index >= indexof(LA) && index <= indexof(LL)))
|
||||
break;
|
||||
#endif
|
||||
recGblGetGraphicDouble(paddr,pgd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (paddr->pfield >= (void *)&prec->a &&
|
||||
paddr->pfield <= (void *)&prec->l) {
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
return 0;
|
||||
}
|
||||
if (paddr->pfield >= (void *)&prec->la &&
|
||||
paddr->pfield <= (void *)&prec->ll) {
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
return 0;
|
||||
}
|
||||
recGblGetGraphicDouble(paddr, pgd);
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static long get_ctrl_double(DBADDR *paddr, struct dbr_ctrlDouble *pcd)
|
||||
static long get_control_double(DBADDR *paddr, struct dbr_ctrlDouble *pcd)
|
||||
{
|
||||
calcoutRecord *prec = (calcoutRecord *)paddr->precord;
|
||||
|
||||
if (paddr->pfield == (void *)&prec->val ||
|
||||
paddr->pfield == (void *)&prec->hihi ||
|
||||
paddr->pfield == (void *)&prec->high ||
|
||||
paddr->pfield == (void *)&prec->low ||
|
||||
paddr->pfield == (void *)&prec->lolo) {
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
return 0;
|
||||
int index = dbGetFieldIndex(paddr);
|
||||
|
||||
switch (index) {
|
||||
case indexof(VAL):
|
||||
case indexof(HIHI):
|
||||
case indexof(HIGH):
|
||||
case indexof(LOW):
|
||||
case indexof(LOLO):
|
||||
case indexof(LALM):
|
||||
case indexof(ALST):
|
||||
case indexof(MLST):
|
||||
#ifdef __GNUC__
|
||||
case indexof(A) ... indexof(L):
|
||||
case indexof(LA) ... indexof(LL):
|
||||
break;
|
||||
default:
|
||||
#else
|
||||
break;
|
||||
default:
|
||||
if((index >= indexof(A) && index <= indexof(L))
|
||||
|| (index >= indexof(LA) && index <= indexof(LL)))
|
||||
break;
|
||||
#endif
|
||||
recGblGetControlDouble(paddr,pcd);
|
||||
if (index == indexof(ODLY)) pcd->lower_ctrl_limit = 0.0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (paddr->pfield >= (void *)&prec->a &&
|
||||
paddr->pfield <= (void *)&prec->l) {
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
return 0;
|
||||
}
|
||||
if (paddr->pfield >= (void *)&prec->la &&
|
||||
paddr->pfield <= (void *)&prec->ll) {
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
return 0;
|
||||
}
|
||||
recGblGetControlDouble(paddr, pcd);
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -447,7 +485,7 @@ static long get_alarm_double(DBADDR *paddr, struct dbr_alDouble *pad)
|
||||
{
|
||||
calcoutRecord *prec = (calcoutRecord *)paddr->precord;
|
||||
|
||||
if (paddr->pfield == (void *)&prec->val) {
|
||||
if (dbGetFieldIndex(paddr) == indexof(VAL)) {
|
||||
pad->upper_alarm_limit = prec->hhsv ? prec->hihi : epicsNAN;
|
||||
pad->upper_warning_limit = prec->hsv ? prec->high : epicsNAN;
|
||||
pad->lower_warning_limit = prec->lsv ? prec->low : epicsNAN;
|
||||
|
||||
+27
-14
@@ -398,11 +398,16 @@ static long put_array_info(DBADDR *paddr, long nNew)
|
||||
return(0);
|
||||
}
|
||||
|
||||
#define indexof(field) compressRecord##field
|
||||
|
||||
static long get_units(DBADDR *paddr,char *units)
|
||||
{
|
||||
compressRecord *prec=(compressRecord *)paddr->precord;
|
||||
|
||||
strncpy(units,prec->egu,DB_UNITS_SIZE);
|
||||
if(paddr->pfldDes->field_type == DBF_DOUBLE
|
||||
|| dbGetFieldIndex(paddr) == indexof(VAL)) {
|
||||
strncpy(units,prec->egu,DB_UNITS_SIZE);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -411,7 +416,7 @@ static long get_precision(DBADDR *paddr, long *precision)
|
||||
compressRecord *prec=(compressRecord *)paddr->precord;
|
||||
|
||||
*precision = prec->prec;
|
||||
if(paddr->pfield == (void *)prec->bptr) return(0);
|
||||
if(dbGetFieldIndex(paddr) == indexof(BPTR)) return(0);
|
||||
recGblGetPrec(paddr,precision);
|
||||
return(0);
|
||||
}
|
||||
@@ -420,12 +425,16 @@ static long get_graphic_double(DBADDR *paddr,struct dbr_grDouble *pgd)
|
||||
{
|
||||
compressRecord *prec=(compressRecord *)paddr->precord;
|
||||
|
||||
if(paddr->pfield==(void *)prec->bptr
|
||||
|| paddr->pfield==(void *)&prec->ihil
|
||||
|| paddr->pfield==(void *)&prec->ilil){
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
} else recGblGetGraphicDouble(paddr,pgd);
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(BPTR):
|
||||
case indexof(IHIL):
|
||||
case indexof(ILIL):
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
break;
|
||||
default:
|
||||
recGblGetGraphicDouble(paddr,pgd);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -433,11 +442,15 @@ static long get_control_double(DBADDR *paddr, struct dbr_ctrlDouble *pcd)
|
||||
{
|
||||
compressRecord *prec=(compressRecord *)paddr->precord;
|
||||
|
||||
if(paddr->pfield==(void *)prec->bptr
|
||||
|| paddr->pfield==(void *)&prec->ihil
|
||||
|| paddr->pfield==(void *)&prec->ilil){
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
} else recGblGetControlDouble(paddr,pcd);
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(BPTR):
|
||||
case indexof(IHIL):
|
||||
case indexof(ILIL):
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
break;
|
||||
default:
|
||||
recGblGetControlDouble(paddr,pcd);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
+36
-37
@@ -126,73 +126,72 @@ static long process(dfanoutRecord *prec)
|
||||
return(status);
|
||||
}
|
||||
|
||||
#define indexof(field) dfanoutRecord##field
|
||||
|
||||
static long get_units(DBADDR *paddr,char *units)
|
||||
{
|
||||
dfanoutRecord *prec=(dfanoutRecord *)paddr->precord;
|
||||
|
||||
strncpy(units,prec->egu,DB_UNITS_SIZE);
|
||||
if(paddr->pfldDes->field_type == DBF_DOUBLE) {
|
||||
strncpy(units,prec->egu,DB_UNITS_SIZE);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long get_precision(DBADDR *paddr,long *precision)
|
||||
{
|
||||
dfanoutRecord *prec=(dfanoutRecord *)paddr->precord;
|
||||
int fieldIndex = dbGetFieldIndex(paddr);
|
||||
|
||||
if(fieldIndex == dfanoutRecordVAL
|
||||
|| fieldIndex == dfanoutRecordHIHI
|
||||
|| fieldIndex == dfanoutRecordHIGH
|
||||
|| fieldIndex == dfanoutRecordLOW
|
||||
|| fieldIndex == dfanoutRecordLOLO
|
||||
|| fieldIndex == dfanoutRecordHOPR
|
||||
|| fieldIndex == dfanoutRecordLOPR) {
|
||||
*precision = prec->prec;
|
||||
} else {
|
||||
recGblGetPrec(paddr,precision);
|
||||
}
|
||||
*precision = prec->prec;
|
||||
if (dbGetFieldIndex(paddr) == indexof(VAL)) return(0);
|
||||
recGblGetPrec(paddr,precision);
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long get_graphic_double(DBADDR *paddr,struct dbr_grDouble *pgd)
|
||||
static long get_graphic_double(DBADDR *paddr,struct dbr_grDouble *pgd)
|
||||
{
|
||||
dfanoutRecord *prec=(dfanoutRecord *)paddr->precord;
|
||||
int fieldIndex = dbGetFieldIndex(paddr);
|
||||
|
||||
if(fieldIndex == dfanoutRecordVAL
|
||||
|| fieldIndex == dfanoutRecordHIHI
|
||||
|| fieldIndex == dfanoutRecordHIGH
|
||||
|| fieldIndex == dfanoutRecordLOW
|
||||
|| fieldIndex == dfanoutRecordLOLO
|
||||
|| fieldIndex == dfanoutRecordHOPR
|
||||
|| fieldIndex == dfanoutRecordLOPR) {
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
} else recGblGetGraphicDouble(paddr,pgd);
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(VAL):
|
||||
case indexof(HIHI):
|
||||
case indexof(HIGH):
|
||||
case indexof(LOW):
|
||||
case indexof(LOLO):
|
||||
case indexof(LALM):
|
||||
case indexof(ALST):
|
||||
case indexof(MLST):
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
break;
|
||||
default:
|
||||
recGblGetGraphicDouble(paddr,pgd);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long get_control_double(DBADDR *paddr,struct dbr_ctrlDouble *pcd)
|
||||
{
|
||||
dfanoutRecord *prec=(dfanoutRecord *)paddr->precord;
|
||||
int fieldIndex = dbGetFieldIndex(paddr);
|
||||
|
||||
if(fieldIndex == dfanoutRecordVAL
|
||||
|| fieldIndex == dfanoutRecordHIHI
|
||||
|| fieldIndex == dfanoutRecordHIGH
|
||||
|| fieldIndex == dfanoutRecordLOW
|
||||
|| fieldIndex == dfanoutRecordLOLO) {
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
} else recGblGetControlDouble(paddr,pcd);
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(VAL):
|
||||
case indexof(LALM):
|
||||
case indexof(ALST):
|
||||
case indexof(MLST):
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
break;
|
||||
default:
|
||||
recGblGetControlDouble(paddr,pcd);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
static long get_alarm_double(DBADDR *paddr,struct dbr_alDouble *pad)
|
||||
{
|
||||
dfanoutRecord *prec=(dfanoutRecord *)paddr->precord;
|
||||
int fieldIndex = dbGetFieldIndex(paddr);
|
||||
|
||||
|
||||
if(fieldIndex == dfanoutRecordVAL) {
|
||||
if(dbGetFieldIndex(paddr) == indexof(VAL)) {
|
||||
pad->upper_alarm_limit = prec->hhsv ? prec->hihi : epicsNAN;
|
||||
pad->upper_warning_limit = prec->hsv ? prec->high : epicsNAN;
|
||||
pad->lower_warning_limit = prec->lsv ? prec->low : epicsNAN;
|
||||
|
||||
+50
-21
@@ -52,7 +52,7 @@ static long special(DBADDR *, int);
|
||||
static long cvt_dbaddr(DBADDR *);
|
||||
static long get_array_info(DBADDR *, long *, long *);
|
||||
#define put_array_info NULL
|
||||
#define get_units NULL
|
||||
static long get_units(DBADDR *, char *);
|
||||
static long get_precision(DBADDR *paddr,long *precision);
|
||||
#define get_enum_str NULL
|
||||
#define get_enum_strs NULL
|
||||
@@ -386,42 +386,71 @@ static long readValue(histogramRecord *prec)
|
||||
return(status);
|
||||
}
|
||||
|
||||
#define indexof(field) histogramRecord##field
|
||||
|
||||
static long get_units(DBADDR *paddr, char *units)
|
||||
{
|
||||
if (dbGetFieldIndex(paddr) == indexof(SDEL)) {
|
||||
strcpy(units,"s");
|
||||
}
|
||||
/* We should have EGU for other DOUBLE values or probably get it from input link SVL */
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long get_precision(DBADDR *paddr,long *precision)
|
||||
{
|
||||
histogramRecord *prec=(histogramRecord *)paddr->precord;
|
||||
int fieldIndex = dbGetFieldIndex(paddr);
|
||||
|
||||
*precision = prec->prec;
|
||||
if(fieldIndex == histogramRecordULIM
|
||||
|| fieldIndex == histogramRecordLLIM
|
||||
|| fieldIndex == histogramRecordSDEL
|
||||
|| fieldIndex == histogramRecordSGNL
|
||||
|| fieldIndex == histogramRecordSVAL
|
||||
|| fieldIndex == histogramRecordWDTH) {
|
||||
*precision = prec->prec;
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(ULIM):
|
||||
case indexof(LLIM):
|
||||
case indexof(SGNL):
|
||||
case indexof(SVAL):
|
||||
case indexof(WDTH):
|
||||
*precision = prec->prec;
|
||||
break;
|
||||
case indexof(SDEL):
|
||||
*precision = 2;
|
||||
break;
|
||||
default:
|
||||
recGblGetPrec(paddr,precision);
|
||||
}
|
||||
recGblGetPrec(paddr,precision);
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long get_graphic_double(DBADDR *paddr,struct dbr_grDouble *pgd)
|
||||
{
|
||||
histogramRecord *prec=(histogramRecord *)paddr->precord;
|
||||
int fieldIndex = dbGetFieldIndex(paddr);
|
||||
|
||||
if(fieldIndex == histogramRecordBPTR){
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
} else recGblGetGraphicDouble(paddr,pgd);
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(BPTR):
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
break;
|
||||
case indexof(WDTH):
|
||||
pgd->upper_disp_limit = prec->ulim-prec->llim;
|
||||
pgd->lower_disp_limit = 0.0;
|
||||
break;
|
||||
default:
|
||||
recGblGetGraphicDouble(paddr,pgd);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
static long get_control_double(DBADDR *paddr,struct dbr_ctrlDouble *pcd)
|
||||
{
|
||||
histogramRecord *prec=(histogramRecord *)paddr->precord;
|
||||
int fieldIndex = dbGetFieldIndex(paddr);
|
||||
|
||||
if(fieldIndex == histogramRecordBPTR){
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
} else recGblGetControlDouble(paddr,pcd);
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(BPTR):
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
break;
|
||||
case indexof(WDTH):
|
||||
pcd->upper_ctrl_limit = prec->ulim-prec->llim;
|
||||
pcd->lower_ctrl_limit = 0.0;
|
||||
break;
|
||||
default:
|
||||
recGblGetControlDouble(paddr,pcd);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
+38
-18
@@ -158,11 +158,15 @@ static long process(longinRecord *prec)
|
||||
return(status);
|
||||
}
|
||||
|
||||
#define indexof(field) longinRecord##field
|
||||
|
||||
static long get_units(DBADDR *paddr,char *units)
|
||||
{
|
||||
longinRecord *prec=(longinRecord *)paddr->precord;
|
||||
|
||||
strncpy(units,prec->egu,DB_UNITS_SIZE);
|
||||
if(paddr->pfldDes->field_type == DBF_LONG) {
|
||||
strncpy(units,prec->egu,DB_UNITS_SIZE);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -171,14 +175,22 @@ static long get_graphic_double(DBADDR *paddr, struct dbr_grDouble *pgd)
|
||||
{
|
||||
longinRecord *prec=(longinRecord *)paddr->precord;
|
||||
|
||||
if(paddr->pfield==(void *)&prec->val
|
||||
|| paddr->pfield==(void *)&prec->hihi
|
||||
|| paddr->pfield==(void *)&prec->high
|
||||
|| paddr->pfield==(void *)&prec->low
|
||||
|| paddr->pfield==(void *)&prec->lolo){
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
} else recGblGetGraphicDouble(paddr,pgd);
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(VAL):
|
||||
case indexof(HIHI):
|
||||
case indexof(HIGH):
|
||||
case indexof(LOW):
|
||||
case indexof(LOLO):
|
||||
case indexof(LALM):
|
||||
case indexof(ALST):
|
||||
case indexof(MLST):
|
||||
case indexof(SVAL):
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
break;
|
||||
default:
|
||||
recGblGetGraphicDouble(paddr,pgd);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -186,14 +198,22 @@ static long get_control_double(DBADDR *paddr, struct dbr_ctrlDouble *pcd)
|
||||
{
|
||||
longinRecord *prec=(longinRecord *)paddr->precord;
|
||||
|
||||
if(paddr->pfield==(void *)&prec->val
|
||||
|| paddr->pfield==(void *)&prec->hihi
|
||||
|| paddr->pfield==(void *)&prec->high
|
||||
|| paddr->pfield==(void *)&prec->low
|
||||
|| paddr->pfield==(void *)&prec->lolo){
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
} else recGblGetControlDouble(paddr,pcd);
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(VAL):
|
||||
case indexof(HIHI):
|
||||
case indexof(HIGH):
|
||||
case indexof(LOW):
|
||||
case indexof(LOLO):
|
||||
case indexof(LALM):
|
||||
case indexof(ALST):
|
||||
case indexof(MLST):
|
||||
case indexof(SVAL):
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
break;
|
||||
default:
|
||||
recGblGetControlDouble(paddr,pcd);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -201,7 +221,7 @@ static long get_alarm_double(DBADDR *paddr, struct dbr_alDouble *pad)
|
||||
{
|
||||
longinRecord *prec=(longinRecord *)paddr->precord;
|
||||
|
||||
if(paddr->pfield==(void *)&prec->val){
|
||||
if(dbGetFieldIndex(paddr) == indexof(VAL)){
|
||||
pad->upper_alarm_limit = prec->hihi;
|
||||
pad->upper_warning_limit = prec->high;
|
||||
pad->lower_warning_limit = prec->low;
|
||||
|
||||
+44
-29
@@ -190,58 +190,73 @@ static long process(longoutRecord *prec)
|
||||
return(status);
|
||||
}
|
||||
|
||||
#define indexof(field) longoutRecord##field
|
||||
|
||||
static long get_units(DBADDR *paddr,char *units)
|
||||
{
|
||||
longoutRecord *prec=(longoutRecord *)paddr->precord;
|
||||
|
||||
strncpy(units,prec->egu,DB_UNITS_SIZE);
|
||||
if(paddr->pfldDes->field_type == DBF_LONG) {
|
||||
strncpy(units,prec->egu,DB_UNITS_SIZE);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long get_graphic_double(DBADDR *paddr,struct dbr_grDouble *pgd)
|
||||
{
|
||||
longoutRecord *prec=(longoutRecord *)paddr->precord;
|
||||
int fieldIndex = dbGetFieldIndex(paddr);
|
||||
|
||||
if(fieldIndex == longoutRecordVAL
|
||||
|| fieldIndex == longoutRecordHIHI
|
||||
|| fieldIndex == longoutRecordHIGH
|
||||
|| fieldIndex == longoutRecordLOW
|
||||
|| fieldIndex == longoutRecordLOLO) {
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
} else recGblGetGraphicDouble(paddr,pgd);
|
||||
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(VAL):
|
||||
case indexof(HIHI):
|
||||
case indexof(HIGH):
|
||||
case indexof(LOW):
|
||||
case indexof(LOLO):
|
||||
case indexof(LALM):
|
||||
case indexof(ALST):
|
||||
case indexof(MLST):
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
break;
|
||||
default:
|
||||
recGblGetGraphicDouble(paddr,pgd);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
static long get_control_double(DBADDR *paddr,struct dbr_ctrlDouble *pcd)
|
||||
{
|
||||
longoutRecord *prec=(longoutRecord *)paddr->precord;
|
||||
int fieldIndex = dbGetFieldIndex(paddr);
|
||||
|
||||
if(fieldIndex == longoutRecordVAL
|
||||
|| fieldIndex == longoutRecordHIHI
|
||||
|| fieldIndex == longoutRecordHIGH
|
||||
|| fieldIndex == longoutRecordLOW
|
||||
|| fieldIndex == longoutRecordLOLO) {
|
||||
/* do not change pre drvh/drvl behavior */
|
||||
if(prec->drvh > prec->drvl) {
|
||||
pcd->upper_ctrl_limit = prec->drvh;
|
||||
pcd->lower_ctrl_limit = prec->drvl;
|
||||
} else {
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
}
|
||||
} else recGblGetControlDouble(paddr,pcd);
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(VAL):
|
||||
case indexof(HIHI):
|
||||
case indexof(HIGH):
|
||||
case indexof(LOW):
|
||||
case indexof(LOLO):
|
||||
case indexof(LALM):
|
||||
case indexof(ALST):
|
||||
case indexof(MLST):
|
||||
/* do not change pre drvh/drvl behavior */
|
||||
if(prec->drvh > prec->drvl) {
|
||||
pcd->upper_ctrl_limit = prec->drvh;
|
||||
pcd->lower_ctrl_limit = prec->drvl;
|
||||
} else {
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
recGblGetControlDouble(paddr,pcd);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long get_alarm_double(DBADDR *paddr,struct dbr_alDouble *pad)
|
||||
{
|
||||
longoutRecord *prec=(longoutRecord *)paddr->precord;
|
||||
int fieldIndex = dbGetFieldIndex(paddr);
|
||||
|
||||
if(fieldIndex == longoutRecordVAL) {
|
||||
if(dbGetFieldIndex(paddr) == indexof(VAL)) {
|
||||
pad->upper_alarm_limit = prec->hihi;
|
||||
pad->upper_warning_limit = prec->high;
|
||||
pad->lower_warning_limit = prec->low;
|
||||
|
||||
+60
-44
@@ -132,11 +132,15 @@ static long process(selRecord *prec)
|
||||
}
|
||||
|
||||
|
||||
#define indexof(field) selRecord##field
|
||||
|
||||
static long get_units(DBADDR *paddr, char *units)
|
||||
{
|
||||
selRecord *prec=(selRecord *)paddr->precord;
|
||||
|
||||
strncpy(units,prec->egu,DB_UNITS_SIZE);
|
||||
if(paddr->pfldDes->field_type == DBF_DOUBLE) {
|
||||
strncpy(units,prec->egu,DB_UNITS_SIZE);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -166,56 +170,68 @@ static long get_precision(DBADDR *paddr, long *precision)
|
||||
static long get_graphic_double(DBADDR *paddr, struct dbr_grDouble *pgd)
|
||||
{
|
||||
selRecord *prec=(selRecord *)paddr->precord;
|
||||
|
||||
if(paddr->pfield==(void *)&prec->val
|
||||
|| paddr->pfield==(void *)&prec->hihi
|
||||
|| paddr->pfield==(void *)&prec->high
|
||||
|| paddr->pfield==(void *)&prec->low
|
||||
|| paddr->pfield==(void *)&prec->lolo){
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
return(0);
|
||||
int index = dbGetFieldIndex(paddr);
|
||||
|
||||
switch (index) {
|
||||
case indexof(VAL):
|
||||
case indexof(HIHI):
|
||||
case indexof(HIGH):
|
||||
case indexof(LOW):
|
||||
case indexof(LOLO):
|
||||
case indexof(LALM):
|
||||
case indexof(ALST):
|
||||
case indexof(MLST):
|
||||
#ifdef __GNUC__
|
||||
case indexof(A) ... indexof(L):
|
||||
case indexof(LA) ... indexof(LL):
|
||||
break;
|
||||
default:
|
||||
#else
|
||||
break;
|
||||
default:
|
||||
if((index >= indexof(A) && index <= indexof(L))
|
||||
|| (index >= indexof(LA) && index <= indexof(LL)))
|
||||
break;
|
||||
#endif
|
||||
recGblGetGraphicDouble(paddr,pgd);
|
||||
return(0);
|
||||
}
|
||||
|
||||
if(paddr->pfield>=(void *)&prec->a && paddr->pfield<=(void *)&prec->l){
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
return(0);
|
||||
}
|
||||
if(paddr->pfield>=(void *)&prec->la && paddr->pfield<=(void *)&prec->ll){
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
return(0);
|
||||
}
|
||||
recGblGetGraphicDouble(paddr,pgd);
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long get_control_double(struct dbAddr *paddr, struct dbr_ctrlDouble *pcd)
|
||||
{
|
||||
selRecord *prec=(selRecord *)paddr->precord;
|
||||
|
||||
if(paddr->pfield==(void *)&prec->val
|
||||
|| paddr->pfield==(void *)&prec->hihi
|
||||
|| paddr->pfield==(void *)&prec->high
|
||||
|| paddr->pfield==(void *)&prec->low
|
||||
|| paddr->pfield==(void *)&prec->lolo){
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
return(0);
|
||||
int index = dbGetFieldIndex(paddr);
|
||||
|
||||
switch (index) {
|
||||
case indexof(VAL):
|
||||
case indexof(HIHI):
|
||||
case indexof(HIGH):
|
||||
case indexof(LOW):
|
||||
case indexof(LOLO):
|
||||
case indexof(LALM):
|
||||
case indexof(ALST):
|
||||
case indexof(MLST):
|
||||
#ifdef __GNUC__
|
||||
case indexof(A) ... indexof(L):
|
||||
case indexof(LA) ... indexof(LL):
|
||||
break;
|
||||
default:
|
||||
#else
|
||||
break;
|
||||
default:
|
||||
if((index >= indexof(A) && index <= indexof(L))
|
||||
|| (index >= indexof(LA) && index <= indexof(LL)))
|
||||
break;
|
||||
#endif
|
||||
recGblGetControlDouble(paddr,pcd);
|
||||
return(0);
|
||||
}
|
||||
|
||||
if(paddr->pfield>=(void *)&prec->a && paddr->pfield<=(void *)&prec->l){
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
return(0);
|
||||
}
|
||||
if(paddr->pfield>=(void *)&prec->la && paddr->pfield<=(void *)&prec->ll){
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
return(0);
|
||||
}
|
||||
recGblGetControlDouble(paddr,pcd);
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -223,7 +239,7 @@ static long get_alarm_double(DBADDR *paddr, struct dbr_alDouble *pad)
|
||||
{
|
||||
selRecord *prec=(selRecord *)paddr->precord;
|
||||
|
||||
if(paddr->pfield==(void *)&prec->val ){
|
||||
if(dbGetFieldIndex(paddr) == indexof(VAL)) {
|
||||
pad->upper_alarm_limit = prec->hhsv ? prec->hihi : epicsNAN;
|
||||
pad->upper_warning_limit = prec->hsv ? prec->high : epicsNAN;
|
||||
pad->lower_warning_limit = prec->lsv ? prec->low : epicsNAN;
|
||||
|
||||
+109
-26
@@ -6,7 +6,7 @@
|
||||
* EPICS BASE is distributed subject to a Software License Agreement found
|
||||
* in file LICENSE that is included with this distribution.
|
||||
\*************************************************************************/
|
||||
|
||||
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
@@ -39,34 +39,48 @@
|
||||
|
||||
int seqRecDebug = 0;
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
static long init_record(seqRecord *prec, int pass);
|
||||
static long process(seqRecord *prec);
|
||||
static int processNextLink(seqRecord *prec);
|
||||
static long asyncFinish(seqRecord *prec);
|
||||
static void processCallback(CALLBACK *arg);
|
||||
static long get_precision(dbAddr *paddr, long *pprecision);
|
||||
|
||||
/* Create RSET - Record Support Entry Table*/
|
||||
#define report NULL
|
||||
#define initialize NULL
|
||||
static long init_record(seqRecord *prec, int pass);
|
||||
static long process(seqRecord *prec);
|
||||
#define special NULL
|
||||
#define get_value NULL
|
||||
#define cvt_dbaddr NULL
|
||||
#define get_array_info NULL
|
||||
#define put_array_info NULL
|
||||
static long get_units(DBADDR *, char *);
|
||||
static long get_precision(dbAddr *paddr, long *);
|
||||
#define get_enum_str NULL
|
||||
#define get_enum_strs NULL
|
||||
#define put_enum_str NULL
|
||||
#define get_graphic_double NULL
|
||||
static long get_control_double(DBADDR *, struct dbr_ctrlDouble *);
|
||||
#define get_alarm_double NULL
|
||||
|
||||
rset seqRSET={
|
||||
RSETNUMBER,
|
||||
NULL, /* report */
|
||||
NULL, /* initialize */
|
||||
report, /* report */
|
||||
initialize, /* initialize */
|
||||
init_record, /* init_record */
|
||||
process, /* process */
|
||||
NULL, /* special */
|
||||
NULL, /* get_value */
|
||||
NULL, /* cvt_dbaddr */
|
||||
NULL, /* get_array_info */
|
||||
NULL, /* put_array_info */
|
||||
NULL, /* get_units */
|
||||
special, /* special */
|
||||
get_value, /* get_value */
|
||||
cvt_dbaddr, /* cvt_dbaddr */
|
||||
get_array_info, /* get_array_info */
|
||||
put_array_info, /* put_array_info */
|
||||
get_units, /* get_units */
|
||||
get_precision, /* get_precision */
|
||||
NULL, /* get_enum_str */
|
||||
NULL, /* get_enum_strs */
|
||||
NULL, /* put_enum_str */
|
||||
NULL, /* get_graphic_double */
|
||||
NULL, /* get_control_double */
|
||||
NULL /* get_alarm_double */
|
||||
|
||||
get_enum_str, /* get_enum_str */
|
||||
get_enum_strs, /* get_enum_strs */
|
||||
put_enum_str, /* put_enum_str */
|
||||
get_graphic_double, /* get_graphic_double */
|
||||
get_control_double, /* get_control_double */
|
||||
get_alarm_double /* get_alarm_double */
|
||||
};
|
||||
epicsExportAddress(rset,seqRSET);
|
||||
|
||||
@@ -406,15 +420,84 @@ static void processCallback(CALLBACK *arg)
|
||||
* Return the precision value from PREC
|
||||
*
|
||||
*****************************************************************************/
|
||||
#define indexof(field) seqRecord##field
|
||||
|
||||
static long get_units(DBADDR *paddr, char *units)
|
||||
{
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
/* we need something for DO1-DOA, either EGU1-EGUA or
|
||||
read EGU from DOL1-DOLA if possible
|
||||
*/
|
||||
case indexof(DLY1):
|
||||
case indexof(DLY2):
|
||||
case indexof(DLY3):
|
||||
case indexof(DLY4):
|
||||
case indexof(DLY5):
|
||||
case indexof(DLY6):
|
||||
case indexof(DLY7):
|
||||
case indexof(DLY8):
|
||||
case indexof(DLY9):
|
||||
case indexof(DLYA):
|
||||
strcpy(units, "s");
|
||||
break;
|
||||
case indexof(DO1):
|
||||
case indexof(DO2):
|
||||
case indexof(DO3):
|
||||
case indexof(DO4):
|
||||
case indexof(DO5):
|
||||
case indexof(DO6):
|
||||
case indexof(DO7):
|
||||
case indexof(DO8):
|
||||
case indexof(DO9):
|
||||
case indexof(DOA):
|
||||
/* we need something here, either EGU1-EGUA or
|
||||
read EGU from DOL1-DOLA if possible
|
||||
*/
|
||||
break;
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long get_precision(dbAddr *paddr, long *pprecision)
|
||||
{
|
||||
seqRecord *prec = (seqRecord *) paddr->precord;
|
||||
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(DLY1):
|
||||
case indexof(DLY2):
|
||||
case indexof(DLY3):
|
||||
case indexof(DLY4):
|
||||
case indexof(DLY5):
|
||||
case indexof(DLY6):
|
||||
case indexof(DLY7):
|
||||
case indexof(DLY8):
|
||||
case indexof(DLY9):
|
||||
case indexof(DLYA):
|
||||
*pprecision = 2;
|
||||
return(0);
|
||||
/* maybe we need specific PRECs for DO1-DOA
|
||||
*/
|
||||
}
|
||||
*pprecision = prec->prec;
|
||||
|
||||
if(paddr->pfield < (void *)&prec->val)
|
||||
return 0; /* Field is NOT in dbCommon */
|
||||
|
||||
recGblGetPrec(paddr, pprecision); /* Field is in dbCommon */
|
||||
return 0;
|
||||
recGblGetPrec(paddr, pprecision);
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long get_control_double(DBADDR *paddr,struct dbr_ctrlDouble *pcd)
|
||||
{
|
||||
recGblGetControlDouble(paddr,pcd);
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(DLY1):
|
||||
case indexof(DLY2):
|
||||
case indexof(DLY3):
|
||||
case indexof(DLY4):
|
||||
case indexof(DLY5):
|
||||
case indexof(DLY6):
|
||||
case indexof(DLY7):
|
||||
case indexof(DLY8):
|
||||
case indexof(DLY9):
|
||||
case indexof(DLYA):
|
||||
pcd->lower_ctrl_limit = 0.0;
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
+55
-42
@@ -201,25 +201,30 @@ static long put_array_info(DBADDR *paddr, long nNew)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define indexof(field) subArrayRecord##field
|
||||
|
||||
static long get_units(DBADDR *paddr, char *units)
|
||||
{
|
||||
subArrayRecord *prec = (subArrayRecord *) paddr->precord;
|
||||
|
||||
strncpy(units, prec->egu, DB_UNITS_SIZE);
|
||||
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(VAL):
|
||||
if (prec->ftvl == DBF_STRING || prec->ftvl == DBF_ENUM)
|
||||
break;
|
||||
case indexof(HOPR):
|
||||
case indexof(LOPR):
|
||||
strncpy(units,prec->egu,DB_UNITS_SIZE);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static long get_precision(DBADDR *paddr, long *precision)
|
||||
{
|
||||
subArrayRecord *prec = (subArrayRecord *) paddr->precord;
|
||||
int fieldIndex = dbGetFieldIndex(paddr);
|
||||
|
||||
*precision = prec->prec;
|
||||
|
||||
if (fieldIndex != subArrayRecordVAL)
|
||||
if (dbGetFieldIndex(paddr) != indexof(VAL))
|
||||
recGblGetPrec(paddr, precision);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -228,25 +233,29 @@ static long get_graphic_double(DBADDR *paddr, struct dbr_grDouble *pgd)
|
||||
subArrayRecord *prec = (subArrayRecord *) paddr->precord;
|
||||
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case subArrayRecordVAL:
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
break;
|
||||
|
||||
case subArrayRecordINDX:
|
||||
pgd->upper_disp_limit = prec->malm - 1;
|
||||
pgd->lower_disp_limit = 0;
|
||||
break;
|
||||
|
||||
case subArrayRecordNELM:
|
||||
pgd->upper_disp_limit = prec->malm;
|
||||
pgd->lower_disp_limit = 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
recGblGetGraphicDouble(paddr, pgd);
|
||||
case indexof(VAL):
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
break;
|
||||
case indexof(INDX):
|
||||
pgd->upper_disp_limit = prec->malm - 1;
|
||||
pgd->lower_disp_limit = 0;
|
||||
break;
|
||||
case indexof(NELM):
|
||||
pgd->upper_disp_limit = prec->malm;
|
||||
pgd->lower_disp_limit = 0;
|
||||
break;
|
||||
case indexof(NORD):
|
||||
pgd->upper_disp_limit = prec->malm;
|
||||
pgd->lower_disp_limit = 0;
|
||||
break;
|
||||
case indexof(BUSY):
|
||||
pgd->upper_disp_limit = 1;
|
||||
pgd->lower_disp_limit = 0;
|
||||
break;
|
||||
default:
|
||||
recGblGetGraphicDouble(paddr, pgd);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -255,25 +264,29 @@ static long get_control_double(DBADDR *paddr, struct dbr_ctrlDouble *pcd)
|
||||
subArrayRecord *prec = (subArrayRecord *) paddr->precord;
|
||||
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case subArrayRecordVAL:
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
break;
|
||||
|
||||
case subArrayRecordINDX:
|
||||
pcd->upper_ctrl_limit = prec->malm - 1;
|
||||
pcd->lower_ctrl_limit = 0;
|
||||
break;
|
||||
|
||||
case subArrayRecordNELM:
|
||||
pcd->upper_ctrl_limit = prec->malm;
|
||||
pcd->lower_ctrl_limit = 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
recGblGetControlDouble(paddr, pcd);
|
||||
case indexof(VAL):
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
break;
|
||||
case indexof(INDX):
|
||||
pcd->upper_ctrl_limit = prec->malm - 1;
|
||||
pcd->lower_ctrl_limit = 0;
|
||||
break;
|
||||
case indexof(NELM):
|
||||
pcd->upper_ctrl_limit = prec->malm;
|
||||
pcd->lower_ctrl_limit = 1;
|
||||
break;
|
||||
case indexof(NORD):
|
||||
pcd->upper_ctrl_limit = prec->malm;
|
||||
pcd->lower_ctrl_limit = 0;
|
||||
break;
|
||||
case indexof(BUSY):
|
||||
pcd->upper_ctrl_limit = 1;
|
||||
pcd->lower_ctrl_limit = 0;
|
||||
break;
|
||||
default:
|
||||
recGblGetControlDouble(paddr, pcd);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+77
-50
@@ -191,80 +191,107 @@ static long special(DBADDR *paddr, int after)
|
||||
return S_db_BadSub;
|
||||
}
|
||||
|
||||
#define indexof(field) subRecord##field
|
||||
|
||||
static long get_units(DBADDR *paddr, char *units)
|
||||
{
|
||||
subRecord *prec = (subRecord *)paddr->precord;
|
||||
int index = dbGetFieldIndex(paddr);
|
||||
|
||||
strncpy(units, prec->egu, DB_UNITS_SIZE);
|
||||
if(paddr->pfldDes->field_type == DBF_DOUBLE) {
|
||||
if((index >= indexof(A) && index <= indexof(L))
|
||||
|| (index >= indexof(LA) && index <= indexof(LL))) {
|
||||
/* We need a way to get units for A-L */;
|
||||
} else {
|
||||
strncpy(units,prec->egu,DB_UNITS_SIZE);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static long get_precision(DBADDR *paddr, long *precision)
|
||||
static long get_precision(DBADDR *paddr, long *pprecision)
|
||||
{
|
||||
subRecord *prec = (subRecord *)paddr->precord;
|
||||
int fieldIndex = dbGetFieldIndex(paddr);
|
||||
|
||||
*precision = prec->prec;
|
||||
if (fieldIndex != subRecordVAL)
|
||||
recGblGetPrec(paddr, precision);
|
||||
int index = dbGetFieldIndex(paddr);
|
||||
|
||||
*pprecision = prec->prec;
|
||||
if (index == indexof(VAL)) {
|
||||
return 0;
|
||||
}
|
||||
if((index >= indexof(A) && index <= indexof(L))
|
||||
|| (index >= indexof(LA) && index <= indexof(LL))) {
|
||||
/* We need a way to get precision for A-L */;
|
||||
*pprecision=15;
|
||||
}
|
||||
recGblGetPrec(paddr, pprecision);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static long get_graphic_double(DBADDR *paddr, struct dbr_grDouble *pgd)
|
||||
{
|
||||
subRecord *prec = (subRecord *)paddr->precord;
|
||||
int fieldIndex = dbGetFieldIndex(paddr);
|
||||
|
||||
switch (fieldIndex) {
|
||||
case subRecordVAL:
|
||||
case subRecordHIHI: case subRecordHIGH:
|
||||
case subRecordLOW: case subRecordLOLO:
|
||||
case subRecordA: case subRecordB:
|
||||
case subRecordC: case subRecordD:
|
||||
case subRecordE: case subRecordF:
|
||||
case subRecordG: case subRecordH:
|
||||
case subRecordI: case subRecordJ:
|
||||
case subRecordK: case subRecordL:
|
||||
case subRecordLA: case subRecordLB:
|
||||
case subRecordLC: case subRecordLD:
|
||||
case subRecordLE: case subRecordLF:
|
||||
case subRecordLG: case subRecordLH:
|
||||
case subRecordLI: case subRecordLJ:
|
||||
case subRecordLK: case subRecordLL:
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
break;
|
||||
|
||||
default:
|
||||
recGblGetGraphicDouble(paddr, pgd);
|
||||
int index = dbGetFieldIndex(paddr);
|
||||
|
||||
switch (index) {
|
||||
case indexof(VAL):
|
||||
case indexof(HIHI):
|
||||
case indexof(HIGH):
|
||||
case indexof(LOW):
|
||||
case indexof(LOLO):
|
||||
case indexof(LALM):
|
||||
case indexof(ALST):
|
||||
case indexof(MLST):
|
||||
#ifdef __GNUC__
|
||||
case indexof(A) ... indexof(L):
|
||||
case indexof(LA) ... indexof(LL):
|
||||
break;
|
||||
default:
|
||||
#else
|
||||
break;
|
||||
default:
|
||||
if((index >= indexof(A) && index <= indexof(L))
|
||||
|| (index >= indexof(LA) && index <= indexof(LL)))
|
||||
break;
|
||||
#endif
|
||||
recGblGetGraphicDouble(paddr,pgd);
|
||||
return 0;
|
||||
}
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static long get_control_double(DBADDR *paddr, struct dbr_ctrlDouble *pcd)
|
||||
{
|
||||
subRecord *prec = (subRecord *)paddr->precord;
|
||||
int fieldIndex = dbGetFieldIndex(paddr);
|
||||
|
||||
switch (fieldIndex) {
|
||||
case subRecordVAL:
|
||||
case subRecordHIHI: case subRecordHIGH:
|
||||
case subRecordLOW: case subRecordLOLO:
|
||||
case subRecordA: case subRecordB:
|
||||
case subRecordC: case subRecordD:
|
||||
case subRecordE: case subRecordF:
|
||||
case subRecordG: case subRecordH:
|
||||
case subRecordI: case subRecordJ:
|
||||
case subRecordK: case subRecordL:
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
break;
|
||||
|
||||
default:
|
||||
recGblGetControlDouble(paddr, pcd);
|
||||
int index = dbGetFieldIndex(paddr);
|
||||
|
||||
switch (index) {
|
||||
case indexof(VAL):
|
||||
case indexof(HIHI):
|
||||
case indexof(HIGH):
|
||||
case indexof(LOW):
|
||||
case indexof(LOLO):
|
||||
case indexof(LALM):
|
||||
case indexof(ALST):
|
||||
case indexof(MLST):
|
||||
#ifdef __GNUC__
|
||||
case indexof(A) ... indexof(L):
|
||||
case indexof(LA) ... indexof(LL):
|
||||
break;
|
||||
default:
|
||||
#else
|
||||
break;
|
||||
default:
|
||||
if((index >= indexof(A) && index <= indexof(L))
|
||||
|| (index >= indexof(LA) && index <= indexof(LL)))
|
||||
break;
|
||||
#endif
|
||||
recGblGetControlDouble(paddr,pcd);
|
||||
return 0;
|
||||
}
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+43
-16
@@ -194,25 +194,30 @@ static long put_array_info(DBADDR *paddr, long nNew)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define indexof(field) waveformRecord##field
|
||||
|
||||
static long get_units(DBADDR *paddr, char *units)
|
||||
{
|
||||
waveformRecord *prec = (waveformRecord *) paddr->precord;
|
||||
|
||||
strncpy(units,prec->egu,DB_UNITS_SIZE);
|
||||
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(VAL):
|
||||
if (prec->ftvl == DBF_STRING || prec->ftvl == DBF_ENUM)
|
||||
break;
|
||||
case indexof(HOPR):
|
||||
case indexof(LOPR):
|
||||
strncpy(units,prec->egu,DB_UNITS_SIZE);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static long get_precision(DBADDR *paddr, long *precision)
|
||||
{
|
||||
waveformRecord *prec = (waveformRecord *) paddr->precord;
|
||||
int fieldIndex = dbGetFieldIndex(paddr);
|
||||
|
||||
*precision = prec->prec;
|
||||
|
||||
if (fieldIndex != waveformRecordVAL)
|
||||
if (dbGetFieldIndex(paddr) != indexof(VAL))
|
||||
recGblGetPrec(paddr, precision);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -220,11 +225,22 @@ static long get_graphic_double(DBADDR *paddr, struct dbr_grDouble *pgd)
|
||||
{
|
||||
waveformRecord *prec = (waveformRecord *) paddr->precord;
|
||||
|
||||
if (dbGetFieldIndex(paddr) == waveformRecordVAL) {
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
} else
|
||||
recGblGetGraphicDouble(paddr, pgd);
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(VAL):
|
||||
pgd->upper_disp_limit = prec->hopr;
|
||||
pgd->lower_disp_limit = prec->lopr;
|
||||
break;
|
||||
case indexof(BUSY):
|
||||
pgd->upper_disp_limit = 1;
|
||||
pgd->lower_disp_limit = 0;
|
||||
break;
|
||||
case indexof(NORD):
|
||||
pgd->upper_disp_limit = prec->nelm;
|
||||
pgd->lower_disp_limit = 0;
|
||||
break;
|
||||
default:
|
||||
recGblGetGraphicDouble(paddr, pgd);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -232,11 +248,22 @@ static long get_control_double(DBADDR *paddr, struct dbr_ctrlDouble *pcd)
|
||||
{
|
||||
waveformRecord *prec = (waveformRecord *) paddr->precord;
|
||||
|
||||
if (dbGetFieldIndex(paddr) == waveformRecordVAL) {
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
} else
|
||||
recGblGetControlDouble(paddr, pcd);
|
||||
switch (dbGetFieldIndex(paddr)) {
|
||||
case indexof(VAL):
|
||||
pcd->upper_ctrl_limit = prec->hopr;
|
||||
pcd->lower_ctrl_limit = prec->lopr;
|
||||
break;
|
||||
case indexof(BUSY):
|
||||
pcd->upper_ctrl_limit = 1;
|
||||
pcd->lower_ctrl_limit = 0;
|
||||
break;
|
||||
case indexof(NORD):
|
||||
pcd->upper_ctrl_limit = prec->nelm;
|
||||
pcd->lower_ctrl_limit = 0;
|
||||
break;
|
||||
default:
|
||||
recGblGetControlDouble(paddr, pcd);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user