本文整理汇总了C++中recGblSetSevr函数的典型用法代码示例。如果您正苦于以下问题:C++ recGblSetSevr函数的具体用法?C++ recGblSetSevr怎么用?C++ recGblSetSevr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了recGblSetSevr函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: processAiAverage
static long processAiAverage(aiRecord *pr)
{
devInt32Pvt *pPvt = (devInt32Pvt *)pr->dpvt;
double rval;
epicsMutexLock(pPvt->ringBufferLock);
if (pPvt->numAverage == 0) {
(void)recGblSetSevr(pr, UDF_ALARM, INVALID_ALARM);
pr->udf = 1;
epicsMutexUnlock(pPvt->ringBufferLock);
return -2;
}
rval = pPvt->sum/pPvt->numAverage;
/*round result*/
rval += (pPvt->sum>0.0) ? 0.5 : -0.5;
pr->rval = (epicsInt32) rval;
pPvt->numAverage = 0;
pPvt->sum = 0.;
asynPrint(pPvt->pasynUser, ASYN_TRACEIO_DEVICE,
"%s devAsynInt32::processAiInt32Average rval=%d, status=%d\n",pr->name, pr->rval, pPvt->result.status);
if (pPvt->result.status == asynSuccess) {
pr->udf = 0;
}
else {
pasynEpicsUtils->asynStatusToEpicsAlarm(pPvt->result.status, READ_ALARM, &pPvt->alarmStat,
INVALID_ALARM, &pPvt->alarmSevr);
(void)recGblSetSevr(pr, pPvt->alarmStat, pPvt->alarmSevr);
pPvt->result.status = 0;
}
epicsMutexUnlock(pPvt->ringBufferLock);
return 0;
}
示例2: alarm
static long alarm(rfmRecord *precord)
{
long status = OK;
if(precord->udf == TRUE) {
recGblSetSevr(precord, UDF_ALARM, INVALID_ALARM);
return status;
}
if(precord->val != rfmSuccess) {
recGblSetSevr(precord, DISABLE_ALARM, MAJOR_ALARM);
return status;
}
if(precord->rfe < 50) {
recGblSetSevr(precord,SOFT_ALARM, MAJOR_ALARM);
return status;
}
if(precord->rfe < 100) {
recGblSetSevr(precord, SOFT_ALARM, MINOR_ALARM);
return status;
}
precord->val = rfmSuccess;
return status;
}
示例3: readValue
static long readValue(stringinRecord *prec)
{
long status;
struct stringindset *pdset = (struct stringindset *) (prec->dset);
if (prec->pact == TRUE){
status=(*pdset->read_stringin)(prec);
return(status);
}
status=dbGetLink(&(prec->siml),DBR_USHORT, &(prec->simm),0,0);
if (status)
return(status);
if (prec->simm == menuYesNoNO){
status=(*pdset->read_stringin)(prec);
return(status);
}
if (prec->simm == menuYesNoYES){
status=dbGetLink(&(prec->siol),DBR_STRING,
prec->sval,0,0);
if (status==0) {
strcpy(prec->val,prec->sval);
prec->udf=FALSE;
}
} else {
status=-1;
recGblSetSevr(prec,SOFT_ALARM,INVALID_ALARM);
return(status);
}
recGblSetSevr(prec,SIMM_ALARM,prec->sims);
return(status);
}
示例4: writeString
static int writeString(gpibDpvt *pgpibDpvt,int P1, int P2, char **P3)
{
asynUser *pasynUser = pgpibDpvt->pasynUser;
stringoutRecord *precord = (stringoutRecord*)pgpibDpvt->precord;
int nchars;
gpibCmd *pgpibCmd = gpibCmdGet(pgpibDpvt);
char *format = (pgpibCmd->format) ? pgpibCmd->format : "%s";
if(!pgpibDpvt->msg) {
asynPrint(pasynUser,ASYN_TRACE_ERROR,
"%s no msg buffer. Must define gpibCmd.msgLen > 0.\n",
precord->name);
recGblSetSevr(precord,WRITE_ALARM, INVALID_ALARM);
return -1;
}
nchars = epicsSnprintf(pgpibDpvt->msg,pgpibCmd->msgLen,format,precord->val);
if(nchars>pgpibCmd->msgLen) {
asynPrint(pasynUser,ASYN_TRACE_ERROR,
"%s msg buffer too small. msgLen %d message length %d\n",
precord->name,pgpibCmd->msgLen,nchars);
recGblSetSevr(precord,WRITE_ALARM, INVALID_ALARM);
return -1;
}
asynPrint(pasynUser,ASYN_TRACE_FLOW,"%s writeMsgString\n",precord->name);
return nchars;
}
示例5: processAiAverage
static long processAiAverage(aiRecord *pai)
{
devPvt *pPvt = (devPvt *)pai->dpvt;
double dval;
epicsMutexLock(pPvt->ringBufferLock);
if (pPvt->numAverage == 0) {
recGblSetSevr(pai, UDF_ALARM, INVALID_ALARM);
pai->udf = 1;
epicsMutexUnlock(pPvt->ringBufferLock);
return -2;
}
dval = pPvt->sum/pPvt->numAverage;
pPvt->numAverage = 0;
pPvt->sum = 0.;
epicsMutexUnlock(pPvt->ringBufferLock);
pasynEpicsUtils->asynStatusToEpicsAlarm(pPvt->result.status,
READ_ALARM, &pPvt->result.alarmStatus,
INVALID_ALARM, &pPvt->result.alarmSeverity);
recGblSetSevr(pai, pPvt->result.alarmStatus, pPvt->result.alarmSeverity);
if (pPvt->result.status == asynSuccess) {
pai->val = dval;
pai->udf = 0;
asynPrint(pPvt->pasynUser, ASYN_TRACEIO_DEVICE,
"%s devAsynFloat64::callbackAiAverage val=%f\n",
pai->name, pai->val);
return 2;
}
else {
pPvt->result.status = asynSuccess;
return -1;
}
}
示例6: writeIt
static asynStatus writeIt(asynUser *pasynUser,const char *message,size_t nbytes)
{
devPvt *pdevPvt = (devPvt *)pasynUser->userPvt;
dbCommon *precord = pdevPvt->precord;
asynOctet *poctet = pdevPvt->poctet;
void *octetPvt = pdevPvt->octetPvt;
asynStatus status;
size_t nbytesTransfered;
status = poctet->write(octetPvt,pasynUser,message,nbytes,&nbytesTransfered);
if(status!=asynSuccess) {
asynPrint(pasynUser,ASYN_TRACE_ERROR,
"%s devTestBlock: writeIt failed %s\n",
precord->name,pasynUser->errorMessage);
recGblSetSevr(precord, WRITE_ALARM, INVALID_ALARM);
return status;
}
if(nbytes != nbytesTransfered) {
asynPrint(pasynUser,ASYN_TRACE_ERROR,
"%s devTestBlock: writeIt requested %lu but sent %lu bytes\n",
precord->name,(unsigned long)nbytes,(unsigned long)nbytesTransfered);
recGblSetSevr(precord, WRITE_ALARM, MINOR_ALARM);
return asynError;
}
asynPrintIO(pasynUser,ASYN_TRACEIO_DEVICE,message,nbytes,
"%s devTestBlock: writeIt\n",precord->name);
return status;
}
示例7: writeValue
static long writeValue(stringoutRecord *prec)
{
long status;
struct stringoutdset *pdset = (struct stringoutdset *) (prec->dset);
if (prec->pact == TRUE){
status=(*pdset->write_stringout)(prec);
return(status);
}
status=dbGetLink(&(prec->siml),DBR_USHORT,
&(prec->simm),0,0);
if (status)
return(status);
if (prec->simm == menuYesNoNO){
status=(*pdset->write_stringout)(prec);
return(status);
}
if (prec->simm == menuYesNoYES){
status=dbPutLink(&prec->siol,DBR_STRING,
prec->val,1);
} else {
status=-1;
recGblSetSevr(prec,SOFT_ALARM,INVALID_ALARM);
return(status);
}
recGblSetSevr(prec,SIMM_ALARM,prec->sims);
return(status);
}
示例8: process
static long process(epidRecord *pepid)
{
struct epidDSET *pdset = (struct epidDSET *)(pepid->dset);
long status;
int pact=pepid->pact;
if (!pact) { /* If this is not a callback from device support */
/* fetch the setpoint */
if(pepid->smsl == menuOmslclosed_loop) {
status = dbGetLink(&(pepid->stpl),DBR_DOUBLE, &(pepid->val),0,0);
if (RTN_SUCCESS(status)) pepid->udf=FALSE;
}
if (pepid->udf == TRUE ) {
#if LT_EPICSBASE(3,15,0,2)
recGblSetSevr(pepid,UDF_ALARM,INVALID_ALARM);
#else
recGblSetSevr(pepid,UDF_ALARM,pepid->udfs);
#endif
return(0);
}
}
status = (*pdset->do_pid)(pepid);
/* See if device support set pact=true, meaning it will call us back */
if (!pact && pepid->pact) return(0);
pepid->pact = TRUE;
recGblGetTimeStamp(pepid);
checkAlarms(pepid);
monitor(pepid);
recGblFwdLink(pepid);
pepid->pact=FALSE;
return(status);
}
示例9: writeValue
static long writeValue(lsoRecord *prec)
{
long status;
lsodset *pdset = (lsodset *) prec->dset;
if (prec->pact)
goto write;
status = dbGetLink(&prec->siml, DBR_USHORT, &prec->simm, 0, 0);
if (status)
return(status);
switch (prec->simm) {
case menuYesNoNO:
write:
status = pdset->write_string(prec);
break;
case menuYesNoYES:
recGblSetSevr(prec, SIMM_ALARM, prec->sims);
status = dbPutLink(&prec->siol,DBR_STRING, prec->val,1);
break;
default:
recGblSetSevr(prec, SOFT_ALARM, INVALID_ALARM);
status = -1;
}
return status;
}
示例10: readValue
static long readValue(waveformRecord *prec)
{
long status;
struct wfdset *pdset = (struct wfdset *) prec->dset;
if (prec->pact == TRUE) {
return (*pdset->read_wf)(prec);
}
status = dbGetLink(&(prec->siml), DBR_ENUM, &(prec->simm),0,0);
if (status)
return status;
if (prec->simm == menuYesNoNO) {
return (*pdset->read_wf)(prec);
}
if (prec->simm == menuYesNoYES) {
long nRequest = prec->nelm;
status = dbGetLink(&(prec->siol), prec->ftvl, prec->bptr, 0, &nRequest);
/* nord set only for db links: needed for old db_access */
if (prec->siol.type != CONSTANT) {
prec->nord = nRequest;
if (status == 0)
prec->udf=FALSE;
}
} else {
recGblSetSevr(prec, SOFT_ALARM, INVALID_ALARM);
return -1;
}
recGblSetSevr(prec, SIMM_ALARM, prec->sims);
return status;
}
示例11: process
static long process(fanoutRecord *prec)
{
struct link *plink;
unsigned short state;
short i;
unsigned short monitor_mask;
prec->pact = TRUE;
/* fetch link selection */
dbGetLink(&(prec->sell),DBR_USHORT,&(prec->seln),0,0);
switch (prec->selm){
case (fanoutSELM_All):
plink=&(prec->lnk1);
state=prec->seln;
for ( i=0; i<6; i++, state>>=1, plink++) {
if(plink->type!=CONSTANT) dbScanFwdLink(plink);
}
break;
case (fanoutSELM_Specified):
if(prec->seln>6) {
recGblSetSevr(prec,SOFT_ALARM,INVALID_ALARM);
break;
}
if(prec->seln==0) {
break;
}
plink=&(prec->lnk1);
plink += (prec->seln-1); dbScanFwdLink(plink);
break;
case (fanoutSELM_Mask):
if(prec->seln==0) {
break;
}
if(prec->seln>63 ) {
recGblSetSevr(prec,SOFT_ALARM,INVALID_ALARM);
break;
}
plink=&(prec->lnk1);
state=prec->seln;
for ( i=0; i<6; i++, state>>=1, plink++) {
if(state & 1 && plink->type!=CONSTANT) dbScanFwdLink(plink);
}
break;
default:
recGblSetSevr(prec,SOFT_ALARM,INVALID_ALARM);
}
prec->udf=FALSE;
recGblGetTimeStamp(prec);
/* check monitors*/
/* get previous stat and sevr and new stat and sevr*/
monitor_mask = recGblResetAlarms(prec);
/* process the forward scan link record */
recGblFwdLink(prec);
prec->pact=FALSE;
return(0);
}
示例12: inherit_severity
static void inherit_severity(const struct pv_link *ppv_link,
dbCommon *pdest, epicsEnum16 stat, epicsEnum16 sevr)
{
switch(ppv_link->pvlMask&pvlOptMsMode) {
case pvlOptNMS: break;
case pvlOptMSI: if (sevr < INVALID_ALARM) break;
case pvlOptMS: recGblSetSevr(pdest,LINK_ALARM,sevr); break;
case pvlOptMSS: recGblSetSevr(pdest,stat,sevr); break;
}
}
示例13: checkAlarms
static void checkAlarms(selRecord *prec)
{
double val, hyst, lalm;
double alev;
epicsEnum16 asev;
if (prec->udf) {
recGblSetSevr(prec, UDF_ALARM, INVALID_ALARM);
return;
}
val = prec->val;
hyst = prec->hyst;
lalm = prec->lalm;
/* alarm condition hihi */
asev = prec->hhsv;
alev = prec->hihi;
if (asev && (val >= alev || ((lalm == alev) && (val >= alev - hyst)))) {
if (recGblSetSevr(prec, HIHI_ALARM, asev))
prec->lalm = alev;
return;
}
/* alarm condition lolo */
asev = prec->llsv;
alev = prec->lolo;
if (asev && (val <= alev || ((lalm == alev) && (val <= alev + hyst)))) {
if (recGblSetSevr(prec, LOLO_ALARM, asev))
prec->lalm = alev;
return;
}
/* alarm condition high */
asev = prec->hsv;
alev = prec->high;
if (asev && (val >= alev || ((lalm == alev) && (val >= alev - hyst)))) {
if (recGblSetSevr(prec, HIGH_ALARM, asev))
prec->lalm = alev;
return;
}
/* alarm condition low */
asev = prec->lsv;
alev = prec->low;
if (asev && (val <= alev || ((lalm == alev) && (val <= alev + hyst)))) {
if (recGblSetSevr(prec, LOW_ALARM, asev))
prec->lalm = alev;
return;
}
/* we get here only if val is out of alarm by at least hyst */
prec->lalm = val;
return;
}
示例14: checkAlarms
static void checkAlarms(aliveRecord *prec)
{
if (prec->udf == TRUE)
{
#if LT_EPICSBASE(3,15,0,2)
recGblSetSevr(prec,UDF_ALARM,INVALID_ALARM);
#else
recGblSetSevr(prec,UDF_ALARM,prec->udfs);
#endif
return;
}
return;
}
示例15: processAo
static long processAo(aoRecord *pr)
{
devInt32Pvt *pPvt = (devInt32Pvt *)pr->dpvt;
asynStatus status;
double value;
if (getCallbackValue(pPvt)) {
/* We got a callback from the driver */
if (pPvt->result.status == asynSuccess) {
pr->rval = pPvt->result.value;
pr->udf = 0;
value = (double)pr->rval + (double)pr->roff;
if(pr->aslo!=0.0) value *= pr->aslo;
value += pr->aoff;
if (pr->linr == menuConvertNO_CONVERSION){
; /*do nothing*/
} else if ((pr->linr == menuConvertLINEAR) ||
(pr->linr == menuConvertSLOPE)) {
value = value*pr->eslo + pr->eoff;
} else {
if(cvtRawToEngBpt(&value,pr->linr,pr->init,
(void *)&pr->pbrk,&pr->lbrk)!=0) {
asynPrint(pPvt->pasynUser, ASYN_TRACE_ERROR,
"%s devAsynInt32 cvtRawToEngBpt failed\n",
pr->name);
(void)recGblSetSevr(pr, WRITE_ALARM, INVALID_ALARM);
return -1;
}
}
pr->val = value;
pr->udf = isnan(value);
}
} else if(pr->pact == 0) {
pPvt->result.value = pr->rval;
if(pPvt->canBlock) pr->pact = 1;
status = pasynManager->queueRequest(pPvt->pasynUser, 0, 0);
if((status==asynSuccess) && pPvt->canBlock) return 0;
if(pPvt->canBlock) pr->pact = 0;
reportQueueRequestStatus(pPvt, status);
}
if(pPvt->result.status == asynSuccess) {
return 0;
}
else {
pasynEpicsUtils->asynStatusToEpicsAlarm(pPvt->result.status, WRITE_ALARM, &pPvt->alarmStat,
INVALID_ALARM, &pPvt->alarmSevr);
(void)recGblSetSevr(pr, pPvt->alarmStat, pPvt->alarmSevr);
pPvt->result.status = asynSuccess;
return -1;
}
}