diff --git a/autogen_psi.sh b/autogen_psi.sh index a1099af..48c93f0 100644 --- a/autogen_psi.sh +++ b/autogen_psi.sh @@ -22,7 +22,7 @@ automake --force --add-missing --copy #Used by ./configure #Assumes format ${EPICS}/base-3.14.12 #source cafeVersion-gcc-7.3.0 -CAFE_V="cafe-1.14.2" +CAFE_V="cafe-1.14.4" #For later check of existence of HOST_ARCH for $EPICS/include/os/$HOST_ARCH #Assume Linux but check if Darwin CAFE_HOST_FLAG_DARWIN=$(echo ${EPICS_HOST_ARCH} | grep -c "Darwin") @@ -258,7 +258,7 @@ echo 'ENABLE_OPTIONS='$ENABLE_OPTIONS --libdir=/opt/gfa/cafe/cpp/${CAFE_V}/lib/${EPICS_HOST_ARCH} \ ${ENABLE_OPTIONS} \ --with-boost-inc=/opt/gfa/cafe/boost/boost_1_61_0/include \ - --with-epics7=${EPICS}/base-7 \ + --with-epics7=${EPICS}/base-7.0.6 \ --with-epics3=${EPICS}/base \ --with-python37=/opt/gfa/python-3.7/latest \ --with-python35=/opt/gfa/python-3.5/latest \ diff --git a/configurePSI.ac b/configurePSI.ac index bfa357a..210ce06 100644 --- a/configurePSI.ac +++ b/configurePSI.ac @@ -9,7 +9,7 @@ # Standard macros AC_PREREQ(2.63) AC_COPYRIGHT([CAFE,Jan Chrin, 2010-2021]) -AC_INIT([CAFE], [1.14.2], [Bug reports to: jan.chrin@psi.ch]) +AC_INIT([CAFE], [1.14.4], [Bug reports to: jan.chrin@psi.ch]) AC_CONFIG_AUX_DIR(./) diff --git a/include/conduitEventHandlerArgs.h b/include/conduitEventHandlerArgs.h index 9afcacf..5f903c1 100644 --- a/include/conduitEventHandlerArgs.h +++ b/include/conduitEventHandlerArgs.h @@ -31,8 +31,8 @@ struct change_eventHandlerArgs if(c.status!=ECA_NORMAL) { std::cout << __METHOD__ << " STATUS IS " << c.status << std::endl; - std::cout << __METHOD__ << " return from method ***NOT*** enforced " << std::endl; - //return; + std::cout << __METHOD__ << " return from method ***IS*** enforced " << std::endl; + return; } //std::cout << __METHOD__ << " STATUS IS " << c.status << std::endl; diff --git a/include/instant.cpp b/include/instant.cpp deleted file mode 100644 index e4f2d61..0000000 --- a/include/instant.cpp +++ /dev/null @@ -1,3166 +0,0 @@ -/// -/// \file instant.cpp -/// \author Jan Chrin, PSI -/// \date Release: February 2015 -/// \version CAFE 1.0.0 -/// - -#ifndef INSTANT_CPP -#define INSTANT_CPP - -//include - -/** - * \brief Set values of data type CTYPE - * \param _handle input: handle to CAFEConduit object - * \param _dbrType input: chtype - * \param _val value/array of values of datatype const CTYPE - * \return ECA_NORMAL if all OK else CAFE_ or ECA_ error - * \return CAFE_ error if CAFEConduit::putCallback() operation is not to be executed: - * \return ECAFE_INVALID_HANDLE - Invalid reference handle - * \return ECAFE_NOWTACCESS - Write access denied - * \return ICAFE_CA_OP_CONN_DOWN - Channel is not connected - * \return ECA_ error from CAFEConduit::putCallback() operation: - * \return (*) should not arise due to pre-checks - * \return ECA_NORMAL - Normal successful completion - * \return ECA_BADCHID - Corrupted Channel Identifier (chid) - * \return ECA_BADTYPE (*) - Invalid DBR_XXX type - * \return ECA_BADCOUNT (*) - Requested count larger than native element count - * \return ECA_NOWTACCESS (*) - Write access denied - * \return ECA_ALLOCMEM - Unable to allocate memory - * \return ECA_DISCONN (*) - Channel is disconnected - */ -template int Instant::set(const unsigned int _handle, const chtype _dbrType, - const CTYPE * _val ) -{ -#define __METHOD__ "Instant::set(_handle, _dbrType, _val)" - - status=ICAFE_NORMAL; - - if (_dbrType > DBR_DOUBLE) - { - std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - std::cout << "INTERNAL CAFE ERROR: HOW DID THIS PERCULIAR DATA TYPE: " - << dbr_type_to_text(_dbrType) << " GET THROUGH!" << std::endl; - } - - cafeConduit_set_by_handle & handle_index = cs.get (); - cafeConduit_set_by_handle::iterator it_handle; - - - it_handle = handle_index.find(_handle); - - if (it_handle != handle_index.end()) - { - - if ( (status=cafeGranules.channelVerifyPut(_handle, _dbrType)) != ICAFE_NORMAL) - { - return status; - } - - if ( (status=cafeGranules.channelPreparePut(_handle)) != ICAFE_NORMAL) - { - return status; - } - - if ( (status=clientRequests(_handle, _dbrType, _val)) != ICAFE_NORMAL) - { - return status; - } - - if ( (status=cafeGranules.channelExecutePut(_handle)) != ICAFE_NORMAL) - { - return status; - } - - } - else - { - std::cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__ << std::endl; - cafeStatus.report(ECAFE_INVALID_HANDLE); - return ECAFE_INVALID_HANDLE; - } - - if(MUTEX) - { - cafeMutex.lock(); - }; //lock - handle_index.modify(it_handle, change_status(status)); - if(MUTEX) - { - cafeMutex.unlock(); - }; //unlock - - return status; - -#undef __METHOD__ -} - -/** - * \brief Retrieve values of data type CTYPE - * \param _handle input: handle to CAFEConduit object - * \param _dbrType input: chtype - * \param _val output: value/array of values of datatype const CTYPE - * \param alarmStatus output - * \param alarmSeverity output - * \param ts output: epicsTimeStamp - * \return ECA_NORMAL if all OK else CAFE_ or ECA_ error - * \return CAFE_ error if CAFEConduit::get() operation is not to be executed: - * \return ECAFE_INVALID_HANDLE - Invalid reference handle - * \return ECAFE_NORDACCESS - Read access denied - * \return ICAFE_CA_OP_CONN_DOWN - Channel is not connected - * \return ECA_ error from CAFEConduit::get() operation: - * \return (*) should not arise due to pre-checks - * \return ECA_NORMAL - Normal successful completion - * \return ECA_BADCHID - Corrupted Channel Identifier (chid) - * \return ECA_BADTYPE (*) - Invalid DBR_XXX type - * \return ECA_BADCOUNT (*) - Requested count larger than native element count - * \return ECA_NORDACCESS(*)- Read access denied - * \return ECA_ALLOCMEM - Unable to allocate memory - * \return ECA_DISCONN (*) - Channel is disconnected - */ -template int Instant::get(const unsigned int _handle, - const chtype _dbrType, CTYPE * _val, - dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) -{ -#define __METHOD__ "Instant::get(_handle, dbrType, _val, alarmStatus, alarmSeverity, ts) " - - //std::cout << __FILE__ << " " << __LINE__ << " " << __METHOD__ << std::endl; - - status=ICAFE_NORMAL; - - if (_dbrType > DBR_CTRL_DOUBLE) - { - std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - std::cout << "INTERNAL CAFE ERROR: HOW DID THIS PERCULIAR DATA TYPE: " - << dbr_type_to_text(_dbrType) << " GET THROUGH!" << std::endl; - } - else if (_dbrType > DBR_TIME_DOUBLE) - { - std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - std::cout << "INTERNAL CAFE ERROR: METHOD NOT MEANT FOR THIS DATA TYPE: " - << dbr_type_to_text(_dbrType) << std::endl; - std::cout << "CAFE WILL THUS TAKE CONTROL OF ALLOCATING APPROPIATE DBR_TYPE" << std::endl; - } - - - - cafeConduit_set_by_handle & handle_index = cs.get (); - cafeConduit_set_by_handle::iterator it_handle; - - if (it_handle != handle_index.end()) - { - - - if ( (*it_handle).getChannelGetActionWhenMonitorPolicy().getActionKind() == CAFENUM::GET_FROM_CACHE) - { - if ( helper.getNmonitorData(_handle) >0) - { - return Instant::getCache(_handle, _dbrType, _val, alarmStatus, alarmSeverity, ts); - } - } - - if ( (status=cafeGranules.channelVerifyGet(_handle, _dbrType)) != ICAFE_NORMAL) - { - return status; - } - - //Here fill channelRequestMetaData - - if ( (status=cafeGranules.channelPrepareGet(_handle)) != ICAFE_NORMAL) - { - return status; - } - - if ( (status=cafeGranules.channelExecuteGet(_handle)) != ICAFE_NORMAL) - { - return status; - } - - channelRequestMetaDataClient = (*it_handle).getChannelRequestMetaDataClient(); - - - status=clientRequests( _handle, channelRequestMetaDataClient.getDbrDataType(), - _val, alarmStatus, alarmSeverity, ts, false); - - } - else - { - std::cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__ << std::endl; - const char * _pv = helper.getPVFromHandle(_handle); - std::cout << "Failed to find handle " << _handle << " for pv " << _pv << std::endl; - cafeStatus.report(ECAFE_INVALID_HANDLE); - return ECAFE_INVALID_HANDLE; - } - - if(MUTEX) - { - cafeMutex.lock(); - }; //lock - handle_index.modify(it_handle, change_status(status)); - if(MUTEX) - { - cafeMutex.unlock(); - }; //unlock - - - return status; - -#undef __METHOD__ -} - - -/** - * \brief Retrieve cached values of data type CTYPE - * \param _handle input: handle to CAFEConduit object - * \param _dbrType input: chtype - * \param _val output: value/array of values of datatype const CTYPE - * \param alarmStatus output - * \param alarmSeverity output - * \param ts output: epicsTimeStamp - * \return ECA_NORMAL if all OK else CAFE_ or ECA_ error - * \return CAFE_ error if CAFEConduit::get() operation is not to be executed: - * \return ECAFE_INVALID_HANDLE - Invalid reference handle - * \return ECAFE_NORDACCESS - Read access denied - * \return ICAFE_CA_OP_CONN_DOWN - Channel is not connected - * \return ECA_ error from CAFEConduit::get() operation: - * \return (*) should not arise due to pre-checks - * \return ECA_NORMAL - Normal successful completion - * \return ECA_BADCHID - Corrupted Channel Identifier (chid) - * \return ECA_BADTYPE (*) - Invalid DBR_XXX type - * \return ECA_BADCOUNT (*) - Requested count larger than native element count - * \return ECA_NORDACCESS(*)- Read access denied - * \return ECA_ALLOCMEM - Unable to allocate memory - * \return ECA_DISCONN (*) - Channel is disconnected - */ -template int Instant::getCache(const unsigned int _handle, - const chtype _dbrType, CTYPE * _val, - dbr_short_t &alarmStatus, dbr_short_t &alarmSeverity, epicsTimeStamp &ts) -{ -#define __METHOD__ "Instant::getCache(_handle, _dbrType, _val, alarmStatus, alarmSeverity, ts) " - - //std::cout << __FILE__ << " " << __LINE__ << " " << __METHOD__ << std::endl; - //std::cout << "handle " << _handle << " dbr input type " << _dbrType << std::endl; - - status=ICAFE_NORMAL; - - ts.secPastEpoch= 0; // default value if cache does not have timeStamp - ts.nsec = 0; // default value if cache does not have timeStamp - alarmStatus =-1; // default value if cache does not have alarmStatus - alarmSeverity =-1; // default value if cache does not have alarmSeverity - - cafeConduit_set_by_handle & handle_index = cs.get (); - cafeConduit_set_by_handle::iterator it_handle; - it_handle = handle_index.find(_handle); - - if (it_handle != handle_index.end()) - { - - //std::cout << __METHOD__ << "__" << __LINE__ << std::endl; - //std::cout << "(*it_handle).getChannelGetCacheWaitPolicy().getWaitKind()" << - //(*it_handle).getChannelGetCacheWaitPolicy().getWaitKind() << " 0=NO_CHECK 1=NO_WAIT 2=WAIT " << std::endl; - - //Let us check input type against client request type. - chtype _dataTypeClient = (*it_handle).getChannelRequestMetaDataClient().getDataType(); - chtype _dbrTypePlain = _dbrType; - - //reduce _dbrType ton_dataTypeClient - - if (dbr_type_is_STS(_dbrType) ) - { - _dbrTypePlain = _dbrType%(LAST_TYPE+1); //DBR_STS_STRING; - } - else if (dbr_type_is_TIME(_dbrType) ) - { - _dbrTypePlain = _dbrType%(LAST_TYPE+1); //DBR_TIME_STRING; - } - - // If they do not agrre - change the data tzype in the client space for the handle!! - // std::cout << _dataTypeClient << " //COMPARISON// " << _dbrTypePlain << std::endl; - - if (_dataTypeClient != _dbrTypePlain) - { - - channelRequestMetaDataClient= (*it_handle).getChannelRequestMetaDataClient(); - - channelRequestMetaDataClient.setDataType (_dbrTypePlain); - channelRequestMetaDataClient.setDbrDataType(_dbrType); - - channelRequestMetaDataClient.setCafeDbrType( - (CAFENUM::DBR_TYPE) helper.convertToCAFEDbrTypeClass(_dbrType) ); - - if(MUTEX) - { - cafeMutex.lock(); //lock - } - handle_index.modify(it_handle, - change_channelRequestMetaDataClient(channelRequestMetaDataClient)); - if(MUTEX) - { - cafeMutex.unlock(); //unlock - } - - } - - - //ifNeverConnected - return error - if ( (*it_handle).getChannelRegalia().getCafeConnectionState() == ICAFE_CS_NEVER_CONN) - { - return ICAFE_CS_NEVER_CONN; - } - else if ( (*it_handle).getChannelRegalia().getCafeConnectionState()==ICAFE_CS_CLOSED) - { - return ICAFE_CS_CLOSED; - } - - - // Meant for use in callbacks in monitors! - // Does not check what the client is requesting. - // If the datadatype render, i.e., dbrType does not correspond to the clientDataType in hash - // then there is a risk that that the data will be unfolded from the buffer incorrectly - // especially when strings are involved - // Solved with the above modification - - if ( (*it_handle).getChannelGetCacheWaitPolicy().getWaitKind() == CAFENUM::GET_CACHE_NO_CHECK) - { - //std::cout << __FILE__ << " " << __LINE__ << " " << __METHOD__ << std::endl; - status=clientRequests(_handle, _dbrType, _val, alarmStatus, alarmSeverity, ts, true); - //std::cout << __FILE__ << " " << __LINE__ << " " << __METHOD__ << std::endl; - return status; - } - - - if (_dbrType > DBR_CTRL_DOUBLE) - { - std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - std::cout << "INTERNAL CAFE ERROR: HOW DID THIS PERCULIAR DATA TYPE: " - << dbr_type_to_text(_dbrType) << " GET THROUGH!" << std::endl; - } - else if (_dbrType > DBR_TIME_DOUBLE) - { - std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - std::cout << "INTERNAL CAFE ERROR: METHOD NOT MEANT FOR THIS DATA TYPE: " - << dbr_type_to_text(_dbrType) << std::endl; - std::cout << "CAFE WILL THUS TAKE CONTROL OF ALLOCATING APPROPIATE DBR_TYPE" << std::endl; - } - - chtype dbrtype =(*it_handle).getChannelRequestMetaData().getDbrDataType(); - - - //MetaData will have true DBR_XXX_YYY type - //Client is asking from cache for DBR_MMM_NNN - //Therefore have to prepare DBR_MMM_NNN from DBR_XXX_YY - CAFENUM::DBR_TYPE cafedbrtype= (*it_handle).getChannelRequestMetaData().getCafeDbrType(); - - - switch (cafedbrtype) - { - case CAFENUM::DBR_TIME: - dbrtype = dbf_type_to_DBR_TIME(_dbrType%DBR_STS_STRING); - break; - case CAFENUM::DBR_STS: - dbrtype = dbf_type_to_DBR_STS(_dbrType%DBR_STS_STRING); - break; - case CAFENUM::DBR_PRIMITIVE: - dbrtype = dbf_type_to_DBR(_dbrType%DBR_STS_STRING); - break; - default: - dbrtype = (*it_handle).getChannelRequestMetaData().getDbrDataType(); - std::cout << __METHOD__ << "/" << __LINE__ < int Instant::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) -{ -#define __METHOD__ "Instant::getCache(handleArray, nelem, _dbrType, val, statusArray) " - - unsigned int nelemPrevious=1; - HandleHelper helper; - int gStatus=ICAFE_NORMAL; - bool statusSet=false; - - //std::cout << __FILE__ << " " << __LINE__ << " " << __METHOD__ << std::endl; - - for (unsigned int i=0; i (); - cafeConduit_set_by_handle::iterator it_handle; - it_handle = handle_index.find(handleArray[i]); - - channelRequestStatusGet =(*it_handle).getChannelRequestStatusGet(); - - if (channelRequestStatusGet.getCallbackProgressKind() == CAFENUM::PENDING - && helper.getNmonitorData(handleArray[i])==0 - && (*it_handle).getChannelRequestPolicyGet().getMethodKind() - != CAFENUM::WITH_CALLBACK_USER_SUPPLIED - && (*it_handle).getChannelGetCacheWaitPolicy().getWaitKind() == CAFENUM::GET_CACHE_WAIT - && (*it_handle).isConnected() - ) - { - - channelTimeoutPolicyGet = (*it_handle).getChannelTimeoutPolicyGet(); - - ca_flush_io(); - status=cafeGranules.waitForGetEvent(handleArray[i], channelTimeoutPolicyGet.getTimeout()); - - - if (status==ECAFE_TIMEOUT && channelTimeoutPolicyGet.getSelfGoverningTimeout()) - { - unsigned short ntries=0; - while (status==ECAFE_TIMEOUT && ntries int Instant::set(const unsigned int *handleArray, const unsigned int nelem, - const chtype _dbrType, const CTYPE * val, int *statusArray) -{ -#define __METHOD__ \ -"Instant::set(unsigned int *handleArray, unsigned int nelem, const chtype _dbrType, dbr_double_t * val, int *statusArray)" - - int overallStatus=ICAFE_NORMAL; - bool isGood=true; - - //std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - - unsigned int nelemPrevious=1; - - for (unsigned int i=0; i int Instant::clientRequests( - const unsigned int _handle, const chtype _dbrType, const CTYPE * _val) -{ -#define __METHOD__ "Instant::clientRequests(*it_handle, _dbrType, _val)" - - cafeConduit_set_by_handle & handle_index = cs.get (); - cafeConduit_set_by_handle::iterator it_handle; - - status=ICAFE_NORMAL; - - it_handle = handle_index.find(_handle); - - if (it_handle != handle_index.end()) - { - //May 2017 Caught by Cython - These variables are set but never used - //Hence comment them out - /* - union db_access_val * PVDataL; - unsigned int nelem; - //unsigned int offset; - chtype dbrTypeRequest_DataBuffer; - - PVDataL = (*it_handle).getPutBuffer (); - nelem = (*it_handle).getChannelRequestMetaPrimitive().getNelem(); - dbrTypeRequest_DataBuffer = (*it_handle).getChannelRequestMetaPrimitive().getDbrDataType(); - */ - - switch(_dbrType) - { - case DBR_STRING: - status=renderString.putString(_handle, (dbr_string_t *) _val); - break; - case DBR_SHORT: - status=renderShort.put(_handle, (dbr_short_t *) _val, _dbrType ); - break; - case DBR_FLOAT: - status=renderFloat.put(_handle, (dbr_float_t *) _val, _dbrType); - break; - case DBR_ENUM: - status=renderEnum.put(_handle, (dbr_enum_t *) _val, _dbrType); - break; - case DBR_CHAR: - status=renderChar.put(_handle, (dbr_char_t *) _val, _dbrType); - break; - case DBR_LONG: - status=renderLong.put(_handle, (dbr_long_t *) _val, _dbrType); - break; - case DBR_DOUBLE: - status=renderDouble.put(_handle, (dbr_double_t *) _val, _dbrType); - break; - default: - std::cout << "ERROR: " << __FILE__ << "/" << __LINE__ << "/" << __METHOD__ << std::endl; - cafeStatus.report(ECAFE_INVALID_SWITCH_CASE); - std::cout << "SWITCH STATMENT NOT MEANT FOR CAFE DATATYPE=" << - _dbrType < int Instant::setAndGet(const unsigned int handleSet, const chtype dbrType, CTYPE valSet, CTYPE &valGet) -{ -#define __METHOD__ "Instant::setAndGet(const unsigned int handleSet,const chtype dbrType, CTYPE valSet, CTYPE &valGet" - //CheckPolicy - - CTYPE valGetA[1]; - CTYPE valSetA[1]; - - valGetA[0]=0; - valGet=0; - - valSetA[0] = (CTYPE) valSet; - - status=Instant::set(handleSet, dbrType, valSetA); - if (status==ICAFE_NORMAL) - { - - unsigned int nelemPrevious, nelemRequestedCheck=0; - unsigned int nelemRequested=1; - nelemPrevious=helper.getNelemClient(handleSet); - //Check the number of elements requested? - if (nelemPrevious>1) - { - nelemRequestedCheck = helper.setNelem(handleSet,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; - } - } - status=Instant::get(handleSet, dbrType, valGetA); - - if (nelemPrevious>1) - { - helper.setNelem(handleSet,nelemPrevious); - } - - valGet=valGetA[0]; - } - else - { - return status; - } - if(valSet==valGet) - { - return ICAFE_NORMAL; - } - std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - std::cout << "Process Variable = " << helper.getPVFromHandle(handleSet) << std::endl; - std::cout << "Set Value: " << valSet << " Get Value: " << valGet << std::endl; - return ICAFE_SET_AND_GET_MISMATCH; -#undef __METHOD__ -} - - - -template int Instant::setMany(std::vector handleSet, const chtype dbrType, std::vector valSet, bool printFlag) -{ - -#define __METHOD__ "Instant::setMany(std::vectorhandleSet, chtype, std::vectorvalSet)" - - CAFEStatus cstat; - - CTYPE valSetA[1]; - - status=ICAFE_NORMAL; - - if (handleSet.size() != valSet.size() ) - { - return ECAFE_HANDLE_MISMATCH_SET_AND_MATCH; - } - - for (size_t i=0; i< handleSet.size(); ++i) - { - - 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]); - } - } - - } - - - 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) - { - - if (dbrType==DBR_CHAR) - { - std::cout << "SETTING PV=" << helper.getPVFromHandle(handleSet[i]) << " to " << (unsigned short) valSet[i] << std::endl; - } - else - { - 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); - - valSetA[0] = (CTYPE) valSet[i]; - - status=set(handleSet[i], dbrType, 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 Channels followed by a corresponding readback of Channels \n - * Method verifies whether or not the set/readback values agree within the given tolerance and timeout \n - * Method returns with ECA_NORMAL as soon as a match is reached - * \param handleSet input: vector of handleSet - * \param dbrType input: chtype of set value - * \param valSet input: vector of CTYPE values to set - * \param handleMatch input: vector of handles of readback channel - * \param tolerance input: CTYPE of tolerance margin - * \param timeout input: double value; maximum time allowed for agreement to occur - * \param printFlag input: bool, set to true for diagnostics - * \return ECA_NORMAL if all OK, else first ECAFE error encountered, else ECAFE_TIMEOUT_SET_AND_MATCH - */ - -template int Instant::compareAndMatchMany(std::vector handleSet, const chtype dbrType, std::vector valSet, std::vector handleMatch, - CTYPE tolerance, double timeout, bool printFlag) -{ -//template int Instant::setTriggerAndMatchMany(std::vector handleSet, chtype dbrType, std::vector valSet, -// std::vector handleAction, std::vector valAction, std::vector handleMatch, -// CTYPE tolerance, double timeout, bool printFlag){ -#define __METHOD__ "Instant::compareAndMatchMany(chtype, std::vectorvalSet, std::vectorhandleMatch, tolerance, timeout, printFlag)" - - - Connect connect; - CAFEStatus cstat; - - CTYPE valGetA[1]; //CTYPE valSetA[1]; - - status=ICAFE_NORMAL; - - - if (handleMatch.size() != valSet.size() ) - { - return ECAFE_HANDLE_MISMATCH_SET_AND_MATCH; - } - - for (size_t i=0; i< handleMatch.size(); ++i) - { - - if (!helper.isChannelConnected(handleMatch[i])) - { - std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - std::cout << "NOT ALL CHANNELS CONNECTED: " << std::endl; - - if (!helper.isChannelConnected(handleMatch[i])) - { - helper.printHandle(handleMatch[i]); - status=helper.getStatus(handleMatch[i]); - } - } - - } - - - if (status!=ICAFE_NORMAL) - { - return status; - } - - if(printFlag) - { - std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - } - - if (printFlag) - { - - - for (size_t i=0; i< handleMatch.size(); ++i) - { - - - if (dbrType==DBR_CHAR) - { - std::cout << "SETTING PV= " << helper.getPVFromHandle(handleSet[i]) << " to " << (unsigned short) valSet[i] << std::endl; - } - else - { - std::cout << "SETTING PV= " << helper.getPVFromHandle(handleSet[i]) << " to " << valSet[i] << std::endl; - } - - std::cout << "READBACK PV=" << helper.getPVFromHandle(handleMatch[i]) - << " tolerance= " << fabs( (double) tolerance) << std::endl; - std::cout << "TIME ALLOWED FOR MATCH IS " << timeout << " (sec) " << std::endl; - - } //for - - } //if - - - std::vector valSetUpper; - std::vector valSetLower; - - std::vector monitorID; - std::vector statMonitor; - std::vector nMonitors; - std::vector valGet; - - - std::vector nelemPreviousCache; - - valSetUpper.reserve( valSet.size()); - - - valSetLower.reserve( valSet.size()); - monitorID.reserve( valSet.size()); - statMonitor.reserve( valSet.size()); - valGet.reserve( valSet.size()); - nMonitors.reserve( valSet.size() ); - - - nelemPreviousCache.reserve( valSet.size()); - - - for (size_t i=0; i< valSet.size(); ++i) - { - - - switch (dbrType) - { - case DBR_LONG : - case DBR_SHORT : - case DBR_ENUM: - valSetUpper[i] = valSet[i] + abs((int)tolerance); - valSetLower[i] = valSet[i] - abs((int)tolerance); - break; - case DBR_CHAR : - valSetUpper[i] = (unsigned short) valSet[i] + abs((unsigned short) tolerance); - valSetLower[i] = (unsigned short) valSet[i] - abs((unsigned short) tolerance); - break; - case DBR_FLOAT: - case DBR_DOUBLE: - default: - - valSetUpper[i] = (CTYPE) (valSet[i] + fabs((double)tolerance)); - valSetLower[i] = (CTYPE) (valSet[i] - fabs((double)tolerance)); - - break; - } - - - - std::vector mpVMatch; - mpVMatch.clear(); - - helper.getMonitorPolicyVector(handleMatch[i], mpVMatch); - - - nMonitors[i]=mpVMatch.size(); - - monitorID[i]=0; - - ////valGetA[0][i]=0; - valGet[i]=0; - - statMonitor[i]=ICAFE_NORMAL; - - } - - - - for (size_t i=0; i< handleMatch.size(); ++i) - { - - //what is monitorpolicy?? - if (nMonitors[i]==0) - { - - unsigned int _nelemPrevious, _nelemRequestedCheck=0; - unsigned int _nelemRequested=1; - _nelemPrevious=helper.getNelemClient(handleMatch[i]); - //Check the number of elements requested? - if (_nelemPrevious>1) - { - _nelemRequestedCheck = helper.setNelem(handleMatch[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; - } - } - - //first do get to update cache before monitor starts - status=Instant::get(handleMatch[i], dbrType, valGetA); - - valGet[i]=valGetA[0]; - - if (_nelemPrevious>1) - { - helper.setNelem(handleMatch[i],_nelemPrevious); - } - - - if (status!=ICAFE_NORMAL) - { - std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - cstat.report(status); - } - - ChannelWhenToFlushSendBufferPolicyKind whenKind= - connect.channelMonitorPolicy.getWhenToFlushSendBuffer(); - connect.channelMonitorPolicy.setWhenToFlushSendBuffer(FLUSH_AUTOMATIC); - - statMonitor[i]=connect.monitorStart(handleMatch[i], monitorID[i]); - - if (statMonitor[i]!=ICAFE_NORMAL) - { - std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - cstat.report(statMonitor[i]); - } - else - { - if(printFlag) - { - std::cout << "MONITOR NOW IN PLACE FOR READBACK CHANNEL " << helper.getPVFromHandle(handleMatch[i]) << " WITH ID=" << monitorID[i] << std::endl; - } - } - //revert to previous - if (whenKind != FLUSH_AUTOMATIC) - { - connect.channelMonitorPolicy.setWhenToFlushSendBuffer(whenKind); - } - - } //if nMonitors - - - - - - //No of elements to get from Cache - - //unsigned int nelemPreviousCheck=0; - unsigned int nelemRequested=1; - unsigned int nelemRequestedCheck=0; - nelemPreviousCache[i]=helper.getNelemRequest(handleMatch[i]); - - //Check the number of elements requested - //See set and Match; this needs to be checked - //Avoid problem when readback channel is the very same as the set(!) - if (nelemPreviousCache[i]>0 && helper.getNelemNative(handleMatch[i])>1) - { - nelemRequestedCheck = helper.setNelemToRetrieveFromCache(handleMatch[i],nelemRequested); - if (nelemRequestedCheck != nelemRequested) - { - std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - std::cout << "Internal CAFE FUNNY: Wanted to set the no. elements from: " - << nelemPreviousCache[i] << std::endl; - std::cout << "to: " << nelemRequested << " but got instead: " - << nelemRequestedCheck << std::endl; - } - } - - - } //for size_t - - - - - //start time - - - - - double timeElapsed=0; - double timeElapsed2=0; - double timeElapsedBase=0; - using namespace boost::posix_time; - - ptime timeStart(microsec_clock::local_time()); - - - for (size_t i=0; i< handleMatch.size(); ++i) - { - - valGetA[0]=0; - - status=Instant::getCache(handleMatch[i], dbrType, valGetA); - - valGet[i]=valGetA[0]; - - - if (status !=ICAFE_NORMAL) - { - std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - cstat.report(status); - } - - ///valGet[i]=valGetA[0][i]; - if (dbrType==DBR_CHAR) - { - valGet[i] = (unsigned short) valGetA[0]; - } - - if(printFlag) - { - //std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - if (dbrType==DBR_CHAR) - { - std::cout << "Current Cached Value = " << (unsigned short) valGet[i] << std::endl; - std::cout << "Lower/Upper Target Values = " << (unsigned short) valSetLower[i] << " and " << (unsigned short) valSetUpper[i] << std::endl; - } - else - { - std::cout << "Current Cached Value = " << valGet[i] << std::endl; - std::cout << "Lower/Upper Target Values = " << valSetLower[i] << " and " << valSetUpper[i] << std::endl; - } - } - - } //for size_t - - - - ptime timeEnd(microsec_clock::local_time()); - time_duration duration(timeEnd-timeStart); - timeElapsed= (double) duration.total_microseconds()/1000000.0; - - - for (size_t i=0; i< valSet.size(); ++i) - { - - - while ( (valGet[i]>valSetUpper[i] || valGet[i]1 && status==ICAFE_NORMAL) - { - - - for (size_t ij=0; ij< handleMatch.size(); ++ij) - { - status=Instant::getCache(handleMatch[ij], dbrType, valGetA); - valGet[ij]=valGetA[0]; - if (valGet[ij]>valSetUpper[ij] || valGet[ij]1) - { - nelemPreviousCheck= helper.setNelemToRetrieveFromCache(handleMatch[i],nelemPreviousCache[i]); - if (nelemPreviousCheck != nelemPreviousCache[i]) - { - 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: " << nelemPreviousCache[i] << " but got instead: " - << nelemPreviousCheck << std::endl; - } - } - - - - if (nMonitors[i]==0 && statMonitor[i]==ICAFE_NORMAL && printFlag) - { - std::cout << "MONITOR NOW STOPPED FOR READBACK CHANNEL " << helper.getPVFromHandle(handleMatch[i]) << " WITH ID =" << monitorID[i] << std::endl; - int statm; - statm=connect.monitorStop(handleMatch[i], monitorID[i]); - if (status==ICAFE_NORMAL) - { - status=statm; - } - } - - } //for - - - return status; -#undef __METHOD__ - -} - - - - - -/** - * \brief Set Channels followed by a corresponding readback of Channels \n - * Method verifies whether or not the set/readback values agree within the given tolerance and timeout \n - * Method returns with ECA_NORMAL as soon as a match is reached - * \param handleSet input: vector of handleSet - * \param dbrType input: chtype of set value - * \param valSet input: vector of CTYPE values to set - * \param handleMatch input: vector of handles of readback channel - * \param tolerance input: CTYPE of tolerance margin - * \param timeout input: double value; maximum time allowed for agreement to occur - * \param printFlag input: bool, set to true for diagnostics - * \return ECA_NORMAL if all OK, else first ECAFE error encountered, else ECAFE_TIMEOUT_SET_AND_MATCH - */ -template int Instant::setAndMatchMany(std::vector handleSet, chtype dbrType, std::vector valSet, std::vector handleMatch, - CTYPE tolerance, double timeout, bool printFlag) -{ -#define __METHOD__ "Instant::setAndMatchMany(std::vectorhandleSet, chtype, std::vectorvalSet, std::vectorhandleMatch, tolerance, timeout, printFlag)" - - Connect connect; - CAFEStatus cstat; - - CTYPE valGetA[1]; - CTYPE valSetA[1]; - - status=ICAFE_NORMAL; - - if (handleSet.size() != handleMatch.size() ) - { - return ECAFE_HANDLE_MISMATCH_SET_AND_MATCH; - } - - if (handleSet.size() != valSet.size() ) - { - return ECAFE_HANDLE_MISMATCH_SET_AND_MATCH; - } - - for (size_t i=0; i< handleSet.size(); ++i) - { - - if (!helper.isChannelConnected(handleSet[i]) - || !helper.isChannelConnected(handleMatch[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]); - } - if (!helper.isChannelConnected(handleMatch[i])) - { - helper.printHandle(handleMatch[i]); - status=helper.getStatus(handleMatch[i]); - } - } - - } - - - if (status!=ICAFE_NORMAL) - { - return status; - } - - if(printFlag) - { - std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - } - - - for (size_t i=0; i< handleSet.size(); ++i) - { - - - if (printFlag) - { - - if (dbrType==DBR_CHAR) - { - std::cout << "SETTING PV=" << helper.getPVFromHandle(handleSet[i]) << " to " << (unsigned short) valSet[i] << std::endl; - } - else - { - std::cout << "SETTING PV=" << helper.getPVFromHandle(handleSet[i]) << " to " << valSet[i] << std::endl; - } - - std::cout << "READBACK PV=" << helper.getPVFromHandle(handleMatch[i]) - << " tolerance= " << fabs( (double) tolerance) << std::endl; - std::cout << "TIME ALLOWED FOR MATCH IS " << timeout << " (sec) " << std::endl; - - } - - } - - - std::vector valSetUpper; - std::vector valSetLower; - - std::vector monitorID; - std::vector statMonitor; - std::vector nMonitors; - std::vector valGet; - - - std::vector nelemPreviousCache; - - valSetUpper.reserve( handleSet.size()); - - - valSetLower.reserve( handleSet.size()); - monitorID.reserve( handleSet.size()); - statMonitor.reserve( handleSet.size()); - valGet.reserve( handleSet.size()); - nMonitors.reserve( handleSet.size() ); - - - nelemPreviousCache.reserve(handleSet.size()); - - - for (size_t i=0; i< handleSet.size(); ++i) - { - - - switch (dbrType) - { - case DBR_LONG : - case DBR_SHORT : - case DBR_ENUM: - valSetUpper[i] = valSet[i] + abs((int)tolerance); - valSetLower[i] = valSet[i] - abs((int)tolerance); - break; - case DBR_CHAR : - valSetUpper[i] = (unsigned short) valSet[i] + abs((unsigned short) tolerance); - valSetLower[i] = (unsigned short) valSet[i] - abs((unsigned short) tolerance); - break; - case DBR_FLOAT: - case DBR_DOUBLE: - default: - - valSetUpper[i] = (CTYPE) (valSet[i] + fabs((double)tolerance)); - valSetLower[i] = (CTYPE) (valSet[i] - fabs((double)tolerance)); - - break; - } - - - - std::vector mpVMatch; - mpVMatch.clear(); - - helper.getMonitorPolicyVector(handleMatch[i], mpVMatch); - - - nMonitors[i]=mpVMatch.size(); - - monitorID[i]=0; - - ////valGetA[0][i]=0; - valGet[i]=0; - - statMonitor[i]=ICAFE_NORMAL; - - } - - - - for (size_t i=0; i< handleSet.size(); ++i) - { - - //what is monitorpolicy?? - if (nMonitors[i]==0) - { - - unsigned int _nelemPrevious, _nelemRequestedCheck=0; - unsigned int _nelemRequested=1; - _nelemPrevious=helper.getNelemClient(handleMatch[i]); - //Check the number of elements requested? - if (_nelemPrevious>1) - { - _nelemRequestedCheck = helper.setNelem(handleMatch[i],_nelemRequested); //change handleSet to handleMatch 23/3/17 - 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; - } - } - - //first do get to update cache before monitor starts - status=Instant::get(handleMatch[i], dbrType, valGetA); - - valGet[i]=valGetA[0]; - - if (_nelemPrevious>1) - { - helper.setNelem(handleMatch[i],_nelemPrevious); //change handleSet to handleMatch 23/3/17 - } - - - if (status!=ICAFE_NORMAL) - { - std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - cstat.report(status); - } - - ChannelWhenToFlushSendBufferPolicyKind whenKind= - connect.channelMonitorPolicy.getWhenToFlushSendBuffer(); - connect.channelMonitorPolicy.setWhenToFlushSendBuffer(FLUSH_AUTOMATIC); - - statMonitor[i]=connect.monitorStart(handleMatch[i], monitorID[i]); - - if (statMonitor[i]!=ICAFE_NORMAL) - { - std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - cstat.report(statMonitor[i]); - } - else - { - if(printFlag) - { - std::cout << "MONITOR NOW IN PLACE FOR READBACK CHANNEL " << helper.getPVFromHandle(handleMatch[i]) << " WITH ID=" << monitorID[i] << std::endl; - } - } - //revert to previous - if (whenKind != FLUSH_AUTOMATIC) - { - connect.channelMonitorPolicy.setWhenToFlushSendBuffer(whenKind); - } - - } //if nMonitors - - ////valSetA[0][i]=valSet[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); - - - valSetA[0] = (CTYPE) valSet[i]; - - status=set(handleSet[i], dbrType, 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; - } - } - - - //No of elements to get from Cache - - nelemPreviousCheck=0; - nelemRequested=1; - nelemRequestedCheck=0; - nelemPreviousCache[i]=helper.getNelemRequest(handleMatch[i]); - - //Check the number of elements requested - //See set and Match; this needs to be checked - //Avoid problem when readback channel is the very same as the set(!) - if (nelemPreviousCache[i]>0 && helper.getNelemNative(handleMatch[i])>1) - { - nelemRequestedCheck = helper.setNelemToRetrieveFromCache(handleMatch[i],nelemRequested); - if (nelemRequestedCheck != nelemRequested) - { - std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - std::cout << "Internal CAFE FUNNY: Wanted to set the no. elements from: " - << nelemPreviousCache[i] << std::endl; - std::cout << "to: " << nelemRequested << " but got instead: " - << nelemRequestedCheck << std::endl; - } - } - - - } //for size_t - - //start time - - - - - double timeElapsed=0; - double timeElapsed2=0; - double timeElapsedBase=0; - using namespace boost::posix_time; - - ptime timeStart(microsec_clock::local_time()); - - - for (size_t i=0; i< handleSet.size(); ++i) - { - - - - valGetA[0]=0; - - status=Instant::getCache(handleMatch[i], dbrType, valGetA); - - valGet[i]=valGetA[0]; - - - - if (status !=ICAFE_NORMAL) - { - std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - cstat.report(status); - } - - ///valGet[i]=valGetA[0][i]; - if (dbrType==DBR_CHAR) - { - valGet[i] = (unsigned short) valGetA[0]; - } - - if(printFlag) - { - //std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - if (dbrType==DBR_CHAR) - { - std::cout << "Current Cached Value = " << (unsigned short) valGet[i] << std::endl; - std::cout << "Lower/Upper Target Values = " << (unsigned short) valSetLower[i] << " and " << (unsigned short) valSetUpper[i] << std::endl; - } - else - { - std::cout << "Current Cached Value = " << valGet[i] << std::endl; - std::cout << "Lower/Upper Target Values = " << valSetLower[i] << " and " << valSetUpper[i] << std::endl; - } - } - - } //for size_t - - - - ptime timeEnd(microsec_clock::local_time()); - time_duration duration(timeEnd-timeStart); - timeElapsed= (double) duration.total_microseconds()/1000000.0; - - - for (size_t i=0; i< handleSet.size(); ++i) - { - - - while ( (valGet[i]>valSetUpper[i] || valGet[i]1 && status==ICAFE_NORMAL) - { - - - - for (size_t ij=0; ij< handleMatch.size(); ++ij) - { - status=Instant::getCache(handleMatch[ij], dbrType, valGetA); - valGet[ij]=valGetA[0]; - if (valGet[ij]>valSetUpper[ij] || valGet[ij]1) - { - nelemPreviousCheck= helper.setNelemToRetrieveFromCache(handleMatch[i],nelemPreviousCache[i]); - if (nelemPreviousCheck != nelemPreviousCache[i]) - { - 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: " << nelemPreviousCache[i] << " but got instead: " - << nelemPreviousCheck << std::endl; - } - } - - - - if (nMonitors[i]==0 && statMonitor[i]==ICAFE_NORMAL && printFlag) - { - std::cout << "MONITOR NOW STOPPED FOR READBACK CHANNEL " << helper.getPVFromHandle(handleMatch[i]) << " WITH ID =" << monitorID[i] << std::endl; - int statm; - statm=connect.monitorStop(handleMatch[i], monitorID[i]); - if (status==ICAFE_NORMAL) - { - status=statm; - } - } - - } //for - - - return status; -#undef __METHOD__ -} - - - -/** - * \brief Set Channel 1 followed by a readback of Channel 2 \n - * Method verifies whether or not the 2 values agree within the given tolerance and timeout \n - * Method returns with ECA_NORMAL as soon as a match is reached - * \param handleSet input: handleSet - * \param dbrType input: chtype of set value - * \param valSet input: CTYPE value to set - * \param handleMatch input: handle of readback channel - * \param tolerance input: CTYPE of tolerance margin - * \param timeout input: double value; maximum time allowed for agreement to occur - * \param printFlag input: bool, set to true for diagnostics - * \return ECA_NORMAL if all OK else first ECAFE error encountered - */ -template int Instant::setAndMatch(const unsigned int handleSet, const chtype dbrType, CTYPE valSet, const unsigned int handleMatch, - CTYPE tolerance, double timeout, bool printFlag) -{ -#define __METHOD__ "Instant::setAndMatch(handleSet, dbrType, valSet, handleMatch, tolerance, timeout, printFlag)" - //check both handles exists before proceeding - - Connect connect; - CAFEStatus cstat; - - if (!helper.isChannelConnected(handleSet) - || !helper.isChannelConnected(handleMatch)) - { - std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - std::cout << "NOT ALL CHANNELS CONNECTED: " << std::endl; - if (!helper.isChannelConnected(handleSet)) - { - helper.printHandle(handleSet); - return helper.getStatus(handleSet); - } - if (!helper.isChannelConnected(handleMatch)) - { - helper.printHandle(handleMatch); - return helper.getStatus(handleMatch); - } - } - - if (printFlag) - { - - if (dbrType==DBR_CHAR) - { - std::cout << "SETTING PV=" << helper.getPVFromHandle(handleSet) << " to " << (unsigned short) valSet << std::endl; - } - else - { - std::cout << "SETTING PV=" << helper.getPVFromHandle(handleSet) << " to " << valSet << std::endl; - } - std::cout << "READBACK PV=" << helper.getPVFromHandle(handleMatch) - << " tolerance= " << fabs((double)tolerance) << std::endl; - std::cout << "TIME ALLOWED FOR MATCH " << timeout << " (sec) " << std::endl; - } - - std::vector mpVMatch; - helper.getMonitorPolicyVector(handleMatch, mpVMatch); - - unsigned short nMonitors=mpVMatch.size(); - - - CTYPE valSetUpper; - CTYPE valSetLower; - - - switch (dbrType) - { - case DBR_LONG : - case DBR_SHORT : - case DBR_ENUM: - valSetUpper = valSet + abs((int)tolerance); - valSetLower = valSet - abs((int)tolerance); - break; - case DBR_CHAR : - valSetUpper = (unsigned short) valSet + abs((unsigned short) tolerance); - valSetLower = (unsigned short) valSet - abs((unsigned short) tolerance); - break; - case DBR_FLOAT: - case DBR_DOUBLE: - default: - valSetUpper = (CTYPE) (valSet + fabs((double)tolerance)); - valSetLower = (CTYPE) (valSet - fabs((double)tolerance)); - break; - } - - - CTYPE valGetA[1]= {0}; - CTYPE valGet=valGetA[0]; - - int statMonitor=ICAFE_NORMAL; - - unsigned int monitorIDis=0; - - //what is monitorpolicy?? - if (nMonitors==0) - { - - unsigned int _nelemPrevious, _nelemRequestedCheck=0; - unsigned int _nelemRequested=1; - _nelemPrevious=helper.getNelemClient(handleMatch); - //Check the number of elements requested? - if (_nelemPrevious>1) - { - _nelemRequestedCheck = helper.setNelem(handleMatch,_nelemRequested); ////change handleSet to handleMatch 23/3/17 - 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; - } - } - - //first do get to update cache before monitor starts - status=Instant::get(handleMatch, dbrType, valGetA); - //valGet=valGetA[0]; - - - if (_nelemPrevious>1) - { - helper.setNelem(handleMatch,_nelemPrevious); ////change handleSet to handleMatch 23/3/17 - } - - if (status!=ICAFE_NORMAL) - { - std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - cstat.report(status); - } - - ChannelWhenToFlushSendBufferPolicyKind whenKind= - connect.channelMonitorPolicy.getWhenToFlushSendBuffer(); - connect.channelMonitorPolicy.setWhenToFlushSendBuffer(FLUSH_AUTOMATIC); - - statMonitor=connect.monitorStart(handleMatch, monitorIDis); - - if (statMonitor!=ICAFE_NORMAL) - { - std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - cstat.report(statMonitor); - } - else - { - if(printFlag) - { - std::cout << "MONITOR STARTED WITH ID=" << monitorIDis<< std::endl; - } - } - //revert to previous - if (whenKind != FLUSH_AUTOMATIC) - { - connect.channelMonitorPolicy.setWhenToFlushSendBuffer(whenKind); - } - } - - CTYPE valSetA[1]; - valSetA[0]=valSet; - - //set No of Elements to 1 - - unsigned int nelemPrevious, nelemRequestedCheck=0; - unsigned int nelemRequested=1; - nelemPrevious=helper.getNelemClient(handleSet); - //Check the number of elements requested? - if (nelemPrevious>1) - { - nelemRequestedCheck = helper.setNelem(handleSet,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, polPrevious); - - polNow.setMethodKind(WITHOUT_CALLBACK); - polNow.setWaitKind(WAIT); - polNow.setWhenToFlushSendBuffer(FLUSH_AUTOMATIC); - - policyHelper.setChannelRequestPolicyPut(handleSet, polNow); - - status=set(handleSet, dbrType, valSetA); - - if (status!=ICAFE_NORMAL) - { - std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - cstat.report(status); - } - - policyHelper.setChannelRequestPolicyPut(handleSet, polPrevious); - - unsigned int nelemPreviousCheck=nelemPrevious; - nelemRequested=1; - //Switch back to previous value - //if (nelemPrevious>1) { - if(helper.getNelemRequest(handleSet)!= nelemPrevious) - { - nelemPreviousCheck= helper.setNelem(handleSet,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; - } - } - - - //start time - - double timeElapsed=0; - double timeElapsed2=0; - double timeElapsedBase=0; - using namespace boost::posix_time; - - ptime timeStart(microsec_clock::local_time()); - - // PVDataHolder pvdMatch; - // status=getCache(handleMatch, dbrType, pvdMatch); - - - //No of elements to get from Cache - - nelemPreviousCheck=0; - nelemRequested=1; - nelemRequestedCheck=0; - nelemPrevious=helper.getNelemRequest(handleMatch); - - - - //Check the number of elements requested - if (nelemPrevious>0) - { - nelemRequestedCheck = helper.setNelemToRetrieveFromCache(handleMatch,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; - } - } - - - - - - status=Instant::getCache(handleMatch, dbrType, valGetA); - - - - - ///if (dbrType==DBR_CHAR) {valGet = (unsigned short) valGetA[0];} - - - - if (status !=ICAFE_NORMAL) - { - std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - cstat.report(status); - } - - - - - if(printFlag) - { - //std::cout << __METHOD__ << std::endl; - std::cout << "Current Cached Value = " ; - if (dbrType==DBR_CHAR) - { - std::cout << (unsigned short) valGetA[0] << std::endl; - std::cout << "Lower/Upper Target Values = " << (unsigned short) valSetLower << " and " << (unsigned short) valSetUpper << std::endl; - } - else - { - std::cout << valGetA[0] << std::endl; - std::cout << "Lower/Upper Target Values = " << valSetLower << " and " << valSetUpper << std::endl; - } - } - - - - ptime timeEnd(microsec_clock::local_time()); - time_duration duration(timeEnd-timeStart); - timeElapsed= (double) duration.total_microseconds()/1000000.0; - - - - if (dbrType==DBR_CHAR) - { - valGet= (unsigned short) valGetA[0]; - } - - else - { - valGet=valGetA[0]; - } - - - - while ( (valGet>valSetUpper || valGetvalSetUpper || pvdMatch.getAsDouble()1) { - nelemRequestedCheck = helper.setNelemToRetrieveFromCache(handleMatch,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; - } - } - */ - - status=Instant::getCache(handleMatch, dbrType, valGetA); - - valGet=valGetA[0]; - - if (dbrType==DBR_CHAR) - { - valGet = (unsigned short) valGetA[0]; - } - //std::cout << "getCache(handleMatch, dbrType, valGetA) = " << valGet << std::endl; - //std::cout << valSetUpper << " U/L " << valSetLower << std::endl; - - ptime timeEnd(microsec_clock::local_time()); - time_duration duration(timeEnd-timeStart); - timeElapsed= (double) duration.total_microseconds()/1000000.0; - - timeElapsed2=timeElapsed-timeElapsedBase; - - if (printFlag && timeElapsed2>1 && status==ICAFE_NORMAL) - { - - if (dbrType==DBR_CHAR) - { - std::cout << "SET VALUE " << (unsigned short) valSet << " CURRENT VALUE " << (unsigned short) valGetA[0] - << " TimeElapsed " << timeElapsed << " (sec) " << std::endl; - } - else - { - std::cout << "SET VALUE " << valSet << " CURRENT VALUE " << valGetA[0] //pvdMatch.getAsDouble() - << " TimeElapsed " << timeElapsed << " (sec) " << std::endl; - } - - - timeElapsedBase=timeElapsed; - - } - - -#if HAVE_BOOST_THREAD - boost::this_thread::sleep_for(boost::chrono::microseconds(20)); -#else -#if HAVE_LINUX - usleep(20); -#endif -#endif - } - - - if (timeout <=timeElapsed ) - { - std::cout << "*****TIMEOUT REACHED****** AFTER " << timeout << " (sec) " << std::endl; - - status=ECAFE_TIMEOUT_SET_AND_MATCH; - } - else - { - if (printFlag) - { - status=Instant::getCache(handleMatch, dbrType, valGetA); - if (dbrType==DBR_CHAR) - { - std::cout << "GAME SET AND MATCH: SET VALUE= " << (unsigned short) valSet - << " LAST VALUE READ= " << (unsigned short) valGetA[0] //pvdMatch.getAsDouble() - << " TimeElapsed " << timeElapsed << " (sec) " << std::endl; - } - else - { - std::cout << "GAME SET AND MATCH: SET VALUE= " << valSet << " LAST VALUE READ= " << valGetA[0] //pvdMatch.getAsDouble() - << " TimeElapsed " << timeElapsed << " (sec) " << std::endl; - } - - } - } - - - - - if (nelemPrevious>1) - { - nelemPreviousCheck= helper.setNelemToRetrieveFromCache(handleMatch,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; - } - } - - - - - if (nMonitors==0 && statMonitor==ICAFE_NORMAL) - { - if (monitorIDis !=0 ) - { - std::cout << "STOPPED MONITOR WITH ID =" << monitorIDis << std::endl; - int statm; - statm=connect.monitorStop(handleMatch, monitorIDis); - - if (status==ICAFE_NORMAL) - { - status=statm; - } - } - } - - return status; -#undef __METHOD__ -} - - -/** - * \brief Set Channel followed by a corresponding readback of Channel \n - * Method verifies whether or not the set/readback values agree within the given tolerance and timeout \n - * Method returns with ECA_NORMAL as soon as a match is reached - * \param dbrType input: chtype of set value - * \param valSet input: CTYPE value to set - * \param handleMatch input: handle of readback channel - * \param tolerance input: CTYPE of tolerance margin - * \param timeout input: double value; maximum time allowed for agreement to occur - * \param printFlag input: bool, set to true for diagnostics - * \return ECA_NORMAL if all OK else first ECAFE error encountered - */ -template int Instant::match(const chtype dbrType, CTYPE valSet, unsigned int handleMatch, - CTYPE tolerance, double timeout, bool printFlag) -{ -#define __METHOD__ "Instant::match(const chtype dbrType, CTYPE valSet, unsigned int handleMatch, \ - CTYPE tolerance,double timeout, bool printFlag)" - - std::vector valSetV; - std::vectorhandleMatchV; - valSetV.reserve(1); - handleMatchV.reserve(1); - valSetV.push_back(valSet); - handleMatchV.push_back(handleMatch); - - return matchMany(dbrType, valSetV, handleMatchV, tolerance, timeout, printFlag); -#undef __METHOD__ -} - - -/** - * \brief Set Channels followed by a corresponding readback of Channels \n - * Method verifies whether or not the set/readback values agree within the given tolerance and timeout \n - * Method returns with ECA_NORMAL as soon as a match is reached - * \param dbrType input: chtype of set value - * \param valSet input: vector of CTYPE values to set - * \param handleMatch input: vector of handles of readback channel - * \param tolerance input: CTYPE of tolerance margin - * \param timeout input: double value; maximum time allowed for agreement to occur - * \param printFlag input: bool, set to true for diagnostics - * \return ECA_NORMAL if all OK else first ECAFE error encountered - */ -template int Instant::matchMany(const chtype dbrType, std::vector valSet, std::vector handleMatch, - CTYPE tolerance, double timeout, bool printFlag) -{ -#define __METHOD__ "Instant::matchMany(const chtype dbrType, std::vectorvalSet, std::vectorhandleMatch, \ - CTYPE tolerance, double timeout, bool printFlag)" - - - Connect connect; - CAFEStatus cstat; - - CTYPE valGetA[1]; - ////CTYPE valSetA[1]; - - status=ICAFE_NORMAL; - - - if (handleMatch.size() != valSet.size() ) - { - return ECAFE_HANDLE_MISMATCH_SET_AND_MATCH; - } - - for (size_t i=0; i< handleMatch.size(); ++i) - { - if ( !helper.isChannelConnected(handleMatch[i])) - { - std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - std::cout << "NOT ALL CHANNELS CONNECTED: " << std::endl; - - helper.printHandle(handleMatch[i]); - status=helper.getStatus(handleMatch[i]); - } - } - - - if (status!=ICAFE_NORMAL) - { - return status; - } - - - for (size_t i=0; i< handleMatch.size(); ++i) - { - if (printFlag) - { - std::cout << "SET VALUE IS = " << valSet[i] << std::endl; - std::cout << "READBACK PV=" << helper.getPVFromHandle(handleMatch[i]) - << " tolerance= " << fabs((double)tolerance) << std::endl; - std::cout << "TIME ALLOWED FOR MATCH IS " << timeout << " (sec) " << std::endl; - } - } - - - std::vector valSetUpper; - std::vector valSetLower; - - std::vector monitorID; - std::vector statMonitor; - std::vector nMonitors; - std::vector valGet; - - std::vector nelemPreviousCache; - - valSetUpper.reserve( handleMatch.size()); - valSetLower.reserve( handleMatch.size()); - monitorID.reserve( handleMatch.size()); - statMonitor.reserve( handleMatch.size()); - valGet.reserve( handleMatch.size()); - nMonitors.reserve( handleMatch.size() ); - - nelemPreviousCache.reserve(handleMatch.size()); - - for (size_t i=0; i< handleMatch.size(); ++i) - { - - switch (dbrType) - { - case DBR_LONG : - case DBR_SHORT : - case DBR_ENUM: - valSetUpper[i] = valSet[i] + abs((int)tolerance); - valSetLower[i] = valSet[i] - abs((int)tolerance); - break; - case DBR_CHAR : - valSetUpper[i] = (unsigned short) valSet[i] + abs((unsigned short) tolerance); - valSetLower[i] = (unsigned short) valSet[i] - abs((unsigned short) tolerance); - break; - case DBR_FLOAT: - case DBR_DOUBLE: - default: - - valSetUpper[i] = (CTYPE) (valSet[i] + fabs((double)tolerance)); - valSetLower[i] = (CTYPE) (valSet[i] - fabs((double)tolerance)); - - break; - } - - - std::vector mpVMatch; - mpVMatch.clear(); - - helper.getMonitorPolicyVector(handleMatch[i], mpVMatch); - - nMonitors[i]=mpVMatch.size(); - - monitorID[i]=0; - - ////valGetA[0][i]=0; - valGet[i]=0; - - statMonitor[i]=ICAFE_NORMAL; - - } - - - - for (size_t i=0; i< handleMatch.size(); ++i) - { - - //what is monitorpolicy?? - if (nMonitors[i]==0) - { - - unsigned int _nelemPrevious, _nelemRequestedCheck=0; - unsigned int _nelemRequested=1; - _nelemPrevious=helper.getNelemClient(handleMatch[i]); - //Check the number of elements requested? - if (_nelemPrevious>1) - { - _nelemRequestedCheck = helper.setNelem(handleMatch[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; - } - } - - //first do get to update cache before monitor starts - status=Instant::get(handleMatch[i], dbrType, valGetA); - - valGet[i]=valGetA[0]; - - if (_nelemPrevious>1) - { - helper.setNelem(handleMatch[i],_nelemPrevious); - } - - - if (status!=ICAFE_NORMAL) - { - std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - cstat.report(status); - } - - ChannelWhenToFlushSendBufferPolicyKind whenKind= - connect.channelMonitorPolicy.getWhenToFlushSendBuffer(); - connect.channelMonitorPolicy.setWhenToFlushSendBuffer(FLUSH_AUTOMATIC); - - statMonitor[i]=connect.monitorStart(handleMatch[i], monitorID[i]); - - if (statMonitor[i]!=ICAFE_NORMAL) - { - std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - cstat.report(statMonitor[i]); - } - else - { - if(printFlag) - { - std::cout << "MONITOR STARTED WITH ID=" << monitorID[i] << std::endl; - } - } - //revert to previous - if (whenKind != FLUSH_AUTOMATIC) - { - connect.channelMonitorPolicy.setWhenToFlushSendBuffer(whenKind); - } - - } //if nMonitors - - ////valSetA[0][i]=valSet[i]; - - //set No of Elements to 1 - - unsigned int nelemPrevious, nelemRequestedCheck=0; - unsigned int nelemRequested=1; - - - nelemPrevious=helper.getNelemClient(handleMatch[i]); - //Check the number of elements requested? - if (nelemPrevious>1) - { - nelemRequestedCheck = helper.setNelem(handleMatch[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; - } - } - - //No of elements to get from Cache - - ////unsigned int nelemPreviousCheck=0; - nelemRequested=1; - nelemRequestedCheck=0; - nelemPreviousCache[i]=helper.getNelemRequest(handleMatch[i]); - - //Check the number of elements requested - //See set and Match; this needs to be checked - //Avoid problem when readback channel is the very same as the set(!) - if (nelemPreviousCache[i]>0 && helper.getNelemNative(handleMatch[i])>1) - { - nelemRequestedCheck = helper.setNelemToRetrieveFromCache(handleMatch[i],nelemRequested); - if (nelemRequestedCheck != nelemRequested) - { - std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - std::cout << "Internal CAFE FUNNY: Wanted to set the no. elements from: " - << nelemPreviousCache[i] << std::endl; - std::cout << "to: " << nelemRequested << " but got instead: " - << nelemRequestedCheck << std::endl; - } - } - - } //if size_t - - //start time - - double timeElapsed=0; - double timeElapsed2=0; - double timeElapsedBase=0; - using namespace boost::posix_time; - - ptime timeStart(microsec_clock::local_time()); - - - for (size_t i=0; i< handleMatch.size(); ++i) - { - - valGetA[0]=0; - - status=Instant::getCache(handleMatch[i], dbrType, valGetA); - - valGet[i]=valGetA[0]; - - if (status !=ICAFE_NORMAL) - { - std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - cstat.report(status); - } - - ///valGet[i]=valGetA[0][i]; - if (dbrType==DBR_CHAR) - { - valGet[i] = (unsigned short) valGet[i]; - } - - if(printFlag) - { - std::cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << std::endl; - std::cout << "Current Cached Value = " << valGet[i] << std::endl; - std::cout << "Lower/Upper Target Values = " << valSetLower[i] << " and " << valSetUpper[i] << std::endl; - } - - } //for size_t - - - - ptime timeEnd(microsec_clock::local_time()); - time_duration duration(timeEnd-timeStart); - timeElapsed= (double) duration.total_microseconds()/1000000.0; - - - for (size_t i=0; i< handleMatch.size(); ++i) - { - - - while ( (valGet[i]>valSetUpper[i] || valGet[i]1 && status==ICAFE_NORMAL) - { - - for (size_t ij=0; ij< handleMatch.size(); ++ij) - { - status=Instant::getCache(handleMatch[ij], dbrType, valGetA); - valGet[ij]=valGetA[0]; - if (valGet[ij]>valSetUpper[ij] || valGet[ij]1) - { - nelemPreviousCheck= helper.setNelemToRetrieveFromCache(handleMatch[i],nelemPreviousCache[i]); - if (nelemPreviousCheck != nelemPreviousCache[i]) - { - 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: " << nelemPreviousCache[i] << " but got instead: " - << nelemPreviousCheck << std::endl; - } - } - - - - if (nMonitors[i]==0 && statMonitor[i]==ICAFE_NORMAL) - { - std::cout << "STOPPING MONITOR WITH ID =" << monitorID[i] << std::endl; - int statm; - statm=connect.monitorStop(handleMatch[i], monitorID[i]); - if(status==ICAFE_NORMAL) - { - status=statm; - } - } - - } //for - - - return status; -#undef __METHOD__ -} - - - - - -#endif // instant.cpp - - - - - - - diff --git a/include/instant.h b/include/instant.h index 32e89aa..a81db85 100644 --- a/include/instant.h +++ b/include/instant.h @@ -812,6 +812,26 @@ template int Instant::getCache(const unsigned int _handle return ICAFE_CS_CLOSED; } + + //Reset any put error + if ( (*it_handle).getStatus() == ECAFE_NOWTACCESS || + (*it_handle).getStatus() == ECA_PUTFAIL || + (*it_handle).getStatus() == ECA_PUTCBINPROG) { + if(MUTEX) + { + cafeMutex.lock(); + }; //lock + //std::cout << "getStatus - before:" << (*it_handle).getStatus() << std::endl; + handle_index.modify(it_handle, change_status(ICAFE_NORMAL)); + //std::cout << "getStatus - after:" << (*it_handle).getStatus() << std::endl; + if(MUTEX) + { + cafeMutex.unlock(); + }; //unlock + } + + + // Meant for use in callbacks in monitors! // Does not check what the client is requesting. diff --git a/include/makefile b/include/makefile index 379226e..0b9bd28 100644 --- a/include/makefile +++ b/include/makefile @@ -86,8 +86,8 @@ host_triplet = x86_64-unknown-linux-gnu #if HAVE_PYTHON_ #include_HEADERS += PyCafe_api.h #endif -am__append_2 = PyCafe.h -#am__append_3 = PyCafe_api.h +#am__append_2 = PyCafe.h +am__append_3 = PyCafe_api.h subdir = include DIST_COMMON = $(srcdir)/makefile.in $(srcdir)/makefile.am \ $(am__include_HEADERS_DIST) @@ -129,7 +129,7 @@ am__include_HEADERS_DIST = config.h cafe.h cafeCache.h cafeConvert.h \ conduitFriends.h connect.h defines.h deviceCollection.h \ exceptions.h exceptionsHelper.h global.h enumStrings.h \ granules.h handleHelper.h hashConduit.h helper.h instant.h \ - instant.cpp loadCollectionXMLParser.h loadGroupXMLParser.h \ + 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 \ @@ -188,9 +188,9 @@ CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = ${SHELL} /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/missing aclocal-1.13 AMTAR = $${TAR-tar} -AM_CPPFLAGS = -fexceptions -fPIC -std=c++1z -I/usr/local/epics/base-7/include/ -I/usr/local/epics/base-7/include/os/Linux -I/usr/local/epics/base-7/include/compiler/gcc -I/opt/gfa/cafe/boost/boost_1_61_0/include/boost -I/opt/gfa/cafe/boost/boost_1_61_0/include -I/opt/gfa/python-3.7/latest/include/python3.7m -I/opt/gfa/python-3.7/latest/lib/python3.7/site-packages/numpy/core/include -I/opt/gfa/python-3.7/latest/include/qt -I/opt/gfa/python-3.7/latest/include/qt/QtCore -I/opt/gfa/python-3.7/latest/include/qt/QtXml +AM_CPPFLAGS = -fexceptions -fPIC -std=c++1z -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/opt/gfa/python-3.7/latest/include/qt -I/opt/gfa/python-3.7/latest/include/qt/QtCore -I/opt/gfa/python-3.7/latest/include/qt/QtXml AM_DEFAULT_VERBOSITY = 1 -AM_LDFLAGS = -L/usr/local/epics/base-7/lib/RHEL7-x86_64 -Wl,-rpath,/usr/local/epics/base-7/lib/RHEL7-x86_64 -L/opt/gfa/python-3.7/latest/lib -Wl,-rpath,/opt/gfa/python-3.7/latest/lib -L/opt/gfa/python-3.7/latest/lib -Wl,-rpath,/opt/gfa/python-3.7/latest/lib +AM_LDFLAGS = -L/usr/local/epics/base/lib/RHEL7-x86_64 -Wl,-rpath,/usr/local/epics/base/lib/RHEL7-x86_64 -L/opt/gfa/python-3.7/latest/lib -Wl,-rpath,/opt/gfa/python-3.7/latest/lib AR = ar AUTOCONF = ${SHELL} /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/missing autoconf AUTOHEADER = ${SHELL} /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/missing autoheader @@ -201,7 +201,7 @@ CC = /opt/psi/Programming/gcc/7.3.0/bin/gcc CCDEPMODE = depmode=gcc3 CFLAGS = -g -O2 CPP = /opt/psi/Programming/gcc/7.3.0/bin/gcc -E -CPPFLAGS = -fexceptions -fPIC -std=c++1z -I/usr/local/epics/base-7/include/ -I/usr/local/epics/base-7/include/os/Linux -I/usr/local/epics/base-7/include/compiler/gcc -I/opt/gfa/cafe/boost/boost_1_61_0/include/boost -I/opt/gfa/cafe/boost/boost_1_61_0/include -I/opt/gfa/python-3.7/latest/include/python3.7m -I/opt/gfa/python-3.7/latest/lib/python3.7/site-packages/numpy/core/include -I/opt/gfa/python-3.7/latest/include/qt -I/opt/gfa/python-3.7/latest/include/qt/QtCore -I/opt/gfa/python-3.7/latest/include/qt/QtXml +CPPFLAGS = -fexceptions -fPIC -std=c++1z -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/opt/gfa/python-3.7/latest/include/qt -I/opt/gfa/python-3.7/latest/include/qt/QtCore -I/opt/gfa/python-3.7/latest/include/qt/QtXml CXX = /opt/psi/Programming/gcc/7.3.0/bin/g++ CXXCPP = /opt/psi/Programming/gcc/7.3.0/bin/g++ -E CXXDEPMODE = depmode=gcc3 @@ -225,9 +225,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-7/lib/RHEL7-x86_64 -Wl,-rpath,/usr/local/epics/base-7/lib/RHEL7-x86_64 -L/opt/gfa/python-3.7/latest/lib -Wl,-rpath,/opt/gfa/python-3.7/latest/lib -L/opt/gfa/python-3.7/latest/lib -Wl,-rpath,/opt/gfa/python-3.7/latest/lib +LDFLAGS = -L/usr/local/epics/base/lib/RHEL7-x86_64 -Wl,-rpath,/usr/local/epics/base/lib/RHEL7-x86_64 -L/opt/gfa/python-3.7/latest/lib -Wl,-rpath,/opt/gfa/python-3.7/latest/lib LIBOBJS = -LIBS = -lQt5Xml -lQt5Core -lpython3.7m +LIBS = -lQt5Xml -lQt5Core LIBTOOL = $(SHELL) $(top_builddir)/libtool LIPO = LN_S = ln -s @@ -245,17 +245,17 @@ OTOOL64 = PACKAGE = cafe PACKAGE_BUGREPORT = Bug reports to: jan.chrin@psi.ch PACKAGE_NAME = CAFE -PACKAGE_STRING = CAFE 1.14.2 +PACKAGE_STRING = CAFE 1.14.4 PACKAGE_TARNAME = cafe PACKAGE_URL = -PACKAGE_VERSION = 1.14.2 +PACKAGE_VERSION = 1.14.4 PATH_SEPARATOR = : RANLIB = ranlib SED = /usr/bin/sed SET_MAKE = SHELL = /bin/sh STRIP = strip -VERSION = 1.14.2 +VERSION = 1.14.4 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 @@ -290,7 +290,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.14.2-sls2-py37-gcc-7.3.0/lib/RHEL7-x86_64 +libdir = /opt/gfa/cafe/cpp/cafe-1.14.4-gcc-7.3.0/lib/RHEL7-x86_64 libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale localstatedir = ${prefix}/var @@ -298,7 +298,7 @@ mandir = ${datarootdir}/man mkdir_p = $(MKDIR_P) oldincludedir = /usr/include pdfdir = ${docdir} -prefix = /opt/gfa/cafe/cpp/cafe-1.14.2-sls2-py37-gcc-7.3.0 +prefix = /opt/gfa/cafe/cpp/cafe-1.14.4-gcc-7.3.0 program_transform_name = s,x,x, psdir = ${docdir} sbindir = ${exec_prefix}/sbin @@ -317,7 +317,7 @@ include_HEADERS = config.h cafe.h cafeCache.h cafeConvert.h \ conduitFriends.h connect.h defines.h deviceCollection.h \ exceptions.h exceptionsHelper.h global.h enumStrings.h \ granules.h handleHelper.h hashConduit.h helper.h instant.h \ - instant.cpp loadCollectionXMLParser.h loadGroupXMLParser.h \ + 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 \ diff --git a/include/makefile.am b/include/makefile.am index 0a54bdf..7059f5a 100644 --- a/include/makefile.am +++ b/include/makefile.am @@ -7,7 +7,7 @@ include_HEADERS = config.h cafe.h cafeCache.h cafeConvert.h cafeDataType.h cafeD cafeEnumStrings.h cafeRoast.h cafeVectors.h cafeXML.h caopCodes.h channelRegalia.h \ conduit.h conduitConnectionHandlerArgs.h conduitEventHandlerArgs.h conduitFriends.h \ connect.h defines.h deviceCollection.h exceptions.h exceptionsHelper.h global.h \ - enumStrings.h granules.h handleHelper.h hashConduit.h helper.h instant.h instant.cpp \ + enumStrings.h granules.h handleHelper.h hashConduit.h helper.h instant.h \ 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 tmDateMap.h diff --git a/libtool b/libtool index d2249a8..c2b1022 100755 --- a/libtool +++ b/libtool @@ -1,6 +1,6 @@ #! /bin/sh -# Generated automatically by config.status (cafe) 1.14.2 -# Libtool was configured on host gfa-lc7.psi.ch: +# Generated automatically by config.status (cafe) 1.14.4 +# Libtool was configured on host sf-lc7a.psi.ch: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. @@ -282,10 +282,10 @@ finish_eval="" hardcode_into_libs=yes # Compile-time system search path for libraries. -sys_lib_search_path_spec="/afs/psi.ch/sys/psi.ra/Programming/gcc/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0 /afs/psi.ch/sys/psi.ra/Programming/gcc/7.3.0/lib/gcc /opt/psi/Programming/gcc/7.3.0/lib64 /afs/psi.ch/sys/psi.ra/Programming/gcc/7.3.0/lib64 /lib64 /usr/lib64 /opt/psi/Programming/gcc/7.3.0/lib /afs/psi.ch/sys/psi.ra/Programming/gcc/7.3.0/lib /lib /usr/lib " +sys_lib_search_path_spec="/afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0 /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/lib/gcc /opt/psi/Programming/gcc/7.3.0/lib64 /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/lib64 /lib64 /usr/lib64 /opt/psi/Programming/gcc/7.3.0/lib /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/lib /lib /usr/lib " # Detected run-time system search path for libraries. -sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib64/atlas /usr/lib64//bind9-export/ /opt/rh/devtoolset-6/root/usr/lib64/dyninst /usr/lib64/dyninst /usr/lib64/llvm /usr/lib64/mysql /usr/lib/oracle/12.2/client64/lib /usr/lib64/tcl8.5/tclx8.4 /usr/lib64/tcl8.5 /usr/lib64/wine/ " +sys_lib_dlsearch_path_spec="/lib /usr/lib /usr/lib64/atlas /usr/lib64//bind9-export/ /usr/lib64/dyninst /usr/lib64/mysql /usr/lib/oracle/12.2/client64/lib /usr/lib64/tcl8.5/tclx8.4 " # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path="" @@ -11815,17 +11815,17 @@ file_list_spec="" hardcode_action=immediate # The directories searched by this compiler when creating a shared library. -compiler_lib_search_dirs="/afs/psi.ch/sys/psi.ra/Programming/gcc/7.3.0/bin/../lib/gcc/x86_64-pc-linux-gnu/7.3.0 /afs/psi.ch/sys/psi.ra/Programming/gcc/7.3.0/bin/../lib/gcc /opt/psi/Programming/gcc/7.3.0/lib64/../lib64 /opt/psi/Programming/gcc/7.3.0/lib/../lib64 /afs/psi.ch/sys/psi.ra/Programming/gcc/7.3.0/bin/../lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../lib64 /lib/../lib64 /usr/lib/../lib64 /opt/psi/Programming/gcc/7.3.0/lib64 /opt/psi/Programming/gcc/7.3.0/lib /afs/psi.ch/sys/psi.ra/Programming/gcc/7.3.0/bin/../lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../.." +compiler_lib_search_dirs="/afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/bin/../lib/gcc/x86_64-pc-linux-gnu/7.3.0 /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/bin/../lib/gcc /opt/psi/Programming/gcc/7.3.0/lib64/../lib64 /opt/psi/Programming/gcc/7.3.0/lib/../lib64 /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/bin/../lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../lib64 /lib/../lib64 /usr/lib/../lib64 /opt/psi/Programming/gcc/7.3.0/lib64 /opt/psi/Programming/gcc/7.3.0/lib /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/bin/../lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../.." # Dependencies to place before and after the objects being linked to # create a shared library. -predep_objects="/lib/../lib64/crti.o /afs/psi.ch/sys/psi.ra/Programming/gcc/7.3.0/bin/../lib/gcc/x86_64-pc-linux-gnu/7.3.0/crtbeginS.o" -postdep_objects="/afs/psi.ch/sys/psi.ra/Programming/gcc/7.3.0/bin/../lib/gcc/x86_64-pc-linux-gnu/7.3.0/crtendS.o /lib/../lib64/crtn.o" +predep_objects="/lib/../lib64/crti.o /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/bin/../lib/gcc/x86_64-pc-linux-gnu/7.3.0/crtbeginS.o" +postdep_objects="/afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/bin/../lib/gcc/x86_64-pc-linux-gnu/7.3.0/crtendS.o /lib/../lib64/crtn.o" predeps="" postdeps="-lstdc++ -lm -lgcc_s -lc -lgcc_s" # The library search path used internally by the compiler when linking # a shared library. -compiler_lib_search_path="-L/afs/psi.ch/sys/psi.ra/Programming/gcc/7.3.0/bin/../lib/gcc/x86_64-pc-linux-gnu/7.3.0 -L/afs/psi.ch/sys/psi.ra/Programming/gcc/7.3.0/bin/../lib/gcc -L/opt/psi/Programming/gcc/7.3.0/lib64/../lib64 -L/opt/psi/Programming/gcc/7.3.0/lib/../lib64 -L/afs/psi.ch/sys/psi.ra/Programming/gcc/7.3.0/bin/../lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/opt/psi/Programming/gcc/7.3.0/lib64 -L/opt/psi/Programming/gcc/7.3.0/lib -L/afs/psi.ch/sys/psi.ra/Programming/gcc/7.3.0/bin/../lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../.." +compiler_lib_search_path="-L/afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/bin/../lib/gcc/x86_64-pc-linux-gnu/7.3.0 -L/afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/bin/../lib/gcc -L/opt/psi/Programming/gcc/7.3.0/lib64/../lib64 -L/opt/psi/Programming/gcc/7.3.0/lib/../lib64 -L/afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/bin/../lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/opt/psi/Programming/gcc/7.3.0/lib64 -L/opt/psi/Programming/gcc/7.3.0/lib -L/afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/bin/../lib/gcc/x86_64-pc-linux-gnu/7.3.0/../../.." # ### END LIBTOOL TAG CONFIG: CXX diff --git a/makefile b/makefile index 67dc68a..a50781f 100644 --- a/makefile +++ b/makefile @@ -232,9 +232,9 @@ am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ distcleancheck_listfiles = find . -type f -print ACLOCAL = ${SHELL} /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/missing aclocal-1.13 AMTAR = $${TAR-tar} -AM_CPPFLAGS = -fexceptions -fPIC -std=c++1z -I/usr/local/epics/base-7/include/ -I/usr/local/epics/base-7/include/os/Linux -I/usr/local/epics/base-7/include/compiler/gcc -I/opt/gfa/cafe/boost/boost_1_61_0/include/boost -I/opt/gfa/cafe/boost/boost_1_61_0/include -I/opt/gfa/python-3.7/latest/include/python3.7m -I/opt/gfa/python-3.7/latest/lib/python3.7/site-packages/numpy/core/include -I/opt/gfa/python-3.7/latest/include/qt -I/opt/gfa/python-3.7/latest/include/qt/QtCore -I/opt/gfa/python-3.7/latest/include/qt/QtXml -I$(top_srcdir)/include +AM_CPPFLAGS = -fexceptions -fPIC -std=c++1z -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/opt/gfa/python-3.7/latest/include/qt -I/opt/gfa/python-3.7/latest/include/qt/QtCore -I/opt/gfa/python-3.7/latest/include/qt/QtXml -I$(top_srcdir)/include AM_DEFAULT_VERBOSITY = 1 -AM_LDFLAGS = -L/usr/local/epics/base-7/lib/RHEL7-x86_64 -Wl,-rpath,/usr/local/epics/base-7/lib/RHEL7-x86_64 -L/opt/gfa/python-3.7/latest/lib -Wl,-rpath,/opt/gfa/python-3.7/latest/lib -L/opt/gfa/python-3.7/latest/lib -Wl,-rpath,/opt/gfa/python-3.7/latest/lib @CAFE_LIBS@ +AM_LDFLAGS = -L/usr/local/epics/base/lib/RHEL7-x86_64 -Wl,-rpath,/usr/local/epics/base/lib/RHEL7-x86_64 -L/opt/gfa/python-3.7/latest/lib -Wl,-rpath,/opt/gfa/python-3.7/latest/lib @CAFE_LIBS@ AR = ar AUTOCONF = ${SHELL} /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/missing autoconf AUTOHEADER = ${SHELL} /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/missing autoheader @@ -245,7 +245,7 @@ CC = /opt/psi/Programming/gcc/7.3.0/bin/gcc CCDEPMODE = depmode=gcc3 CFLAGS = -g -O2 CPP = /opt/psi/Programming/gcc/7.3.0/bin/gcc -E -CPPFLAGS = -fexceptions -fPIC -std=c++1z -I/usr/local/epics/base-7/include/ -I/usr/local/epics/base-7/include/os/Linux -I/usr/local/epics/base-7/include/compiler/gcc -I/opt/gfa/cafe/boost/boost_1_61_0/include/boost -I/opt/gfa/cafe/boost/boost_1_61_0/include -I/opt/gfa/python-3.7/latest/include/python3.7m -I/opt/gfa/python-3.7/latest/lib/python3.7/site-packages/numpy/core/include -I/opt/gfa/python-3.7/latest/include/qt -I/opt/gfa/python-3.7/latest/include/qt/QtCore -I/opt/gfa/python-3.7/latest/include/qt/QtXml +CPPFLAGS = -fexceptions -fPIC -std=c++1z -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/opt/gfa/python-3.7/latest/include/qt -I/opt/gfa/python-3.7/latest/include/qt/QtCore -I/opt/gfa/python-3.7/latest/include/qt/QtXml CXX = /opt/psi/Programming/gcc/7.3.0/bin/g++ CXXCPP = /opt/psi/Programming/gcc/7.3.0/bin/g++ -E CXXDEPMODE = depmode=gcc3 @@ -269,9 +269,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-7/lib/RHEL7-x86_64 -Wl,-rpath,/usr/local/epics/base-7/lib/RHEL7-x86_64 -L/opt/gfa/python-3.7/latest/lib -Wl,-rpath,/opt/gfa/python-3.7/latest/lib -L/opt/gfa/python-3.7/latest/lib -Wl,-rpath,/opt/gfa/python-3.7/latest/lib +LDFLAGS = -L/usr/local/epics/base/lib/RHEL7-x86_64 -Wl,-rpath,/usr/local/epics/base/lib/RHEL7-x86_64 -L/opt/gfa/python-3.7/latest/lib -Wl,-rpath,/opt/gfa/python-3.7/latest/lib LIBOBJS = -LIBS = -lQt5Xml -lQt5Core -lpython3.7m +LIBS = -lQt5Xml -lQt5Core LIBTOOL = $(SHELL) $(top_builddir)/libtool LIPO = LN_S = ln -s @@ -289,17 +289,17 @@ OTOOL64 = PACKAGE = cafe PACKAGE_BUGREPORT = Bug reports to: jan.chrin@psi.ch PACKAGE_NAME = CAFE -PACKAGE_STRING = CAFE 1.14.2 +PACKAGE_STRING = CAFE 1.14.4 PACKAGE_TARNAME = cafe PACKAGE_URL = -PACKAGE_VERSION = 1.14.2 +PACKAGE_VERSION = 1.14.4 PATH_SEPARATOR = : RANLIB = ranlib SED = /usr/bin/sed SET_MAKE = SHELL = /bin/sh STRIP = strip -VERSION = 1.14.2 +VERSION = 1.14.4 abs_builddir = /afs/psi.ch/project/cafe/gitlab/CAFE/cpp abs_srcdir = /afs/psi.ch/project/cafe/gitlab/CAFE/cpp abs_top_builddir = /afs/psi.ch/project/cafe/gitlab/CAFE/cpp @@ -334,7 +334,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.14.2-sls2-py37-gcc-7.3.0/lib/RHEL7-x86_64 +libdir = /opt/gfa/cafe/cpp/cafe-1.14.4-gcc-7.3.0/lib/RHEL7-x86_64 libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale localstatedir = ${prefix}/var @@ -342,7 +342,7 @@ mandir = ${datarootdir}/man mkdir_p = $(MKDIR_P) oldincludedir = /usr/include pdfdir = ${docdir} -prefix = /opt/gfa/cafe/cpp/cafe-1.14.2-sls2-py37-gcc-7.3.0 +prefix = /opt/gfa/cafe/cpp/cafe-1.14.4-gcc-7.3.0 program_transform_name = s,x,x, psdir = ${docdir} sbindir = ${exec_prefix}/sbin diff --git a/src/bitshuffle/.deps/bitshuffle.Plo b/src/bitshuffle/.deps/bitshuffle.Plo index 1a7dbad..7ae269b 100644 --- a/src/bitshuffle/.deps/bitshuffle.Plo +++ b/src/bitshuffle/.deps/bitshuffle.Plo @@ -1,18 +1,16 @@ -bitshuffle/bitshuffle.lo: bitshuffle/bitshuffle.c \ - /usr/include/stdc-predef.h bitshuffle/bitshuffle.h /usr/include/stdlib.h \ - /usr/include/features.h /usr/include/sys/cdefs.h \ +bitshuffle/bitshuffle.lo: bitshuffle/bitshuffle.c bitshuffle/bitshuffle.h \ + /usr/include/stdlib.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ /usr/include/gnu/stubs-64.h \ /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/stddef.h \ /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/bits/byteswap.h /usr/include/bits/types.h \ - /usr/include/bits/typesizes.h /usr/include/bits/byteswap-16.h \ - /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/bits/sigset.h \ - /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ - /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/bits/stdlib-float.h bitshuffle/bitshuffle_core.h \ + /usr/include/bits/byteswap.h /usr/include/sys/types.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h bitshuffle/bitshuffle_core.h \ /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/stdint.h \ /usr/include/stdint.h /usr/include/bits/wchar.h \ bitshuffle/bitshuffle_internals.h bitshuffle/iochain.h \ @@ -23,8 +21,6 @@ bitshuffle/bitshuffle.lo: bitshuffle/bitshuffle.c \ /usr/include/bits/stdio.h /usr/include/string.h /usr/include/xlocale.h \ /usr/include/bits/string.h /usr/include/bits/string2.h -/usr/include/stdc-predef.h: - bitshuffle/bitshuffle.h: /usr/include/stdlib.h: @@ -51,14 +47,12 @@ bitshuffle/bitshuffle.h: /usr/include/bits/byteswap.h: +/usr/include/sys/types.h: + /usr/include/bits/types.h: /usr/include/bits/typesizes.h: -/usr/include/bits/byteswap-16.h: - -/usr/include/sys/types.h: - /usr/include/time.h: /usr/include/sys/select.h: @@ -75,8 +69,6 @@ bitshuffle/bitshuffle.h: /usr/include/alloca.h: -/usr/include/bits/stdlib-float.h: - bitshuffle/bitshuffle_core.h: /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/stdint.h: diff --git a/src/bitshuffle/.deps/bitshuffle_core.Plo b/src/bitshuffle/.deps/bitshuffle_core.Plo index c3319ef..b05826f 100644 --- a/src/bitshuffle/.deps/bitshuffle_core.Plo +++ b/src/bitshuffle/.deps/bitshuffle_core.Plo @@ -1,5 +1,5 @@ bitshuffle/bitshuffle_core.lo: bitshuffle/bitshuffle_core.c \ - /usr/include/stdc-predef.h bitshuffle/bitshuffle_core.h \ + bitshuffle/bitshuffle_core.h \ /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/stdint.h \ /usr/include/stdint.h /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ @@ -8,13 +8,12 @@ bitshuffle/bitshuffle_core.lo: bitshuffle/bitshuffle_core.c \ /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/stddef.h \ /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/bits/byteswap.h /usr/include/bits/types.h \ - /usr/include/bits/typesizes.h /usr/include/bits/byteswap-16.h \ - /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/bits/sigset.h \ - /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ - /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/bits/stdlib-float.h bitshuffle/bitshuffle_internals.h \ + /usr/include/bits/byteswap.h /usr/include/sys/types.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h bitshuffle/bitshuffle_internals.h \ bitshuffle/iochain.h /usr/include/stdio.h /usr/include/libio.h \ /usr/include/_G_config.h /usr/include/wchar.h \ /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/stdarg.h \ @@ -26,8 +25,6 @@ bitshuffle/bitshuffle_core.lo: bitshuffle/bitshuffle_core.c \ /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/mmintrin.h \ /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/mm_malloc.h -/usr/include/stdc-predef.h: - bitshuffle/bitshuffle_core.h: /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/stdint.h: @@ -60,14 +57,12 @@ bitshuffle/bitshuffle_core.h: /usr/include/bits/byteswap.h: +/usr/include/sys/types.h: + /usr/include/bits/types.h: /usr/include/bits/typesizes.h: -/usr/include/bits/byteswap-16.h: - -/usr/include/sys/types.h: - /usr/include/time.h: /usr/include/sys/select.h: @@ -84,8 +79,6 @@ bitshuffle/bitshuffle_core.h: /usr/include/alloca.h: -/usr/include/bits/stdlib-float.h: - bitshuffle/bitshuffle_internals.h: bitshuffle/iochain.h: diff --git a/src/bitshuffle/.deps/iochain.Plo b/src/bitshuffle/.deps/iochain.Plo index 3d104ee..59df5bf 100644 --- a/src/bitshuffle/.deps/iochain.Plo +++ b/src/bitshuffle/.deps/iochain.Plo @@ -1,19 +1,16 @@ -bitshuffle/iochain.lo: bitshuffle/iochain.c /usr/include/stdc-predef.h \ - /usr/include/stdlib.h /usr/include/features.h /usr/include/sys/cdefs.h \ +bitshuffle/iochain.lo: bitshuffle/iochain.c /usr/include/stdlib.h \ + /usr/include/features.h /usr/include/sys/cdefs.h \ /usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \ /usr/include/gnu/stubs-64.h \ /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/7.3.0/lib/gcc/x86_64-pc-linux-gnu/7.3.0/include/stddef.h \ /usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \ /usr/include/endian.h /usr/include/bits/endian.h \ - /usr/include/bits/byteswap.h /usr/include/bits/types.h \ - /usr/include/bits/typesizes.h /usr/include/bits/byteswap-16.h \ - /usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \ - /usr/include/bits/select.h /usr/include/bits/sigset.h \ - /usr/include/bits/time.h /usr/include/sys/sysmacros.h \ - /usr/include/bits/pthreadtypes.h /usr/include/alloca.h \ - /usr/include/bits/stdlib-float.h bitshuffle/iochain.h - -/usr/include/stdc-predef.h: + /usr/include/bits/byteswap.h /usr/include/sys/types.h \ + /usr/include/bits/types.h /usr/include/bits/typesizes.h \ + /usr/include/time.h /usr/include/sys/select.h /usr/include/bits/select.h \ + /usr/include/bits/sigset.h /usr/include/bits/time.h \ + /usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \ + /usr/include/alloca.h bitshuffle/iochain.h /usr/include/stdlib.h: @@ -39,14 +36,12 @@ bitshuffle/iochain.lo: bitshuffle/iochain.c /usr/include/stdc-predef.h \ /usr/include/bits/byteswap.h: +/usr/include/sys/types.h: + /usr/include/bits/types.h: /usr/include/bits/typesizes.h: -/usr/include/bits/byteswap-16.h: - -/usr/include/sys/types.h: - /usr/include/time.h: /usr/include/sys/select.h: @@ -63,6 +58,4 @@ bitshuffle/iochain.lo: bitshuffle/iochain.c /usr/include/stdc-predef.h \ /usr/include/alloca.h: -/usr/include/bits/stdlib-float.h: - bitshuffle/iochain.h: diff --git a/src/callbackHandlerMonitor.cpp b/src/callbackHandlerMonitor.cpp index 13403c9..2eb995b 100644 --- a/src/callbackHandlerMonitor.cpp +++ b/src/callbackHandlerMonitor.cpp @@ -14,6 +14,7 @@ #include #include +#define RETURN_ON_ERROR false using namespace std; using namespace boost::posix_time; @@ -31,7 +32,7 @@ void MonitorPolicy::callbackHandlerMonitor( struct event_handler_args args) { cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << endl; cout << "Status=" << args.status << " for channel " << ca_name (args.chid) << endl; - //return; + if (RETURN_ON_ERROR == true) return; } unsigned int _handle = (unsigned long) ca_puser(args.chid);// args.usr; // ca_puser(args.chid); @@ -149,7 +150,7 @@ void MonitorPolicy::PyCallbackHandlerMonitor (struct event_handler_args args) { cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << endl; cout << "Status=" << args.status << " for channel " << ca_name (args.chid) << endl; - // return; + if (RETURN_ON_ERROR == true) return; } unsigned int _handle = (unsigned long) ca_puser(args.chid);// args.usr; // ca_puser(args.chid); @@ -236,7 +237,7 @@ void MonitorPolicy::PyCallbackHandlerMonitorData (struct event_handler_args args { cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << endl; cout << "Status=" << args.status << " for channel " << ca_name (args.chid) << endl; - // return; + if (RETURN_ON_ERROR == true) return; } unsigned int _handle = (unsigned long) ca_puser(args.chid);// args.usr; // ca_puser(args.chid); diff --git a/src/makefile b/src/makefile index f7b132f..d746ce3 100644 --- a/src/makefile +++ b/src/makefile @@ -249,9 +249,9 @@ AMTAR = $${TAR-tar} #if HAVE_PYTHON_ #libcafe_la_SOURCES += pycafe/PyCafe.cpp #endif -AM_CPPFLAGS = -fexceptions -fPIC -std=c++1z -I/usr/local/epics/base-7/include/ -I/usr/local/epics/base-7/include/os/Linux -I/usr/local/epics/base-7/include/compiler/gcc -I/opt/gfa/cafe/boost/boost_1_61_0/include/boost -I/opt/gfa/cafe/boost/boost_1_61_0/include -I/opt/gfa/python-3.7/latest/include/python3.7m -I/opt/gfa/python-3.7/latest/lib/python3.7/site-packages/numpy/core/include -I/opt/gfa/python-3.7/latest/include/qt -I/opt/gfa/python-3.7/latest/include/qt/QtCore -I/opt/gfa/python-3.7/latest/include/qt/QtXml -I$(top_srcdir)/include +AM_CPPFLAGS = -fexceptions -fPIC -std=c++1z -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/opt/gfa/python-3.7/latest/include/qt -I/opt/gfa/python-3.7/latest/include/qt/QtCore -I/opt/gfa/python-3.7/latest/include/qt/QtXml -I$(top_srcdir)/include AM_DEFAULT_VERBOSITY = 1 -AM_LDFLAGS = -L/usr/local/epics/base-7/lib/RHEL7-x86_64 -Wl,-rpath,/usr/local/epics/base-7/lib/RHEL7-x86_64 -L/opt/gfa/python-3.7/latest/lib -Wl,-rpath,/opt/gfa/python-3.7/latest/lib -L/opt/gfa/python-3.7/latest/lib -Wl,-rpath,/opt/gfa/python-3.7/latest/lib +AM_LDFLAGS = -L/usr/local/epics/base/lib/RHEL7-x86_64 -Wl,-rpath,/usr/local/epics/base/lib/RHEL7-x86_64 -L/opt/gfa/python-3.7/latest/lib -Wl,-rpath,/opt/gfa/python-3.7/latest/lib AR = ar AUTOCONF = ${SHELL} /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/missing autoconf AUTOHEADER = ${SHELL} /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/missing autoheader @@ -262,7 +262,7 @@ CC = /opt/psi/Programming/gcc/7.3.0/bin/gcc CCDEPMODE = depmode=gcc3 CFLAGS = -g -O2 CPP = /opt/psi/Programming/gcc/7.3.0/bin/gcc -E -CPPFLAGS = -fexceptions -fPIC -std=c++1z -I/usr/local/epics/base-7/include/ -I/usr/local/epics/base-7/include/os/Linux -I/usr/local/epics/base-7/include/compiler/gcc -I/opt/gfa/cafe/boost/boost_1_61_0/include/boost -I/opt/gfa/cafe/boost/boost_1_61_0/include -I/opt/gfa/python-3.7/latest/include/python3.7m -I/opt/gfa/python-3.7/latest/lib/python3.7/site-packages/numpy/core/include -I/opt/gfa/python-3.7/latest/include/qt -I/opt/gfa/python-3.7/latest/include/qt/QtCore -I/opt/gfa/python-3.7/latest/include/qt/QtXml +CPPFLAGS = -fexceptions -fPIC -std=c++1z -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/opt/gfa/python-3.7/latest/include/qt -I/opt/gfa/python-3.7/latest/include/qt/QtCore -I/opt/gfa/python-3.7/latest/include/qt/QtXml CXX = /opt/psi/Programming/gcc/7.3.0/bin/g++ CXXCPP = /opt/psi/Programming/gcc/7.3.0/bin/g++ -E CXXDEPMODE = depmode=gcc3 @@ -286,9 +286,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-7/lib/RHEL7-x86_64 -Wl,-rpath,/usr/local/epics/base-7/lib/RHEL7-x86_64 -L/opt/gfa/python-3.7/latest/lib -Wl,-rpath,/opt/gfa/python-3.7/latest/lib -L/opt/gfa/python-3.7/latest/lib -Wl,-rpath,/opt/gfa/python-3.7/latest/lib +LDFLAGS = -L/usr/local/epics/base/lib/RHEL7-x86_64 -Wl,-rpath,/usr/local/epics/base/lib/RHEL7-x86_64 -L/opt/gfa/python-3.7/latest/lib -Wl,-rpath,/opt/gfa/python-3.7/latest/lib LIBOBJS = -LIBS = -lQt5Xml -lQt5Core -lpython3.7m +LIBS = -lQt5Xml -lQt5Core LIBTOOL = $(SHELL) $(top_builddir)/libtool LIPO = LN_S = ln -s @@ -306,17 +306,17 @@ OTOOL64 = PACKAGE = cafe PACKAGE_BUGREPORT = Bug reports to: jan.chrin@psi.ch PACKAGE_NAME = CAFE -PACKAGE_STRING = CAFE 1.14.2 +PACKAGE_STRING = CAFE 1.14.4 PACKAGE_TARNAME = cafe PACKAGE_URL = -PACKAGE_VERSION = 1.14.2 +PACKAGE_VERSION = 1.14.4 PATH_SEPARATOR = : RANLIB = ranlib SED = /usr/bin/sed SET_MAKE = SHELL = /bin/sh STRIP = strip -VERSION = 1.14.2 +VERSION = 1.14.4 abs_builddir = /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/src abs_srcdir = /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/src abs_top_builddir = /afs/psi.ch/project/cafe/gitlab/CAFE/cpp @@ -351,7 +351,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.14.2-sls2-py37-gcc-7.3.0/lib/RHEL7-x86_64 +libdir = /opt/gfa/cafe/cpp/cafe-1.14.4-gcc-7.3.0/lib/RHEL7-x86_64 libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale localstatedir = ${prefix}/var @@ -359,7 +359,7 @@ mandir = ${datarootdir}/man mkdir_p = $(MKDIR_P) oldincludedir = /usr/include pdfdir = ${docdir} -prefix = /opt/gfa/cafe/cpp/cafe-1.14.2-sls2-py37-gcc-7.3.0 +prefix = /opt/gfa/cafe/cpp/cafe-1.14.4-gcc-7.3.0 program_transform_name = s,x,x, psdir = ${docdir} sbindir = ${exec_prefix}/sbin @@ -379,7 +379,7 @@ lib_LTLIBRARIES = libcafe.la #2nd: age #3rd: revision #1.9.1 1.10.2 1.11.0 1.11.1 1.12.0 1.12.1 1.12.2 1.12.4 -libcafe_la_LDFLAGS = -version-info 15:2:14 +libcafe_la_LDFLAGS = -version-info 15:4:14 libcafe_la_SOURCES = cafe.cpp cafeCache.cpp cafeGroup.cpp \ cafeVectors.cpp cafeXML.cpp callbackHandlerCreate.cpp \ callbackHandlerMonitor.cpp conduit.cpp connect.cpp \ diff --git a/src/makefile.am b/src/makefile.am index 7ea27cc..01ce486 100644 --- a/src/makefile.am +++ b/src/makefile.am @@ -12,7 +12,7 @@ lib_LTLIBRARIES = libcafe.la #2nd: age #3rd: revision #1.9.1 1.10.2 1.11.0 1.11.1 1.12.0 1.12.1 1.12.2 1.12.4 -libcafe_la_LDFLAGS = -version-info 15:2:14 +libcafe_la_LDFLAGS = -version-info 15:4:14 libcafe_la_SOURCES = cafe.cpp cafeCache.cpp cafeGroup.cpp cafeVectors.cpp cafeXML.cpp \ callbackHandlerCreate.cpp callbackHandlerMonitor.cpp conduit.cpp connect.cpp connectCallbacks.cpp \ diff --git a/src/methodCallbacks.cpp b/src/methodCallbacks.cpp index dd00436..625bad7 100644 --- a/src/methodCallbacks.cpp +++ b/src/methodCallbacks.cpp @@ -17,6 +17,7 @@ using namespace std; //#include //#endif +#define RETURN_ON_ERROR true #if HAVE_PYTHON_H @@ -32,7 +33,7 @@ void CALLBACK_CAFE::PyHandlerPut( struct event_handler_args args) { cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__ << endl; cout << "Status=" << args.status << " for channel " << ca_name (args.chid) << endl; - //return; + if (RETURN_ON_ERROR == true) return; } @@ -111,7 +112,7 @@ void CALLBACK_CAFE::PyHandlerGet( struct event_handler_args args) { cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__ << endl; cout << "Status=" << args.status << " for channel " << ca_name (args.chid) << endl; - //return; + if (RETURN_ON_ERROR == true) return; } unsigned int _handle = (unsigned long) args.usr; // ca_puser(args.chid); @@ -205,7 +206,7 @@ void CALLBACK_CAFE::handlerPulseID( struct event_handler_args args) { cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__ << endl; cout << "Status=" << args.status << " for channel " << ca_name (args.chid) << endl; - //return; + if (RETURN_ON_ERROR == true) return; } unsigned int _handle = (unsigned long) args.usr; @@ -259,7 +260,7 @@ void CALLBACK_CAFE::handlerPut( struct event_handler_args args) { cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__ << endl; cout << "Status=" << args.status << " for channel " << ca_name (args.chid) << endl; - //return; + if (RETURN_ON_ERROR == true) return; } unsigned int _handle = (unsigned long) args.usr; @@ -330,7 +331,7 @@ void CALLBACK_CAFE::handlerGet( struct event_handler_args args) { cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__ << endl; cout << "Status=" << args.status << " for channel " << ca_name (args.chid) << endl; - //return; + if (RETURN_ON_ERROR == true) return; } unsigned int _handle = (unsigned long) args.usr; // ca_puser(args.chid); @@ -435,7 +436,7 @@ void CALLBACK_CAFE::handlerGetCtrlAtConnect( struct event_handler_args args) } #endif */ - //return; + if (RETURN_ON_ERROR == true) return; } unsigned int _handle = (unsigned long) args.usr; // ca_puser(args.chid); @@ -559,7 +560,7 @@ void CALLBACK_CAFE::handlerGetCtrl( struct event_handler_args args) { cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__ << endl; cout << "Status=" << args.status << " for channel " << ca_name (args.chid) << endl; - //return; + if (RETURN_ON_ERROR == true) return; } unsigned int _handle = (unsigned long) args.usr; // ca_puser(args.chid); @@ -658,7 +659,7 @@ void CALLBACK_CAFE::handlerGetSTSACK( struct event_handler_args args) { cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__ << endl; cout << "Status=" << args.status << " for channel " << ca_name (args.chid) << endl; - //return; + if (RETURN_ON_ERROR == true) return; } @@ -756,7 +757,7 @@ void CALLBACK_CAFE::handlerGetClassName( struct event_handler_args args) { cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__ << endl; cout << "Status=" << args.status << " for channel " << ca_name (args.chid) << endl; - //return; + if (RETURN_ON_ERROR == true) return; } unsigned int _handle = (unsigned long) args.usr; // ca_puser(args.chid); @@ -855,7 +856,7 @@ void CALLBACK_CAFE::handlerGetDescription( struct event_handler_args args) { cout << __FILE__ << "/" << __LINE__ << "/" << __METHOD__ << endl; cout << "Status=" << args.status << " for channel " << ca_name (args.chid) << endl; - //return; + if (RETURN_ON_ERROR == true) return; } unsigned int _handle = (unsigned long) args.usr; // ca_puser(args.chid);