-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Reorganizing of code duplicates within devEvrEvent*
devEvrEventUtag.cpp contained code duplicates from devEvrEvent.cpp. Now implementation is included within devEvrEvent.cpp
- Loading branch information
1 parent
f264755
commit 277abf2
Showing
3 changed files
with
65 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -283,3 +283,68 @@ epicsExportAddress(dset,devSOEventEVR); | |
epicsExportAddress(dset,devEVEventEVR); | ||
|
||
} | ||
|
||
|
||
/* | ||
* Timestamping with UTAG extension | ||
* Date: 5.12.2023 | ||
* Authors: Joao Paulo Martins <[email protected]> | ||
* Jerzy Jamroz <[email protected]> | ||
*/ | ||
|
||
#ifdef DBR_UTAG | ||
|
||
#include <int64outRecord.h> | ||
|
||
static long process_int64out(int64outRecord *prec) | ||
{ | ||
priv *p = static_cast<priv *>(prec->dpvt); | ||
long ret = 0; | ||
try | ||
{ | ||
|
||
if (p->event >= 0 && p->event <= 255) | ||
post_event(p->event); | ||
|
||
if (prec->tse == epicsTimeEventDeviceTime) | ||
{ | ||
p->evr->getTimeStamp(&prec->time, p->event); | ||
prec->utag = static_cast<epicsUTag>(prec->val); | ||
p->evr->setUtag(prec->utag, p->event); | ||
} | ||
|
||
return 0; | ||
} | ||
catch (std::runtime_error &e) | ||
{ | ||
recGblRecordError(S_dev_noDevice, (void *)prec, e.what()); | ||
ret = S_dev_noDevice; | ||
} | ||
catch (std::exception &e) | ||
{ | ||
recGblRecordError(S_db_noMemory, (void *)prec, e.what()); | ||
ret = S_db_noMemory; | ||
} | ||
return ret; | ||
} | ||
|
||
static long add_int64out(struct dbCommon *precord) | ||
{ | ||
return add_record(precord, &((struct int64outRecord *)precord)->out); | ||
} | ||
|
||
dsxt dxtI64OEventUtagEVR = {add_int64out, del_record}; | ||
static common_dset devI64OEventUtagEVR = { | ||
6, NULL, | ||
dset_cast(&init_dset<&dxtI64OEventUtagEVR>), | ||
(DEVSUPFUN)init_record_empty, | ||
(DEVSUPFUN)&get_ioint_info, | ||
dset_cast(&process_int64out), | ||
NULL}; | ||
|
||
extern "C" | ||
{ | ||
epicsExportAddress(dset, devI64OEventUtagEVR); | ||
} | ||
|
||
#endif |
This file was deleted.
Oops, something went wrong.