Skip to content

Commit

Permalink
add DTYP="QSRV Demo Replicate"
Browse files Browse the repository at this point in the history
  • Loading branch information
mdavidsaver committed Nov 10, 2022
1 parent 2a53ea7 commit 0af5e97
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
26 changes: 26 additions & 0 deletions pdbApp/demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,30 @@ long process_spin(waveformRecord *prec)
return 0;
}

long process_repeat(waveformRecord *prec)
{
long ret;
if(prec->ftvl!=menuFtypeULONG) {
recGblSetSevr(prec, READ_ALARM, INVALID_ALARM);
return S_db_badDbrtype;
}

epicsUInt32 iv=0;
if(!!(ret = dbGetLink(&prec->inp, DBF_ULONG, &iv, NULL, NULL))) {
recGblSetSevr(prec, READ_ALARM, INVALID_ALARM);
return ret;
}

epicsUInt32 *val = (epicsUInt32*)prec->bptr;
for(size_t i=0, N=prec->nelm; i<N; i++) {
val[i] = iv;
}

prec->nord = iv;

return 0;
}

long process_utag(longinRecord *prec)
{
long status = dbGetLink(&prec->inp, DBR_LONG, &prec->val, 0, 0);
Expand All @@ -80,11 +104,13 @@ struct dset5
};

dset5<waveformRecord> devWfPDBDemo = {5,0,0,&init_spin,0,&process_spin};
dset5<waveformRecord> devWfPDBDemoRepeat = {5,0,0,0,0,&process_repeat};
dset5<longinRecord> devLoPDBUTag = {5,0,0,0,0,&process_utag};

} // namespace

extern "C" {
epicsExportAddress(dset, devWfPDBDemo);
epicsExportAddress(dset, devWfPDBDemoRepeat);
epicsExportAddress(dset, devLoPDBUTag);
}
1 change: 1 addition & 0 deletions pdbApp/qsrv-new.dbd
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ link("pva", "lsetPVA")

# from demo.cpp
device(waveform, CONSTANT, devWfPDBDemo, "QSRV Demo")
device(waveform, CONSTANT, devWfPDBDemoRepeat, "QSRV Demo Replicate")
device(longin, CONSTANT, devLoPDBUTag, "QSRV Set UTag")
# from imagedemo.c
function(QSRV_image_demo)
Expand Down
1 change: 1 addition & 0 deletions pdbApp/qsrv-old.dbd
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ registrar(installPVAAddLinkHook)

# from demo.cpp
device(waveform, CONSTANT, devWfPDBDemo, "QSRV Demo")
device(waveform, CONSTANT, devWfPDBDemoRepeat, "QSRV Demo Replicate")
device(longin, CONSTANT, devLoPDBUTag, "QSRV Set UTag")
# from imagedemo.c
function(QSRV_image_demo)
Expand Down

0 comments on commit 0af5e97

Please sign in to comment.