additional methods to handleHelper
This commit is contained in:
@@ -94,13 +94,22 @@ int getCache(const unsigned int _handle, vector<long long> & V,
|
||||
int getCache(const unsigned int _handle, 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 getV(vector<unsigned int> handleV, vector<int> &statusV){
|
||||
status=get(handleV, statusV); ca_flush_io(); //Yes let's flush here!
|
||||
status=get(handleV, statusV); ca_flush_io(); //Yes let's flush here!
|
||||
return status;}
|
||||
|
||||
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);
|
||||
|
||||
@@ -40,6 +40,10 @@ class Connect
|
||||
CAFEStatus cafeStatus;
|
||||
CAFEStatusSeverity cafeStatusSeverity;
|
||||
|
||||
CAFEGlobalAlarmSeverity epicsAlarmSeverity;
|
||||
CAFEGlobalAlarmCondition epicsAlarmStatus;
|
||||
|
||||
|
||||
cafeConduit_set::iterator itcs;
|
||||
cafeGroup_set::iterator itgs;
|
||||
|
||||
@@ -140,6 +144,11 @@ class Connect
|
||||
CAFEStatus getCafeStatus() {return cafeStatus;}
|
||||
CAFEStatusSeverity getCafeStatusSeverity() {return cafeStatusSeverity;}
|
||||
|
||||
CAFEGlobalAlarmCondition getEpicsAlarmStatus() {return epicsAlarmStatus;}
|
||||
CAFEGlobalAlarmCondition getEpicsAlarmCondition() {return epicsAlarmStatus;}
|
||||
CAFEGlobalAlarmSeverity getEpicsAlarmSeverity() {return epicsAlarmSeverity;}
|
||||
|
||||
|
||||
int flushNow() {return ca_flush_io();}
|
||||
|
||||
int _ca_flush_io(){return ca_flush_io();}
|
||||
@@ -493,6 +502,13 @@ class Connect
|
||||
int printStatusIfError(vector<unsigned int> handleV, vector<int> statusV);
|
||||
|
||||
|
||||
int printStatus(const char *pv, int status);
|
||||
int printStatusIfError(const char *pv, int status);
|
||||
int printStatus(const char * pvArray, unsigned int nelem, int * statusArray);
|
||||
int printStatusIfError(const char * pvArray, unsigned int nelem, int * statusArray);
|
||||
int printStatus(vector<string> pvV, vector<int> statusV);
|
||||
int printStatusIfError(vector<string> pvV, vector<int> statusV);
|
||||
|
||||
int setPVAlias(unsigned int handle, const char * pv) throw (CAFEException_open);
|
||||
|
||||
// GROUP FUNCTIONS
|
||||
|
||||
@@ -83,6 +83,8 @@ class HandleHelper : public Helper {
|
||||
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> getHandlesFromWithinGroupV(unsigned int gh);
|
||||
unsigned int * getHandlesFromWithinGroup(unsigned int gh);
|
||||
|
||||
@@ -764,15 +764,15 @@ template <class CTYPE> int Instant<CTYPE>::clientRequests(
|
||||
|
||||
if (it_handle != handle_index.end()) {
|
||||
|
||||
union db_access_val * PVDataL;
|
||||
unsigned int nelem;
|
||||
//unsigned int offset;
|
||||
chtype dbrTypeRequest_DataBuffer;
|
||||
//union db_access_val * PVDataL;
|
||||
//unsigned int nelem;
|
||||
|
||||
//chtype dbrTypeRequest_DataBuffer;
|
||||
|
||||
PVDataL = (*it_handle).getPutBuffer ();
|
||||
nelem = (*it_handle).getChannelRequestMetaPrimitive().getNelem();
|
||||
//PVDataL = (*it_handle).getPutBuffer ();
|
||||
//nelem = (*it_handle).getChannelRequestMetaPrimitive().getNelem();
|
||||
|
||||
dbrTypeRequest_DataBuffer = (*it_handle).getChannelRequestMetaPrimitive().getDbrDataType();
|
||||
//dbrTypeRequest_DataBuffer = (*it_handle).getChannelRequestMetaPrimitive().getDbrDataType();
|
||||
|
||||
switch(_dbrType) {
|
||||
case DBR_STRING:
|
||||
@@ -805,15 +805,7 @@ template <class CTYPE> int Instant<CTYPE>::clientRequests(
|
||||
return ECAFE_INVALID_SWITCH_CASE;
|
||||
break;
|
||||
}
|
||||
/*
|
||||
epicsTimeStamp ts;
|
||||
ts.secPastEpoch= 0; // default value if cache does not have timeStamp
|
||||
ts.nsec = 0; // default value if cache does not have timeStamp
|
||||
dbr_short_t alarmStatus =-1; // default value if cache does not have alarmStatus
|
||||
dbr_short_t alarmSeverity =-1; // default value if cache does not have alarmSeverity
|
||||
//helper function to set TimeStamps!
|
||||
helper.setSTS(_handle, alarmStatus, alarmSeverity, ts);
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
@@ -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.3.0-final-1/lib
|
||||
libdir = /opt/gfa/cafe/cpp/cafe-1.3.0-final-2/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.3.0-final-1
|
||||
prefix = /opt/gfa/cafe/cpp/cafe-1.3.0-final-2
|
||||
program_transform_name = s,x,x,
|
||||
psdir = ${docdir}
|
||||
sbindir = ${exec_prefix}/sbin
|
||||
|
||||
@@ -107,7 +107,8 @@ enum CAFE_ERROR_STATE { ECAFE_NODATA=ICAFE_STATUS_ERROR,
|
||||
ECAFE_INVALID_ENUM_INDEX,
|
||||
ECAFE_PVGROUP_GROUPHANDLE_MISMATCH,
|
||||
ECAFE_TIMEOUT_SET_AND_MATCH,
|
||||
ECAFE_HANDLE_MISMATCH_SET_AND_MATCH
|
||||
ECAFE_HANDLE_MISMATCH_SET_AND_MATCH,
|
||||
ECAFE_INCONSISTENT_CONTAINER_CORRECTED
|
||||
};
|
||||
|
||||
enum CAFE_FILE_ERROR { ECAFE_LOAD_COLLECTION=ICAFE_FILE_ERROR,
|
||||
@@ -415,6 +416,7 @@ public:
|
||||
* 1033 ECAFE_PVGROUP_GROUPHANDLE_MISMATCH \n
|
||||
* 1034 ECAFE_TIMEOUT_SET_AND_MATCH \n
|
||||
* 1035 ECAFE_HANDLE_MISMATCH_SET_AND_MATCH \n
|
||||
* 1036 ECAFE_INCONSISTENT_CONTAINER_CORRECTED \n
|
||||
* 1100 ECAFE_LOAD_COLLECTION \n
|
||||
* 1101 ECAFE_LOAD_GROUP \n
|
||||
* 1200 ECAFE_BPM_DATA_IS_INVALID \n
|
||||
@@ -507,7 +509,10 @@ public:
|
||||
mapStatusInfo.insert(std::make_pair((int) ECAFE_TIMEOUT_SET_AND_MATCH, "Readback channel did not reach set value within specified timeout period "));
|
||||
|
||||
mapStatusInfo.insert(std::make_pair((int) ECAFE_HANDLE_MISMATCH_SET_AND_MATCH, "Number of set/readback handles do not match"));
|
||||
mapStatusInfo.insert(std::make_pair((int) ECAFE_LOAD_COLLECTION, "CAFE collection could not be loaded from xml configuration file " ));
|
||||
mapStatusInfo.insert(std::make_pair((int) ECAFE_INCONSISTENT_CONTAINER_CORRECTED, "Boost container required update after consistency check"));
|
||||
|
||||
|
||||
mapStatusInfo.insert(std::make_pair((int) ECAFE_LOAD_COLLECTION, "CAFE collection could not be loaded from xml configuration file " ));
|
||||
mapStatusInfo.insert(std::make_pair((int) ECAFE_LOAD_GROUP, "CAFE group could not be loaded from group xml configuration file " ));
|
||||
|
||||
mapStatusInfo.insert(std::make_pair((int) ECAFE_BPM_DATA_IS_INVALID, "CAFE BPM Service: Data Validity channel reports BPM data is INVALID " ));
|
||||
@@ -659,12 +664,15 @@ public:
|
||||
mapStatusCode.insert(std::make_pair((int) ECAFE_HASH_UNIQUEID_EXISTS, "CAFE ERROR: ECAFE_HASH_UNIQUEID_EXISTS"));
|
||||
mapStatusCode.insert(std::make_pair((int) ECAFE_WRONG_CA_CONTEXT, "CAFE ERROR: ECAFE_WRONG_CA_CONTEXT"));
|
||||
mapStatusCode.insert(std::make_pair((int) ECAFE_INVALID_CAFENUM_POLICY_TYPE, "CAFE ERROR: ECAFE_INVALID_CAFENUM_POLICY_TYPE"));
|
||||
mapStatusCode.insert(std::make_pair((int) ECAFE_MAX_MONITORS_PER_CHAN_EXCEEDED, "CAFE_ERROR: ECAFE_MAX_MONITORS_PER_CHAN_EXCEEDED"));
|
||||
mapStatusCode.insert(std::make_pair((int) ECAFE_INVALID_ENUM_INDEX, "CAFE_ERROR: ECAFE_INVALID_ENUM_INDEX"));
|
||||
mapStatusCode.insert(std::make_pair((int) ECAFE_MAX_MONITORS_PER_CHAN_EXCEEDED, "CAFE_ERROR: ECAFE_MAX_MONITORS_PER_CHAN_EXCEEDED"));
|
||||
mapStatusCode.insert(std::make_pair((int) ECAFE_INVALID_ENUM_INDEX, "CAFE_ERROR: ECAFE_INVALID_ENUM_INDEX"));
|
||||
mapStatusCode.insert(std::make_pair((int) ECAFE_PVGROUP_GROUPHANDLE_MISMATCH, "CAFE ERROR:ECAFE_PVGROUP_GROUPHANDLE_MISMATCH"));
|
||||
|
||||
mapStatusCode.insert(std::make_pair((int) ECAFE_TIMEOUT_SET_AND_MATCH, "CAFE ERROR: CAFE_TIMEOUT_SET_AND_MATCH"));
|
||||
mapStatusCode.insert(std::make_pair((int) ECAFE_HANDLE_MISMATCH_SET_AND_MATCH, "CAFE ERROR: CAFE_HANDLE_MISMATCH_SET_AND_MATCH"));
|
||||
mapStatusCode.insert(std::make_pair((int) ECAFE_INCONSISTENT_CONTAINER_CORRECTED,"CAFE ERROR: ECAFE_INCONSISTENT_CONTAINER_CORRECTED"));
|
||||
|
||||
|
||||
mapStatusCode.insert(std::make_pair((int) ECAFE_LOAD_COLLECTION, "CAFE ERROR: ECAFE_LOAD_COLLECTION"));
|
||||
mapStatusCode.insert(std::make_pair((int) ECAFE_LOAD_GROUP, "CAFE ERROR: ECAFE_LOAD_GROUP"));
|
||||
|
||||
@@ -871,6 +879,9 @@ public:
|
||||
|
||||
mapStatusSeverity.insert(std::make_pair((int) ECAFE_TIMEOUT_SET_AND_MATCH, "WARN"));
|
||||
mapStatusSeverity.insert(std::make_pair((int) ECAFE_HANDLE_MISMATCH_SET_AND_MATCH, "ERROR"));
|
||||
mapStatusSeverity.insert(std::make_pair((int) ECAFE_INCONSISTENT_CONTAINER_CORRECTED, "WARN"));
|
||||
|
||||
|
||||
mapStatusSeverity.insert(std::make_pair((int) ECAFE_LOAD_COLLECTION, "ERROR"));
|
||||
mapStatusSeverity.insert(std::make_pair((int) ECAFE_LOAD_GROUP, "ERROR"));
|
||||
|
||||
@@ -967,6 +978,10 @@ class CAFEStatus {
|
||||
strRet.append(csi.message(i));
|
||||
return (std::string) strRet;
|
||||
}
|
||||
|
||||
bool isTimeout(int i) {
|
||||
return csc.isTimeout(i);
|
||||
}
|
||||
|
||||
void report (int i) {
|
||||
std::cout << "------------------" << std::endl;
|
||||
|
||||
@@ -311,6 +311,12 @@ template <class CTYPE> int Transpose<CTYPE>::put(const unsigned int _handle,
|
||||
}//if noStrings>0
|
||||
|
||||
}//if
|
||||
|
||||
|
||||
//cout << "dbrTypeRequest_DataBuffer " << dbrTypeRequest_DataBuffer << endl;
|
||||
//cout << "_dbrType " << _dbrType << endl;
|
||||
|
||||
//cout << "nelem " << nelem << endl;
|
||||
|
||||
switch (dbrTypeRequest_DataBuffer)
|
||||
{
|
||||
@@ -444,9 +450,12 @@ template <class CTYPE> int Transpose<CTYPE>::put(const unsigned int _handle,
|
||||
}
|
||||
break;
|
||||
case DBR_DOUBLE: //6
|
||||
|
||||
for (unsigned int i=0; i<nelem; ++i) {
|
||||
*((dbr_float_t *) (PVDataL) + i ) = (dbr_float_t) val[i] ;
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
case DBR_STRING: //0
|
||||
status=putString(_handle, (dbr_string_t *) val);
|
||||
@@ -688,7 +697,7 @@ template <class CTYPE> int Transpose<CTYPE>::put(const unsigned int _handle,
|
||||
return ECAFE_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
|
||||
cout << "status " << status << endl;
|
||||
|
||||
return status;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user