new release
This commit is contained in:
@@ -42,29 +42,53 @@ private:
|
||||
CAFE_DATATYPE_UNION lowerCtrlLimit;
|
||||
|
||||
Helper helper;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
PVCtrlHolder(){
|
||||
alarmStatus=0; alarmSeverity=0; precision=0; status=ECA_NORMAL;
|
||||
nelem=1; size=1; rule=true; beamEventNo=0;
|
||||
hasAlarm=true;
|
||||
noStr=0; dataType=(CAFE_DATATYPE) CAFE_NO_ACCESS;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
PVCtrlHolder()
|
||||
{
|
||||
alarmStatus=0;
|
||||
alarmSeverity=0;
|
||||
precision=0;
|
||||
status=ECA_NORMAL;
|
||||
nelem=1;
|
||||
size=1;
|
||||
rule=true;
|
||||
beamEventNo=0;
|
||||
hasAlarm=true;
|
||||
noStr=0;
|
||||
dataType=(CAFE_DATATYPE) CAFE_NO_ACCESS;
|
||||
dataTypeNative=(CAFE_DATATYPE) CAFE_NO_ACCESS;
|
||||
strcpy(pv,""); strcpy(pvAlias,"");strcpy(device,""); strcpy(attrib,""); strcpy(units,"");
|
||||
strcpy(pv,"");
|
||||
strcpy(pvAlias,"");
|
||||
strcpy(device,"");
|
||||
strcpy(attrib,"");
|
||||
strcpy(units,"");
|
||||
|
||||
val.reset( new CAFE_DATATYPE_UNION[nelem] );
|
||||
val[0].d=0.00;
|
||||
};
|
||||
|
||||
PVCtrlHolder(unsigned int _sizeOfArray) {
|
||||
alarmStatus=0; alarmSeverity=0; precision=0; status=ECA_NORMAL;
|
||||
nelem=_sizeOfArray; size=_sizeOfArray; rule=true; beamEventNo=0;
|
||||
hasAlarm=true;
|
||||
noStr=0; dataType=(CAFE_DATATYPE) CAFE_NO_ACCESS;
|
||||
|
||||
PVCtrlHolder(unsigned int _sizeOfArray)
|
||||
{
|
||||
alarmStatus=0;
|
||||
alarmSeverity=0;
|
||||
precision=0;
|
||||
status=ECA_NORMAL;
|
||||
nelem=_sizeOfArray;
|
||||
size=_sizeOfArray;
|
||||
rule=true;
|
||||
beamEventNo=0;
|
||||
hasAlarm=true;
|
||||
noStr=0;
|
||||
dataType=(CAFE_DATATYPE) CAFE_NO_ACCESS;
|
||||
dataTypeNative=(CAFE_DATATYPE) CAFE_NO_ACCESS;
|
||||
strcpy(pv,""); strcpy(pvAlias,"");strcpy(device,""); strcpy(attrib,""); strcpy(units,"");
|
||||
strcpy(pv,"");
|
||||
strcpy(pvAlias,"");
|
||||
strcpy(device,"");
|
||||
strcpy(attrib,"");
|
||||
strcpy(units,"");
|
||||
|
||||
val.reset( new CAFE_DATATYPE_UNION[nelem] );
|
||||
|
||||
@@ -73,14 +97,19 @@ private:
|
||||
};
|
||||
};
|
||||
|
||||
~PVCtrlHolder() {val.reset();};
|
||||
~PVCtrlHolder()
|
||||
{
|
||||
val.reset();
|
||||
};
|
||||
|
||||
void setHasAlarm(bool a) {
|
||||
hasAlarm=a;
|
||||
return;
|
||||
};
|
||||
void setHasAlarm(bool a)
|
||||
{
|
||||
hasAlarm=a;
|
||||
return;
|
||||
};
|
||||
|
||||
unsigned int setNelem (unsigned int _nelem) {
|
||||
unsigned int setNelem (unsigned int _nelem)
|
||||
{
|
||||
_nelem>0 ? nelem=_nelem : nelem=1;
|
||||
|
||||
if (_nelem>size) {
|
||||
@@ -93,17 +122,33 @@ private:
|
||||
return nelem;
|
||||
};
|
||||
|
||||
short getPrecision() const {return precision;}
|
||||
|
||||
const char * getUnits() const {return units;}
|
||||
string getUnitsAsString() const {return (string) units;}
|
||||
short getNoEnumStrings () const {return noStr;};
|
||||
char * getEnumString(short indx) const {return (char *) strs[indx];};
|
||||
short getPrecision() const
|
||||
{
|
||||
return precision;
|
||||
}
|
||||
|
||||
const char * getUnits() const
|
||||
{
|
||||
return units;
|
||||
}
|
||||
std::string getUnitsAsString() const
|
||||
{
|
||||
return (std::string) units;
|
||||
}
|
||||
short getNoEnumStrings () const
|
||||
{
|
||||
return noStr;
|
||||
};
|
||||
char * getEnumString(short indx) const
|
||||
{
|
||||
return (char *) strs[indx];
|
||||
};
|
||||
|
||||
|
||||
vector<std::string> getEnumStrings() const {
|
||||
std::vector<std::string> getEnumStrings() const
|
||||
{
|
||||
|
||||
vector<std::string> vEnumStrings;
|
||||
std::vector<std::string> vEnumStrings;
|
||||
|
||||
vEnumStrings.reserve(noStr>0?noStr:1);
|
||||
for ( short i=0; i<noStr; ++i) {
|
||||
@@ -111,193 +156,299 @@ private:
|
||||
}
|
||||
return vEnumStrings;
|
||||
};
|
||||
|
||||
|
||||
short getEnumFromString(string enumString){
|
||||
|
||||
short returnValue=-1;
|
||||
|
||||
for ( short i=0; i<noStr; ++i) {
|
||||
if (strcmp(enumString.c_str(), strs[i])==0) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
char pvStripped[MAX_ENUM_STRING_SIZE];
|
||||
helper.removeLeadingAndTrailingSpaces((char *) enumString.c_str(), pvStripped);
|
||||
|
||||
for ( short i=0; i<noStr; ++i) {
|
||||
if (strcmp(pvStripped, strs[i])==0) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
cout << "*** WARNING FROM PvCtrlHolder.h ***" << endl;
|
||||
cout << "*** Method getEnumFromString(string enumString) ***" << endl;
|
||||
cout << "The given input string '" << enumString << "' was not recognized! " << endl;
|
||||
cout << "Valid values are: " << endl;
|
||||
for ( short i=0; i<noStr; ++i) {
|
||||
cout << i << ":" << strs[i] << endl;
|
||||
}
|
||||
|
||||
|
||||
return returnValue;
|
||||
|
||||
}
|
||||
|
||||
string getStringFromEnum(unsigned short enumValue) const{
|
||||
|
||||
string returnValue="";
|
||||
|
||||
if (enumValue<noStr) {
|
||||
return (string) strs[enumValue];
|
||||
}
|
||||
else {
|
||||
cout << "*** WARNING FROM PvCtrlHolder.h ***" << endl;
|
||||
cout << "*** Method getStringFromEnum(unsigned short enumValue) ***" << endl;
|
||||
cout << "The given input index " << enumValue << " exceeds the number of enum states " << noStr << endl;
|
||||
cout << "Valid values are: " << endl;
|
||||
for ( short i=0; i<noStr; ++i) {
|
||||
cout << i << ":" << strs[i] << endl;
|
||||
}
|
||||
|
||||
if (enumValue<MAX_ENUM_STATES) {
|
||||
return (string) strs[enumValue];
|
||||
}
|
||||
else {
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
CafeDataTypeHelper getRISC_pad() {CafeDataTypeHelper cdth(RISC_pad, dataType); return cdth;}
|
||||
CafeDataTypeHelper getUpperDispLimit() {CafeDataTypeHelper cdth(upperDispLimit, dataType); return cdth;}
|
||||
CafeDataTypeHelper getLowerDispLimit() {CafeDataTypeHelper cdth(lowerDispLimit, dataType); return cdth;}
|
||||
CafeDataTypeHelper getUpperAlarmLimit() {CafeDataTypeHelper cdth(upperAlarmLimit, dataType); return cdth;}
|
||||
CafeDataTypeHelper getUpperWarningLimit() {CafeDataTypeHelper cdth(upperWarningLimit, dataType); return cdth;}
|
||||
CafeDataTypeHelper getLowerWarningLimit() {CafeDataTypeHelper cdth(lowerWarningLimit, dataType); return cdth;}
|
||||
CafeDataTypeHelper getLowerAlarmLimit() {CafeDataTypeHelper cdth(lowerAlarmLimit, dataType); return cdth;}
|
||||
CafeDataTypeHelper getUpperCtrlLimit() {CafeDataTypeHelper cdth(upperCtrlLimit, dataType); return cdth;}
|
||||
CafeDataTypeHelper getLowerCtrlLimit() {CafeDataTypeHelper cdth(lowerCtrlLimit, dataType); return cdth;}
|
||||
short getEnumFromString(std::string enumString)
|
||||
{
|
||||
|
||||
short returnValue=-1;
|
||||
|
||||
for ( short i=0; i<noStr; ++i) {
|
||||
if (strcmp(enumString.c_str(), strs[i])==0) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
char pvStripped[MAX_ENUM_STRING_SIZE];
|
||||
helper.removeLeadingAndTrailingSpaces((char *) enumString.c_str(), pvStripped);
|
||||
|
||||
for ( short i=0; i<noStr; ++i) {
|
||||
if (strcmp(pvStripped, strs[i])==0) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
std::cout << "*** WARNING FROM PvCtrlHolder.h ***" << std::endl;
|
||||
std::cout << "*** Method getEnumFromString(string enumString) ***" << std::endl;
|
||||
std::cout << "The given input string '" << enumString << "' was not recognized! " << std::endl;
|
||||
std::cout << "Valid values are: " << std::endl;
|
||||
for ( short i=0; i<noStr; ++i) {
|
||||
std::cout << i << ":" << strs[i] << std::endl;
|
||||
}
|
||||
|
||||
|
||||
return returnValue;
|
||||
|
||||
}
|
||||
|
||||
std::string getStringFromEnum(unsigned short enumValue) const
|
||||
{
|
||||
|
||||
std::string returnValue="";
|
||||
|
||||
if (enumValue<noStr) {
|
||||
return (std::string) strs[enumValue];
|
||||
}
|
||||
else {
|
||||
std::cout << "*** WARNING FROM PvCtrlHolder.h ***" << std::endl;
|
||||
std::cout << "*** Method getStringFromEnum(unsigned short enumValue) ***" << std::endl;
|
||||
std::cout << "The given input index " << enumValue << " exceeds the number of enum states " << noStr << std::endl;
|
||||
std::cout << "Valid values are: " << std::endl;
|
||||
for ( short i=0; i<noStr; ++i) {
|
||||
std::cout << i << ":" << strs[i] << std::endl;
|
||||
}
|
||||
|
||||
if (enumValue<MAX_ENUM_STATES) {
|
||||
return (std::string) strs[enumValue];
|
||||
}
|
||||
else {
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
string getUpperDispLimit_AsString() { return getAsString(upperDispLimit); }
|
||||
string getLowerDispLimit_AsString() { return getAsString(lowerDispLimit); }
|
||||
string getUpperAlarmLimit_AsString() { return getAsString(upperAlarmLimit); }
|
||||
string getUpperWarningLimit_AsString() { return getAsString(upperWarningLimit); }
|
||||
string getLowerWarningLimit_AsString() { return getAsString(lowerWarningLimit); }
|
||||
string getLowerAlarmLimit_AsString() { return getAsString(lowerAlarmLimit); }
|
||||
string getUpperCtrlLimit_AsString() { return getAsString(upperCtrlLimit); }
|
||||
string getLowerCtrlLimit_AsString() { return getAsString(lowerCtrlLimit); }
|
||||
|
||||
double getUpperDispLimit_AsDouble() { return getAsDouble(upperDispLimit); }
|
||||
double getLowerDispLimit_AsDouble() { return getAsDouble(lowerDispLimit); }
|
||||
double getUpperAlarmLimit_AsDouble() { return getAsDouble(upperAlarmLimit); }
|
||||
double getUpperWarningLimit_AsDouble() { return getAsDouble(upperWarningLimit); }
|
||||
double getLowerWarningLimit_AsDouble() { return getAsDouble(lowerWarningLimit); }
|
||||
double getLowerAlarmLimit_AsDouble() { return getAsDouble(lowerAlarmLimit); }
|
||||
double getUpperCtrlLimit_AsDouble() { return getAsDouble(upperCtrlLimit); }
|
||||
double getLowerCtrlLimit_AsDouble() { return getAsDouble(lowerCtrlLimit); }
|
||||
CafeDataTypeHelper getRISC_pad()
|
||||
{
|
||||
CafeDataTypeHelper cdth(RISC_pad, dataType);
|
||||
return cdth;
|
||||
}
|
||||
CafeDataTypeHelper getUpperDispLimit()
|
||||
{
|
||||
CafeDataTypeHelper cdth(upperDispLimit, dataType);
|
||||
return cdth;
|
||||
}
|
||||
CafeDataTypeHelper getLowerDispLimit()
|
||||
{
|
||||
CafeDataTypeHelper cdth(lowerDispLimit, dataType);
|
||||
return cdth;
|
||||
}
|
||||
CafeDataTypeHelper getUpperAlarmLimit()
|
||||
{
|
||||
CafeDataTypeHelper cdth(upperAlarmLimit, dataType);
|
||||
return cdth;
|
||||
}
|
||||
CafeDataTypeHelper getUpperWarningLimit()
|
||||
{
|
||||
CafeDataTypeHelper cdth(upperWarningLimit, dataType);
|
||||
return cdth;
|
||||
}
|
||||
CafeDataTypeHelper getLowerWarningLimit()
|
||||
{
|
||||
CafeDataTypeHelper cdth(lowerWarningLimit, dataType);
|
||||
return cdth;
|
||||
}
|
||||
CafeDataTypeHelper getLowerAlarmLimit()
|
||||
{
|
||||
CafeDataTypeHelper cdth(lowerAlarmLimit, dataType);
|
||||
return cdth;
|
||||
}
|
||||
CafeDataTypeHelper getUpperCtrlLimit()
|
||||
{
|
||||
CafeDataTypeHelper cdth(upperCtrlLimit, dataType);
|
||||
return cdth;
|
||||
}
|
||||
CafeDataTypeHelper getLowerCtrlLimit()
|
||||
{
|
||||
CafeDataTypeHelper cdth(lowerCtrlLimit, dataType);
|
||||
return cdth;
|
||||
}
|
||||
|
||||
void print() {
|
||||
|
||||
|
||||
std::string getUpperDispLimit_AsString()
|
||||
{
|
||||
return getAsString(upperDispLimit);
|
||||
}
|
||||
std::string getLowerDispLimit_AsString()
|
||||
{
|
||||
return getAsString(lowerDispLimit);
|
||||
}
|
||||
std::string getUpperAlarmLimit_AsString()
|
||||
{
|
||||
return getAsString(upperAlarmLimit);
|
||||
}
|
||||
std::string getUpperWarningLimit_AsString()
|
||||
{
|
||||
return getAsString(upperWarningLimit);
|
||||
}
|
||||
std::string getLowerWarningLimit_AsString()
|
||||
{
|
||||
return getAsString(lowerWarningLimit);
|
||||
}
|
||||
std::string getLowerAlarmLimit_AsString()
|
||||
{
|
||||
return getAsString(lowerAlarmLimit);
|
||||
}
|
||||
std::string getUpperCtrlLimit_AsString()
|
||||
{
|
||||
return getAsString(upperCtrlLimit);
|
||||
}
|
||||
std::string getLowerCtrlLimit_AsString()
|
||||
{
|
||||
return getAsString(lowerCtrlLimit);
|
||||
}
|
||||
|
||||
double getUpperDispLimit_AsDouble()
|
||||
{
|
||||
return getAsDouble(upperDispLimit);
|
||||
}
|
||||
double getLowerDispLimit_AsDouble()
|
||||
{
|
||||
return getAsDouble(lowerDispLimit);
|
||||
}
|
||||
double getUpperAlarmLimit_AsDouble()
|
||||
{
|
||||
return getAsDouble(upperAlarmLimit);
|
||||
}
|
||||
double getUpperWarningLimit_AsDouble()
|
||||
{
|
||||
return getAsDouble(upperWarningLimit);
|
||||
}
|
||||
double getLowerWarningLimit_AsDouble()
|
||||
{
|
||||
return getAsDouble(lowerWarningLimit);
|
||||
}
|
||||
double getLowerAlarmLimit_AsDouble()
|
||||
{
|
||||
return getAsDouble(lowerAlarmLimit);
|
||||
}
|
||||
double getUpperCtrlLimit_AsDouble()
|
||||
{
|
||||
return getAsDouble(upperCtrlLimit);
|
||||
}
|
||||
double getLowerCtrlLimit_AsDouble()
|
||||
{
|
||||
return getAsDouble(lowerCtrlLimit);
|
||||
}
|
||||
|
||||
void print()
|
||||
{
|
||||
print(nelem) ;
|
||||
}
|
||||
|
||||
|
||||
void print(unsigned int nelemToPrint) {
|
||||
void print(unsigned int nelemToPrint)
|
||||
{
|
||||
|
||||
nelemToPrint=min(nelemToPrint,nelem);
|
||||
nelemToPrint=std::min(nelemToPrint,nelem);
|
||||
std::cout << "------------------------------------------" << std::endl;
|
||||
std::cout << "PVCtrlHolder:" << std::endl;
|
||||
std::cout << "processVariable= " << pv << std::endl;
|
||||
std::cout << "processVariable= " << pv << std::endl;
|
||||
if (strcmp(pvAlias,pv)) {
|
||||
std::cout << "pvAlias = " << pvAlias << std::endl;
|
||||
}
|
||||
std::cout << "device = " << device << std::endl;
|
||||
std::cout << "attrib = " << attrib << std::endl;
|
||||
std::cout << "dataType = " << cafeDataTypeCode.message(dataType).c_str()
|
||||
<< " (" << dataType << ") " << std::endl;
|
||||
<< " (" << dataType << ") " << std::endl;
|
||||
std::cout << "dbrTypeRequest = " << dbr_type_to_text(dbrDataType)<< std::endl;
|
||||
if (dataType!=CAFE_NO_ACCESS || dataType != CAFE_TYPENOTCONN) {
|
||||
std::cout << "nelem = " << nelem << std::endl;
|
||||
std::cout << "nelem = " << nelem << std::endl;
|
||||
|
||||
//std::cout << "alarmStatus = " << alarmStatus << " [" << acond.asString(alarmStatus)<< "]" << std::endl;
|
||||
//std::cout << "alarmSeverity = " << alarmSeverity << " [" << aseve.asString(alarmSeverity) << "]"<< std::endl;
|
||||
std::cout << "alarmStatus = " << acond.asString(alarmStatus) << " (" << alarmStatus << ")" << std::endl;
|
||||
std::cout << "alarmSeverity = " << aseve.asString(alarmSeverity) << " (" <<alarmSeverity << ")" << std::endl;
|
||||
//std::cout << "alarmStatus = " << alarmStatus << " [" << acond.asString(alarmStatus)<< "]" << std::endl;
|
||||
//std::cout << "alarmSeverity = " << alarmSeverity << " [" << aseve.asString(alarmSeverity) << "]"<< std::endl;
|
||||
std::cout << "alarmStatus = " << acond.asString(alarmStatus) << " (" << alarmStatus << ")" << std::endl;
|
||||
std::cout << "alarmSeverity = " << aseve.asString(alarmSeverity) << " (" <<alarmSeverity << ")" << std::endl;
|
||||
|
||||
|
||||
std::cout << "precision = " << precision << std::endl;
|
||||
std::cout << "units = " << units << std::endl;
|
||||
/*
|
||||
if (dataType==CAFE_DOUBLE){
|
||||
std::cout << "RISC_Pad0 = " << (dbr_short_t) RISC_pad.d << std::endl
|
||||
// in dbr_ctrl_double this is a RISC_pad
|
||||
}
|
||||
else if (dataType==CAFE_CHAR) {
|
||||
std::cout << "RISC_Pad = " << (unsigned short) RISC_pad.ch << std::endl;
|
||||
}
|
||||
else if (dataType==CAFE_FLOAT) {
|
||||
std::cout << "RISC_Pad = " << (dbr_short_t) RISC_pad.f << std::endl;
|
||||
}
|
||||
*/
|
||||
if (dataType!=CAFE_ENUM) {
|
||||
std::cout << "upperDispLimit = " << getAsString(upperDispLimit) << std::endl;
|
||||
std::cout << "lowerDispLimit = " << getAsString(lowerDispLimit) << std::endl;
|
||||
std::cout << "upperAlarmLimit= " << getAsString(upperAlarmLimit) << std::endl;
|
||||
std::cout << "upperWarnLimit = " << getAsString(upperWarningLimit) << std::endl;
|
||||
std::cout << "lowerWarnLimit = " << getAsString(lowerWarningLimit) << std::endl;
|
||||
std::cout << "lowerAlarmLimit= " << getAsString(lowerAlarmLimit) << std::endl;
|
||||
if(dbr_type_is_CTRL(dbrDataType)) {
|
||||
std::cout << "upperCtrlLimit = " << getAsString(upperCtrlLimit) << std::endl;
|
||||
std::cout << "lowerCtrlLimit = " << getAsString(lowerCtrlLimit) << std::endl;
|
||||
|
||||
std::cout << "precision = " << precision << std::endl;
|
||||
std::cout << "units = " << units << std::endl;
|
||||
/*
|
||||
if (dataType==CAFE_DOUBLE){
|
||||
std::cout << "RISC_Pad0 = " << (dbr_short_t) RISC_pad.d << std::endl
|
||||
// in dbr_ctrl_double this is a RISC_pad
|
||||
}
|
||||
else if (dataType==CAFE_CHAR) {
|
||||
std::cout << "RISC_Pad = " << (unsigned short) RISC_pad.ch << std::endl;
|
||||
}
|
||||
else if (dataType==CAFE_FLOAT) {
|
||||
std::cout << "RISC_Pad = " << (dbr_short_t) RISC_pad.f << std::endl;
|
||||
}
|
||||
*/
|
||||
if (dataType!=CAFE_ENUM) {
|
||||
std::cout << "upperDispLimit = " << getAsString(upperDispLimit) << std::endl;
|
||||
std::cout << "lowerDispLimit = " << getAsString(lowerDispLimit) << std::endl;
|
||||
std::cout << "upperAlarmLimit= " << getAsString(upperAlarmLimit) << std::endl;
|
||||
std::cout << "upperWarnLimit = " << getAsString(upperWarningLimit) << std::endl;
|
||||
std::cout << "lowerWarnLimit = " << getAsString(lowerWarningLimit) << std::endl;
|
||||
std::cout << "lowerAlarmLimit= " << getAsString(lowerAlarmLimit) << std::endl;
|
||||
if(dbr_type_is_CTRL(dbrDataType)) {
|
||||
std::cout << "upperCtrlLimit = " << getAsString(upperCtrlLimit) << std::endl;
|
||||
std::cout << "lowerCtrlLimit = " << getAsString(lowerCtrlLimit) << std::endl;
|
||||
}
|
||||
}
|
||||
else {
|
||||
std::cout << "NoStr (ENUM) = " << noStr << std::endl;
|
||||
std::cout << "strs (ENUM) = " ;
|
||||
for (short i=0; i< noStr; ++i) {
|
||||
std::cout << "{" << strs[i] << "} " ;
|
||||
}
|
||||
std::cout <<std::endl;
|
||||
}
|
||||
}
|
||||
else {
|
||||
std::cout << "NoStr (ENUM) = " << noStr << std::endl;
|
||||
std::cout << "strs (ENUM) = " ;
|
||||
for (short i=0; i< noStr; ++i) {std::cout << "{" << strs[i] << "} " ;}
|
||||
cout <<std::endl;
|
||||
}
|
||||
|
||||
std::cout << "status = " << cafeStatusCode.message(status).c_str() << std::endl;
|
||||
if(nelem>0) {std::cout << "value(s) = " ;}
|
||||
|
||||
switch (dataType) {
|
||||
case CAFE_STRING:
|
||||
for (unsigned int i=0; i <nelemToPrint; ++i ) {std::cout << val[i].str << " [" << i << "] " ;}
|
||||
break;
|
||||
case CAFE_SHORT:
|
||||
for (unsigned int i=0; i <nelemToPrint; ++i ) {std::cout << val[i].s << " [" << i << "] " ;}
|
||||
break;
|
||||
case CAFE_FLOAT:
|
||||
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 ) {std::cout <<
|
||||
getAsString(i) << " (" << val[i].us << ")" << " [" << i << "] " ;}
|
||||
break;
|
||||
case CAFE_CHAR:
|
||||
for (unsigned int i=0; i <nelemToPrint; ++i ) {std::cout << (unsigned short) val[i].ch << " [" << i << "] " ;}
|
||||
break;
|
||||
case CAFE_LONG:
|
||||
for (unsigned int i=0; i <nelemToPrint; ++i ) {std::cout << val[i].l << " [" << i << "] " ;}
|
||||
break;
|
||||
case CAFE_DOUBLE:
|
||||
for (unsigned int i=0; i <nelemToPrint; ++i ) {std::cout << val[i].d << " [" << i << "] " ;}
|
||||
break;
|
||||
case CAFE_NO_ACCESS:
|
||||
std::cout << "status = " << cafeStatusCode.message(status).c_str() << std::endl;
|
||||
if(nelem>0) {
|
||||
std::cout << "value(s) = " ;
|
||||
}
|
||||
|
||||
switch (dataType) {
|
||||
case CAFE_STRING:
|
||||
for (unsigned int i=0; i <nelemToPrint; ++i ) {
|
||||
std::cout << val[i].str << " [" << i << "] " ;
|
||||
}
|
||||
break;
|
||||
case CAFE_SHORT:
|
||||
for (unsigned int i=0; i <nelemToPrint; ++i ) {
|
||||
std::cout << val[i].s << " [" << i << "] " ;
|
||||
}
|
||||
break;
|
||||
case CAFE_FLOAT:
|
||||
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 ) {
|
||||
std::cout <<
|
||||
getAsString(i) << " (" << val[i].us << ")" << " [" << i << "] " ;
|
||||
}
|
||||
break;
|
||||
case CAFE_CHAR:
|
||||
for (unsigned int i=0; i <nelemToPrint; ++i ) {
|
||||
std::cout << (unsigned short) val[i].ch << " [" << i << "] " ;
|
||||
}
|
||||
break;
|
||||
case CAFE_LONG:
|
||||
for (unsigned int i=0; i <nelemToPrint; ++i ) {
|
||||
std::cout << val[i].l << " [" << i << "] " ;
|
||||
}
|
||||
break;
|
||||
case CAFE_DOUBLE:
|
||||
for (unsigned int i=0; i <nelemToPrint; ++i ) {
|
||||
std::cout << val[i].d << " [" << i << "] " ;
|
||||
}
|
||||
break;
|
||||
case CAFE_NO_ACCESS:
|
||||
default:
|
||||
std::cout << "DATA_TYPE NOT YET DEFINED " << endl;
|
||||
break;
|
||||
std::cout << "DATA_TYPE NOT YET DEFINED " << std::endl;
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
std::cout << std::endl;
|
||||
}
|
||||
std::cout << "------------------------------------------" << std::endl;
|
||||
std::cout << "------------------------------------------" << std::endl;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#define PVDATAHOLDER_H
|
||||
|
||||
#include <PVHolder.h>
|
||||
#include <tmDateMap.h>
|
||||
|
||||
/**
|
||||
* \class PVDataHolder
|
||||
@@ -21,39 +22,48 @@ class PVDataHolder : public PVHolder {
|
||||
friend class PVGroup;
|
||||
friend class Connect;
|
||||
friend class Conduit;
|
||||
//if HAVE_LIBQTXML
|
||||
//if HAVE_LIBQTXML
|
||||
friend class loadCollectionXMLParser;
|
||||
friend class restorePVGroupXMLParser;
|
||||
//endif
|
||||
//endif
|
||||
friend struct change_dataBufferPVDataHolder;
|
||||
friend struct change_dataBufferSize_TIME;
|
||||
friend struct change_connectionHandlerArgs;
|
||||
friend struct change_pvAlias;
|
||||
|
||||
//private:
|
||||
//epicsTimeStamp ts;
|
||||
//bool hasTS;
|
||||
|
||||
|
||||
|
||||
public:
|
||||
|
||||
epicsTimeStamp ts;
|
||||
bool hasTS;
|
||||
|
||||
epicsTimeStamp ts;
|
||||
bool hasTS;
|
||||
etsNorm _etsNorm;
|
||||
etsDate _etsDate;
|
||||
TMwdayText tmDay;
|
||||
TMmonthpText tmMonth;
|
||||
|
||||
//Derived class does not inherit constructors
|
||||
PVDataHolder(unsigned int _sizeOfArray) {
|
||||
PVDataHolder(unsigned int _sizeOfArray)
|
||||
{
|
||||
|
||||
alarmStatus=0; alarmSeverity=0; status=ECAFE_NODATA;
|
||||
alarmStatus=-1;
|
||||
alarmSeverity=-1;
|
||||
status=ECAFE_NODATA;
|
||||
nelem= _sizeOfArray > 0 ? _sizeOfArray : 1;
|
||||
size = _sizeOfArray > 0 ? _sizeOfArray : 1;
|
||||
|
||||
dataType=(CAFE_DATATYPE) CAFE_NO_ACCESS;
|
||||
dataTypeNative=(CAFE_DATATYPE) CAFE_NO_ACCESS;
|
||||
rule=true; beamEventNo=0; userNo=0; ts.nsec=0; ts.secPastEpoch=0;
|
||||
hasAlarm=true; hasTS=true;
|
||||
strcpy(pv,""); strcpy(pvAlias,""); strcpy(device,""); strcpy(attrib,"");
|
||||
rule=true;
|
||||
beamEventNo=0;
|
||||
userNo=0;
|
||||
ts.nsec=0;
|
||||
ts.secPastEpoch=0;
|
||||
hasAlarm=true;
|
||||
hasTS=true;
|
||||
strcpy(pv,"");
|
||||
strcpy(pvAlias,"");
|
||||
strcpy(device,"");
|
||||
strcpy(attrib,"");
|
||||
|
||||
val.reset( new CAFE_DATATYPE_UNION[nelem] );
|
||||
|
||||
@@ -62,104 +72,197 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
PVDataHolder(){
|
||||
PVDataHolder()
|
||||
{
|
||||
|
||||
alarmStatus=0; alarmSeverity=0; status=ECAFE_NODATA; nelem=1; size=1;
|
||||
alarmStatus=-1;
|
||||
alarmSeverity=-1;
|
||||
status=ECAFE_NODATA;
|
||||
nelem=1;
|
||||
size=1;
|
||||
dataType=(CAFE_DATATYPE) CAFE_NO_ACCESS;
|
||||
dataTypeNative=(CAFE_DATATYPE) CAFE_NO_ACCESS;
|
||||
rule=true; beamEventNo=0; userNo=0; ts.nsec=0; ts.secPastEpoch =0;
|
||||
hasAlarm=true; hasTS=true;
|
||||
strcpy(pv,""); strcpy(pvAlias,""); strcpy(device,""); strcpy(attrib,"");
|
||||
rule=true;
|
||||
beamEventNo=0;
|
||||
userNo=0;
|
||||
ts.nsec=0;
|
||||
ts.secPastEpoch =0;
|
||||
hasAlarm=true;
|
||||
hasTS=true;
|
||||
strcpy(pv,"");
|
||||
strcpy(pvAlias,"");
|
||||
strcpy(device,"");
|
||||
strcpy(attrib,"");
|
||||
|
||||
val.reset( new CAFE_DATATYPE_UNION[nelem] );
|
||||
|
||||
val[0].d=0.00;
|
||||
};
|
||||
|
||||
~PVDataHolder() {
|
||||
|
||||
val.reset();
|
||||
~PVDataHolder()
|
||||
{
|
||||
|
||||
val.reset();
|
||||
};
|
||||
|
||||
void valReset() {
|
||||
void valReset()
|
||||
{
|
||||
|
||||
val.reset();
|
||||
}
|
||||
val.reset();
|
||||
}
|
||||
|
||||
|
||||
void setHasAlarm(bool a) {
|
||||
hasAlarm=a;
|
||||
return;
|
||||
};
|
||||
void setHasAlarm(bool a)
|
||||
{
|
||||
hasAlarm=a;
|
||||
return;
|
||||
};
|
||||
|
||||
void setHasTS(bool t){
|
||||
hasTS=t;
|
||||
if (t) {hasAlarm=t;} //TS will also retrieve alarmStatus
|
||||
return;
|
||||
}
|
||||
void setHasTS(bool t)
|
||||
{
|
||||
hasTS=t;
|
||||
if (t) {
|
||||
hasAlarm=t; //TS will also retrieve alarmStatus
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
bool getHasTS(){
|
||||
return hasTS;
|
||||
}
|
||||
bool getHasTS()
|
||||
{
|
||||
return hasTS;
|
||||
}
|
||||
|
||||
unsigned int setNelem (unsigned int _nelem) {
|
||||
unsigned int setNelem (unsigned int _nelem)
|
||||
{
|
||||
|
||||
_nelem>0 ? nelem=_nelem : nelem=1;
|
||||
|
||||
if (nelem>size) {
|
||||
size=nelem;
|
||||
val.reset( new CAFE_DATATYPE_UNION[size] );
|
||||
if (nelem>size) {
|
||||
size=nelem;
|
||||
val.reset( new CAFE_DATATYPE_UNION[size] );
|
||||
}
|
||||
|
||||
return nelem;
|
||||
};
|
||||
|
||||
epicsTimeStamp getEpicsTimeStamp() const {return ts;};
|
||||
epicsTimeStamp getEpicsTimeStamp() const
|
||||
{
|
||||
return ts;
|
||||
};
|
||||
|
||||
struct etsNorm{ unsigned int secPastEpoch; unsigned int nsec;} _etsNorm;
|
||||
struct etsDate{ unsigned short year; unsigned short mon; unsigned short day;
|
||||
unsigned short hour; unsigned short min; unsigned short sec; unsigned int nsec;} _etsDate ;
|
||||
|
||||
|
||||
etsNorm getEpicsTimeStampAsUInt32() {
|
||||
etsNorm getEpicsTimeStampAsUInt32()
|
||||
{
|
||||
_etsNorm.secPastEpoch=ts.secPastEpoch;
|
||||
_etsNorm.nsec=(unsigned long) ts.nsec;
|
||||
return _etsNorm;};
|
||||
return _etsNorm;
|
||||
};
|
||||
|
||||
etsDate getEpicsTimeStampAsDate() {
|
||||
etsDate getEpicsTimeStampAsDate()
|
||||
{
|
||||
|
||||
ts.nsec=(unsigned int) ts.nsec;
|
||||
ts.nsec=(unsigned int) ts.nsec;
|
||||
|
||||
//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) {
|
||||
cout << "OVERFLOW IN gets.nsec CORRECTED for epicsTime converter " << endl; ts.nsec=0;
|
||||
}
|
||||
//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) {
|
||||
std::cout << "OVERFLOW IN gets.nsec CORRECTED for epicsTime converter " << std::endl;
|
||||
ts.nsec=0;
|
||||
}
|
||||
|
||||
epicsTime time(ts);
|
||||
|
||||
local_tm_nano_sec local = (local_tm_nano_sec) time;
|
||||
_etsDate.year = local.ansi_tm.tm_year + 1900;
|
||||
_etsDate.mon = local.ansi_tm.tm_mon + 1;
|
||||
_etsDate.day = local.ansi_tm.tm_mday;
|
||||
_etsDate.mon = local.ansi_tm.tm_mon + 1;
|
||||
_etsDate.day = local.ansi_tm.tm_mday;
|
||||
_etsDate.hour = local.ansi_tm.tm_hour;
|
||||
_etsDate.min = local.ansi_tm.tm_min;
|
||||
_etsDate.sec = local.ansi_tm.tm_sec;
|
||||
_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;
|
||||
|
||||
return _etsDate;
|
||||
}
|
||||
|
||||
|
||||
etsDate getUnixTimeAsDate(etsNorm ets)
|
||||
{
|
||||
|
||||
time_t t= ets.secPastEpoch;
|
||||
|
||||
struct tm * local;
|
||||
local=localtime(&t);
|
||||
//local_tm_nano_sec local = (local_tm_nano_sec) time;
|
||||
_etsDate.year = local->tm_year +1900;
|
||||
_etsDate.mon = local->tm_mon + 1;
|
||||
_etsDate.day = local->tm_mday;
|
||||
_etsDate.hour = local->tm_hour;
|
||||
_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;
|
||||
|
||||
return _etsDate;
|
||||
}
|
||||
|
||||
|
||||
std::string getEpicsTimeStampAsString() {
|
||||
|
||||
void print() {
|
||||
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() {
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void print()
|
||||
{
|
||||
print(nelem) ;
|
||||
}
|
||||
|
||||
void print(unsigned int nelemToPrint) {
|
||||
nelemToPrint=min(nelemToPrint,nelem);
|
||||
if (pv==NULL) {
|
||||
|
||||
void print(unsigned int nelemToPrint)
|
||||
{
|
||||
nelemToPrint=std::min(nelemToPrint,nelem);
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
std::cout << "------------------------------------------" << std::endl;
|
||||
//std::cout << "PVDataHolder:" << std::endl;
|
||||
|
||||
@@ -171,7 +274,7 @@ public:
|
||||
std::cout << "device = " << device << std::endl;
|
||||
std::cout << "attrib = " << attrib << std::endl;
|
||||
std::cout << "dataType = " << cafeDataTypeCode.message(dataType).c_str()
|
||||
<< " (" << dataType << ") " << std::endl;
|
||||
<< " (" << dataType << ") " << std::endl;
|
||||
std::cout << "dbrTypeRequest = " << dbr_type_to_text(dbrDataType)
|
||||
<< " (" << dbrDataType << ") " << std::endl;
|
||||
|
||||
@@ -183,50 +286,55 @@ public:
|
||||
else {
|
||||
std::cout << "nelem = ";
|
||||
}
|
||||
std::cout << nelem; std::cout << std::endl;
|
||||
std::cout << nelem;
|
||||
std::cout << std::endl;
|
||||
if(!rule) {
|
||||
std::cout << "rule (0=false) = " << rule <<std::endl;
|
||||
}
|
||||
|
||||
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)) {
|
||||
std::cout << "epicsTimeStamp = " << ts.secPastEpoch << " sec. and " << ts.nsec << " nsec" << std::endl;
|
||||
std::cout << "timeStamp = " << ts.secPastEpoch << " sec. and " << ts.nsec << " nsec" << std::endl;
|
||||
}
|
||||
}
|
||||
if(beamEventNo!=0) {std::cout << "beamEventNo = " << beamEventNo << std::endl;};
|
||||
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) {
|
||||
case CAFE_STRING:
|
||||
for (unsigned int i=0; i <nelemToPrint; ++i ) std::cout << val[i].str << " [" << i << "] " ;
|
||||
case CAFE_STRING:
|
||||
for (unsigned int i=0; i <nelemToPrint; ++i ) std::cout << val[i].str << " [" << i << "] " ;
|
||||
break;
|
||||
case CAFE_SHORT:
|
||||
for (unsigned int i=0; i <nelemToPrint; ++i ) std::cout << val[i].s << " [" << i << "] " ;
|
||||
case CAFE_SHORT:
|
||||
for (unsigned int i=0; i <nelemToPrint; ++i ) std::cout << val[i].s << " [" << i << "] " ;
|
||||
break;
|
||||
case CAFE_FLOAT:
|
||||
for (unsigned int i=0; i <nelemToPrint; ++i ) std::cout << val[i].f << " [" << i << "] " ;
|
||||
case CAFE_FLOAT:
|
||||
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 ) { std::cout <<
|
||||
getAsString(i) << " (" << val[i].us << ")" << " [" << i << "] " ;}
|
||||
case CAFE_ENUM:
|
||||
for (unsigned int i=0; i <nelemToPrint; ++i ) {
|
||||
std::cout <<
|
||||
getAsString(i) << " (" << val[i].us << ")" << " [" << i << "] " ;
|
||||
}
|
||||
break;
|
||||
case CAFE_CHAR:
|
||||
for (unsigned int i=0; i <nelemToPrint; ++i ) std::cout << (unsigned short) val[i].ch << " [" << i << "] " ;
|
||||
case CAFE_CHAR:
|
||||
for (unsigned int i=0; i <nelemToPrint; ++i ) std::cout << (unsigned short) val[i].ch << " [" << i << "] " ;
|
||||
break;
|
||||
case CAFE_LONG:
|
||||
for (unsigned int i=0; i <nelemToPrint; ++i ) std::cout << val[i].l << " [" << i << "] " ;
|
||||
case CAFE_LONG:
|
||||
for (unsigned int i=0; i <nelemToPrint; ++i ) std::cout << val[i].l << " [" << i << "] " ;
|
||||
break;
|
||||
case CAFE_DOUBLE:
|
||||
for (unsigned int i=0; i <nelemToPrint; ++i ) std::cout << val[i].d << " [" << i << "] " ;
|
||||
case CAFE_DOUBLE:
|
||||
for (unsigned int i=0; i <nelemToPrint; ++i ) std::cout << val[i].d << " [" << i << "] " ;
|
||||
break;
|
||||
case CAFE_NO_ACCESS:
|
||||
std::cout << "DATA_TYPE NOT YET DEFINED " << endl;
|
||||
default:
|
||||
case CAFE_NO_ACCESS:
|
||||
std::cout << "DATA_TYPE NOT YET DEFINED " << std::endl;
|
||||
default:
|
||||
break;
|
||||
|
||||
};
|
||||
|
||||
@@ -14,45 +14,50 @@
|
||||
|
||||
/**
|
||||
* class MemberMap
|
||||
* maps string to index
|
||||
* maps string to index
|
||||
*/
|
||||
class MemberMap {
|
||||
typedef std::map<long, std::string> mapLongString;
|
||||
typedef std::map<long, std::string> mapLongString;
|
||||
private:
|
||||
mapLongString mapNameIndex;
|
||||
mapLongString::iterator pos;
|
||||
Helper helper;
|
||||
mapLongString mapNameIndex;
|
||||
mapLongString::iterator pos;
|
||||
Helper helper;
|
||||
|
||||
public:
|
||||
MemberMap(){};
|
||||
~MemberMap(){};
|
||||
MemberMap() {};
|
||||
~MemberMap() {};
|
||||
|
||||
void insert(int a, std::string _Name) {
|
||||
mapNameIndex.insert(std::make_pair(a, _Name));
|
||||
};
|
||||
void insert(int a, std::string _Name)
|
||||
{
|
||||
mapNameIndex.insert(std::make_pair(a, _Name));
|
||||
};
|
||||
|
||||
std::string getPV (int i) {
|
||||
std::string getPV (int i)
|
||||
{
|
||||
|
||||
pos = mapNameIndex.find(i);
|
||||
if (pos != mapNameIndex.end()) return pos->second;
|
||||
cout << "Index " << i << " not found! Size of group vector is " << mapNameIndex.size() << endl;
|
||||
return "";
|
||||
};
|
||||
pos = mapNameIndex.find(i);
|
||||
if (pos != mapNameIndex.end()) return pos->second;
|
||||
std::cout << "Index " << i << " not found! Size of group vector is " << mapNameIndex.size() << std::endl;
|
||||
return "";
|
||||
};
|
||||
|
||||
int getIndex (std::string _Name) {
|
||||
char pvStripped[PVNAME_SIZE];
|
||||
helper.removeLeadingAndTrailingSpaces(_Name.c_str(), pvStripped);
|
||||
string Name=pvStripped;
|
||||
int getIndex (std::string _Name)
|
||||
{
|
||||
char pvStripped[PVNAME_SIZE];
|
||||
helper.removeLeadingAndTrailingSpaces(_Name.c_str(), pvStripped);
|
||||
std::string Name=pvStripped;
|
||||
|
||||
for (pos=mapNameIndex.begin(); pos != mapNameIndex.end(); ++pos) {
|
||||
for (pos=mapNameIndex.begin(); pos != mapNameIndex.end(); ++pos) {
|
||||
|
||||
if (pos->second==Name) {return pos->first;}
|
||||
// String searches such as s.find(s1) return string::npos on failure
|
||||
//else if ( (pos->second).find(Name) != std::string::npos) return pos->first;
|
||||
}
|
||||
cout << "PV: " << Name << " IS NOT A MEMBER OF THIS LIST " << endl;
|
||||
return -1;
|
||||
};
|
||||
if (pos->second==Name) {
|
||||
return pos->first;
|
||||
}
|
||||
// String searches such as s.find(s1) return string::npos on failure
|
||||
//else if ( (pos->second).find(Name) != std::string::npos) return pos->first;
|
||||
}
|
||||
std::cout << "PV: " << Name << " IS NOT A MEMBER OF THIS LIST " << std::endl;
|
||||
return -1;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -64,49 +69,99 @@ int getIndex (std::string _Name) {
|
||||
class PVGroup {
|
||||
friend class Connect;
|
||||
friend class CAFE;
|
||||
//if HAVE_LIBQTXML
|
||||
//if HAVE_LIBQTXML
|
||||
friend class restorePVGroupXMLParser;
|
||||
//endif
|
||||
//endif
|
||||
private:
|
||||
PVDataHolder * pvdata;
|
||||
unsigned int npv;
|
||||
char name [PVGROUP_PSEUDO_SIZE];
|
||||
char name [PVGROUP_PSEUDO_SIZE];
|
||||
int statusGroup;
|
||||
unsigned int groupHandle;
|
||||
bool isIndexOutOfRange (unsigned int idx) {
|
||||
bool isIndexOutOfRange (unsigned int idx)
|
||||
{
|
||||
return (idx >= npv) ? true:false;
|
||||
};
|
||||
MemberMap memberMap;
|
||||
|
||||
public:
|
||||
//Initialize 1st two to avoid compiler warning messages
|
||||
PVGroup(){npv=0; pvdata=NULL; statusGroup=ICAFE_NORMAL; groupHandle=0; strcpy(name,"");};
|
||||
~PVGroup(){};
|
||||
MemberMap getMemberMap() const {return memberMap;};
|
||||
PVDataHolder * getPVData() const {return pvdata;};
|
||||
PVDataHolder getPVData(unsigned int idx) throw(std::out_of_range){
|
||||
//Initialize 1st two to avoid compiler warning messages
|
||||
PVGroup()
|
||||
{
|
||||
npv=0;
|
||||
pvdata=NULL;
|
||||
statusGroup=ICAFE_NORMAL;
|
||||
groupHandle=0;
|
||||
strcpy(name,"");
|
||||
};
|
||||
~PVGroup() {};
|
||||
MemberMap getMemberMap() const
|
||||
{
|
||||
return memberMap;
|
||||
};
|
||||
PVDataHolder * getPVData() const
|
||||
{
|
||||
return pvdata;
|
||||
};
|
||||
PVDataHolder getPVData(unsigned int idx) throw(std::out_of_range)
|
||||
{
|
||||
if(isIndexOutOfRange(idx)) {
|
||||
std::ostringstream oss;
|
||||
oss << "Exception! Index " << idx <<
|
||||
" to PVGroup.pvdata() is out of range. Valid range is from 0 to " << npv-1;
|
||||
" to PVGroup.pvdata() is out of range. Valid range is from 0 to " << npv-1;
|
||||
throw std::out_of_range(oss.str());
|
||||
}
|
||||
return pvdata[idx];
|
||||
};
|
||||
void setHasAlarm(bool h){ for (unsigned int i=0; i<npv; ++i) {pvdata[i].setHasAlarm(h);} }
|
||||
void setHasTS(bool h){ for (unsigned int i=0; i<npv; ++i) {pvdata[i].setHasTS(h);} }
|
||||
void setHasAlarm(bool h)
|
||||
{
|
||||
for (unsigned int i=0; i<npv; ++i) {
|
||||
pvdata[i].setHasAlarm(h);
|
||||
}
|
||||
}
|
||||
void setHasTS(bool h)
|
||||
{
|
||||
for (unsigned int i=0; i<npv; ++i) {
|
||||
pvdata[i].setHasTS(h);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int getNPV() const {return npv;};
|
||||
string getNameAsString() const {return name;};
|
||||
const char * getName() const {return (const char *) name;};
|
||||
int getStatusGroup() const {return statusGroup;};
|
||||
int getGroupStatus() const {return statusGroup;};
|
||||
unsigned int getGroupHandle() const {return groupHandle;};
|
||||
unsigned int getNPV() const
|
||||
{
|
||||
return npv;
|
||||
};
|
||||
std::string getNameAsString() const
|
||||
{
|
||||
return name;
|
||||
};
|
||||
const char * getName() const
|
||||
{
|
||||
return (const char *) name;
|
||||
};
|
||||
int getStatusGroup() const
|
||||
{
|
||||
return statusGroup;
|
||||
};
|
||||
int getGroupStatus() const
|
||||
{
|
||||
return statusGroup;
|
||||
};
|
||||
unsigned int getGroupHandle() const
|
||||
{
|
||||
return groupHandle;
|
||||
};
|
||||
|
||||
int PV2Index(std::string _pv) const {return getMemberMap().getIndex(_pv);}
|
||||
string Index2PV(unsigned int _idx) const {return getMemberMap().getPV(_idx);}
|
||||
int PV2Index(std::string _pv) const
|
||||
{
|
||||
return getMemberMap().getIndex(_pv);
|
||||
}
|
||||
std::string Index2PV(unsigned int _idx) const
|
||||
{
|
||||
return getMemberMap().getPV(_idx);
|
||||
}
|
||||
|
||||
void setPVData(PVDataHolder * _pvdata) {
|
||||
void setPVData(PVDataHolder * _pvdata)
|
||||
{
|
||||
|
||||
//We do not need to make a deep copy
|
||||
/*
|
||||
@@ -134,50 +189,78 @@ public:
|
||||
pvdata=_pvdata;
|
||||
};
|
||||
|
||||
void set(unsigned int _npv) {npv=_npv;};
|
||||
void setName(const char * _name) {strcpy(name, _name);};
|
||||
void setName(string _name) {strcpy(name,_name.c_str());};
|
||||
void setStatusGroup(int _sg) {statusGroup=_sg;}
|
||||
void set(unsigned int _npv)
|
||||
{
|
||||
npv=_npv;
|
||||
};
|
||||
void setName(const char * _name)
|
||||
{
|
||||
strcpy(name, _name);
|
||||
};
|
||||
void setName(std::string _name)
|
||||
{
|
||||
strcpy(name,_name.c_str());
|
||||
};
|
||||
void setStatusGroup(int _sg)
|
||||
{
|
||||
statusGroup=_sg;
|
||||
}
|
||||
|
||||
|
||||
void show() {print(npv) ;}
|
||||
void showMax(unsigned int npvToPrint){print(npvToPrint);}
|
||||
void showMaxMax(unsigned int npvToPrint, unsigned int maxNelemWF){
|
||||
print(npvToPrint, maxNelemWF);}
|
||||
void show()
|
||||
{
|
||||
print(npv) ;
|
||||
}
|
||||
void showMax(unsigned int npvToPrint)
|
||||
{
|
||||
print(npvToPrint);
|
||||
}
|
||||
void showMaxMax(unsigned int npvToPrint, unsigned int maxNelemWF)
|
||||
{
|
||||
print(npvToPrint, maxNelemWF);
|
||||
}
|
||||
|
||||
void print() {print(npv) ;}
|
||||
void print(unsigned int npvToPrint) {
|
||||
npvToPrint=min(npvToPrint,npv);
|
||||
void print()
|
||||
{
|
||||
print(npv) ;
|
||||
}
|
||||
void print(unsigned int npvToPrint)
|
||||
{
|
||||
npvToPrint=std::min(npvToPrint,npv);
|
||||
std::cout << "------------ PVGroup Handle = " << groupHandle << " ------------ "<< std::endl;
|
||||
std::cout << "PVGROUP: " << name << " HAS " << npv << " MEMBERS " << std::endl;
|
||||
std::cout << "PRINTING THE REQUESTED " << npvToPrint << " MEMBERS " << std::endl;
|
||||
std::cout << "OVERALL STATUS OF GROUP REPORTS " << statusGroup << std::endl;
|
||||
if (statusGroup!=ICAFE_NORMAL) {
|
||||
CAFEStatus cstat; cstat.report(statusGroup);
|
||||
CAFEStatus cstat;
|
||||
cstat.report(statusGroup);
|
||||
}
|
||||
for (unsigned int i=0; i<npvToPrint; ++i) {
|
||||
std::cout << "------------------------------------------" << std::endl;
|
||||
std::cout << "Element [" << i << "] of " << npvToPrint << " in group: " << name << endl;
|
||||
std::cout << "------------------------------------------" << std::endl;
|
||||
std::cout << "Element [" << i << "] of " << npvToPrint << " in group: " << name << std::endl;
|
||||
pvdata[i].print();
|
||||
}
|
||||
}
|
||||
void print(unsigned int npvToPrint, unsigned int maxNelemWF) {
|
||||
npvToPrint=min(npvToPrint,npv);
|
||||
void print(unsigned int npvToPrint, unsigned int maxNelemWF)
|
||||
{
|
||||
npvToPrint=std::min(npvToPrint,npv);
|
||||
std::cout << "------------ PVGroup Handle = " << groupHandle << " ------------ "<< std::endl;
|
||||
std::cout << "PVGROUP: " << name << " HAS " << npv << " MEMBERS " << std::endl;
|
||||
std::cout << "PRINTING THE REQUESTED " << npvToPrint << " MEMBERS " << std::endl;
|
||||
std::cout << "OVERALL STATUS OF GROUP REPORTS " << statusGroup << std::endl;
|
||||
if (statusGroup!=ICAFE_NORMAL) {
|
||||
CAFEStatus cstat; cstat.report(statusGroup);
|
||||
CAFEStatus cstat;
|
||||
cstat.report(statusGroup);
|
||||
}
|
||||
for (unsigned int i=0; i<npvToPrint; ++i) {
|
||||
std::cout << "------------------------------------------" << std::endl;
|
||||
std::cout << "Element [" << i << "] of " << npvToPrint << " in group: " << name << endl;
|
||||
pvdata[i].print(min(maxNelemWF,pvdata[i].getNelem()));
|
||||
std::cout << "------------------------------------------" << std::endl;
|
||||
std::cout << "Element [" << i << "] of " << npvToPrint << " in group: " << name << std::endl;
|
||||
pvdata[i].print(std::min(maxNelemWF,pvdata[i].getNelem()));
|
||||
}
|
||||
}
|
||||
|
||||
void printIfError() {
|
||||
void printIfError()
|
||||
{
|
||||
unsigned int npvToPrint=npv;
|
||||
bool iErrorFound=false;
|
||||
for (unsigned int i=0; i<npvToPrint; ++i) {
|
||||
@@ -187,8 +270,8 @@ public:
|
||||
std::cout << "PRINTING PV TRANSACTIONS WITH ERRORS " << std::endl;
|
||||
iErrorFound=true;
|
||||
}
|
||||
cout << "------------------------------------------------------------" << endl;
|
||||
cout << "Element [" << i << "] of " << npv << " in group: " << name << endl;
|
||||
std::cout << "------------------------------------------------------------" << std::endl;
|
||||
std::cout << "Element [" << i << "] of " << npv << " in group: " << name << std::endl;
|
||||
pvdata[i].print();
|
||||
}
|
||||
}
|
||||
|
||||
2170
include/PVHolder.h
2170
include/PVHolder.h
File diff suppressed because it is too large
Load Diff
@@ -5,15 +5,15 @@
|
||||
#ifndef __PYX_HAVE_API__PyCafe
|
||||
|
||||
#ifndef __PYX_EXTERN_C
|
||||
#ifdef __cplusplus
|
||||
#define __PYX_EXTERN_C extern "C"
|
||||
#else
|
||||
#define __PYX_EXTERN_C extern
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
#define __PYX_EXTERN_C extern "C"
|
||||
#else
|
||||
#define __PYX_EXTERN_C extern
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef DL_IMPORT
|
||||
#define DL_IMPORT(_T) _T
|
||||
#define DL_IMPORT(_T) _T
|
||||
#endif
|
||||
|
||||
__PYX_EXTERN_C DL_IMPORT(void) py_cb_wrapper(PVDataHolder, unsigned int, std::string);
|
||||
|
||||
@@ -18,15 +18,16 @@ static void (*__pyx_api_f_6PyCafe_py_cb_handle_put_wrapper)(unsigned int) = 0;
|
||||
#define py_cb_handle_put_wrapper __pyx_api_f_6PyCafe_py_cb_handle_put_wrapper
|
||||
#if !defined(__Pyx_PyIdentifier_FromString)
|
||||
#if PY_MAJOR_VERSION < 3
|
||||
#define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
|
||||
#define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
|
||||
#else
|
||||
#define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
|
||||
#define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef __PYX_HAVE_RT_ImportModule
|
||||
#define __PYX_HAVE_RT_ImportModule
|
||||
static PyObject *__Pyx_ImportModule(const char *name) {
|
||||
static PyObject *__Pyx_ImportModule(const char *name)
|
||||
{
|
||||
PyObject *py_name = 0;
|
||||
PyObject *py_module = 0;
|
||||
py_name = __Pyx_PyIdentifier_FromString(name);
|
||||
@@ -43,7 +44,8 @@ bad:
|
||||
|
||||
#ifndef __PYX_HAVE_RT_ImportFunction
|
||||
#define __PYX_HAVE_RT_ImportFunction
|
||||
static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
|
||||
static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig)
|
||||
{
|
||||
PyObject *d = 0;
|
||||
PyObject *cobj = 0;
|
||||
union {
|
||||
@@ -56,32 +58,38 @@ static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**
|
||||
cobj = PyDict_GetItemString(d, funcname);
|
||||
if (!cobj) {
|
||||
PyErr_Format(PyExc_ImportError,
|
||||
"%.200s does not export expected C function %.200s",
|
||||
PyModule_GetName(module), funcname);
|
||||
"%.200s does not export expected C function %.200s",
|
||||
PyModule_GetName(module), funcname);
|
||||
goto bad;
|
||||
}
|
||||
#if PY_VERSION_HEX >= 0x02070000
|
||||
if (!PyCapsule_IsValid(cobj, sig)) {
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
|
||||
PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
|
||||
"C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
|
||||
PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
|
||||
goto bad;
|
||||
}
|
||||
tmp.p = PyCapsule_GetPointer(cobj, sig);
|
||||
#else
|
||||
{const char *desc, *s1, *s2;
|
||||
desc = (const char *)PyCObject_GetDesc(cobj);
|
||||
if (!desc)
|
||||
goto bad;
|
||||
s1 = desc; s2 = sig;
|
||||
while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
|
||||
if (*s1 != *s2) {
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
|
||||
PyModule_GetName(module), funcname, sig, desc);
|
||||
goto bad;
|
||||
{
|
||||
const char *desc, *s1, *s2;
|
||||
desc = (const char *)PyCObject_GetDesc(cobj);
|
||||
if (!desc)
|
||||
goto bad;
|
||||
s1 = desc;
|
||||
s2 = sig;
|
||||
while (*s1 != '\0' && *s1 == *s2) {
|
||||
s1++;
|
||||
s2++;
|
||||
}
|
||||
if (*s1 != *s2) {
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
|
||||
PyModule_GetName(module), funcname, sig, desc);
|
||||
goto bad;
|
||||
}
|
||||
tmp.p = PyCObject_AsVoidPtr(cobj);
|
||||
}
|
||||
tmp.p = PyCObject_AsVoidPtr(cobj);}
|
||||
#endif
|
||||
*f = tmp.fp;
|
||||
if (!(*f))
|
||||
@@ -95,21 +103,23 @@ bad:
|
||||
#endif
|
||||
|
||||
|
||||
static int import_PyCafe(void) {
|
||||
PyObject *module = 0;
|
||||
module = __Pyx_ImportModule("PyCafe");
|
||||
if (!module) goto bad;
|
||||
if (__Pyx_ImportFunction(module, "py_cb_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_wrapper, "void (PVDataHolder, unsigned int, std::string)") < 0) goto bad;
|
||||
if (__Pyx_ImportFunction(module, "py_cb_ctrl_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_ctrl_wrapper, "void (PVCtrlHolder, unsigned int, std::string)") < 0) goto bad;
|
||||
if (__Pyx_ImportFunction(module, "py_cb_handle_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_handle_wrapper, "void (unsigned int)") < 0) goto bad;
|
||||
if (__Pyx_ImportFunction(module, "py_cb_handle_monid_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_handle_monid_wrapper, "void (unsigned int, unsigned long)") < 0) goto bad;
|
||||
if (__Pyx_ImportFunction(module, "py_cb_handle_get_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_handle_get_wrapper, "void (unsigned int)") < 0) goto bad;
|
||||
if (__Pyx_ImportFunction(module, "py_cb_handle_put_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_handle_put_wrapper, "void (unsigned int)") < 0) goto bad;
|
||||
Py_DECREF(module); module = 0;
|
||||
return 0;
|
||||
bad:
|
||||
Py_XDECREF(module);
|
||||
return -1;
|
||||
static int import_PyCafe(void)
|
||||
{
|
||||
PyObject *module = 0;
|
||||
module = __Pyx_ImportModule("PyCafe");
|
||||
if (!module) goto bad;
|
||||
if (__Pyx_ImportFunction(module, "py_cb_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_wrapper, "void (PVDataHolder, unsigned int, std::string)") < 0) goto bad;
|
||||
if (__Pyx_ImportFunction(module, "py_cb_ctrl_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_ctrl_wrapper, "void (PVCtrlHolder, unsigned int, std::string)") < 0) goto bad;
|
||||
if (__Pyx_ImportFunction(module, "py_cb_handle_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_handle_wrapper, "void (unsigned int)") < 0) goto bad;
|
||||
if (__Pyx_ImportFunction(module, "py_cb_handle_monid_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_handle_monid_wrapper, "void (unsigned int, unsigned long)") < 0) goto bad;
|
||||
if (__Pyx_ImportFunction(module, "py_cb_handle_get_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_handle_get_wrapper, "void (unsigned int)") < 0) goto bad;
|
||||
if (__Pyx_ImportFunction(module, "py_cb_handle_put_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_handle_put_wrapper, "void (unsigned int)") < 0) goto bad;
|
||||
Py_DECREF(module);
|
||||
module = 0;
|
||||
return 0;
|
||||
bad:
|
||||
Py_XDECREF(module);
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif /* !__PYX_HAVE_API__PyCafe */
|
||||
|
||||
@@ -18,15 +18,16 @@ static void (*__pyx_api_f_6PyCafe_py_cb_handle_put_wrapper)(unsigned int) = 0;
|
||||
#define py_cb_handle_put_wrapper __pyx_api_f_6PyCafe_py_cb_handle_put_wrapper
|
||||
#if !defined(__Pyx_PyIdentifier_FromString)
|
||||
#if PY_MAJOR_VERSION < 3
|
||||
#define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
|
||||
#define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
|
||||
#else
|
||||
#define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
|
||||
#define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef __PYX_HAVE_RT_ImportModule
|
||||
#define __PYX_HAVE_RT_ImportModule
|
||||
static PyObject *__Pyx_ImportModule(const char *name) {
|
||||
static PyObject *__Pyx_ImportModule(const char *name)
|
||||
{
|
||||
PyObject *py_name = 0;
|
||||
PyObject *py_module = 0;
|
||||
py_name = __Pyx_PyIdentifier_FromString(name);
|
||||
@@ -43,7 +44,8 @@ bad:
|
||||
|
||||
#ifndef __PYX_HAVE_RT_ImportFunction
|
||||
#define __PYX_HAVE_RT_ImportFunction
|
||||
static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig) {
|
||||
static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig)
|
||||
{
|
||||
PyObject *d = 0;
|
||||
PyObject *cobj = 0;
|
||||
union {
|
||||
@@ -56,32 +58,38 @@ static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**
|
||||
cobj = PyDict_GetItemString(d, funcname);
|
||||
if (!cobj) {
|
||||
PyErr_Format(PyExc_ImportError,
|
||||
"%.200s does not export expected C function %.200s",
|
||||
PyModule_GetName(module), funcname);
|
||||
"%.200s does not export expected C function %.200s",
|
||||
PyModule_GetName(module), funcname);
|
||||
goto bad;
|
||||
}
|
||||
#if PY_VERSION_HEX >= 0x02070000
|
||||
if (!PyCapsule_IsValid(cobj, sig)) {
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
|
||||
PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
|
||||
"C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
|
||||
PyModule_GetName(module), funcname, sig, PyCapsule_GetName(cobj));
|
||||
goto bad;
|
||||
}
|
||||
tmp.p = PyCapsule_GetPointer(cobj, sig);
|
||||
#else
|
||||
{const char *desc, *s1, *s2;
|
||||
desc = (const char *)PyCObject_GetDesc(cobj);
|
||||
if (!desc)
|
||||
goto bad;
|
||||
s1 = desc; s2 = sig;
|
||||
while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
|
||||
if (*s1 != *s2) {
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
|
||||
PyModule_GetName(module), funcname, sig, desc);
|
||||
goto bad;
|
||||
{
|
||||
const char *desc, *s1, *s2;
|
||||
desc = (const char *)PyCObject_GetDesc(cobj);
|
||||
if (!desc)
|
||||
goto bad;
|
||||
s1 = desc;
|
||||
s2 = sig;
|
||||
while (*s1 != '\0' && *s1 == *s2) {
|
||||
s1++;
|
||||
s2++;
|
||||
}
|
||||
if (*s1 != *s2) {
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"C function %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
|
||||
PyModule_GetName(module), funcname, sig, desc);
|
||||
goto bad;
|
||||
}
|
||||
tmp.p = PyCObject_AsVoidPtr(cobj);
|
||||
}
|
||||
tmp.p = PyCObject_AsVoidPtr(cobj);}
|
||||
#endif
|
||||
*f = tmp.fp;
|
||||
if (!(*f))
|
||||
@@ -95,21 +103,23 @@ bad:
|
||||
#endif
|
||||
|
||||
|
||||
static int import_PyCafe(void) {
|
||||
PyObject *module = 0;
|
||||
module = __Pyx_ImportModule("PyCafe");
|
||||
if (!module) goto bad;
|
||||
if (__Pyx_ImportFunction(module, "py_cb_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_wrapper, "void (PVDataHolder, unsigned int, std::string)") < 0) goto bad;
|
||||
if (__Pyx_ImportFunction(module, "py_cb_ctrl_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_ctrl_wrapper, "void (PVCtrlHolder, unsigned int, std::string)") < 0) goto bad;
|
||||
if (__Pyx_ImportFunction(module, "py_cb_handle_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_handle_wrapper, "void (unsigned int)") < 0) goto bad;
|
||||
if (__Pyx_ImportFunction(module, "py_cb_handle_monid_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_handle_monid_wrapper, "void (unsigned int, unsigned long)") < 0) goto bad;
|
||||
if (__Pyx_ImportFunction(module, "py_cb_handle_get_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_handle_get_wrapper, "void (unsigned int)") < 0) goto bad;
|
||||
if (__Pyx_ImportFunction(module, "py_cb_handle_put_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_handle_put_wrapper, "void (unsigned int)") < 0) goto bad;
|
||||
Py_DECREF(module); module = 0;
|
||||
return 0;
|
||||
bad:
|
||||
Py_XDECREF(module);
|
||||
return -1;
|
||||
static int import_PyCafe(void)
|
||||
{
|
||||
PyObject *module = 0;
|
||||
module = __Pyx_ImportModule("PyCafe");
|
||||
if (!module) goto bad;
|
||||
if (__Pyx_ImportFunction(module, "py_cb_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_wrapper, "void (PVDataHolder, unsigned int, std::string)") < 0) goto bad;
|
||||
if (__Pyx_ImportFunction(module, "py_cb_ctrl_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_ctrl_wrapper, "void (PVCtrlHolder, unsigned int, std::string)") < 0) goto bad;
|
||||
if (__Pyx_ImportFunction(module, "py_cb_handle_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_handle_wrapper, "void (unsigned int)") < 0) goto bad;
|
||||
if (__Pyx_ImportFunction(module, "py_cb_handle_monid_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_handle_monid_wrapper, "void (unsigned int, unsigned long)") < 0) goto bad;
|
||||
if (__Pyx_ImportFunction(module, "py_cb_handle_get_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_handle_get_wrapper, "void (unsigned int)") < 0) goto bad;
|
||||
if (__Pyx_ImportFunction(module, "py_cb_handle_put_wrapper", (void (**)(void))&__pyx_api_f_6PyCafe_py_cb_handle_put_wrapper, "void (unsigned int)") < 0) goto bad;
|
||||
Py_DECREF(module);
|
||||
module = 0;
|
||||
return 0;
|
||||
bad:
|
||||
Py_XDECREF(module);
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif /* !__PYX_HAVE_API__PyCafe */
|
||||
|
||||
1482
include/cafe.h
1482
include/cafe.h
File diff suppressed because it is too large
Load Diff
@@ -9,6 +9,9 @@
|
||||
#ifndef CAFECACHE_H
|
||||
#define CAFECACHE_H
|
||||
|
||||
|
||||
//No longer required - get from TS
|
||||
/*
|
||||
int getPulseID(unsigned int * handle, unsigned int nelem, unsigned int * pulseID) {
|
||||
int status=ICAFE_NORMAL; int statusLocal=ICAFE_NORMAL;
|
||||
for (unsigned int i=0; i<nelem; ++i) {
|
||||
@@ -35,8 +38,8 @@ unsigned int getPulseIDFromTS(epicsTimeStamp ts) {
|
||||
return handleHelper.getPulseIDFromTS(ts);
|
||||
}
|
||||
|
||||
vector<unsigned int>getPulseIDFromTS(PVDataHolder * pvd, unsigned int nelem) {
|
||||
vector<unsigned int> vui;
|
||||
std::vector<unsigned int>getPulseIDFromTS(PVDataHolder * pvd, unsigned int nelem) {
|
||||
std::vector<unsigned int> vui;
|
||||
vui.clear();
|
||||
vui.reserve(nelem);
|
||||
for (unsigned int i=0; i<nelem; ++i) {
|
||||
@@ -45,8 +48,8 @@ vector<unsigned int>getPulseIDFromTS(PVDataHolder * pvd, unsigned int nelem) {
|
||||
return vui;
|
||||
}
|
||||
|
||||
vector<unsigned int>getPulseIDFromTS(PVGroup pvg) {
|
||||
vector<unsigned int> vui;
|
||||
std::vector<unsigned int>getPulseIDFromTS(PVGroup pvg) {
|
||||
std::vector<unsigned int> vui;
|
||||
vui.clear();
|
||||
vui.reserve(pvg.getNPV());
|
||||
PVDataHolder * pvd=pvg.getPVData();
|
||||
@@ -55,9 +58,10 @@ vector<unsigned int>getPulseIDFromTS(PVGroup pvg) {
|
||||
}
|
||||
return vui;
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
int getCachePVArray (vector<unsigned int> handleV, PVDataHolder * pvd){
|
||||
int getCachePVArray (std::vector<unsigned int> handleV, PVDataHolder * pvd){
|
||||
unsigned int * handleArray = new unsigned int [handleV.size()];
|
||||
for (size_t i=0; i< (size_t) handleV.size(); ++i) {handleArray[i]= (unsigned int) handleV[i];}
|
||||
status=getCache(handleArray, (unsigned int) handleV.size(), pvd);
|
||||
@@ -66,29 +70,35 @@ int getCachePVArray (vector<unsigned int> handleV, PVDataHolder * pvd){
|
||||
*/
|
||||
|
||||
|
||||
int getCachePVArray (vector<unsigned int> handleV, PVDataHolder * pvd){
|
||||
return getCache(&handleV[0], (unsigned int) handleV.size(), pvd);
|
||||
int getCachePVArray (std::vector<unsigned int> handleV, PVDataHolder * pvd)
|
||||
{
|
||||
return getCache(&handleV[0], (unsigned int) handleV.size(), pvd);
|
||||
};
|
||||
|
||||
int getCachePVArrayNoWait (vector<unsigned int> handleV, PVDataHolder * pvd){
|
||||
|
||||
int overallStatus=ICAFE_NORMAL;
|
||||
for (size_t i=0; i< (size_t) handleV.size(); ++i) {
|
||||
status=getCacheNoWait(handleV[i], pvd[i]);
|
||||
//cout << "handle= " << handleV[i] << " pvFromHandle= " << CAFE::getPVFromHandle(handleV[i]) << " status= " << pvd[i].getStatus() << " val= " << pvd[i].getAsString() << endl;
|
||||
if (status!=ICAFE_NORMAL) {
|
||||
resetCallbackGet(handleV[i]);
|
||||
if(overallStatus==ICAFE_NORMAL) {overallStatus=status;}
|
||||
}
|
||||
if (pvd[i].getStatus() !=ICAFE_NORMAL) {
|
||||
if(overallStatus==ICAFE_NORMAL) {overallStatus=pvd[i].getStatus();}
|
||||
}
|
||||
}
|
||||
return overallStatus;
|
||||
int getCachePVArrayNoWait (std::vector<unsigned int> handleV, PVDataHolder * pvd)
|
||||
{
|
||||
|
||||
int overallStatus=ICAFE_NORMAL;
|
||||
for (size_t i=0; i< (size_t) handleV.size(); ++i) {
|
||||
status=getCacheNoWait(handleV[i], pvd[i]);
|
||||
//cout << "handle= " << handleV[i] << " pvFromHandle= " << CAFE::getPVFromHandle(handleV[i]) << " status= " << pvd[i].getStatus() << " val= " << pvd[i].getAsString() << endl;
|
||||
if (status!=ICAFE_NORMAL) {
|
||||
resetCallbackGet(handleV[i]);
|
||||
if(overallStatus==ICAFE_NORMAL) {
|
||||
overallStatus=status;
|
||||
}
|
||||
}
|
||||
if (pvd[i].getStatus() !=ICAFE_NORMAL) {
|
||||
if(overallStatus==ICAFE_NORMAL) {
|
||||
overallStatus=pvd[i].getStatus();
|
||||
}
|
||||
}
|
||||
}
|
||||
return overallStatus;
|
||||
};
|
||||
|
||||
/*
|
||||
int getCachePVArrayNoWait (vector<unsigned int> handleV, PVDataHolder * pvd){
|
||||
int getCachePVArrayNoWait (std::vector<unsigned int> handleV, PVDataHolder * pvd){
|
||||
unsigned int * handleArray = new unsigned int [handleV.size()];
|
||||
int overallStatus=ICAFE_NORMAL;
|
||||
for (size_t i=0; i< (size_t) handleV.size(); ++i) {handleArray[i]= (unsigned int) handleV[i];
|
||||
@@ -107,28 +117,41 @@ int resetCallbackPut(const unsigned int handle);
|
||||
|
||||
int getCacheNoWait(const unsigned int handle, PVDataHolder & pvd);
|
||||
|
||||
int getCacheFromPulseID (const unsigned int handle, const unsigned long long globalPulseID, PVDataHolder & pvd);
|
||||
|
||||
int getCache (const unsigned int handle, PVDataHolder & pvd);
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, PVDataHolder * pvd);
|
||||
|
||||
int getCtrlCache (const unsigned int handle, PVCtrlHolder & pvc);
|
||||
int getCtrlCache (const unsigned int *handleArray, unsigned int nelem, PVCtrlHolder * pvc);
|
||||
|
||||
int getCache (const char * pv, PVDataHolder & pvd) {
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv); return getCache(handle, pvd);}
|
||||
int getCtrlCache (const char * pv, PVCtrlHolder & pvc) {
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv); return getCtrlCache(handle, pvc);}
|
||||
int getCache (const char * pv, PVDataHolder & pvd)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return getCache(handle, pvd);
|
||||
}
|
||||
|
||||
int getCtrlCache (const char * pv, PVCtrlHolder & pvc)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return getCtrlCache(handle, pvc);
|
||||
}
|
||||
|
||||
//6
|
||||
int getCacheDoubleArray(const unsigned int handle, dbr_double_t * _val) {
|
||||
int getCacheDoubleArray(const unsigned int handle, dbr_double_t * _val)
|
||||
{
|
||||
return cafeDoppio.getCache(handle, DBR_DOUBLE, _val);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_double_t * _val) {
|
||||
int getCache(const unsigned int handle, dbr_double_t * _val)
|
||||
{
|
||||
return cafeDoppio.getCache(handle, DBR_DOUBLE, _val);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_double_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const unsigned int handle, dbr_double_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
return cafeDoppio.getCache(handle, DBR_STS_DOUBLE, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_double_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const unsigned int handle, dbr_double_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
return cafeDoppio.getCache(handle, DBR_TIME_DOUBLE, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
//5+ long long
|
||||
@@ -137,278 +160,370 @@ int getCache(const unsigned int handle, long long * _val, dbr_short_t &alarmS
|
||||
int getCache(const unsigned int handle, long long * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);
|
||||
|
||||
//5
|
||||
int getCacheLongArray(const unsigned int handle, dbr_long_t * _val) {
|
||||
int getCacheLongArray(const unsigned int handle, dbr_long_t * _val)
|
||||
{
|
||||
return cafeLatte.getCache(handle, DBR_LONG, _val);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_long_t * _val) {
|
||||
int getCache(const unsigned int handle, dbr_long_t * _val)
|
||||
{
|
||||
return cafeLatte.getCache(handle, DBR_LONG, _val);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_long_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const unsigned int handle, dbr_long_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
return cafeLatte.getCache(handle, DBR_STS_LONG, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_long_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const unsigned int handle, dbr_long_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
return cafeLatte.getCache(handle, DBR_TIME_LONG, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
//4
|
||||
int getCache(const unsigned int handle, dbr_char_t * _val) {
|
||||
int getCache(const unsigned int handle, dbr_char_t * _val)
|
||||
{
|
||||
return cafeCappuccino.getCache(handle, DBR_CHAR, _val);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_char_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const unsigned int handle, dbr_char_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
return cafeCappuccino.getCache(handle, DBR_STS_ENUM, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_char_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const unsigned int handle, dbr_char_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
return cafeCappuccino.getCache(handle, DBR_TIME_ENUM, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
//3
|
||||
int getCache(const unsigned int handle, dbr_enum_t * _val) {
|
||||
int getCache(const unsigned int handle, dbr_enum_t * _val)
|
||||
{
|
||||
return cafeEspresso.getCache(handle, DBR_ENUM, _val);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_enum_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const unsigned int handle, dbr_enum_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
return cafeEspresso.getCache(handle, DBR_STS_ENUM, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_enum_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const unsigned int handle, dbr_enum_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
return cafeEspresso.getCache(handle, DBR_TIME_ENUM, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
//2
|
||||
int getCacheFloatArray(const unsigned int handle, dbr_float_t * _val) {
|
||||
int getCacheFloatArray(const unsigned int handle, dbr_float_t * _val)
|
||||
{
|
||||
return cafeFrappuccino.getCache(handle, DBR_FLOAT, _val);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_float_t * _val) {
|
||||
int getCache(const unsigned int handle, dbr_float_t * _val)
|
||||
{
|
||||
return cafeFrappuccino.getCache(handle, DBR_FLOAT, _val);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_float_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const unsigned int handle, dbr_float_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
return cafeFrappuccino.getCache(handle, DBR_STS_FLOAT, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_float_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const unsigned int handle, dbr_float_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
return cafeFrappuccino.getCache(handle, DBR_TIME_FLOAT, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
//1
|
||||
int getCacheShortArray(const unsigned int handle, dbr_short_t * _val) {
|
||||
return cafeSchale.getCache(handle, DBR_SHORT, _val);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_short_t * _val) {
|
||||
int getCacheShortArray(const unsigned int handle, dbr_short_t * _val)
|
||||
{
|
||||
return cafeSchale.getCache(handle, DBR_SHORT, _val);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_short_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const unsigned int handle, dbr_short_t * _val)
|
||||
{
|
||||
return cafeSchale.getCache(handle, DBR_SHORT, _val);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_short_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
return cafeSchale.getCache(handle, DBR_STS_SHORT, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_short_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const unsigned int handle, dbr_short_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
return cafeSchale.getCache(handle, DBR_TIME_SHORT, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
int getCacheDbrStringArray(const unsigned int handle, dbr_string_t * _val){
|
||||
return cafeSoluble.getCache(handle, DBR_STRING, _val);
|
||||
int getCacheDbrStringArray(const unsigned int handle, dbr_string_t * _val)
|
||||
{
|
||||
return cafeSoluble.getCache(handle, DBR_STRING, _val);
|
||||
};
|
||||
|
||||
//0
|
||||
int getCache(const unsigned int handle, dbr_string_t * _val) {
|
||||
int getCache(const unsigned int handle, dbr_string_t * _val)
|
||||
{
|
||||
return cafeSoluble.getCache(handle, DBR_STRING, _val);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_string_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const unsigned int handle, dbr_string_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
return cafeSoluble.getCache(handle, DBR_STS_STRING, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_string_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const unsigned int handle, dbr_string_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
return cafeSoluble.getCache(handle, DBR_TIME_STRING, _val, alarmStatus, alarmSeverity, ts);
|
||||
}
|
||||
//0+
|
||||
int getCacheStringArray(const unsigned int handle, string * valStr) {
|
||||
int getCacheStringArray(const unsigned int handle, std::string * valStr)
|
||||
{
|
||||
dbr_string_t * _val = new dbr_string_t[handleHelper.getNelemRequest(handle)];
|
||||
status=cafeSoluble.getCache(handle, DBR_STRING, _val);
|
||||
for (unsigned int i=0; i< handleHelper.getNelemRequest(handle); ++i) { valStr[i]=_val[i]; }
|
||||
delete [] _val; return status;
|
||||
for (unsigned int i=0; i< handleHelper.getNelemRequest(handle); ++i) {
|
||||
valStr[i]=_val[i];
|
||||
}
|
||||
delete [] _val;
|
||||
return status;
|
||||
};
|
||||
int getCache(const unsigned int handle, string * valStr) {
|
||||
int getCache(const unsigned int handle, std::string * valStr)
|
||||
{
|
||||
dbr_string_t * _val = new dbr_string_t[handleHelper.getNelemRequest(handle)];
|
||||
status=cafeSoluble.getCache(handle, DBR_STRING, _val);
|
||||
for (unsigned int i=0; i< handleHelper.getNelemRequest(handle); ++i) { valStr[i]=_val[i]; }
|
||||
delete [] _val; return status;
|
||||
for (unsigned int i=0; i< handleHelper.getNelemRequest(handle); ++i) {
|
||||
valStr[i]=_val[i];
|
||||
}
|
||||
delete [] _val;
|
||||
return status;
|
||||
};
|
||||
int getCache(const unsigned int handle, string * valStr, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const unsigned int handle, std::string * valStr, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
dbr_string_t * _val = new dbr_string_t[handleHelper.getNelemRequest(handle)];
|
||||
status=cafeSoluble.getCache(handle, DBR_STS_STRING, _val, alarmStatus, alarmSeverity);
|
||||
for (unsigned int i=0; i< handleHelper.getNelemRequest(handle); ++i) { valStr[i]=_val[i]; }
|
||||
delete [] _val; return status;
|
||||
for (unsigned int i=0; i< handleHelper.getNelemRequest(handle); ++i) {
|
||||
valStr[i]=_val[i];
|
||||
}
|
||||
delete [] _val;
|
||||
return status;
|
||||
};
|
||||
int getCache(const unsigned int handle, string * valStr, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const unsigned int handle, std::string * valStr, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
dbr_string_t * _val = new dbr_string_t[handleHelper.getNelemRequest(handle)];
|
||||
status=cafeSoluble.getCache(handle, DBR_TIME_STRING, _val, alarmStatus, alarmSeverity, ts);
|
||||
for (unsigned int i=0; i< handleHelper.getNelemRequest(handle); ++i) { valStr[i]=_val[i]; }
|
||||
delete [] _val; return status;
|
||||
for (unsigned int i=0; i< handleHelper.getNelemRequest(handle); ++i) {
|
||||
valStr[i]=_val[i];
|
||||
}
|
||||
delete [] _val;
|
||||
return status;
|
||||
}
|
||||
//Single value
|
||||
//0+
|
||||
int getCacheString(const unsigned int handle, string & valStr){ //0
|
||||
unsigned int nelemPrevious=CAFE::setNelemToRetrieveFromCacheToOne(handle); dbr_string_t val[1]={""};
|
||||
status=cafeSoluble.getCache(handle, DBR_STRING, val);
|
||||
if (status==ICAFE_NORMAL) {valStr=val[0];} CAFE::setNelemToRetrieveFromCacheToPrevious(handle, nelemPrevious);
|
||||
return status;
|
||||
int getCacheString(const unsigned int handle, std::string & valStr) //0
|
||||
{
|
||||
unsigned int nelemPrevious=CAFE::setNelemToRetrieveFromCacheToOne(handle);
|
||||
dbr_string_t val[1]= {""};
|
||||
status=cafeSoluble.getCache(handle, DBR_STRING, val);
|
||||
if (status==ICAFE_NORMAL) {
|
||||
valStr=val[0];
|
||||
}
|
||||
CAFE::setNelemToRetrieveFromCacheToPrevious(handle, nelemPrevious);
|
||||
return status;
|
||||
}
|
||||
|
||||
int getCache(const unsigned int handle, string & valStr){ //0
|
||||
unsigned int nelemPrevious=CAFE::setNelemToRetrieveFromCacheToOne(handle); dbr_string_t val[1]={""};
|
||||
int getCache(const unsigned int handle, std::string & valStr) //0
|
||||
{
|
||||
unsigned int nelemPrevious=CAFE::setNelemToRetrieveFromCacheToOne(handle);
|
||||
dbr_string_t val[1]= {""};
|
||||
status=cafeSoluble.getCache(handle, DBR_STRING, val);
|
||||
if (status==ICAFE_NORMAL) {valStr=val[0];} CAFE::setNelemToRetrieveFromCacheToPrevious(handle, nelemPrevious);
|
||||
if (status==ICAFE_NORMAL) {
|
||||
valStr=val[0];
|
||||
}
|
||||
CAFE::setNelemToRetrieveFromCacheToPrevious(handle, nelemPrevious);
|
||||
return status;
|
||||
}
|
||||
int getCache(const unsigned int handle, string & valStr, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity){ //0
|
||||
unsigned int nelemPrevious=CAFE::setNelemToRetrieveFromCacheToOne(handle); dbr_string_t val[1]={""};
|
||||
int getCache(const unsigned int handle, std::string & valStr, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) //0
|
||||
{
|
||||
unsigned int nelemPrevious=CAFE::setNelemToRetrieveFromCacheToOne(handle);
|
||||
dbr_string_t val[1]= {""};
|
||||
status=cafeSoluble.getCache(handle, DBR_STS_STRING, val, alarmStatus, alarmSeverity);
|
||||
if (status==ICAFE_NORMAL) {valStr=val[0];} CAFE::setNelemToRetrieveFromCacheToPrevious(handle, nelemPrevious);
|
||||
if (status==ICAFE_NORMAL) {
|
||||
valStr=val[0];
|
||||
}
|
||||
CAFE::setNelemToRetrieveFromCacheToPrevious(handle, nelemPrevious);
|
||||
return status;
|
||||
}
|
||||
int getCache(const unsigned int handle, string & valStr,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts){ //0
|
||||
unsigned int nelemPrevious=CAFE::setNelemToRetrieveFromCacheToOne(handle); dbr_string_t val[1]={""};
|
||||
int getCache(const unsigned int handle, std::string & valStr,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) //0
|
||||
{
|
||||
unsigned int nelemPrevious=CAFE::setNelemToRetrieveFromCacheToOne(handle);
|
||||
dbr_string_t val[1]= {""};
|
||||
status=cafeSoluble.getCache(handle, DBR_TIME_STRING, val, alarmStatus, alarmSeverity, ts);
|
||||
if (status==ICAFE_NORMAL) {valStr=val[0];} CAFE::setNelemToRetrieveFromCacheToPrevious(handle, nelemPrevious);
|
||||
if (status==ICAFE_NORMAL) {
|
||||
valStr=val[0];
|
||||
}
|
||||
CAFE::setNelemToRetrieveFromCacheToPrevious(handle, nelemPrevious);
|
||||
return status;
|
||||
}
|
||||
int getCache(const unsigned int handle, dbr_string_t & val); //0
|
||||
int getCache(const unsigned int handle, dbr_string_t & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //0
|
||||
int getCache(const unsigned int handle, dbr_string_t & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //0
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //0
|
||||
int getCache(const unsigned int handle, dbr_short_t & val); //1
|
||||
int getCache(const unsigned int handle, dbr_short_t & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //1
|
||||
int getCache(const unsigned int handle, dbr_short_t & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //1
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //1
|
||||
int getCache(const unsigned int handle, dbr_float_t & val); //2
|
||||
int getCache(const unsigned int handle, dbr_float_t & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //2
|
||||
int getCache(const unsigned int handle, dbr_float_t & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //2
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //2
|
||||
int getCache(const unsigned int handle, dbr_enum_t & val); //3
|
||||
int getCache(const unsigned int handle, dbr_enum_t & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //3
|
||||
int getCache(const unsigned int handle, dbr_enum_t & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //3
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //3
|
||||
int getCache(const unsigned int handle, dbr_char_t & val); //4
|
||||
int getCache(const unsigned int handle, dbr_char_t & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //4
|
||||
int getCache(const unsigned int handle, dbr_char_t & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //4
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //4
|
||||
|
||||
int getCacheLong(const unsigned int handle, dbr_long_t & val) { return getCache(handle, val);}
|
||||
int getCacheLong(const unsigned int handle, dbr_long_t & val)
|
||||
{
|
||||
return getCache(handle, val);
|
||||
}
|
||||
|
||||
int getCache(const unsigned int handle, dbr_long_t & val); //5
|
||||
int getCache(const unsigned int handle, dbr_long_t & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //5
|
||||
int getCache(const unsigned int handle, dbr_long_t & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //5
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //5
|
||||
int getCache(const unsigned int handle, long long & val); //5+
|
||||
int getCache(const unsigned int handle, long long & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //5+
|
||||
int getCache(const unsigned int handle, long long & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //5+
|
||||
int getCacheDouble(const unsigned int handle, dbr_double_t & val) {
|
||||
return getCache(handle, val);
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //5+
|
||||
int getCacheDouble(const unsigned int handle, dbr_double_t & val)
|
||||
{
|
||||
return getCache(handle, val);
|
||||
}
|
||||
|
||||
int getCache(const unsigned int handle, dbr_double_t & val); //6
|
||||
int getCache(const unsigned int handle, dbr_double_t & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //6
|
||||
int getCache(const unsigned int handle, dbr_double_t & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //6
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //6
|
||||
|
||||
|
||||
//getCache by array of handles
|
||||
//0+
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, string * valStr, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts) {
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, std::string * valStr, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts)
|
||||
{
|
||||
dbr_string_t * val = new dbr_string_t[nelem];
|
||||
status=cafeSoluble.getCache(handleArray, nelem, DBR_TIME_STRING, val, statusArray,
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
for (unsigned int i=0; i< nelem; ++i) { valStr[i]=val[i]; }
|
||||
delete [] val; return status;
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
for (unsigned int i=0; i< nelem; ++i) {
|
||||
valStr[i]=val[i];
|
||||
}
|
||||
delete [] val;
|
||||
return status;
|
||||
};
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, string * valStr, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity) {
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, std::string * valStr, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity)
|
||||
{
|
||||
dbr_string_t * val = new dbr_string_t[nelem];
|
||||
status=cafeSoluble.getCache(handleArray, nelem, DBR_STS_STRING, val, statusArray,
|
||||
alarmStatus, alarmSeverity);
|
||||
for (unsigned int i=0; i< nelem; ++i) { valStr[i]=val[i]; }
|
||||
delete [] val; return status;
|
||||
alarmStatus, alarmSeverity);
|
||||
for (unsigned int i=0; i< nelem; ++i) {
|
||||
valStr[i]=val[i];
|
||||
}
|
||||
delete [] val;
|
||||
return status;
|
||||
};
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, string * valStr, int *statusArray) {
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, std::string * valStr, int *statusArray)
|
||||
{
|
||||
dbr_string_t * val = new dbr_string_t[nelem];
|
||||
status=cafeSoluble.getCache(handleArray, nelem, DBR_STRING, val, statusArray);
|
||||
for (unsigned int i=0; i< nelem; ++i) { valStr[i]=val[i]; }
|
||||
delete [] val; return status;
|
||||
for (unsigned int i=0; i< nelem; ++i) {
|
||||
valStr[i]=val[i];
|
||||
}
|
||||
delete [] val;
|
||||
return status;
|
||||
}
|
||||
//0
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, dbr_string_t * val, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts)
|
||||
{
|
||||
return cafeSoluble.getCache(handleArray, nelem, DBR_TIME_STRING, val, statusArray,
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, dbr_string_t * val, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity)
|
||||
{
|
||||
return cafeSoluble.getCache(handleArray, nelem, DBR_STS_STRING, val, statusArray,
|
||||
alarmStatus, alarmSeverity);
|
||||
alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, dbr_string_t * val, int *statusArray) {
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, dbr_string_t * val, int *statusArray)
|
||||
{
|
||||
return cafeSoluble.getCache(handleArray, nelem, DBR_STRING, val, statusArray);
|
||||
}
|
||||
//1
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, dbr_short_t * val, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts)
|
||||
{
|
||||
return cafeSchale.getCache(handleArray, nelem, DBR_TIME_SHORT, val, statusArray,
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, dbr_short_t * val, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity)
|
||||
{
|
||||
return cafeSchale.getCache(handleArray, nelem, DBR_STS_SHORT, val, statusArray,
|
||||
alarmStatus, alarmSeverity);
|
||||
alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, dbr_short_t * val, int *statusArray) {
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, dbr_short_t * val, int *statusArray)
|
||||
{
|
||||
return cafeSchale.getCache(handleArray, nelem, DBR_SHORT, val, statusArray);
|
||||
}
|
||||
//2
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, dbr_float_t * val, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts)
|
||||
{
|
||||
return cafeFrappuccino.getCache(handleArray, nelem, DBR_TIME_FLOAT, val, statusArray,
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, dbr_float_t * val, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity)
|
||||
{
|
||||
return cafeFrappuccino.getCache(handleArray, nelem, DBR_STS_FLOAT, val, statusArray,
|
||||
alarmStatus, alarmSeverity);
|
||||
alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, dbr_float_t * val, int *statusArray) {
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, dbr_float_t * val, int *statusArray)
|
||||
{
|
||||
return cafeFrappuccino.getCache(handleArray, nelem, DBR_FLOAT, val, statusArray);
|
||||
}
|
||||
//3
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, dbr_ushort_t * val, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts)
|
||||
{
|
||||
return cafeEspresso.getCache(handleArray, nelem, DBR_TIME_ENUM, val, statusArray,
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, dbr_ushort_t * val, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity)
|
||||
{
|
||||
return cafeEspresso.getCache(handleArray, nelem, DBR_STS_ENUM, val, statusArray,
|
||||
alarmStatus, alarmSeverity);
|
||||
alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, dbr_ushort_t * val, int *statusArray) {
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, dbr_ushort_t * val, int *statusArray)
|
||||
{
|
||||
return cafeEspresso.getCache(handleArray, nelem, DBR_ENUM, val, statusArray);
|
||||
}
|
||||
//4
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, dbr_char_t * val, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts)
|
||||
{
|
||||
return cafeCappuccino.getCache(handleArray, nelem, DBR_TIME_CHAR, val, statusArray,
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, dbr_char_t * val, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity)
|
||||
{
|
||||
return cafeCappuccino.getCache(handleArray, nelem, DBR_STS_CHAR, val, statusArray,
|
||||
alarmStatus, alarmSeverity);
|
||||
alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, dbr_char_t * val, int *statusArray) {
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, dbr_char_t * val, int *statusArray)
|
||||
{
|
||||
return cafeCappuccino.getCache(handleArray, nelem, DBR_CHAR, val, statusArray);
|
||||
}
|
||||
//5
|
||||
int getCache(unsigned int *handleArray, unsigned int nelem, dbr_long_t * val, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts)
|
||||
{
|
||||
return cafeLatte.getCache(handleArray, nelem, DBR_TIME_LONG, val, statusArray,
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, dbr_long_t * val, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity)
|
||||
{
|
||||
return cafeLatte.getCache(handleArray, nelem, DBR_STS_LONG, val, statusArray,
|
||||
alarmStatus, alarmSeverity);
|
||||
alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, dbr_long_t * val, int *statusArray) {
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, dbr_long_t * val, int *statusArray)
|
||||
{
|
||||
return cafeLatte.getCache(handleArray, nelem, DBR_LONG, val, statusArray);
|
||||
}
|
||||
//5+ long long
|
||||
@@ -421,195 +536,237 @@ int getCache(const unsigned int *handleArray, unsigned int nelem, long long
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, long long * val, int *statusArray);
|
||||
//6
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, dbr_double_t * val, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts)
|
||||
{
|
||||
return cafeDoppio.getCache(handleArray, nelem, DBR_TIME_DOUBLE, val, statusArray,
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, dbr_double_t * val, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity)
|
||||
{
|
||||
return cafeDoppio.getCache(handleArray, nelem, DBR_STS_DOUBLE, val, statusArray,
|
||||
alarmStatus, alarmSeverity);
|
||||
alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, dbr_double_t * val, int *statusArray) {
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, dbr_double_t * val, int *statusArray)
|
||||
{
|
||||
return cafeDoppio.getCache(handleArray, nelem, DBR_DOUBLE, val, statusArray);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////// by PV name ///////////////////////////////////
|
||||
|
||||
int getCache(const char * pv, string & valStr); //0+
|
||||
int getCache(const char * pv, string & valStr, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //0+
|
||||
int getCache(const char * pv, string & valStr,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //0+
|
||||
int getCache(const char * pv, std::string & valStr); //0+
|
||||
int getCache(const char * pv, std::string & valStr, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //0+
|
||||
int getCache(const char * pv, std::string & valStr,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //0+
|
||||
int getCache(const char * pv, dbr_string_t & val); //0
|
||||
int getCache(const char * pv, dbr_string_t & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //0
|
||||
int getCache(const char * pv, dbr_string_t & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //0
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //0
|
||||
int getCache(const char * pv, dbr_short_t & val); //1
|
||||
int getCache(const char * pv, dbr_short_t & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //1
|
||||
int getCache(const char * pv, dbr_short_t & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //1
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //1
|
||||
int getCache(const char * pv, dbr_float_t & val); //2
|
||||
int getCache(const char * pv, dbr_float_t & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //2
|
||||
int getCache(const char * pv, dbr_float_t & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //2
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //2
|
||||
int getCache(const char * pv, dbr_enum_t & val); //3
|
||||
int getCache(const char * pv, dbr_enum_t & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //3
|
||||
int getCache(const char * pv, dbr_enum_t & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //3
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //3
|
||||
int getCache(const char * pv, dbr_char_t & val); //4
|
||||
int getCache(const char * pv, dbr_char_t & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //4
|
||||
int getCache(const char * pv, dbr_char_t & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //4
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //4
|
||||
int getCache(const char * pv, dbr_long_t & val); //5
|
||||
int getCache(const char * pv, dbr_long_t & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //5
|
||||
int getCache(const char * pv, dbr_long_t & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //5
|
||||
int getCache(const char * pv, long long & val){ //5+
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //5
|
||||
int getCache(const char * pv, long long & val) //5+
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return CAFE::getCache(handle, val);
|
||||
}
|
||||
int getCache(const char * pv, long long & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity){ //5+
|
||||
int getCache(const char * pv, long long & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) //5+
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return CAFE::getCache(handle, val, alarmStatus, alarmSeverity);
|
||||
}
|
||||
int getCache(const char * pv, long long & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts){ //5+
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) //5+
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return CAFE::getCache(handle, val, alarmStatus, alarmSeverity, ts);
|
||||
}
|
||||
int getCache(const char * pv, dbr_double_t & val); //6
|
||||
int getCache(const char * pv, dbr_double_t & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //6
|
||||
int getCache(const char * pv, dbr_double_t & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //6
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //6
|
||||
|
||||
|
||||
//6
|
||||
int getCache(const char * pv, dbr_double_t * _val) {
|
||||
int getCache(const char * pv, dbr_double_t * _val)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeDoppio.getCache(handle, DBR_DOUBLE, _val);
|
||||
};
|
||||
int getCache(const char * pv, dbr_double_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const char * pv, dbr_double_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeDoppio.getCache(handle, DBR_STS_DOUBLE, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const char * pv, dbr_double_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const char * pv, dbr_double_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeDoppio.getCache(handle, DBR_TIME_DOUBLE, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
|
||||
//5+
|
||||
int getCache(const char * pv, long long * _val) {
|
||||
int getCache(const char * pv, long long * _val)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return CAFE::getCache(handle, _val);
|
||||
};
|
||||
int getCache(const char * pv, long long * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const char * pv, long long * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return CAFE::getCache(handle, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const char * pv, long long * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const char * pv, long long * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return CAFE::getCache(handle, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
|
||||
//5
|
||||
int getCache(const char * pv, dbr_long_t * _val) {
|
||||
int getCache(const char * pv, dbr_long_t * _val)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeLatte.getCache(handle, DBR_LONG, _val);
|
||||
};
|
||||
int getCache(const char * pv, dbr_long_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const char * pv, dbr_long_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeLatte.getCache(handle, DBR_STS_LONG, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const char * pv, dbr_long_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const char * pv, dbr_long_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeLatte.getCache(handle, DBR_TIME_LONG, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
//4
|
||||
int getCache(const char * pv, dbr_char_t * _val) {
|
||||
int getCache(const char * pv, dbr_char_t * _val)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeCappuccino.getCache(handle, DBR_CHAR, _val);
|
||||
};
|
||||
int getCache(const char * pv, dbr_char_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const char * pv, dbr_char_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeCappuccino.getCache(handle, DBR_STS_ENUM, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const char * pv, dbr_char_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const char * pv, dbr_char_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeCappuccino.getCache(handle, DBR_TIME_ENUM, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
//3
|
||||
int getCache(const char * pv, dbr_enum_t * _val) {
|
||||
int getCache(const char * pv, dbr_enum_t * _val)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeEspresso.getCache(handle, DBR_ENUM, _val);
|
||||
};
|
||||
int getCache(const char * pv, dbr_enum_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const char * pv, dbr_enum_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeEspresso.getCache(handle, DBR_STS_ENUM, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const char * pv, dbr_enum_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const char * pv, dbr_enum_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeEspresso.getCache(handle, DBR_TIME_ENUM, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
//2
|
||||
int getCache(const char * pv, dbr_float_t * _val) {
|
||||
int getCache(const char * pv, dbr_float_t * _val)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeFrappuccino.getCache(handle, DBR_FLOAT, _val);
|
||||
};
|
||||
int getCache(const char * pv, dbr_float_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const char * pv, dbr_float_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeFrappuccino.getCache(handle, DBR_STS_FLOAT, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const char * pv, dbr_float_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const char * pv, dbr_float_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeFrappuccino.getCache(handle, DBR_TIME_FLOAT, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
//1
|
||||
int getCache(const char * pv, dbr_short_t * _val) {
|
||||
int getCache(const char * pv, dbr_short_t * _val)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeSchale.getCache(handle, DBR_SHORT, _val);
|
||||
};
|
||||
int getCache(const char * pv, dbr_short_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const char * pv, dbr_short_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeSchale.getCache(handle, DBR_STS_SHORT, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const char * pv, dbr_short_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const char * pv, dbr_short_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeSchale.getCache(handle, DBR_TIME_SHORT, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
//0
|
||||
int getCache(const char * pv, dbr_string_t * _val) {
|
||||
int getCache(const char * pv, dbr_string_t * _val)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeSoluble.getCache(handle, DBR_STRING, _val);
|
||||
};
|
||||
int getCache(const char * pv, dbr_string_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const char * pv, dbr_string_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeSoluble.getCache(handle, DBR_STS_STRING, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const char * pv, dbr_string_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const char * pv, dbr_string_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeSoluble.getCache(handle, DBR_TIME_STRING, _val, alarmStatus, alarmSeverity, ts);
|
||||
}
|
||||
//0+
|
||||
int getCache(const char * pv, string * valStr) {
|
||||
int getCache(const char * pv, std::string * valStr)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
dbr_string_t * _val = new dbr_string_t[handleHelper.getNelemRequest(handle)];
|
||||
status=cafeSoluble.getCache(handle, DBR_STRING, _val);
|
||||
for (unsigned int i=0; i< handleHelper.getNelemRequest(handle); ++i) { valStr[i]=_val[i]; }
|
||||
delete [] _val; return status;
|
||||
for (unsigned int i=0; i< handleHelper.getNelemRequest(handle); ++i) {
|
||||
valStr[i]=_val[i];
|
||||
}
|
||||
delete [] _val;
|
||||
return status;
|
||||
};
|
||||
int getCache(const char * pv, string * valStr, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const char * pv, std::string * valStr, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
dbr_string_t * _val = new dbr_string_t[handleHelper.getNelemRequest(handle)];
|
||||
status=cafeSoluble.getCache(handle, DBR_STS_STRING, _val, alarmStatus, alarmSeverity);
|
||||
for (unsigned int i=0; i< handleHelper.getNelemRequest(handle); ++i) { valStr[i]=_val[i]; }
|
||||
delete [] _val; return status;
|
||||
for (unsigned int i=0; i< handleHelper.getNelemRequest(handle); ++i) {
|
||||
valStr[i]=_val[i];
|
||||
}
|
||||
delete [] _val;
|
||||
return status;
|
||||
};
|
||||
int getCache(const char * pv, string * valStr, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const char * pv, std::string * valStr, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
dbr_string_t * _val = new dbr_string_t[handleHelper.getNelemRequest(handle)];
|
||||
status=cafeSoluble.getCache(handle, DBR_TIME_STRING, _val, alarmStatus, alarmSeverity, ts);
|
||||
for (unsigned int i=0; i< handleHelper.getNelemRequest(handle); ++i) { valStr[i]=_val[i]; }
|
||||
delete [] _val; return status;
|
||||
for (unsigned int i=0; i< handleHelper.getNelemRequest(handle); ++i) {
|
||||
valStr[i]=_val[i];
|
||||
}
|
||||
delete [] _val;
|
||||
return status;
|
||||
}
|
||||
|
||||
#endif // CAFECACHE_H
|
||||
|
||||
@@ -9,8 +9,10 @@
|
||||
#ifndef CAFECACHE_H
|
||||
#define CAFECACHE_H
|
||||
|
||||
int getPulseID(unsigned int * handle, unsigned int nelem, unsigned int * pulseID) {
|
||||
int status=ICAFE_NORMAL; int statusLocal=ICAFE_NORMAL;
|
||||
int getPulseID(unsigned int * handle, unsigned int nelem, unsigned int * pulseID)
|
||||
{
|
||||
int status=ICAFE_NORMAL;
|
||||
int statusLocal=ICAFE_NORMAL;
|
||||
for (unsigned int i=0; i<nelem; ++i) {
|
||||
statusLocal=handleHelper.getPulseID(handle[i], pulseID[i]);
|
||||
if (statusLocal!=ICAFE_NORMAL && status==ICAFE_NORMAL) {
|
||||
@@ -20,22 +22,26 @@ int getPulseID(unsigned int * handle, unsigned int nelem, unsigned int * pulseI
|
||||
return status;
|
||||
}
|
||||
|
||||
int getPulseID(unsigned int handle, unsigned int &pulseID) {
|
||||
int getPulseID(unsigned int handle, unsigned int &pulseID)
|
||||
{
|
||||
pulseID=0;
|
||||
return handleHelper.getPulseID(handle, pulseID);
|
||||
}
|
||||
|
||||
int getPulseID(char * pv, unsigned int &pulseID) {
|
||||
int getPulseID(char * pv, unsigned int &pulseID)
|
||||
{
|
||||
pulseID=0;
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return handleHelper.getPulseID(handle, pulseID);
|
||||
}
|
||||
|
||||
unsigned int getPulseIDFromTS(epicsTimeStamp ts) {
|
||||
unsigned int getPulseIDFromTS(epicsTimeStamp ts)
|
||||
{
|
||||
return handleHelper.getPulseIDFromTS(ts);
|
||||
}
|
||||
|
||||
vector<unsigned int>getPulseIDFromTS(PVDataHolder * pvd, unsigned int nelem) {
|
||||
vector<unsigned int>getPulseIDFromTS(PVDataHolder * pvd, unsigned int nelem)
|
||||
{
|
||||
vector<unsigned int> vui;
|
||||
vui.clear();
|
||||
vui.reserve(nelem);
|
||||
@@ -45,7 +51,8 @@ vector<unsigned int>getPulseIDFromTS(PVDataHolder * pvd, unsigned int nelem) {
|
||||
return vui;
|
||||
}
|
||||
|
||||
vector<unsigned int>getPulseIDFromTS(PVGroup pvg) {
|
||||
vector<unsigned int>getPulseIDFromTS(PVGroup pvg)
|
||||
{
|
||||
vector<unsigned int> vui;
|
||||
vui.clear();
|
||||
vui.reserve(pvg.getNPV());
|
||||
@@ -56,24 +63,33 @@ vector<unsigned int>getPulseIDFromTS(PVGroup pvg) {
|
||||
return vui;
|
||||
}
|
||||
|
||||
int getCachePVArray (vector<unsigned int> handleV, PVDataHolder * pvd){
|
||||
unsigned int * handleArray = new unsigned int [handleV.size()];
|
||||
for (size_t i=0; i< (size_t) handleV.size(); ++i) {handleArray[i]= (unsigned int) handleV[i];}
|
||||
status=getCache(handleArray, (unsigned int) handleV.size(), pvd);
|
||||
delete [] handleArray; return status;
|
||||
int getCachePVArray (vector<unsigned int> handleV, PVDataHolder * pvd)
|
||||
{
|
||||
unsigned int * handleArray = new unsigned int [handleV.size()];
|
||||
for (size_t i=0; i< (size_t) handleV.size(); ++i) {
|
||||
handleArray[i]= (unsigned int) handleV[i];
|
||||
}
|
||||
status=getCache(handleArray, (unsigned int) handleV.size(), pvd);
|
||||
delete [] handleArray;
|
||||
return status;
|
||||
};
|
||||
|
||||
int getCachePVArrayNoWait (vector<unsigned int> handleV, PVDataHolder * pvd){
|
||||
unsigned int * handleArray = new unsigned int [handleV.size()];
|
||||
int overallStatus=ICAFE_NORMAL;
|
||||
for (size_t i=0; i< (size_t) handleV.size(); ++i) {handleArray[i]= (unsigned int) handleV[i];
|
||||
status=getCacheNoWait(handleArray[i], pvd[i]);
|
||||
if (status!=ICAFE_NORMAL) {
|
||||
resetCallbackGet(handleArray[i]);
|
||||
if(overallStatus==ICAFE_NORMAL) {overallStatus=status;}
|
||||
}
|
||||
}
|
||||
delete [] handleArray; return status;
|
||||
int getCachePVArrayNoWait (vector<unsigned int> handleV, PVDataHolder * pvd)
|
||||
{
|
||||
unsigned int * handleArray = new unsigned int [handleV.size()];
|
||||
int overallStatus=ICAFE_NORMAL;
|
||||
for (size_t i=0; i< (size_t) handleV.size(); ++i) {
|
||||
handleArray[i]= (unsigned int) handleV[i];
|
||||
status=getCacheNoWait(handleArray[i], pvd[i]);
|
||||
if (status!=ICAFE_NORMAL) {
|
||||
resetCallbackGet(handleArray[i]);
|
||||
if(overallStatus==ICAFE_NORMAL) {
|
||||
overallStatus=status;
|
||||
}
|
||||
}
|
||||
}
|
||||
delete [] handleArray;
|
||||
return status;
|
||||
};
|
||||
|
||||
int resetCallbackGet(const unsigned int handle);
|
||||
@@ -87,22 +103,32 @@ int getCache (const unsigned int *handleArray, unsigned int nelem, PVDataHold
|
||||
int getCtrlCache (const unsigned int handle, PVCtrlHolder & pvc);
|
||||
int getCtrlCache (const unsigned int *handleArray, unsigned int nelem, PVCtrlHolder * pvc);
|
||||
|
||||
int getCache (const char * pv, PVDataHolder & pvd) {
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv); return getCache(handle, pvd);}
|
||||
int getCtrlCache (const char * pv, PVCtrlHolder & pvc) {
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv); return getCtrlCache(handle, pvc);}
|
||||
int getCache (const char * pv, PVDataHolder & pvd)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return getCache(handle, pvd);
|
||||
}
|
||||
int getCtrlCache (const char * pv, PVCtrlHolder & pvc)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return getCtrlCache(handle, pvc);
|
||||
}
|
||||
|
||||
//6
|
||||
int getCacheDoubleArray(const unsigned int handle, dbr_double_t * _val) {
|
||||
int getCacheDoubleArray(const unsigned int handle, dbr_double_t * _val)
|
||||
{
|
||||
return cafeDoppio.getCache(handle, DBR_DOUBLE, _val);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_double_t * _val) {
|
||||
int getCache(const unsigned int handle, dbr_double_t * _val)
|
||||
{
|
||||
return cafeDoppio.getCache(handle, DBR_DOUBLE, _val);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_double_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const unsigned int handle, dbr_double_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
return cafeDoppio.getCache(handle, DBR_STS_DOUBLE, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_double_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const unsigned int handle, dbr_double_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
return cafeDoppio.getCache(handle, DBR_TIME_DOUBLE, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
//5+ long long
|
||||
@@ -111,280 +137,369 @@ int getCache(const unsigned int handle, long long * _val, dbr_short_t &alarmS
|
||||
int getCache(const unsigned int handle, long long * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);
|
||||
|
||||
//5
|
||||
int getCacheLongArray(const unsigned int handle, dbr_long_t * _val) {
|
||||
int getCacheLongArray(const unsigned int handle, dbr_long_t * _val)
|
||||
{
|
||||
return cafeLatte.getCache(handle, DBR_LONG, _val);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_long_t * _val) {
|
||||
int getCache(const unsigned int handle, dbr_long_t * _val)
|
||||
{
|
||||
return cafeLatte.getCache(handle, DBR_LONG, _val);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_long_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const unsigned int handle, dbr_long_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
return cafeLatte.getCache(handle, DBR_STS_LONG, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_long_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const unsigned int handle, dbr_long_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
return cafeLatte.getCache(handle, DBR_TIME_LONG, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
//4
|
||||
int getCache(const unsigned int handle, dbr_char_t * _val) {
|
||||
int getCache(const unsigned int handle, dbr_char_t * _val)
|
||||
{
|
||||
return cafeCappuccino.getCache(handle, DBR_CHAR, _val);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_char_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const unsigned int handle, dbr_char_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
return cafeCappuccino.getCache(handle, DBR_STS_ENUM, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_char_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const unsigned int handle, dbr_char_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
return cafeCappuccino.getCache(handle, DBR_TIME_ENUM, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
//3
|
||||
int getCache(const unsigned int handle, dbr_enum_t * _val) {
|
||||
int getCache(const unsigned int handle, dbr_enum_t * _val)
|
||||
{
|
||||
return cafeEspresso.getCache(handle, DBR_ENUM, _val);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_enum_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const unsigned int handle, dbr_enum_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
return cafeEspresso.getCache(handle, DBR_STS_ENUM, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_enum_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const unsigned int handle, dbr_enum_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
return cafeEspresso.getCache(handle, DBR_TIME_ENUM, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
//2
|
||||
int getCacheFloatArray(const unsigned int handle, dbr_float_t * _val) {
|
||||
int getCacheFloatArray(const unsigned int handle, dbr_float_t * _val)
|
||||
{
|
||||
return cafeFrappuccino.getCache(handle, DBR_FLOAT, _val);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_float_t * _val) {
|
||||
int getCache(const unsigned int handle, dbr_float_t * _val)
|
||||
{
|
||||
return cafeFrappuccino.getCache(handle, DBR_FLOAT, _val);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_float_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const unsigned int handle, dbr_float_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
return cafeFrappuccino.getCache(handle, DBR_STS_FLOAT, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_float_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const unsigned int handle, dbr_float_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
return cafeFrappuccino.getCache(handle, DBR_TIME_FLOAT, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
//1
|
||||
int getCache(const unsigned int handle, dbr_short_t * _val) {
|
||||
int getCache(const unsigned int handle, dbr_short_t * _val)
|
||||
{
|
||||
return cafeSchale.getCache(handle, DBR_SHORT, _val);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_short_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const unsigned int handle, dbr_short_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
return cafeSchale.getCache(handle, DBR_STS_SHORT, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_short_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const unsigned int handle, dbr_short_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
return cafeSchale.getCache(handle, DBR_TIME_SHORT, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
|
||||
|
||||
int getCacheDbrStringArray(const unsigned int handle, dbr_string_t * _val){
|
||||
return cafeSoluble.getCache(handle, DBR_STRING, _val);
|
||||
int getCacheDbrStringArray(const unsigned int handle, dbr_string_t * _val)
|
||||
{
|
||||
return cafeSoluble.getCache(handle, DBR_STRING, _val);
|
||||
};
|
||||
|
||||
//0
|
||||
int getCache(const unsigned int handle, dbr_string_t * _val) {
|
||||
int getCache(const unsigned int handle, dbr_string_t * _val)
|
||||
{
|
||||
return cafeSoluble.getCache(handle, DBR_STRING, _val);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_string_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const unsigned int handle, dbr_string_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
return cafeSoluble.getCache(handle, DBR_STS_STRING, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const unsigned int handle, dbr_string_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const unsigned int handle, dbr_string_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
return cafeSoluble.getCache(handle, DBR_TIME_STRING, _val, alarmStatus, alarmSeverity, ts);
|
||||
}
|
||||
//0+
|
||||
int getCacheStringArray(const unsigned int handle, string * valStr) {
|
||||
int getCacheStringArray(const unsigned int handle, string * valStr)
|
||||
{
|
||||
dbr_string_t * _val = new dbr_string_t[handleHelper.getNelemRequest(handle)];
|
||||
status=cafeSoluble.getCache(handle, DBR_STRING, _val);
|
||||
for (unsigned int i=0; i< handleHelper.getNelemRequest(handle); ++i) { valStr[i]=_val[i]; }
|
||||
delete [] _val; return status;
|
||||
for (unsigned int i=0; i< handleHelper.getNelemRequest(handle); ++i) {
|
||||
valStr[i]=_val[i];
|
||||
}
|
||||
delete [] _val;
|
||||
return status;
|
||||
};
|
||||
int getCache(const unsigned int handle, string * valStr) {
|
||||
int getCache(const unsigned int handle, string * valStr)
|
||||
{
|
||||
dbr_string_t * _val = new dbr_string_t[handleHelper.getNelemRequest(handle)];
|
||||
status=cafeSoluble.getCache(handle, DBR_STRING, _val);
|
||||
for (unsigned int i=0; i< handleHelper.getNelemRequest(handle); ++i) { valStr[i]=_val[i]; }
|
||||
delete [] _val; return status;
|
||||
for (unsigned int i=0; i< handleHelper.getNelemRequest(handle); ++i) {
|
||||
valStr[i]=_val[i];
|
||||
}
|
||||
delete [] _val;
|
||||
return status;
|
||||
};
|
||||
int getCache(const unsigned int handle, string * valStr, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const unsigned int handle, string * valStr, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
dbr_string_t * _val = new dbr_string_t[handleHelper.getNelemRequest(handle)];
|
||||
status=cafeSoluble.getCache(handle, DBR_STS_STRING, _val, alarmStatus, alarmSeverity);
|
||||
for (unsigned int i=0; i< handleHelper.getNelemRequest(handle); ++i) { valStr[i]=_val[i]; }
|
||||
delete [] _val; return status;
|
||||
for (unsigned int i=0; i< handleHelper.getNelemRequest(handle); ++i) {
|
||||
valStr[i]=_val[i];
|
||||
}
|
||||
delete [] _val;
|
||||
return status;
|
||||
};
|
||||
int getCache(const unsigned int handle, string * valStr, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const unsigned int handle, string * valStr, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
dbr_string_t * _val = new dbr_string_t[handleHelper.getNelemRequest(handle)];
|
||||
status=cafeSoluble.getCache(handle, DBR_TIME_STRING, _val, alarmStatus, alarmSeverity, ts);
|
||||
for (unsigned int i=0; i< handleHelper.getNelemRequest(handle); ++i) { valStr[i]=_val[i]; }
|
||||
delete [] _val; return status;
|
||||
for (unsigned int i=0; i< handleHelper.getNelemRequest(handle); ++i) {
|
||||
valStr[i]=_val[i];
|
||||
}
|
||||
delete [] _val;
|
||||
return status;
|
||||
}
|
||||
//Single value
|
||||
//0+
|
||||
|
||||
int getCacheString(const unsigned int handle, string & valStr){ //0
|
||||
unsigned int nelemPrevious=CAFE::setNelemToRetrieveFromCacheToOne(handle); dbr_string_t val[1]={""};
|
||||
status=cafeSoluble.getCache(handle, DBR_STRING, val);
|
||||
if (status==ICAFE_NORMAL) {valStr=val[0];} CAFE::setNelemToRetrieveFromCacheToPrevious(handle, nelemPrevious);
|
||||
return status;
|
||||
}
|
||||
|
||||
int getCache(const unsigned int handle, string & valStr){ //0
|
||||
unsigned int nelemPrevious=CAFE::setNelemToRetrieveFromCacheToOne(handle); dbr_string_t val[1]={""};
|
||||
int getCacheString(const unsigned int handle, string & valStr) //0
|
||||
{
|
||||
unsigned int nelemPrevious=CAFE::setNelemToRetrieveFromCacheToOne(handle);
|
||||
dbr_string_t val[1]= {""};
|
||||
status=cafeSoluble.getCache(handle, DBR_STRING, val);
|
||||
if (status==ICAFE_NORMAL) {valStr=val[0];} CAFE::setNelemToRetrieveFromCacheToPrevious(handle, nelemPrevious);
|
||||
if (status==ICAFE_NORMAL) {
|
||||
valStr=val[0];
|
||||
}
|
||||
CAFE::setNelemToRetrieveFromCacheToPrevious(handle, nelemPrevious);
|
||||
return status;
|
||||
}
|
||||
int getCache(const unsigned int handle, string & valStr, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity){ //0
|
||||
unsigned int nelemPrevious=CAFE::setNelemToRetrieveFromCacheToOne(handle); dbr_string_t val[1]={""};
|
||||
|
||||
int getCache(const unsigned int handle, string & valStr) //0
|
||||
{
|
||||
unsigned int nelemPrevious=CAFE::setNelemToRetrieveFromCacheToOne(handle);
|
||||
dbr_string_t val[1]= {""};
|
||||
status=cafeSoluble.getCache(handle, DBR_STRING, val);
|
||||
if (status==ICAFE_NORMAL) {
|
||||
valStr=val[0];
|
||||
}
|
||||
CAFE::setNelemToRetrieveFromCacheToPrevious(handle, nelemPrevious);
|
||||
return status;
|
||||
}
|
||||
int getCache(const unsigned int handle, string & valStr, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) //0
|
||||
{
|
||||
unsigned int nelemPrevious=CAFE::setNelemToRetrieveFromCacheToOne(handle);
|
||||
dbr_string_t val[1]= {""};
|
||||
status=cafeSoluble.getCache(handle, DBR_STS_STRING, val, alarmStatus, alarmSeverity);
|
||||
if (status==ICAFE_NORMAL) {valStr=val[0];} CAFE::setNelemToRetrieveFromCacheToPrevious(handle, nelemPrevious);
|
||||
if (status==ICAFE_NORMAL) {
|
||||
valStr=val[0];
|
||||
}
|
||||
CAFE::setNelemToRetrieveFromCacheToPrevious(handle, nelemPrevious);
|
||||
return status;
|
||||
}
|
||||
int getCache(const unsigned int handle, string & valStr,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts){ //0
|
||||
unsigned int nelemPrevious=CAFE::setNelemToRetrieveFromCacheToOne(handle); dbr_string_t val[1]={""};
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) //0
|
||||
{
|
||||
unsigned int nelemPrevious=CAFE::setNelemToRetrieveFromCacheToOne(handle);
|
||||
dbr_string_t val[1]= {""};
|
||||
status=cafeSoluble.getCache(handle, DBR_TIME_STRING, val, alarmStatus, alarmSeverity, ts);
|
||||
if (status==ICAFE_NORMAL) {valStr=val[0];} CAFE::setNelemToRetrieveFromCacheToPrevious(handle, nelemPrevious);
|
||||
if (status==ICAFE_NORMAL) {
|
||||
valStr=val[0];
|
||||
}
|
||||
CAFE::setNelemToRetrieveFromCacheToPrevious(handle, nelemPrevious);
|
||||
return status;
|
||||
}
|
||||
int getCache(const unsigned int handle, dbr_string_t & val); //0
|
||||
int getCache(const unsigned int handle, dbr_string_t & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //0
|
||||
int getCache(const unsigned int handle, dbr_string_t & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //0
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //0
|
||||
int getCache(const unsigned int handle, dbr_short_t & val); //1
|
||||
int getCache(const unsigned int handle, dbr_short_t & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //1
|
||||
int getCache(const unsigned int handle, dbr_short_t & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //1
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //1
|
||||
int getCache(const unsigned int handle, dbr_float_t & val); //2
|
||||
int getCache(const unsigned int handle, dbr_float_t & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //2
|
||||
int getCache(const unsigned int handle, dbr_float_t & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //2
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //2
|
||||
int getCache(const unsigned int handle, dbr_enum_t & val); //3
|
||||
int getCache(const unsigned int handle, dbr_enum_t & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //3
|
||||
int getCache(const unsigned int handle, dbr_enum_t & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //3
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //3
|
||||
int getCache(const unsigned int handle, dbr_char_t & val); //4
|
||||
int getCache(const unsigned int handle, dbr_char_t & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //4
|
||||
int getCache(const unsigned int handle, dbr_char_t & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //4
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //4
|
||||
|
||||
int getCacheLong(const unsigned int handle, dbr_long_t & val) {
|
||||
return getCache(handle, val);
|
||||
int getCacheLong(const unsigned int handle, dbr_long_t & val)
|
||||
{
|
||||
return getCache(handle, val);
|
||||
}
|
||||
|
||||
int getCache(const unsigned int handle, dbr_long_t & val); //5
|
||||
int getCache(const unsigned int handle, dbr_long_t & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //5
|
||||
int getCache(const unsigned int handle, dbr_long_t & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //5
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //5
|
||||
int getCache(const unsigned int handle, long long & val); //5+
|
||||
int getCache(const unsigned int handle, long long & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //5+
|
||||
int getCache(const unsigned int handle, long long & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //5+
|
||||
int getCacheDouble(const unsigned int handle, dbr_double_t & val) {
|
||||
return getCache(handle, val);
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //5+
|
||||
int getCacheDouble(const unsigned int handle, dbr_double_t & val)
|
||||
{
|
||||
return getCache(handle, val);
|
||||
}
|
||||
|
||||
int getCache(const unsigned int handle, dbr_double_t & val); //6
|
||||
int getCache(const unsigned int handle, dbr_double_t & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //6
|
||||
int getCache(const unsigned int handle, dbr_double_t & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //6
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //6
|
||||
|
||||
|
||||
//getCache by array of handles
|
||||
//0+
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, string * valStr, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts)
|
||||
{
|
||||
dbr_string_t * val = new dbr_string_t[nelem];
|
||||
status=cafeSoluble.getCache(handleArray, nelem, DBR_TIME_STRING, val, statusArray,
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
for (unsigned int i=0; i< nelem; ++i) { valStr[i]=val[i]; }
|
||||
delete [] val; return status;
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
for (unsigned int i=0; i< nelem; ++i) {
|
||||
valStr[i]=val[i];
|
||||
}
|
||||
delete [] val;
|
||||
return status;
|
||||
};
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, string * valStr, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity)
|
||||
{
|
||||
dbr_string_t * val = new dbr_string_t[nelem];
|
||||
status=cafeSoluble.getCache(handleArray, nelem, DBR_STS_STRING, val, statusArray,
|
||||
alarmStatus, alarmSeverity);
|
||||
for (unsigned int i=0; i< nelem; ++i) { valStr[i]=val[i]; }
|
||||
delete [] val; return status;
|
||||
alarmStatus, alarmSeverity);
|
||||
for (unsigned int i=0; i< nelem; ++i) {
|
||||
valStr[i]=val[i];
|
||||
}
|
||||
delete [] val;
|
||||
return status;
|
||||
};
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, string * valStr, int *statusArray) {
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, string * valStr, int *statusArray)
|
||||
{
|
||||
dbr_string_t * val = new dbr_string_t[nelem];
|
||||
status=cafeSoluble.getCache(handleArray, nelem, DBR_STRING, val, statusArray);
|
||||
for (unsigned int i=0; i< nelem; ++i) { valStr[i]=val[i]; }
|
||||
delete [] val; return status;
|
||||
for (unsigned int i=0; i< nelem; ++i) {
|
||||
valStr[i]=val[i];
|
||||
}
|
||||
delete [] val;
|
||||
return status;
|
||||
}
|
||||
//0
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, dbr_string_t * val, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts)
|
||||
{
|
||||
return cafeSoluble.getCache(handleArray, nelem, DBR_TIME_STRING, val, statusArray,
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, dbr_string_t * val, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity)
|
||||
{
|
||||
return cafeSoluble.getCache(handleArray, nelem, DBR_STS_STRING, val, statusArray,
|
||||
alarmStatus, alarmSeverity);
|
||||
alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, dbr_string_t * val, int *statusArray) {
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, dbr_string_t * val, int *statusArray)
|
||||
{
|
||||
return cafeSoluble.getCache(handleArray, nelem, DBR_STRING, val, statusArray);
|
||||
}
|
||||
//1
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, dbr_short_t * val, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts)
|
||||
{
|
||||
return cafeSchale.getCache(handleArray, nelem, DBR_TIME_SHORT, val, statusArray,
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, dbr_short_t * val, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity)
|
||||
{
|
||||
return cafeSchale.getCache(handleArray, nelem, DBR_STS_SHORT, val, statusArray,
|
||||
alarmStatus, alarmSeverity);
|
||||
alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, dbr_short_t * val, int *statusArray) {
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, dbr_short_t * val, int *statusArray)
|
||||
{
|
||||
return cafeSchale.getCache(handleArray, nelem, DBR_SHORT, val, statusArray);
|
||||
}
|
||||
//2
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, dbr_float_t * val, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts)
|
||||
{
|
||||
return cafeFrappuccino.getCache(handleArray, nelem, DBR_TIME_FLOAT, val, statusArray,
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, dbr_float_t * val, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity)
|
||||
{
|
||||
return cafeFrappuccino.getCache(handleArray, nelem, DBR_STS_FLOAT, val, statusArray,
|
||||
alarmStatus, alarmSeverity);
|
||||
alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, dbr_float_t * val, int *statusArray) {
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, dbr_float_t * val, int *statusArray)
|
||||
{
|
||||
return cafeFrappuccino.getCache(handleArray, nelem, DBR_FLOAT, val, statusArray);
|
||||
}
|
||||
//3
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, dbr_ushort_t * val, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts)
|
||||
{
|
||||
return cafeEspresso.getCache(handleArray, nelem, DBR_TIME_ENUM, val, statusArray,
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, dbr_ushort_t * val, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity)
|
||||
{
|
||||
return cafeEspresso.getCache(handleArray, nelem, DBR_STS_ENUM, val, statusArray,
|
||||
alarmStatus, alarmSeverity);
|
||||
alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, dbr_ushort_t * val, int *statusArray) {
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, dbr_ushort_t * val, int *statusArray)
|
||||
{
|
||||
return cafeEspresso.getCache(handleArray, nelem, DBR_ENUM, val, statusArray);
|
||||
}
|
||||
//4
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, dbr_char_t * val, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts)
|
||||
{
|
||||
return cafeCappuccino.getCache(handleArray, nelem, DBR_TIME_CHAR, val, statusArray,
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, dbr_char_t * val, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity)
|
||||
{
|
||||
return cafeCappuccino.getCache(handleArray, nelem, DBR_STS_CHAR, val, statusArray,
|
||||
alarmStatus, alarmSeverity);
|
||||
alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, dbr_char_t * val, int *statusArray) {
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, dbr_char_t * val, int *statusArray)
|
||||
{
|
||||
return cafeCappuccino.getCache(handleArray, nelem, DBR_CHAR, val, statusArray);
|
||||
}
|
||||
//5
|
||||
int getCache(unsigned int *handleArray, unsigned int nelem, dbr_long_t * val, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts)
|
||||
{
|
||||
return cafeLatte.getCache(handleArray, nelem, DBR_TIME_LONG, val, statusArray,
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, dbr_long_t * val, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity)
|
||||
{
|
||||
return cafeLatte.getCache(handleArray, nelem, DBR_STS_LONG, val, statusArray,
|
||||
alarmStatus, alarmSeverity);
|
||||
alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, dbr_long_t * val, int *statusArray) {
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, dbr_long_t * val, int *statusArray)
|
||||
{
|
||||
return cafeLatte.getCache(handleArray, nelem, DBR_LONG, val, statusArray);
|
||||
}
|
||||
//5+ long long
|
||||
@@ -397,16 +512,19 @@ int getCache(const unsigned int *handleArray, unsigned int nelem, long long
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, long long * val, int *statusArray);
|
||||
//6
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, dbr_double_t * val, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity, epicsTimeStamp *ts)
|
||||
{
|
||||
return cafeDoppio.getCache(handleArray, nelem, DBR_TIME_DOUBLE, val, statusArray,
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
int getCache(const unsigned int *handleArray, unsigned int nelem, dbr_double_t * val, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity)
|
||||
{
|
||||
return cafeDoppio.getCache(handleArray, nelem, DBR_STS_DOUBLE, val, statusArray,
|
||||
alarmStatus, alarmSeverity);
|
||||
alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, dbr_double_t * val, int *statusArray) {
|
||||
int getCache (const unsigned int *handleArray, unsigned int nelem, dbr_double_t * val, int *statusArray)
|
||||
{
|
||||
return cafeDoppio.getCache(handleArray, nelem, DBR_DOUBLE, val, statusArray);
|
||||
}
|
||||
|
||||
@@ -415,177 +533,216 @@ int getCache (const unsigned int *handleArray, unsigned int nelem, dbr_double
|
||||
int getCache(const char * pv, string & valStr); //0+
|
||||
int getCache(const char * pv, string & valStr, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //0+
|
||||
int getCache(const char * pv, string & valStr,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //0+
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //0+
|
||||
int getCache(const char * pv, dbr_string_t & val); //0
|
||||
int getCache(const char * pv, dbr_string_t & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //0
|
||||
int getCache(const char * pv, dbr_string_t & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //0
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //0
|
||||
int getCache(const char * pv, dbr_short_t & val); //1
|
||||
int getCache(const char * pv, dbr_short_t & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //1
|
||||
int getCache(const char * pv, dbr_short_t & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //1
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //1
|
||||
int getCache(const char * pv, dbr_float_t & val); //2
|
||||
int getCache(const char * pv, dbr_float_t & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //2
|
||||
int getCache(const char * pv, dbr_float_t & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //2
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //2
|
||||
int getCache(const char * pv, dbr_enum_t & val); //3
|
||||
int getCache(const char * pv, dbr_enum_t & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //3
|
||||
int getCache(const char * pv, dbr_enum_t & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //3
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //3
|
||||
int getCache(const char * pv, dbr_char_t & val); //4
|
||||
int getCache(const char * pv, dbr_char_t & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //4
|
||||
int getCache(const char * pv, dbr_char_t & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //4
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //4
|
||||
int getCache(const char * pv, dbr_long_t & val); //5
|
||||
int getCache(const char * pv, dbr_long_t & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //5
|
||||
int getCache(const char * pv, dbr_long_t & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //5
|
||||
int getCache(const char * pv, long long & val){ //5+
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //5
|
||||
int getCache(const char * pv, long long & val) //5+
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return CAFE::getCache(handle, val);
|
||||
}
|
||||
int getCache(const char * pv, long long & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity){ //5+
|
||||
int getCache(const char * pv, long long & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) //5+
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return CAFE::getCache(handle, val, alarmStatus, alarmSeverity);
|
||||
}
|
||||
int getCache(const char * pv, long long & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts){ //5+
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) //5+
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return CAFE::getCache(handle, val, alarmStatus, alarmSeverity, ts);
|
||||
}
|
||||
int getCache(const char * pv, dbr_double_t & val); //6
|
||||
int getCache(const char * pv, dbr_double_t & val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity); //6
|
||||
int getCache(const char * pv, dbr_double_t & val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //6
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts); //6
|
||||
|
||||
|
||||
//6
|
||||
int getCache(const char * pv, dbr_double_t * _val) {
|
||||
int getCache(const char * pv, dbr_double_t * _val)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeDoppio.getCache(handle, DBR_DOUBLE, _val);
|
||||
};
|
||||
int getCache(const char * pv, dbr_double_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const char * pv, dbr_double_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeDoppio.getCache(handle, DBR_STS_DOUBLE, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const char * pv, dbr_double_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const char * pv, dbr_double_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeDoppio.getCache(handle, DBR_TIME_DOUBLE, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
|
||||
//5+
|
||||
int getCache(const char * pv, long long * _val) {
|
||||
int getCache(const char * pv, long long * _val)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return CAFE::getCache(handle, _val);
|
||||
};
|
||||
int getCache(const char * pv, long long * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const char * pv, long long * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return CAFE::getCache(handle, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const char * pv, long long * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const char * pv, long long * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return CAFE::getCache(handle, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
|
||||
//5
|
||||
int getCache(const char * pv, dbr_long_t * _val) {
|
||||
int getCache(const char * pv, dbr_long_t * _val)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeLatte.getCache(handle, DBR_LONG, _val);
|
||||
};
|
||||
int getCache(const char * pv, dbr_long_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const char * pv, dbr_long_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeLatte.getCache(handle, DBR_STS_LONG, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const char * pv, dbr_long_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const char * pv, dbr_long_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeLatte.getCache(handle, DBR_TIME_LONG, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
//4
|
||||
int getCache(const char * pv, dbr_char_t * _val) {
|
||||
int getCache(const char * pv, dbr_char_t * _val)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeCappuccino.getCache(handle, DBR_CHAR, _val);
|
||||
};
|
||||
int getCache(const char * pv, dbr_char_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const char * pv, dbr_char_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeCappuccino.getCache(handle, DBR_STS_ENUM, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const char * pv, dbr_char_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const char * pv, dbr_char_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeCappuccino.getCache(handle, DBR_TIME_ENUM, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
//3
|
||||
int getCache(const char * pv, dbr_enum_t * _val) {
|
||||
int getCache(const char * pv, dbr_enum_t * _val)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeEspresso.getCache(handle, DBR_ENUM, _val);
|
||||
};
|
||||
int getCache(const char * pv, dbr_enum_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const char * pv, dbr_enum_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeEspresso.getCache(handle, DBR_STS_ENUM, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const char * pv, dbr_enum_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const char * pv, dbr_enum_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeEspresso.getCache(handle, DBR_TIME_ENUM, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
//2
|
||||
int getCache(const char * pv, dbr_float_t * _val) {
|
||||
int getCache(const char * pv, dbr_float_t * _val)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeFrappuccino.getCache(handle, DBR_FLOAT, _val);
|
||||
};
|
||||
int getCache(const char * pv, dbr_float_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const char * pv, dbr_float_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeFrappuccino.getCache(handle, DBR_STS_FLOAT, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const char * pv, dbr_float_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const char * pv, dbr_float_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeFrappuccino.getCache(handle, DBR_TIME_FLOAT, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
//1
|
||||
int getCache(const char * pv, dbr_short_t * _val) {
|
||||
int getCache(const char * pv, dbr_short_t * _val)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeSchale.getCache(handle, DBR_SHORT, _val);
|
||||
};
|
||||
int getCache(const char * pv, dbr_short_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const char * pv, dbr_short_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeSchale.getCache(handle, DBR_STS_SHORT, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const char * pv, dbr_short_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const char * pv, dbr_short_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeSchale.getCache(handle, DBR_TIME_SHORT, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
//0
|
||||
int getCache(const char * pv, dbr_string_t * _val) {
|
||||
int getCache(const char * pv, dbr_string_t * _val)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeSoluble.getCache(handle, DBR_STRING, _val);
|
||||
};
|
||||
int getCache(const char * pv, dbr_string_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const char * pv, dbr_string_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeSoluble.getCache(handle, DBR_STS_STRING, _val, alarmStatus, alarmSeverity);
|
||||
};
|
||||
int getCache(const char * pv, dbr_string_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const char * pv, dbr_string_t * _val, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
return cafeSoluble.getCache(handle, DBR_TIME_STRING, _val, alarmStatus, alarmSeverity, ts);
|
||||
}
|
||||
//0+
|
||||
int getCache(const char * pv, string * valStr) {
|
||||
int getCache(const char * pv, string * valStr)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
dbr_string_t * _val = new dbr_string_t[handleHelper.getNelemRequest(handle)];
|
||||
status=cafeSoluble.getCache(handle, DBR_STRING, _val);
|
||||
for (unsigned int i=0; i< handleHelper.getNelemRequest(handle); ++i) { valStr[i]=_val[i]; }
|
||||
delete [] _val; return status;
|
||||
for (unsigned int i=0; i< handleHelper.getNelemRequest(handle); ++i) {
|
||||
valStr[i]=_val[i];
|
||||
}
|
||||
delete [] _val;
|
||||
return status;
|
||||
};
|
||||
int getCache(const char * pv, string * valStr, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity) {
|
||||
int getCache(const char * pv, string * valStr, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
dbr_string_t * _val = new dbr_string_t[handleHelper.getNelemRequest(handle)];
|
||||
status=cafeSoluble.getCache(handle, DBR_STS_STRING, _val, alarmStatus, alarmSeverity);
|
||||
for (unsigned int i=0; i< handleHelper.getNelemRequest(handle); ++i) { valStr[i]=_val[i]; }
|
||||
delete [] _val; return status;
|
||||
for (unsigned int i=0; i< handleHelper.getNelemRequest(handle); ++i) {
|
||||
valStr[i]=_val[i];
|
||||
}
|
||||
delete [] _val;
|
||||
return status;
|
||||
};
|
||||
int getCache(const char * pv, string * valStr, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) {
|
||||
int getCache(const char * pv, string * valStr, dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts)
|
||||
{
|
||||
unsigned int handle=handleHelper.getHandleFromPV(pv);
|
||||
dbr_string_t * _val = new dbr_string_t[handleHelper.getNelemRequest(handle)];
|
||||
status=cafeSoluble.getCache(handle, DBR_TIME_STRING, _val, alarmStatus, alarmSeverity, ts);
|
||||
for (unsigned int i=0; i< handleHelper.getNelemRequest(handle); ++i) { valStr[i]=_val[i]; }
|
||||
delete [] _val; return status;
|
||||
for (unsigned int i=0; i< handleHelper.getNelemRequest(handle); ++i) {
|
||||
valStr[i]=_val[i];
|
||||
}
|
||||
delete [] _val;
|
||||
return status;
|
||||
}
|
||||
|
||||
#endif // CAFECACHE_H
|
||||
|
||||
@@ -13,9 +13,6 @@
|
||||
#include <cstdio>
|
||||
#include <boost/math/special_functions/fpclassify.hpp>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
/**
|
||||
* CAFEConvert Template \n
|
||||
* CTYPE is the input data type \n
|
||||
@@ -27,20 +24,20 @@ using namespace std;
|
||||
* method getAsChar () converts CTYPE to char \n
|
||||
* method getAsLong () converts CTYPE to int \n
|
||||
* method getAsString() converts CTYPE to string \n
|
||||
*
|
||||
*
|
||||
*/
|
||||
template <class CTYPE> class CAFEConvert {
|
||||
private:
|
||||
CTYPE returnVal[1];
|
||||
CTYPE returnVal[1];
|
||||
public:
|
||||
CAFEConvert (unsigned int nelem){};
|
||||
CAFEConvert (){};
|
||||
~CAFEConvert (){};
|
||||
CTYPE * get(unsigned int index, CAFE_DATATYPE dt, CAFE_DATATYPE_UNION_SEQ val);
|
||||
CTYPE * getString(unsigned int index, CAFE_DATATYPE dt, CAFE_DATATYPE_UNION_SEQ val);
|
||||
CTYPE * getStringFromEnum(unsigned int index, unsigned int noStr, CAFE_DATATYPE_UNION_SEQ val, char stig[MAX_ENUM_STATES][MAX_ENUM_STRING_SIZE]);
|
||||
CTYPE * get(CAFE_DATATYPE dt, CAFE_DATATYPE_UNION val);
|
||||
CTYPE * getString(CAFE_DATATYPE dt, CAFE_DATATYPE_UNION val);
|
||||
CAFEConvert (unsigned int nelem) {};
|
||||
CAFEConvert () {};
|
||||
~CAFEConvert () {};
|
||||
CTYPE * get(unsigned int index, CAFE_DATATYPE dt, CAFE_DATATYPE_UNION_SEQ val);
|
||||
CTYPE * getString(unsigned int index, CAFE_DATATYPE dt, CAFE_DATATYPE_UNION_SEQ val);
|
||||
CTYPE * getStringFromEnum(unsigned int index, unsigned int noStr, CAFE_DATATYPE_UNION_SEQ val, char stig[MAX_ENUM_STATES][MAX_ENUM_STRING_SIZE]);
|
||||
CTYPE * get(CAFE_DATATYPE dt, CAFE_DATATYPE_UNION val);
|
||||
CTYPE * getString(CAFE_DATATYPE dt, CAFE_DATATYPE_UNION val);
|
||||
};
|
||||
|
||||
|
||||
@@ -51,7 +48,7 @@ public:
|
||||
* \return CTYPE
|
||||
*/
|
||||
template <class CTYPE> CTYPE * CAFEConvert<CTYPE>::get (CAFE_DATATYPE dt, CAFE_DATATYPE_UNION val)
|
||||
{
|
||||
{
|
||||
#define __METHOD__ "CAFEConvert<CTYPE>::get(dt, val)"
|
||||
|
||||
// (boost::math::isnan) calls the Boost version of the isnan macro
|
||||
@@ -59,7 +56,7 @@ template <class CTYPE> CTYPE * CAFEConvert<CTYPE>::get (CAFE_DATATYPE dt, CAFE_D
|
||||
// (brackets required) to avoid compiler error should isnan also be a native macro
|
||||
|
||||
switch (dt) {
|
||||
case CAFE_DOUBLE:
|
||||
case CAFE_DOUBLE:
|
||||
if ( (boost::math::isnan)((CTYPE) val.d) ) {
|
||||
returnVal[0]= (CTYPE) val.d;
|
||||
}
|
||||
@@ -67,57 +64,58 @@ template <class CTYPE> CTYPE * CAFEConvert<CTYPE>::get (CAFE_DATATYPE dt, CAFE_D
|
||||
returnVal[0]= (CTYPE) 0;
|
||||
}
|
||||
break;
|
||||
case CAFE_FLOAT:
|
||||
case CAFE_FLOAT:
|
||||
if ( (boost::math::isnan)((CTYPE) val.f) ) {
|
||||
returnVal[0]= (CTYPE) val.f;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
returnVal[0]= 0;
|
||||
}
|
||||
break;
|
||||
case CAFE_LONG:
|
||||
returnVal[0]= (CTYPE) val.l;
|
||||
case CAFE_LONG:
|
||||
returnVal[0]= (CTYPE) val.l;
|
||||
break;
|
||||
case CAFE_SHORT:
|
||||
returnVal[0]= (CTYPE) val.s;
|
||||
case CAFE_SHORT:
|
||||
returnVal[0]= (CTYPE) val.s;
|
||||
break;
|
||||
case CAFE_ENUM:
|
||||
returnVal[0]= (CTYPE) val.us;
|
||||
case CAFE_ENUM:
|
||||
returnVal[0]= (CTYPE) val.us;
|
||||
break;
|
||||
case CAFE_CHAR:
|
||||
returnVal[0]= (CTYPE) val.ch;
|
||||
case CAFE_CHAR:
|
||||
returnVal[0]= (CTYPE) val.ch;
|
||||
break;
|
||||
case CAFE_STRING:
|
||||
returnVal[0]= (CTYPE) strtod( val.str, NULL);
|
||||
case CAFE_STRING:
|
||||
returnVal[0]= (CTYPE) strtod( val.str, NULL);
|
||||
break;
|
||||
case CAFE_TYPENOTCONN:
|
||||
//cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__
|
||||
// << " CAFE_TYPENOTCONN: dataType: " << dt << " " << endl;
|
||||
returnVal[0]=0;
|
||||
break;
|
||||
case CAFE_NO_ACCESS:
|
||||
//cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__
|
||||
// << " CAFE_NO_ACCESS: dataType: " << dt << " " << endl;
|
||||
returnVal[0]=0;
|
||||
case CAFE_TYPENOTCONN:
|
||||
//std::cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__
|
||||
// << " CAFE_TYPENOTCONN: dataType: " << dt << " " << std::endl;
|
||||
returnVal[0]=0;
|
||||
break;
|
||||
case CAFE_INVALID_DATATYPE:
|
||||
//cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__
|
||||
// << " CAFE_INVALID_DATATYPE: dataType: " << dt << " " << endl;
|
||||
returnVal[0]=0;
|
||||
case CAFE_NO_ACCESS:
|
||||
//std::cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__
|
||||
// << " CAFE_NO_ACCESS: dataType: " << dt << " " << std::endl;
|
||||
returnVal[0]=0;
|
||||
break;
|
||||
case CAFE_NOT_REQUESTED:
|
||||
//cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__
|
||||
// << " CAFE_NOT_REQUESTED: dataType: " << dt << " " << endl;
|
||||
returnVal[0]=0;
|
||||
case CAFE_INVALID_DATATYPE:
|
||||
//std::cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__
|
||||
// << " CAFE_INVALID_DATATYPE: dataType: " << dt << " " << std::endl;
|
||||
returnVal[0]=0;
|
||||
break;
|
||||
case CAFE_NOT_SHOWN:
|
||||
//cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__
|
||||
// << " CAFE_INVALID_DATATYPE: dataType: " << dt << " " << endl;
|
||||
returnVal[0]=0;
|
||||
case CAFE_NOT_REQUESTED:
|
||||
//std::cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__
|
||||
// << " CAFE_NOT_REQUESTED: dataType: " << dt << " " << std::endl;
|
||||
returnVal[0]=0;
|
||||
break;
|
||||
default:
|
||||
cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__
|
||||
<< " CAFE INTERNAL ERROR: Unknown dataType: " << dt << " " << endl;
|
||||
returnVal[0]=0;
|
||||
case CAFE_NOT_SHOWN:
|
||||
//std::cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__
|
||||
// << " CAFE_INVALID_DATATYPE: dataType: " << dt << " " << std::endl;
|
||||
returnVal[0]=0;
|
||||
break;
|
||||
default:
|
||||
std::cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__
|
||||
<< " CAFE INTERNAL ERROR: Unknown dataType: " << dt << " " << std::endl;
|
||||
returnVal[0]=0;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -134,65 +132,65 @@ template <class CTYPE> CTYPE * CAFEConvert<CTYPE>::get (CAFE_DATATYPE dt, CAFE_D
|
||||
* \return CTYPE
|
||||
*/
|
||||
template <class CTYPE> CTYPE * CAFEConvert<CTYPE>::get (unsigned int index, CAFE_DATATYPE dt, CAFE_DATATYPE_UNION_SEQ val)
|
||||
{
|
||||
{
|
||||
#define __METHOD__ "CAFEConvert<CTYPE>::get(index, dt, val[])"
|
||||
|
||||
switch (dt) {
|
||||
case CAFE_DOUBLE:
|
||||
returnVal[0]= (CTYPE) val[index].d;
|
||||
break;
|
||||
case CAFE_FLOAT:
|
||||
returnVal[0]= (CTYPE) val[index].f;
|
||||
break;
|
||||
case CAFE_LONG:
|
||||
returnVal[0]= (CTYPE) val[index].l;
|
||||
break;
|
||||
case CAFE_SHORT:
|
||||
returnVal[0]= (CTYPE) val[index].s;
|
||||
break;
|
||||
case CAFE_ENUM:
|
||||
returnVal[0]= (CTYPE) val[index].us;
|
||||
case CAFE_DOUBLE:
|
||||
returnVal[0]= (CTYPE) val[index].d;
|
||||
break;
|
||||
case CAFE_CHAR:
|
||||
returnVal[0]= (CTYPE) val[index].ch;
|
||||
break;
|
||||
case CAFE_STRING:
|
||||
returnVal[0]= (CTYPE) strtod( val[index].str, NULL);
|
||||
break;
|
||||
case CAFE_TYPENOTCONN:
|
||||
//cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__
|
||||
// << " CAFE_TYPENOTCONN: dataType: " << dt << " " << endl;
|
||||
returnVal[0]=0;
|
||||
break;
|
||||
case CAFE_NO_ACCESS:
|
||||
//cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__
|
||||
// << " CAFE_NO_ACCESS: dataType: " << dt << " " << endl;
|
||||
returnVal[0]=0;
|
||||
break;
|
||||
case CAFE_INVALID_DATATYPE:
|
||||
//cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__
|
||||
// << " CAFE_INVALID_DATATYPE: dataType: " << dt << " " << endl;
|
||||
returnVal[0]=0;
|
||||
break;
|
||||
case CAFE_NOT_REQUESTED:
|
||||
//cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__
|
||||
// << " CAFE_NOT_REQUESTED: dataType: " << dt << " " << endl;
|
||||
returnVal[0]=0;
|
||||
break;
|
||||
case CAFE_NOT_SHOWN:
|
||||
//cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__
|
||||
// << " CAFE_INVALID_DATATYPE: dataType: " << dt << " " << endl;
|
||||
returnVal[0]=0;
|
||||
break;
|
||||
default:
|
||||
cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__
|
||||
<< " CAFE INTERNAL ERROR: Unknown dataType: " << dt << " " << endl;
|
||||
returnVal[0]=0;
|
||||
case CAFE_FLOAT:
|
||||
returnVal[0]= (CTYPE) val[index].f;
|
||||
break;
|
||||
case CAFE_LONG:
|
||||
returnVal[0]= (CTYPE) val[index].l;
|
||||
break;
|
||||
case CAFE_SHORT:
|
||||
returnVal[0]= (CTYPE) val[index].s;
|
||||
break;
|
||||
case CAFE_ENUM:
|
||||
returnVal[0]= (CTYPE) val[index].us;
|
||||
break;
|
||||
case CAFE_CHAR:
|
||||
returnVal[0]= (CTYPE) val[index].ch;
|
||||
break;
|
||||
case CAFE_STRING:
|
||||
returnVal[0]= (CTYPE) strtod( val[index].str, NULL);
|
||||
break;
|
||||
case CAFE_TYPENOTCONN:
|
||||
//std::cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__
|
||||
// << " CAFE_TYPENOTCONN: dataType: " << dt << " " << std::endl;
|
||||
returnVal[0]=0;
|
||||
break;
|
||||
case CAFE_NO_ACCESS:
|
||||
//std::cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__
|
||||
// << " CAFE_NO_ACCESS: dataType: " << dt << " " << std::endl;
|
||||
returnVal[0]=0;
|
||||
break;
|
||||
case CAFE_INVALID_DATATYPE:
|
||||
//std::cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__
|
||||
// << " CAFE_INVALID_DATATYPE: dataType: " << dt << " " << std::endl;
|
||||
returnVal[0]=0;
|
||||
break;
|
||||
case CAFE_NOT_REQUESTED:
|
||||
//std::cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__
|
||||
// << " CAFE_NOT_REQUESTED: dataType: " << dt << " " << std::endl;
|
||||
returnVal[0]=0;
|
||||
break;
|
||||
case CAFE_NOT_SHOWN:
|
||||
//std::cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__
|
||||
// << " CAFE_INVALID_DATATYPE: dataType: " << dt << " " << std::endl;
|
||||
returnVal[0]=0;
|
||||
break;
|
||||
default:
|
||||
std::cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__
|
||||
<< " CAFE INTERNAL ERROR: Unknown dataType: " << dt << " " << std::endl;
|
||||
returnVal[0]=0;
|
||||
break;
|
||||
}
|
||||
|
||||
return (CTYPE *) returnVal;
|
||||
|
||||
|
||||
#undef __METHOD__
|
||||
};
|
||||
|
||||
@@ -208,46 +206,46 @@ template <class CTYPE> CTYPE * CAFEConvert<CTYPE>::get (unsigned int index, CAFE
|
||||
* \return CTYPE
|
||||
*/
|
||||
template <class CTYPE> CTYPE * CAFEConvert<CTYPE>::getStringFromEnum (unsigned int index, unsigned int noStr, CAFE_DATATYPE_UNION_SEQ val,
|
||||
char stig[MAX_ENUM_STATES][MAX_ENUM_STRING_SIZE])
|
||||
{
|
||||
char stig[MAX_ENUM_STATES][MAX_ENUM_STRING_SIZE])
|
||||
{
|
||||
#define __METHOD__ "CAFEConvert<CTYPE>::getStringFromEnum(indx, noStr, val, stig)"
|
||||
|
||||
|
||||
unsigned int noEmptyStrings=0;
|
||||
//Check for empty strings:
|
||||
for (unsigned int j=0; j<noStr; ++j) {
|
||||
if (strcmp(stig[j],"")==0) {
|
||||
++noEmptyStrings;
|
||||
}
|
||||
}
|
||||
|
||||
if (noStr==noEmptyStrings) {
|
||||
cout << "*** WARNING FROM " << __METHOD__ << " *** " << endl;
|
||||
cout << "ENUM STRING OPTIONS ARE ALL EMPTY! " << endl;
|
||||
cout << "BADLY CONFIGURED EPICS RECORD. " << endl;
|
||||
}
|
||||
|
||||
|
||||
if (index < noStr && noStr!=noEmptyStrings) {
|
||||
sprintf(returnVal[0], "%s", stig[val[index].us] );
|
||||
}
|
||||
else {
|
||||
sprintf(returnVal[0], "%d", val[index].us );
|
||||
if ( val[index].us>= noStr) {
|
||||
cout << "*** WARNING FROM " << __METHOD__ << " *** " << endl;
|
||||
cout << "ENUM UNSIGNED SHORT VALUE IS GREATER THAN THE NO OF ENUMERATED TYPES" << endl;
|
||||
cout << "VALUE (unsigned short) = " << val[index].us << endl;
|
||||
cout << "NO OF ENUMERATED STRINGS = " << noStr << " WITH VALUES: " << endl;
|
||||
for (unsigned int j=0; j<noStr; ++j) {
|
||||
cout << stig[j] << " [" <<j << "] ";
|
||||
}
|
||||
cout << endl;
|
||||
}
|
||||
}
|
||||
|
||||
return (CTYPE *) returnVal;
|
||||
|
||||
#undef __METHOD__
|
||||
|
||||
|
||||
unsigned int noEmptyStrings=0;
|
||||
//Check for empty strings:
|
||||
for (unsigned int j=0; j<noStr; ++j) {
|
||||
if (strcmp(stig[j],"")==0) {
|
||||
++noEmptyStrings;
|
||||
}
|
||||
}
|
||||
|
||||
if (noStr==noEmptyStrings) {
|
||||
std::cout << "*** WARNING FROM " << __METHOD__ << " *** " << std::endl;
|
||||
std::cout << "ENUM STRING OPTIONS ARE ALL EMPTY! " << std::endl;
|
||||
std::cout << "BADLY CONFIGURED EPICS RECORD. " << std::endl;
|
||||
}
|
||||
|
||||
|
||||
if (index < noStr && noStr!=noEmptyStrings) {
|
||||
sprintf(returnVal[0], "%s", stig[val[index].us] );
|
||||
}
|
||||
else {
|
||||
sprintf(returnVal[0], "%d", val[index].us );
|
||||
if ( val[index].us>= noStr) {
|
||||
std::cout << "*** WARNING FROM " << __METHOD__ << " *** " << std::endl;
|
||||
std::cout << "ENUM UNSIGNED SHORT VALUE IS GREATER THAN THE NO OF ENUMERATED TYPES" << std::endl;
|
||||
std::cout << "VALUE (unsigned short) = " << val[index].us << std::endl;
|
||||
std::cout << "NO OF ENUMERATED STRINGS = " << noStr << " WITH VALUES: " << std::endl;
|
||||
for (unsigned int j=0; j<noStr; ++j) {
|
||||
std::cout << stig[j] << " [" <<j << "] ";
|
||||
}
|
||||
std::cout << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
return (CTYPE *) returnVal;
|
||||
|
||||
#undef __METHOD__
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -258,13 +256,13 @@ template <class CTYPE> CTYPE * CAFEConvert<CTYPE>::getStringFromEnum (unsigned i
|
||||
* \return CTYPE
|
||||
*/
|
||||
template <class CTYPE> CTYPE * CAFEConvert<CTYPE>::getString (unsigned int index, CAFE_DATATYPE dt, CAFE_DATATYPE_UNION_SEQ val)
|
||||
{
|
||||
{
|
||||
#define __METHOD__ "CAFEConvert<CTYPE>::getString(nelem, dt, val[])"
|
||||
|
||||
|
||||
switch (dt) {
|
||||
case CAFE_STRING:
|
||||
sprintf(returnVal[0], "%s", val[index].str);
|
||||
break;
|
||||
break;
|
||||
case CAFE_CHAR:
|
||||
sprintf(returnVal[0], "%u", val[index].ch);
|
||||
break;
|
||||
@@ -284,39 +282,39 @@ template <class CTYPE> CTYPE * CAFEConvert<CTYPE>::getString (unsigned int index
|
||||
sprintf(returnVal[0], "%u", val[index].us);
|
||||
break;
|
||||
case CAFE_TYPENOTCONN:
|
||||
//cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << endl;
|
||||
//cout << " ERROR CAFE_TYPENOTCONN: dataType: " << dt << " " << endl;
|
||||
//std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl;
|
||||
//std::cout << " ERROR CAFE_TYPENOTCONN: dataType: " << dt << " " << std::endl;
|
||||
sprintf(returnVal[0], "%s", "0"); //CAFE_TYPENOTCONN");
|
||||
break;
|
||||
case CAFE_NO_ACCESS:
|
||||
//cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << endl;
|
||||
//cout << " CAFE_NO_ACCESS: dataType: " << dt << " " << endl;
|
||||
//std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl;
|
||||
//std::cout << " CAFE_NO_ACCESS: dataType: " << dt << " " << std::endl;
|
||||
sprintf(returnVal[0], "%s", "0"); //"CAFE_NO_ACCESS");
|
||||
break;
|
||||
break;
|
||||
case CAFE_INVALID_DATATYPE:
|
||||
//cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << endl;
|
||||
//cout<< " CAFE_INVALID_DATATYPE: dataType: " << dt << " " << endl;
|
||||
//std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl;
|
||||
//std::cout<< " CAFE_INVALID_DATATYPE: dataType: " << dt << " " << std::endl;
|
||||
sprintf(returnVal[0], "%s", "0"); //"CAFE_INVALID_DATATYPE");
|
||||
break;
|
||||
case CAFE_NOT_REQUESTED:
|
||||
//cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << endl;
|
||||
//cout<< " CAFE_NOT_REQUESTED: dataType: " << dt << " " << endl;
|
||||
//std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl;
|
||||
//std::cout<< " CAFE_NOT_REQUESTED: dataType: " << dt << " " << std::endl;
|
||||
sprintf(returnVal[0], "%s", "0"); //"");
|
||||
break;
|
||||
case CAFE_NOT_SHOWN:
|
||||
//cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << endl;
|
||||
//cout<< " CAFE_NOT_SHOWN: dataType: " << dt << " " << endl;
|
||||
//std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl;
|
||||
//std::cout<< " CAFE_NOT_SHOWN: dataType: " << dt << " " << std::endl;
|
||||
sprintf(returnVal[0], "%s", "0"); // "CAFE_NOT_SHOWN");
|
||||
break;
|
||||
default:
|
||||
//cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << endl;
|
||||
//cout<< " CAFE INTERNAL ERROR: Unknown dataType: "<< dt << " " << endl;
|
||||
//std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl;
|
||||
//std::cout<< " CAFE INTERNAL ERROR: Unknown dataType: "<< dt << " " << std::endl;
|
||||
sprintf(returnVal[0], "%s", "0");// "Unknown dataType");
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
return (CTYPE *) returnVal;
|
||||
|
||||
return (CTYPE *) returnVal;
|
||||
|
||||
#undef __METHOD__
|
||||
};
|
||||
@@ -354,39 +352,39 @@ template <class CTYPE> CTYPE * CAFEConvert<CTYPE>::getString (CAFE_DATATYPE dt,
|
||||
sprintf(returnVal[0], "%u", val.us);
|
||||
break;
|
||||
case CAFE_TYPENOTCONN:
|
||||
//cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << endl;
|
||||
//cout << " ERROR CAFE_TYPENOTCONN: dataType: " << dt << " " << endl;
|
||||
//std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl;
|
||||
//std::cout << " ERROR CAFE_TYPENOTCONN: dataType: " << dt << " " << std::endl;
|
||||
sprintf(returnVal[0], "%s", "0"); //CAFE_TYPENOTCONN");
|
||||
break;
|
||||
case CAFE_NO_ACCESS:
|
||||
//cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << endl;
|
||||
//cout << " CAFE_NO_ACCESS: dataType: " << dt << " " << endl;
|
||||
//std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl;
|
||||
//std::cout << " CAFE_NO_ACCESS: dataType: " << dt << " " << std::endl;
|
||||
sprintf(returnVal[0], "%s", "0"); //"CAFE_NO_ACCESS");
|
||||
break;
|
||||
case CAFE_INVALID_DATATYPE:
|
||||
//cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << endl;
|
||||
//cout<< " CAFE_INVALID_DATATYPE: dataType: " << dt << " " << endl;
|
||||
//std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl;
|
||||
//std::cout<< " CAFE_INVALID_DATATYPE: dataType: " << dt << " " << std::endl;
|
||||
sprintf(returnVal[0], "%s", "0"); //"CAFE_INVALID_DATATYPE");
|
||||
break;
|
||||
case CAFE_NOT_REQUESTED:
|
||||
//cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << endl;
|
||||
//cout<< " CAFE_NOT_REQUESTED: dataType: " << dt << " " << endl;
|
||||
//std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl;
|
||||
//std::cout<< " CAFE_NOT_REQUESTED: dataType: " << dt << " " << std::endl;
|
||||
sprintf(returnVal[0], "%s", "0"); //"");
|
||||
break;
|
||||
case CAFE_NOT_SHOWN:
|
||||
//cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << endl;
|
||||
//cout<< " CAFE_NOT_SHOWN: dataType: " << dt << " " << endl;
|
||||
//std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl;
|
||||
//std::cout<< " CAFE_NOT_SHOWN: dataType: " << dt << " " << std::endl;
|
||||
sprintf(returnVal[0], "%s", "0"); // "CAFE_NOT_SHOWN");
|
||||
break;
|
||||
default:
|
||||
//cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << endl;
|
||||
//cout<< " CAFE INTERNAL ERROR: Unknown dataType: "<< dt << " " << endl;
|
||||
//std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl;
|
||||
//std::cout<< " CAFE INTERNAL ERROR: Unknown dataType: "<< dt << " " << std::endl;
|
||||
sprintf(returnVal[0], "%s", "0");// "Unknown dataType");
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
return (CTYPE *) returnVal;
|
||||
return (CTYPE *) returnVal;
|
||||
|
||||
#undef __METHOD__
|
||||
};
|
||||
|
||||
@@ -7,27 +7,27 @@
|
||||
|
||||
#ifndef CAFEDATATYPE_H
|
||||
#define CAFEDATATYPE_H
|
||||
|
||||
|
||||
#include <cadef.h>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
enum CAFE_DATATYPE {
|
||||
CAFE_TYPENOTCONN = TYPENOTCONN, // -1 val returned by ca_field_type when channel not connected
|
||||
CAFE_STRING = DBF_STRING, // 0
|
||||
CAFE_SHORT = DBF_SHORT, // 1
|
||||
CAFE_INT = DBF_INT, // 1
|
||||
CAFE_FLOAT = DBF_FLOAT, // 2
|
||||
CAFE_ENUM = DBF_ENUM, // 3
|
||||
CAFE_USHORT = DBF_ENUM, // 3
|
||||
CAFE_CHAR = DBF_CHAR, // 4
|
||||
CAFE_LONG = DBF_LONG, // 5
|
||||
CAFE_DOUBLE = DBF_DOUBLE, // 6
|
||||
CAFE_NO_ACCESS = DBF_NO_ACCESS, //7
|
||||
CAFE_INVALID_DATATYPE = 8,
|
||||
CAFE_NOT_REQUESTED = 100,
|
||||
CAFE_NOT_SHOWN = 101 // (in stop monitor)
|
||||
CAFE_TYPENOTCONN = TYPENOTCONN, // -1 val returned by ca_field_type when channel not connected
|
||||
CAFE_STRING = DBF_STRING, // 0
|
||||
CAFE_SHORT = DBF_SHORT, // 1
|
||||
CAFE_INT = DBF_INT, // 1
|
||||
CAFE_FLOAT = DBF_FLOAT, // 2
|
||||
CAFE_ENUM = DBF_ENUM, // 3
|
||||
CAFE_USHORT = DBF_ENUM, // 3
|
||||
CAFE_CHAR = DBF_CHAR, // 4
|
||||
CAFE_LONG = DBF_LONG, // 5
|
||||
CAFE_DOUBLE = DBF_DOUBLE, // 6
|
||||
CAFE_NO_ACCESS = DBF_NO_ACCESS, //7
|
||||
CAFE_INVALID_DATATYPE = 8,
|
||||
CAFE_NOT_REQUESTED = 100,
|
||||
CAFE_NOT_SHOWN = 101 // (in stop monitor)
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -35,80 +35,89 @@ enum CAFE_DATATYPE {
|
||||
* the CAFE_DATATYPES and text equivalent
|
||||
*/
|
||||
class CAFEDataTypeCode {
|
||||
typedef std::map<int, std::string> mapLongString;
|
||||
private:
|
||||
mapLongString mapDataType;
|
||||
mapLongString::iterator pos;
|
||||
typedef std::map<int, std::string> mapLongString;
|
||||
private:
|
||||
mapLongString mapDataType;
|
||||
mapLongString::iterator pos;
|
||||
public:
|
||||
CAFEDataTypeCode() {
|
||||
mapDataType.insert(std::make_pair((int) CAFE_TYPENOTCONN, "CAFE_TYPENOTCONN" ));
|
||||
mapDataType.insert(std::make_pair((int) CAFE_STRING, "DBF_STRING" ));
|
||||
mapDataType.insert(std::make_pair((int) CAFE_SHORT, "DBF_SHORT" ));
|
||||
mapDataType.insert(std::make_pair((int) CAFE_INT, "DBF_SHORT" ));
|
||||
mapDataType.insert(std::make_pair((int) CAFE_FLOAT, "DBF_FLOAT" ));
|
||||
mapDataType.insert(std::make_pair((int) CAFE_ENUM, "DBF_ENUM" ));
|
||||
mapDataType.insert(std::make_pair((int) CAFE_CHAR, "DBF_CHAR" ));
|
||||
mapDataType.insert(std::make_pair((int) CAFE_LONG, "DBF_LONG" ));
|
||||
mapDataType.insert(std::make_pair((int) CAFE_DOUBLE, "DBF_DOUBLE" ));
|
||||
mapDataType.insert(std::make_pair((int) CAFE_NO_ACCESS, "DBF_NO_ACCESS" ));
|
||||
mapDataType.insert(std::make_pair((int) CAFE_INVALID_DATATYPE, "CAFE_INVALID_DATATYPE"));
|
||||
mapDataType.insert(std::make_pair((int) CAFE_NOT_REQUESTED, "CAFE_NOT_REQUESTED"));
|
||||
mapDataType.insert(std::make_pair((int) CAFE_NOT_SHOWN, "CAFE_NOT_SHOWN (IN STOP MONITOR)"));
|
||||
};
|
||||
CAFEDataTypeCode()
|
||||
{
|
||||
mapDataType.insert(std::make_pair((int) CAFE_TYPENOTCONN, "CAFE_TYPENOTCONN" ));
|
||||
mapDataType.insert(std::make_pair((int) CAFE_STRING, "DBF_STRING" ));
|
||||
mapDataType.insert(std::make_pair((int) CAFE_SHORT, "DBF_SHORT" ));
|
||||
mapDataType.insert(std::make_pair((int) CAFE_INT, "DBF_SHORT" ));
|
||||
mapDataType.insert(std::make_pair((int) CAFE_FLOAT, "DBF_FLOAT" ));
|
||||
mapDataType.insert(std::make_pair((int) CAFE_ENUM, "DBF_ENUM" ));
|
||||
mapDataType.insert(std::make_pair((int) CAFE_CHAR, "DBF_CHAR" ));
|
||||
mapDataType.insert(std::make_pair((int) CAFE_LONG, "DBF_LONG" ));
|
||||
mapDataType.insert(std::make_pair((int) CAFE_DOUBLE, "DBF_DOUBLE" ));
|
||||
mapDataType.insert(std::make_pair((int) CAFE_NO_ACCESS, "DBF_NO_ACCESS" ));
|
||||
mapDataType.insert(std::make_pair((int) CAFE_INVALID_DATATYPE, "CAFE_INVALID_DATATYPE"));
|
||||
mapDataType.insert(std::make_pair((int) CAFE_NOT_REQUESTED, "CAFE_NOT_REQUESTED"));
|
||||
mapDataType.insert(std::make_pair((int) CAFE_NOT_SHOWN, "CAFE_NOT_SHOWN (IN STOP MONITOR)"));
|
||||
};
|
||||
|
||||
~CAFEDataTypeCode() {};
|
||||
|
||||
std::string message (int i) {
|
||||
pos = mapDataType.find(i);
|
||||
if (pos != mapDataType.end()) return pos->second;
|
||||
return "CAFE_DATATYPE_UNKNOWN";
|
||||
};
|
||||
|
||||
|
||||
std::string asString (int i) {
|
||||
pos = mapDataType.find(i);
|
||||
if (pos != mapDataType.end()) return pos->second;
|
||||
return "CAFE_DATATYPE_UNKNOWN";
|
||||
};
|
||||
|
||||
int enumIs (std::string message) {
|
||||
for (pos=mapDataType.begin(); pos != mapDataType.end(); ++pos)
|
||||
if (pos->second==message) return pos->first;
|
||||
return -1;
|
||||
};
|
||||
|
||||
|
||||
int asEnum (std::string message) {
|
||||
for (pos=mapDataType.begin(); pos != mapDataType.end(); ++pos)
|
||||
if (pos->second==message) return pos->first;
|
||||
return -1;
|
||||
};
|
||||
~CAFEDataTypeCode() {};
|
||||
|
||||
void show() {print();}
|
||||
std::string message (int i)
|
||||
{
|
||||
pos = mapDataType.find(i);
|
||||
if (pos != mapDataType.end()) return pos->second;
|
||||
return "CAFE_DATATYPE_UNKNOWN";
|
||||
};
|
||||
|
||||
void print ( ) {
|
||||
std::cout << "------------------" << std::endl;
|
||||
std::cout << "CAFE_DATATYPE LIST" << std::endl;
|
||||
std::cout << "-----------------" << std::endl;
|
||||
for (pos=mapDataType.begin(); pos != mapDataType.end(); ++pos) {
|
||||
std::cout << pos->first << " " << pos->second << std::endl;
|
||||
|
||||
std::string asString (int i)
|
||||
{
|
||||
pos = mapDataType.find(i);
|
||||
if (pos != mapDataType.end()) return pos->second;
|
||||
return "CAFE_DATATYPE_UNKNOWN";
|
||||
};
|
||||
|
||||
int enumIs (std::string message)
|
||||
{
|
||||
for (pos=mapDataType.begin(); pos != mapDataType.end(); ++pos)
|
||||
if (pos->second==message) return pos->first;
|
||||
return -1;
|
||||
};
|
||||
|
||||
|
||||
int asEnum (std::string message)
|
||||
{
|
||||
for (pos=mapDataType.begin(); pos != mapDataType.end(); ++pos)
|
||||
if (pos->second==message) return pos->first;
|
||||
return -1;
|
||||
};
|
||||
|
||||
void show()
|
||||
{
|
||||
print();
|
||||
}
|
||||
std::cout << "-----------------" << std::endl;
|
||||
};
|
||||
|
||||
|
||||
void print ( )
|
||||
{
|
||||
std::cout << "------------------" << std::endl;
|
||||
std::cout << "CAFE_DATATYPE LIST" << std::endl;
|
||||
std::cout << "-----------------" << std::endl;
|
||||
for (pos=mapDataType.begin(); pos != mapDataType.end(); ++pos) {
|
||||
std::cout << pos->first << " " << pos->second << std::endl;
|
||||
}
|
||||
std::cout << "-----------------" << std::endl;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* A union of CAFE primitive datatypes
|
||||
*/
|
||||
union CAFE_DATATYPE_UNION {
|
||||
dbr_string_t str;
|
||||
dbr_short_t s;
|
||||
dbr_float_t f;
|
||||
dbr_enum_t us; //unsigned short us;
|
||||
dbr_char_t ch; //unsigned char ch;
|
||||
dbr_long_t l; //int l;
|
||||
dbr_double_t d;
|
||||
dbr_string_t str;
|
||||
dbr_short_t s;
|
||||
dbr_float_t f;
|
||||
dbr_enum_t us; //unsigned short us;
|
||||
dbr_char_t ch; //unsigned char ch;
|
||||
dbr_long_t l; //int l;
|
||||
dbr_double_t d;
|
||||
};
|
||||
|
||||
typedef CAFE_DATATYPE_UNION * CAFE_DATATYPE_UNION_SEQ;
|
||||
|
||||
@@ -6,26 +6,27 @@
|
||||
///
|
||||
|
||||
#ifndef CAFEDATATYPEHELPER_H
|
||||
#define CAFEDATATYPEHELP_H
|
||||
|
||||
#define CAFEDATATYPEHELPER_H
|
||||
|
||||
#include <cadef.h>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <cafeDataType.h>
|
||||
|
||||
class CafeDataTypeHelper{
|
||||
class CafeDataTypeHelper {
|
||||
private:
|
||||
CAFE_DATATYPE_UNION cdu;
|
||||
CAFE_DATATYPE dataType;
|
||||
|
||||
public:
|
||||
CafeDataTypeHelper(CAFE_DATATYPE_UNION _cdu, CAFE_DATATYPE _dataType){
|
||||
CafeDataTypeHelper(CAFE_DATATYPE_UNION _cdu, CAFE_DATATYPE _dataType)
|
||||
{
|
||||
cdu=_cdu;
|
||||
dataType=_dataType;
|
||||
};
|
||||
|
||||
~CafeDataTypeHelper(){};
|
||||
|
||||
~CafeDataTypeHelper() {};
|
||||
|
||||
CAFEConvert<double> renderDouble;
|
||||
CAFEConvert<float> renderFloat;
|
||||
@@ -43,23 +44,58 @@ public:
|
||||
CAFEConvert<int> renderInt;
|
||||
CAFEConvert<unsigned int> renderUInt;
|
||||
|
||||
std::string getAsString(){
|
||||
std::string getAsString()
|
||||
{
|
||||
return (std::string) renderString.getString(dataType, cdu)[0];
|
||||
};
|
||||
dbr_string_t * getAsDbr_string_t(){
|
||||
dbr_string_t * getAsDbr_string_t()
|
||||
{
|
||||
return (dbr_string_t *) (renderString.getString(dataType, cdu)[0]);
|
||||
};
|
||||
double getAsDouble(){return (double) renderDouble.get(dataType, cdu)[0];};
|
||||
float getAsFloat() {return (float) renderFloat.get (dataType, cdu)[0];};
|
||||
short getAsShort() {return (short) renderShort.get(dataType, cdu)[0];};
|
||||
dbr_enum_t getAsEnum(){return (dbr_enum_t) renderEnum.get(dataType, cdu)[0];};
|
||||
unsigned short getAsUShort(){return (unsigned short) renderEnum.get(dataType, cdu)[0];};
|
||||
int getAsInt() {return (int) renderInt.get(dataType, cdu)[0];};
|
||||
unsigned int getAsUInt() {return (int) renderUInt.get(dataType, cdu)[0];};
|
||||
char getAsChar() {return (char) renderChar.get(dataType, cdu)[0];};
|
||||
unsigned char getAsUChar(){return (unsigned char) renderUChar.get(dataType, cdu)[0];};
|
||||
long long getAsLongLong() {return (long long) renderLongLong.get(dataType, cdu)[0];};
|
||||
unsigned int getAsULongLong() {return (unsigned long long) renderULongLong.get(dataType, cdu)[0];};
|
||||
double getAsDouble()
|
||||
{
|
||||
return (double) renderDouble.get(dataType, cdu)[0];
|
||||
};
|
||||
float getAsFloat()
|
||||
{
|
||||
return (float) renderFloat.get (dataType, cdu)[0];
|
||||
};
|
||||
short getAsShort()
|
||||
{
|
||||
return (short) renderShort.get(dataType, cdu)[0];
|
||||
};
|
||||
dbr_enum_t getAsEnum()
|
||||
{
|
||||
return (dbr_enum_t) renderEnum.get(dataType, cdu)[0];
|
||||
};
|
||||
unsigned short getAsUShort()
|
||||
{
|
||||
return (unsigned short) renderEnum.get(dataType, cdu)[0];
|
||||
};
|
||||
int getAsInt()
|
||||
{
|
||||
return (int) renderInt.get(dataType, cdu)[0];
|
||||
};
|
||||
unsigned int getAsUInt()
|
||||
{
|
||||
return (int) renderUInt.get(dataType, cdu)[0];
|
||||
};
|
||||
char getAsChar()
|
||||
{
|
||||
return (char) renderChar.get(dataType, cdu)[0];
|
||||
};
|
||||
unsigned char getAsUChar()
|
||||
{
|
||||
return (unsigned char) renderUChar.get(dataType, cdu)[0];
|
||||
};
|
||||
long long getAsLongLong()
|
||||
{
|
||||
return (long long) renderLongLong.get(dataType, cdu)[0];
|
||||
};
|
||||
unsigned int getAsULongLong()
|
||||
{
|
||||
return (unsigned long long) renderULongLong.get(dataType, cdu)[0];
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -17,17 +17,17 @@ namespace CAFENUM {
|
||||
* i.e. whether PRIMITIVE, STS, TIME, GR or CTRL
|
||||
*/
|
||||
enum DBR_TYPE {
|
||||
DBR_PRIMITIVE,
|
||||
DBR_PLAIN=DBR_PRIMITIVE,
|
||||
DBR_STS,
|
||||
DBR_TIME,
|
||||
DBR_GR,
|
||||
DBR_CTRL,
|
||||
DBR_PUT, //DBR_PUT_ACKT and DBR_PUT_ACKS Write only - used from global alarm acknowledge.
|
||||
DBR_STSACK, // is DBR_STSACK_STRING
|
||||
DBR_CLASS, // is DBR_CLASS_NAME,
|
||||
DBR_NONE // should not occur, but used internally within cafeVectors.h
|
||||
};
|
||||
DBR_PRIMITIVE,
|
||||
DBR_PLAIN=DBR_PRIMITIVE,
|
||||
DBR_STS,
|
||||
DBR_TIME,
|
||||
DBR_GR,
|
||||
DBR_CTRL,
|
||||
DBR_PUT, //DBR_PUT_ACKT and DBR_PUT_ACKS Write only - used from global alarm acknowledge.
|
||||
DBR_STSACK, // is DBR_STSACK_STRING
|
||||
DBR_CLASS, // is DBR_CLASS_NAME,
|
||||
DBR_NONE // should not occur, but used internally within cafeVectors.h
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -71,7 +71,7 @@ enum ChannelServerDispatchPriority {
|
||||
CA_SERVER_DISPATCH_PRIORITY_VERYHIGH=CA_PRIORITY_MIN+98,
|
||||
CA_SERVER_DISPATCH_PRIORITY_MAX =CA_PRIORITY_MAX
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
@@ -80,10 +80,10 @@ enum ChannelServerDispatchPriority {
|
||||
* are never blocked
|
||||
*/
|
||||
enum ChannelGetCacheWaitPolicyKind {
|
||||
GET_CACHE_NO_CHECK=0,
|
||||
GET_CACHE_NO_WAIT,
|
||||
GET_CACHE_NOW =GET_CACHE_NO_WAIT,
|
||||
GET_CACHE_WAIT
|
||||
GET_CACHE_NO_CHECK=0,
|
||||
GET_CACHE_NO_WAIT,
|
||||
GET_CACHE_NOW =GET_CACHE_NO_WAIT,
|
||||
GET_CACHE_WAIT
|
||||
};
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ enum ChannelGetCacheWaitPolicyKind {
|
||||
*/
|
||||
enum ChannelGetActionWhenMonitorPolicyKind {
|
||||
GET_FROM_CACHE,
|
||||
GET_FROM_IOC
|
||||
GET_FROM_IOC
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -139,13 +139,13 @@ enum StatusMessageKind {
|
||||
FROM_PEND,
|
||||
FROM_CALLBACK,
|
||||
FROM_MESSAGE
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
enum CallbackProgressKind {
|
||||
NOT_INITIATED,
|
||||
PENDING,
|
||||
COMPLETE
|
||||
};
|
||||
};
|
||||
|
||||
}; //namespace CAFENUM
|
||||
|
||||
|
||||
@@ -14,31 +14,33 @@
|
||||
#include "enumStrings.h"
|
||||
|
||||
template<> char const * enumStrings<CAFENUM::ChannelWaitForResponsePolicyKind>::data[]
|
||||
= {"CAFENUM::WAIT", "CAFENUM::NO_WAIT"};
|
||||
= {"CAFENUM::WAIT", "CAFENUM::NO_WAIT"};
|
||||
|
||||
template<> char const * enumStrings<CAFENUM::ChannelRequestDataTypePolicyKind>::data[]
|
||||
= {"CAFENUM::NATIVE_DATATYPE", "CAFENUM::LOWEST_DATATYPE"};
|
||||
= {"CAFENUM::NATIVE_DATATYPE", "CAFENUM::LOWEST_DATATYPE"};
|
||||
|
||||
template<> char const * enumStrings<CAFENUM::ChannelFlushSendBufferPolicyKind>::data[]
|
||||
= {"CAFENUM::WITH_FLUSH_IO","CAFENUM::WITH_PEND_IO","CAFENUM::WITH_PEND_EVENT", "CAFENUM::WITH_POLL"};
|
||||
= {"CAFENUM::WITH_FLUSH_IO","CAFENUM::WITH_PEND_IO","CAFENUM::WITH_PEND_EVENT", "CAFENUM::WITH_POLL"};
|
||||
|
||||
template<> char const * enumStrings<CAFENUM::ChannelWhenToFlushSendBufferPolicyKind>::data[]
|
||||
= {"CAFENUM::FLUSH_AFTER_EACH_MESSAGE","CAFENUM::FLUSH_DESIGNATED_TO_CLIENT"};
|
||||
= {"CAFENUM::FLUSH_AFTER_EACH_MESSAGE","CAFENUM::FLUSH_DESIGNATED_TO_CLIENT"};
|
||||
|
||||
template<> char const * enumStrings<CAFENUM::ChannelRequestPolicyKind>::data[]
|
||||
= {"CAFENUM::WITHOUT_CALLBACK","CAFENUM::WITH_CALLBACK_DEFAULT","CAFENUM::WITH_CALLBACK_USER_SUPPLIED"};
|
||||
= {"CAFENUM::WITHOUT_CALLBACK","CAFENUM::WITH_CALLBACK_DEFAULT","CAFENUM::WITH_CALLBACK_USER_SUPPLIED"};
|
||||
|
||||
template<> char const * enumStrings<CAFENUM::DBR_TYPE>::data[]
|
||||
= {"CAFENUM::DBR_PRIMITIVE","CAFENUM::DBR_STS","CAFENUM::DBR_TIME", "CAFENUM::DBR_GR",
|
||||
"CAFENUM::DBR_CTRL","CAFENUM::DBR_PUT", "CAFENUM::DBR_STSACK","CAFENUM::DBR_CLASS",
|
||||
"CAFENUM::DBR_OTHER"};
|
||||
= {"CAFENUM::DBR_PRIMITIVE","CAFENUM::DBR_STS","CAFENUM::DBR_TIME", "CAFENUM::DBR_GR",
|
||||
"CAFENUM::DBR_CTRL","CAFENUM::DBR_PUT", "CAFENUM::DBR_STSACK","CAFENUM::DBR_CLASS",
|
||||
"CAFENUM::DBR_OTHER"
|
||||
};
|
||||
|
||||
template<> char const * enumStrings<CAFENUM::StatusMessageKind>::data[]
|
||||
= {"CAFENUM::NO_MESSAGE","CAFENUM::PRE_REQUEST","CAFENUM::FROM_REQUEST","CAFENUM::FROM_PEND",
|
||||
"CAFENUM::FROM_CALLBACK"};
|
||||
= {"CAFENUM::NO_MESSAGE","CAFENUM::PRE_REQUEST","CAFENUM::FROM_REQUEST","CAFENUM::FROM_PEND",
|
||||
"CAFENUM::FROM_CALLBACK"
|
||||
};
|
||||
|
||||
template<> char const * enumStrings<CAFENUM::CallbackProgressKind>::data[]
|
||||
= {"CAFENUM::NOT_INITIATED","CAFENUM::PENDING","CAFENUM::COMPLETE"};
|
||||
= {"CAFENUM::NOT_INITIATED","CAFENUM::PENDING","CAFENUM::COMPLETE"};
|
||||
|
||||
|
||||
#endif // CAFEENUMSTRINGS_H
|
||||
|
||||
@@ -3,102 +3,122 @@
|
||||
/// \author Jan Chrin, PSI
|
||||
/// \date Release: January 2016
|
||||
/// \version CAFE 1.3.0
|
||||
///
|
||||
///
|
||||
/// Add Match methods
|
||||
///
|
||||
///
|
||||
|
||||
#ifndef CAFEROAST_H
|
||||
#define CAFEROAST_H
|
||||
|
||||
|
||||
int setAndGet (const unsigned int handleSet, dbr_double_t valSet, dbr_double_t &valGet) {
|
||||
int setAndGet (const unsigned int handleSet, dbr_double_t valSet, dbr_double_t &valGet)
|
||||
{
|
||||
status=cafeDoppio.setAndGet((unsigned int) handleSet, DBR_DOUBLE, valSet, valGet);
|
||||
return status;
|
||||
}
|
||||
int setAndGet (const unsigned int handleSet, dbr_float_t valSet, dbr_float_t &valGet) {
|
||||
int setAndGet (const unsigned int handleSet, dbr_float_t valSet, dbr_float_t &valGet)
|
||||
{
|
||||
status=cafeFrappuccino.setAndGet((unsigned int) handleSet, DBR_FLOAT, valSet, valGet);
|
||||
return status;
|
||||
}
|
||||
int setAndGet (const unsigned int handleSet, dbr_char_t valSet, dbr_char_t &valGet) {
|
||||
int setAndGet (const unsigned int handleSet, dbr_char_t valSet, dbr_char_t &valGet)
|
||||
{
|
||||
status=cafeCappuccino.setAndGet((unsigned int) handleSet, DBR_CHAR, valSet, valGet);
|
||||
return status;
|
||||
}
|
||||
int setAndGet (const unsigned int handleSet, dbr_enum_t valSet, dbr_enum_t &valGet) {
|
||||
int setAndGet (const unsigned int handleSet, dbr_enum_t valSet, dbr_enum_t &valGet)
|
||||
{
|
||||
status=cafeEspresso.setAndGet((unsigned int) handleSet, DBR_ENUM, valSet, valGet);
|
||||
return status;
|
||||
}
|
||||
int setAndGet (const unsigned int handleSet, dbr_short_t valSet, dbr_short_t &valGet) {
|
||||
int setAndGet (const unsigned int handleSet, dbr_short_t valSet, dbr_short_t &valGet)
|
||||
{
|
||||
status=cafeSchale.setAndGet((unsigned int) handleSet, DBR_SHORT, valSet, valGet);
|
||||
return status;
|
||||
}
|
||||
int setAndGet (const unsigned int handleSet, dbr_long_t valSet, dbr_long_t &valGet) {
|
||||
int setAndGet (const unsigned int handleSet, dbr_long_t valSet, dbr_long_t &valGet)
|
||||
{
|
||||
status=cafeLatte.setAndGet((unsigned int) handleSet, DBR_LONG, valSet, valGet);
|
||||
return status;
|
||||
}
|
||||
int setAndGet (const unsigned int handleSet, long long valSet, long long &valGet) {
|
||||
double valSetD=valSet; double valGetD=0;
|
||||
int setAndGet (const unsigned int handleSet, long long valSet, long long &valGet)
|
||||
{
|
||||
double valSetD=valSet;
|
||||
double valGetD=0;
|
||||
status=cafeDoppio.setAndGet((unsigned int) handleSet, DBR_DOUBLE, valSetD, valGetD);
|
||||
valGet=(long long) valGetD;
|
||||
return status;
|
||||
}
|
||||
int setAndGet (const unsigned int handleSet, dbr_string_t valSet, dbr_string_t &valGet) {
|
||||
int setAndGet (const unsigned int handleSet, dbr_string_t valSet, dbr_string_t &valGet)
|
||||
{
|
||||
status=cafeSoluble.setAndGetDbrString((unsigned int) handleSet, valSet, valGet);
|
||||
return status;
|
||||
return status;
|
||||
}
|
||||
int setAndGet (const unsigned int handleSet, string valSet, string &valGet) {
|
||||
int setAndGet (const unsigned int handleSet, std::string valSet, std::string &valGet)
|
||||
{
|
||||
status=cafeSoluble.setAndGetString((unsigned int) handleSet, valSet, valGet);
|
||||
return status;
|
||||
return status;
|
||||
}
|
||||
|
||||
//
|
||||
int match(dbr_double_t valSet, unsigned int handleMatch,
|
||||
dbr_double_t tolerance, double timeout, bool printFlag){
|
||||
dbr_double_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
return cafeDoppio.match(DBR_DOUBLE, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
|
||||
|
||||
int match(dbr_float_t valSet, unsigned int handleMatch,
|
||||
dbr_float_t tolerance, double timeout, bool printFlag){
|
||||
dbr_float_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
return cafeFrappuccino.match(DBR_FLOAT, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
|
||||
|
||||
int match(dbr_char_t valSet, unsigned int handleMatch,
|
||||
dbr_char_t tolerance, double timeout, bool printFlag){
|
||||
dbr_char_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
return cafeCappuccino.match(DBR_CHAR, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
|
||||
int match(dbr_enum_t valSet, unsigned int handleMatch,
|
||||
dbr_enum_t tolerance, double timeout, bool printFlag){
|
||||
dbr_enum_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
return cafeEspresso.match(DBR_ENUM, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
|
||||
int match(dbr_short_t valSet, unsigned int handleMatch,
|
||||
dbr_short_t tolerance, double timeout, bool printFlag){
|
||||
dbr_short_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
return cafeSchale.match(DBR_SHORT, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
|
||||
|
||||
int match(dbr_long_t valSet, unsigned int handleMatch,
|
||||
dbr_long_t tolerance, double timeout, bool printFlag){
|
||||
dbr_long_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
return cafeLatte.match(DBR_LONG, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
|
||||
|
||||
int match(long long valSet, unsigned int handleMatch,
|
||||
long long tolerance, double timeout, bool printFlag){
|
||||
dbr_double_t valSetDouble=valSet;
|
||||
dbr_double_t toleranceDouble = tolerance;
|
||||
long long tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
dbr_double_t valSetDouble=valSet;
|
||||
dbr_double_t toleranceDouble = tolerance;
|
||||
return cafeDoppio.match(DBR_DOUBLE, valSetDouble, handleMatch, toleranceDouble, timeout, printFlag);
|
||||
}
|
||||
|
||||
int match(string valSet, unsigned int handleMatch,
|
||||
string tolerance, double timeout, bool printFlag){
|
||||
int match(std::string valSet, unsigned int handleMatch,
|
||||
std::string tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
#define __METHOD__ "match (string valSet, unsigned int handleMatch,\
|
||||
string tolerance, double timeout, bool printFlag)"
|
||||
|
||||
istringstream ss;
|
||||
dbr_double_t d=0; dbr_double_t valSetDouble=0; dbr_double_t toleranceDouble = 0;
|
||||
|
||||
std::istringstream ss;
|
||||
dbr_double_t d=0;
|
||||
dbr_double_t valSetDouble=0;
|
||||
dbr_double_t toleranceDouble = 0;
|
||||
ss.clear();
|
||||
ss.str(valSet);
|
||||
ss>>d;
|
||||
@@ -107,11 +127,11 @@ int match(string valSet, unsigned int handleMatch,
|
||||
valSetDouble=d;
|
||||
}
|
||||
else {
|
||||
cout << __METHOD__ << __LINE__ << endl;
|
||||
cout << "***WARNING*** NO STRING TO DBR_DOUBLE CONVERSION " << endl;
|
||||
cout << "***WARNING*** COULD NOT CONVERT: ";
|
||||
cout << valSet;
|
||||
cout << " TO DOUBLE!" << endl;
|
||||
std::cout << __METHOD__ << __LINE__ << std::endl;
|
||||
std::cout << "***WARNING*** NO STRING TO DBR_DOUBLE CONVERSION " << std::endl;
|
||||
std::cout << "***WARNING*** COULD NOT CONVERT: ";
|
||||
std::cout << valSet;
|
||||
std::cout << " TO DOUBLE!" << std::endl;
|
||||
return ECAFE_NO_CONVERT;
|
||||
}
|
||||
d=0;
|
||||
@@ -123,26 +143,29 @@ int match(string valSet, unsigned int handleMatch,
|
||||
toleranceDouble=d;
|
||||
}
|
||||
else {
|
||||
cout << __METHOD__ << __LINE__ << endl;
|
||||
cout << "***WARNING*** NO STRING TO DBR_DOUBLE CONVERSION " << endl;
|
||||
cout << "***WARNING*** COULD NOT CONVERT: ";
|
||||
cout << tolerance;
|
||||
cout << " TO DOUBLE!" << endl;
|
||||
std::cout << __METHOD__ << __LINE__ << std::endl;
|
||||
std::cout << "***WARNING*** NO STRING TO DBR_DOUBLE CONVERSION " << std::endl;
|
||||
std::cout << "***WARNING*** COULD NOT CONVERT: ";
|
||||
std::cout << tolerance;
|
||||
std::cout << " TO DOUBLE!" << std::endl;
|
||||
return ECAFE_NO_CONVERT;
|
||||
}
|
||||
|
||||
return cafeDoppio.match(DBR_DOUBLE, valSetDouble, handleMatch, toleranceDouble, timeout, printFlag);
|
||||
#undef __METHOD__
|
||||
#undef __METHOD__
|
||||
}
|
||||
|
||||
|
||||
|
||||
int match(dbr_string_t valSet, unsigned int handleMatch,
|
||||
dbr_string_t tolerance, double timeout, bool printFlag){
|
||||
dbr_string_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
#define __METHOD__ "match (dbr_string_t valSet, unsigned int handleMatch,\
|
||||
dbr_string_t tolerance, double timeout, bool printFlag)"
|
||||
istringstream ss;
|
||||
dbr_double_t d=0; dbr_double_t valSetDouble=0; dbr_double_t toleranceDouble = 0;
|
||||
std::istringstream ss;
|
||||
dbr_double_t d=0;
|
||||
dbr_double_t valSetDouble=0;
|
||||
dbr_double_t toleranceDouble = 0;
|
||||
ss.clear();
|
||||
ss.str(valSet);
|
||||
ss>>d;
|
||||
@@ -151,11 +174,11 @@ int match(dbr_string_t valSet, unsigned int handleMatch,
|
||||
valSetDouble=d;
|
||||
}
|
||||
else {
|
||||
cout << __METHOD__ << __LINE__ << endl;
|
||||
cout << "***WARNING*** NO STRING TO DBR_DOUBLE CONVERSION " << endl;
|
||||
cout << "***WARNING*** COULD NOT CONVERT: ";
|
||||
cout << valSet;
|
||||
cout << " TO DOUBLE!" << endl;
|
||||
std::cout << __METHOD__ << __LINE__ << std::endl;
|
||||
std::cout << "***WARNING*** NO STRING TO DBR_DOUBLE CONVERSION " << std::endl;
|
||||
std::cout << "***WARNING*** COULD NOT CONVERT: ";
|
||||
std::cout << valSet;
|
||||
std::cout << " TO DOUBLE!" << std::endl;
|
||||
return ECAFE_NO_CONVERT;
|
||||
}
|
||||
d=0;
|
||||
@@ -167,95 +190,104 @@ int match(dbr_string_t valSet, unsigned int handleMatch,
|
||||
toleranceDouble=d;
|
||||
}
|
||||
else {
|
||||
cout << __METHOD__ << __LINE__ << endl;
|
||||
cout << "***WARNING*** NO STRING TO DBR_DOUBLE CONVERSION " << endl;
|
||||
cout << "***WARNING*** COULD NOT CONVERT: ";
|
||||
cout << tolerance;
|
||||
cout << " TO DOUBLE!" << endl;
|
||||
std::cout << __METHOD__ << __LINE__ << std::endl;
|
||||
std::cout << "***WARNING*** NO STRING TO DBR_DOUBLE CONVERSION " << std::endl;
|
||||
std::cout << "***WARNING*** COULD NOT CONVERT: ";
|
||||
std::cout << tolerance;
|
||||
std::cout << " TO DOUBLE!" << std::endl;
|
||||
return ECAFE_NO_CONVERT;
|
||||
}
|
||||
|
||||
return cafeDoppio.match(DBR_DOUBLE, valSetDouble, handleMatch, toleranceDouble, timeout, printFlag);
|
||||
#undef __METHOD__
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return cafeDoppio.match(DBR_DOUBLE, valSetDouble, handleMatch, toleranceDouble, timeout, printFlag);
|
||||
#undef __METHOD__
|
||||
}
|
||||
|
||||
//
|
||||
int matchMany(vector<dbr_double_t> valSet, vector<unsigned int> handleMatch,
|
||||
dbr_double_t tolerance, double timeout, bool printFlag){
|
||||
int matchMany(std::vector<dbr_double_t> valSet, std::vector<unsigned int> handleMatch,
|
||||
dbr_double_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
return cafeDoppio.matchMany(DBR_DOUBLE, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
|
||||
|
||||
int matchMany(vector<dbr_float_t> valSet, vector<unsigned int> handleMatch,
|
||||
dbr_float_t tolerance, double timeout, bool printFlag){
|
||||
int matchMany(std::vector<dbr_float_t> valSet, std::vector<unsigned int> handleMatch,
|
||||
dbr_float_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
return cafeFrappuccino.matchMany(DBR_FLOAT, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
|
||||
|
||||
int matchMany(vector<dbr_char_t> valSet, vector<unsigned int> handleMatch,
|
||||
dbr_char_t tolerance, double timeout, bool printFlag){
|
||||
int matchMany(std::vector<dbr_char_t> valSet, std::vector<unsigned int> handleMatch,
|
||||
dbr_char_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
return cafeCappuccino.matchMany(DBR_CHAR, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
|
||||
int matchMany(vector<dbr_enum_t> valSet, vector<unsigned int> handleMatch,
|
||||
dbr_enum_t tolerance, double timeout, bool printFlag){
|
||||
int matchMany(std::vector<dbr_enum_t> valSet, std::vector<unsigned int> handleMatch,
|
||||
dbr_enum_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
return cafeEspresso.matchMany(DBR_ENUM, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
|
||||
int matchMany(vector<dbr_short_t> valSet, vector<unsigned int> handleMatch,
|
||||
dbr_short_t tolerance, double timeout, bool printFlag){
|
||||
int matchMany(std::vector<dbr_short_t> valSet, std::vector<unsigned int> handleMatch,
|
||||
dbr_short_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
return cafeSchale.matchMany(DBR_SHORT, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
|
||||
|
||||
int matchMany(vector<dbr_long_t> valSet, vector<unsigned int> handleMatch,
|
||||
dbr_long_t tolerance, double timeout, bool printFlag){
|
||||
int matchMany(std::vector<dbr_long_t> valSet, std::vector<unsigned int> handleMatch,
|
||||
dbr_long_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
return cafeLatte.matchMany(DBR_LONG, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
|
||||
|
||||
int matchMany(vector<long long> valSet, vector<unsigned int> handleMatch,
|
||||
long long tolerance, double timeout, bool printFlag){
|
||||
|
||||
vector<dbr_double_t> valSetDoubleV;
|
||||
valSetDoubleV.reserve(valSet.size());
|
||||
|
||||
std::copy(valSet.begin(), valSet.end(),
|
||||
std::back_inserter(valSetDoubleV));
|
||||
|
||||
int matchMany(std::vector<long long> valSet, std::vector<unsigned int> handleMatch,
|
||||
long long tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
|
||||
std::vector<dbr_double_t> valSetDoubleV;
|
||||
valSetDoubleV.reserve(valSet.size());
|
||||
|
||||
std::copy(valSet.begin(), valSet.end(),
|
||||
std::back_inserter(valSetDoubleV));
|
||||
|
||||
dbr_double_t toleranceDouble = tolerance;
|
||||
|
||||
|
||||
return cafeDoppio.matchMany(DBR_DOUBLE, valSetDoubleV, handleMatch, toleranceDouble, timeout, printFlag);
|
||||
}
|
||||
|
||||
int matchMany(vector<string> valSetV, vector<unsigned int> handleMatchV,
|
||||
string tolerance, double timeout, bool printFlag){
|
||||
#define __METHOD__ "matchMany (vector<string> valSetV, vector<unsigned int> handleMatchV, \
|
||||
int matchMany(std::vector<std::string> valSetV, std::vector<unsigned int> handleMatchV,
|
||||
std::string tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
#define __METHOD__ "matchMany (std::vector<string> valSetV, std::vector<unsigned int> handleMatchV, \
|
||||
string tolerance, double timeout, bool printFlag)"
|
||||
|
||||
vector<dbr_double_t> valSetDoubleV;
|
||||
std::vector<dbr_double_t> valSetDoubleV;
|
||||
|
||||
std::istringstream ss;
|
||||
dbr_double_t d=0;
|
||||
dbr_double_t toleranceDouble = 0;
|
||||
for (size_t i=0; i< valSetV.size(); ++i) {
|
||||
d=0;
|
||||
ss.clear();
|
||||
ss.str(valSetV[i]);
|
||||
ss>>d;
|
||||
|
||||
if ( !ss.fail()) {
|
||||
valSetDoubleV.push_back(d);
|
||||
}
|
||||
else {
|
||||
std::cout << __METHOD__ << __LINE__ << std::endl;
|
||||
std::cout << "***WARNING*** NO STRING TO DBR_DOUBLE CONVERSION " << std::endl;
|
||||
std::cout << "***WARNING*** COULD NOT CONVERT: ";
|
||||
std::cout << valSetV[i];
|
||||
std::cout << " TO DOUBLE!" << std::endl;
|
||||
return ECAFE_NO_CONVERT;
|
||||
}
|
||||
}
|
||||
|
||||
istringstream ss;
|
||||
dbr_double_t d=0; dbr_double_t toleranceDouble = 0;
|
||||
for (size_t i=0; i< valSetV.size(); ++i) {
|
||||
d=0;
|
||||
ss.clear();
|
||||
ss.str(valSetV[i]);
|
||||
ss>>d;
|
||||
|
||||
if ( !ss.fail()) {
|
||||
valSetDoubleV.push_back(d);
|
||||
}
|
||||
else {
|
||||
cout << __METHOD__ << __LINE__ << endl;
|
||||
cout << "***WARNING*** NO STRING TO DBR_DOUBLE CONVERSION " << endl;
|
||||
cout << "***WARNING*** COULD NOT CONVERT: ";
|
||||
cout << valSetV[i];
|
||||
cout << " TO DOUBLE!" << endl;
|
||||
return ECAFE_NO_CONVERT;
|
||||
}
|
||||
}
|
||||
|
||||
d=0;
|
||||
ss.clear();
|
||||
ss.str(tolerance);
|
||||
@@ -265,11 +297,11 @@ int matchMany(vector<string> valSetV, vector<unsigned int> handleMatchV,
|
||||
toleranceDouble=d;
|
||||
}
|
||||
else {
|
||||
cout << __METHOD__ << __LINE__ << endl;
|
||||
cout << "***WARNING*** NO STRING TO DBR_DOUBLE CONVERSION " << endl;
|
||||
cout << "***WARNING*** COULD NOT CONVERT: ";
|
||||
cout << tolerance;
|
||||
cout << " TO DOUBLE!" << endl;
|
||||
std::cout << __METHOD__ << __LINE__ << std::endl;
|
||||
std::cout << "***WARNING*** NO STRING TO DBR_DOUBLE CONVERSION " << std::endl;
|
||||
std::cout << "***WARNING*** COULD NOT CONVERT: ";
|
||||
std::cout << tolerance;
|
||||
std::cout << " TO DOUBLE!" << std::endl;
|
||||
return ECAFE_NO_CONVERT;
|
||||
}
|
||||
|
||||
@@ -280,84 +312,93 @@ int matchMany(vector<string> valSetV, vector<unsigned int> handleMatchV,
|
||||
|
||||
|
||||
|
||||
int setAndMatchMany(vector<unsigned int> handleSet, vector<dbr_double_t> valSet, vector<unsigned int> handleMatch,
|
||||
dbr_double_t tolerance, double timeout, bool printFlag){
|
||||
int setAndMatchMany(std::vector<unsigned int> handleSet, std::vector<dbr_double_t> valSet, std::vector<unsigned int> handleMatch,
|
||||
dbr_double_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
return cafeDoppio.setAndMatchMany(handleSet, DBR_DOUBLE, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
|
||||
|
||||
int setAndMatchMany(vector<unsigned int> handleSet, vector<dbr_float_t> valSet, vector<unsigned int> handleMatch,
|
||||
dbr_float_t tolerance, double timeout, bool printFlag){
|
||||
int setAndMatchMany(std::vector<unsigned int> handleSet, std::vector<dbr_float_t> valSet, std::vector<unsigned int> handleMatch,
|
||||
dbr_float_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
return cafeFrappuccino.setAndMatchMany(handleSet, DBR_FLOAT, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
|
||||
|
||||
int setAndMatchMany(vector<unsigned int> handleSet, vector<dbr_char_t> valSet, vector<unsigned int> handleMatch,
|
||||
dbr_char_t tolerance, double timeout, bool printFlag){
|
||||
int setAndMatchMany(std::vector<unsigned int> handleSet, std::vector<dbr_char_t> valSet, std::vector<unsigned int> handleMatch,
|
||||
dbr_char_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
return cafeCappuccino.setAndMatchMany(handleSet, DBR_CHAR, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
|
||||
|
||||
int setAndMatchMany(vector<unsigned int> handleSet, vector<dbr_enum_t> valSet, vector<unsigned int> handleMatch,
|
||||
dbr_enum_t tolerance, double timeout, bool printFlag){
|
||||
int setAndMatchMany(std::vector<unsigned int> handleSet, std::vector<dbr_enum_t> valSet, std::vector<unsigned int> handleMatch,
|
||||
dbr_enum_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
return cafeEspresso.setAndMatchMany(handleSet, DBR_ENUM, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
|
||||
int setAndMatchMany(vector<unsigned int> handleSet, vector<dbr_short_t> valSet, vector<unsigned int> handleMatch,
|
||||
dbr_short_t tolerance, double timeout, bool printFlag){
|
||||
int setAndMatchMany(std::vector<unsigned int> handleSet, std::vector<dbr_short_t> valSet, std::vector<unsigned int> handleMatch,
|
||||
dbr_short_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
return cafeSchale.setAndMatchMany(handleSet, DBR_SHORT, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
|
||||
|
||||
int setAndMatchMany(vector<unsigned int> handleSet, vector<dbr_long_t> valSet, vector<unsigned int> handleMatch,
|
||||
dbr_long_t tolerance, double timeout, bool printFlag){
|
||||
int setAndMatchMany(std::vector<unsigned int> handleSet, std::vector<dbr_long_t> valSet, std::vector<unsigned int> handleMatch,
|
||||
dbr_long_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
return cafeLatte.setAndMatchMany(handleSet, DBR_LONG, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
|
||||
|
||||
int setAndMatchMany(vector<unsigned int> handleSet, vector<long long> valSet, vector<unsigned int> handleMatch,
|
||||
long long tolerance, double timeout, bool printFlag){
|
||||
|
||||
vector<dbr_double_t> valSetDoubleV;
|
||||
valSetDoubleV.reserve(valSet.size());
|
||||
|
||||
std::copy(valSet.begin(), valSet.end(),
|
||||
std::back_inserter(valSetDoubleV));
|
||||
|
||||
dbr_double_t toleranceDouble = tolerance;
|
||||
|
||||
int setAndMatchMany(std::vector<unsigned int> handleSet, std::vector<long long> valSet, std::vector<unsigned int> handleMatch,
|
||||
long long tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
|
||||
std::vector<dbr_double_t> valSetDoubleV;
|
||||
valSetDoubleV.reserve(valSet.size());
|
||||
|
||||
std::copy(valSet.begin(), valSet.end(),
|
||||
std::back_inserter(valSetDoubleV));
|
||||
|
||||
dbr_double_t toleranceDouble = tolerance;
|
||||
|
||||
return cafeDoppio.setAndMatchMany(handleSet, DBR_DOUBLE, valSetDoubleV, handleMatch, toleranceDouble, timeout, printFlag);
|
||||
}
|
||||
|
||||
|
||||
int setAndMatchMany(vector<unsigned int> handleSetV, vector<string> valSetV, vector<unsigned int> handleMatchV,
|
||||
string tolerance, double timeout, bool printFlag){
|
||||
#define __METHOD__ "setAndMatchMany (vector<unsigned int> handleSetV, vector<string> valSetV, vector<unsigned int> handleMatchV, \
|
||||
int setAndMatchMany(std::vector<unsigned int> handleSetV, std::vector<std::string> valSetV, std::vector<unsigned int> handleMatchV,
|
||||
std::string tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
#define __METHOD__ "setAndMatchMany (std::vector<unsigned int> handleSetV, std::vector<string> valSetV, std::vector<unsigned int> handleMatchV, \
|
||||
string tolerance, double timeout, bool printFlag)"
|
||||
|
||||
vector<dbr_double_t> valSetDoubleV;
|
||||
std::vector<dbr_double_t> valSetDoubleV;
|
||||
|
||||
std::istringstream ss;
|
||||
dbr_double_t d=0;
|
||||
dbr_double_t toleranceDouble = 0;
|
||||
for (size_t i=0; i< valSetV.size(); ++i) {
|
||||
d=0;
|
||||
ss.clear();
|
||||
ss.str(valSetV[i]);
|
||||
ss>>d;
|
||||
|
||||
if ( !ss.fail()) {
|
||||
valSetDoubleV.push_back(d);
|
||||
}
|
||||
else {
|
||||
std::cout << __METHOD__ << __LINE__ << std::endl;
|
||||
std::cout << "***WARNING*** NO STRING TO DBR_DOUBLE CONVERSION " << std::endl;
|
||||
std::cout << "***WARNING*** COULD NOT CONVERT: ";
|
||||
std::cout << valSetV[i];
|
||||
std::cout << " TO DOUBLE!" << std::endl;
|
||||
return ECAFE_NO_CONVERT;
|
||||
}
|
||||
}
|
||||
|
||||
istringstream ss;
|
||||
dbr_double_t d=0; dbr_double_t toleranceDouble = 0;
|
||||
for (size_t i=0; i< valSetV.size(); ++i) {
|
||||
d=0;
|
||||
ss.clear();
|
||||
ss.str(valSetV[i]);
|
||||
ss>>d;
|
||||
|
||||
if ( !ss.fail()) {
|
||||
valSetDoubleV.push_back(d);
|
||||
}
|
||||
else {
|
||||
cout << __METHOD__ << __LINE__ << endl;
|
||||
cout << "***WARNING*** NO STRING TO DBR_DOUBLE CONVERSION " << endl;
|
||||
cout << "***WARNING*** COULD NOT CONVERT: ";
|
||||
cout << valSetV[i];
|
||||
cout << " TO DOUBLE!" << endl;
|
||||
return ECAFE_NO_CONVERT;
|
||||
}
|
||||
}
|
||||
|
||||
d=0;
|
||||
ss.clear();
|
||||
ss.str(tolerance);
|
||||
@@ -367,11 +408,11 @@ int setAndMatchMany(vector<unsigned int> handleSetV, vector<string> valSetV, vec
|
||||
toleranceDouble=d;
|
||||
}
|
||||
else {
|
||||
cout << __METHOD__ << __LINE__ << endl;
|
||||
cout << "***WARNING*** NO STRING TO DBR_DOUBLE CONVERSION " << endl;
|
||||
cout << "***WARNING*** COULD NOT CONVERT: ";
|
||||
cout << tolerance;
|
||||
cout << " TO DOUBLE!" << endl;
|
||||
std::cout << __METHOD__ << __LINE__ << std::endl;
|
||||
std::cout << "***WARNING*** NO STRING TO DBR_DOUBLE CONVERSION " << std::endl;
|
||||
std::cout << "***WARNING*** COULD NOT CONVERT: ";
|
||||
std::cout << tolerance;
|
||||
std::cout << " TO DOUBLE!" << std::endl;
|
||||
return ECAFE_NO_CONVERT;
|
||||
}
|
||||
|
||||
@@ -384,106 +425,115 @@ int setAndMatchMany(vector<unsigned int> handleSetV, vector<string> valSetV, vec
|
||||
|
||||
|
||||
|
||||
int gameSetAndMatch(vector<unsigned int> handleSet, vector<dbr_double_t> valSet,
|
||||
vector<unsigned int> handleAction, vector<string> valAction, vector<unsigned int> handleMatch,
|
||||
dbr_double_t tolerance, double timeout, bool printFlag){
|
||||
cafeDoppio.setMany (handleSet, DBR_DOUBLE, valSet, false);
|
||||
cafeSoluble.setManyString (handleAction, valAction, false);
|
||||
int gameSetAndMatch(std::vector<unsigned int> handleSet, std::vector<dbr_double_t> valSet,
|
||||
std::vector<unsigned int> handleAction, std::vector<std::string> valAction, std::vector<unsigned int> handleMatch,
|
||||
dbr_double_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
cafeDoppio.setMany (handleSet, DBR_DOUBLE, valSet, false);
|
||||
cafeSoluble.setManyString (handleAction, valAction, false);
|
||||
return cafeDoppio.compareAndMatchMany(handleSet, DBR_DOUBLE, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
|
||||
|
||||
int gameSetAndMatch(vector<unsigned int> handleSet, vector<dbr_float_t> valSet,
|
||||
vector<unsigned int> handleAction, vector<string> valAction, vector<unsigned int> handleMatch,
|
||||
dbr_float_t tolerance, double timeout, bool printFlag){
|
||||
cafeFrappuccino.setMany (handleSet, DBR_FLOAT, valSet, false);
|
||||
cafeSoluble.setManyString (handleAction, valAction, false);
|
||||
return cafeFrappuccino.compareAndMatchMany(handleSet, DBR_FLOAT, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
int gameSetAndMatch(std::vector<unsigned int> handleSet, std::vector<dbr_float_t> valSet,
|
||||
std::vector<unsigned int> handleAction, std::vector<std::string> valAction, std::vector<unsigned int> handleMatch,
|
||||
dbr_float_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
cafeFrappuccino.setMany (handleSet, DBR_FLOAT, valSet, false);
|
||||
cafeSoluble.setManyString (handleAction, valAction, false);
|
||||
return cafeFrappuccino.compareAndMatchMany(handleSet, DBR_FLOAT, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
|
||||
|
||||
int gameSetAndMatch(vector<unsigned int> handleSet, vector<dbr_char_t> valSet,
|
||||
vector<unsigned int> handleAction, vector<string> valAction, vector<unsigned int> handleMatch,
|
||||
dbr_char_t tolerance, double timeout, bool printFlag){
|
||||
cafeCappuccino.setMany (handleSet, DBR_CHAR, valSet, false);
|
||||
cafeSoluble.setManyString (handleAction, valAction, false);
|
||||
return cafeCappuccino.compareAndMatchMany(handleSet, DBR_CHAR, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
int gameSetAndMatch(std::vector<unsigned int> handleSet, std::vector<dbr_char_t> valSet,
|
||||
std::vector<unsigned int> handleAction, std::vector<std::string> valAction, std::vector<unsigned int> handleMatch,
|
||||
dbr_char_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
cafeCappuccino.setMany (handleSet, DBR_CHAR, valSet, false);
|
||||
cafeSoluble.setManyString (handleAction, valAction, false);
|
||||
return cafeCappuccino.compareAndMatchMany(handleSet, DBR_CHAR, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
|
||||
|
||||
int gameSetAndMatch(vector<unsigned int> handleSet, vector<dbr_enum_t> valSet,
|
||||
vector<unsigned int> handleAction, vector<string> valAction, vector<unsigned int> handleMatch,
|
||||
dbr_enum_t tolerance, double timeout, bool printFlag){
|
||||
cafeEspresso.setMany (handleSet, DBR_ENUM, valSet, false);
|
||||
cafeSoluble.setManyString (handleAction, valAction, false);
|
||||
return cafeEspresso.compareAndMatchMany(handleSet, DBR_ENUM, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
int gameSetAndMatch(std::vector<unsigned int> handleSet, std::vector<dbr_enum_t> valSet,
|
||||
std::vector<unsigned int> handleAction, std::vector<std::string> valAction, std::vector<unsigned int> handleMatch,
|
||||
dbr_enum_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
cafeEspresso.setMany (handleSet, DBR_ENUM, valSet, false);
|
||||
cafeSoluble.setManyString (handleAction, valAction, false);
|
||||
return cafeEspresso.compareAndMatchMany(handleSet, DBR_ENUM, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
|
||||
int gameSetAndMatch(vector<unsigned int> handleSet, vector<dbr_short_t> valSet,
|
||||
vector<unsigned int> handleAction, vector<string> valAction, vector<unsigned int> handleMatch,
|
||||
dbr_short_t tolerance, double timeout, bool printFlag){
|
||||
cafeSchale.setMany (handleSet, DBR_SHORT, valSet, false);
|
||||
cafeSoluble.setManyString (handleAction, valAction, false);
|
||||
return cafeSchale.compareAndMatchMany(handleSet, DBR_SHORT, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
int gameSetAndMatch(std::vector<unsigned int> handleSet, std::vector<dbr_short_t> valSet,
|
||||
std::vector<unsigned int> handleAction, std::vector<std::string> valAction, std::vector<unsigned int> handleMatch,
|
||||
dbr_short_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
cafeSchale.setMany (handleSet, DBR_SHORT, valSet, false);
|
||||
cafeSoluble.setManyString (handleAction, valAction, false);
|
||||
return cafeSchale.compareAndMatchMany(handleSet, DBR_SHORT, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
|
||||
|
||||
int gameSetAndMatch(vector<unsigned int> handleSet, vector<dbr_long_t> valSet,
|
||||
vector<unsigned int> handleAction, vector<string> valAction, vector<unsigned int> handleMatch,
|
||||
dbr_long_t tolerance, double timeout, bool printFlag){
|
||||
cafeLatte.setMany (handleSet, DBR_LONG, valSet, false);
|
||||
cafeSoluble.setManyString (handleAction, valAction, false);
|
||||
return cafeLatte.compareAndMatchMany(handleSet, DBR_LONG, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
int gameSetAndMatch(std::vector<unsigned int> handleSet, std::vector<dbr_long_t> valSet,
|
||||
std::vector<unsigned int> handleAction, std::vector<std::string> valAction, std::vector<unsigned int> handleMatch,
|
||||
dbr_long_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
cafeLatte.setMany (handleSet, DBR_LONG, valSet, false);
|
||||
cafeSoluble.setManyString (handleAction, valAction, false);
|
||||
return cafeLatte.compareAndMatchMany(handleSet, DBR_LONG, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
|
||||
|
||||
int gameSetAndMatch(vector<unsigned int> handleSet, vector<long long> valSet,
|
||||
vector<unsigned int> handleAction, vector<string> valAction, vector<unsigned int> handleMatch,
|
||||
long long tolerance, double timeout, bool printFlag){
|
||||
|
||||
vector<dbr_double_t> valSetDoubleV;
|
||||
valSetDoubleV.reserve(valSet.size());
|
||||
|
||||
std::copy(valSet.begin(), valSet.end(),
|
||||
std::back_inserter(valSetDoubleV));
|
||||
|
||||
dbr_double_t toleranceDouble = tolerance;
|
||||
|
||||
int gameSetAndMatch(std::vector<unsigned int> handleSet, std::vector<long long> valSet,
|
||||
std::vector<unsigned int> handleAction, std::vector<std::string> valAction, std::vector<unsigned int> handleMatch,
|
||||
long long tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
|
||||
std::vector<dbr_double_t> valSetDoubleV;
|
||||
valSetDoubleV.reserve(valSet.size());
|
||||
|
||||
std::copy(valSet.begin(), valSet.end(),
|
||||
std::back_inserter(valSetDoubleV));
|
||||
|
||||
dbr_double_t toleranceDouble = tolerance;
|
||||
|
||||
return gameSetAndMatch(handleSet, valSetDoubleV,
|
||||
handleAction, valAction, handleMatch, toleranceDouble, timeout, printFlag);
|
||||
handleAction, valAction, handleMatch, toleranceDouble, timeout, printFlag);
|
||||
}
|
||||
|
||||
|
||||
int gameSetAndMatch(vector<unsigned int> handleSetV, vector<string> valSetV,
|
||||
vector<unsigned int> handleAction, vector<string> valAction, vector<unsigned int> handleMatchV,
|
||||
string tolerance, double timeout, bool printFlag){
|
||||
#define __METHOD__ "gameSetAndMatch (vector<unsigned int> handleSetV, vector<string> valSetV, \
|
||||
vector<unsigned int> handleAction, vector<string> valAction, vector<unsigned int> handleMatchV, \
|
||||
int gameSetAndMatch(std::vector<unsigned int> handleSetV, std::vector<std::string> valSetV,
|
||||
std::vector<unsigned int> handleAction, std::vector<std::string> valAction, std::vector<unsigned int> handleMatchV,
|
||||
std::string tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
#define __METHOD__ "gameSetAndMatch (std::vector<unsigned int> handleSetV, std::vector<string> valSetV, \
|
||||
std::vector<unsigned int> handleAction, std::vector<string> valAction, std::vector<unsigned int> handleMatchV, \
|
||||
string tolerance, double timeout, bool printFlag)"
|
||||
|
||||
vector<dbr_double_t> valSetDoubleV;
|
||||
std::vector<dbr_double_t> valSetDoubleV;
|
||||
|
||||
std::istringstream ss;
|
||||
dbr_double_t d=0;
|
||||
dbr_double_t toleranceDouble = 0;
|
||||
for (size_t i=0; i< valSetV.size(); ++i) {
|
||||
d=0;
|
||||
ss.clear();
|
||||
ss.str(valSetV[i]);
|
||||
ss>>d;
|
||||
|
||||
if ( !ss.fail()) {
|
||||
valSetDoubleV.push_back(d);
|
||||
}
|
||||
else {
|
||||
std::cout << __METHOD__ << __LINE__ << std::endl;
|
||||
std::cout << "***WARNING*** NO STRING TO DBR_DOUBLE CONVERSION " << std::endl;
|
||||
std::cout << "***WARNING*** COULD NOT CONVERT: ";
|
||||
std::cout << valSetV[i];
|
||||
std::cout << " TO DOUBLE!" << std::endl;
|
||||
return ECAFE_NO_CONVERT;
|
||||
}
|
||||
}
|
||||
|
||||
istringstream ss;
|
||||
dbr_double_t d=0; dbr_double_t toleranceDouble = 0;
|
||||
for (size_t i=0; i< valSetV.size(); ++i) {
|
||||
d=0;
|
||||
ss.clear();
|
||||
ss.str(valSetV[i]);
|
||||
ss>>d;
|
||||
|
||||
if ( !ss.fail()) {
|
||||
valSetDoubleV.push_back(d);
|
||||
}
|
||||
else {
|
||||
cout << __METHOD__ << __LINE__ << endl;
|
||||
cout << "***WARNING*** NO STRING TO DBR_DOUBLE CONVERSION " << endl;
|
||||
cout << "***WARNING*** COULD NOT CONVERT: ";
|
||||
cout << valSetV[i];
|
||||
cout << " TO DOUBLE!" << endl;
|
||||
return ECAFE_NO_CONVERT;
|
||||
}
|
||||
}
|
||||
|
||||
d=0;
|
||||
ss.clear();
|
||||
ss.str(tolerance);
|
||||
@@ -493,11 +543,11 @@ int gameSetAndMatch(vector<unsigned int> handleSetV, vector<string> valSetV,
|
||||
toleranceDouble=d;
|
||||
}
|
||||
else {
|
||||
cout << __METHOD__ << __LINE__ << endl;
|
||||
cout << "***WARNING*** NO STRING TO DBR_DOUBLE CONVERSION " << endl;
|
||||
cout << "***WARNING*** COULD NOT CONVERT: ";
|
||||
cout << tolerance;
|
||||
cout << " TO DOUBLE!" << endl;
|
||||
std::cout << __METHOD__ << __LINE__ << std::endl;
|
||||
std::cout << "***WARNING*** NO STRING TO DBR_DOUBLE CONVERSION " << std::endl;
|
||||
std::cout << "***WARNING*** COULD NOT CONVERT: ";
|
||||
std::cout << tolerance;
|
||||
std::cout << " TO DOUBLE!" << std::endl;
|
||||
return ECAFE_NO_CONVERT;
|
||||
}
|
||||
|
||||
@@ -513,36 +563,43 @@ int gameSetAndMatch(vector<unsigned int> handleSetV, vector<string> valSetV,
|
||||
|
||||
|
||||
int setAndMatch(const unsigned int handleSet, dbr_double_t valSet, const unsigned int handleMatch,
|
||||
dbr_double_t tolerance, double timeout, bool printFlag){
|
||||
dbr_double_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
return cafeDoppio.setAndMatch(handleSet, DBR_DOUBLE, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
|
||||
int setAndMatch(const unsigned int handleSet, dbr_float_t valSet, const unsigned int handleMatch,
|
||||
dbr_float_t tolerance, double timeout, bool printFlag){
|
||||
dbr_float_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
return cafeFrappuccino.setAndMatch(handleSet, DBR_FLOAT, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
|
||||
int setAndMatch(const unsigned int handleSet, dbr_char_t valSet, const unsigned int handleMatch,
|
||||
dbr_char_t tolerance, double timeout, bool printFlag){
|
||||
dbr_char_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
return cafeCappuccino.setAndMatch(handleSet, DBR_CHAR, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
|
||||
int setAndMatch(const unsigned int handleSet, dbr_enum_t valSet, const unsigned int handleMatch,
|
||||
dbr_enum_t tolerance, double timeout, bool printFlag){
|
||||
dbr_enum_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
return cafeEspresso.setAndMatch(handleSet, DBR_ENUM, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
|
||||
int setAndMatch(const unsigned int handleSet, dbr_short_t valSet, const unsigned int handleMatch,
|
||||
dbr_short_t tolerance, double timeout, bool printFlag){
|
||||
dbr_short_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
return cafeSchale.setAndMatch(handleSet, DBR_SHORT, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
|
||||
int setAndMatch(const unsigned int handleSet, dbr_long_t valSet, const unsigned int handleMatch,
|
||||
dbr_long_t tolerance, double timeout, bool printFlag){
|
||||
dbr_long_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
return cafeLatte.setAndMatch(handleSet, DBR_LONG, valSet, handleMatch, tolerance, timeout, printFlag);
|
||||
}
|
||||
int setAndMatch(const unsigned int handleSet, long long valSet, const unsigned int handleMatch,
|
||||
long long tolerance, double timeout, bool printFlag){
|
||||
long long tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
dbr_double_t valSetDouble=valSet;
|
||||
dbr_double_t toleranceDouble = tolerance;
|
||||
return cafeDoppio.setAndMatch(handleSet, DBR_DOUBLE, valSetDouble, handleMatch, toleranceDouble, timeout, printFlag);
|
||||
@@ -550,10 +607,13 @@ int setAndMatch(const unsigned int handleSet, long long valSet, const unsigned i
|
||||
|
||||
|
||||
int setAndMatch(const unsigned int handleSet, dbr_string_t valSet, const unsigned int handleMatch,
|
||||
dbr_string_t tolerance, double timeout, bool printFlag){
|
||||
dbr_string_t tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
#define __METHOD__ "setAndMatch (dbr_string_t input)"
|
||||
istringstream ss;
|
||||
dbr_double_t d=0; dbr_double_t valSetDouble=0; dbr_double_t toleranceDouble = 0;
|
||||
std::istringstream ss;
|
||||
dbr_double_t d=0;
|
||||
dbr_double_t valSetDouble=0;
|
||||
dbr_double_t toleranceDouble = 0;
|
||||
ss.clear();
|
||||
ss.str(valSet);
|
||||
ss>>d;
|
||||
@@ -562,11 +622,11 @@ int setAndMatch(const unsigned int handleSet, dbr_string_t valSet, const unsigne
|
||||
valSetDouble=d;
|
||||
}
|
||||
else {
|
||||
cout << __METHOD__ << __LINE__ << endl;
|
||||
cout << "***WARNING*** NO STRING TO DBR_DOUBLE CONVERSION " << endl;
|
||||
cout << "***WARNING*** COULD NOT CONVERT: ";
|
||||
cout << valSet;
|
||||
cout << " TO DOUBLE!" << endl;
|
||||
std::cout << __METHOD__ << __LINE__ << std::endl;
|
||||
std::cout << "***WARNING*** NO STRING TO DBR_DOUBLE CONVERSION " << std::endl;
|
||||
std::cout << "***WARNING*** COULD NOT CONVERT: ";
|
||||
std::cout << valSet;
|
||||
std::cout << " TO DOUBLE!" << std::endl;
|
||||
return ECAFE_NO_CONVERT;
|
||||
}
|
||||
d=0;
|
||||
@@ -578,11 +638,11 @@ int setAndMatch(const unsigned int handleSet, dbr_string_t valSet, const unsigne
|
||||
toleranceDouble=d;
|
||||
}
|
||||
else {
|
||||
cout << __METHOD__ << __LINE__ << endl;
|
||||
cout << "***WARNING*** NO STRING TO DBR_DOUBLE CONVERSION " << endl;
|
||||
cout << "***WARNING*** COULD NOT CONVERT: ";
|
||||
cout << tolerance;
|
||||
cout << " TO DOUBLE!" << endl;
|
||||
std::cout << __METHOD__ << __LINE__ << std::endl;
|
||||
std::cout << "***WARNING*** NO STRING TO DBR_DOUBLE CONVERSION " << std::endl;
|
||||
std::cout << "***WARNING*** COULD NOT CONVERT: ";
|
||||
std::cout << tolerance;
|
||||
std::cout << " TO DOUBLE!" << std::endl;
|
||||
return ECAFE_NO_CONVERT;
|
||||
}
|
||||
|
||||
@@ -590,11 +650,14 @@ int setAndMatch(const unsigned int handleSet, dbr_string_t valSet, const unsigne
|
||||
#undef __METHOD__
|
||||
}
|
||||
|
||||
int setAndMatch(const unsigned int handleSet, string valSet, const unsigned int handleMatch,
|
||||
string tolerance, double timeout, bool printFlag){
|
||||
int setAndMatch(const unsigned int handleSet, std::string valSet, const unsigned int handleMatch,
|
||||
std::string tolerance, double timeout, bool printFlag)
|
||||
{
|
||||
#define __METHOD__ "setAndMatch (string input)"
|
||||
istringstream ss;
|
||||
dbr_double_t d=0; dbr_double_t valSetDouble=0; dbr_double_t toleranceDouble = 0;
|
||||
std::istringstream ss;
|
||||
dbr_double_t d=0;
|
||||
dbr_double_t valSetDouble=0;
|
||||
dbr_double_t toleranceDouble = 0;
|
||||
ss.clear();
|
||||
ss.str(valSet);
|
||||
ss>>d;
|
||||
@@ -603,11 +666,11 @@ int setAndMatch(const unsigned int handleSet, string valSet, const unsigned int
|
||||
valSetDouble=d;
|
||||
}
|
||||
else {
|
||||
cout << __METHOD__ << __LINE__ << endl;
|
||||
cout << "***WARNING*** NO STRING TO DBR_DOUBLE CONVERSION " << endl;
|
||||
cout << "***WARNING*** COULD NOT CONVERT: ";
|
||||
cout << valSet;
|
||||
cout << " TO DOUBLE!" << endl;
|
||||
std::cout << __METHOD__ << __LINE__ << std::endl;
|
||||
std::cout << "***WARNING*** NO STRING TO DBR_DOUBLE CONVERSION " << std::endl;
|
||||
std::cout << "***WARNING*** COULD NOT CONVERT: ";
|
||||
std::cout << valSet;
|
||||
std::cout << " TO DOUBLE!" << std::endl;
|
||||
return ECAFE_NO_CONVERT;
|
||||
}
|
||||
d=0;
|
||||
@@ -619,11 +682,11 @@ int setAndMatch(const unsigned int handleSet, string valSet, const unsigned int
|
||||
toleranceDouble=d;
|
||||
}
|
||||
else {
|
||||
cout << __METHOD__ << __LINE__ << endl;
|
||||
cout << "***WARNING*** NO STRING TO DBR_DOUBLE CONVERSION " << endl;
|
||||
cout << "***WARNING*** COULD NOT CONVERT: ";
|
||||
cout << tolerance;
|
||||
cout << " TO DOUBLE!" << endl;
|
||||
std::cout << __METHOD__ << __LINE__ << std::endl;
|
||||
std::cout << "***WARNING*** NO STRING TO DBR_DOUBLE CONVERSION " << std::endl;
|
||||
std::cout << "***WARNING*** COULD NOT CONVERT: ";
|
||||
std::cout << tolerance;
|
||||
std::cout << " TO DOUBLE!" << std::endl;
|
||||
return ECAFE_NO_CONVERT;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,267 +9,289 @@
|
||||
#define CAFEVECTORS_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
int get(const unsigned int _handle, vector<string> & V); //0
|
||||
int get(const unsigned int _handle, vector<short> & V); //1
|
||||
int get(const unsigned int _handle, vector<float> & V); //2
|
||||
int get(const unsigned int _handle, vector<unsigned short> & V); //3
|
||||
int get(const unsigned int _handle, vector<unsigned char> & V); //4
|
||||
int get(const unsigned int _handle, vector<dbr_long_t> & V); //5
|
||||
int get(const unsigned int _handle, vector<long long> & V); //5
|
||||
int get(const unsigned int _handle, vector<double> & V); //6
|
||||
int get(const unsigned int _handle, vector<string> & V,
|
||||
int get(const unsigned int _handle, std::vector<std::string> & V); //0
|
||||
int get(const unsigned int _handle, std::vector<short> & V); //1
|
||||
int get(const unsigned int _handle, std::vector<float> & V); //2
|
||||
int get(const unsigned int _handle, std::vector<unsigned short> & V); //3
|
||||
int get(const unsigned int _handle, std::vector<unsigned char> & V); //4
|
||||
int get(const unsigned int _handle, std::vector<dbr_long_t> & V); //5
|
||||
int get(const unsigned int _handle, std::vector<long long> & V); //5
|
||||
int get(const unsigned int _handle, std::vector<double> & V); //6
|
||||
int get(const unsigned int _handle, std::vector<std::string> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//0
|
||||
int get(const unsigned int _handle, vector<short> & V,
|
||||
int get(const unsigned int _handle, std::vector<short> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//1
|
||||
int get(const unsigned int _handle, vector<float> & V,
|
||||
int get(const unsigned int _handle, std::vector<float> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//2
|
||||
int get(const unsigned int _handle, vector<unsigned short> & V,
|
||||
int get(const unsigned int _handle, std::vector<unsigned short> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//3
|
||||
int get(const unsigned int _handle, vector<unsigned char> & V,
|
||||
int get(const unsigned int _handle, std::vector<unsigned char> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//4
|
||||
int get(const unsigned int _handle, vector<dbr_long_t> & V,
|
||||
int get(const unsigned int _handle, std::vector<dbr_long_t> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//5
|
||||
int get(const unsigned int _handle, vector<long long> & V,
|
||||
int get(const unsigned int _handle, std::vector<long long> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//5
|
||||
int get(const unsigned int _handle, vector<double> & V,
|
||||
int get(const unsigned int _handle, std::vector<double> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//6
|
||||
int get(const unsigned int _handle, vector<string> & V,
|
||||
int get(const unsigned int _handle, std::vector<std::string> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//0
|
||||
int get(const unsigned int _handle, vector<short> & V,
|
||||
int get(const unsigned int _handle, std::vector<short> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//1
|
||||
int get(const unsigned int _handle, vector<float> & V,
|
||||
int get(const unsigned int _handle, std::vector<float> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//2
|
||||
int get(const unsigned int _handle, vector<unsigned short> & V,
|
||||
int get(const unsigned int _handle, std::vector<unsigned short> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//3
|
||||
int get(const unsigned int _handle, vector<unsigned char> & V,
|
||||
int get(const unsigned int _handle, std::vector<unsigned char> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//4
|
||||
int get(const unsigned int _handle, vector<dbr_long_t> & V,
|
||||
int get(const unsigned int _handle, std::vector<dbr_long_t> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//5
|
||||
int get(const unsigned int _handle, vector<long long> & V,
|
||||
int get(const unsigned int _handle, std::vector<long long> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//5
|
||||
int get(const unsigned int _handle, vector<double> & V,
|
||||
int get(const unsigned int _handle, std::vector<double> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//
|
||||
|
||||
int getCache(const unsigned int _handle, vector<string> & V); //0
|
||||
int getCache(const unsigned int _handle, vector<short> & V); //1
|
||||
int getCache(const unsigned int _handle, vector<float> & V); //2
|
||||
int getCache(const unsigned int _handle, vector<unsigned short> & V);//3
|
||||
int getCache(const unsigned int _handle, vector<unsigned char> & V);//4
|
||||
int getCache(const unsigned int _handle, vector<dbr_long_t> & V); //5
|
||||
int getCache(const unsigned int _handle, vector<long long> & V); //5
|
||||
int getCache(const unsigned int _handle, vector<double> & V); //6
|
||||
int getCache(const unsigned int _handle, vector<string> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//0
|
||||
int getCache(const unsigned int _handle, vector<short> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//1
|
||||
int getCache(const unsigned int _handle, vector<float> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//2
|
||||
int getCache(const unsigned int _handle, vector<unsigned short> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//3
|
||||
int getCache(const unsigned int _handle, vector<unsigned char> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//4
|
||||
int getCache(const unsigned int _handle, vector<dbr_long_t> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//5
|
||||
int getCache(const unsigned int _handle, vector<long long> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//5
|
||||
int getCache(const unsigned int _handle, vector<double> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//6
|
||||
int getCache(const unsigned int _handle, std::vector<std::string> & V); //0
|
||||
int getCache(const unsigned int _handle, std::vector<short> & V); //1
|
||||
int getCache(const unsigned int _handle, std::vector<float> & V); //2
|
||||
int getCache(const unsigned int _handle, std::vector<unsigned short> & V);//3
|
||||
int getCache(const unsigned int _handle, std::vector<unsigned char> & V);//4
|
||||
int getCache(const unsigned int _handle, std::vector<dbr_long_t> & V); //5
|
||||
int getCache(const unsigned int _handle, std::vector<long long> & V); //5
|
||||
int getCache(const unsigned int _handle, std::vector<double> & V); //6
|
||||
int getCache(const unsigned int _handle, std::vector<std::string> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//0
|
||||
int getCache(const unsigned int _handle, std::vector<short> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//1
|
||||
int getCache(const unsigned int _handle, std::vector<float> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//2
|
||||
int getCache(const unsigned int _handle, std::vector<unsigned short> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//3
|
||||
int getCache(const unsigned int _handle, std::vector<unsigned char> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//4
|
||||
int getCache(const unsigned int _handle, std::vector<dbr_long_t> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//5
|
||||
int getCache(const unsigned int _handle, std::vector<long long> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//5
|
||||
int getCache(const unsigned int _handle, std::vector<double> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity);//6
|
||||
|
||||
|
||||
int getCache(const unsigned int _handle, vector<string> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//0
|
||||
int getCache(const unsigned int _handle, vector<short> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//1
|
||||
int getCache(const unsigned int _handle, vector<float> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//2
|
||||
int getCache(const unsigned int _handle, vector<unsigned short> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//3
|
||||
int getCache(const unsigned int _handle, vector<unsigned char> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//4
|
||||
int getCache(const unsigned int _handle, vector<dbr_long_t> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//5
|
||||
int getCache(const unsigned int _handle, vector<long long> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//5
|
||||
int getCache(const unsigned int _handle, vector<double> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//6
|
||||
int getCache(const unsigned int _handle, std::vector<std::string> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//0
|
||||
int getCache(const unsigned int _handle, std::vector<short> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//1
|
||||
int getCache(const unsigned int _handle, std::vector<float> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//2
|
||||
int getCache(const unsigned int _handle, std::vector<unsigned short> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//3
|
||||
int getCache(const unsigned int _handle, std::vector<unsigned char> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//4
|
||||
int getCache(const unsigned int _handle, std::vector<dbr_long_t> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//5
|
||||
int getCache(const unsigned int _handle, std::vector<long long> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//5
|
||||
int getCache(const unsigned int _handle, std::vector<double> & V,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);//6
|
||||
|
||||
//NON_BLOCKING
|
||||
int get(vector<unsigned int> handleV, vector<int> &statusV);
|
||||
int get(std::vector<unsigned int> handleV, std::vector<int> &statusV);
|
||||
|
||||
int getV(vector<unsigned int> handleV, vector<int> &statusV){
|
||||
status=get(handleV, statusV); ca_flush_io(); //Yes let's flush here!
|
||||
return status;}
|
||||
int getV(std::vector<unsigned int> handleV, std::vector<int> &statusV)
|
||||
{
|
||||
status=get(handleV, statusV);
|
||||
ca_flush_io(); //Yes let's flush here!
|
||||
return status;
|
||||
}
|
||||
|
||||
int get(std::vector<std::string> pvV, std::vector<int> &statusV)
|
||||
{
|
||||
std::vector<unsigned int> hV;
|
||||
hV.reserve(pvV.size());
|
||||
hV=handleHelper.getHandlesFromPVs(pvV);
|
||||
return get(hV, statusV);
|
||||
|
||||
int get(vector<string> pvV, vector<int> &statusV) {
|
||||
vector<unsigned int> hV;
|
||||
hV.reserve(pvV.size());
|
||||
hV=handleHelper.getHandlesFromPVs(pvV);
|
||||
return get(hV, statusV);
|
||||
|
||||
}
|
||||
|
||||
|
||||
int getScalars(vector<unsigned int> handleV, vector<string> & V, vector<int> &statusV){ //0
|
||||
CAFE::get(handleV, statusV);
|
||||
CAFE::waitForBundledEvents(handleV, statusV);
|
||||
return CAFE::getCache(handleV, V, statusV);
|
||||
int getScalars(std::vector<unsigned int> handleV, std::vector<std::string> & V, std::vector<int> &statusV) //0
|
||||
{
|
||||
CAFE::get(handleV, statusV);
|
||||
CAFE::waitForBundledEvents(handleV, statusV);
|
||||
return CAFE::getCache(handleV, V, statusV);
|
||||
}
|
||||
int getScalars(vector<unsigned int> handleV, vector<dbr_short_t> & V, vector<int> &statusV){ //1
|
||||
CAFE::get(handleV, statusV);
|
||||
CAFE::waitForBundledEvents(handleV, statusV);
|
||||
return CAFE::getCache(handleV, V, statusV);
|
||||
int getScalars(std::vector<unsigned int> handleV, std::vector<dbr_short_t> & V, std::vector<int> &statusV) //1
|
||||
{
|
||||
CAFE::get(handleV, statusV);
|
||||
CAFE::waitForBundledEvents(handleV, statusV);
|
||||
return CAFE::getCache(handleV, V, statusV);
|
||||
}
|
||||
int getScalars(vector<unsigned int> handleV, vector<dbr_float_t> & V, vector<int> &statusV){ //2
|
||||
CAFE::get(handleV, statusV);
|
||||
CAFE::waitForBundledEvents(handleV, statusV);
|
||||
return CAFE::getCache(handleV, V, statusV);
|
||||
int getScalars(std::vector<unsigned int> handleV, std::vector<dbr_float_t> & V, std::vector<int> &statusV) //2
|
||||
{
|
||||
CAFE::get(handleV, statusV);
|
||||
CAFE::waitForBundledEvents(handleV, statusV);
|
||||
return CAFE::getCache(handleV, V, statusV);
|
||||
}
|
||||
int getScalars(vector<unsigned int> handleV, vector<dbr_enum_t> & V, vector<int> &statusV){ //3
|
||||
CAFE::get(handleV, statusV);
|
||||
CAFE::waitForBundledEvents(handleV, statusV);
|
||||
return CAFE::getCache(handleV, V, statusV);
|
||||
int getScalars(std::vector<unsigned int> handleV, std::vector<dbr_enum_t> & V, std::vector<int> &statusV) //3
|
||||
{
|
||||
CAFE::get(handleV, statusV);
|
||||
CAFE::waitForBundledEvents(handleV, statusV);
|
||||
return CAFE::getCache(handleV, V, statusV);
|
||||
}
|
||||
int getScalars(vector<unsigned int> handleV, vector<dbr_char_t> & V, vector<int> &statusV){ //4
|
||||
CAFE::get(handleV, statusV);
|
||||
CAFE::waitForBundledEvents(handleV, statusV);
|
||||
return CAFE::getCache(handleV, V, statusV);
|
||||
int getScalars(std::vector<unsigned int> handleV, std::vector<dbr_char_t> & V, std::vector<int> &statusV) //4
|
||||
{
|
||||
CAFE::get(handleV, statusV);
|
||||
CAFE::waitForBundledEvents(handleV, statusV);
|
||||
return CAFE::getCache(handleV, V, statusV);
|
||||
}
|
||||
int getScalars(vector<unsigned int> handleV, vector<dbr_long_t> & V, vector<int> &statusV){ //5
|
||||
CAFE::get(handleV, statusV);
|
||||
CAFE::waitForBundledEvents(handleV, statusV);
|
||||
return CAFE::getCache(handleV, V, statusV);
|
||||
int getScalars(std::vector<unsigned int> handleV, std::vector<dbr_long_t> & V, std::vector<int> &statusV) //5
|
||||
{
|
||||
CAFE::get(handleV, statusV);
|
||||
CAFE::waitForBundledEvents(handleV, statusV);
|
||||
return CAFE::getCache(handleV, V, statusV);
|
||||
}
|
||||
int getScalars(vector<unsigned int> handleV, vector<long long> & V, vector<int> &statusV) { //5
|
||||
CAFE::get(handleV, statusV);
|
||||
CAFE::waitForBundledEvents(handleV, statusV);
|
||||
return CAFE::getCache(handleV, V, statusV);
|
||||
int getScalars(std::vector<unsigned int> handleV, std::vector<long long> & V, std::vector<int> &statusV) //5
|
||||
{
|
||||
CAFE::get(handleV, statusV);
|
||||
CAFE::waitForBundledEvents(handleV, statusV);
|
||||
return CAFE::getCache(handleV, V, statusV);
|
||||
}
|
||||
int getScalars(vector<unsigned int> handleV, vector<dbr_double_t> & V, vector<int> &statusV) { //6
|
||||
CAFE::get(handleV, statusV);
|
||||
//for (size_t i=0; i< handleV.size(); ++i) { cout << "/Asyn/h=" << handleV[i] << "s=" << statusV[i] << " [" << i << "] " << endl;}
|
||||
CAFE::waitForBundledEvents(handleV, statusV);
|
||||
//for (size_t i=0; i< handleV.size(); ++i) { cout << "/Wait/h=" << handleV[i] << "s=" << statusV[i] << " [" << i << "] " << endl;}
|
||||
status=CAFE::getCache(handleV, V, statusV);
|
||||
//for (size_t i=0; i< handleV.size(); ++i) { cout << "/Cach/h=" << handleV[i] << "s=" << statusV[i] << " [" << i << "] " << endl;}
|
||||
return status;
|
||||
int getScalars(std::vector<unsigned int> handleV, std::vector<dbr_double_t> & V, std::vector<int> &statusV) //6
|
||||
{
|
||||
CAFE::get(handleV, statusV);
|
||||
//for (size_t i=0; i< handleV.size(); ++i) { cout << "/Asyn/h=" << handleV[i] << "s=" << statusV[i] << " [" << i << "] " << endl;}
|
||||
CAFE::waitForBundledEvents(handleV, statusV);
|
||||
//for (size_t i=0; i< handleV.size(); ++i) { cout << "/Wait/h=" << handleV[i] << "s=" << statusV[i] << " [" << i << "] " << endl;}
|
||||
status=CAFE::getCache(handleV, V, statusV);
|
||||
//for (size_t i=0; i< handleV.size(); ++i) { cout << "/Cach/h=" << handleV[i] << "s=" << statusV[i] << " [" << i << "] " << endl;}
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
int getCacheVStr(vector<unsigned int> handleV, vector<string> & V, vector<int> &statusV){
|
||||
return getCache(handleV, V, statusV);}
|
||||
int getCacheVLong(vector<unsigned int> handleV, vector<dbr_long_t> & V, vector<int> &statusV){
|
||||
return getCache(handleV, V, statusV);}
|
||||
int getCacheVDouble(vector<unsigned int> handleV, vector<dbr_double_t> & V, vector<int> &statusV){
|
||||
return getCache(handleV, V, statusV);}
|
||||
int getCacheVStr(std::vector<unsigned int> handleV, std::vector<std::string> & V, std::vector<int> &statusV)
|
||||
{
|
||||
return getCache(handleV, V, statusV);
|
||||
}
|
||||
int getCacheVLong(std::vector<unsigned int> handleV, std::vector<dbr_long_t> & V, std::vector<int> &statusV)
|
||||
{
|
||||
return getCache(handleV, V, statusV);
|
||||
}
|
||||
int getCacheVDouble(std::vector<unsigned int> handleV, std::vector<dbr_double_t> & V, std::vector<int> &statusV)
|
||||
{
|
||||
return getCache(handleV, V, statusV);
|
||||
}
|
||||
|
||||
|
||||
int getCache(vector<unsigned int> handleV, vector<string> & V, vector<int> &statusV); //0
|
||||
int getCache(vector<unsigned int> handleV, vector<dbr_short_t> & V, vector<int> &statusV); //1
|
||||
int getCache(vector<unsigned int> handleV, vector<dbr_float_t> & V, vector<int> &statusV); //2
|
||||
int getCache(vector<unsigned int> handleV, vector<dbr_enum_t> & V, vector<int> &statusV); //3
|
||||
int getCache(vector<unsigned int> handleV, vector<dbr_char_t> & V, vector<int> &statusV); //4
|
||||
int getCache(vector<unsigned int> handleV, vector<dbr_long_t> & V, vector<int> &statusV); //5
|
||||
int getCache(vector<unsigned int> handleV, vector<long long> & V, vector<int> &statusV); //5
|
||||
int getCache(vector<unsigned int> handleV, vector<dbr_double_t> & V, vector<int> &statusV); //6
|
||||
int getCache(std::vector<unsigned int> handleV, std::vector<std::string> & V, std::vector<int> &statusV); //0
|
||||
int getCache(std::vector<unsigned int> handleV, std::vector<dbr_short_t> & V, std::vector<int> &statusV); //1
|
||||
int getCache(std::vector<unsigned int> handleV, std::vector<dbr_float_t> & V, std::vector<int> &statusV); //2
|
||||
int getCache(std::vector<unsigned int> handleV, std::vector<dbr_enum_t> & V, std::vector<int> &statusV); //3
|
||||
int getCache(std::vector<unsigned int> handleV, std::vector<dbr_char_t> & V, std::vector<int> &statusV); //4
|
||||
int getCache(std::vector<unsigned int> handleV, std::vector<dbr_long_t> & V, std::vector<int> &statusV); //5
|
||||
int getCache(std::vector<unsigned int> handleV, std::vector<long long> & V, std::vector<int> &statusV); //5
|
||||
int getCache(std::vector<unsigned int> handleV, std::vector<dbr_double_t> & V, std::vector<int> &statusV); //6
|
||||
|
||||
int getCache(vector<unsigned int> handleV, vector<string> & V, vector<int> &statusV,
|
||||
vector<dbr_short_t> &alarmStatusV, vector<dbr_short_t> &alarmSeverityV); //0
|
||||
int getCache(vector<unsigned int> handleV, vector<dbr_short_t> & V, vector<int> &statusV,
|
||||
vector<dbr_short_t> &alarmStatusV, vector<dbr_short_t> &alarmSeverityV); //1
|
||||
int getCache(vector<unsigned int> handleV, vector<dbr_float_t> & V, vector<int> &statusV,
|
||||
vector<dbr_short_t> &alarmStatusV, vector<dbr_short_t> &alarmSeverityV); //2
|
||||
int getCache(vector<unsigned int> handleV, vector<dbr_enum_t> & V, vector<int> &statusV,
|
||||
vector<dbr_short_t> &alarmStatusV, vector<dbr_short_t> &alarmSeverityV); //3
|
||||
int getCache(vector<unsigned int> handleV, vector<dbr_char_t> & V, vector<int> &statusV,
|
||||
vector<dbr_short_t> &alarmStatusV, vector<dbr_short_t> &alarmSeverityV); //4
|
||||
int getCache(vector<unsigned int> handleV, vector<dbr_long_t> & V, vector<int> &statusV,
|
||||
vector<dbr_short_t> &alarmStatusV, vector<dbr_short_t> &alarmSeverityV); //5
|
||||
int getCache(vector<unsigned int> handleV, vector<long long> & V, vector<int> &statusV,
|
||||
vector<dbr_short_t> &alarmStatusV, vector<dbr_short_t> &alarmSeverityV); //5
|
||||
int getCache(vector<unsigned int> handleV, vector<dbr_double_t> & V, vector<int> &statusV,
|
||||
vector<dbr_short_t> &alarmStatusV, vector<dbr_short_t> &alarmSeverityV); //6
|
||||
int getCache(std::vector<unsigned int> handleV, std::vector<std::string> & V, std::vector<int> &statusV,
|
||||
std::vector<dbr_short_t> &alarmStatusV, std::vector<dbr_short_t> &alarmSeverityV); //0
|
||||
int getCache(std::vector<unsigned int> handleV, std::vector<dbr_short_t> & V, std::vector<int> &statusV,
|
||||
std::vector<dbr_short_t> &alarmStatusV, std::vector<dbr_short_t> &alarmSeverityV); //1
|
||||
int getCache(std::vector<unsigned int> handleV, std::vector<dbr_float_t> & V, std::vector<int> &statusV,
|
||||
std::vector<dbr_short_t> &alarmStatusV, std::vector<dbr_short_t> &alarmSeverityV); //2
|
||||
int getCache(std::vector<unsigned int> handleV, std::vector<dbr_enum_t> & V, std::vector<int> &statusV,
|
||||
std::vector<dbr_short_t> &alarmStatusV, std::vector<dbr_short_t> &alarmSeverityV); //3
|
||||
int getCache(std::vector<unsigned int> handleV, std::vector<dbr_char_t> & V, std::vector<int> &statusV,
|
||||
std::vector<dbr_short_t> &alarmStatusV, std::vector<dbr_short_t> &alarmSeverityV); //4
|
||||
int getCache(std::vector<unsigned int> handleV, std::vector<dbr_long_t> & V, std::vector<int> &statusV,
|
||||
std::vector<dbr_short_t> &alarmStatusV, std::vector<dbr_short_t> &alarmSeverityV); //5
|
||||
int getCache(std::vector<unsigned int> handleV, std::vector<long long> & V, std::vector<int> &statusV,
|
||||
std::vector<dbr_short_t> &alarmStatusV, std::vector<dbr_short_t> &alarmSeverityV); //5
|
||||
int getCache(std::vector<unsigned int> handleV, std::vector<dbr_double_t> & V, std::vector<int> &statusV,
|
||||
std::vector<dbr_short_t> &alarmStatusV, std::vector<dbr_short_t> &alarmSeverityV); //6
|
||||
|
||||
//0
|
||||
int getCache(vector<unsigned int> handleV, vector<string> & V, vector<int> &statusV,
|
||||
vector<dbr_short_t> &alarmStatusV, vector<dbr_short_t> &alarmSeverityV,
|
||||
vector<epicsTimeStamp> &tsV);
|
||||
int getCache(std::vector<unsigned int> handleV, std::vector<std::string> & V, std::vector<int> &statusV,
|
||||
std::vector<dbr_short_t> &alarmStatusV, std::vector<dbr_short_t> &alarmSeverityV,
|
||||
std::vector<epicsTimeStamp> &tsV);
|
||||
//1
|
||||
int getCache(vector<unsigned int> handleV, vector<dbr_short_t> & V, vector<int> &statusV,
|
||||
vector<dbr_short_t> &alarmStatusV, vector<dbr_short_t> &alarmSeverityV,
|
||||
vector<epicsTimeStamp> &tsV);
|
||||
int getCache(std::vector<unsigned int> handleV, std::vector<dbr_short_t> & V, std::vector<int> &statusV,
|
||||
std::vector<dbr_short_t> &alarmStatusV, std::vector<dbr_short_t> &alarmSeverityV,
|
||||
std::vector<epicsTimeStamp> &tsV);
|
||||
//2
|
||||
int getCache(vector<unsigned int> handleV, vector<dbr_float_t> & V, vector<int> &statusV,
|
||||
vector<dbr_short_t> &alarmStatusV, vector<dbr_short_t> &alarmSeverityV,
|
||||
vector<epicsTimeStamp> &tsV);
|
||||
int getCache(std::vector<unsigned int> handleV, std::vector<dbr_float_t> & V, std::vector<int> &statusV,
|
||||
std::vector<dbr_short_t> &alarmStatusV, std::vector<dbr_short_t> &alarmSeverityV,
|
||||
std::vector<epicsTimeStamp> &tsV);
|
||||
//3
|
||||
int getCache(vector<unsigned int> handleV, vector<dbr_enum_t> & V, vector<int> &statusV,
|
||||
vector<dbr_short_t> &alarmStatusV, vector<dbr_short_t> &alarmSeverityV,
|
||||
vector<epicsTimeStamp> &tsV);
|
||||
int getCache(std::vector<unsigned int> handleV, std::vector<dbr_enum_t> & V, std::vector<int> &statusV,
|
||||
std::vector<dbr_short_t> &alarmStatusV, std::vector<dbr_short_t> &alarmSeverityV,
|
||||
std::vector<epicsTimeStamp> &tsV);
|
||||
//4
|
||||
int getCache(vector<unsigned int> handleV, vector<dbr_char_t> & V, vector<int> &statusV,
|
||||
vector<dbr_short_t> &alarmStatusV, vector<dbr_short_t> &alarmSeverityV,
|
||||
vector<epicsTimeStamp> &tsV);
|
||||
int getCache(std::vector<unsigned int> handleV, std::vector<dbr_char_t> & V, std::vector<int> &statusV,
|
||||
std::vector<dbr_short_t> &alarmStatusV, std::vector<dbr_short_t> &alarmSeverityV,
|
||||
std::vector<epicsTimeStamp> &tsV);
|
||||
//5
|
||||
int getCache(vector<unsigned int> handleV, vector<dbr_long_t> & V, vector<int> &statusV,
|
||||
vector<dbr_short_t> &alarmStatusV, vector<dbr_short_t> &alarmSeverityV,
|
||||
vector<epicsTimeStamp> &tsV);
|
||||
int getCache(vector<unsigned int> handleV, vector<long long> & V, vector<int> &statusV,
|
||||
vector<dbr_short_t> &alarmStatusV, vector<dbr_short_t> &alarmSeverityV,
|
||||
vector<epicsTimeStamp> &tsV);
|
||||
int getCache(std::vector<unsigned int> handleV, std::vector<dbr_long_t> & V, std::vector<int> &statusV,
|
||||
std::vector<dbr_short_t> &alarmStatusV, std::vector<dbr_short_t> &alarmSeverityV,
|
||||
std::vector<epicsTimeStamp> &tsV);
|
||||
int getCache(std::vector<unsigned int> handleV, std::vector<long long> & V, std::vector<int> &statusV,
|
||||
std::vector<dbr_short_t> &alarmStatusV, std::vector<dbr_short_t> &alarmSeverityV,
|
||||
std::vector<epicsTimeStamp> &tsV);
|
||||
//6
|
||||
int getCache(vector<unsigned int> handleV, vector<dbr_double_t> & V, vector<int> &statusV,
|
||||
vector<dbr_short_t> &alarmStatusV, vector<dbr_short_t> &alarmSeverityV,
|
||||
vector<epicsTimeStamp> &tsV);
|
||||
int getCache(std::vector<unsigned int> handleV, std::vector<dbr_double_t> & V, std::vector<int> &statusV,
|
||||
std::vector<dbr_short_t> &alarmStatusV, std::vector<dbr_short_t> &alarmSeverityV,
|
||||
std::vector<epicsTimeStamp> &tsV);
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int set(const unsigned int handle, vector<string> V); //0
|
||||
int set(const unsigned int handle, vector<dbr_short_t> V); //1
|
||||
int set(const unsigned int handle, vector<dbr_float_t> V); //2
|
||||
int set(const unsigned int handle, vector<dbr_enum_t> V);//3
|
||||
int set(const unsigned int handle, vector<dbr_char_t> V);//4
|
||||
int set(const unsigned int handle, vector<dbr_long_t> V); //5
|
||||
int set(const unsigned int handle, vector<long long> V); //5+
|
||||
int set(const unsigned int handle, vector<dbr_double_t> V); //6
|
||||
int set(const unsigned int _handle, std::vector<std::string> V); //0
|
||||
int set(const unsigned int _handle, std::vector<dbr_short_t> V); //1
|
||||
int set(const unsigned int _handle, std::vector<dbr_float_t> V); //2
|
||||
int set(const unsigned int _handle, std::vector<dbr_enum_t> V);//3
|
||||
int set(const unsigned int _handle, std::vector<dbr_char_t> V);//4
|
||||
int set(const unsigned int _handle, std::vector<dbr_long_t> V); //5
|
||||
int set(const unsigned int _handle, std::vector<long long> V); //5+
|
||||
int set(const unsigned int _handle, std::vector<dbr_double_t> V); //6
|
||||
|
||||
int set(vector<unsigned int> handleV, vector<string> V, vector<int> &statusV); //0
|
||||
int set(vector<unsigned int> handleV, vector<dbr_short_t> V, vector<int> &statusV); //1
|
||||
int set(vector<unsigned int> handleV, vector<dbr_float_t> V, vector<int> &statusV); //2
|
||||
int set(vector<unsigned int> handleV, vector<dbr_enum_t> V, vector<int> &statusV); //3
|
||||
int set(vector<unsigned int> handleV, vector<dbr_char_t> V, vector<int> &statusV); //4
|
||||
int set(vector<unsigned int> handleV, vector<dbr_long_t> V, vector<int> &statusV); //5
|
||||
int set(vector<unsigned int> handleV, vector<long long> V, vector<int> &statusV); //5+
|
||||
int set(vector<unsigned int> handleV, vector<dbr_double_t> V, vector<int> &statusV); //6
|
||||
int set(std::vector<unsigned int> _handleV, std::vector<std::string> V, std::vector<int> &statusV); //0
|
||||
int set(std::vector<unsigned int> _handleV, std::vector<dbr_short_t> V, std::vector<int> &statusV); //1
|
||||
int set(std::vector<unsigned int> _handleV, std::vector<dbr_float_t> V, std::vector<int> &statusV); //2
|
||||
int set(std::vector<unsigned int> _handleV, std::vector<dbr_enum_t> V, std::vector<int> &statusV); //3
|
||||
int set(std::vector<unsigned int> _handleV, std::vector<dbr_char_t> V, std::vector<int> &statusV); //4
|
||||
int set(std::vector<unsigned int> _handleV, std::vector<dbr_long_t> V, std::vector<int> &statusV); //5
|
||||
int set(std::vector<unsigned int> _handleV, std::vector<long long> V, std::vector<int> &statusV); //5+
|
||||
int set(std::vector<unsigned int> _handleV, std::vector<dbr_double_t> V, std::vector<int> &statusV); //6
|
||||
|
||||
|
||||
|
||||
int get (vector<unsigned int> handleV, PVDataHolder * pvd){
|
||||
|
||||
return get(&handleV[0], (unsigned int) handleV.size(), pvd);
|
||||
|
||||
int get (std::vector<unsigned int> handleV, PVDataHolder * pvd)
|
||||
{
|
||||
|
||||
return get(&handleV[0], (unsigned int) handleV.size(), pvd);
|
||||
|
||||
};
|
||||
|
||||
|
||||
int getCache (vector<unsigned int> handleV, PVDataHolder * pvd){
|
||||
|
||||
return getCache(&handleV[0], (unsigned int) handleV.size(), pvd);
|
||||
int getCache (std::vector<unsigned int> handleV, PVDataHolder * pvd)
|
||||
{
|
||||
|
||||
return getCache(&handleV[0], (unsigned int) handleV.size(), pvd);
|
||||
};
|
||||
|
||||
|
||||
int getPVArray (vector<unsigned int> handleV, PVDataHolder * pvd){
|
||||
//unsigned int * handleArray = new unsigned int [handleV.size()];
|
||||
//for (size_t i=0; i< (size_t) handleV.size(); ++i) {handleArray[i]= (unsigned int) handleV[i];}
|
||||
//status=get(handleArray, (unsigned int) handleV.size(), pvd);
|
||||
//delete [] handleArray; return status;
|
||||
return get(&handleV[0], (unsigned int) handleV.size(), pvd);
|
||||
int getPVArray (std::vector<unsigned int> handleV, PVDataHolder * pvd)
|
||||
{
|
||||
//unsigned int * handleArray = new unsigned int [handleV.size()];
|
||||
//for (size_t i=0; i< (size_t) handleV.size(); ++i) {handleArray[i]= (unsigned int) handleV[i];}
|
||||
//status=get(handleArray, (unsigned int) handleV.size(), pvd);
|
||||
//delete [] handleArray; return status;
|
||||
return get(&handleV[0], (unsigned int) handleV.size(), pvd);
|
||||
};
|
||||
|
||||
/*
|
||||
int getPVArrayCache (vector<unsigned int> handleV, PVDataHolder * pvd){
|
||||
int getPVArrayCache (std::vector<unsigned int> handleV, PVDataHolder * pvd){
|
||||
//unsigned int * handleArray = new unsigned int [handleV.size()];
|
||||
//for (size_t i=0; i< (size_t) handleV.size(); ++i) {handleArray[i]= (unsigned int) handleV[i];}
|
||||
//status=getCache(handleArray, (unsigned int) handleV.size(), pvd);
|
||||
@@ -279,27 +301,56 @@ int getPVArrayCache (vector<unsigned int> handleV, PVDataHolder * pvd){
|
||||
*/
|
||||
|
||||
|
||||
//setPVArray is in cafeVectors.h and .cc
|
||||
//setPVArray is in cafeStd::Vectors.h and .cc
|
||||
//For Cython
|
||||
int setPVArray(vector<unsigned int> handleV, PVDataHolder * pvd);
|
||||
int setPVArray(std::vector<unsigned int> handleV, PVDataHolder * pvd);
|
||||
|
||||
int setVVString(vector<unsigned int> handleV, vector<string> V, vector<int> &statusV) {
|
||||
return set(handleV, V, statusV);};
|
||||
int setVVChar(vector<unsigned int> handleV, vector<dbr_char_t> V, vector<int> &statusV){
|
||||
return set(handleV, V, statusV);};
|
||||
int setVVLong(vector<unsigned int> handleV, vector<dbr_long_t> V, vector<int> &statusV){
|
||||
return set(handleV, V, statusV);};
|
||||
int setVVDouble(vector<unsigned int> handleV, vector<dbr_double_t> V, vector<int> &statusV){
|
||||
return set(handleV, V, statusV);};
|
||||
int setVVString(std::vector<unsigned int> handleV, std::vector<std::string> V, std::vector<int> &statusV)
|
||||
{
|
||||
return set(handleV, V, statusV);
|
||||
};
|
||||
int setVVChar(std::vector<unsigned int> handleV, std::vector<dbr_char_t> V, std::vector<int> &statusV)
|
||||
{
|
||||
return set(handleV, V, statusV);
|
||||
};
|
||||
int setVVLong(std::vector<unsigned int> handleV, std::vector<dbr_long_t> V, std::vector<int> &statusV)
|
||||
{
|
||||
return set(handleV, V, statusV);
|
||||
};
|
||||
int setVVDouble(std::vector<unsigned int> handleV, std::vector<dbr_double_t> V, std::vector<int> &statusV)
|
||||
{
|
||||
return set(handleV, V, statusV);
|
||||
};
|
||||
|
||||
int setVString(const unsigned int handle, vector<string> V) {return set(handle, V);};
|
||||
int setVString(const unsigned int handle, std::vector<std::string> V)
|
||||
{
|
||||
return set(handle, V);
|
||||
};
|
||||
|
||||
int setVChar (const unsigned int handle, vector<dbr_char_t> V) {return set(handle, V);};
|
||||
int setVLong (const unsigned int handle, vector<dbr_long_t> V) {return set(handle, V);};
|
||||
int setVShort (const unsigned int handle, vector<dbr_short_t> V) {return set(handle, V);};
|
||||
int setVUShort(const unsigned int handle, vector<dbr_enum_t> V) {return set(handle, V);};
|
||||
int setVFloat (const unsigned int handle, vector<dbr_float_t> V) {return set(handle, V);};
|
||||
int setVDouble(const unsigned int handle, vector<dbr_double_t> V) {return set(handle, V);};
|
||||
int setVChar (const unsigned int handle, std::vector<dbr_char_t> V)
|
||||
{
|
||||
return set(handle, V);
|
||||
};
|
||||
int setVLong (const unsigned int handle, std::vector<dbr_long_t> V)
|
||||
{
|
||||
return set(handle, V);
|
||||
};
|
||||
int setVShort (const unsigned int handle, std::vector<dbr_short_t> V)
|
||||
{
|
||||
return set(handle, V);
|
||||
};
|
||||
int setVUShort(const unsigned int handle, std::vector<dbr_enum_t> V)
|
||||
{
|
||||
return set(handle, V);
|
||||
};
|
||||
int setVFloat (const unsigned int handle, std::vector<dbr_float_t> V)
|
||||
{
|
||||
return set(handle, V);
|
||||
};
|
||||
int setVDouble(const unsigned int handle, std::vector<dbr_double_t> V)
|
||||
{
|
||||
return set(handle, V);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -10,15 +10,15 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#if HAVE_LIBQTXML
|
||||
//if HAVE_LIBQTXML - needed for externsions
|
||||
int loadCollectionsFromXML(const char * collectionsFile);
|
||||
int loadGroupsFromXML (const char * groupsFile);
|
||||
int restoreFromXML(const char * snapshotFile);
|
||||
#endif
|
||||
//endif
|
||||
|
||||
int snapshot2XML (PVGroup pg);
|
||||
void openGroupXMLFile(string fileName);
|
||||
void closeGroupXMLFile(string fileName);
|
||||
int group2XML (const char * grpName, string fileName);
|
||||
void openGroupXMLFile(std::string fileName);
|
||||
void closeGroupXMLFile(std::string fileName);
|
||||
int group2XML (const char * grpName, std::string fileName);
|
||||
|
||||
#endif // CAFEXML_H
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#ifndef CAOPCODES_H
|
||||
#define CAOPCODES_H
|
||||
|
||||
|
||||
#include <cadef.h>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
@@ -18,49 +18,56 @@
|
||||
* the CA_OP_xx and text equivalent
|
||||
*/
|
||||
class CAOPCodes {
|
||||
typedef std::map<int, std::string> mapIntString;
|
||||
private:
|
||||
mapIntString mapDataType;
|
||||
mapIntString::iterator pos;
|
||||
typedef std::map<int, std::string> mapIntString;
|
||||
private:
|
||||
mapIntString mapDataType;
|
||||
mapIntString::iterator pos;
|
||||
public:
|
||||
CAOPCodes() {
|
||||
mapDataType.insert(std::make_pair((int) CA_OP_GET, "CA_OP_GET" ));
|
||||
mapDataType.insert(std::make_pair((int) CA_OP_PUT, "CA_OP_PUT" ));
|
||||
mapDataType.insert(std::make_pair((int) CA_OP_CREATE_CHANNEL, "CA_OP_CREATE_CHANNEL" ));
|
||||
mapDataType.insert(std::make_pair((int) CA_OP_ADD_EVENT, "CA_OP_ADD_EVENT" ));
|
||||
mapDataType.insert(std::make_pair((int) CA_OP_CLEAR_EVENT, "CA_OP_CLEAR_EVENT" ));
|
||||
mapDataType.insert(std::make_pair((int) CA_OP_OTHER, "CA_OP_OTHER" ));
|
||||
mapDataType.insert(std::make_pair((int) CA_OP_CONN_UP, "CA_OP_CONN_UP" ));
|
||||
mapDataType.insert(std::make_pair((int) CA_OP_CONN_DOWN, "CA_OP_CONN_DOWN" ));
|
||||
};
|
||||
CAOPCodes()
|
||||
{
|
||||
mapDataType.insert(std::make_pair((int) CA_OP_GET, "CA_OP_GET" ));
|
||||
mapDataType.insert(std::make_pair((int) CA_OP_PUT, "CA_OP_PUT" ));
|
||||
mapDataType.insert(std::make_pair((int) CA_OP_CREATE_CHANNEL, "CA_OP_CREATE_CHANNEL" ));
|
||||
mapDataType.insert(std::make_pair((int) CA_OP_ADD_EVENT, "CA_OP_ADD_EVENT" ));
|
||||
mapDataType.insert(std::make_pair((int) CA_OP_CLEAR_EVENT, "CA_OP_CLEAR_EVENT" ));
|
||||
mapDataType.insert(std::make_pair((int) CA_OP_OTHER, "CA_OP_OTHER" ));
|
||||
mapDataType.insert(std::make_pair((int) CA_OP_CONN_UP, "CA_OP_CONN_UP" ));
|
||||
mapDataType.insert(std::make_pair((int) CA_OP_CONN_DOWN, "CA_OP_CONN_DOWN" ));
|
||||
};
|
||||
|
||||
~CAOPCodes() {};
|
||||
|
||||
std::string message (int i) {
|
||||
|
||||
pos = mapDataType.find(i);
|
||||
if (pos != mapDataType.end()) return pos->second;
|
||||
return "CAFE_DATATYPE_UNKNOWN";
|
||||
};
|
||||
|
||||
int enumIs (std::string message) {
|
||||
for (pos=mapDataType.begin(); pos != mapDataType.end(); ++pos)
|
||||
if (pos->second==message) return pos->first;
|
||||
return -1;
|
||||
};
|
||||
~CAOPCodes() {};
|
||||
|
||||
void show() {print();}
|
||||
std::string message (int i)
|
||||
{
|
||||
|
||||
void print ( ) {
|
||||
std::cout << "------------------" << std::endl;
|
||||
std::cout << "CA_OP_LIST" << std::endl;
|
||||
std::cout << "-----------------" << std::endl;
|
||||
for (pos=mapDataType.begin(); pos != mapDataType.end(); ++pos) {
|
||||
std::cout << pos->first << " " << pos->second << std::endl;
|
||||
pos = mapDataType.find(i);
|
||||
if (pos != mapDataType.end()) return pos->second;
|
||||
return "CAFE_DATATYPE_UNKNOWN";
|
||||
};
|
||||
|
||||
int enumIs (std::string message)
|
||||
{
|
||||
for (pos=mapDataType.begin(); pos != mapDataType.end(); ++pos)
|
||||
if (pos->second==message) return pos->first;
|
||||
return -1;
|
||||
};
|
||||
|
||||
void show()
|
||||
{
|
||||
print();
|
||||
}
|
||||
std::cout << "-----------------" << std::endl;
|
||||
};
|
||||
|
||||
|
||||
void print ( )
|
||||
{
|
||||
std::cout << "------------------" << std::endl;
|
||||
std::cout << "CA_OP_LIST" << std::endl;
|
||||
std::cout << "-----------------" << std::endl;
|
||||
for (pos=mapDataType.begin(); pos != mapDataType.end(); ++pos) {
|
||||
std::cout << pos->first << " " << pos->second << std::endl;
|
||||
}
|
||||
std::cout << "-----------------" << std::endl;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
///
|
||||
/// \file channelRegalia.h
|
||||
///
|
||||
/// Classes are:
|
||||
/// Classes are:
|
||||
/// ChannelRegalia
|
||||
/// ChannelRequestMetaData
|
||||
/// ChannelRequestMetaDataClient
|
||||
@@ -21,21 +21,27 @@
|
||||
#include <defines.h>
|
||||
#include <cafeEnum.h>
|
||||
|
||||
using namespace std;
|
||||
//required for channelDataStore
|
||||
#include <PVDataHolder.h>
|
||||
#include <PVCtrlHolder.h>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Struct defining channel properties and connection status for use in Conduit container
|
||||
*
|
||||
*/
|
||||
class ChannelRegalia{
|
||||
class ChannelRegalia {
|
||||
private:
|
||||
CAFEStatus cafeStatus;
|
||||
CAFEStatus cafeStatus;
|
||||
public:
|
||||
friend struct change_accessRightsHandlerArgs;
|
||||
friend struct change_accessRead;
|
||||
friend struct change_accessWrite;
|
||||
friend struct change_channelID;
|
||||
friend struct change_connectionHandlerArgs;
|
||||
friend struct change_connectionHandlerArgs;
|
||||
friend struct change_eventHandlerArgs;
|
||||
//friend struct change_channelRegalia;
|
||||
friend class Connect;
|
||||
@@ -56,64 +62,193 @@ protected:
|
||||
int cafeConnectionState; //as given by cafe_cs_state in statusCodes
|
||||
|
||||
//void setChannelID (chid id) {channelID=id;};
|
||||
void setConnectFlag (bool c) {connectFlag=c;};
|
||||
void setHostName (const char * h) {hostName=h;};
|
||||
void setDataType (chtype d) {dataType=d;};
|
||||
void setAccessRead (unsigned short r){accessRead=r;};
|
||||
void setAccessWrite(unsigned short w){accessWrite=w;};
|
||||
void setReadAccess (unsigned short r){accessRead=r;};
|
||||
void setWriteAccess(unsigned short w){accessWrite=w;};
|
||||
void setNelem (unsigned int n) {nelem=n;};
|
||||
void setConnectionState (int cs) {connectionState=cs;};
|
||||
void setCafeConnectionState (int ccs) {cafeConnectionState=ccs;};
|
||||
void setConnectFlag (bool c)
|
||||
{
|
||||
connectFlag=c;
|
||||
};
|
||||
void setHostName (const char * h)
|
||||
{
|
||||
hostName=h;
|
||||
};
|
||||
void setDataType (chtype d)
|
||||
{
|
||||
dataType=d;
|
||||
};
|
||||
void setAccessRead (unsigned short r)
|
||||
{
|
||||
accessRead=r;
|
||||
};
|
||||
void setAccessWrite(unsigned short w)
|
||||
{
|
||||
accessWrite=w;
|
||||
};
|
||||
void setReadAccess (unsigned short r)
|
||||
{
|
||||
accessRead=r;
|
||||
};
|
||||
void setWriteAccess(unsigned short w)
|
||||
{
|
||||
accessWrite=w;
|
||||
};
|
||||
void setNelem (unsigned int n)
|
||||
{
|
||||
nelem=n;
|
||||
};
|
||||
void setConnectionState (int cs)
|
||||
{
|
||||
connectionState=cs;
|
||||
};
|
||||
void setCafeConnectionState (int ccs)
|
||||
{
|
||||
cafeConnectionState=ccs;
|
||||
};
|
||||
|
||||
public:
|
||||
chid getChannelID() const {return channelID;};
|
||||
bool getConnectFlag()const {return connectFlag;};
|
||||
const char * getHostName() const {return hostName;};
|
||||
string getHostNameAsString() {string h= hostName; return h;};
|
||||
chtype getDataType() const {return dataType;};
|
||||
const char * getClassName() const {return className;};
|
||||
string getClassNameAsString() {string c=className; return c;};
|
||||
unsigned short getAccessRead() const {return accessRead;};
|
||||
unsigned short getAccessWrite()const {return accessWrite;};
|
||||
unsigned short getReadAccess() const {return accessRead;};
|
||||
unsigned short getWriteAccess()const {return accessWrite;};
|
||||
unsigned int getNelem() const {return nelem;};
|
||||
int getConnectionState() const {return connectionState;};
|
||||
int getCafeConnectionState() const {return cafeConnectionState;};
|
||||
string getConnectionStateAsString() {
|
||||
if(connectionState==CA_OP_CONN_UP){return "CA_OP_CONN_UP";}
|
||||
else if(connectionState==CA_OP_CONN_DOWN){return "CA_OP_CONN_DOWN"; }
|
||||
else {return "CA_OP_CONN is UNKNOWN: THIS SHOULD NEVER APPEAR!";}};
|
||||
chid getChannelID() const
|
||||
{
|
||||
return channelID;
|
||||
};
|
||||
bool getConnectFlag()const
|
||||
{
|
||||
return connectFlag;
|
||||
};
|
||||
const char * getHostName() const
|
||||
{
|
||||
return hostName;
|
||||
};
|
||||
std::string getHostNameAsString()
|
||||
{
|
||||
std::string h= hostName;
|
||||
return h;
|
||||
};
|
||||
chtype getDataType() const
|
||||
{
|
||||
return dataType;
|
||||
};
|
||||
const char * getClassName() const
|
||||
{
|
||||
return className;
|
||||
};
|
||||
std::string getClassNameAsString()
|
||||
{
|
||||
std::string c=className;
|
||||
return c;
|
||||
};
|
||||
unsigned short getAccessRead() const
|
||||
{
|
||||
return accessRead;
|
||||
};
|
||||
unsigned short getAccessWrite()const
|
||||
{
|
||||
return accessWrite;
|
||||
};
|
||||
unsigned short getReadAccess() const
|
||||
{
|
||||
return accessRead;
|
||||
};
|
||||
unsigned short getWriteAccess()const
|
||||
{
|
||||
return accessWrite;
|
||||
};
|
||||
unsigned int getNelem() const
|
||||
{
|
||||
return nelem;
|
||||
};
|
||||
int getConnectionState() const
|
||||
{
|
||||
return connectionState;
|
||||
};
|
||||
int getCafeConnectionState() const
|
||||
{
|
||||
return cafeConnectionState;
|
||||
};
|
||||
std::string getConnectionStateAsString()
|
||||
{
|
||||
if(connectionState==CA_OP_CONN_UP) {
|
||||
return "CA_OP_CONN_UP";
|
||||
}
|
||||
else if(connectionState==CA_OP_CONN_DOWN) {
|
||||
return "CA_OP_CONN_DOWN";
|
||||
}
|
||||
else {
|
||||
return "CA_OP_CONN is UNKNOWN: THIS SHOULD NEVER APPEAR!";
|
||||
}
|
||||
};
|
||||
|
||||
string getCafeConnectionStateAsString() {
|
||||
return cafeStatus.csc.message(cafeConnectionState);};
|
||||
std::string getCafeConnectionStateAsString()
|
||||
{
|
||||
return cafeStatus.csc.message(cafeConnectionState);
|
||||
};
|
||||
|
||||
ChannelRegalia():channelID((chid) NULL), connectFlag(false), nelem((unsigned int) 1),
|
||||
dataType((chtype) CAFE_TYPENOTCONN),
|
||||
accessRead((unsigned short) 0), accessWrite((unsigned short) 0),
|
||||
connectionState((int) CA_OP_CONN_DOWN), cafeConnectionState((int) ICAFE_CS_NEVER_CONN)
|
||||
{strcpy(className, ""); hostName="";};
|
||||
dataType((chtype) CAFE_TYPENOTCONN),
|
||||
accessRead((unsigned short) 0), accessWrite((unsigned short) 0),
|
||||
connectionState((int) CA_OP_CONN_DOWN), cafeConnectionState((int) ICAFE_CS_NEVER_CONN)
|
||||
{
|
||||
strcpy(className, "");
|
||||
hostName="";
|
||||
};
|
||||
|
||||
~ChannelRegalia(){};
|
||||
~ChannelRegalia() {};
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Struct defining channel properties and connection status for use in displays
|
||||
*
|
||||
*/
|
||||
class ChannelDataStore {
|
||||
public:
|
||||
|
||||
std::string description;
|
||||
ChannelRegalia info;
|
||||
PVDataHolder pvd;
|
||||
PVCtrlHolder pvc;
|
||||
|
||||
ChannelDataStore() {
|
||||
|
||||
|
||||
};
|
||||
|
||||
~ChannelDataStore() {};
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Stores strings for Enum datatypes
|
||||
*
|
||||
*/
|
||||
class ChannelEnumStrings{
|
||||
class ChannelEnumStrings {
|
||||
public:
|
||||
friend struct change_eventHandlerArgs;
|
||||
private:
|
||||
char options [MAX_ENUM_STATES][MAX_ENUM_STRING_SIZE];
|
||||
short noOptions;
|
||||
public:
|
||||
ChannelEnumStrings():noOptions( (short) 0){};
|
||||
short getNoOptions() const {return noOptions;};
|
||||
char getOptions() const {return options[MAX_ENUM_STATES][MAX_ENUM_STRING_SIZE];};
|
||||
ChannelEnumStrings():noOptions( (short) 0) {};
|
||||
short getNoOptions() const
|
||||
{
|
||||
return noOptions;
|
||||
};
|
||||
std::vector<std::string> getOptions() const
|
||||
{
|
||||
std::vector<std::string> optionsV;
|
||||
optionsV.reserve(noOptions);
|
||||
for ( short i=0; i<noOptions; ++i) {
|
||||
optionsV.push_back(options[i]);
|
||||
}
|
||||
return optionsV;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -121,22 +256,22 @@ public:
|
||||
* Stores device/attribute pairing
|
||||
*
|
||||
*/
|
||||
class ChannelDeviceAttribute{
|
||||
class ChannelDeviceAttribute {
|
||||
private:
|
||||
std::string pv;
|
||||
std::string device;
|
||||
std::string attribute;
|
||||
std::string deliminator;
|
||||
public:
|
||||
ChannelDeviceAttribute(){};
|
||||
~ChannelDeviceAttribute(){};
|
||||
ChannelDeviceAttribute() {};
|
||||
~ChannelDeviceAttribute() {};
|
||||
|
||||
int init(std::string _pv, std::string _deliminator)
|
||||
{
|
||||
pv=_pv;
|
||||
deliminator=_deliminator;
|
||||
short posOfSeparator=pv.find_first_of(deliminator);
|
||||
if (posOfSeparator<0){
|
||||
if (posOfSeparator<0) {
|
||||
device="";
|
||||
attribute="";
|
||||
return ECAFE_DEVICE_ATTRIB_NOT_FOUND;
|
||||
@@ -144,17 +279,43 @@ public:
|
||||
else {
|
||||
device= pv.substr(0,posOfSeparator);
|
||||
attribute=pv.substr(posOfSeparator+1,pv.size());
|
||||
//Check for .VAL and remove
|
||||
std::size_t found = attribute.find(".");
|
||||
if (found != std::string::npos) {
|
||||
attribute=attribute.substr(0, found);
|
||||
}
|
||||
}
|
||||
return ICAFE_NORMAL;
|
||||
};
|
||||
|
||||
const char * getDeliminator() const {return deliminator.c_str();};
|
||||
const char * getDevice() const {return device.c_str();};
|
||||
const char * getAttribute() const {return attribute.c_str();};
|
||||
const char * getAttrib() const {return attribute.c_str();};
|
||||
std::string getDeliminatorAsString() const {return deliminator;};
|
||||
std::string getDeviceAsString() const {return device;};
|
||||
std::string getAttributeAsString() const {return attribute;};
|
||||
const char * getDeliminator() const
|
||||
{
|
||||
return deliminator.c_str();
|
||||
};
|
||||
const char * getDevice() const
|
||||
{
|
||||
return device.c_str();
|
||||
};
|
||||
const char * getAttribute() const
|
||||
{
|
||||
return attribute.c_str();
|
||||
};
|
||||
const char * getAttrib() const
|
||||
{
|
||||
return attribute.c_str();
|
||||
};
|
||||
std::string getDeliminatorAsString() const
|
||||
{
|
||||
return deliminator;
|
||||
};
|
||||
std::string getDeviceAsString() const
|
||||
{
|
||||
return device;
|
||||
};
|
||||
std::string getAttributeAsString() const
|
||||
{
|
||||
return attribute;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -162,7 +323,7 @@ public:
|
||||
* 0. Struct defining channel datatype/nelem executed by CAFE for use in Conduit container
|
||||
*
|
||||
*/
|
||||
class ChannelRequestMetaData{
|
||||
class ChannelRequestMetaData {
|
||||
public:
|
||||
friend struct change_connectionHandlerArgs;
|
||||
friend struct change_dataBufferSize_CTRL;
|
||||
@@ -175,7 +336,7 @@ public:
|
||||
|
||||
friend class Conduit;
|
||||
friend class ConduitGroup;
|
||||
|
||||
|
||||
protected:
|
||||
chid channelID; //of requested item
|
||||
unsigned int nelem; //depends on Policy
|
||||
@@ -188,59 +349,107 @@ protected:
|
||||
unsigned int offset;
|
||||
|
||||
public:
|
||||
void setNelem(unsigned int n){nelem= n > 0 ? n : 1;
|
||||
//nelemCache= nelem > nelemCache ? nelemCache : nelem;
|
||||
}; // byteSize=dbr_size_n(dbrDataType,nelem); };
|
||||
void setNelemCache(unsigned int n){nelemCache= n > 0 ? n : 1;}
|
||||
void setUsrArg(void * u){usrArg=u;};
|
||||
void setDataType(chtype d){dataType=d;};
|
||||
void setDbrDataType(chtype dbr){dbrDataType=dbr; }; //byteSize=dbr_size_n(dbrDataType,nelem);};
|
||||
void setCafeDbrType(CAFENUM::DBR_TYPE cd){cafeDbrType=cd;};
|
||||
void setDbrTypesFromCafeDbrType(CAFENUM::DBR_TYPE cd){
|
||||
void setNelem(unsigned int n)
|
||||
{
|
||||
nelem= n > 0 ? n : 1;
|
||||
//nelemCache= nelem > nelemCache ? nelemCache : nelem;
|
||||
}; // byteSize=dbr_size_n(dbrDataType,nelem); };
|
||||
void setNelemCache(unsigned int n)
|
||||
{
|
||||
nelemCache= n > 0 ? n : 1;
|
||||
}
|
||||
void setUsrArg(void * u)
|
||||
{
|
||||
usrArg=u;
|
||||
};
|
||||
void setDataType(chtype d)
|
||||
{
|
||||
dataType=d;
|
||||
};
|
||||
void setDbrDataType(chtype dbr)
|
||||
{
|
||||
dbrDataType=dbr;
|
||||
}; //byteSize=dbr_size_n(dbrDataType,nelem);};
|
||||
void setCafeDbrType(CAFENUM::DBR_TYPE cd)
|
||||
{
|
||||
cafeDbrType=cd;
|
||||
switch(cafeDbrType)
|
||||
{
|
||||
case CAFENUM::DBR_TIME:
|
||||
dbrDataType = dbf_type_to_DBR_TIME(dataType);
|
||||
break;
|
||||
case CAFENUM::DBR_STS:
|
||||
dbrDataType = dbf_type_to_DBR_STS(dataType);
|
||||
break;
|
||||
case CAFENUM::DBR_PRIMITIVE:
|
||||
dbrDataType = dbf_type_to_DBR(dataType);
|
||||
break;
|
||||
default:
|
||||
//Print Warning Message?
|
||||
dbrDataType = dbf_type_to_DBR_TIME(dataType);
|
||||
cafeDbrType = CAFENUM::DBR_TIME;
|
||||
break;
|
||||
};
|
||||
void setDbrTypesFromCafeDbrType(CAFENUM::DBR_TYPE cd)
|
||||
{
|
||||
cafeDbrType=cd;
|
||||
switch(cafeDbrType) {
|
||||
case CAFENUM::DBR_TIME:
|
||||
dbrDataType = dbf_type_to_DBR_TIME(dataType);
|
||||
break;
|
||||
case CAFENUM::DBR_STS:
|
||||
dbrDataType = dbf_type_to_DBR_STS(dataType);
|
||||
break;
|
||||
case CAFENUM::DBR_PRIMITIVE:
|
||||
dbrDataType = dbf_type_to_DBR(dataType);
|
||||
break;
|
||||
default:
|
||||
//Print Warning Message?
|
||||
dbrDataType = dbf_type_to_DBR_TIME(dataType);
|
||||
cafeDbrType = CAFENUM::DBR_TIME;
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
void setByteSize(unsigned int b){ byteSize=b;};
|
||||
void setByteSize(unsigned int b)
|
||||
{
|
||||
byteSize=b;
|
||||
};
|
||||
|
||||
unsigned int getNelem() const{return nelem;};
|
||||
unsigned int getNelemCache() const{return nelemCache;};
|
||||
void * getUsrArg() const{return usrArg;};
|
||||
chtype getDataType() const { return dataType;};
|
||||
chtype getDbrDataType() const { return dbrDataType;};
|
||||
CAFENUM::DBR_TYPE getCafeDbrType() const {return cafeDbrType;};
|
||||
unsigned int getNelem() const
|
||||
{
|
||||
return nelem;
|
||||
};
|
||||
unsigned int getNelemCache() const
|
||||
{
|
||||
return nelemCache;
|
||||
};
|
||||
void * getUsrArg() const
|
||||
{
|
||||
return usrArg;
|
||||
};
|
||||
chtype getDataType() const
|
||||
{
|
||||
return dataType;
|
||||
};
|
||||
chtype getDbrDataType() const
|
||||
{
|
||||
return dbrDataType;
|
||||
};
|
||||
CAFENUM::DBR_TYPE getCafeDbrType() const
|
||||
{
|
||||
return cafeDbrType;
|
||||
};
|
||||
|
||||
unsigned int getByteSize() const {return byteSize;};
|
||||
unsigned int getByteSize() const
|
||||
{
|
||||
return byteSize;
|
||||
};
|
||||
|
||||
void setOffset(unsigned int o) {offset=o;};
|
||||
unsigned int getOffset() const {return offset;};
|
||||
void setOffset(unsigned int o)
|
||||
{
|
||||
offset=o;
|
||||
};
|
||||
unsigned int getOffset() const
|
||||
{
|
||||
return offset;
|
||||
};
|
||||
|
||||
//Constructors
|
||||
ChannelRequestMetaData():channelID((chid) NULL), nelem((unsigned int) 1), nelemCache((unsigned int) 1),
|
||||
dataType((chtype) DBF_NO_ACCESS), dbrDataType((chtype) TYPENOTCONN), //
|
||||
cafeDbrType( (CAFENUM::DBR_TYPE) NULL),
|
||||
usrArg((void *) NULL), byteSize((unsigned int) 0), offset((unsigned int) 0){
|
||||
dataType((chtype) DBF_NO_ACCESS), dbrDataType((chtype) TYPENOTCONN), //
|
||||
cafeDbrType( (CAFENUM::DBR_TYPE) NULL),
|
||||
usrArg((void *) NULL), byteSize((unsigned int) 0), offset((unsigned int) 0)
|
||||
{
|
||||
|
||||
}; //CAStatus((long) ECA_NORMAL){};
|
||||
|
||||
~ChannelRequestMetaData(){};
|
||||
~ChannelRequestMetaData() {};
|
||||
};
|
||||
|
||||
|
||||
@@ -248,18 +457,18 @@ public:
|
||||
* -1. Struct defining channel datatype/nelem requested by client for use in Conduit container
|
||||
*
|
||||
*/
|
||||
class ChannelRequestMetaDataClient: public ChannelRequestMetaData{
|
||||
class ChannelRequestMetaDataClient: public ChannelRequestMetaData {
|
||||
public:
|
||||
|
||||
|
||||
//protected:
|
||||
//unsigned int offset;
|
||||
public:
|
||||
public:
|
||||
//void setOffset(unsigned int o) {offset=o;};
|
||||
//unsigned int getOffset() const {return offset;};
|
||||
|
||||
|
||||
//Constructors
|
||||
ChannelRequestMetaDataClient(){};//:offset((unsigned int) 0){};
|
||||
~ChannelRequestMetaDataClient(){};
|
||||
ChannelRequestMetaDataClient() {}; //:offset((unsigned int) 0){};
|
||||
~ChannelRequestMetaDataClient() {};
|
||||
};
|
||||
|
||||
|
||||
@@ -269,7 +478,7 @@ public:
|
||||
* messageStatus = requestStatus or messageStatus=callbackStatus (if policy WITH_CALLBACK)
|
||||
*
|
||||
*/
|
||||
class ChannelRequestStatus{
|
||||
class ChannelRequestStatus {
|
||||
|
||||
private:
|
||||
int preRequestStatus; // current status of channel
|
||||
@@ -284,33 +493,84 @@ private:
|
||||
CAFENUM::CallbackProgressKind callbackProgressKind;
|
||||
|
||||
public:
|
||||
int getPreRequestStatus() const {return preRequestStatus;};
|
||||
int getRequestStatus() const {return requestStatus;};
|
||||
int getPendStatus() const {return pendStatus;};
|
||||
int getCallbackStatus() const {return callbackStatus;};
|
||||
int getMessageStatus() const {return messageStatus;};
|
||||
CAFENUM::StatusMessageKind getMessageKind() const {return messageKind;};
|
||||
CAFENUM::CallbackProgressKind getCallbackProgressKind() const {return callbackProgressKind;};
|
||||
int getPreRequestStatus() const
|
||||
{
|
||||
return preRequestStatus;
|
||||
};
|
||||
int getRequestStatus() const
|
||||
{
|
||||
return requestStatus;
|
||||
};
|
||||
int getPendStatus() const
|
||||
{
|
||||
return pendStatus;
|
||||
};
|
||||
int getCallbackStatus() const
|
||||
{
|
||||
return callbackStatus;
|
||||
};
|
||||
int getMessageStatus() const
|
||||
{
|
||||
return messageStatus;
|
||||
};
|
||||
CAFENUM::StatusMessageKind getMessageKind() const
|
||||
{
|
||||
return messageKind;
|
||||
};
|
||||
CAFENUM::CallbackProgressKind getCallbackProgressKind() const
|
||||
{
|
||||
return callbackProgressKind;
|
||||
};
|
||||
|
||||
void setPreRequestStatus (int s) {preRequestStatus=s; messageStatus=s; messageKind=(CAFENUM::StatusMessageKind) CAFENUM::PRE_REQUEST;};
|
||||
void setRequestStatus (int r) {requestStatus = r; messageStatus=r; messageKind=(CAFENUM::StatusMessageKind) CAFENUM::FROM_REQUEST;};
|
||||
void setPendStatus (int p) {pendStatus = p; messageStatus=p; messageKind=(CAFENUM::StatusMessageKind) CAFENUM::FROM_PEND;};
|
||||
void setCallbackStatus (int c) {callbackStatus= c; messageStatus=c; messageKind=(CAFENUM::StatusMessageKind) CAFENUM::FROM_CALLBACK;};
|
||||
void setCallbackKind (bool hasInit, bool hasTrig) {
|
||||
hasCallbackInitiated=hasInit; hasCallbackTriggered=hasTrig;
|
||||
if ( hasInit && !hasTrig) {callbackProgressKind=(CAFENUM::CallbackProgressKind) CAFENUM::PENDING;}
|
||||
else if (!hasInit && hasTrig) {callbackProgressKind=(CAFENUM::CallbackProgressKind) CAFENUM::COMPLETE;}
|
||||
else if (!hasInit && !hasTrig) {callbackProgressKind=(CAFENUM::CallbackProgressKind) CAFENUM::NOT_INITIATED;}
|
||||
else {std::cout << "CAFE INTERNAL POLICY ERROR" << std::endl;
|
||||
std::cout << "ChannelRequestStatus::setCallbackKind gives an INVALID callbackProgressKind" << endl;}
|
||||
void setPreRequestStatus (int s)
|
||||
{
|
||||
preRequestStatus=s;
|
||||
messageStatus=s;
|
||||
messageKind=(CAFENUM::StatusMessageKind) CAFENUM::PRE_REQUEST;
|
||||
};
|
||||
void setRequestStatus (int r)
|
||||
{
|
||||
requestStatus = r;
|
||||
messageStatus=r;
|
||||
messageKind=(CAFENUM::StatusMessageKind) CAFENUM::FROM_REQUEST;
|
||||
};
|
||||
void setPendStatus (int p)
|
||||
{
|
||||
pendStatus = p;
|
||||
messageStatus=p;
|
||||
messageKind=(CAFENUM::StatusMessageKind) CAFENUM::FROM_PEND;
|
||||
};
|
||||
void setCallbackStatus (int c)
|
||||
{
|
||||
callbackStatus= c;
|
||||
messageStatus=c;
|
||||
messageKind=(CAFENUM::StatusMessageKind) CAFENUM::FROM_CALLBACK;
|
||||
};
|
||||
void setCallbackKind (bool hasInit, bool hasTrig)
|
||||
{
|
||||
hasCallbackInitiated=hasInit;
|
||||
hasCallbackTriggered=hasTrig;
|
||||
if ( hasInit && !hasTrig) {
|
||||
callbackProgressKind=(CAFENUM::CallbackProgressKind) CAFENUM::PENDING;
|
||||
}
|
||||
else if (!hasInit && hasTrig) {
|
||||
callbackProgressKind=(CAFENUM::CallbackProgressKind) CAFENUM::COMPLETE;
|
||||
}
|
||||
else if (!hasInit && !hasTrig) {
|
||||
callbackProgressKind=(CAFENUM::CallbackProgressKind) CAFENUM::NOT_INITIATED;
|
||||
}
|
||||
else {
|
||||
std::cout << "CAFE INTERNAL POLICY ERROR" << std::endl;
|
||||
std::cout << "ChannelRequestStatus::setCallbackKind gives an INVALID callbackProgressKind" << std::endl;
|
||||
}
|
||||
};
|
||||
//void setMessageStatus (long mstatus) {messageStatus = mstatus;};
|
||||
// void setMessageKind (StatusMessageKind mkind) { if (mkind<=CAFENUM::FROM_CALLBACK && mkind >= CAFENUM::PRE_REQUEST)
|
||||
// {messageKind = mkind;} else {cout<< mkind << " is an invalid statusMessageKind!" << endl;}};
|
||||
|
||||
ChannelRequestStatus():preRequestStatus(ICAFE_CS_NEVER_CONN),requestStatus(ICAFE_CS_NEVER_CONN),pendStatus(ICAFE_CS_NEVER_CONN),
|
||||
callbackStatus(ICAFE_CS_NEVER_CONN),messageStatus(ICAFE_CS_NEVER_CONN),messageKind((CAFENUM::StatusMessageKind) CAFENUM::NO_MESSAGE),
|
||||
hasCallbackInitiated(false),hasCallbackTriggered(false),callbackProgressKind((CAFENUM::CallbackProgressKind) CAFENUM::NOT_INITIATED){};
|
||||
callbackStatus(ICAFE_CS_NEVER_CONN),messageStatus(ICAFE_CS_NEVER_CONN),messageKind((CAFENUM::StatusMessageKind) CAFENUM::NO_MESSAGE),
|
||||
hasCallbackInitiated(false),hasCallbackTriggered(false),callbackProgressKind((CAFENUM::CallbackProgressKind) CAFENUM::NOT_INITIATED) {};
|
||||
};
|
||||
|
||||
#endif // CHANNELINFO_H
|
||||
|
||||
@@ -18,16 +18,16 @@
|
||||
#include <PVDataHolder.h>
|
||||
#include <PVCtrlHolder.h>
|
||||
#include <policies.h>
|
||||
|
||||
#include <deque>
|
||||
|
||||
#if HAVE_PYTHON_H
|
||||
|
||||
#if HAVE_PYCAFE_EXT
|
||||
#include <Python.h> //required for PyCafe.h
|
||||
#include <PyCafe.h>
|
||||
#else
|
||||
#include <PyCafe_api.h>
|
||||
#endif
|
||||
#if HAVE_PYCAFE_EXT
|
||||
#include <Python.h> //required for PyCafe.h
|
||||
#include <PyCafe.h>
|
||||
#else
|
||||
#include <PyCafe_api.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -37,25 +37,27 @@
|
||||
* \param _pv process variable
|
||||
* \param _ccc ca_client_context
|
||||
*/
|
||||
class Conduit
|
||||
{
|
||||
class Conduit {
|
||||
public:
|
||||
friend struct change_alarmStatus;
|
||||
friend struct change_alarmSeverity;
|
||||
friend struct change_epicsTimeStamp;
|
||||
friend struct change_alarmStatus;
|
||||
friend struct change_alarmSeverity;
|
||||
friend struct change_epicsTimeStamp;
|
||||
|
||||
friend struct change_accessRightsHandlerArgs;
|
||||
friend struct change_accessRead;
|
||||
friend struct change_accessWrite;
|
||||
|
||||
friend struct change_beamEventNo;
|
||||
|
||||
friend struct change_channelDeviceAttribute;
|
||||
friend struct change_channelID;
|
||||
friend struct change_channelRegalia;
|
||||
|
||||
friend struct change_channelGetCacheWaitPolicy;
|
||||
friend struct change_channelGetActionWhenMonitorPolicy;
|
||||
|
||||
friend struct change_channelGetCacheWaitPolicy;
|
||||
friend struct change_channelGetActionWhenMonitorPolicy;
|
||||
|
||||
friend struct change_channelRequestDataTypePolicy;
|
||||
|
||||
|
||||
friend struct change_channelRequestMetaCtrl;
|
||||
friend struct change_channelRequestMetaCtrlClient;
|
||||
|
||||
@@ -80,7 +82,7 @@ public:
|
||||
friend struct change_channelTimeoutPolicyPut;
|
||||
|
||||
friend struct change_connectionHandlerArgs;
|
||||
|
||||
|
||||
friend struct change_dataBufferSize_PRIMITIVE;
|
||||
friend struct change_dataBufferSize_TIME;
|
||||
friend struct change_dataBufferSize_CTRL;
|
||||
@@ -88,8 +90,12 @@ public:
|
||||
|
||||
//friend struct change_dataBufferPVCtrlHolder;
|
||||
//friend struct change_dataBufferPVDataHolder;
|
||||
|
||||
friend struct change_eventHandlerArgs;
|
||||
friend struct change_hasNewData;
|
||||
friend struct change_dequePulseID;
|
||||
friend struct change_mapPulseID;
|
||||
friend struct change_mapPulseIDBufferSize;
|
||||
friend struct change_monitorAction;
|
||||
friend struct change_monitorActionClear;
|
||||
friend struct change_monitorActionErase;
|
||||
@@ -104,6 +110,8 @@ public:
|
||||
friend struct change_pvAlias;
|
||||
friend struct change_status;
|
||||
|
||||
friend struct change_supplementHandle;
|
||||
|
||||
friend struct change_usrArgs;
|
||||
|
||||
friend struct free_dataBuffers;
|
||||
@@ -114,40 +122,57 @@ public:
|
||||
friend class ChannelCreatePolicy;
|
||||
friend class ConduitGroup;
|
||||
friend class MonitorPolicy;
|
||||
|
||||
//friend void CAFE_CALLBACK::PyHandlerPut;
|
||||
//friend void CAFE_CALLBACK::PyHandlerGet;
|
||||
//friend struct change_pyCafeFlag;
|
||||
|
||||
//friend void CAFE_CALLBACK::PyHandlerPut;
|
||||
//friend void CAFE_CALLBACK::PyHandlerGet;
|
||||
//friend struct change_pyCafeFlag;
|
||||
|
||||
private:
|
||||
//from alarmString.h
|
||||
const char * epicsAlarmSeverityStrings[ALARM_SEVERITY_STRING_LENGTH];
|
||||
//from alarmString.h
|
||||
const char * epicsAlarmSeverityStrings[ALARM_SEVERITY_STRING_LENGTH];
|
||||
const char * epicsAlarmConditionStrings[ALARM_STATUS_STRING_LENGTH];
|
||||
|
||||
|
||||
static unsigned int handleNext;
|
||||
|
||||
ca_client_context * ccc;
|
||||
|
||||
union db_access_val * dataBuffer;
|
||||
|
||||
union db_access_val * dataBuffer;
|
||||
union db_access_val * ctrlBuffer;
|
||||
union db_access_val * putBuffer;
|
||||
union db_access_val * stsackBuffer;
|
||||
|
||||
union db_access_val * stsackBuffer;
|
||||
|
||||
short alarmStatus;
|
||||
short alarmSeverity;
|
||||
epicsTimeStamp ts;
|
||||
|
||||
void * usrArgs; //Filled in conduitEventHandlerArgs.h; used by getUsrArgsAsUInt in CyCafe
|
||||
|
||||
chtype dataType;
|
||||
chtype dbrDataType;
|
||||
CAFENUM::DBR_TYPE cafeDbrType;
|
||||
|
||||
|
||||
//New Oct. 2018
|
||||
std::string desc;
|
||||
//short hhsv;
|
||||
//short hsv;
|
||||
//short lsv;
|
||||
//short llsv;
|
||||
alarmSeverityStruct aSevStruct;
|
||||
bool hasDesc;
|
||||
bool hasAlarmSevStruct;
|
||||
|
||||
|
||||
void * usrArgs; //Filled in conduitEventHandlerArgs.h; used by getUsrArgsAsUInt in CyCafe
|
||||
|
||||
chtype dataType;
|
||||
chtype dbrDataType;
|
||||
CAFENUM::DBR_TYPE cafeDbrType;
|
||||
|
||||
//Reserved
|
||||
unsigned int beamEventNo;
|
||||
unsigned long long beamEventNo;
|
||||
|
||||
std:: deque<PVDataHolder> dequePulseID;
|
||||
|
||||
std::map<unsigned long long, PVDataHolder> mapPulseID;
|
||||
std::map<unsigned long long, PVDataHolder>::iterator mpos;
|
||||
unsigned short mapPulseIDBufferSize;
|
||||
|
||||
//bool rule;
|
||||
bool pyCafeFlag;
|
||||
bool pyCafeFlag;
|
||||
|
||||
std::string deviceAttributeDeliminator;
|
||||
ChannelDeviceAttribute channelDeviceAttribute;
|
||||
@@ -159,7 +184,7 @@ private:
|
||||
|
||||
//ChannelPolicies
|
||||
|
||||
ChannelGetCacheWaitPolicy channelGetCacheWaitPolicy;
|
||||
ChannelGetCacheWaitPolicy channelGetCacheWaitPolicy;
|
||||
ChannelGetActionWhenMonitorPolicy channelGetActionWhenMonitorPolicy;
|
||||
|
||||
ChannelRequestDataTypePolicy channelRequestDataTypePolicy;
|
||||
@@ -176,28 +201,28 @@ private:
|
||||
ChannelRequestStatus channelRequestStatusGetSTSACK; //STSACK
|
||||
ChannelRequestStatus channelRequestStatusGetClassName;//ClassName
|
||||
|
||||
ChannelTimeoutPolicy channelTimeoutPolicyGet;
|
||||
ChannelTimeoutPolicy channelTimeoutPolicyPut;
|
||||
ChannelTimeoutPolicy channelTimeoutPolicyGet;
|
||||
ChannelTimeoutPolicy channelTimeoutPolicyPut;
|
||||
|
||||
ChannelRegalia channelRegalia;
|
||||
|
||||
ChannelRequestMetaData channelRequestMetaData; //0 container for actual send
|
||||
ChannelRequestMetaDataClient channelRequestMetaDataClient; //-1 //DATA
|
||||
//ChannelRequestMetaDataRepository channelRequestMetaDataRepository; // (CAFENUM::DBR_TYPE DBR_TIME) ; //1
|
||||
|
||||
|
||||
ChannelRequestMetaData channelRequestMetaCtrl; //0 container for actual send
|
||||
ChannelRequestMetaDataClient channelRequestMetaCtrlClient; //-1 //CTRL
|
||||
ChannelRequestMetaDataClient channelRequestMetaCtrlClient; //-1 //CTRL
|
||||
//ChannelRequestMetaDataRepository channelRequestMetaCtrlRepository; // (CAFENUM::DBR_TYPE DBR_CTRL); //1
|
||||
|
||||
|
||||
ChannelRequestMetaData channelRequestMetaSTSACK;// (CAFENUM::DBR_TYPE DBR_STSACK);//1
|
||||
ChannelRequestMetaData channelRequestMetaPrimitive; //Put operations
|
||||
|
||||
#if HAVE_PYTHON_H
|
||||
void * PyEventHandler() const;
|
||||
void * PyEventHandler(unsigned int) const;
|
||||
void * PyDataEventHandler() const;
|
||||
void * PyCtrlEventHandler() const;
|
||||
#endif
|
||||
#if HAVE_PYTHON_H
|
||||
void * PyEventHandler() const;
|
||||
void * PyEventHandler(unsigned int) const;
|
||||
void * PyDataEventHandler() const;
|
||||
void * PyCtrlEventHandler() const;
|
||||
#endif
|
||||
|
||||
int putWithCallback(pCallback callbackHandlerPut) const;
|
||||
|
||||
@@ -216,134 +241,379 @@ private:
|
||||
//map<unsigned long,MonitorPolicy>::iterator ilump;
|
||||
|
||||
////MonitorPolicy mpBase;
|
||||
vector<MonitorPolicy> mpV;
|
||||
vector<MonitorPolicy> mpInWaitingV;
|
||||
std::vector<MonitorPolicy> mpV;
|
||||
std::vector<MonitorPolicy> mpInWaitingV;
|
||||
|
||||
int monitorStart(MonitorPolicy &mp) const;
|
||||
int monitorStop(evid eventID) const;
|
||||
|
||||
vector<std::string> monitorAction;
|
||||
std::vector<std::string> monitorAction;
|
||||
|
||||
bool hasNewData; // used by HandleHelper.getMonitorAction();
|
||||
|
||||
public:
|
||||
#if HAVE_PYTHON_H
|
||||
void * PyGetHandler() const;
|
||||
void * PyPutHandler() const;
|
||||
#endif
|
||||
|
||||
#if HAVE_PYTHON_H
|
||||
void * PyGetHandler() const;
|
||||
void * PyPutHandler() const;
|
||||
#endif
|
||||
|
||||
Conduit(void );
|
||||
|
||||
Conduit(const char * _pv, ca_client_context *_ccc,
|
||||
ChannelRequestPolicy _channelRequestPolicyPut, ChannelRequestPolicy _channelRequestPolicyGet,
|
||||
ChannelGetActionWhenMonitorPolicy _channelGetActionWhenMonitorPolicy,
|
||||
bool _pyCafeFlag);
|
||||
|
||||
|
||||
Conduit(const char * _pv, ca_client_context *_ccc,
|
||||
ChannelRequestPolicy _channelRequestPolicyPut, ChannelRequestPolicy _channelRequestPolicyGet,
|
||||
ChannelGetActionWhenMonitorPolicy _channelGetActionWhenMonitorPolicy, bool _pyCafeFlag);
|
||||
|
||||
//Conduit(const char * _pv, ca_client_context *_ccc, bool _pyCafeFlag);
|
||||
//Conduit(const char * _pv, ca_client_context *_ccc);
|
||||
virtual ~Conduit();
|
||||
unsigned int groupHandle; // Group handle this pv handle belongs to!!
|
||||
unsigned int handle;
|
||||
|
||||
|
||||
chid channelID;
|
||||
//evid eventID;
|
||||
|
||||
std::string pv;
|
||||
std::string pvAlias;
|
||||
std::string pvAlias;
|
||||
|
||||
int status;
|
||||
|
||||
|
||||
|
||||
friend std::ostream& operator<<(std::ostream& os, const Conduit& e)
|
||||
{
|
||||
os<< "handle=" << e.handle<<" pv=" << e.pv<< std::endl;
|
||||
return os;
|
||||
};
|
||||
|
||||
bool getPyCafe() const {return pyCafeFlag;};
|
||||
|
||||
bool operator<(const Conduit& c)const{return handle<c.handle;};
|
||||
|
||||
const char * getDevice(void) const {return channelDeviceAttribute.getDevice();};
|
||||
const char * getAttribute(void) const {return channelDeviceAttribute.getAttribute();};
|
||||
bool getPyCafe() const
|
||||
{
|
||||
return pyCafeFlag;
|
||||
};
|
||||
|
||||
const char * getHostName(void) const {return channelRegalia.hostName;};
|
||||
bool isConnected(void) const {return channelRegalia.connectFlag;};
|
||||
|
||||
epicsTimeStamp getTimeStamp(void) const{return ts;}
|
||||
short getAlarmStatus(void) const{return alarmStatus;}
|
||||
short getAlarmSeverity(void) const{return alarmSeverity;}
|
||||
|
||||
bool operator<(const Conduit& c)const
|
||||
{
|
||||
return handle<c.handle;
|
||||
};
|
||||
|
||||
const char * getDevice(void) const
|
||||
{
|
||||
return channelDeviceAttribute.getDevice();
|
||||
};
|
||||
const char * getAttribute(void) const
|
||||
{
|
||||
return channelDeviceAttribute.getAttribute();
|
||||
};
|
||||
|
||||
const char * getHostName(void) const
|
||||
{
|
||||
return channelRegalia.hostName;
|
||||
};
|
||||
bool isConnected(void) const
|
||||
{
|
||||
return channelRegalia.connectFlag;
|
||||
};
|
||||
|
||||
std::string getDescription(void) const
|
||||
{
|
||||
return desc;
|
||||
}
|
||||
|
||||
epicsTimeStamp getTimeStamp(void) const
|
||||
{
|
||||
return ts;
|
||||
}
|
||||
short getAlarmStatus(void) const
|
||||
{
|
||||
return alarmStatus;
|
||||
}
|
||||
short getAlarmSeverity(void) const
|
||||
{
|
||||
return alarmSeverity;
|
||||
}
|
||||
short getHHSV(void) const
|
||||
{
|
||||
return aSevStruct.hhsv;
|
||||
}
|
||||
short getHSV(void) const
|
||||
{
|
||||
return aSevStruct.hsv;
|
||||
}
|
||||
short getLSV(void) const
|
||||
{
|
||||
return aSevStruct.lsv;
|
||||
}
|
||||
short getLLSV(void) const
|
||||
{
|
||||
return aSevStruct.llsv;
|
||||
}
|
||||
alarmSeverityStruct getAlarmSeverityStruct(void) const
|
||||
{
|
||||
return aSevStruct;
|
||||
}
|
||||
|
||||
string getAlarmStatusAsString(void) const{
|
||||
if (alarmStatus>-1 && alarmStatus<ALARM_STATUS_STRING_LENGTH) {
|
||||
return (string) epicsAlarmConditionStrings[alarmStatus];}
|
||||
else {
|
||||
cout << "alarmStatusValue=" << alarmStatus << " is not within the valid range of 0-3!" << endl;
|
||||
return (string) "ALARM_UNKNOWN";
|
||||
}
|
||||
}
|
||||
string getAlarmSeverityAsString(void) const{
|
||||
if (alarmSeverity>-1 && alarmSeverity<ALARM_SEVERITY_STRING_LENGTH) {
|
||||
return (string) epicsAlarmSeverityStrings[alarmSeverity];}
|
||||
else {
|
||||
cout << "alarmStatusSeverity=" << alarmSeverity << " is not within the valid range of 0-21!" << endl;
|
||||
return (string) "SEVERITY_UNKNOWN";
|
||||
}
|
||||
}
|
||||
bool hasDescription(void) const
|
||||
{
|
||||
return hasDesc;
|
||||
}
|
||||
|
||||
bool hasAlarmSeverityStruct(void) const
|
||||
{
|
||||
return hasAlarmSevStruct;
|
||||
}
|
||||
|
||||
bool hasAlarmSeverity(void) const
|
||||
{
|
||||
if (aSevStruct.hhsv>SEV_NO_ALARM && aSevStruct.hhsv<=SEV_INVALID) {return true;}
|
||||
else if (aSevStruct.hsv>SEV_NO_ALARM && aSevStruct.hsv<=SEV_INVALID) {return true;}
|
||||
else if (aSevStruct.lsv>SEV_NO_ALARM && aSevStruct.lsv<=SEV_INVALID) {return true;}
|
||||
else if (aSevStruct.llsv>SEV_NO_ALARM && aSevStruct.llsv<=SEV_INVALID) {return true;}
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned short getAccessRead(void) const{return channelRegalia.accessRead;};
|
||||
unsigned short getAccessWrite(void) const{return channelRegalia.accessWrite;};
|
||||
std::string getAlarmStatusAsString(void) const
|
||||
{
|
||||
if (alarmStatus>-1 && alarmStatus<ALARM_STATUS_STRING_LENGTH) {
|
||||
return (std::string) epicsAlarmConditionStrings[alarmStatus];
|
||||
}
|
||||
else {
|
||||
std::cout << "alarmStatusValue=" << alarmStatus << " is not within the valid range of 0-3!" << std::endl;
|
||||
return (std::string) "ALARM_UNKNOWN";
|
||||
}
|
||||
}
|
||||
std::string getAlarmSeverityAsString(void) const
|
||||
{
|
||||
if (alarmSeverity>-1 && alarmSeverity<ALARM_SEVERITY_STRING_LENGTH) {
|
||||
return (std::string) epicsAlarmSeverityStrings[alarmSeverity];
|
||||
}
|
||||
else {
|
||||
std::cout << "alarmStatusSeverity=" << alarmSeverity << " is not within the valid range of 0-21!" << std::endl;
|
||||
return (std::string) "SEVERITY_UNKNOWN";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
unsigned short getAccessRead(void) const
|
||||
{
|
||||
return channelRegalia.accessRead;
|
||||
};
|
||||
unsigned short getAccessWrite(void) const
|
||||
{
|
||||
return channelRegalia.accessWrite;
|
||||
};
|
||||
//Reserved
|
||||
unsigned int getBeamEventNo(void) const {return beamEventNo;};
|
||||
chid getChannelID(void) const {return channelRegalia.channelID;};
|
||||
ChannelRegalia getChannelRegalia(void) const {return channelRegalia;};
|
||||
ca_client_context * getClientContext(void) const {return ccc;};
|
||||
unsigned int getGroupHandle(void) const {return groupHandle;};
|
||||
unsigned int getHandle(void) const {return handle;};
|
||||
const char * getPV(void) const {return pv.c_str();};
|
||||
const char * getPVAlias(void) const {return pvAlias.c_str();};
|
||||
unsigned long long getBeamEventNo(void) const
|
||||
{
|
||||
return beamEventNo;
|
||||
};
|
||||
unsigned long long getPulseID(void) const
|
||||
{
|
||||
return beamEventNo;
|
||||
};
|
||||
|
||||
int getStatus(void) const {return status;};
|
||||
/*
|
||||
PVDataHolder getPVDataFromPulseID(unsigned long long globalPulseID) const {
|
||||
PVDataHolder pvd;
|
||||
std::map<unsigned long long, PVDataHolder>::iterator mpos;
|
||||
|
||||
void * getUsrArgs(void) const {return usrArgs;};
|
||||
chtype getDataType(void) const {return dataType;};
|
||||
chtype getDbrDataType(void) const {return dbrDataType;};
|
||||
CAFENUM::DBR_TYPE getCafeDbrType(void) const {return cafeDbrType;};
|
||||
|
||||
db_access_val * getCtrlBuffer(void) const {return ctrlBuffer;};
|
||||
db_access_val * getDataBuffer(void) const {return dataBuffer;};
|
||||
db_access_val * getPutBuffer(void) const {return putBuffer;};
|
||||
mpos=mapPulseID.find(globalPulseID);
|
||||
|
||||
if (mpos != mapPulseID.end() ) {
|
||||
pvd = (mpos->second);
|
||||
//std::cout << "key: EXACT MATCH FOUND " << mpos->first << " pid " << globalPulseID << std::endl;
|
||||
return pvd;
|
||||
}
|
||||
else {getPVDataHolder(pvd);
|
||||
return pvd;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
std::map<unsigned long long, PVDataHolder> getPulsePVDataMap() const
|
||||
{
|
||||
//std::map<unsigned long long, PVDataHolder> a; return a;};
|
||||
return mapPulseID;
|
||||
};
|
||||
unsigned short getMapPulseIDBufferSize() const
|
||||
{
|
||||
return mapPulseIDBufferSize;
|
||||
};
|
||||
|
||||
std::deque<PVDataHolder> getPulsePVData() const
|
||||
{
|
||||
return dequePulseID;
|
||||
}
|
||||
|
||||
|
||||
chid getChannelID(void) const
|
||||
{
|
||||
return channelRegalia.channelID;
|
||||
};
|
||||
ChannelRegalia getChannelRegalia(void) const
|
||||
{
|
||||
return channelRegalia;
|
||||
};
|
||||
ca_client_context * getClientContext(void) const
|
||||
{
|
||||
return ccc;
|
||||
};
|
||||
unsigned int getGroupHandle(void) const
|
||||
{
|
||||
return groupHandle;
|
||||
};
|
||||
unsigned int getHandle(void) const
|
||||
{
|
||||
return handle;
|
||||
};
|
||||
const char * getPV(void) const
|
||||
{
|
||||
return pv.c_str();
|
||||
};
|
||||
std::string getPVAsString(void) const
|
||||
{
|
||||
return pv;
|
||||
};
|
||||
const char * getPVAlias(void) const
|
||||
{
|
||||
return pvAlias.c_str();
|
||||
};
|
||||
std::string getPVAliasAsString(void) const
|
||||
{
|
||||
return pvAlias;
|
||||
};
|
||||
|
||||
int getStatus(void) const
|
||||
{
|
||||
return status;
|
||||
};
|
||||
|
||||
void * getUsrArgs(void) const
|
||||
{
|
||||
return usrArgs;
|
||||
};
|
||||
chtype getDataType(void) const
|
||||
{
|
||||
return dataType;
|
||||
};
|
||||
chtype getDbrDataType(void) const
|
||||
{
|
||||
return dbrDataType;
|
||||
};
|
||||
CAFENUM::DBR_TYPE getCafeDbrType(void) const
|
||||
{
|
||||
return cafeDbrType;
|
||||
};
|
||||
|
||||
db_access_val * getCtrlBuffer(void) const
|
||||
{
|
||||
return ctrlBuffer;
|
||||
};
|
||||
db_access_val * getDataBuffer(void) const
|
||||
{
|
||||
return dataBuffer;
|
||||
};
|
||||
db_access_val * getPutBuffer(void) const
|
||||
{
|
||||
return putBuffer;
|
||||
};
|
||||
|
||||
int getPVDataHolder(PVDataHolder &) const ;
|
||||
int getPVCtrlHolder(PVCtrlHolder &) const ;
|
||||
|
||||
|
||||
std::string getUnits(void) const {
|
||||
PVCtrlHolder pvc;
|
||||
getPVCtrlHolder(pvc);
|
||||
return pvc.getUnitsAsString();
|
||||
};
|
||||
|
||||
short getPrecision(void) const {
|
||||
PVCtrlHolder pvc;
|
||||
getPVCtrlHolder(pvc);
|
||||
return pvc.getPrecision();
|
||||
};
|
||||
|
||||
//bool getRule(void) const {return rule;};
|
||||
//bool getRule(void) const {return rule;};
|
||||
|
||||
//RequestPolicy
|
||||
ChannelGetCacheWaitPolicy getChannelGetCacheWaitPolicy(void) const { return channelGetCacheWaitPolicy;};
|
||||
ChannelGetActionWhenMonitorPolicy getChannelGetActionWhenMonitorPolicy(void) const { return channelGetActionWhenMonitorPolicy;}
|
||||
|
||||
ChannelTimeoutPolicy getChannelTimeoutPolicyGet (void) const {return channelTimeoutPolicyGet;};
|
||||
ChannelRequestPolicy getChannelRequestPolicyGet (void) const {return channelRequestPolicyGet;};
|
||||
ChannelRequestStatus getChannelRequestStatusGet (void) const {return channelRequestStatusGet;};
|
||||
ChannelRequestPolicy getChannelRequestPolicyGetCtrl (void) const {return channelRequestPolicyGetCtrl;};
|
||||
ChannelRequestStatus getChannelRequestStatusGetCtrl (void) const {return channelRequestStatusGetCtrl;};
|
||||
//RequestPolicy
|
||||
ChannelGetCacheWaitPolicy getChannelGetCacheWaitPolicy(void) const
|
||||
{
|
||||
return channelGetCacheWaitPolicy;
|
||||
};
|
||||
ChannelGetActionWhenMonitorPolicy getChannelGetActionWhenMonitorPolicy(void) const
|
||||
{
|
||||
return channelGetActionWhenMonitorPolicy;
|
||||
}
|
||||
|
||||
ChannelRequestStatus getChannelRequestStatusGetSTSACK (void) const {return channelRequestStatusGetSTSACK;};
|
||||
ChannelRequestStatus getChannelRequestStatusGetClassName (void) const {return channelRequestStatusGetClassName;};
|
||||
ChannelTimeoutPolicy getChannelTimeoutPolicyGet (void) const
|
||||
{
|
||||
return channelTimeoutPolicyGet;
|
||||
};
|
||||
ChannelRequestPolicy getChannelRequestPolicyGet (void) const
|
||||
{
|
||||
return channelRequestPolicyGet;
|
||||
};
|
||||
ChannelRequestStatus getChannelRequestStatusGet (void) const
|
||||
{
|
||||
return channelRequestStatusGet;
|
||||
};
|
||||
ChannelRequestPolicy getChannelRequestPolicyGetCtrl (void) const
|
||||
{
|
||||
return channelRequestPolicyGetCtrl;
|
||||
};
|
||||
ChannelRequestStatus getChannelRequestStatusGetCtrl (void) const
|
||||
{
|
||||
return channelRequestStatusGetCtrl;
|
||||
};
|
||||
|
||||
ChannelTimeoutPolicy getChannelTimeoutPolicyPut (void) const {return channelTimeoutPolicyPut;};
|
||||
ChannelRequestPolicy getChannelRequestPolicyPut (void) const {return channelRequestPolicyPut;};
|
||||
ChannelRequestStatus getChannelRequestStatusPut (void) const {return channelRequestStatusPut;};
|
||||
ChannelRequestStatus getChannelRequestStatusGetSTSACK (void) const
|
||||
{
|
||||
return channelRequestStatusGetSTSACK;
|
||||
};
|
||||
ChannelRequestStatus getChannelRequestStatusGetClassName (void) const
|
||||
{
|
||||
return channelRequestStatusGetClassName;
|
||||
};
|
||||
|
||||
ChannelRequestDataTypePolicy getChannelRequestDataTypePolicy(void) const { return channelRequestDataTypePolicy;};
|
||||
ChannelTimeoutPolicy getChannelTimeoutPolicyPut (void) const
|
||||
{
|
||||
return channelTimeoutPolicyPut;
|
||||
};
|
||||
ChannelRequestPolicy getChannelRequestPolicyPut (void) const
|
||||
{
|
||||
return channelRequestPolicyPut;
|
||||
};
|
||||
ChannelRequestStatus getChannelRequestStatusPut (void) const
|
||||
{
|
||||
return channelRequestStatusPut;
|
||||
};
|
||||
|
||||
ChannelRequestMetaData getChannelRequestMetaData(void) const {return channelRequestMetaData;}; //0
|
||||
ChannelRequestMetaDataClient getChannelRequestMetaDataClient(void) const {return channelRequestMetaDataClient;}; //-1
|
||||
ChannelRequestMetaData getChannelRequestMetaCtrl(void) const {return channelRequestMetaCtrl;}; //0
|
||||
ChannelRequestMetaDataClient getChannelRequestMetaCtrlClient(void) const {return channelRequestMetaCtrlClient;}; //-1
|
||||
ChannelRequestDataTypePolicy getChannelRequestDataTypePolicy(void) const
|
||||
{
|
||||
return channelRequestDataTypePolicy;
|
||||
};
|
||||
|
||||
ChannelRequestMetaData getChannelRequestMetaPrimitive(void) const {return channelRequestMetaPrimitive;}; //0
|
||||
ChannelRequestMetaData getChannelRequestMetaData(void) const
|
||||
{
|
||||
return channelRequestMetaData;
|
||||
}; //0
|
||||
ChannelRequestMetaDataClient getChannelRequestMetaDataClient(void) const
|
||||
{
|
||||
return channelRequestMetaDataClient;
|
||||
}; //-1
|
||||
ChannelRequestMetaData getChannelRequestMetaCtrl(void) const
|
||||
{
|
||||
return channelRequestMetaCtrl;
|
||||
}; //0
|
||||
ChannelRequestMetaDataClient getChannelRequestMetaCtrlClient(void) const
|
||||
{
|
||||
return channelRequestMetaCtrlClient;
|
||||
}; //-1
|
||||
|
||||
ChannelRequestMetaData getChannelRequestMetaPrimitive(void) const
|
||||
{
|
||||
return channelRequestMetaPrimitive;
|
||||
}; //0
|
||||
|
||||
//ChannelRequestMetaDataRepository getChannelRequestMetaDataRepository (void) const {return channelRequestMetaDataRepository;}; //1
|
||||
//ChannelRequestMetaDataRepository getChannelRequestMetaCtrlRepository (void) const {return channelRequestMetaCtrlRepository;}; //1
|
||||
@@ -351,11 +621,23 @@ public:
|
||||
//ChannelRequestMetaDataRepository getChannelRequestMetaPrimitiveRepository(void) const {return channelRequestMetaPrimitiveRepository;}; //1
|
||||
|
||||
////MonitorPolicy getMonitorPolicy(void) const {return mpBase;};
|
||||
vector<MonitorPolicy> getMonitorPolicyVector(void) const {return mpV;};
|
||||
vector<MonitorPolicy> getMonitorPolicyInWaitingVector(void) const {return mpInWaitingV;};
|
||||
std::vector<MonitorPolicy> getMonitorPolicyVector(void) const
|
||||
{
|
||||
return mpV;
|
||||
};
|
||||
std::vector<MonitorPolicy> getMonitorPolicyInWaitingVector(void) const
|
||||
{
|
||||
return mpInWaitingV;
|
||||
};
|
||||
|
||||
vector<string> getMonitorAction(void) const {return monitorAction;};
|
||||
bool getHasNewData(void) const {return hasNewData;};
|
||||
std::vector<std::string> getMonitorAction(void) const
|
||||
{
|
||||
return monitorAction;
|
||||
};
|
||||
bool getHasNewData(void) const
|
||||
{
|
||||
return hasNewData;
|
||||
};
|
||||
};
|
||||
|
||||
#endif // CONDUIT_H
|
||||
|
||||
@@ -12,45 +12,44 @@
|
||||
#include <conduit.h>
|
||||
#include <statusCodes.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
/**
|
||||
* Friend to Conduit/CAFEGroup records the connection_handler_args struct from callback fns
|
||||
* in hash table
|
||||
*/
|
||||
struct change_connectionHandlerArgs
|
||||
{
|
||||
struct change_connectionHandlerArgs {
|
||||
#define __METHOD__ "change_connectionHandlerArgs"
|
||||
change_connectionHandlerArgs (const struct connection_handler_args & new_connectionHandlerArgs):
|
||||
new_connectionHandlerArgs(new_connectionHandlerArgs){}
|
||||
new_connectionHandlerArgs(new_connectionHandlerArgs) {}
|
||||
|
||||
void operator() (Conduit& c)
|
||||
{
|
||||
|
||||
|
||||
void operator() (Conduit& c) {
|
||||
|
||||
chtype nativeDataType = ca_field_type(new_connectionHandlerArgs.chid);
|
||||
|
||||
|
||||
c.channelRegalia.connectionState=new_connectionHandlerArgs.op;
|
||||
|
||||
|
||||
// Data type code will be one of DBF_. The constant TYPENOTCONN=-1 is
|
||||
// returned if the channel is not connected
|
||||
// but we do not overwrite it upon disconnect.
|
||||
|
||||
//connectFlag
|
||||
if (new_connectionHandlerArgs.op == CA_OP_CONN_UP){
|
||||
|
||||
//cout << " change_connectionHandlerArgs: bytesize UP " << c.channelRequestMetaData.byteSize << endl;
|
||||
//channelRegalia
|
||||
if (new_connectionHandlerArgs.op == CA_OP_CONN_UP) {
|
||||
|
||||
//std::cout << " change_connectionHandlerArgs: bytesize UP " << c.channelRequestMetaData.byteSize << std::endl;
|
||||
//channelRegalia
|
||||
c.channelRegalia.nelem = ca_element_count(new_connectionHandlerArgs.chid);
|
||||
c.channelRegalia.connectFlag = true;
|
||||
c.channelRegalia.hostName = (const char *) ca_host_name (new_connectionHandlerArgs.chid);
|
||||
|
||||
if (c.channelRegalia.channelID != new_connectionHandlerArgs.chid) {
|
||||
cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << endl;
|
||||
cout << "Internal CAFE WARNING for handle : " << c.handle << endl;
|
||||
cout << "Channel ID has changed from " << c.channelRegalia.channelID
|
||||
<< " to " << new_connectionHandlerArgs.chid << " " << endl;
|
||||
cout << "This is a rare occurence and happens when the ca message buffer " << endl;
|
||||
cout << "is flushed ahead of schedule (does that when full) and this callback is " << endl;
|
||||
cout << "consequently activated before channel ID is written to the hash table " << endl;
|
||||
std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl;
|
||||
std::cout << "Internal CAFE WARNING for handle : " << c.handle << std::endl;
|
||||
std::cout << "Channel ID has changed from " << c.channelRegalia.channelID
|
||||
<< " to " << new_connectionHandlerArgs.chid << " " << std::endl;
|
||||
std::cout << "This is a rare occurence and happens when the ca message buffer " << std::endl;
|
||||
std::cout << "is flushed ahead of schedule (does that when full) and this callback is " << std::endl;
|
||||
std::cout << "consequently activated before channel ID is written to the hash table " << std::endl;
|
||||
c.channelRegalia.channelID = new_connectionHandlerArgs.chid;
|
||||
}
|
||||
|
||||
@@ -61,8 +60,8 @@ struct change_connectionHandlerArgs
|
||||
c.channelRegalia.dataType = nativeDataType;
|
||||
|
||||
|
||||
// DATA BUFFER ------------------------------------------------------------------
|
||||
// data buffer CLIENT
|
||||
// DATA BUFFER ------------------------------------------------------------------
|
||||
// data buffer CLIENT
|
||||
// Check if c.channelRegalia.cafeConnectionState == ICAFE_CS_NEVER_CONN or not!
|
||||
|
||||
|
||||
@@ -74,8 +73,7 @@ struct change_connectionHandlerArgs
|
||||
|
||||
//cafeDbrType first filled with CAFENUM:DBR_TIME on initialization
|
||||
//but will be overwritten by whatever the client needs
|
||||
switch (c.channelRequestMetaDataClient.cafeDbrType)
|
||||
{
|
||||
switch (c.channelRequestMetaDataClient.cafeDbrType) {
|
||||
case CAFENUM::DBR_TIME:
|
||||
c.channelRequestMetaDataClient.dbrDataType = dbf_type_to_DBR_TIME(nativeDataType);
|
||||
break;
|
||||
@@ -93,12 +91,12 @@ struct change_connectionHandlerArgs
|
||||
|
||||
//What client is actutally requesting
|
||||
c.channelRequestMetaDataClient.byteSize=dbr_size_n(
|
||||
c.channelRequestMetaDataClient.dbrDataType,
|
||||
//dbf_type_to_DBR_TIME(nativeDataType),
|
||||
c.channelRequestMetaDataClient.nelem);
|
||||
c.channelRequestMetaDataClient.dbrDataType,
|
||||
//dbf_type_to_DBR_TIME(nativeDataType),
|
||||
c.channelRequestMetaDataClient.nelem);
|
||||
}
|
||||
|
||||
//data Buffer requested by Cafe
|
||||
|
||||
//data Buffer requested by Cafe
|
||||
c.channelRequestMetaData.channelID = new_connectionHandlerArgs.chid;
|
||||
c.channelRequestMetaData.nelem = c.channelRegalia.nelem;
|
||||
c.channelRequestMetaData.nelemCache = c.channelRegalia.nelem;
|
||||
@@ -106,8 +104,7 @@ struct change_connectionHandlerArgs
|
||||
|
||||
//cafeDbrType first filled with CAFENUM:DBR_TIME on initialization
|
||||
//cafeDbrType can only be overwritten by an explicit method invocation
|
||||
switch (c.channelRequestMetaData.cafeDbrType)
|
||||
{
|
||||
switch (c.channelRequestMetaData.cafeDbrType) {
|
||||
case CAFENUM::DBR_TIME:
|
||||
c.channelRequestMetaData.dbrDataType = dbf_type_to_DBR_TIME(nativeDataType);
|
||||
break;
|
||||
@@ -126,18 +123,18 @@ struct change_connectionHandlerArgs
|
||||
|
||||
|
||||
// CTRL BUFFER ------------------------------------------------------------------
|
||||
|
||||
|
||||
//No of elements for Ctrl Buffers
|
||||
unsigned int nelem_ctrl_buffer=1;
|
||||
|
||||
if ( c.channelRegalia.nelem > MAX_NELEM_FOR_CTRL_BUFFER) {
|
||||
nelem_ctrl_buffer = DEFAULT_NELEM_FOR_CTRL_BUFFER;
|
||||
}
|
||||
else {
|
||||
nelem_ctrl_buffer = c.channelRegalia.nelem;
|
||||
}
|
||||
|
||||
//ctrl data CLIENT
|
||||
|
||||
if ( c.channelRegalia.nelem > MAX_NELEM_FOR_CTRL_BUFFER) {
|
||||
nelem_ctrl_buffer = DEFAULT_NELEM_FOR_CTRL_BUFFER;
|
||||
}
|
||||
else {
|
||||
nelem_ctrl_buffer = c.channelRegalia.nelem;
|
||||
}
|
||||
|
||||
//ctrl data CLIENT
|
||||
//Ctrl data requested by Client
|
||||
if (c.channelRegalia.cafeConnectionState == ICAFE_CS_NEVER_CONN ) {
|
||||
c.channelRequestMetaCtrlClient.channelID = new_connectionHandlerArgs.chid;
|
||||
@@ -147,8 +144,7 @@ struct change_connectionHandlerArgs
|
||||
|
||||
//cafeDbrType first filled with CAFENUM:DBR_CTRL on initialization
|
||||
//but will be overwritten by whatever the client needs
|
||||
switch (c.channelRequestMetaCtrlClient.cafeDbrType)
|
||||
{
|
||||
switch (c.channelRequestMetaCtrlClient.cafeDbrType) {
|
||||
case CAFENUM::DBR_CTRL:
|
||||
c.channelRequestMetaCtrlClient.dbrDataType = dbf_type_to_DBR_CTRL(nativeDataType);
|
||||
break;
|
||||
@@ -162,7 +158,7 @@ struct change_connectionHandlerArgs
|
||||
}
|
||||
|
||||
c.channelRequestMetaCtrlClient.byteSize=dbr_size_n(
|
||||
c.channelRequestMetaCtrlClient.dbrDataType,c.channelRequestMetaCtrlClient.nelem);
|
||||
c.channelRequestMetaCtrlClient.dbrDataType,c.channelRequestMetaCtrlClient.nelem);
|
||||
}
|
||||
|
||||
//ctrl Data requested by Cafe
|
||||
@@ -172,8 +168,7 @@ struct change_connectionHandlerArgs
|
||||
c.channelRequestMetaCtrl.dataType = nativeDataType;
|
||||
//cafeDbrType first filled with CAFENUM:DBR_CTRL on initialization
|
||||
//cafeDbrType can only be overwritten by an explicit method invocation
|
||||
switch (c.channelRequestMetaCtrl.cafeDbrType)
|
||||
{
|
||||
switch (c.channelRequestMetaCtrl.cafeDbrType) {
|
||||
case CAFENUM::DBR_CTRL:
|
||||
c.channelRequestMetaCtrl.dbrDataType = dbf_type_to_DBR_CTRL(nativeDataType);
|
||||
break;
|
||||
@@ -187,16 +182,16 @@ struct change_connectionHandlerArgs
|
||||
}
|
||||
|
||||
// STSACK BUFFER ------------------------------------------------------------------
|
||||
|
||||
//No of elements for STSACK Buffers
|
||||
|
||||
//No of elements for STSACK Buffers
|
||||
unsigned int nelem_stsack_buffer;
|
||||
|
||||
if ( c.channelRegalia.nelem > MAX_NELEM_FOR_STSACK_BUFFER) {
|
||||
nelem_stsack_buffer = DEFAULT_NELEM_FOR_STSACK_BUFFER;
|
||||
}
|
||||
else {
|
||||
nelem_stsack_buffer = c.channelRegalia.nelem;
|
||||
}
|
||||
|
||||
if ( c.channelRegalia.nelem > MAX_NELEM_FOR_STSACK_BUFFER) {
|
||||
nelem_stsack_buffer = DEFAULT_NELEM_FOR_STSACK_BUFFER;
|
||||
}
|
||||
else {
|
||||
nelem_stsack_buffer = c.channelRegalia.nelem;
|
||||
}
|
||||
|
||||
|
||||
//STSACK Buffer Repository
|
||||
@@ -210,7 +205,7 @@ struct change_connectionHandlerArgs
|
||||
|
||||
//PRIMITIVE Buffer Repository
|
||||
c.channelRequestMetaPrimitive.channelID = new_connectionHandlerArgs.chid;
|
||||
c.channelRequestMetaPrimitive.nelem = c.channelRegalia.nelem;
|
||||
c.channelRequestMetaPrimitive.nelem = c.channelRegalia.nelem;
|
||||
c.channelRequestMetaPrimitive.dataType = nativeDataType;;
|
||||
c.channelRequestMetaPrimitive.dbrDataType= dbf_type_to_DBR(nativeDataType);
|
||||
c.channelRequestMetaPrimitive.cafeDbrType= CAFENUM::DBR_PRIMITIVE;
|
||||
@@ -221,29 +216,29 @@ struct change_connectionHandlerArgs
|
||||
if ( c.channelRegalia.nelem>1) {
|
||||
double tout= ((unsigned int) (c.channelRegalia.nelem*0.000001)); // 1 sec per million
|
||||
c.channelRequestDataTypePolicy.setRequestKind(CAFENUM::LOWEST_DATATYPE);
|
||||
c.channelTimeoutPolicyGet.setTimeout(std::max(DEFAULT_TIMEOUT_PEND_IO_WF , tout));
|
||||
c.channelTimeoutPolicyPut.setTimeout(std::max(DEFAULT_TIMEOUT_PEND_IO_WF , tout));
|
||||
c.channelTimeoutPolicyGet.setDefaultTimeout(DEFAULT_TIMEOUT_PEND_IO_WF);
|
||||
c.channelTimeoutPolicyPut.setDefaultTimeout(DEFAULT_TIMEOUT_PEND_IO_WF);
|
||||
c.channelTimeoutPolicyGet.setTimeout(std::max(DEFAULT_TIMEOUT_PEND_IO_WF, tout));
|
||||
c.channelTimeoutPolicyPut.setTimeout(std::max(DEFAULT_TIMEOUT_PEND_IO_WF, tout));
|
||||
c.channelTimeoutPolicyGet.setDefaultTimeout(DEFAULT_TIMEOUT_PEND_IO_WF);
|
||||
c.channelTimeoutPolicyPut.setDefaultTimeout(DEFAULT_TIMEOUT_PEND_IO_WF);
|
||||
}
|
||||
|
||||
c.channelRegalia.cafeConnectionState = ICAFE_CS_CONN;
|
||||
c.status = ICAFE_CA_OP_CONN_UP;
|
||||
}
|
||||
else {
|
||||
|
||||
|
||||
//nativeType not known on disconnect!!
|
||||
|
||||
//Also callback done
|
||||
c.channelRequestStatusGet.setCallbackKind(false, true); //fake completion
|
||||
c.channelRequestStatusPut.setCallbackKind(false, true); //fake completion
|
||||
c.channelRegalia.cafeConnectionState =ICAFE_CS_DISCONN;
|
||||
c.channelRegalia.connectFlag = false;
|
||||
c.channelRegalia.connectFlag = false;
|
||||
c.status = ICAFE_CA_OP_CONN_DOWN;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -256,12 +251,12 @@ private:
|
||||
* Friend to Conduit/CAFEGroup permitting fast modification to the ctrlBuffer
|
||||
* This is the ctrlBuffer for _CTRL data requested through ca_get
|
||||
*/
|
||||
struct change_dataBufferSize_CTRL
|
||||
{
|
||||
struct change_dataBufferSize_CTRL {
|
||||
#define __METHOD__ "change_dataBufferSize_CTRL"
|
||||
change_dataBufferSize_CTRL (const chtype & new_ctrlTypeBuffer): new_ctrlTypeBuffer(new_ctrlTypeBuffer){}
|
||||
change_dataBufferSize_CTRL (const chtype & new_ctrlTypeBuffer): new_ctrlTypeBuffer(new_ctrlTypeBuffer) {}
|
||||
|
||||
void operator() (Conduit& c) {
|
||||
void operator() (Conduit& c)
|
||||
{
|
||||
|
||||
// Free buffer on re-connection
|
||||
// Check Byte size first!!!
|
||||
@@ -273,27 +268,27 @@ struct change_dataBufferSize_CTRL
|
||||
}
|
||||
|
||||
else if ( dbr_size_n(new_ctrlTypeBuffer,c.channelRequestMetaCtrl.getNelem()) > c.channelRequestMetaCtrl.getByteSize() ) {
|
||||
cout << "ctrlBuffer already exists= " << c.ctrlBuffer << " for channel " << c.pv
|
||||
<< " with handle " << c.handle << endl;
|
||||
cout << "Freeing and reallocating ctrlBuffer" << endl;
|
||||
std::cout << "ctrlBuffer already exists= " << c.ctrlBuffer << " for channel " << c.pv
|
||||
<< " with handle " << c.handle << std::endl;
|
||||
std::cout << "Freeing and reallocating ctrlBuffer" << std::endl;
|
||||
free(c.ctrlBuffer);
|
||||
allocateMemory=true;
|
||||
}
|
||||
|
||||
if (allocateMemory) {
|
||||
//cout << "sizeof c.ctrlBuffer " << dbr_size_n(new_ctrlTypeBuffer,c.channelRequestMetaCtrl.getNelem()) << endl;
|
||||
//std::cout << "sizeof c.ctrlBuffer " << dbr_size_n(new_ctrlTypeBuffer,c.channelRequestMetaCtrl.getNelem()) << std::endl;
|
||||
c.ctrlBuffer = (db_access_val *) malloc ( dbr_size_n(new_ctrlTypeBuffer,c.channelRequestMetaCtrl.getNelem()) );
|
||||
c.channelRequestMetaCtrl.byteSize=dbr_size_n(new_ctrlTypeBuffer,c.channelRequestMetaCtrl.getNelem());
|
||||
c.channelRequestMetaCtrl.byteSize=dbr_size_n(new_ctrlTypeBuffer,c.channelRequestMetaCtrl.getNelem());
|
||||
}
|
||||
|
||||
|
||||
if (c.ctrlBuffer==0){
|
||||
cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__ << endl;
|
||||
printf ("Virtual memory exhausted for channel %s ", ca_name(c.channelID));
|
||||
printf ("Exiting CAFE");
|
||||
}
|
||||
if (c.ctrlBuffer==0) {
|
||||
std::cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__ << std::endl;
|
||||
printf ("Virtual memory exhausted for channel %s ", ca_name(c.channelID));
|
||||
printf ("Exiting CAFE");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
chtype new_ctrlTypeBuffer;
|
||||
@@ -305,12 +300,12 @@ private:
|
||||
* Friend to CAFEConduit/CAFEGroup permitting fast modification to the dataBuffer of type DBR (putBuffer)
|
||||
* This is used in ca_put methods when input data that is not already in native data type is thus converted
|
||||
*/
|
||||
struct change_dataBufferSize_PRIMITIVE
|
||||
{
|
||||
struct change_dataBufferSize_PRIMITIVE {
|
||||
#define __METHOD__ "change_dataBufferSize_PRIMITIVE"
|
||||
change_dataBufferSize_PRIMITIVE (const chtype & new_dataTypeBufferNative): new_dataTypeBufferNative(new_dataTypeBufferNative){}
|
||||
change_dataBufferSize_PRIMITIVE (const chtype & new_dataTypeBufferNative): new_dataTypeBufferNative(new_dataTypeBufferNative) {}
|
||||
|
||||
void operator() (Conduit& c) {
|
||||
void operator() (Conduit& c)
|
||||
{
|
||||
|
||||
bool allocateMemory=false ;
|
||||
|
||||
@@ -319,27 +314,27 @@ struct change_dataBufferSize_PRIMITIVE
|
||||
}
|
||||
else if ( dbr_size_n(c.channelRequestMetaPrimitive.getDbrDataType(),
|
||||
c.channelRequestMetaPrimitive.getNelem())
|
||||
> c.channelRequestMetaPrimitive.getByteSize() ) {
|
||||
cout << "putBuffer already exists= " << c.putBuffer << " for channel " << c.pv
|
||||
<< " with handle " << c.handle << endl;
|
||||
cout << "Freeing and reallocating putBuffer" << endl;
|
||||
> c.channelRequestMetaPrimitive.getByteSize() ) {
|
||||
std::cout << "putBuffer already exists= " << c.putBuffer << " for channel " << c.pv
|
||||
<< " with handle " << c.handle << std::endl;
|
||||
std::cout << "Freeing and reallocating putBuffer" << std::endl;
|
||||
free(c.putBuffer);
|
||||
allocateMemory=true;
|
||||
}
|
||||
|
||||
if (allocateMemory) {
|
||||
//cout << "sizeof c.putBuffer " << dbr_size_n(c.channelRequestMetaPrimitive.getDbrDataType(),
|
||||
// c.channelRequestMetaPrimitive.getNelem()) << endl;
|
||||
//std::cout << "sizeof c.putBuffer " << dbr_size_n(c.channelRequestMetaPrimitive.getDbrDataType(),
|
||||
// c.channelRequestMetaPrimitive.getNelem()) << std::endl;
|
||||
c.putBuffer = (db_access_val *) malloc (dbr_size_n(c.channelRequestMetaPrimitive.getDbrDataType(),
|
||||
c.channelRequestMetaPrimitive.getNelem()));
|
||||
c.channelRequestMetaPrimitive.getNelem()));
|
||||
|
||||
c.channelRequestMetaPrimitive.byteSize
|
||||
=dbr_size_n(c.channelRequestMetaPrimitive.getDbrDataType(),
|
||||
c.channelRequestMetaPrimitive.getNelem());
|
||||
=dbr_size_n(c.channelRequestMetaPrimitive.getDbrDataType(),
|
||||
c.channelRequestMetaPrimitive.getNelem());
|
||||
}
|
||||
|
||||
if (c.putBuffer==0){
|
||||
cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__ << endl;
|
||||
if (c.putBuffer==0) {
|
||||
std::cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__ << std::endl;
|
||||
printf ("Virtual memory exhausted for channel %s ", ca_name(c.channelID));
|
||||
printf ("Exiting CAFE");
|
||||
exit(0);
|
||||
@@ -358,42 +353,42 @@ private:
|
||||
* Friend to CAFEConduit/CAFEGroup permitting fast modification to the ctrlBuffer
|
||||
* This is the ctrlBuffer for _CTRL data requested through ca_get
|
||||
*/
|
||||
struct change_dataBufferSize_STSACK
|
||||
{
|
||||
struct change_dataBufferSize_STSACK {
|
||||
#define __METHOD__ "change_dataBufferSize_STSACK"
|
||||
change_dataBufferSize_STSACK (){}
|
||||
change_dataBufferSize_STSACK () {}
|
||||
|
||||
void operator() (Conduit& c) {
|
||||
void operator() (Conduit& c)
|
||||
{
|
||||
|
||||
bool allocateMemory=false ;
|
||||
|
||||
if(c.stsackBuffer==NULL) {
|
||||
|
||||
allocateMemory=true;
|
||||
allocateMemory=true;
|
||||
}
|
||||
|
||||
else if ( dbr_size_n(c.channelRequestMetaSTSACK.getDbrDataType(),
|
||||
c.channelRequestMetaSTSACK.getNelem())
|
||||
> c.channelRequestMetaSTSACK.getByteSize() ) {
|
||||
cout << "stsackBuffer already exists= " << c.stsackBuffer << " for channel " << c.pv
|
||||
<< " with handle " << c.handle << endl;
|
||||
cout << "Freeing and reallocating putBuffer" << endl;
|
||||
> c.channelRequestMetaSTSACK.getByteSize() ) {
|
||||
std::cout << "stsackBuffer already exists= " << c.stsackBuffer << " for channel " << c.pv
|
||||
<< " with handle " << c.handle << std::endl;
|
||||
std::cout << "Freeing and reallocating putBuffer" << std::endl;
|
||||
free(c.stsackBuffer);
|
||||
allocateMemory=true;
|
||||
}
|
||||
|
||||
if (allocateMemory) {
|
||||
//cout << "sizeof c.stsackBuffer " << dbr_size_n(c.channelRequestMetaSTSACK.getDbrDataType(),
|
||||
// c.channelRequestMetaSTSACK.getNelem()) << endl;
|
||||
//std::cout << "sizeof c.stsackBuffer " << dbr_size_n(c.channelRequestMetaSTSACK.getDbrDataType(),
|
||||
// c.channelRequestMetaSTSACK.getNelem()) << std::endl;
|
||||
c.stsackBuffer = (db_access_val *) malloc (dbr_size_n(c.channelRequestMetaSTSACK.getDbrDataType(),
|
||||
c.channelRequestMetaSTSACK.getNelem()));
|
||||
c.channelRequestMetaSTSACK.getNelem()));
|
||||
|
||||
c.channelRequestMetaSTSACK.byteSize
|
||||
=dbr_size_n(c.channelRequestMetaSTSACK.getDbrDataType(),
|
||||
c.channelRequestMetaSTSACK.getNelem());
|
||||
=dbr_size_n(c.channelRequestMetaSTSACK.getDbrDataType(),
|
||||
c.channelRequestMetaSTSACK.getNelem());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#undef __METHOD__
|
||||
};
|
||||
|
||||
@@ -402,46 +397,46 @@ struct change_dataBufferSize_STSACK
|
||||
* Friend to CAFEConduit/CAFEGroup permitting fast modification to the dataBuffer of type DBR_TIME (dataBuffer)
|
||||
* This is the main dataBuffer for data requested through ca_get
|
||||
*/
|
||||
struct change_dataBufferSize_TIME
|
||||
{
|
||||
struct change_dataBufferSize_TIME {
|
||||
#define __METHOD__ "change_dataBufferSize_PRIMITIVE"
|
||||
|
||||
change_dataBufferSize_TIME (const chtype & new_dataTypeBuffer): new_dataTypeBuffer(new_dataTypeBuffer){}
|
||||
change_dataBufferSize_TIME (const chtype & new_dataTypeBuffer): new_dataTypeBuffer(new_dataTypeBuffer) {}
|
||||
|
||||
void operator() (Conduit& c) {
|
||||
void operator() (Conduit& c)
|
||||
{
|
||||
|
||||
// Free buffer on re-connection
|
||||
// Check Byte size first!!!
|
||||
|
||||
bool allocateMemory=false ;
|
||||
// Check Byte size first!!!
|
||||
|
||||
bool allocateMemory=false ;
|
||||
|
||||
|
||||
if(c.dataBuffer==NULL) {
|
||||
|
||||
allocateMemory=true;
|
||||
}
|
||||
|
||||
|
||||
if(c.dataBuffer==NULL) {
|
||||
|
||||
allocateMemory=true;
|
||||
}
|
||||
|
||||
else if ( dbr_size_n(new_dataTypeBuffer,c.channelRegalia.getNelem()) > c.channelRequestMetaData.getByteSize() ) {
|
||||
cout << "dataBuffer already exists= " << c.dataBuffer << " for channel " << c.pv
|
||||
<< " with handle " << c.handle << endl;
|
||||
cout << "Freeing and reallocating dataBuffer" << endl;
|
||||
std::cout << "dataBuffer already exists= " << c.dataBuffer << " for channel " << c.pv
|
||||
<< " with handle " << c.handle << std::endl;
|
||||
std::cout << "Freeing and reallocating dataBuffer" << std::endl;
|
||||
|
||||
cout << dbr_size_n(new_dataTypeBuffer,c.channelRegalia.getNelem()) << " VERSUS "
|
||||
<< c.channelRequestMetaData.getByteSize() << endl;
|
||||
std::cout << dbr_size_n(new_dataTypeBuffer,c.channelRegalia.getNelem()) << " VERSUS "
|
||||
<< c.channelRequestMetaData.getByteSize() << std::endl;
|
||||
free(c.dataBuffer);
|
||||
allocateMemory=true;
|
||||
|
||||
}
|
||||
|
||||
if (allocateMemory) {
|
||||
//cout << "sizeof c.dataBuffer " << dbr_size_n(new_dataTypeBuffer,c.channelRegalia.getNelem()) << endl;
|
||||
c.dataBuffer = (db_access_val *) malloc ( dbr_size_n(new_dataTypeBuffer,c.channelRegalia.getNelem()) );
|
||||
}
|
||||
|
||||
if (allocateMemory) {
|
||||
//std::cout << "sizeof c.dataBuffer " << dbr_size_n(new_dataTypeBuffer,c.channelRegalia.getNelem()) << std::endl;
|
||||
c.dataBuffer = (db_access_val *) malloc ( dbr_size_n(new_dataTypeBuffer,c.channelRegalia.getNelem()) );
|
||||
c.channelRequestMetaData.byteSize=dbr_size_n(new_dataTypeBuffer,c.channelRequestMetaData.getNelem());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (c.dataBuffer==NULL){
|
||||
cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__ << endl;
|
||||
if (c.dataBuffer==NULL) {
|
||||
std::cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__ << std::endl;
|
||||
printf ("Virtual memory exhausted for channel %s ", ca_name(c.channelID));
|
||||
printf ("Exiting CAFE");
|
||||
|
||||
@@ -458,27 +453,27 @@ private:
|
||||
/**
|
||||
* Friend to CAFEConduit/CAFEGroup - releases resources
|
||||
*/
|
||||
struct free_dataBuffers
|
||||
{
|
||||
free_dataBuffers (){}
|
||||
struct free_dataBuffers {
|
||||
free_dataBuffers () {}
|
||||
|
||||
void operator() (Conduit& c) {
|
||||
void operator() (Conduit& c)
|
||||
{
|
||||
|
||||
//cout << "c.handle=" << c.handle << " " << c.pv << endl;
|
||||
//std::cout << "c.handle=" << c.handle << " " << c.pv << std::endl;
|
||||
|
||||
if(c.dataBuffer) {
|
||||
free(c.dataBuffer); // _TIME data buffer for ca_get
|
||||
if(c.dataBuffer) {
|
||||
free(c.dataBuffer); // _TIME data buffer for ca_get
|
||||
}
|
||||
|
||||
if(c.ctrlBuffer) {
|
||||
free(c.ctrlBuffer); // _CTRL data buffer for ca_get
|
||||
if(c.ctrlBuffer) {
|
||||
free(c.ctrlBuffer); // _CTRL data buffer for ca_get
|
||||
}
|
||||
|
||||
if(c.stsackBuffer) {
|
||||
free(c.stsackBuffer); // _STSACK_STRING data buffer for ca_get
|
||||
if(c.stsackBuffer) {
|
||||
free(c.stsackBuffer); // _STSACK_STRING data buffer for ca_get
|
||||
}
|
||||
|
||||
if(c.putBuffer) {
|
||||
if(c.putBuffer) {
|
||||
free(c.putBuffer); // data buffer for ca_put
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -21,22 +21,21 @@
|
||||
* \param _ccc ca_client_context
|
||||
* \param _groupID unique group identifier (CA_SYNC_GID)
|
||||
* \param _nMember number of members in group
|
||||
* \param _memberCC CAFEConduit object representing each group member
|
||||
* \param _memberCC CAFEConduit object representing each group member
|
||||
* \param _groupStatus groupStatus: error indicates >0 members have an error
|
||||
*/
|
||||
class ConduitGroup
|
||||
{
|
||||
class ConduitGroup {
|
||||
friend struct change_channelTimeoutPolicySGPut;
|
||||
friend struct change_channelTimeoutPolicySGGet;
|
||||
friend struct change_timeout_sg_pend_io;
|
||||
friend struct change_sg_rule;
|
||||
friend class Connect;
|
||||
|
||||
private:
|
||||
|
||||
private:
|
||||
static unsigned int groupHandleNext;
|
||||
unsigned int nMember;
|
||||
ca_client_context * ccc;
|
||||
|
||||
|
||||
double timeout_sg_pend_io;
|
||||
|
||||
ChannelTimeoutPolicy channelTimeoutPolicySGGet;
|
||||
@@ -49,7 +48,7 @@ private:
|
||||
os<< "handle=" << e.groupHandle<<" name=" << e.groupName<< " nMember=" << e.nMember << std::endl;
|
||||
return os;
|
||||
};
|
||||
|
||||
|
||||
public:
|
||||
std::string groupName;
|
||||
unsigned int groupHandle;
|
||||
@@ -59,30 +58,63 @@ public:
|
||||
bool * mRule;
|
||||
|
||||
unsigned int * mHandle;
|
||||
|
||||
|
||||
|
||||
virtual ~ConduitGroup();
|
||||
|
||||
|
||||
ConduitGroup();
|
||||
ConduitGroup(const char * _groupName, ca_client_context * _ccc, CA_SYNC_GID _groupID,
|
||||
unsigned int _nMember, unsigned int * _handle);
|
||||
unsigned int _nMember, unsigned int * _handle);
|
||||
|
||||
int get(void) const;
|
||||
int put(void) const;
|
||||
|
||||
ca_client_context * getClientContext(void) const {return ccc;};
|
||||
const char * getGroupName(void) const {return groupName.c_str();};
|
||||
string getGroupNameAsString(void) const {return groupName;};
|
||||
CA_SYNC_GID getGroupID(void) const {return groupID;};
|
||||
unsigned int getNMember(void) const {return nMember;};
|
||||
int * getStatus(void) const {return mStatus;};
|
||||
bool * getRule(void) const {return mRule;};
|
||||
bool getRule(unsigned int i) const {return mRule[i];};
|
||||
unsigned int getGroupHandle(void) const {return groupHandle;};
|
||||
ChannelTimeoutPolicy getChannelTimeoutPolicySGPut(void) const {return channelTimeoutPolicySGPut;};
|
||||
ChannelTimeoutPolicy getChannelTimeoutPolicySGGet(void) const {return channelTimeoutPolicySGGet;};
|
||||
|
||||
};
|
||||
|
||||
ca_client_context * getClientContext(void) const
|
||||
{
|
||||
return ccc;
|
||||
};
|
||||
const char * getGroupName(void) const
|
||||
{
|
||||
return groupName.c_str();
|
||||
};
|
||||
std::string getGroupNameAsString(void) const
|
||||
{
|
||||
return groupName;
|
||||
};
|
||||
CA_SYNC_GID getGroupID(void) const
|
||||
{
|
||||
return groupID;
|
||||
};
|
||||
unsigned int getNMember(void) const
|
||||
{
|
||||
return nMember;
|
||||
};
|
||||
int * getStatus(void) const
|
||||
{
|
||||
return mStatus;
|
||||
};
|
||||
bool * getRule(void) const
|
||||
{
|
||||
return mRule;
|
||||
};
|
||||
bool getRule(unsigned int i) const
|
||||
{
|
||||
return mRule[i];
|
||||
};
|
||||
unsigned int getGroupHandle(void) const
|
||||
{
|
||||
return groupHandle;
|
||||
};
|
||||
ChannelTimeoutPolicy getChannelTimeoutPolicySGPut(void) const
|
||||
{
|
||||
return channelTimeoutPolicySGPut;
|
||||
};
|
||||
ChannelTimeoutPolicy getChannelTimeoutPolicySGGet(void) const
|
||||
{
|
||||
return channelTimeoutPolicySGGet;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -90,46 +122,50 @@ public:
|
||||
* Friend to ConduitGroup permitting fast modification of the rule in group hash table;
|
||||
* the rule flag only functions within a PVGroup
|
||||
*/
|
||||
struct change_sg_rule
|
||||
{
|
||||
change_sg_rule (const bool & new_rule, const unsigned int & iMember):
|
||||
new_rule(new_rule),iMember(iMember){}
|
||||
struct change_sg_rule {
|
||||
change_sg_rule (const bool & new_rule, const unsigned int & iMember):
|
||||
new_rule(new_rule),iMember(iMember) {}
|
||||
|
||||
void operator() (ConduitGroup& g) {g.mRule[iMember] = new_rule;}
|
||||
void operator() (ConduitGroup& g)
|
||||
{
|
||||
g.mRule[iMember] = new_rule;
|
||||
}
|
||||
|
||||
private:
|
||||
bool new_rule;
|
||||
unsigned int iMember;
|
||||
bool new_rule;
|
||||
unsigned int iMember;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Friend to ConduitGroup permitting fast modification of status in group hash table;
|
||||
*/
|
||||
struct change_sg_status
|
||||
{
|
||||
change_sg_status (const int & new_status, const unsigned int & iMember):
|
||||
new_status(new_status),iMember(iMember){}
|
||||
struct change_sg_status {
|
||||
change_sg_status (const int & new_status, const unsigned int & iMember):
|
||||
new_status(new_status),iMember(iMember) {}
|
||||
|
||||
void operator() (ConduitGroup& g) {
|
||||
g.mStatus[iMember] = new_status;
|
||||
}
|
||||
void operator() (ConduitGroup& g)
|
||||
{
|
||||
g.mStatus[iMember] = new_status;
|
||||
}
|
||||
|
||||
private:
|
||||
int new_status;
|
||||
unsigned int iMember;
|
||||
int new_status;
|
||||
unsigned int iMember;
|
||||
};
|
||||
|
||||
/**
|
||||
* friend to ConduitGroup permitting fast modification to \n
|
||||
* the timeout_sg_pend_event period recorded in ConduitGroup hash table
|
||||
*/
|
||||
struct change_timeout_sg_pend_io
|
||||
{
|
||||
struct change_timeout_sg_pend_io {
|
||||
change_timeout_sg_pend_io (const double & new_timeout_sg_pend_io):
|
||||
new_timeout_sg_pend_io(new_timeout_sg_pend_io){}
|
||||
void operator() (ConduitGroup& g) {g.timeout_sg_pend_io = new_timeout_sg_pend_io;}
|
||||
|
||||
new_timeout_sg_pend_io(new_timeout_sg_pend_io) {}
|
||||
void operator() (ConduitGroup& g)
|
||||
{
|
||||
g.timeout_sg_pend_io = new_timeout_sg_pend_io;
|
||||
}
|
||||
|
||||
private:
|
||||
double new_timeout_sg_pend_io;
|
||||
};
|
||||
@@ -138,12 +174,12 @@ private:
|
||||
/**
|
||||
* Friend to ConduitGroup records the channelTimeoutPolicySGGet in hash table
|
||||
*/
|
||||
struct change_channelTimeoutPolicySGGet
|
||||
{
|
||||
struct change_channelTimeoutPolicySGGet {
|
||||
change_channelTimeoutPolicySGGet (const ChannelTimeoutPolicy & new_channelTimeoutPolicy):
|
||||
new_channelTimeoutPolicy(new_channelTimeoutPolicy){}
|
||||
new_channelTimeoutPolicy(new_channelTimeoutPolicy) {}
|
||||
|
||||
void operator() (ConduitGroup & g) {
|
||||
void operator() (ConduitGroup & g)
|
||||
{
|
||||
//This does a deep copy!
|
||||
g.channelTimeoutPolicySGGet = new_channelTimeoutPolicy;
|
||||
}
|
||||
@@ -155,12 +191,12 @@ private:
|
||||
/**
|
||||
* Friend to ConduitGroup records the channelTimeoutPolicySGPut in hash table
|
||||
*/
|
||||
struct change_channelTimeoutPolicySGPut
|
||||
{
|
||||
struct change_channelTimeoutPolicySGPut {
|
||||
change_channelTimeoutPolicySGPut (const ChannelTimeoutPolicy & new_channelTimeoutPolicy):
|
||||
new_channelTimeoutPolicy(new_channelTimeoutPolicy){}
|
||||
new_channelTimeoutPolicy(new_channelTimeoutPolicy) {}
|
||||
|
||||
void operator() (ConduitGroup & g) {
|
||||
void operator() (ConduitGroup & g)
|
||||
{
|
||||
//This does a deep copy!
|
||||
g.channelTimeoutPolicySGPut = new_channelTimeoutPolicy;
|
||||
}
|
||||
|
||||
1344
include/connect.h
1344
include/connect.h
File diff suppressed because it is too large
Load Diff
@@ -15,7 +15,7 @@
|
||||
|
||||
#if (EPICS_MAJOR==3) && (EPICS_MINOR==14) && (EPICS_PATCH>=11)
|
||||
#define MASK_CTRL DBE_VALUE | DBE_LOG | DBE_ALARM | DBE_PROPERTY
|
||||
#elif (EPICS_MAJOR==3) && (EPICS_MINOR>14)
|
||||
#elif (EPICS_MAJOR==3) && (EPICS_MINOR>14)
|
||||
#define MASK_CTRL DBE_VALUE | DBE_LOG | DBE_ALARM | DBE_PROPERTY
|
||||
#else
|
||||
#define MASK_CTRL DBE_VALUE | DBE_LOG | DBE_ALARM
|
||||
@@ -27,7 +27,40 @@ const unsigned short ALARM_STATUS_STRING_LENGTH = 22; // "NO_ALARM","READ","WR
|
||||
//"HIHI","HIGH","LOLO","LOW","STATE","COS","COMM","TIMEOUT","HWLIMIT","CALC","SCAN","LINK",
|
||||
//"SOFT","BAD_SUB","UDF","DISABLE","SIMM","READ_ACCESS","WRITE_ACCESS"
|
||||
|
||||
struct alarmSeverityStruct {
|
||||
short llsv;
|
||||
short lsv;
|
||||
short hsv;
|
||||
short hhsv;
|
||||
};
|
||||
|
||||
struct etsDatePrevious {
|
||||
int year;
|
||||
int mon;
|
||||
int day;
|
||||
int hour;
|
||||
int min;
|
||||
int sec;
|
||||
unsigned long nsec;
|
||||
};
|
||||
|
||||
struct etsDate {
|
||||
int year;
|
||||
int mon;
|
||||
int day;
|
||||
int hour;
|
||||
int min;
|
||||
int sec;
|
||||
unsigned long nsec;
|
||||
int wday;
|
||||
int yday;
|
||||
int isdst;
|
||||
};
|
||||
|
||||
struct etsNorm {
|
||||
unsigned int secPastEpoch;
|
||||
unsigned int nsec;
|
||||
};
|
||||
/**
|
||||
* Define pCallback \n
|
||||
*/
|
||||
@@ -46,7 +79,7 @@ const short PVGROUP_PSEUDO_SIZE=1024; //determines max size of groupNameEntry fo
|
||||
//List all possible deliminators; code will separate dev/attriby when first of this list is found;
|
||||
const std::string DEFAULT_DEVICE_ATTRIBUTE_DELIMINATOR=":"; //Only one deliminator
|
||||
|
||||
typedef char pv_string_t[PVNAME_SIZE];
|
||||
typedef char pv_string_t[PVNAME_SIZE];
|
||||
|
||||
/**
|
||||
* Default configuration parameters. Recall that if pend_event is too short \n
|
||||
@@ -54,6 +87,7 @@ typedef char pv_string_t[PVNAME_SIZE];
|
||||
*/
|
||||
const bool DEFAULT_SELF_GOVERNING_TIMEOUT = true;
|
||||
|
||||
|
||||
const double DEFAULT_TIMEOUT_PEND_IO_WF = 5.0;
|
||||
const double TIMEOUT_PEND_IO_MIN = 0.0001;
|
||||
const double TIMEOUT_PEND_IO_MAX = 20.0; // max timeout for first attempt (ntries=1)
|
||||
@@ -65,16 +99,28 @@ const double PEND_IO_INCREMENT_TIME_MAX= 10.0;
|
||||
const double DEFAULT_TIMEOUT_PEND_EVENT = 0.4;
|
||||
const double DEFAULT_TIMEOUT_PEND_IO = 0.4; // previously 3.0
|
||||
const double DEFAULT_TIMEOUT_SG_PEND_EVENT = 0.5; // plus nMember/NMEMBER_PER_SEC_SG_PEND_EVENT
|
||||
const double NMEMBER_PER_SEC_SG_PEND_EVENT = 400; //
|
||||
const double NMEMBER_PER_SEC_SG_PEND_EVENT = 400; //
|
||||
const double DEFAULT_TIMEOUT_SG_PEND_IO = 5.0;
|
||||
|
||||
// Otherwise too many large databuffers are created
|
||||
const unsigned int MAX_NELEM_FOR_CTRL_BUFFER = 8192;
|
||||
// Keep at 1, else becomes problematic when wf is made a syn. group member (ch disconnect occurs for STSACK cb)
|
||||
const unsigned int MAX_NELEM_FOR_STSACK_BUFFER = 1;
|
||||
const unsigned int MAX_NELEM_FOR_STSACK_BUFFER = 1;
|
||||
const unsigned int DEFAULT_NELEM_FOR_CTRL_BUFFER = 256; // if nelem exceeds above
|
||||
const unsigned int DEFAULT_NELEM_FOR_STSACK_BUFFER = 1; // if nelem exceeds above
|
||||
|
||||
const unsigned short MAX_NO_MONITORS_PER_CHANNEL = 4; // Can't start more than 4; 1 is more usual.
|
||||
|
||||
|
||||
//For BSREAD
|
||||
const double BSREAD_MAX_CONNECT_TIME = 20; //20 seconds; typically 10 seconds is required
|
||||
const unsigned short BSREAD_ZEROMQ_HIGH_WATER_MARK = 1;
|
||||
const short BSREAD_ZEROMQ_TIMEOUT_MS = 2000; //Can handle 10 Hz // -1 wait for ever
|
||||
|
||||
const unsigned short BSREAD_PREBLOB_BYTES = 12; //No of bytes pre-pending the binary blob with metadata
|
||||
|
||||
const std::string SF_PULSE_ID_PV = "SIN-TIMAST-EVG0:TX-PULSEID";
|
||||
const unsigned short SF_PULSE_ID_BUFFER_SIZE = 10; //Size of map to store history of pulseIDs;
|
||||
|
||||
|
||||
#endif // DEFINES_H
|
||||
|
||||
@@ -16,18 +16,18 @@
|
||||
|
||||
class collectionMember {
|
||||
public:
|
||||
collectionMember():deviceName(""),devicePosition(0){};
|
||||
virtual ~collectionMember(){};
|
||||
std::string deviceName;
|
||||
float devicePosition;
|
||||
collectionMember():deviceName(""),devicePosition(0) {};
|
||||
virtual ~collectionMember() {};
|
||||
std::string deviceName;
|
||||
float devicePosition;
|
||||
};
|
||||
|
||||
class deviceCollection {
|
||||
friend class Connect;
|
||||
friend class CAFE;
|
||||
//if HAVE_LIBQTXML
|
||||
//if HAVE_LIBQTXML
|
||||
friend class loadCollectionXMLParser;
|
||||
//endif
|
||||
//endif
|
||||
private:
|
||||
std::string name;
|
||||
std::string description;
|
||||
@@ -36,22 +36,38 @@ private:
|
||||
|
||||
Helper helper;
|
||||
public:
|
||||
deviceCollection():description("collection of devices"){};
|
||||
virtual ~deviceCollection(){};
|
||||
deviceCollection():description("collection of devices") {};
|
||||
virtual ~deviceCollection() {};
|
||||
|
||||
std::string getName() const {return name;};
|
||||
std::string getDescription() const {return description;};
|
||||
std::vector<collectionMember> getCMembers() const {return cMembers;};
|
||||
|
||||
std::vector<std::string> getAttributes() const {return attributes;};
|
||||
std::vector<float> getPositions() {
|
||||
std::vector<float> posV; posV.clear(); posV.reserve(cMembers.size());
|
||||
for (size_t i=0; i<cMembers.size(); ++i) {
|
||||
posV.push_back(cMembers[i].devicePosition);
|
||||
};
|
||||
return posV;
|
||||
std::string getName() const
|
||||
{
|
||||
return name;
|
||||
};
|
||||
float getPosition(const char * c) {
|
||||
std::string getDescription() const
|
||||
{
|
||||
return description;
|
||||
};
|
||||
std::vector<collectionMember> getCMembers() const
|
||||
{
|
||||
return cMembers;
|
||||
};
|
||||
|
||||
std::vector<std::string> getAttributes() const
|
||||
{
|
||||
return attributes;
|
||||
};
|
||||
std::vector<float> getPositions()
|
||||
{
|
||||
std::vector<float> posV;
|
||||
posV.clear();
|
||||
posV.reserve(cMembers.size());
|
||||
for (size_t i=0; i<cMembers.size(); ++i) {
|
||||
posV.push_back(cMembers[i].devicePosition);
|
||||
};
|
||||
return posV;
|
||||
};
|
||||
float getPosition(const char * c)
|
||||
{
|
||||
char _c[PVNAME_SIZE];
|
||||
helper.removeLeadingAndTrailingSpaces(c, _c);
|
||||
for (size_t i=0; i<cMembers.size(); ++i) {
|
||||
@@ -64,32 +80,41 @@ public:
|
||||
return -1;
|
||||
}
|
||||
|
||||
std::vector<std::string> getMembers() {
|
||||
std::vector<std::string> memberV; memberV.clear(); memberV.reserve(cMembers.size());
|
||||
for (size_t i=0; i<cMembers.size(); ++i) {
|
||||
memberV.push_back(cMembers[i].deviceName);
|
||||
};
|
||||
return memberV;
|
||||
std::vector<std::string> getMembers()
|
||||
{
|
||||
std::vector<std::string> memberV;
|
||||
memberV.clear();
|
||||
memberV.reserve(cMembers.size());
|
||||
for (size_t i=0; i<cMembers.size(); ++i) {
|
||||
memberV.push_back(cMembers[i].deviceName);
|
||||
};
|
||||
return memberV;
|
||||
};
|
||||
|
||||
unsigned int getNCollectionMembers() const {return cMembers.size();};
|
||||
unsigned int getNAttribuites() const {return attributes.size();};
|
||||
unsigned int getNCollectionMembers() const
|
||||
{
|
||||
return cMembers.size();
|
||||
};
|
||||
unsigned int getNAttribuites() const
|
||||
{
|
||||
return attributes.size();
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
class collectionInGroup {
|
||||
//friend class loadGroupXMLParser;
|
||||
//friend class loadGroupXMLParser;
|
||||
public:
|
||||
collectionInGroup(){};
|
||||
virtual ~collectionInGroup(){};
|
||||
std::string id;
|
||||
std::string attrib;
|
||||
collectionInGroup() {};
|
||||
virtual ~collectionInGroup() {};
|
||||
std::string id;
|
||||
std::string attrib;
|
||||
};
|
||||
|
||||
class deviceGroup {
|
||||
//if HAVE_LIBQTXML
|
||||
//if HAVE_LIBQTXML
|
||||
friend class loadGroupXMLParser;
|
||||
//endif
|
||||
//endif
|
||||
private:
|
||||
std::string id;
|
||||
std::string description;
|
||||
@@ -98,16 +123,34 @@ private:
|
||||
std::vector<std::string> xmlMembers;
|
||||
std::vector<collectionInGroup> collections;
|
||||
public:
|
||||
deviceGroup(){};
|
||||
virtual ~deviceGroup(){};
|
||||
deviceGroup() {};
|
||||
virtual ~deviceGroup() {};
|
||||
|
||||
std::string getName() const {return id;};
|
||||
std::string getID() const {return id;};
|
||||
std::string getName() const
|
||||
{
|
||||
return id;
|
||||
};
|
||||
std::string getID() const
|
||||
{
|
||||
return id;
|
||||
};
|
||||
|
||||
std::string getDescription() const {return description;};
|
||||
std::vector<collectionMember> getCMembers() const {return members;};
|
||||
std::vector<collectionInGroup> getCollections() const {return collections;};
|
||||
std::vector<std::string>getXMLMembers() const {return xmlMembers;};
|
||||
std::string getDescription() const
|
||||
{
|
||||
return description;
|
||||
};
|
||||
std::vector<collectionMember> getCMembers() const
|
||||
{
|
||||
return members;
|
||||
};
|
||||
std::vector<collectionInGroup> getCollections() const
|
||||
{
|
||||
return collections;
|
||||
};
|
||||
std::vector<std::string>getXMLMembers() const
|
||||
{
|
||||
return xmlMembers;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -19,21 +19,18 @@
|
||||
|
||||
|
||||
template<typename T>
|
||||
struct enumStrings
|
||||
{
|
||||
struct enumStrings {
|
||||
static char const* data[];
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct enumRefHolder
|
||||
{
|
||||
struct enumRefHolder {
|
||||
T& enumVal;
|
||||
enumRefHolder(T& enumVal): enumVal(enumVal) {}
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
struct enumConstRefHolder
|
||||
{
|
||||
struct enumConstRefHolder {
|
||||
T const& enumVal;
|
||||
enumConstRefHolder(T const& enumVal): enumVal(enumVal) {}
|
||||
};
|
||||
@@ -48,7 +45,7 @@ inline std::ostream& operator<<(std::ostream& str, enumConstRefHolder<T> const&
|
||||
}
|
||||
else {
|
||||
return str << "ERROR: enumStrings.h reports data.enumVal= " << data.enumVal
|
||||
<< " DOES NOT HAVE A STRING EQUIVALENT!";
|
||||
<< " DOES NOT HAVE A STRING EQUIVALENT!";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,18 +65,17 @@ inline std::istream& operator>>(std::istream& str, enumRefHolder<T> const& data)
|
||||
//if (find != end)
|
||||
|
||||
if ( std::find( boost::begin(enumStrings<T>::data), boost::end( enumStrings<T>::data), value) !=
|
||||
boost::end( enumStrings<T>::data))
|
||||
{
|
||||
boost::end( enumStrings<T>::data)) {
|
||||
//data.enumVal = static_cast<T>(std::distance(begin, find));
|
||||
data.enumVal = static_cast<T>(std::distance(boost::begin(enumStrings<T>::data),
|
||||
std::find (boost::begin(enumStrings<T>::data), boost::end(enumStrings<T>::data), value ) ));
|
||||
std::find (boost::begin(enumStrings<T>::data), boost::end(enumStrings<T>::data), value ) ));
|
||||
}
|
||||
|
||||
|
||||
if (data.enumVal > boost::size( enumStrings<T>::data) ) {
|
||||
|
||||
std::cout << "ERROR: enumStrings.h reports data.enumVal = " << data.enumVal
|
||||
<< " is out of enum range = " << boost::size( enumStrings<T>::data) << std::endl;
|
||||
<< " is out of enum range = " << boost::size( enumStrings<T>::data) << std::endl;
|
||||
}
|
||||
|
||||
return str;
|
||||
@@ -87,10 +83,16 @@ inline std::istream& operator>>(std::istream& str, enumRefHolder<T> const& data)
|
||||
|
||||
|
||||
template<typename T>
|
||||
enumConstRefHolder<T> enumToString(T const& e) {return enumConstRefHolder<T>(e);}
|
||||
enumConstRefHolder<T> enumToString(T const& e)
|
||||
{
|
||||
return enumConstRefHolder<T>(e);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
enumRefHolder<T> enumFromString(T& e) {return enumRefHolder<T>(e);}
|
||||
enumRefHolder<T> enumFromString(T& e)
|
||||
{
|
||||
return enumRefHolder<T>(e);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -8,20 +8,17 @@
|
||||
#ifndef EXCEPTIONS_H
|
||||
#define EXCEPTIONS_H
|
||||
|
||||
#include <exception>
|
||||
#include <exception>
|
||||
#include <cstring>
|
||||
#include <defines.h>
|
||||
#include <cafeDataType.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
/**
|
||||
* The CAFEException_pv struct for pv error reporting
|
||||
*/
|
||||
struct CAFEException_pv
|
||||
{
|
||||
struct CAFEException_pv {
|
||||
char pv [PVNAME_SIZE];
|
||||
char pvAlias[PVNAME_SIZE];
|
||||
char pvAlias[PVNAME_SIZE];
|
||||
unsigned int handle;
|
||||
CAFE_DATATYPE dataTypeNative;
|
||||
const char * dataTypeNativeText;
|
||||
@@ -30,14 +27,13 @@ struct CAFEException_pv
|
||||
const char * statusMessage;
|
||||
const char * source;
|
||||
unsigned int ln;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* The CAFEException_group struct for group error reporting
|
||||
*/
|
||||
struct CAFEException_group
|
||||
{
|
||||
struct CAFEException_group {
|
||||
char groupName [PVNAME_SIZE];
|
||||
unsigned int groupHandle;
|
||||
int statusCode;
|
||||
@@ -45,15 +41,14 @@ struct CAFEException_group
|
||||
const char * statusMessage;
|
||||
const char * source;
|
||||
unsigned int ln;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* The CAFEException_open class for ca open error reporting
|
||||
*/
|
||||
class CAFEException_open : public exception
|
||||
{
|
||||
public:
|
||||
class CAFEException_open : public std::exception {
|
||||
public:
|
||||
virtual const char* what() const throw()
|
||||
{
|
||||
return "CAFEException_open exception: Could not establish link to pv";
|
||||
@@ -65,14 +60,13 @@ class CAFEException_open : public exception
|
||||
/**
|
||||
* The CAFEException_groupOpen class for ca group open error reporting
|
||||
*/
|
||||
class CAFEException_groupOpen : public exception
|
||||
{
|
||||
public:
|
||||
class CAFEException_groupOpen : public std::exception {
|
||||
public:
|
||||
virtual const char* what() const throw()
|
||||
{
|
||||
return "CAFEException_groupOpen exception: Could not establish link to group";
|
||||
};
|
||||
|
||||
|
||||
CAFEException_group groupEx;
|
||||
};
|
||||
|
||||
@@ -80,22 +74,20 @@ class CAFEException_groupOpen : public exception
|
||||
/**
|
||||
* The CAFEException_init
|
||||
*/
|
||||
class CAFEException_init: public exception
|
||||
{
|
||||
public:
|
||||
class CAFEException_init: public std::exception {
|
||||
public:
|
||||
virtual const char* what() const throw()
|
||||
{
|
||||
return "CAFEException_init exception: \nChannel Access Error: ECA_ALLOCMEM when calling ca_context_create";
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The CAFEException_allocBufferMem
|
||||
*/
|
||||
class CAFEException_allocBufferMem: public exception
|
||||
{
|
||||
public:
|
||||
class CAFEException_allocBufferMem: public std::exception {
|
||||
public:
|
||||
virtual const char* what() const throw()
|
||||
{
|
||||
return "CAFEException_allocBufferMem exception: \nCAFE ERROR: Cannot create space for pv data/ctrl buffer";
|
||||
|
||||
@@ -12,27 +12,26 @@
|
||||
#include "statusCodes.h"
|
||||
#include "defines.h"
|
||||
|
||||
class ExceptionsHelper
|
||||
{
|
||||
class ExceptionsHelper {
|
||||
private:
|
||||
CAFEDataTypeCode cafeDataTypeCode;
|
||||
CAFEStatus cafeStatus;
|
||||
CAFEDataTypeCode cafeDataTypeCode;
|
||||
CAFEStatus cafeStatus;
|
||||
public:
|
||||
CAFEException_pv prepareCAFEException_pv(const char *pv, const char *pvAlias,
|
||||
unsigned int handle, chid pCh, int status,
|
||||
const char * source, unsigned int ln);
|
||||
CAFEException_pv prepareCAFEException_pv(const char *pv, const char *pvAlias,
|
||||
unsigned int handle, chid pCh, int status,
|
||||
const char * source, unsigned int ln);
|
||||
|
||||
CAFEException_group prepareCAFEException_group(
|
||||
CAFEException_group prepareCAFEException_group(
|
||||
char groupName [PVNAME_SIZE],
|
||||
unsigned int groupHandle,
|
||||
int statusCode,
|
||||
const char * source,
|
||||
unsigned int ln);
|
||||
|
||||
ExceptionsHelper(void){};
|
||||
~ExceptionsHelper(void){};
|
||||
void printCAFEException_pv(CAFEException_pv & e);
|
||||
|
||||
ExceptionsHelper(void) {};
|
||||
~ExceptionsHelper(void) {};
|
||||
void printCAFEException_pv(CAFEException_pv & e);
|
||||
|
||||
|
||||
};
|
||||
#endif // EXCEPTIONSHELPER_H
|
||||
|
||||
@@ -25,16 +25,22 @@ extern epicsMutex cafeMutex;
|
||||
|
||||
extern cafeConduit_set cs;
|
||||
extern cafeGroup_set gs;
|
||||
extern vector<PVGroup> PVGroupV;
|
||||
extern vector<PVGroup> PVGroupPseudo;
|
||||
extern vector<deviceCollection> deviceCollectionV;
|
||||
extern map<vector<unsigned int>, string> groupPseudoMap;
|
||||
extern std::vector<PVGroup> PVGroupV;
|
||||
extern std::vector<PVGroup> PVGroupPseudo;
|
||||
extern std::vector<deviceCollection> deviceCollectionV;
|
||||
extern std::map<std::vector<unsigned int>, std::string> groupPseudoMap;
|
||||
|
||||
extern vector<string> globalChannelList;
|
||||
extern std::vector<std::string> globalChannelList;
|
||||
|
||||
|
||||
extern string contentsS;
|
||||
extern string contentsBS;
|
||||
extern std::string contentsS;
|
||||
extern std::string contentsBS;
|
||||
|
||||
extern unsigned long nCBs;
|
||||
|
||||
extern bool callbackLiveFlag;
|
||||
|
||||
extern bool SF_WITH_PULSE_ID;
|
||||
|
||||
|
||||
#endif // GLOBAL_H
|
||||
|
||||
@@ -33,10 +33,10 @@ public:
|
||||
|
||||
template <class CTYPE> friend class Instant;
|
||||
friend class CAFE;
|
||||
Granules(){};
|
||||
Granules() {};
|
||||
|
||||
private:
|
||||
HandleHelper helper;
|
||||
HandleHelper helper;
|
||||
CAFEStatus cafeStatus;
|
||||
|
||||
ChannelRequestDataTypePolicy channelRequestDataTypePolicy;
|
||||
@@ -74,7 +74,7 @@ private:
|
||||
int channelExecuteGet (const unsigned int); //report status
|
||||
int channelExecuteGetNoWait(const unsigned int); //report status
|
||||
|
||||
int waitForManyGetEvents(const unsigned int * handleArray, unsigned int arrayLength, map<unsigned int, int> & bundleResponse);
|
||||
int waitForManyGetEvents(const unsigned int * handleArray, unsigned int arrayLength, std::map<unsigned int, int> & bundleResponse);
|
||||
|
||||
int waitForGetEvent (const unsigned int, double);
|
||||
bool isGetCallbackDone (const unsigned int _handle);
|
||||
|
||||
@@ -15,269 +15,388 @@
|
||||
#include <conduitFriends.h>
|
||||
#include <hashConduitGroup.h>
|
||||
#include <cafeDataType.h>
|
||||
#include <defines.h>
|
||||
|
||||
//August 2018 Version 1.7
|
||||
#include <tmDateMap.h>
|
||||
|
||||
|
||||
class HandleHelper : public Helper {
|
||||
|
||||
private:
|
||||
CAFEStatus cafeStatus;
|
||||
cafeConduit_set::iterator itcs;
|
||||
private:
|
||||
CAFEStatus cafeStatus;
|
||||
cafeConduit_set::iterator itcs;
|
||||
|
||||
cafeGroup_set::iterator itgs;
|
||||
cafeGroup_set::iterator itgs;
|
||||
|
||||
ChannelRequestMetaDataClient channelRequestMetaDataClient;
|
||||
ChannelRequestMetaData channelRequestMetaData;
|
||||
ChannelRequestMetaDataClient channelRequestMetaDataClient;
|
||||
ChannelRequestMetaData channelRequestMetaData;
|
||||
|
||||
ChannelRequestMetaDataClient channelRequestMetaCtrlClient;
|
||||
ChannelRequestMetaData channelRequestMetaCtrl;
|
||||
ChannelRequestMetaDataClient channelRequestMetaCtrlClient;
|
||||
ChannelRequestMetaData channelRequestMetaCtrl;
|
||||
|
||||
ChannelDeviceAttribute channelDeviceAttribute;
|
||||
ChannelDeviceAttribute channelDeviceAttribute;
|
||||
CAFEDataTypeCode cafeDataTypeCode;
|
||||
|
||||
PrintErrorPolicy printErrorPolicy;
|
||||
|
||||
// now in defines.h
|
||||
//struct etsNorm{ unsigned int secPastEpoch; unsigned int nsec;};
|
||||
//struct etsDate{ int year; int mon; int day;
|
||||
// int hour; int min; int sec; unsigned long nsec;};
|
||||
|
||||
|
||||
public:
|
||||
|
||||
HandleHelper() {};
|
||||
~HandleHelper() {};
|
||||
|
||||
//Move to private if possible
|
||||
int setSTS(unsigned int _handle, dbr_short_t a, dbr_short_t s, epicsTimeStamp ets);
|
||||
|
||||
|
||||
etsNorm _etsNorm;
|
||||
etsDate _etsDate;
|
||||
TMwdayText tmDay;
|
||||
TMmonthpText tmMonth;
|
||||
|
||||
int checkConsistency();
|
||||
int checkConsistency(unsigned int _handle);
|
||||
|
||||
int setChannelDeviceAttribute(std::string deliminator);
|
||||
int setChannelDeviceAttribute(unsigned int _handle, std::string deliminator);
|
||||
|
||||
int getChannelDevice(unsigned int _handle, std::string & device);
|
||||
int getChannelAttribute(unsigned int _handle, std::string & attribute);
|
||||
|
||||
int getChannelRegalia(unsigned int _handle, ChannelRegalia & channelInfo);
|
||||
|
||||
int getChannelRequestStatusGetClassName(unsigned int _handle, ChannelRequestStatus &crsClassName);
|
||||
int getChannelRequestStatusGetSTSACK (unsigned int _handle, ChannelRequestStatus &crsSTSACK);
|
||||
int getChannelRequestStatusGetCtrl (unsigned int _handle, ChannelRequestStatus &crsCtrl);
|
||||
int getChannelRequestStatusGet (unsigned int _handle, ChannelRequestStatus &crs);
|
||||
|
||||
ca_client_context * getContextFromPV (const char * _pv);
|
||||
ca_client_context * getContextFromHandle (unsigned int _handle);
|
||||
|
||||
const char * getPVFromHandle (unsigned int _handle);
|
||||
const char * getPVFromHandle (unsigned int _handle, ca_client_context * ccc);
|
||||
|
||||
const char * getPV (unsigned int _handle)
|
||||
{
|
||||
return getPVFromHandle(_handle);
|
||||
}
|
||||
const char * getPVAlias (unsigned int _handle);
|
||||
const char * getPVAlias (unsigned int _handle, ca_client_context * ccc);
|
||||
|
||||
unsigned int getHandleFromPV (const char * _pv);
|
||||
unsigned int getHandleFromPV (const char * _pv, ca_client_context * ccc);
|
||||
unsigned int getHandleFromPVAlias(const char * _pv);
|
||||
unsigned int getHandleFromPVAlias(const char * _pv, ca_client_context * ccc);
|
||||
|
||||
std::vector<unsigned int> getHandlesFromPVs(std::vector<std::string> pvV, ca_client_context * ccc);
|
||||
std::vector<unsigned int> getHandlesFromPVs(std::vector<std::string> pvV);
|
||||
|
||||
std::vector<unsigned int> getDisconnectedHandlesFromWithinGroupV(unsigned int gh);
|
||||
|
||||
std::vector<unsigned int> getHandlesFromWithinGroupV(unsigned int gh);
|
||||
unsigned int * getHandlesFromWithinGroup(unsigned int gh);
|
||||
|
||||
unsigned int getHandleFromPVWithinGroup(const char * _pv, unsigned int gh);
|
||||
unsigned int getHandleFromPVWithinGroup(const char * _pv,
|
||||
ca_client_context * ccc, unsigned int gh);
|
||||
|
||||
int getStatus (unsigned int h);
|
||||
int getTimeStamp(unsigned int h, epicsTimeStamp &ts);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
etsNorm getEpicsTimeStampAsUInt32(unsigned int h)
|
||||
{
|
||||
epicsTimeStamp ts;
|
||||
getTimeStamp(h, ts);
|
||||
_etsNorm.secPastEpoch=ts.secPastEpoch;
|
||||
_etsNorm.nsec=ts.nsec;
|
||||
return _etsNorm;
|
||||
};
|
||||
|
||||
etsDate getEpicsTimeStampAsDate(unsigned int h)
|
||||
{
|
||||
epicsTimeStamp ts;
|
||||
|
||||
getTimeStamp(h, ts);
|
||||
|
||||
epicsTime time(ts);
|
||||
|
||||
local_tm_nano_sec local = (local_tm_nano_sec) time;
|
||||
_etsDate.year = local.ansi_tm.tm_year + 1900;
|
||||
_etsDate.mon = local.ansi_tm.tm_mon + 1;
|
||||
_etsDate.day = local.ansi_tm.tm_mday;
|
||||
_etsDate.hour = local.ansi_tm.tm_hour;
|
||||
_etsDate.min = local.ansi_tm.tm_min;
|
||||
_etsDate.sec = local.ansi_tm.tm_sec;
|
||||
|
||||
_etsDate.nsec = (unsigned long) ts.nsec;
|
||||
|
||||
CAFEDataTypeCode cafeDataTypeCode;
|
||||
_etsDate.wday = local.ansi_tm.tm_wday;
|
||||
_etsDate.yday = local.ansi_tm.tm_yday;
|
||||
_etsDate.isdst = local.ansi_tm.tm_isdst;
|
||||
|
||||
PrintErrorPolicy printErrorPolicy;
|
||||
return _etsDate;
|
||||
}
|
||||
|
||||
struct etsNorm{ unsigned int secPastEpoch; unsigned int nsec;};
|
||||
struct etsDate{ int year; int mon; int day;
|
||||
int hour; int min; int sec; unsigned long nsec;};
|
||||
etsDate epicsTimeStampToDate(epicsTimeStamp ts)
|
||||
{
|
||||
epicsTime time(ts);
|
||||
local_tm_nano_sec local = (local_tm_nano_sec) time;
|
||||
_etsDate.year = local.ansi_tm.tm_year + 1900;
|
||||
_etsDate.mon = local.ansi_tm.tm_mon + 1;
|
||||
_etsDate.day = local.ansi_tm.tm_mday;
|
||||
_etsDate.hour = local.ansi_tm.tm_hour;
|
||||
_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;
|
||||
|
||||
return _etsDate;
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
etsDate etsNormToDate(etsNorm ts)
|
||||
{
|
||||
epicsTimeStamp ets;
|
||||
ets.secPastEpoch=ts.secPastEpoch;
|
||||
ets.nsec=ts.nsec;
|
||||
epicsTime time(ets);
|
||||
local_tm_nano_sec local = (local_tm_nano_sec) time;
|
||||
_etsDate.year = local.ansi_tm.tm_year + 1900;
|
||||
_etsDate.mon = local.ansi_tm.tm_mon + 1;
|
||||
_etsDate.day = local.ansi_tm.tm_mday;
|
||||
_etsDate.hour = local.ansi_tm.tm_hour;
|
||||
_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;
|
||||
|
||||
return _etsDate;
|
||||
}
|
||||
|
||||
|
||||
etsDate unixTimeToDate(etsNorm ts)
|
||||
{
|
||||
time_t t= ts.secPastEpoch;// = time(NULL);
|
||||
|
||||
struct tm * local;
|
||||
local=localtime(&t);
|
||||
//local_tm_nano_sec local = (local_tm_nano_sec) time;
|
||||
_etsDate.year = local->tm_year +1900;
|
||||
_etsDate.mon = local->tm_mon + 1;
|
||||
_etsDate.day = local->tm_mday;
|
||||
_etsDate.hour = local->tm_hour;
|
||||
_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;
|
||||
|
||||
return _etsDate;
|
||||
}
|
||||
|
||||
|
||||
std::string etsDateAsString(etsNorm ts) {
|
||||
|
||||
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);
|
||||
|
||||
|
||||
HandleHelper(){};
|
||||
~HandleHelper(){};
|
||||
|
||||
//Move to private if possible
|
||||
int setSTS(unsigned int _handle, dbr_short_t a, dbr_short_t s, epicsTimeStamp ets);
|
||||
|
||||
|
||||
etsNorm _etsNorm;
|
||||
etsDate _etsDate;
|
||||
|
||||
int checkConsistency();
|
||||
int checkConsistency(unsigned int _handle);
|
||||
|
||||
int setChannelDeviceAttribute(std::string deliminator);
|
||||
int setChannelDeviceAttribute(unsigned int _handle, std::string deliminator);
|
||||
|
||||
int getChannelDevice(unsigned int _handle, std::string & device);
|
||||
int getChannelAttribute(unsigned int _handle, std::string & attribute);
|
||||
|
||||
int getChannelRegalia(unsigned int _handle, ChannelRegalia & channelInfo);
|
||||
|
||||
int getChannelRequestStatusGetClassName(unsigned int _handle, ChannelRequestStatus &crsClassName);
|
||||
int getChannelRequestStatusGetSTSACK (unsigned int _handle, ChannelRequestStatus &crsSTSACK);
|
||||
int getChannelRequestStatusGetCtrl (unsigned int _handle, ChannelRequestStatus &crsCtrl);
|
||||
int getChannelRequestStatusGet (unsigned int _handle, ChannelRequestStatus &crs);
|
||||
|
||||
|
||||
//Add getPVFromHandle
|
||||
ca_client_context * getContextFromPV (const char * _pv);
|
||||
ca_client_context * getContextFromHandle (unsigned int _handle);
|
||||
|
||||
const char * getPVFromHandle (unsigned int _handle);
|
||||
const char * getPVFromHandle (unsigned int _handle, ca_client_context * ccc);
|
||||
|
||||
unsigned int getHandleFromPV (const char * _pv);
|
||||
unsigned int getHandleFromPV (const char * _pv, ca_client_context * ccc);
|
||||
unsigned int getHandleFromPVAlias(const char * _pv);
|
||||
unsigned int getHandleFromPVAlias(const char * _pv, ca_client_context * ccc);
|
||||
|
||||
vector<unsigned int> getHandlesFromPVs(vector<string> pvV, ca_client_context * ccc);
|
||||
vector<unsigned int> getHandlesFromPVs(vector<string> pvV);
|
||||
|
||||
vector<unsigned int> getDisconnectedHandlesFromWithinGroupV(unsigned int gh);
|
||||
|
||||
vector<unsigned int> getHandlesFromWithinGroupV(unsigned int gh);
|
||||
unsigned int * getHandlesFromWithinGroup(unsigned int gh);
|
||||
|
||||
unsigned int getHandleFromPVWithinGroup(const char * _pv, unsigned int gh);
|
||||
unsigned int getHandleFromPVWithinGroup(const char * _pv,
|
||||
ca_client_context * ccc, unsigned int gh);
|
||||
|
||||
int getStatus (unsigned int h);
|
||||
int getTimeStamp(unsigned int h, epicsTimeStamp &ts);
|
||||
|
||||
|
||||
etsNorm getEpicsTimeStampAsUInt32(unsigned int h) {
|
||||
epicsTimeStamp ts;
|
||||
getTimeStamp(h, ts);
|
||||
_etsNorm.secPastEpoch=ts.secPastEpoch; _etsNorm.nsec=ts.nsec;
|
||||
return _etsNorm;};
|
||||
|
||||
etsDate getEpicsTimeStampAsDate(unsigned int h) {
|
||||
epicsTimeStamp ts;
|
||||
|
||||
getTimeStamp(h, ts);
|
||||
|
||||
epicsTime time(ts);
|
||||
|
||||
local_tm_nano_sec local = (local_tm_nano_sec) time;
|
||||
_etsDate.year = local.ansi_tm.tm_year + 1900;
|
||||
_etsDate.mon = local.ansi_tm.tm_mon + 1;
|
||||
_etsDate.day = local.ansi_tm.tm_mday;
|
||||
_etsDate.hour = local.ansi_tm.tm_hour;
|
||||
_etsDate.min = local.ansi_tm.tm_min;
|
||||
_etsDate.sec = local.ansi_tm.tm_sec;
|
||||
|
||||
_etsDate.nsec = (unsigned long) ts.nsec;
|
||||
|
||||
return _etsDate;
|
||||
}
|
||||
|
||||
etsDate epicsTimeStampToDate(epicsTimeStamp ts) {
|
||||
epicsTime time(ts);
|
||||
local_tm_nano_sec local = (local_tm_nano_sec) time;
|
||||
_etsDate.year = local.ansi_tm.tm_year + 1900;
|
||||
_etsDate.mon = local.ansi_tm.tm_mon + 1;
|
||||
_etsDate.day = local.ansi_tm.tm_mday;
|
||||
_etsDate.hour = local.ansi_tm.tm_hour;
|
||||
_etsDate.min = local.ansi_tm.tm_min;
|
||||
_etsDate.sec = local.ansi_tm.tm_sec;
|
||||
_etsDate.nsec = (unsigned long) ts.nsec;
|
||||
return _etsDate;
|
||||
return date;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int getPulseID(unsigned int h, unsigned int &pulseID) {
|
||||
epicsTimeStamp ts;
|
||||
int status=getTimeStamp(h, ts);
|
||||
if (status==ICAFE_NORMAL){
|
||||
std::string nsS = static_cast<ostringstream*>( &(ostringstream() << ts.nsec) )->str();
|
||||
int l=nsS.length();
|
||||
int startPos=max(l-6,0);
|
||||
std::string pidS = nsS.substr(startPos,min(6,l));
|
||||
if ( ! (istringstream(pidS) >> pulseID) ) pulseID = 0;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
unsigned int getPulseIDFromTS(epicsTimeStamp ts) {
|
||||
unsigned int pulseID;
|
||||
std::string nsS = static_cast<ostringstream*>( &(ostringstream() << ts.nsec) )->str();
|
||||
//Deprecated!!!
|
||||
int getPulseID(unsigned int h, unsigned int &pulseID)
|
||||
{
|
||||
epicsTimeStamp ts;
|
||||
int status=getTimeStamp(h, ts);
|
||||
if (status==ICAFE_NORMAL) {
|
||||
std::string nsS = static_cast<std::ostringstream*>( &(std::ostringstream() << ts.nsec) )->str();
|
||||
int l=nsS.length();
|
||||
int startPos=max(l-6,0);
|
||||
std::string pidS = nsS.substr(startPos,min(6,l));
|
||||
if ( ! (istringstream(pidS) >> pulseID) ) pulseID = 0;
|
||||
return pulseID;
|
||||
int startPos=std::max(l-6,0);
|
||||
std::string pidS = nsS.substr(startPos,std::min(6,l));
|
||||
if ( ! (std::istringstream(pidS) >> pulseID) ) pulseID = 0;
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
int getAlarmStatusSeverity(unsigned int h, dbr_short_t as[2]);
|
||||
int getAlarmStatusSeverityAsString(unsigned int h, string asas[2]);
|
||||
unsigned int getNoHandles();
|
||||
unsigned int getNextFreeHandle();
|
||||
unsigned int getPulseIDFromTS(epicsTimeStamp ts)
|
||||
{
|
||||
unsigned int pulseID;
|
||||
std::string nsS = static_cast<std::ostringstream*>( &(std::ostringstream() << ts.nsec) )->str();
|
||||
int l=nsS.length();
|
||||
int startPos=std::max(l-6,0);
|
||||
std::string pidS = nsS.substr(startPos,std::min(6,l));
|
||||
if ( ! (std::istringstream(pidS) >> pulseID) ) pulseID = 0;
|
||||
return pulseID;
|
||||
}
|
||||
|
||||
bool isChannelConnected(unsigned int handle);
|
||||
bool allChannelsConnected();
|
||||
bool allChannelsWithinGroupConnected();
|
||||
bool allChannelsWithinGroupConnectedV(vector<unsigned int>);
|
||||
bool hasAlarmStatusSeverity(unsigned int h);
|
||||
int getAlarmStatusSeverity(unsigned int h, dbr_short_t as[2]);
|
||||
int getAlarmStatusSeverityAsString(unsigned int h, std::string asas[2]);
|
||||
unsigned int getNoHandles();
|
||||
unsigned int getNextFreeHandle();
|
||||
|
||||
int printHandle (unsigned int h);
|
||||
int printHandlesV(vector<unsigned int> handleV);
|
||||
int printHandles(unsigned int * handleArray, unsigned int nHandles);
|
||||
unsigned int printHandles();
|
||||
unsigned int printChannels(){return printHandles();};
|
||||
unsigned int printDisconnectedHandles();
|
||||
unsigned int printDisconnectedChannels(){return printDisconnectedChannels();};
|
||||
unsigned int getDisconnectedHandles(vector<unsigned int> &, vector<string> &);
|
||||
unsigned int getConnectedHandles(vector<unsigned int> &, vector<string> &);
|
||||
unsigned int getHandles(vector<unsigned int> &, vector<string> &);
|
||||
unsigned int getHandleStates(vector<unsigned int> &, vector<string> &, vector<unsigned short> &);
|
||||
unsigned int printMonitors();
|
||||
|
||||
vector<unsigned int> getHandlesWithMonitors();
|
||||
int getMonitorHandlesAndActions(vector<unsigned int> & handleV, vector<string> & actionV);
|
||||
|
||||
int setCafeDbrTypeV(vector<unsigned int> _handleV, CAFENUM::DBR_TYPE cdt);
|
||||
int setCafeDbrType(unsigned int _handle, CAFENUM::DBR_TYPE cdt);
|
||||
int getCafeDbrType(unsigned int _handle, CAFENUM::DBR_TYPE &cdt);
|
||||
int getDescription(unsigned int _handle, std::string & desc);
|
||||
int getUnits (unsigned int h, std::string & units);
|
||||
int getPrecision(unsigned int h, short &precision);
|
||||
|
||||
bool isEnum(unsigned int _handle);
|
||||
short getEnumFromString(unsigned int _handle, string enumStringValue);
|
||||
string getStringFromEnum(unsigned int _handle, unsigned short enumValue);
|
||||
|
||||
int getDataTypeNative (unsigned int _handle, chtype &ndt);
|
||||
int getDataTypeRequest(unsigned int _handle, chtype &rdt);
|
||||
bool isChannelConnected(unsigned int handle);
|
||||
bool allChannelsConnected();
|
||||
bool allChannelsWithinGroupConnected();
|
||||
bool allChannelsWithinGroupConnectedV(std::vector<unsigned int>);
|
||||
|
||||
int printHandle (unsigned int h);
|
||||
int printHandlesV(std::vector<unsigned int> handleV);
|
||||
int printHandles(unsigned int * handleArray, unsigned int nHandles);
|
||||
unsigned int printHandles();
|
||||
unsigned int printChannels()
|
||||
{
|
||||
return printHandles();
|
||||
};
|
||||
unsigned int printDisconnectedHandles();
|
||||
unsigned int printDisconnectedChannels()
|
||||
{
|
||||
return printDisconnectedChannels();
|
||||
};
|
||||
unsigned int getDisconnectedHandles(std::vector<unsigned int> &, std::vector<std::string> &);
|
||||
unsigned int getConnectedHandles(std::vector<unsigned int> &, std::vector<std::string> &);
|
||||
unsigned int getHandles(std::vector<unsigned int> &, std::vector<std::string> &);
|
||||
unsigned int getHandleStates(std::vector<unsigned int> &, std::vector<std::string> &, std::vector<unsigned short> &);
|
||||
unsigned int printMonitors();
|
||||
|
||||
int eraseMonitorAction(unsigned int _handle);
|
||||
int clearMonitorAction(unsigned int _handle);
|
||||
std::vector<unsigned int> getHandlesWithMonitors();
|
||||
int getMonitorHandlesAndActions(std::vector<unsigned int> & handleV, std::vector<std::string> & actionV);
|
||||
|
||||
int clearMonitorAction();
|
||||
int setCafeDbrTypeV(std::vector<unsigned int> _handleV, CAFENUM::DBR_TYPE cdt);
|
||||
int setCafeDbrType(unsigned int _handle, CAFENUM::DBR_TYPE cdt);
|
||||
int getCafeDbrType(unsigned int _handle, CAFENUM::DBR_TYPE &cdt);
|
||||
|
||||
int addMonitorAction(unsigned int _handle, string mAction);
|
||||
int getMonitorAction(unsigned int _handle, vector<string> &msV);
|
||||
vector<string> getMonitorAction(bool onlyIfNewData); //all handles; false gives all
|
||||
bool isEnum(unsigned int _handle);
|
||||
short getEnumFromString(unsigned int _handle, std::string enumStringValue);
|
||||
std::string getStringFromEnum(unsigned int _handle, unsigned short enumValue);
|
||||
std::vector<std::string> getEnumStrings(unsigned int handle);
|
||||
|
||||
int getMonitorPolicyVector(unsigned int _handle, vector<MonitorPolicy> &mpV);
|
||||
int getMonitorPolicyInWaitingVector(unsigned int _handle, vector<MonitorPolicy> &mpV);
|
||||
int getNmonitor(unsigned int _handle);
|
||||
int getNmonitorData(unsigned int _handle);
|
||||
int getNmonitorCtrl(unsigned int _handle);
|
||||
vector<unsigned int> getMonitorIDs(unsigned int _handle);
|
||||
vector<unsigned int> getMonitorIDsInWaiting(unsigned int _handle);
|
||||
int getDataTypeNative (unsigned int _handle, chtype &ndt);
|
||||
int getDataTypeRequest(unsigned int _handle, chtype &rdt);
|
||||
|
||||
unsigned int getUsrArgsAsUInt(unsigned int _handle); //From c.channelRequestMetaData.usrArg
|
||||
chtype getDataTypeCB(unsigned int _handle);
|
||||
chtype getDbrDataTypeCB(unsigned int _handle);
|
||||
CAFENUM::DBR_TYPE getCafeDbrTypeCB(unsigned int _handle);
|
||||
|
||||
//setNoElements
|
||||
int setNelem (); //All handles to native
|
||||
unsigned int setNelem (unsigned int _handle); //To Native
|
||||
unsigned int setNelemToNative (unsigned int _handle){return setNelem(_handle);}; //To Native
|
||||
unsigned int setNelem (unsigned int _handle, unsigned int _nelem);
|
||||
//For Arrays:
|
||||
unsigned int setNelemToRetrieveFromCache (unsigned int _handle);
|
||||
unsigned int setNelemToRetrieveFromCache (unsigned int _handle, unsigned int _nelem);
|
||||
unsigned int setNelemToRetrieveFromCtrlCache (unsigned int _handle);
|
||||
unsigned int setNelemToRetrieveFromCtrlCache (unsigned int _handle, unsigned int _nelem);
|
||||
unsigned int getNelemToRetrieveFromCache (unsigned int _handle);
|
||||
unsigned int getNelemToRetrieveFromCtrlCache (unsigned int _handle);
|
||||
int eraseMonitorAction(unsigned int _handle);
|
||||
int clearMonitorAction(unsigned int _handle);
|
||||
|
||||
char * getPV (unsigned int _handle);
|
||||
char * getPVAlias (unsigned int _handle);
|
||||
int clearMonitorAction();
|
||||
|
||||
unsigned int getNelemClient (unsigned int _handle);
|
||||
unsigned int getNelemNative (unsigned int _handle);
|
||||
unsigned int getNelemRequest (unsigned int _handle);
|
||||
int addMonitorAction(unsigned int _handle, std::string mAction);
|
||||
int getMonitorAction(unsigned int _handle, std::vector<std::string> &msV);
|
||||
std::vector<std::string> getMonitorAction(bool onlyIfNewData); //all handles; false gives all
|
||||
|
||||
int getNelem(unsigned int _handle, unsigned int &c, unsigned int &n, unsigned int &r);
|
||||
int getMonitorPolicyVector(unsigned int _handle, std::vector<MonitorPolicy> &mpV);
|
||||
int getMonitorPolicyInWaitingVector(unsigned int _handle, std::vector<MonitorPolicy> &mpV);
|
||||
int getNmonitor(unsigned int _handle);
|
||||
int getNmonitorData(unsigned int _handle);
|
||||
int getNmonitorCtrl(unsigned int _handle);
|
||||
std::vector<unsigned int> getMonitorIDs(unsigned int _handle);
|
||||
std::vector<unsigned int> getMonitorIDsInWaiting(unsigned int _handle);
|
||||
|
||||
//Ctrl
|
||||
|
||||
unsigned int setNelemCtrl (unsigned int _handle, unsigned int _nelem);
|
||||
unsigned int getNelemRequestCtrl (unsigned int _handle);
|
||||
unsigned int getNelemClientCtrl (unsigned int _handle);
|
||||
//setOffSet
|
||||
unsigned int setOffset(unsigned int _handle, unsigned int _offset);
|
||||
unsigned int getOffset(unsigned int _handle);
|
||||
unsigned int getOffsetLast(unsigned int _handle);
|
||||
unsigned int getUsrArgsAsUInt(unsigned int _handle); //From c.channelRequestMetaData.usrArg
|
||||
chtype getDataTypeCB(unsigned int _handle);
|
||||
chtype getDbrDataTypeCB(unsigned int _handle);
|
||||
CAFENUM::DBR_TYPE getCafeDbrTypeCB(unsigned int _handle);
|
||||
|
||||
void setFirstAndLastArrayElements(unsigned int _handle,
|
||||
unsigned int _start, unsigned int _last){
|
||||
if (_last > _start ) { setOffset(_handle, _start); setNelem(_handle, _last);}
|
||||
else {std::cout << " offset must be less than the nelements" <<std::endl; };
|
||||
//setNoElements
|
||||
int setNelem (); //All handles to native
|
||||
unsigned int setNelem (unsigned int _handle); //To Native
|
||||
unsigned int setNelemToNative (unsigned int _handle)
|
||||
{
|
||||
return setNelem(_handle);
|
||||
}; //To Native
|
||||
unsigned int setNelem (unsigned int _handle, unsigned int _nelem);
|
||||
//For Arrays:
|
||||
unsigned int setNelemToRetrieveFromCache (unsigned int _handle);
|
||||
unsigned int setNelemToRetrieveFromCache (unsigned int _handle, unsigned int _nelem);
|
||||
unsigned int setNelemToRetrieveFromCtrlCache (unsigned int _handle);
|
||||
unsigned int setNelemToRetrieveFromCtrlCache (unsigned int _handle, unsigned int _nelem);
|
||||
unsigned int getNelemToRetrieveFromCache (unsigned int _handle);
|
||||
unsigned int getNelemToRetrieveFromCtrlCache (unsigned int _handle);
|
||||
|
||||
unsigned int getNelemClient (unsigned int _handle);
|
||||
unsigned int getNelemNative (unsigned int _handle);
|
||||
unsigned int getNelemRequest (unsigned int _handle);
|
||||
|
||||
int getNelem(unsigned int _handle, unsigned int &c, unsigned int &n, unsigned int &r);
|
||||
|
||||
//Ctrl
|
||||
unsigned int setNelemCtrl (unsigned int _handle, unsigned int _nelem);
|
||||
unsigned int getNelemRequestCtrl (unsigned int _handle);
|
||||
unsigned int getNelemClientCtrl (unsigned int _handle);
|
||||
//setOffSet
|
||||
unsigned int setOffset(unsigned int _handle, unsigned int _offset);
|
||||
unsigned int getOffset(unsigned int _handle);
|
||||
unsigned int getOffsetLast(unsigned int _handle);
|
||||
|
||||
void setFirstAndLastArrayElements(unsigned int _handle,
|
||||
unsigned int _start, unsigned int _last)
|
||||
{
|
||||
if (_last > _start ) {
|
||||
setOffset(_handle, _start);
|
||||
setNelem(_handle, _last);
|
||||
}
|
||||
else {
|
||||
std::cout << " offset must be less than the nelements" <<std::endl;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
//long setOffsetCtrl(unsigned int _handle, unsigned int _offset);
|
||||
//long setOffsetCtrl(unsigned int _handle, unsigned int _offset);
|
||||
|
||||
//Groups
|
||||
unsigned int getGroupHandleFromGroupName(const char * _groupName){
|
||||
ca_client_context * ccc= ca_current_context();
|
||||
return getGroupHandleFromGroupName(_groupName, ccc);
|
||||
}
|
||||
//bs read
|
||||
int setMapPulseIDBufferSize(unsigned int _handle, unsigned short _bufferSize);
|
||||
int setMapPulseIDBufferSizeAll(unsigned short _bufferSize);
|
||||
|
||||
unsigned int getGroupHandleFromGroupName(const char * _groupName, ca_client_context * ccc);
|
||||
string getGroupNameFromGroupHandle(unsigned int groupHandle);
|
||||
//Groups
|
||||
unsigned int getGroupHandleFromGroupName(const char * _groupName)
|
||||
{
|
||||
ca_client_context * ccc= ca_current_context();
|
||||
return getGroupHandleFromGroupName(_groupName, ccc);
|
||||
}
|
||||
|
||||
unsigned int getGroupNPV(unsigned int gHandle);
|
||||
unsigned int getGroupNPV(const char * _groupName, ca_client_context * ccc);
|
||||
unsigned int getGroupNPV(const char * _groupName){
|
||||
ca_client_context * ccc= ca_current_context();
|
||||
return getGroupNPV(_groupName, ccc);
|
||||
}
|
||||
unsigned int getGroupHandleFromGroupName(const char * _groupName, ca_client_context * ccc);
|
||||
std::string getGroupNameFromGroupHandle(unsigned int groupHandle);
|
||||
|
||||
unsigned int getGroupNPV(unsigned int gHandle);
|
||||
unsigned int getGroupNPV(const char * _groupName, ca_client_context * ccc);
|
||||
unsigned int getGroupNPV(const char * _groupName)
|
||||
{
|
||||
ca_client_context * ccc= ca_current_context();
|
||||
return getGroupNPV(_groupName, ccc);
|
||||
}
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -20,28 +20,28 @@
|
||||
using boost::multi_index_container;
|
||||
using namespace boost::multi_index;
|
||||
|
||||
struct by_handle{};
|
||||
struct by_channelID{};
|
||||
struct by_pv{};
|
||||
struct by_pvAlias{};
|
||||
struct by_handle {};
|
||||
struct by_channelID {};
|
||||
struct by_pv {};
|
||||
struct by_pvAlias {};
|
||||
|
||||
|
||||
typedef multi_index_container<
|
||||
Conduit,
|
||||
indexed_by<
|
||||
ordered_unique<
|
||||
tag<by_handle>, BOOST_MULTI_INDEX_MEMBER(Conduit, unsigned int, handle)>,
|
||||
ordered_non_unique<
|
||||
tag<by_channelID>, BOOST_MULTI_INDEX_MEMBER(Conduit, chid, channelID)>,
|
||||
ordered_non_unique<
|
||||
tag<by_pv>, BOOST_MULTI_INDEX_MEMBER(Conduit, std::string, pv)>,
|
||||
ordered_non_unique<
|
||||
tag<by_pvAlias>, BOOST_MULTI_INDEX_MEMBER(Conduit, std::string, pvAlias)>,
|
||||
//ordered_non_unique<
|
||||
//tag<by_uniqueID>, BOOST_MULTI_INDEX_MEMBER(Conduit, unsigned int, uniqueID)>,
|
||||
hashed_unique<member<Conduit, unsigned int, &Conduit::handle> >
|
||||
>
|
||||
> cafeConduit_set;
|
||||
Conduit,
|
||||
indexed_by<
|
||||
ordered_unique<
|
||||
tag<by_handle>, BOOST_MULTI_INDEX_MEMBER(Conduit, unsigned int, handle)>,
|
||||
ordered_non_unique<
|
||||
tag<by_channelID>, BOOST_MULTI_INDEX_MEMBER(Conduit, chid, channelID)>,
|
||||
ordered_non_unique<
|
||||
tag<by_pv>, BOOST_MULTI_INDEX_MEMBER(Conduit, std::string, pv)>,
|
||||
ordered_non_unique<
|
||||
tag<by_pvAlias>, BOOST_MULTI_INDEX_MEMBER(Conduit, std::string, pvAlias)>,
|
||||
//ordered_non_unique<
|
||||
//tag<by_uniqueID>, BOOST_MULTI_INDEX_MEMBER(Conduit, unsigned int, uniqueID)>,
|
||||
hashed_unique<member<Conduit, unsigned int, &Conduit::handle> >
|
||||
>
|
||||
> cafeConduit_set;
|
||||
|
||||
|
||||
typedef cafeConduit_set::index<by_channelID>::type cafeConduit_set_by_channelID;
|
||||
|
||||
@@ -21,21 +21,21 @@ using boost::multi_index_container;
|
||||
// namespace multi-indexing of reference handles to CAFEConduit objects
|
||||
using namespace boost::multi_index;
|
||||
|
||||
struct by_groupHandle{};
|
||||
struct by_groupID{};
|
||||
struct by_groupName{};
|
||||
struct by_groupHandle {};
|
||||
struct by_groupID {};
|
||||
struct by_groupName {};
|
||||
|
||||
typedef multi_index_container<
|
||||
ConduitGroup,
|
||||
indexed_by<
|
||||
ordered_unique<
|
||||
tag<by_groupHandle>, BOOST_MULTI_INDEX_MEMBER(ConduitGroup, unsigned int, groupHandle)>,
|
||||
ordered_non_unique<
|
||||
tag<by_groupID>, BOOST_MULTI_INDEX_MEMBER(ConduitGroup, CA_SYNC_GID, groupID)>,
|
||||
ordered_non_unique<
|
||||
tag<by_groupName>, BOOST_MULTI_INDEX_MEMBER(ConduitGroup, std::string, groupName)>,
|
||||
hashed_unique<member<ConduitGroup, unsigned int, &ConduitGroup::groupHandle> >
|
||||
>
|
||||
ConduitGroup,
|
||||
indexed_by<
|
||||
ordered_unique<
|
||||
tag<by_groupHandle>, BOOST_MULTI_INDEX_MEMBER(ConduitGroup, unsigned int, groupHandle)>,
|
||||
ordered_non_unique<
|
||||
tag<by_groupID>, BOOST_MULTI_INDEX_MEMBER(ConduitGroup, CA_SYNC_GID, groupID)>,
|
||||
ordered_non_unique<
|
||||
tag<by_groupName>, BOOST_MULTI_INDEX_MEMBER(ConduitGroup, std::string, groupName)>,
|
||||
hashed_unique<member<ConduitGroup, unsigned int, &ConduitGroup::groupHandle> >
|
||||
>
|
||||
> cafeGroup_set;
|
||||
|
||||
typedef cafeGroup_set::index<by_groupID>::type cafeGroup_set_by_groupID;
|
||||
|
||||
@@ -19,19 +19,18 @@
|
||||
#include <cafeEnum.h>
|
||||
#include <defines.h>
|
||||
|
||||
class Helper
|
||||
{
|
||||
public:
|
||||
Helper(){};
|
||||
class Helper {
|
||||
public:
|
||||
Helper() {};
|
||||
|
||||
void removeLeadingAndTrailingSpacesDbrString(const char * _pv, char pvStripped[MAX_STRING_SIZE]);
|
||||
void removeLeadingAndTrailingSpacesPseudo(const char * _pv, char pvStripped[PVGROUP_PSEUDO_SIZE]);
|
||||
void removeLeadingAndTrailingSpaces(const char * _pv, char pvStripped[PVNAME_SIZE]);
|
||||
unsigned int convertToUniqueNumber(const char * pv, ca_client_context * ccc, unsigned int ghs);
|
||||
unsigned int convertToUniqueNumber(const char * pv, ca_client_context * ccc);
|
||||
CAFENUM::DBR_TYPE convertToCAFEDbrTypeClass(const chtype _chtype) const;
|
||||
void removeLeadingAndTrailingSpacesDbrString(const char * _pv, char pvStripped[MAX_STRING_SIZE]);
|
||||
void removeLeadingAndTrailingSpacesPseudo(const char * _pv, char pvStripped[PVGROUP_PSEUDO_SIZE]);
|
||||
void removeLeadingAndTrailingSpaces(const char * _pv, char pvStripped[PVNAME_SIZE]);
|
||||
unsigned int convertToUniqueNumber(const char * pv, ca_client_context * ccc, unsigned int ghs);
|
||||
unsigned int convertToUniqueNumber(const char * pv, ca_client_context * ccc);
|
||||
CAFENUM::DBR_TYPE convertToCAFEDbrTypeClass(const chtype _chtype) const;
|
||||
|
||||
std::string concatToString(dbr_char_t * inChar, unsigned int nChar);
|
||||
std::string concatToString(dbr_char_t * inChar, unsigned int nChar);
|
||||
};
|
||||
|
||||
#endif // HELPER_H
|
||||
|
||||
3475
include/instant.cpp
3475
include/instant.cpp
File diff suppressed because it is too large
Load Diff
@@ -29,7 +29,7 @@ private:
|
||||
|
||||
PolicyHelper policyHelper;
|
||||
|
||||
HandleHelper helper;
|
||||
HandleHelper helper;
|
||||
|
||||
Conduit cc;
|
||||
ChannelTimeoutPolicy channelTimeoutPolicyGet;
|
||||
@@ -48,11 +48,11 @@ private:
|
||||
bool isCacheRequest);
|
||||
public:
|
||||
|
||||
Instant (){};
|
||||
~Instant (){};
|
||||
Instant () {};
|
||||
~Instant () {};
|
||||
|
||||
int set(const unsigned int *handleArray, const unsigned int nelem,
|
||||
const chtype _dbrType, const CTYPE * val, int *statusArray);
|
||||
const chtype _dbrType, const CTYPE * val, int *statusArray);
|
||||
|
||||
int set(const unsigned int _handle, const chtype dbrType, const CTYPE * _val);
|
||||
|
||||
@@ -60,27 +60,35 @@ public:
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);
|
||||
|
||||
int get(const unsigned int _handle, const chtype dbrType, CTYPE * _val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity){
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
epicsTimeStamp ts;
|
||||
return get(_handle, dbrType, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
|
||||
int get(const unsigned int _handle, const chtype dbrType, CTYPE * _val){
|
||||
dbr_short_t alarmStatus; dbr_short_t alarmSeverity; epicsTimeStamp ts;
|
||||
return get(_handle, dbrType, _val, alarmStatus, alarmSeverity, ts);
|
||||
int get(const unsigned int _handle, const chtype dbrType, CTYPE * _val)
|
||||
{
|
||||
dbr_short_t alarmStatus;
|
||||
dbr_short_t alarmSeverity;
|
||||
epicsTimeStamp ts;
|
||||
return get(_handle, dbrType, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
|
||||
int getCache(const unsigned int _handle, const chtype dbrType, CTYPE * _val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts);
|
||||
|
||||
int getCache(const unsigned int _handle, const chtype dbrType, CTYPE * _val,
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity){
|
||||
dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity)
|
||||
{
|
||||
epicsTimeStamp ts;
|
||||
return getCache(_handle, dbrType, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
|
||||
int getCache(const unsigned int _handle, const chtype dbrType, CTYPE * _val){
|
||||
dbr_short_t alarmStatus; dbr_short_t alarmSeverity; epicsTimeStamp ts;
|
||||
int getCache(const unsigned int _handle, const chtype dbrType, CTYPE * _val)
|
||||
{
|
||||
dbr_short_t alarmStatus;
|
||||
dbr_short_t alarmSeverity;
|
||||
epicsTimeStamp ts;
|
||||
return getCache(_handle, dbrType, _val, alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
|
||||
@@ -90,181 +98,190 @@ public:
|
||||
|
||||
int getCache(const unsigned int *handleArray, const unsigned int nelem,
|
||||
const chtype _dbrType, CTYPE * val, int *statusArray,
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity ) {
|
||||
dbr_short_t *alarmStatus, dbr_short_t *alarmSeverity )
|
||||
{
|
||||
epicsTimeStamp * ts;
|
||||
return getCache(handleArray, nelem, _dbrType, val, statusArray,
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
int getCache(const unsigned int *handleArray, const unsigned int nelem,
|
||||
const chtype _dbrType, CTYPE * val, int *statusArray) {
|
||||
dbr_short_t * alarmStatus; dbr_short_t * alarmSeverity; epicsTimeStamp * ts;
|
||||
const chtype _dbrType, CTYPE * val, int *statusArray)
|
||||
{
|
||||
dbr_short_t * alarmStatus;
|
||||
dbr_short_t * alarmSeverity;
|
||||
epicsTimeStamp * ts;
|
||||
return getCache(handleArray, nelem, _dbrType, val, statusArray,
|
||||
alarmStatus, alarmSeverity, ts);
|
||||
};
|
||||
|
||||
int setAndGet(const unsigned int handleSet, const chtype dbrType, CTYPE valSet, CTYPE &valGet);
|
||||
int setAndMatch(const unsigned int handleSet, const chtype dbrType, CTYPE valSet, const unsigned int handleMatch,
|
||||
CTYPE tolerance, double timeout, bool printFlag);
|
||||
|
||||
int setAndMatchMany(vector<unsigned int> handleSetV, const chtype dbrType, vector<CTYPE> valSet, vector<unsigned int> handleMatch,
|
||||
CTYPE tolerance, double timeout, bool printFlag);
|
||||
|
||||
int setTriggerAndMatchMany(vector<unsigned int> handleSetV, const chtype dbrType, vector<CTYPE> valSet,
|
||||
vector<unsigned int> handleAction, vector<string> valAction, vector<unsigned int> handleMatch,
|
||||
CTYPE tolerance, double timeout, bool printFlag);
|
||||
CTYPE tolerance, double timeout, bool printFlag);
|
||||
|
||||
int matchMany( const chtype dbrType, vector<CTYPE> valSet, vector<unsigned int> handleMatch,
|
||||
CTYPE tolerance, double timeout, bool printFlag);
|
||||
int setAndMatchMany(std::vector<unsigned int> handleSetV, const chtype dbrType, std::vector<CTYPE> valSet, std::vector<unsigned int> handleMatch,
|
||||
CTYPE tolerance, double timeout, bool printFlag);
|
||||
|
||||
int match( const chtype dbrType, CTYPE valSet, unsigned int handleMatch,
|
||||
CTYPE tolerance, double timeout, bool printFlag);
|
||||
|
||||
int setMany(vector<unsigned int> handleSet, const chtype dbrType, vector<CTYPE> valSet, bool printFlag);
|
||||
|
||||
|
||||
|
||||
int compareAndMatchMany(vector<unsigned int> handleSet, const chtype dbrType, vector<CTYPE> valSet, vector<unsigned int> handleMatch,
|
||||
CTYPE tolerance, double timeout, bool printFlag);
|
||||
int setTriggerAndMatchMany(std::vector<unsigned int> handleSetV, const chtype dbrType, std::vector<CTYPE> valSet,
|
||||
std::vector<unsigned int> handleAction, std::vector<std::string> valAction, std::vector<unsigned int> handleMatch,
|
||||
CTYPE tolerance, double timeout, bool printFlag);
|
||||
|
||||
int matchMany( const chtype dbrType, std::vector<CTYPE> valSet, std::vector<unsigned int> handleMatch,
|
||||
CTYPE tolerance, double timeout, bool printFlag);
|
||||
|
||||
int match( const chtype dbrType, CTYPE valSet, unsigned int handleMatch,
|
||||
CTYPE tolerance, double timeout, bool printFlag);
|
||||
|
||||
int setMany(std::vector<unsigned int> handleSet, const chtype dbrType, std::vector<CTYPE> valSet, bool printFlag);
|
||||
|
||||
|
||||
|
||||
int setManyString(vector<unsigned int> handleSet, vector<string> valSet, bool printFlag) {
|
||||
int compareAndMatchMany(std::vector<unsigned int> handleSet, const chtype dbrType, std::vector<CTYPE> valSet, std::vector<unsigned int> handleMatch,
|
||||
CTYPE tolerance, double timeout, bool printFlag);
|
||||
|
||||
#define __METHOD__ "Instant<CTYPE>::setMany(vector<unsigned int>handleSet, chtype, vector<CTYPE>valSet)"
|
||||
|
||||
CAFEStatus cstat;
|
||||
|
||||
|
||||
status=ICAFE_NORMAL;
|
||||
|
||||
if (handleSet.size() != valSet.size() ) {
|
||||
return ECAFE_HANDLE_MISMATCH_SET_AND_MATCH;
|
||||
}
|
||||
|
||||
for (size_t i=0; i< handleSet.size(); ++i) {
|
||||
int setManyString(std::vector<unsigned int> handleSet, std::vector<std::string> valSet, bool printFlag)
|
||||
{
|
||||
|
||||
if (!helper.isChannelConnected(handleSet[i])) {
|
||||
cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << endl;
|
||||
cout << "NOT ALL CHANNELS CONNECTED: " << endl;
|
||||
if (!helper.isChannelConnected(handleSet[i])) {
|
||||
helper.printHandle(handleSet[i]);
|
||||
status=helper.getStatus(handleSet[i]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (status!=ICAFE_NORMAL) {return status;}
|
||||
|
||||
if(printFlag) {
|
||||
cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << endl;
|
||||
}
|
||||
|
||||
|
||||
if (printFlag) {
|
||||
|
||||
for (size_t i=0; i< handleSet.size(); ++i) {
|
||||
|
||||
cout << "SETTING PV=" << helper.getPVFromHandle(handleSet[i]) << " to " << valSet[i] << endl;
|
||||
|
||||
|
||||
} //for
|
||||
|
||||
} //if
|
||||
|
||||
|
||||
for (size_t i=0; i< handleSet.size(); ++i) {
|
||||
|
||||
|
||||
|
||||
//set No of Elements to 1
|
||||
#define __METHOD__ "Instant<CTYPE>::setMany(vector<unsigned int>handleSet, chtype, vector<CTYPE>valSet)"
|
||||
|
||||
unsigned int nelemPrevious, nelemRequestedCheck=0;
|
||||
unsigned int nelemRequested=1;
|
||||
|
||||
nelemPrevious=helper.getNelemClient(handleSet[i]);
|
||||
//Check the number of elements requested?
|
||||
if (nelemPrevious>1) {
|
||||
nelemRequestedCheck = helper.setNelem(handleSet[i],nelemRequested);
|
||||
if (nelemRequestedCheck != nelemRequested) {
|
||||
cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << endl;
|
||||
cout << "Internal CAFE FUNNY: Wanted to set the no. elements from: "
|
||||
<< nelemPrevious << endl;
|
||||
cout << "to: " << nelemRequested << " but got instead: "
|
||||
<< nelemRequestedCheck << endl;
|
||||
CAFEStatus cstat;
|
||||
|
||||
|
||||
status=ICAFE_NORMAL;
|
||||
|
||||
if (handleSet.size() != valSet.size() ) {
|
||||
return ECAFE_HANDLE_MISMATCH_SET_AND_MATCH;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//policy set synchronous
|
||||
ChannelRequestPolicy polPrevious, polNow;
|
||||
|
||||
policyHelper.getChannelRequestPolicyPut(handleSet[i], polPrevious);
|
||||
for (size_t i=0; i< handleSet.size(); ++i) {
|
||||
|
||||
polNow.setMethodKind(WITHOUT_CALLBACK);
|
||||
polNow.setWaitKind(WAIT);
|
||||
polNow.setWhenToFlushSendBuffer(FLUSH_AUTOMATIC);
|
||||
if (!helper.isChannelConnected(handleSet[i])) {
|
||||
std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl;
|
||||
std::cout << "NOT ALL CHANNELS CONNECTED: " << std::endl;
|
||||
if (!helper.isChannelConnected(handleSet[i])) {
|
||||
helper.printHandle(handleSet[i]);
|
||||
status=helper.getStatus(handleSet[i]);
|
||||
}
|
||||
}
|
||||
|
||||
policyHelper.setChannelRequestPolicyPut(handleSet[i], polNow);
|
||||
|
||||
dbr_string_t valSetA[1];
|
||||
|
||||
|
||||
helper.removeLeadingAndTrailingSpaces(valSet[i].c_str(), valSetA[0]);
|
||||
|
||||
|
||||
status=set(handleSet[i], DBR_STRING, valSetA);
|
||||
|
||||
if (status!=ICAFE_NORMAL) {
|
||||
cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << endl;
|
||||
cstat.report(status);
|
||||
}
|
||||
|
||||
policyHelper.setChannelRequestPolicyPut(handleSet[i], polPrevious);
|
||||
|
||||
|
||||
unsigned int nelemPreviousCheck=nelemPrevious;
|
||||
nelemRequested=1;
|
||||
//Switch back to previous value
|
||||
//if (nelemPrevious>1) {
|
||||
if(helper.getNelemRequest(handleSet[i])!= nelemPrevious) {
|
||||
nelemPreviousCheck= helper.setNelem(handleSet[i],nelemPrevious);
|
||||
if (nelemPreviousCheck != nelemPrevious) {
|
||||
cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << endl;
|
||||
cout << "Internal CAFE FUNNY: Wanted to re-set the no. elements from: "
|
||||
<< nelemRequested << endl;
|
||||
cout << "to the previous: " << nelemPrevious << " but got instead: "
|
||||
<< nelemPreviousCheck << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} //for size_t
|
||||
|
||||
return status;
|
||||
if (status!=ICAFE_NORMAL) {
|
||||
return status;
|
||||
}
|
||||
|
||||
if(printFlag) {
|
||||
std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl;
|
||||
}
|
||||
|
||||
|
||||
if (printFlag) {
|
||||
|
||||
for (size_t i=0; i< handleSet.size(); ++i) {
|
||||
|
||||
std::cout << "SETTING PV=" << helper.getPVFromHandle(handleSet[i]) << " to " << valSet[i] << std::endl;
|
||||
|
||||
|
||||
} //for
|
||||
|
||||
} //if
|
||||
|
||||
|
||||
for (size_t i=0; i< handleSet.size(); ++i) {
|
||||
|
||||
|
||||
|
||||
//set No of Elements to 1
|
||||
|
||||
unsigned int nelemPrevious, nelemRequestedCheck=0;
|
||||
unsigned int nelemRequested=1;
|
||||
|
||||
nelemPrevious=helper.getNelemClient(handleSet[i]);
|
||||
//Check the number of elements requested?
|
||||
if (nelemPrevious>1) {
|
||||
nelemRequestedCheck = helper.setNelem(handleSet[i],nelemRequested);
|
||||
if (nelemRequestedCheck != nelemRequested) {
|
||||
std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl;
|
||||
std::cout << "Internal CAFE FUNNY: Wanted to set the no. elements from: "
|
||||
<< nelemPrevious << std::endl;
|
||||
std::cout << "to: " << nelemRequested << " but got instead: "
|
||||
<< nelemRequestedCheck << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//policy set synchronous
|
||||
ChannelRequestPolicy polPrevious, polNow;
|
||||
|
||||
policyHelper.getChannelRequestPolicyPut(handleSet[i], polPrevious);
|
||||
|
||||
polNow.setMethodKind(WITHOUT_CALLBACK);
|
||||
polNow.setWaitKind(WAIT);
|
||||
polNow.setWhenToFlushSendBuffer(FLUSH_AUTOMATIC);
|
||||
|
||||
policyHelper.setChannelRequestPolicyPut(handleSet[i], polNow);
|
||||
|
||||
dbr_string_t valSetA[1];
|
||||
|
||||
|
||||
helper.removeLeadingAndTrailingSpaces(valSet[i].c_str(), valSetA[0]);
|
||||
|
||||
|
||||
status=set(handleSet[i], DBR_STRING, valSetA);
|
||||
|
||||
if (status!=ICAFE_NORMAL) {
|
||||
std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl;
|
||||
cstat.report(status);
|
||||
}
|
||||
|
||||
policyHelper.setChannelRequestPolicyPut(handleSet[i], polPrevious);
|
||||
|
||||
|
||||
unsigned int nelemPreviousCheck=nelemPrevious;
|
||||
nelemRequested=1;
|
||||
//Switch back to previous value
|
||||
//if (nelemPrevious>1) {
|
||||
if(helper.getNelemRequest(handleSet[i])!= nelemPrevious) {
|
||||
nelemPreviousCheck= helper.setNelem(handleSet[i],nelemPrevious);
|
||||
if (nelemPreviousCheck != nelemPrevious) {
|
||||
std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl;
|
||||
std::cout << "Internal CAFE FUNNY: Wanted to re-set the no. elements from: "
|
||||
<< nelemRequested << std::endl;
|
||||
std::cout << "to the previous: " << nelemPrevious << " but got instead: "
|
||||
<< nelemPreviousCheck << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} //for size_t
|
||||
|
||||
return status;
|
||||
#undef __METHOD__
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief Set followed by an immediate get
|
||||
* \param handleSet input: handle
|
||||
* \param valSet input: string value to set
|
||||
* \param valGet output: string value to get
|
||||
* \return ECA_NORMAL if all OK else first ECAFE error encountered, else ICAFE_SET_AND_GET_MISMATCH;
|
||||
*/
|
||||
int setAndGetString(const unsigned int handleSet, string valSet, string &valGet) {
|
||||
#define __METHOD__ "Instant<CTYPE>::setAndGetString(const unsigned int handleSet, string valSet, string &valGet"
|
||||
/**
|
||||
* \brief Set followed by an immediate get
|
||||
* \param handleSet input: handle
|
||||
* \param valSet input: string value to set
|
||||
* \param valGet output: string value to get
|
||||
* \return ECA_NORMAL if all OK else first ECAFE error encountered, else ICAFE_SET_AND_GET_MISMATCH;
|
||||
*/
|
||||
int setAndGetString(const unsigned int handleSet, std::string valSet, std::string &valGet)
|
||||
{
|
||||
#define __METHOD__ "Instant<CTYPE>::setAndGetString(const unsigned int handleSet, std::string valSet, std::string &valGet"
|
||||
//CheckPolicy
|
||||
|
||||
dbr_string_t valGetA[1]; dbr_string_t valSetA[1];
|
||||
dbr_string_t valGetA[1];
|
||||
dbr_string_t valSetA[1];
|
||||
|
||||
strcpy(valGetA[0],"0");
|
||||
valGet="0";
|
||||
|
||||
|
||||
helper.removeLeadingAndTrailingSpaces(valSet.c_str(), valSetA[0]);
|
||||
|
||||
|
||||
status=Instant::set(handleSet, DBR_STRING, valSetA);
|
||||
if (status==ICAFE_NORMAL) {
|
||||
status=Instant::get(handleSet, DBR_STRING, valGetA);
|
||||
@@ -279,66 +296,70 @@ return status;
|
||||
return ICAFE_NORMAL;
|
||||
}
|
||||
|
||||
//Check if number
|
||||
istringstream ins, ous;
|
||||
double oud=0;
|
||||
//Check if number
|
||||
std::istringstream ins, ous;
|
||||
double oud=0;
|
||||
ous.clear();
|
||||
ous.str(valGetA[0]);
|
||||
ous>>oud;
|
||||
double ind=0;
|
||||
double ind=0;
|
||||
ins.clear();
|
||||
ins.str(valSetA[0]);
|
||||
ins>>ind;
|
||||
|
||||
|
||||
if ( !ous.fail() && !ins.fail()) {
|
||||
if (ind==oud) {return ICAFE_NORMAL;}
|
||||
if (ind==oud) {
|
||||
return ICAFE_NORMAL;
|
||||
}
|
||||
}
|
||||
//Cater for enums that are refered to by their integer values in string format
|
||||
else if (!ins.fail()) {
|
||||
short enumval=-1;
|
||||
|
||||
enumval=helper.getEnumFromString(handleSet, valGet);
|
||||
|
||||
//Convert integer to string
|
||||
|
||||
stringstream ss;
|
||||
ss << enumval;
|
||||
valGet= ss.str();
|
||||
if ((short)ind==enumval) {
|
||||
return ICAFE_NORMAL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << endl;
|
||||
cout << "Process Variable = " << helper.getPVFromHandle(handleSet) << endl;
|
||||
cout << "Set Value: " << valSetA[0] << " Get Value: " << valGet.c_str() << endl;
|
||||
//Cater for enums that are refered to by their integer values in string format
|
||||
else if (!ins.fail()) {
|
||||
short enumval=-1;
|
||||
|
||||
enumval=helper.getEnumFromString(handleSet, valGet);
|
||||
|
||||
//Convert integer to string
|
||||
|
||||
std::stringstream ss;
|
||||
ss << enumval;
|
||||
valGet= ss.str();
|
||||
if ((short)ind==enumval) {
|
||||
return ICAFE_NORMAL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl;
|
||||
std::cout << "Process Variable = " << helper.getPVFromHandle(handleSet) << std::endl;
|
||||
std::cout << "Set Value: " << valSetA[0] << " Get Value: " << valGet.c_str() << std::endl;
|
||||
return ICAFE_SET_AND_GET_MISMATCH;
|
||||
#undef __METHOD__
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* \brief Set followed by an immediate get
|
||||
* \param handleSet input: handle
|
||||
* \param valSet input: dbr_string_t value to set
|
||||
* \param valGet output: dbr_string_t value to get
|
||||
* \return ECA_NORMAL if all OK else first ECAFE error encountered, else ICAFE_SET_AND_GET_MISMATCH;
|
||||
*/
|
||||
int setAndGetDbrString(const unsigned int handleSet, dbr_string_t valSet, dbr_string_t &valGet) {
|
||||
|
||||
/**
|
||||
* \brief Set followed by an immediate get
|
||||
* \param handleSet input: handle
|
||||
* \param valSet input: dbr_string_t value to set
|
||||
* \param valGet output: dbr_string_t value to get
|
||||
* \return ECA_NORMAL if all OK else first ECAFE error encountered, else ICAFE_SET_AND_GET_MISMATCH;
|
||||
*/
|
||||
int setAndGetDbrString(const unsigned int handleSet, dbr_string_t valSet, dbr_string_t &valGet)
|
||||
{
|
||||
#define __METHOD__ "Instant<CTYPE>::setAndGetDbrString(const unsigned int handleSet, dbr_string_tvalSet, dbr_string_t &valGet"
|
||||
//CheckPolicy
|
||||
|
||||
dbr_string_t valGetA[1]; dbr_string_t valSetA[1];
|
||||
dbr_string_t valGetA[1];
|
||||
dbr_string_t valSetA[1];
|
||||
|
||||
strcpy(valGetA[0],"0");
|
||||
strcpy(valGet,"0");
|
||||
|
||||
helper.removeLeadingAndTrailingSpaces(valSet, valSetA[0]);
|
||||
|
||||
|
||||
helper.removeLeadingAndTrailingSpaces(valSet, valSetA[0]);
|
||||
|
||||
status=Instant::set(handleSet, DBR_STRING, valSetA);
|
||||
if (status==ICAFE_NORMAL) {
|
||||
status=Instant::get(handleSet, DBR_STRING, valGetA);
|
||||
@@ -353,48 +374,50 @@ return status;
|
||||
return ICAFE_NORMAL;
|
||||
}
|
||||
|
||||
//Check if number
|
||||
//Check if number
|
||||
istringstream ins, ous;
|
||||
double oud=0;
|
||||
//Check if number
|
||||
//Check if number
|
||||
std::istringstream ins, ous;
|
||||
double oud=0;
|
||||
ous.clear();
|
||||
ous.str(valGetA[0]);
|
||||
ous>>oud;
|
||||
double ind=0;
|
||||
double ind=0;
|
||||
ins.clear();
|
||||
ins.str(valSetA[0]);
|
||||
ins>>ind;
|
||||
|
||||
if ( !ous.fail() && !ins.fail()) {
|
||||
if (ind==oud) {return ICAFE_NORMAL;}
|
||||
if (ind==oud) {
|
||||
return ICAFE_NORMAL;
|
||||
}
|
||||
}
|
||||
//Cater for enums that are refered to by their integer values in string format
|
||||
else if (!ins.fail()) {
|
||||
short enumval=-1;
|
||||
|
||||
enumval=helper.getEnumFromString(handleSet, valGet);
|
||||
|
||||
//Convert integer to string
|
||||
stringstream ss;
|
||||
ss << enumval;
|
||||
strcpy(valGet, ss.str().c_str());
|
||||
|
||||
if ((short) ind==enumval) {
|
||||
return ICAFE_NORMAL;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//Cater for enums that are refered to by their integer values in string format
|
||||
else if (!ins.fail()) {
|
||||
short enumval=-1;
|
||||
|
||||
cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << endl;
|
||||
cout << "Process Variable = " << helper.getPVFromHandle(handleSet) << endl;
|
||||
cout << "Set Value: " << valSetA[0] << " Get Value: " << valGet << endl;
|
||||
enumval=helper.getEnumFromString(handleSet, valGet);
|
||||
|
||||
//Convert integer to string
|
||||
std::stringstream ss;
|
||||
ss << enumval;
|
||||
strcpy(valGet, ss.str().c_str());
|
||||
|
||||
if ((short) ind==enumval) {
|
||||
return ICAFE_NORMAL;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl;
|
||||
std::cout << "Process Variable = " << helper.getPVFromHandle(handleSet) << std::endl;
|
||||
std::cout << "Set Value: " << valSetA[0] << " Get Value: " << valGet << std::endl;
|
||||
return ICAFE_SET_AND_GET_MISMATCH;
|
||||
#undef __METHOD__
|
||||
|
||||
};
|
||||
|
||||
|
||||
};
|
||||
|
||||
#include "instant.cpp"
|
||||
|
||||
@@ -32,11 +32,10 @@ public:
|
||||
bool characters (const QString& ch);
|
||||
|
||||
std::vector<deviceCollection> deviceCollectionV;
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
enum
|
||||
{
|
||||
enum {
|
||||
NotWaiting,
|
||||
WaitingForDescription,
|
||||
WaitingForDevice,
|
||||
@@ -44,8 +43,8 @@ private:
|
||||
} state;
|
||||
|
||||
deviceCollection devCollection;
|
||||
collectionMember cMember;
|
||||
|
||||
collectionMember cMember;
|
||||
|
||||
std::string attributeName;
|
||||
static const QString& tagConfig;
|
||||
static const QString& tagGroup;
|
||||
|
||||
@@ -18,28 +18,27 @@
|
||||
|
||||
class loadGroupXMLParser : public QXmlDefaultHandler {
|
||||
public:
|
||||
loadGroupXMLParser();
|
||||
virtual ~loadGroupXMLParser();
|
||||
loadGroupXMLParser();
|
||||
virtual ~loadGroupXMLParser();
|
||||
bool startElement(const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts);
|
||||
bool endElement(const QString& namespaceURI, const QString& localName, const QString& qName);
|
||||
bool characters(const QString& ch);
|
||||
|
||||
std::vector<deviceGroup> groups;
|
||||
private:
|
||||
enum
|
||||
{
|
||||
NotWaiting,
|
||||
WaitingForDescription,
|
||||
WaitingForStatusGroup,
|
||||
enum {
|
||||
NotWaiting,
|
||||
WaitingForDescription,
|
||||
WaitingForStatusGroup,
|
||||
WaitingForMember,
|
||||
WaitingForName,
|
||||
WaitingForNelem,
|
||||
WaitingForStatus,
|
||||
WaitingForRule,
|
||||
WaitingForDataType,
|
||||
WaitingForId,
|
||||
WaitingForAttrib,
|
||||
WaitingForCollectiveType
|
||||
WaitingForName,
|
||||
WaitingForNelem,
|
||||
WaitingForStatus,
|
||||
WaitingForRule,
|
||||
WaitingForDataType,
|
||||
WaitingForId,
|
||||
WaitingForAttrib,
|
||||
WaitingForCollectiveType
|
||||
} state;
|
||||
deviceGroup group;
|
||||
//collectionMember member;
|
||||
|
||||
@@ -34,7 +34,7 @@ PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = x86_64-unknown-linux-gnu
|
||||
host_triplet = x86_64-unknown-linux-gnu
|
||||
#am__append_1 = PyCafe_api.h
|
||||
am__append_1 = PyCafe_api.h
|
||||
#am__append_2 = PyCafe.h
|
||||
subdir = include
|
||||
DIST_COMMON = $(am__include_HEADERS_DIST) $(srcdir)/makefile.am \
|
||||
@@ -61,7 +61,7 @@ am__include_HEADERS_DIST = cafe.h cafeCache.h cafeConvert.h \
|
||||
methodCallbacks.h policies.h policyHelper.h PVCtrlHolder.h \
|
||||
PVDataHolder.h PVGroup.h PVHolder.h statusCodes.h transpose.h \
|
||||
conduitGroup.h hashConduitGroup.h restorePVGroupXMLParser.h \
|
||||
PyCafe_api.h PyCafe.h
|
||||
tmDateMap.h PyCafe_api.h PyCafe.h
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
@@ -90,21 +90,21 @@ CTAGS = ctags
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = ${SHELL} /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/missing --run aclocal-1.11
|
||||
AMTAR = ${SHELL} /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/missing --run tar
|
||||
AM_CPPFLAGS = -fexceptions -fPIC -I/usr/local/epics/base/include/ -I/usr/local/epics/base/include/os/Linux -I/opt/gfa/cafe/boost/boost_1_61_0/include/boost -I/opt/gfa/cafe/boost/boost_1_61_0/include -I/usr/include/QtCore -I/usr/include/QtXml
|
||||
AM_LDFLAGS = -L/usr/local/epics/base/lib/SL6-x86_64 -Wl,-rpath,/usr/local/epics/base/lib/SL6-x86_64 -L/usr/lib64 -Wl,-rpath,/usr/lib64
|
||||
AM_CPPFLAGS = -fexceptions -fPIC -Wno-deprecated -I/usr/local/epics/base/include/ -I/usr/local/epics/base/include/os/Linux -I/opt/gfa/cafe/boost/boost_1_61_0/include/boost -I/opt/gfa/cafe/boost/boost_1_61_0/include -I/usr/include/QtCore -I/usr/include/QtXml -I/opt/gfa/python-3.5/latest/include/python3.5m
|
||||
AM_LDFLAGS = -L/usr/local/epics/base/lib/SL6-x86_64 -Wl,-rpath,/usr/local/epics/base/lib/SL6-x86_64 -L/usr/lib64 -Wl,-rpath,/usr/lib64 -L/opt/gfa/python-3.5/latest/lib -Wl,-rpath,/opt/gfa/python-3.5/latest/lib
|
||||
AR = ar
|
||||
AUTOCONF = ${SHELL} /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/missing --run autoconf
|
||||
AUTOHEADER = ${SHELL} /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/missing --run autoheader
|
||||
AUTOMAKE = ${SHELL} /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/missing --run automake-1.11
|
||||
AWK = gawk
|
||||
CAFE_CPPFLAGS = -I$(top_srcdir)/include
|
||||
CC = gcc
|
||||
CC = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/6.3.0/bin/gcc
|
||||
CCDEPMODE = depmode=gcc3
|
||||
CFLAGS = -g -O2
|
||||
CPP = gcc -E
|
||||
CPPFLAGS = -fexceptions -fPIC -I/usr/local/epics/base/include/ -I/usr/local/epics/base/include/os/Linux -I/opt/gfa/cafe/boost/boost_1_61_0/include/boost -I/opt/gfa/cafe/boost/boost_1_61_0/include -I/usr/include/QtCore -I/usr/include/QtXml
|
||||
CXX = g++
|
||||
CXXCPP = g++ -E
|
||||
CPP = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/6.3.0/bin/gcc -E
|
||||
CPPFLAGS = -fexceptions -fPIC -Wno-deprecated -I/usr/local/epics/base/include/ -I/usr/local/epics/base/include/os/Linux -I/opt/gfa/cafe/boost/boost_1_61_0/include/boost -I/opt/gfa/cafe/boost/boost_1_61_0/include -I/usr/include/QtCore -I/usr/include/QtXml -I/opt/gfa/python-3.5/latest/include/python3.5m
|
||||
CXX = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/6.3.0/bin/g++
|
||||
CXXCPP = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/6.3.0/bin/g++ -E
|
||||
CXXDEPMODE = depmode=gcc3
|
||||
CXXFLAGS = -g -O2
|
||||
CYGPATH_W = echo
|
||||
@@ -125,9 +125,9 @@ INSTALL_PROGRAM = ${INSTALL}
|
||||
INSTALL_SCRIPT = ${INSTALL}
|
||||
INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
|
||||
LD = /usr/bin/ld -m elf_x86_64
|
||||
LDFLAGS = -L/usr/local/epics/base/lib/SL6-x86_64 -Wl,-rpath,/usr/local/epics/base/lib/SL6-x86_64 -L/usr/lib64 -Wl,-rpath,/usr/lib64
|
||||
LDFLAGS = -L/usr/local/epics/base/lib/SL6-x86_64 -Wl,-rpath,/usr/local/epics/base/lib/SL6-x86_64 -L/usr/lib64 -Wl,-rpath,/usr/lib64 -L/opt/gfa/python-3.5/latest/lib -Wl,-rpath,/opt/gfa/python-3.5/latest/lib
|
||||
LIBOBJS =
|
||||
LIBS = -lQtXml -lQtCore
|
||||
LIBS = -lpython3.5m -lQtXml -lQtCore
|
||||
LIBTOOL = $(SHELL) $(top_builddir)/libtool
|
||||
LIPO =
|
||||
LN_S = ln -s
|
||||
@@ -143,22 +143,22 @@ OTOOL64 =
|
||||
PACKAGE = cafe
|
||||
PACKAGE_BUGREPORT = Bug reports to: jan.chrin@psi.ch
|
||||
PACKAGE_NAME = CAFE
|
||||
PACKAGE_STRING = CAFE 1.0.0
|
||||
PACKAGE_STRING = CAFE 1.8.0
|
||||
PACKAGE_TARNAME = cafe
|
||||
PACKAGE_VERSION = 1.0.0
|
||||
PACKAGE_VERSION = 1.8.0
|
||||
PATH_SEPARATOR = :
|
||||
RANLIB = ranlib
|
||||
SED = /bin/sed
|
||||
SET_MAKE =
|
||||
SHELL = /bin/sh
|
||||
STRIP = strip
|
||||
VERSION = 1.0.0
|
||||
VERSION = 1.8.0
|
||||
abs_builddir = /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/include
|
||||
abs_srcdir = /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/include
|
||||
abs_top_builddir = /afs/psi.ch/project/cafe/gitlab/CAFE/cpp
|
||||
abs_top_srcdir = /afs/psi.ch/project/cafe/gitlab/CAFE/cpp
|
||||
ac_ct_CC = gcc
|
||||
ac_ct_CXX = g++
|
||||
ac_ct_CC = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/6.3.0/bin/gcc
|
||||
ac_ct_CXX =
|
||||
ac_ct_DUMPBIN =
|
||||
am__include = include
|
||||
am__leading_dot = .
|
||||
@@ -186,7 +186,7 @@ htmldir = ${docdir}
|
||||
includedir = ${prefix}/include
|
||||
infodir = ${datarootdir}/info
|
||||
install_sh = ${SHELL} /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/install-sh
|
||||
libdir = /opt/gfa/cafe/cpp/cafe-1.5.0-final-2/lib
|
||||
libdir = /opt/gfa/cafe/python/python-3.5/pycafe-1.8.0/lib
|
||||
libexecdir = ${exec_prefix}/libexec
|
||||
localedir = ${datarootdir}/locale
|
||||
localstatedir = ${prefix}/var
|
||||
@@ -195,7 +195,7 @@ mandir = ${datarootdir}/man
|
||||
mkdir_p = /bin/mkdir -p
|
||||
oldincludedir = /usr/include
|
||||
pdfdir = ${docdir}
|
||||
prefix = /opt/gfa/cafe/cpp/cafe-1.5.0-final-2
|
||||
prefix = /opt/gfa/cafe/python/python-3.5/pycafe-1.8.0
|
||||
program_transform_name = s,x,x,
|
||||
psdir = ${docdir}
|
||||
sbindir = ${exec_prefix}/sbin
|
||||
@@ -217,7 +217,7 @@ include_HEADERS = cafe.h cafeCache.h cafeConvert.h cafeDataType.h \
|
||||
methodCallbacks.h policies.h policyHelper.h PVCtrlHolder.h \
|
||||
PVDataHolder.h PVGroup.h PVHolder.h statusCodes.h transpose.h \
|
||||
conduitGroup.h hashConduitGroup.h restorePVGroupXMLParser.h \
|
||||
$(am__append_1) $(am__append_2)
|
||||
tmDateMap.h $(am__append_1) $(am__append_2)
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
|
||||
@@ -10,7 +10,7 @@ include_HEADERS = cafe.h cafeCache.h cafeConvert.h cafeDataType.h cafeDataTypeHe
|
||||
enumStrings.h granules.h handleHelper.h hashConduit.h helper.h instant.h instant.cpp \
|
||||
loadCollectionXMLParser.h loadGroupXMLParser.h methodCallbacks.h policies.h policyHelper.h \
|
||||
PVCtrlHolder.h PVDataHolder.h PVGroup.h PVHolder.h statusCodes.h transpose.h \
|
||||
conduitGroup.h hashConduitGroup.h restorePVGroupXMLParser.h
|
||||
conduitGroup.h hashConduitGroup.h restorePVGroupXMLParser.h tmDateMap.h
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -11,15 +11,18 @@
|
||||
#include <config.h>
|
||||
|
||||
namespace CALLBACK_CAFE {
|
||||
#if HAVE_PYTHON_H
|
||||
void PyHandlerPut( struct event_handler_args args);
|
||||
void PyHandlerGet( struct event_handler_args args);
|
||||
#endif
|
||||
void handlerPut( struct event_handler_args args) ;
|
||||
void handlerGet( struct event_handler_args args) ;
|
||||
void handlerGetCtrl( struct event_handler_args args) ;
|
||||
void handlerGetSTSACK( struct event_handler_args args) ;
|
||||
void handlerGetClassName( struct event_handler_args args) ;
|
||||
#if HAVE_PYTHON_H
|
||||
void PyHandlerPut( struct event_handler_args args);
|
||||
void PyHandlerGet( struct event_handler_args args);
|
||||
#endif
|
||||
void handlerPulseID( struct event_handler_args args) ;
|
||||
void handlerPut( struct event_handler_args args) ;
|
||||
void handlerGet( struct event_handler_args args) ;
|
||||
void handlerGetCtrl( struct event_handler_args args) ;
|
||||
void handlerGetSTSACK( struct event_handler_args args) ;
|
||||
void handlerGetClassName( struct event_handler_args args) ;
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif // METHODCALLBACKS_H
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -15,43 +15,54 @@
|
||||
#include "hashConduitGroup.h"
|
||||
#include "conduitFriends.h"
|
||||
|
||||
class PolicyHelper : Helper
|
||||
{
|
||||
class PolicyHelper : Helper {
|
||||
private:
|
||||
CAFEStatus cafeStatus;
|
||||
cafeConduit_set::iterator itcs;
|
||||
cafeGroup_set::iterator itgs;
|
||||
cafeGroup_set::iterator itgs;
|
||||
public:
|
||||
PolicyHelper(){};
|
||||
~PolicyHelper(){};
|
||||
PolicyHelper() {};
|
||||
~PolicyHelper() {};
|
||||
|
||||
int getChannelGetActionWhenMonitorPolicy(unsigned int _handle, ChannelGetActionWhenMonitorPolicy & awmp);
|
||||
int setChannelGetActionWhenMonitorPolicy(unsigned int _handle, ChannelGetActionWhenMonitorPolicy awmp);
|
||||
int setChannelGetActionWhenMonitorPolicy(ChannelGetActionWhenMonitorPolicy awmp);
|
||||
int setChannelGetActionWhenMonitorPolicyAllHandles(ChannelGetActionWhenMonitorPolicy awmp){
|
||||
return setChannelGetActionWhenMonitorPolicy(awmp);}
|
||||
int getChannelGetActionWhenMonitorPolicy(unsigned int _handle, ChannelGetActionWhenMonitorPolicy & awmp);
|
||||
int setChannelGetActionWhenMonitorPolicy(unsigned int _handle, ChannelGetActionWhenMonitorPolicy awmp);
|
||||
int setChannelGetActionWhenMonitorPolicy(ChannelGetActionWhenMonitorPolicy awmp);
|
||||
int setChannelGetActionWhenMonitorPolicyAllHandles(ChannelGetActionWhenMonitorPolicy awmp)
|
||||
{
|
||||
return setChannelGetActionWhenMonitorPolicy(awmp);
|
||||
}
|
||||
|
||||
int getChannelGetCacheWaitPolicy(unsigned int _handle, ChannelGetCacheWaitPolicy & cwp);
|
||||
int setChannelGetCacheWaitPolicy(unsigned int _handle, ChannelGetCacheWaitPolicy cwp);
|
||||
int setChannelGetCacheWaitPolicy(ChannelGetCacheWaitPolicy cwp);
|
||||
int setChannelGetCacheWaitPolicyAllHandles(ChannelGetCacheWaitPolicy cwp){
|
||||
return setChannelGetCacheWaitPolicy(cwp);}
|
||||
int getChannelGetCacheWaitPolicy(unsigned int _handle, ChannelGetCacheWaitPolicy & cwp);
|
||||
int setChannelGetCacheWaitPolicy(unsigned int _handle, ChannelGetCacheWaitPolicy cwp);
|
||||
int setChannelGetCacheWaitPolicy(ChannelGetCacheWaitPolicy cwp);
|
||||
int setChannelGetCacheWaitPolicyAllHandles(ChannelGetCacheWaitPolicy cwp)
|
||||
{
|
||||
return setChannelGetCacheWaitPolicy(cwp);
|
||||
}
|
||||
|
||||
int getChannelRequestDataTypePolicy(unsigned int _handle, ChannelRequestDataTypePolicy &crdtp);
|
||||
int setChannelRequestDataTypePolicy(unsigned int _handle, ChannelRequestDataTypePolicy crdtp);
|
||||
int setChannelRequestDataTypePolicy(ChannelRequestDataTypePolicy crdtp);
|
||||
int setChannelRequestDataTypePolicyAllHandles(ChannelRequestDataTypePolicy crdtp){
|
||||
return setChannelRequestDataTypePolicy(crdtp);}
|
||||
int setChannelRequestDataTypePolicyAllHandles(ChannelRequestDataTypePolicy crdtp)
|
||||
{
|
||||
return setChannelRequestDataTypePolicy(crdtp);
|
||||
}
|
||||
|
||||
int getChannelRequestPolicyGet (unsigned int _handle, ChannelRequestPolicy & crpg);
|
||||
int setChannelRequestPolicyGet (unsigned int _handle, ChannelRequestPolicy crpg);
|
||||
int setChannelRequestPolicyGet (ChannelRequestPolicy crpg);
|
||||
int setChannelRequestPolicyGetAllHandles (ChannelRequestPolicy crpg) {return setChannelRequestPolicyGet (crpg);}
|
||||
|
||||
int setChannelRequestPolicyGetAllHandles (ChannelRequestPolicy crpg)
|
||||
{
|
||||
return setChannelRequestPolicyGet (crpg);
|
||||
}
|
||||
|
||||
int getChannelRequestPolicyPut (unsigned int _handle, ChannelRequestPolicy & crpp);
|
||||
int setChannelRequestPolicyPut (unsigned int _handle, ChannelRequestPolicy crpp);
|
||||
int setChannelRequestPolicyPut (ChannelRequestPolicy crpp);
|
||||
int setChannelRequestPolicyPutAllHandles (ChannelRequestPolicy crpp) {return setChannelRequestPolicyPut (crpp);}
|
||||
int setChannelRequestPolicyPutAllHandles (ChannelRequestPolicy crpp)
|
||||
{
|
||||
return setChannelRequestPolicyPut (crpp);
|
||||
}
|
||||
|
||||
int getChannelTimeoutPolicyGet (unsigned int _handle, ChannelTimeoutPolicy & ctpg);
|
||||
int setChannelTimeoutPolicyGet (unsigned int _handle, ChannelTimeoutPolicy ctpg);
|
||||
@@ -60,24 +71,35 @@ public:
|
||||
int setChannelTimeoutPolicyPut (unsigned int _handle, ChannelTimeoutPolicy ctpp);
|
||||
|
||||
|
||||
int setSelfGoverningTimeout(bool b);
|
||||
int setSelfGoverningTimeout(unsigned int _handle, bool b);
|
||||
int setSelfGoverningTimeoutPut(unsigned int _handle, bool p);
|
||||
int setSelfGoverningTimeoutGet(unsigned int _handle, bool g);
|
||||
int getSelfGoverningTimeout(unsigned int _handle, bool &p, bool &g);
|
||||
int setSelfGoverningTimeout(bool b);
|
||||
int setSelfGoverningTimeout(unsigned int _handle, bool b);
|
||||
int setSelfGoverningTimeoutPut(unsigned int _handle, bool p);
|
||||
int setSelfGoverningTimeoutGet(unsigned int _handle, bool g);
|
||||
int getSelfGoverningTimeout(unsigned int _handle, bool &p, bool &g);
|
||||
|
||||
int setSGSelfGoverningTimeout(bool b);
|
||||
int setSGSelfGoverningTimeout(unsigned int _handle, bool b);
|
||||
int setSGSelfGoverningTimeoutPut(unsigned int _handle, bool p);
|
||||
int setSGSelfGoverningTimeoutGet(unsigned int _handle, bool g);
|
||||
int getSGSelfGoverningTimeout(unsigned int _handle, bool &p, bool &g);
|
||||
int setSGSelfGoverningTimeout(bool b);
|
||||
int setSGSelfGoverningTimeout(unsigned int _handle, bool b);
|
||||
int setSGSelfGoverningTimeoutPut(unsigned int _handle, bool p);
|
||||
int setSGSelfGoverningTimeoutGet(unsigned int _handle, bool g);
|
||||
int getSGSelfGoverningTimeout(unsigned int _handle, bool &p, bool &g);
|
||||
|
||||
//Short cuts
|
||||
//put, get, put, get
|
||||
int getTimeoutRange (double &p, double &p2, double &g, double &g2) { int stp; int stg;
|
||||
stp=getTimeoutMin(p,g); stg=getTimeoutMax(p2, g2);
|
||||
if (stp!=ICAFE_NORMAL){return stp;} else if(stg!=ICAFE_NORMAL){return stg;}
|
||||
else {return ICAFE_NORMAL;}
|
||||
int getTimeoutRange (double &p, double &p2, double &g, double &g2)
|
||||
{
|
||||
int stp;
|
||||
int stg;
|
||||
stp=getTimeoutMin(p,g);
|
||||
stg=getTimeoutMax(p2, g2);
|
||||
if (stp!=ICAFE_NORMAL) {
|
||||
return stp;
|
||||
}
|
||||
else if(stg!=ICAFE_NORMAL) {
|
||||
return stg;
|
||||
}
|
||||
else {
|
||||
return ICAFE_NORMAL;
|
||||
}
|
||||
};
|
||||
|
||||
int getTimeoutMin (double &p, double &g);
|
||||
@@ -85,59 +107,136 @@ public:
|
||||
|
||||
int getTimeout (unsigned int _handle, double &p, double &g);
|
||||
//returns lesser of the two
|
||||
int getTimeout (unsigned int _handle, double &pg) {double p; double g; int st;
|
||||
st=getTimeout(_handle, p, g); pg=std::min(p,g); return st;}
|
||||
int getTimeoutPut(unsigned int _handle, double &p) {double g; return getTimeout(_handle, p, g);}
|
||||
int getTimeoutGet(unsigned int _handle, double &g) {double p; return getTimeout(_handle, p, g);}
|
||||
int getTimeout (unsigned int _handle, double &pg)
|
||||
{
|
||||
double p;
|
||||
double g;
|
||||
int st;
|
||||
st=getTimeout(_handle, p, g);
|
||||
pg=std::min(p,g);
|
||||
return st;
|
||||
}
|
||||
int getTimeoutPut(unsigned int _handle, double &p)
|
||||
{
|
||||
double g;
|
||||
return getTimeout(_handle, p, g);
|
||||
}
|
||||
int getTimeoutGet(unsigned int _handle, double &g)
|
||||
{
|
||||
double p;
|
||||
return getTimeout(_handle, p, g);
|
||||
}
|
||||
|
||||
int printTimeout ();
|
||||
int printTimeout (unsigned int _handle);
|
||||
|
||||
int setTimeout (double p, double g); // for all handles put and get separately
|
||||
int setTimeout (double pg){return setTimeout(pg, pg);};
|
||||
int setTimeoutPut(double p) {return setTimeout(p, (double) NULL);};
|
||||
int setTimeoutGet(double g) {return setTimeout((double) NULL, g);};
|
||||
int setTimeout (double pg)
|
||||
{
|
||||
return setTimeout(pg, pg);
|
||||
};
|
||||
int setTimeoutPut(double p)
|
||||
{
|
||||
return setTimeout(p, (double) NULL);
|
||||
};
|
||||
int setTimeoutGet(double g)
|
||||
{
|
||||
return setTimeout((double) NULL, g);
|
||||
};
|
||||
|
||||
int setTimeout (unsigned int _handle, double p, double g);
|
||||
int setTimeout (unsigned int _handle, double pg){return setTimeout(_handle, pg, pg); };
|
||||
int setTimeoutPut(unsigned int _handle, double p) {return setTimeout(_handle, p, (double) NULL);};
|
||||
int setTimeoutGet(unsigned int _handle, double g) {return setTimeout(_handle, (double) NULL, g);};
|
||||
int setTimeoutToDefault(unsigned int _handle);
|
||||
int setTimeoutToDefault();
|
||||
|
||||
//get SGTimeout
|
||||
int getSGTimeoutRange (double &p, double &p2, double &g, double &g2) { int stp; int stg;
|
||||
stp=getSGTimeoutMin(p,g); stg=getSGTimeoutMax(p2, g2);
|
||||
if (stp!=ICAFE_NORMAL){return stp;} else if(stg!=ICAFE_NORMAL){return stg;}
|
||||
else {return ICAFE_NORMAL;}
|
||||
int setTimeout (unsigned int _handle, double pg)
|
||||
{
|
||||
return setTimeout(_handle, pg, pg);
|
||||
};
|
||||
|
||||
int getSGTimeoutMin (double &p, double &g);
|
||||
int getSGTimeoutMax (double &p, double &g);
|
||||
int printSGTimeout ();
|
||||
int printSGTimeout (unsigned int _handle);
|
||||
|
||||
|
||||
int setTimeoutPut(unsigned int _handle, double p)
|
||||
{
|
||||
return setTimeout(_handle, p, (double) NULL);
|
||||
};
|
||||
int setTimeoutGet(unsigned int _handle, double g)
|
||||
{
|
||||
return setTimeout(_handle, (double) NULL, g);
|
||||
};
|
||||
int setTimeoutToDefault(unsigned int _handle);
|
||||
int setTimeoutToDefault();
|
||||
|
||||
//get SGTimeout
|
||||
int getSGTimeoutRange (double &p, double &p2, double &g, double &g2)
|
||||
{
|
||||
int stp;
|
||||
int stg;
|
||||
stp=getSGTimeoutMin(p,g);
|
||||
stg=getSGTimeoutMax(p2, g2);
|
||||
if (stp!=ICAFE_NORMAL) {
|
||||
return stp;
|
||||
}
|
||||
else if(stg!=ICAFE_NORMAL) {
|
||||
return stg;
|
||||
}
|
||||
else {
|
||||
return ICAFE_NORMAL;
|
||||
}
|
||||
};
|
||||
|
||||
int getSGTimeoutMin (double &p, double &g);
|
||||
int getSGTimeoutMax (double &p, double &g);
|
||||
int printSGTimeout ();
|
||||
int printSGTimeout (unsigned int _handle);
|
||||
|
||||
|
||||
int getSGTimeout (unsigned int _handle, double &p, double &g);
|
||||
//returns lesser of the two
|
||||
int getSGTimeout (unsigned int _handle, double &pg) {double p; double g; int st;
|
||||
st=getSGTimeout(_handle, p, g); pg=std::min(p,g); return st;}
|
||||
int getSGTimeoutPut(unsigned int _handle, double &p) {double g; return getSGTimeout(_handle, p, g);}
|
||||
int getSGTimeoutGet(unsigned int _handle, double &g) {double p; return getSGTimeout(_handle, p, g);}
|
||||
int getSGTimeout (unsigned int _handle, double &pg)
|
||||
{
|
||||
double p;
|
||||
double g;
|
||||
int st;
|
||||
st=getSGTimeout(_handle, p, g);
|
||||
pg=std::min(p,g);
|
||||
return st;
|
||||
}
|
||||
int getSGTimeoutPut(unsigned int _handle, double &p)
|
||||
{
|
||||
double g;
|
||||
return getSGTimeout(_handle, p, g);
|
||||
}
|
||||
int getSGTimeoutGet(unsigned int _handle, double &g)
|
||||
{
|
||||
double p;
|
||||
return getSGTimeout(_handle, p, g);
|
||||
}
|
||||
|
||||
|
||||
//set SGTimeout
|
||||
int setSGTimeout (double p, double g); // for all group handles put and get separately
|
||||
int setSGTimeout (double pg){return setSGTimeout(pg, pg);};
|
||||
int setSGTimeoutPut(double p) {return setSGTimeout(p, (double) NULL);};
|
||||
int setSGTimeoutGet(double g) {return setSGTimeout((double) NULL, g);};
|
||||
int setSGTimeout (unsigned int _gHandle, double p, double g);
|
||||
int setSGTimeout (unsigned int _gHandle, double pg){return setSGTimeout(_gHandle, pg, pg); };
|
||||
int setSGTimeoutPut(unsigned int _gHandle, double p) {return setSGTimeout(_gHandle, p, (double) NULL);};
|
||||
int setSGTimeoutGet(unsigned int _gHandle, double g) {return setSGTimeout(_gHandle, (double) NULL, g);};
|
||||
//set SGTimeout
|
||||
int setSGTimeout (double p, double g); // for all group handles put and get separately
|
||||
int setSGTimeout (double pg)
|
||||
{
|
||||
return setSGTimeout(pg, pg);
|
||||
};
|
||||
int setSGTimeoutPut(double p)
|
||||
{
|
||||
return setSGTimeout(p, (double) NULL);
|
||||
};
|
||||
int setSGTimeoutGet(double g)
|
||||
{
|
||||
return setSGTimeout((double) NULL, g);
|
||||
};
|
||||
int setSGTimeout (unsigned int _gHandle, double p, double g);
|
||||
int setSGTimeout (unsigned int _gHandle, double pg)
|
||||
{
|
||||
return setSGTimeout(_gHandle, pg, pg);
|
||||
};
|
||||
int setSGTimeoutPut(unsigned int _gHandle, double p)
|
||||
{
|
||||
return setSGTimeout(_gHandle, p, (double) NULL);
|
||||
};
|
||||
int setSGTimeoutGet(unsigned int _gHandle, double g)
|
||||
{
|
||||
return setSGTimeout(_gHandle, (double) NULL, g);
|
||||
};
|
||||
|
||||
int setSGTimeoutToDefault(unsigned int _handle);
|
||||
int setSGTimeoutToDefault();
|
||||
int setSGTimeoutToDefault();
|
||||
|
||||
|
||||
};
|
||||
|
||||
@@ -22,24 +22,23 @@ class restorePVGroupXMLParser : public QXmlDefaultHandler {
|
||||
public:
|
||||
restorePVGroupXMLParser();
|
||||
virtual ~restorePVGroupXMLParser();
|
||||
|
||||
|
||||
bool startElement(const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts);
|
||||
bool endElement(const QString& namespaceURI, const QString& localName, const QString& qName);
|
||||
bool characters(const QString& ch);
|
||||
|
||||
|
||||
PVGroup group;
|
||||
private:
|
||||
enum
|
||||
{
|
||||
NotWaiting,
|
||||
enum {
|
||||
NotWaiting,
|
||||
WaitingForConfig,
|
||||
WaitingForNPV,
|
||||
WaitingForGroup,
|
||||
WaitingForDescription,
|
||||
WaitingForStatusGroup,
|
||||
WaitingForDescription,
|
||||
WaitingForStatusGroup,
|
||||
WaitingForMember,
|
||||
WaitingForName,
|
||||
WaitingForNelem,
|
||||
WaitingForName,
|
||||
WaitingForNelem,
|
||||
WaitingForStatus,
|
||||
WaitingForRule,
|
||||
WaitingForVal,
|
||||
@@ -58,12 +57,12 @@ private:
|
||||
const static QString& tagStatusGroup;
|
||||
const static QString& tagMember;
|
||||
const static QString& tagName;
|
||||
const static QString& tagNelem;
|
||||
const static QString& tagNelem;
|
||||
const static QString& tagStatus;
|
||||
const static QString& tagRule;
|
||||
const static QString& tagVal;
|
||||
const static QString& tagSettable;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
196
include/tmDateMap.h
Normal file
196
include/tmDateMap.h
Normal file
@@ -0,0 +1,196 @@
|
||||
///
|
||||
/// \file tmDateMap.h
|
||||
/// \author Jan Chrin, PSI
|
||||
/// \date Release: August 2018
|
||||
/// \version CAFE 1.7.0
|
||||
///
|
||||
|
||||
#ifndef TMDATEMAP_H
|
||||
#define TMDATEMAP_H
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
enum TM_WDAY {
|
||||
TM_SUNDAY = 0,
|
||||
TM_MONDAY = 1,
|
||||
TM_TUESDAY = 2,
|
||||
TM_WEDNESDAY=3,
|
||||
TM_THURSDAY =4,
|
||||
TM_FRIDAY =5,
|
||||
TM_SATURDAY =6
|
||||
};
|
||||
|
||||
|
||||
enum TM_MONTHP {
|
||||
TM_JAN = 1,
|
||||
TM_FEB = 2,
|
||||
TM_MAR = 3,
|
||||
TM_APR = 4,
|
||||
TM_MAY = 5,
|
||||
TM_JUN = 6,
|
||||
TM_JUL = 7,
|
||||
TM_AUG = 8,
|
||||
TM_SEP = 9,
|
||||
TM_OCT =10,
|
||||
TM_NOV =11,
|
||||
TM_DEC =12
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Provides methods to convert between
|
||||
* the TM_WDAY and text equivalent
|
||||
*/
|
||||
class TMwdayText {
|
||||
typedef std::map<int, std::string> mapLongString;
|
||||
private:
|
||||
mapLongString mapDataType;
|
||||
mapLongString::iterator pos;
|
||||
public:
|
||||
TMwdayText()
|
||||
{
|
||||
mapDataType.insert(std::make_pair((int) TM_SUNDAY, "Sun" ));
|
||||
mapDataType.insert(std::make_pair((int) TM_MONDAY, "Mon" ));
|
||||
mapDataType.insert(std::make_pair((int) TM_TUESDAY, "Tue" ));
|
||||
mapDataType.insert(std::make_pair((int) TM_WEDNESDAY, "Wed" ));
|
||||
mapDataType.insert(std::make_pair((int) TM_THURSDAY, "Thu" ));
|
||||
mapDataType.insert(std::make_pair((int) TM_FRIDAY, "Fri" ));
|
||||
mapDataType.insert(std::make_pair((int) TM_SATURDAY, "Sat" ));
|
||||
};
|
||||
|
||||
~TMwdayText() {};
|
||||
|
||||
std::string message (int i)
|
||||
{
|
||||
pos = mapDataType.find(i);
|
||||
if (pos != mapDataType.end()) return pos->second;
|
||||
return "Day Unknown";
|
||||
};
|
||||
|
||||
|
||||
std::string asString (int i)
|
||||
{
|
||||
pos = mapDataType.find(i);
|
||||
if (pos != mapDataType.end()) return pos->second;
|
||||
return "Day Unknown";
|
||||
};
|
||||
|
||||
int enumIs (std::string message)
|
||||
{
|
||||
for (pos=mapDataType.begin(); pos != mapDataType.end(); ++pos)
|
||||
if (pos->second==message) return pos->first;
|
||||
return -1;
|
||||
};
|
||||
|
||||
|
||||
int asEnum (std::string message)
|
||||
{
|
||||
for (pos=mapDataType.begin(); pos != mapDataType.end(); ++pos)
|
||||
if (pos->second==message) return pos->first;
|
||||
return -1;
|
||||
};
|
||||
|
||||
void show()
|
||||
{
|
||||
print();
|
||||
}
|
||||
|
||||
void print ( )
|
||||
{
|
||||
std::cout << "------------------" << std::endl;
|
||||
std::cout << "TM_WDAY LIST" << std::endl;
|
||||
std::cout << "------------------" << std::endl;
|
||||
for (pos=mapDataType.begin(); pos != mapDataType.end(); ++pos) {
|
||||
std::cout << pos->first << " " << pos->second << std::endl;
|
||||
}
|
||||
std::cout << "-----------------" << std::endl;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Provides methods to convert between
|
||||
* the TM_WDAY and text equivalent
|
||||
*/
|
||||
class TMmonthpText {
|
||||
typedef std::map<int, std::string> mapLongString;
|
||||
private:
|
||||
mapLongString mapDataType;
|
||||
mapLongString::iterator pos;
|
||||
public:
|
||||
TMmonthpText()
|
||||
{
|
||||
mapDataType.insert(std::make_pair((int) TM_JAN, "Jan" ));
|
||||
mapDataType.insert(std::make_pair((int) TM_FEB, "Feb" ));
|
||||
mapDataType.insert(std::make_pair((int) TM_MAR, "Mar" ));
|
||||
mapDataType.insert(std::make_pair((int) TM_APR, "Apr" ));
|
||||
mapDataType.insert(std::make_pair((int) TM_MAY, "May" ));
|
||||
mapDataType.insert(std::make_pair((int) TM_JUN, "Jun" ));
|
||||
mapDataType.insert(std::make_pair((int) TM_JUL, "Jul" ));
|
||||
mapDataType.insert(std::make_pair((int) TM_AUG, "Aug" ));
|
||||
mapDataType.insert(std::make_pair((int) TM_SEP, "Sep" ));
|
||||
mapDataType.insert(std::make_pair((int) TM_OCT, "Oct" ));
|
||||
mapDataType.insert(std::make_pair((int) TM_NOV, "Nov" ));
|
||||
mapDataType.insert(std::make_pair((int) TM_DEC, "Dec" ));
|
||||
|
||||
};
|
||||
|
||||
~TMmonthpText() {};
|
||||
|
||||
std::string message (int i)
|
||||
{
|
||||
pos = mapDataType.find(i);
|
||||
if (pos != mapDataType.end()) return pos->second;
|
||||
return "Month Unknown";
|
||||
};
|
||||
|
||||
|
||||
std::string asString (int i)
|
||||
{
|
||||
pos = mapDataType.find(i);
|
||||
if (pos != mapDataType.end()) return pos->second;
|
||||
return "Month Unknown";
|
||||
};
|
||||
|
||||
int enumIs (std::string message)
|
||||
{
|
||||
for (pos=mapDataType.begin(); pos != mapDataType.end(); ++pos)
|
||||
if (pos->second==message) return pos->first;
|
||||
return -1;
|
||||
};
|
||||
|
||||
|
||||
int asEnum (std::string message)
|
||||
{
|
||||
for (pos=mapDataType.begin(); pos != mapDataType.end(); ++pos)
|
||||
if (pos->second==message) return pos->first;
|
||||
return -1;
|
||||
};
|
||||
|
||||
void show()
|
||||
{
|
||||
print();
|
||||
}
|
||||
|
||||
void print ( )
|
||||
{
|
||||
std::cout << "------------------" << std::endl;
|
||||
std::cout << "TM_MONTH(+1) LIST" << std::endl;
|
||||
std::cout << "------------------" << std::endl;
|
||||
for (pos=mapDataType.begin(); pos != mapDataType.end(); ++pos) {
|
||||
std::cout << pos->first << " " << pos->second << std::endl;
|
||||
}
|
||||
std::cout << "-----------------" << std::endl;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
1933
include/transpose.h
1933
include/transpose.h
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user