cafe-1.12.5 release

This commit is contained in:
2021-03-16 09:30:56 +01:00
parent 7504b0a539
commit 7ba4128448
106 changed files with 185064 additions and 183247 deletions

View File

@@ -16,7 +16,8 @@
* \brief This class is the holder of data values associated with
* the EPICS DBR_TIME_(dataType) structure of a given handle/pv
*/
class PVDataHolder : public PVHolder {
class PVDataHolder : public PVHolder
{
friend class CAFE;
friend class PVGroup;
@@ -38,8 +39,8 @@ public:
bool hasTS;
etsNorm _etsNorm;
etsDate _etsDate;
TMwdayText tmDay;
TMmonthpText tmMonth;
TMwdayText tmDay;
TMmonthpText tmMonth;
//Derived class does not inherit constructors
PVDataHolder(unsigned int _sizeOfArray)
@@ -67,7 +68,8 @@ public:
val.reset( new CAFE_DATATYPE_UNION[nelem] );
for (unsigned int i=0; i<nelem; ++i) {
for (unsigned int i=0; i<nelem; ++i)
{
val[i].d=0.0;
};
};
@@ -121,7 +123,8 @@ public:
void setHasTS(bool t)
{
hasTS=t;
if (t) {
if (t)
{
hasAlarm=t; //TS will also retrieve alarmStatus
}
return;
@@ -137,7 +140,8 @@ public:
_nelem>0 ? nelem=_nelem : nelem=1;
if (nelem>size) {
if (nelem>size)
{
size=nelem;
val.reset( new CAFE_DATATYPE_UNION[size] );
}
@@ -150,7 +154,7 @@ public:
return ts;
};
etsNorm getEpicsTimeStampAsUInt32()
{
@@ -166,7 +170,8 @@ public:
//This may happen in timeouts; epicsTime convertor will report overflow error
//However this possibility is now captured in conduitFriend.h and other
if(ts.nsec >= 1000000000) {
if(ts.nsec >= 1000000000)
{
std::cout << "OVERFLOW IN gets.nsec CORRECTED for epicsTime converter " << std::endl;
ts.nsec=0;
}
@@ -181,11 +186,11 @@ public:
_etsDate.min = local.ansi_tm.tm_min;
_etsDate.sec = local.ansi_tm.tm_sec;
_etsDate.nsec = (unsigned long) ts.nsec;
_etsDate.wday = local.ansi_tm.tm_wday;
_etsDate.yday = local.ansi_tm.tm_yday;
_etsDate.isdst = local.ansi_tm.tm_isdst;
_etsDate.wday = local.ansi_tm.tm_wday;
_etsDate.yday = local.ansi_tm.tm_yday;
_etsDate.isdst = local.ansi_tm.tm_isdst;
return _etsDate;
}
@@ -205,47 +210,49 @@ public:
_etsDate.min = local->tm_min;
_etsDate.sec = local->tm_sec;
_etsDate.nsec = (unsigned long) ts.nsec;
_etsDate.wday = local->tm_wday;
_etsDate.yday = local->tm_yday;
_etsDate.isdst = local->tm_isdst;
_etsDate.wday = local->tm_wday;
_etsDate.yday = local->tm_yday;
_etsDate.isdst = local->tm_isdst;
return _etsDate;
}
std::string getEpicsTimeStampAsString() {
std::string getEpicsTimeStampAsString()
{
time_t t= ts.secPastEpoch;
struct tm * local;
local=localtime(&t);
char buf[40];
local->tm_year=local->tm_year+20; //EPICS Time is 20 years out!
strftime (buf,80,"%b %d, %Y %T.",local);
std::string date=(std::string) buf;
char buft[10];
sprintf(buft,"%d",ts.nsec);
date.append((std::string) buft);
return date;
}
std::string getBSTimeStampAsString() {
char buf[40];
local->tm_year=local->tm_year+20; //EPICS Time is 20 years out!
strftime (buf,80,"%b %d, %Y %T.",local);
std::string date=(std::string) buf;
char buft[10];
sprintf(buft,"%d",ts.nsec);
date.append((std::string) buft);
return date;
}
std::string getBSTimeStampAsString()
{
time_t t= ts.secPastEpoch;
struct tm * local;
local=localtime(&t);
char buf[40];
strftime (buf,80,"%b %d, %Y %T.",local);
std::string date=(std::string) buf;
char buft[10];
sprintf(buft,"%d",ts.nsec);
date.append((std::string) buft);
return date;
}
char buf[40];
strftime (buf,80,"%b %d, %Y %T.",local);
std::string date=(std::string) buf;
char buft[10];
sprintf(buft,"%d",ts.nsec);
date.append((std::string) buft);
return date;
}
@@ -257,7 +264,8 @@ public:
void print(unsigned int nelemToPrint)
{
nelemToPrint=std::min(nelemToPrint,nelem);
if (strcmp(pv,"")==0) {
if (strcmp(pv,"")==0)
{
std::cout << "Process Variable NOT ASSIGNED!" << std::endl;
std::cout << "Variable has not been applied to a get operation!" << std::endl;
return;
@@ -268,7 +276,8 @@ public:
std::cout << "processVariable= " << pv << std::endl;
if (strcmp(pvAlias,pv) && strcmp(pvAlias,"")) {
if (strcmp(pvAlias,pv) && strcmp(pvAlias,""))
{
std::cout << "pvAlias = " << pvAlias << std::endl;
}
std::cout << "device = " << device << std::endl;
@@ -280,34 +289,41 @@ public:
//std::cout << "dataType = " << CAFEDataTypeCode.message(dataType).c_str() << std::endl;
if (dataType != CAFE_NO_ACCESS && dataType != CAFE_TYPENOTCONN) {
if (dataType != CAFE_NO_ACCESS && dataType != CAFE_TYPENOTCONN)
{
std::cout << "nelem = ";
}
else {
else
{
std::cout << "nelem = ";
}
std::cout << nelem;
std::cout << std::endl;
if(!rule) {
if(!rule)
{
std::cout << "rule (0=false) = " << rule <<std::endl;
}
if (dbr_type_is_STS(dbrDataType) || dbr_type_is_TIME(dbrDataType) ) {
if (dbr_type_is_STS(dbrDataType) || dbr_type_is_TIME(dbrDataType) )
{
std::cout << "alarmStatus = " << acond.asString(alarmStatus) << " (" << alarmStatus << ")" << std::endl;
std::cout << "alarmSeverity = " << aseve.asString(alarmSeverity) << " (" <<alarmSeverity << ")" << std::endl;
if (dbr_type_is_TIME(dbrDataType)) {
if (dbr_type_is_TIME(dbrDataType))
{
std::cout << "timeStamp = " << ts.secPastEpoch << " sec. and " << ts.nsec << " nsec" << std::endl;
}
}
if(beamEventNo!=0) {
if(beamEventNo!=0)
{
std::cout << "pulseID = " << beamEventNo << std::endl;
};
std::cout << "status = " << cafeStatusCode.message(status).c_str() << " (" << status << ") " << std::endl;
std::cout << "value(s) = " ;
switch (dataType) {
switch (dataType)
{
case CAFE_STRING:
for (unsigned int i=0; i <nelemToPrint; ++i ) std::cout << val[i].str << " [" << i << "] " ;
break;
@@ -318,7 +334,8 @@ public:
for (unsigned int i=0; i <nelemToPrint; ++i ) std::cout << val[i].f << " [" << i << "] " ;
break;
case CAFE_ENUM:
for (unsigned int i=0; i <nelemToPrint; ++i ) {
for (unsigned int i=0; i <nelemToPrint; ++i )
{
std::cout <<
getAsString(i) << " (" << val[i].us << ")" << " [" << i << "] " ;
}