diff --git a/examples/cafeTest/cafeTest b/examples/cafeTest/cafeTest index 89422d1..46c2722 100755 Binary files a/examples/cafeTest/cafeTest and b/examples/cafeTest/cafeTest differ diff --git a/examples/cafeTest/cafeTest.cc b/examples/cafeTest/cafeTest.cc index d3d1963..a61e7a7 100644 --- a/examples/cafeTest/cafeTest.cc +++ b/examples/cafeTest/cafeTest.cc @@ -66,7 +66,6 @@ int main( int argc, char *argv[] ) - //------------------------------------------------------------ //(1) Establishing connections to EPICS Process Variables (PVs) //------------------------------------------------------------ diff --git a/include/cafeEnumStrings.h b/include/cafeEnumStrings.h index 3cd1e21..29526c9 100644 --- a/include/cafeEnumStrings.h +++ b/include/cafeEnumStrings.h @@ -10,8 +10,8 @@ #define CAFEENUMSTRINGS_H -#include "cafeEnum.h" -#include "enumStrings.h" +#include +#include template<> char const * enumStrings::data[] = {"CAFENUM::WAIT", "CAFENUM::NO_WAIT"}; diff --git a/include/exceptionsHelper.h b/include/exceptionsHelper.h index 90dfc68..0dab5b8 100644 --- a/include/exceptionsHelper.h +++ b/include/exceptionsHelper.h @@ -8,9 +8,9 @@ #ifndef EXCEPTIONSHELPER_H #define EXCEPTIONSHELPER_H -#include "exceptions.h" -#include "statusCodes.h" -#include "defines.h" +#include +#include +#include class ExceptionsHelper { private: diff --git a/include/handleHelper.h b/include/handleHelper.h index bc5b9fc..ae75c7b 100644 --- a/include/handleHelper.h +++ b/include/handleHelper.h @@ -57,8 +57,8 @@ public: etsNorm _etsNorm; etsDate _etsDate; - TMwdayText tmDay; - TMmonthpText tmMonth; + TMwdayText tmDay; + TMmonthpText tmMonth; int checkConsistency(); int checkConsistency(unsigned int _handle); @@ -139,10 +139,10 @@ public: _etsDate.sec = local.ansi_tm.tm_sec; _etsDate.nsec = (unsigned long) ts.nsec; - - _etsDate.wday = local.ansi_tm.tm_wday; - _etsDate.yday = local.ansi_tm.tm_yday; - _etsDate.isdst = local.ansi_tm.tm_isdst; + + _etsDate.wday = local.ansi_tm.tm_wday; + _etsDate.yday = local.ansi_tm.tm_yday; + _etsDate.isdst = local.ansi_tm.tm_isdst; return _etsDate; } @@ -158,11 +158,11 @@ public: _etsDate.min = local.ansi_tm.tm_min; _etsDate.sec = local.ansi_tm.tm_sec; _etsDate.nsec = (unsigned long) ts.nsec; - - _etsDate.wday = local.ansi_tm.tm_wday; - _etsDate.yday = local.ansi_tm.tm_yday; - _etsDate.isdst = local.ansi_tm.tm_isdst; - + + _etsDate.wday = local.ansi_tm.tm_wday; + _etsDate.yday = local.ansi_tm.tm_yday; + _etsDate.isdst = local.ansi_tm.tm_isdst; + return _etsDate; } @@ -181,11 +181,11 @@ public: _etsDate.min = local.ansi_tm.tm_min; _etsDate.sec = local.ansi_tm.tm_sec; _etsDate.nsec = (unsigned long) ts.nsec; - - _etsDate.wday = local.ansi_tm.tm_wday; - _etsDate.yday = local.ansi_tm.tm_yday; - _etsDate.isdst = local.ansi_tm.tm_isdst; - + + _etsDate.wday = local.ansi_tm.tm_wday; + _etsDate.yday = local.ansi_tm.tm_yday; + _etsDate.isdst = local.ansi_tm.tm_isdst; + return _etsDate; } @@ -204,32 +204,32 @@ public: _etsDate.min = local->tm_min; _etsDate.sec = local->tm_sec; _etsDate.nsec = (unsigned long) ts.nsec; - - _etsDate.wday = local->tm_wday; - _etsDate.yday = local->tm_yday; - _etsDate.isdst = local->tm_isdst; - + + _etsDate.wday = local->tm_wday; + _etsDate.yday = local->tm_yday; + _etsDate.isdst = local->tm_isdst; + return _etsDate; } - std::string etsDateAsString(etsNorm ts) { - + std::string etsDateAsString(etsNorm ts) { + time_t t= ts.secPastEpoch; struct tm * local; local=localtime(&t); - char buf[40]; - strftime (buf,80,"%b %d, %Y %T.",local); - std::string date=(std::string) buf; - char buft[10]; - sprintf(buft,"%d",ts.nsec); - date.append((std::string) buft); - - - return date; - - } + char buf[40]; + strftime (buf,80,"%b %d, %Y %T.",local); + std::string date=(std::string) buf; + char buft[10]; + sprintf(buft,"%u",ts.nsec); + date.append((std::string) buft); + + + return date; + + } //Deprecated!!! diff --git a/include/instant.h b/include/instant.h index 1097ad5..691f5cf 100644 --- a/include/instant.h +++ b/include/instant.h @@ -420,7 +420,7 @@ public: }; -#include "instant.cpp" +#include #endif // INSTANT_H diff --git a/include/loadCollectionXMLParser.h b/include/loadCollectionXMLParser.h index d24c144..dd9d317 100644 --- a/include/loadCollectionXMLParser.h +++ b/include/loadCollectionXMLParser.h @@ -13,7 +13,7 @@ #ifndef LOADCOLLECTIONXMLPARSER_H #define LOADCOLLECTIONXMLPARSER_H -#include "deviceCollection.h" +#include #include diff --git a/include/loadGroupXMLParser.h b/include/loadGroupXMLParser.h index c33883a..9c884d4 100644 --- a/include/loadGroupXMLParser.h +++ b/include/loadGroupXMLParser.h @@ -12,7 +12,7 @@ #ifndef LOADGROUPXMLPARSER_H #define LOADGROUPXMLPARSER_H -#include "deviceCollection.h" +#include #include diff --git a/include/makefile b/include/makefile index 7554f59..1290dd5 100644 --- a/include/makefile +++ b/include/makefile @@ -34,7 +34,7 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = x86_64-unknown-linux-gnu host_triplet = x86_64-unknown-linux-gnu -am__append_1 = PyCafe_api.h +#am__append_1 = PyCafe_api.h #am__append_2 = PyCafe.h subdir = include DIST_COMMON = $(am__include_HEADERS_DIST) $(srcdir)/makefile.am \ @@ -90,8 +90,8 @@ CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = ${SHELL} /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/missing --run aclocal-1.11 AMTAR = ${SHELL} /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/missing --run tar -AM_CPPFLAGS = -fexceptions -fPIC -Wno-deprecated -I/usr/local/epics/base/include/ -I/usr/local/epics/base/include/os/Linux -I/opt/gfa/cafe/boost/boost_1_61_0/include/boost -I/opt/gfa/cafe/boost/boost_1_61_0/include -I/usr/include/QtCore -I/usr/include/QtXml -I/opt/gfa/python-3.5/latest/include/python3.5m -AM_LDFLAGS = -L/usr/local/epics/base/lib/SL6-x86_64 -Wl,-rpath,/usr/local/epics/base/lib/SL6-x86_64 -L/usr/lib64 -Wl,-rpath,/usr/lib64 -L/opt/gfa/python-3.5/latest/lib -Wl,-rpath,/opt/gfa/python-3.5/latest/lib +AM_CPPFLAGS = -fexceptions -fPIC -Wno-deprecated -I/usr/local/epics/base/include/ -I/usr/local/epics/base/include/os/Linux -I/opt/gfa/cafe/boost/boost_1_61_0/include/boost -I/opt/gfa/cafe/boost/boost_1_61_0/include -I/usr/include/QtCore -I/usr/include/QtXml +AM_LDFLAGS = -L/usr/local/epics/base/lib/SL6-x86_64 -Wl,-rpath,/usr/local/epics/base/lib/SL6-x86_64 -L/usr/lib64 -Wl,-rpath,/usr/lib64 AR = ar AUTOCONF = ${SHELL} /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/missing --run autoconf AUTOHEADER = ${SHELL} /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/missing --run autoheader @@ -102,7 +102,7 @@ CC = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/6.3.0/bin/gcc CCDEPMODE = depmode=gcc3 CFLAGS = -g -O2 CPP = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/6.3.0/bin/gcc -E -CPPFLAGS = -fexceptions -fPIC -Wno-deprecated -I/usr/local/epics/base/include/ -I/usr/local/epics/base/include/os/Linux -I/opt/gfa/cafe/boost/boost_1_61_0/include/boost -I/opt/gfa/cafe/boost/boost_1_61_0/include -I/usr/include/QtCore -I/usr/include/QtXml -I/opt/gfa/python-3.5/latest/include/python3.5m +CPPFLAGS = -fexceptions -fPIC -Wno-deprecated -I/usr/local/epics/base/include/ -I/usr/local/epics/base/include/os/Linux -I/opt/gfa/cafe/boost/boost_1_61_0/include/boost -I/opt/gfa/cafe/boost/boost_1_61_0/include -I/usr/include/QtCore -I/usr/include/QtXml CXX = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/6.3.0/bin/g++ CXXCPP = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/6.3.0/bin/g++ -E CXXDEPMODE = depmode=gcc3 @@ -125,9 +125,9 @@ INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = $(install_sh) -c -s LD = /usr/bin/ld -m elf_x86_64 -LDFLAGS = -L/usr/local/epics/base/lib/SL6-x86_64 -Wl,-rpath,/usr/local/epics/base/lib/SL6-x86_64 -L/usr/lib64 -Wl,-rpath,/usr/lib64 -L/opt/gfa/python-3.5/latest/lib -Wl,-rpath,/opt/gfa/python-3.5/latest/lib +LDFLAGS = -L/usr/local/epics/base/lib/SL6-x86_64 -Wl,-rpath,/usr/local/epics/base/lib/SL6-x86_64 -L/usr/lib64 -Wl,-rpath,/usr/lib64 LIBOBJS = -LIBS = -lpython3.5m -lQtXml -lQtCore +LIBS = -lQtXml -lQtCore LIBTOOL = $(SHELL) $(top_builddir)/libtool LIPO = LN_S = ln -s @@ -186,7 +186,7 @@ htmldir = ${docdir} includedir = ${prefix}/include infodir = ${datarootdir}/info install_sh = ${SHELL} /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/install-sh -libdir = /opt/gfa/cafe/python/python-3.5/pycafe-1.8.0/lib +libdir = /opt/gfa/cafe/cpp/cafe-1.8.0-gcc-6.3.0/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale localstatedir = ${prefix}/var @@ -195,7 +195,7 @@ mandir = ${datarootdir}/man mkdir_p = /bin/mkdir -p oldincludedir = /usr/include pdfdir = ${docdir} -prefix = /opt/gfa/cafe/python/python-3.5/pycafe-1.8.0 +prefix = /opt/gfa/cafe/cpp/cafe-1.8.0-gcc-6.3.0 program_transform_name = s,x,x, psdir = ${docdir} sbindir = ${exec_prefix}/sbin diff --git a/include/policies.h b/include/policies.h index 5238069..de5d8b5 100644 --- a/include/policies.h +++ b/include/policies.h @@ -679,26 +679,26 @@ public: { bool has=false; # if (EPICS_MAJOR==3 && EPICS_MINOR>=14 && EPICS_PATCH >=11) - mask & DBE_PROPERTY ? has=true : has=false; + (mask & DBE_PROPERTY) ? has=true : has=false; # endif return has; }; //8 bool maskHasDBE_VALUE() const { bool has=false; - mask & DBE_VALUE ? has=true : has=false; + (mask & DBE_VALUE) ? has=true : has=false; return has; }; //4 bool maskHasDBE_LOG() const { bool has=false; - mask & DBE_LOG ? has=true : has=false; + (mask & DBE_LOG) ? has=true : has=false; return has; }; //2 bool maskHasDBE_ALARM() const { bool has=false; - mask & DBE_ALARM ? has=true : has=false; + (mask & DBE_ALARM) ? has=true : has=false; return has; }; //1 pCallback getHandler() const diff --git a/include/policyHelper.h b/include/policyHelper.h index 5f2073a..0dfff48 100644 --- a/include/policyHelper.h +++ b/include/policyHelper.h @@ -9,11 +9,11 @@ #define POLICYHELPER_H #include -#include "helper.h" -#include "defines.h" -#include "hashConduit.h" -#include "hashConduitGroup.h" -#include "conduitFriends.h" +#include +#include +#include +#include +#include class PolicyHelper : Helper { private: diff --git a/include/restorePVGroupXMLParser.h b/include/restorePVGroupXMLParser.h index f802080..db6442b 100644 --- a/include/restorePVGroupXMLParser.h +++ b/include/restorePVGroupXMLParser.h @@ -12,7 +12,7 @@ #ifndef RESTOREPVGROUPXMLPARSER_H #define RESTOREPVGROUPXMLPARSER_H -#include "PVGroup.h" +#include #include diff --git a/makefile b/makefile index 19bc3bd..a009618 100644 --- a/makefile +++ b/makefile @@ -131,8 +131,8 @@ distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = ${SHELL} /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/missing --run aclocal-1.11 AMTAR = ${SHELL} /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/missing --run tar -AM_CPPFLAGS = -fexceptions -fPIC -Wno-deprecated -I/usr/local/epics/base/include/ -I/usr/local/epics/base/include/os/Linux -I/opt/gfa/cafe/boost/boost_1_61_0/include/boost -I/opt/gfa/cafe/boost/boost_1_61_0/include -I/usr/include/QtCore -I/usr/include/QtXml -I/opt/gfa/python-3.5/latest/include/python3.5m -I$(top_srcdir)/include -AM_LDFLAGS = -L/usr/local/epics/base/lib/SL6-x86_64 -Wl,-rpath,/usr/local/epics/base/lib/SL6-x86_64 -L/usr/lib64 -Wl,-rpath,/usr/lib64 -L/opt/gfa/python-3.5/latest/lib -Wl,-rpath,/opt/gfa/python-3.5/latest/lib @CAFE_LIBS@ +AM_CPPFLAGS = -fexceptions -fPIC -Wno-deprecated -I/usr/local/epics/base/include/ -I/usr/local/epics/base/include/os/Linux -I/opt/gfa/cafe/boost/boost_1_61_0/include/boost -I/opt/gfa/cafe/boost/boost_1_61_0/include -I/usr/include/QtCore -I/usr/include/QtXml -I$(top_srcdir)/include +AM_LDFLAGS = -L/usr/local/epics/base/lib/SL6-x86_64 -Wl,-rpath,/usr/local/epics/base/lib/SL6-x86_64 -L/usr/lib64 -Wl,-rpath,/usr/lib64 @CAFE_LIBS@ AR = ar AUTOCONF = ${SHELL} /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/missing --run autoconf AUTOHEADER = ${SHELL} /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/missing --run autoheader @@ -143,7 +143,7 @@ CC = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/6.3.0/bin/gcc CCDEPMODE = depmode=gcc3 CFLAGS = -g -O2 CPP = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/6.3.0/bin/gcc -E -CPPFLAGS = -fexceptions -fPIC -Wno-deprecated -I/usr/local/epics/base/include/ -I/usr/local/epics/base/include/os/Linux -I/opt/gfa/cafe/boost/boost_1_61_0/include/boost -I/opt/gfa/cafe/boost/boost_1_61_0/include -I/usr/include/QtCore -I/usr/include/QtXml -I/opt/gfa/python-3.5/latest/include/python3.5m +CPPFLAGS = -fexceptions -fPIC -Wno-deprecated -I/usr/local/epics/base/include/ -I/usr/local/epics/base/include/os/Linux -I/opt/gfa/cafe/boost/boost_1_61_0/include/boost -I/opt/gfa/cafe/boost/boost_1_61_0/include -I/usr/include/QtCore -I/usr/include/QtXml CXX = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/6.3.0/bin/g++ CXXCPP = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/6.3.0/bin/g++ -E CXXDEPMODE = depmode=gcc3 @@ -166,9 +166,9 @@ INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = $(install_sh) -c -s LD = /usr/bin/ld -m elf_x86_64 -LDFLAGS = -L/usr/local/epics/base/lib/SL6-x86_64 -Wl,-rpath,/usr/local/epics/base/lib/SL6-x86_64 -L/usr/lib64 -Wl,-rpath,/usr/lib64 -L/opt/gfa/python-3.5/latest/lib -Wl,-rpath,/opt/gfa/python-3.5/latest/lib +LDFLAGS = -L/usr/local/epics/base/lib/SL6-x86_64 -Wl,-rpath,/usr/local/epics/base/lib/SL6-x86_64 -L/usr/lib64 -Wl,-rpath,/usr/lib64 LIBOBJS = -LIBS = -lpython3.5m -lQtXml -lQtCore +LIBS = -lQtXml -lQtCore LIBTOOL = $(SHELL) $(top_builddir)/libtool LIPO = LN_S = ln -s @@ -227,7 +227,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/python/python-3.5/pycafe-1.8.0/lib +libdir = /opt/gfa/cafe/cpp/cafe-1.8.0-gcc-6.3.0/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale localstatedir = ${prefix}/var @@ -236,7 +236,7 @@ mandir = ${datarootdir}/man mkdir_p = /bin/mkdir -p oldincludedir = /usr/include pdfdir = ${docdir} -prefix = /opt/gfa/cafe/python/python-3.5/pycafe-1.8.0 +prefix = /opt/gfa/cafe/cpp/cafe-1.8.0-gcc-6.3.0 program_transform_name = s,x,x, psdir = ${docdir} sbindir = ${exec_prefix}/sbin diff --git a/src/cafe.cpp b/src/cafe.cpp index b87d1a0..d039d04 100644 --- a/src/cafe.cpp +++ b/src/cafe.cpp @@ -1527,7 +1527,7 @@ int CAFE::getWFAsStringCache(unsigned int handle, std::string & psWF) it_handle = handle_index.find(handle); if (it_handle != handle_index.end()) { - unsigned int c=(*it_handle).getChannelRequestMetaDataClient().getNelem(); + //unsigned int c=(*it_handle).getChannelRequestMetaDataClient().getNelem(); unsigned int n=(*it_handle).getChannelRegalia().getNelem(); unsigned int r =min( (*it_handle).getChannelRequestMetaData().getNelemCache(), ((*it_handle).getChannelRequestMetaData().getNelem()-(*it_handle).getChannelRequestMetaData().getOffset()) ) ; @@ -3989,6 +3989,36 @@ int CAFE::getAllChannelInfo(unsigned int handle, ChannelRegalia & channelInfo, P +/** + * \brief Supplment all handles with Severity levels and Desc information. + * If PV has a special field (DESC, HHSV HSV etc..) then do not supplement + * \return ICAFE_NORMAL + * +int CAFE::supplementHandles(std::vector hV) +{ +#define __METHOD__ "CAFE::supplementHandles(vector)" + cafeConduit_set_by_handle & handle_index = cs.get (); + cafeConduit_set_by_handle::iterator it_handle; + int overallStatus=ICAFE_NORMAL; + for (unsigned int i=0; i(); cafeConduit_set_by_handle::iterator it_handle; std::vector pvV; @@ -4171,173 +4202,173 @@ int CAFE::supplementHandlesV(std::vector hV) cafeConduit_set_by_handle & handle_index=cs.get(); cafeConduit_set_by_handle::iterator it_handle; - std::vector pvV; - std::vector pvAsGivenV; - std::vector pvsToClose; - std::vector allHandles; - std::vector allPVs; - - std::size_t found; - std::size_t foundField; - std::string field=""; std::string pv=""; std::string pvDevAttrib=""; - - std::vector specialFields; - specialFields.reserve(5); - specialFields.push_back( (char *) "DESC"); - specialFields.push_back( (char *) "HHSV"); - specialFields.push_back( (char *) "HSV"); - specialFields.push_back( (char *) "LSV"); - specialFields.push_back( (char *) "LLSV"); - - std::vector pvContainer; pvContainer.reserve(5); - - unsigned int localHandle=0; - int status=ICAFE_NORMAL; - int overallStatus=ICAFE_NORMAL; - - + std::vector pvV; + std::vector pvAsGivenV; + std::vector pvsToClose; + std::vector allHandles; + std::vector allPVs; + + std::size_t found; + std::size_t foundField; + std::string field=""; std::string pv=""; std::string pvDevAttrib=""; + + std::vector specialFields; + specialFields.reserve(5); + specialFields.push_back( (char *) "DESC"); + specialFields.push_back( (char *) "HHSV"); + specialFields.push_back( (char *) "HSV"); + specialFields.push_back( (char *) "LSV"); + specialFields.push_back( (char *) "LLSV"); + + std::vector pvContainer; pvContainer.reserve(5); + + unsigned int localHandle=0; + int status=ICAFE_NORMAL; + int overallStatus=ICAFE_NORMAL; + + for (unsigned int i=0; i allStatus; - std::vector vRB; vRB.reserve(allHandles.size()); - overallStatus=CAFE::get(allHandles, allStatus); - - status=CAFE::waitForBundledEvents(allHandles, vRB); - - if (status != ICAFE_NORMAL) { overallStatus=status;} - - for (int i=0; i allStatus; + std::vector vRB; vRB.reserve(allHandles.size()); + overallStatus=CAFE::get(allHandles, allStatus); + + status=CAFE::waitForBundledEvents(allHandles, vRB); + + if (status != ICAFE_NORMAL) { overallStatus=status;} + + for (int i=0; i +#include template<> char const * enumStrings::data[] = {"CAFENUM::WAIT", "CAFENUM::NO_WAIT"}; diff --git a/src/callbackHandlerMonitor.cpp b/src/callbackHandlerMonitor.cpp index e4b1340..8934c99 100644 --- a/src/callbackHandlerMonitor.cpp +++ b/src/callbackHandlerMonitor.cpp @@ -6,13 +6,13 @@ /// #include -#include "global.h" -#include "policies.h" -#include "conduitFriends.h" -#include "conduitConnectionHandlerArgs.h" -#include "conduitEventHandlerArgs.h" -#include "methodCallbacks.h" -#include "granules.h" +#include +#include +#include +#include +#include +#include +#include using namespace std; diff --git a/src/connectCallbacks.cpp b/src/connectCallbacks.cpp index 85da4b9..4e2e2c9 100644 --- a/src/connectCallbacks.cpp +++ b/src/connectCallbacks.cpp @@ -5,8 +5,8 @@ /// \version CAFE 1.0.0 /// -#include "connect.h" -#include "conduitFriends.h" +#include +#include extern cafeConduit_set cs; extern bool MUTEX; @@ -82,7 +82,7 @@ void Connect::callbackHandlerException(struct exception_handler_args args) strcpy(pName, ca_name(args.chid)); _handle = (unsigned long) ca_puser(args.chid); sprintf(buf, - "%s with request handle=%d, channel=%s, op=%ld, datatype=%s, count=%ld. %s", + "%s with request handle=%u, channel=%s, op=%ld, datatype=%s, count=%ld. %s", args.ctx, (unsigned int) _handle, pName, args.op, dbr_type_to_text (args.type), args.count, "Possibly an IOC has been switched off or is rebooting."); diff --git a/src/enumStrings.cpp b/src/enumStrings.cpp index c3444e4..646dfd7 100644 --- a/src/enumStrings.cpp +++ b/src/enumStrings.cpp @@ -6,10 +6,10 @@ /// \version CAFE 1.0.0 -#include "enumStrings.h" -#include "defines.h" -#include "policies.h" -#include "cafeEnum.h" +#include +#include +#include +#include template diff --git a/src/exceptionsHelper.cpp b/src/exceptionsHelper.cpp index 3296e32..0309b04 100644 --- a/src/exceptionsHelper.cpp +++ b/src/exceptionsHelper.cpp @@ -5,7 +5,7 @@ /// \version CAFE 1.0.0 /// -#include "exceptionsHelper.h" +#include using namespace std; diff --git a/src/helper.cpp b/src/helper.cpp index 53c563b..b4a96ea 100644 --- a/src/helper.cpp +++ b/src/helper.cpp @@ -4,11 +4,8 @@ /// \date Release: February 2015 /// \version CAFE 1.0.0 -//include "connect.h" -//include "conduit.h" -//#include "cafeConduitFriends.h" -#include "helper.h" +#include using namespace std; diff --git a/src/loadGroupXMLParser.cpp b/src/loadGroupXMLParser.cpp index b159108..7aea107 100644 --- a/src/loadGroupXMLParser.cpp +++ b/src/loadGroupXMLParser.cpp @@ -7,7 +7,7 @@ -#include "loadGroupXMLParser.h" +#include #if HAVE_LIBQTXML #include diff --git a/src/makefile b/src/makefile index 65c9d83..88cf065 100644 --- a/src/makefile +++ b/src/makefile @@ -111,8 +111,8 @@ AMTAR = ${SHELL} /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/missing --run tar #if HAVE_ZEROMQ #libcafe_la_SOURCES += cafeService.cpp #endif -AM_CPPFLAGS = -fexceptions -fPIC -Wno-deprecated -I/usr/local/epics/base/include/ -I/usr/local/epics/base/include/os/Linux -I/opt/gfa/cafe/boost/boost_1_61_0/include/boost -I/opt/gfa/cafe/boost/boost_1_61_0/include -I/usr/include/QtCore -I/usr/include/QtXml -I/opt/gfa/python-3.5/latest/include/python3.5m -I$(top_srcdir)/include -AM_LDFLAGS = -L/usr/local/epics/base/lib/SL6-x86_64 -Wl,-rpath,/usr/local/epics/base/lib/SL6-x86_64 -L/usr/lib64 -Wl,-rpath,/usr/lib64 -L/opt/gfa/python-3.5/latest/lib -Wl,-rpath,/opt/gfa/python-3.5/latest/lib +AM_CPPFLAGS = -fexceptions -fPIC -Wno-deprecated -I/usr/local/epics/base/include/ -I/usr/local/epics/base/include/os/Linux -I/opt/gfa/cafe/boost/boost_1_61_0/include/boost -I/opt/gfa/cafe/boost/boost_1_61_0/include -I/usr/include/QtCore -I/usr/include/QtXml -I$(top_srcdir)/include +AM_LDFLAGS = -L/usr/local/epics/base/lib/SL6-x86_64 -Wl,-rpath,/usr/local/epics/base/lib/SL6-x86_64 -L/usr/lib64 -Wl,-rpath,/usr/lib64 AR = ar AUTOCONF = ${SHELL} /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/missing --run autoconf AUTOHEADER = ${SHELL} /afs/psi.ch/project/cafe/gitlab/CAFE/cpp/missing --run autoheader @@ -123,7 +123,7 @@ CC = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/6.3.0/bin/gcc CCDEPMODE = depmode=gcc3 CFLAGS = -g -O2 CPP = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/6.3.0/bin/gcc -E -CPPFLAGS = -fexceptions -fPIC -Wno-deprecated -I/usr/local/epics/base/include/ -I/usr/local/epics/base/include/os/Linux -I/opt/gfa/cafe/boost/boost_1_61_0/include/boost -I/opt/gfa/cafe/boost/boost_1_61_0/include -I/usr/include/QtCore -I/usr/include/QtXml -I/opt/gfa/python-3.5/latest/include/python3.5m +CPPFLAGS = -fexceptions -fPIC -Wno-deprecated -I/usr/local/epics/base/include/ -I/usr/local/epics/base/include/os/Linux -I/opt/gfa/cafe/boost/boost_1_61_0/include/boost -I/opt/gfa/cafe/boost/boost_1_61_0/include -I/usr/include/QtCore -I/usr/include/QtXml CXX = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/6.3.0/bin/g++ CXXCPP = /afs/psi.ch/sys/psi.x86_64_slp6/Programming/gcc/6.3.0/bin/g++ -E CXXDEPMODE = depmode=gcc3 @@ -146,9 +146,9 @@ INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_STRIP_PROGRAM = $(install_sh) -c -s LD = /usr/bin/ld -m elf_x86_64 -LDFLAGS = -L/usr/local/epics/base/lib/SL6-x86_64 -Wl,-rpath,/usr/local/epics/base/lib/SL6-x86_64 -L/usr/lib64 -Wl,-rpath,/usr/lib64 -L/opt/gfa/python-3.5/latest/lib -Wl,-rpath,/opt/gfa/python-3.5/latest/lib +LDFLAGS = -L/usr/local/epics/base/lib/SL6-x86_64 -Wl,-rpath,/usr/local/epics/base/lib/SL6-x86_64 -L/usr/lib64 -Wl,-rpath,/usr/lib64 LIBOBJS = -LIBS = -lpython3.5m -lQtXml -lQtCore +LIBS = -lQtXml -lQtCore LIBTOOL = $(SHELL) $(top_builddir)/libtool LIPO = LN_S = ln -s @@ -207,7 +207,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/python/python-3.5/pycafe-1.8.0/lib +libdir = /opt/gfa/cafe/cpp/cafe-1.8.0-gcc-6.3.0/lib libexecdir = ${exec_prefix}/libexec localedir = ${datarootdir}/locale localstatedir = ${prefix}/var @@ -216,7 +216,7 @@ mandir = ${datarootdir}/man mkdir_p = /bin/mkdir -p oldincludedir = /usr/include pdfdir = ${docdir} -prefix = /opt/gfa/cafe/python/python-3.5/pycafe-1.8.0 +prefix = /opt/gfa/cafe/cpp/cafe-1.8.0-gcc-6.3.0 program_transform_name = s,x,x, psdir = ${docdir} sbindir = ${exec_prefix}/sbin diff --git a/src/methodCallbacks.cpp b/src/methodCallbacks.cpp index ea12af8..b83bc7c 100644 --- a/src/methodCallbacks.cpp +++ b/src/methodCallbacks.cpp @@ -4,9 +4,9 @@ /// \date Release: February 2015 /// \version CAFE 1.0.0 -#include "conduitEventHandlerArgs.h" -#include "methodCallbacks.h" -#include "connect.h" +#include +#include +#include using namespace std; diff --git a/src/policyHelper.cpp b/src/policyHelper.cpp index ea76c5d..0afe8bd 100644 --- a/src/policyHelper.cpp +++ b/src/policyHelper.cpp @@ -5,8 +5,8 @@ /// \version CAFE 1.0.0 /// -#include "policyHelper.h" -#include "global.h" +#include +#include using namespace std; diff --git a/src/restorePVGroupXMLParser.cpp b/src/restorePVGroupXMLParser.cpp index 4f41db4..7c9f948 100644 --- a/src/restorePVGroupXMLParser.cpp +++ b/src/restorePVGroupXMLParser.cpp @@ -7,7 +7,7 @@ -#include "restorePVGroupXMLParser.h" +#include #if HAVE_LIBQTXML diff --git a/src/transpose.cpp b/src/transpose.cpp index 7ff85e3..f906537 100644 --- a/src/transpose.cpp +++ b/src/transpose.cpp @@ -8,7 +8,7 @@ #ifndef TRANSPOSE_CC #define TRANSPOSE_CC -#include "transpose.h" +#include using namespace std; @@ -108,8 +108,6 @@ int Transpose::putString memcpy( stig, &(((struct dbr_ctrl_enum *) dataEnum)->strs), sizeof(stig )) ; - - for (unsigned int i=0; i::get( break; case DBR_ENUM: - for (unsigned int i=0; ino_str; + { + //Special treatment of ENUM: Transform VAL to String equivalent + dataEnum = (dbr_ctrl_enum *) (*it_handle).getCtrlBuffer(); + noStrings = ((struct dbr_ctrl_enum *) dataEnum)->no_str; - memcpy( stig, &(((struct dbr_ctrl_enum *) dataEnum)->strs), sizeof(stig )) ; + memcpy( stig, &(((struct dbr_ctrl_enum *) dataEnum)->strs), sizeof(stig )) ; - - - - unsigned int noEmptyStrings=0; - //Check for empty strings: - for (unsigned int j=0; jtenmval.value)+i+offset)) < noStrings) && (noStrings!=noEmptyStrings)) { - sprintf(val[i], "%s", stig[(*(&((PVDataL)->tenmval.value)+i+offset))] ); - } - else { - sprintf(val[i], "%d", (*(&((PVDataL)->tenmval.value)+i+offset)) ); - if ( ((*(&((PVDataL)->tenmval.value)+i+offset)) >= noStrings) ) { - cout << "*** WARNING FROM " << __METHOD__ << " *** " << endl; - cout << "ENUM UNSIGNED SHORT VALUE IS GREATER THAN THE NO OF ENUMERATED TYPES" << endl; - cout << "VALUE (unsigned short) = " << (*(&((PVDataL)->tenmval.value)+i+offset)) << endl; - cout << "NO OF ENUMERATED STRINGS = " << noStrings << " WITH VALUES: " << endl; - for (unsigned int j=0; jenmval)+i+offset))] ); - // } } - break; + if (noStrings==noEmptyStrings) { + cout << "*** WARNING FROM " << __METHOD__ << " *** " << endl; + cout << "ENUM STRING OPTIONS ARE ALL EMPTY! " << endl; + cout << "BADLY CONFIGURED EPICS " << (*it_handle).getChannelRegalia().getClassName() << " RECORD. " << endl; + cout << "CHANNEL: " << (*it_handle).getPV() << " (handle=" << (*it_handle).getHandle() <<") " << endl; + } + + for (unsigned int i=0; ienmval)+i+offset)) < noStrings) && (noStrings!=noEmptyStrings)) { + sprintf(val[i], "%s", stig[(*(&((PVDataL)->enmval)+i+offset))] ); + } + else { + sprintf(val[i], "%d", (*(&((PVDataL)->enmval)+i+offset)) ); + if ( ((*(&((PVDataL)->enmval)+i+offset)) >= noStrings) ) { + cout << "*** WARNING FROM " << __METHOD__ << " *** " << endl; + cout << "ENUM UNSIGNED SHORT VALUE IS GREATER THAN THE NO OF ENUMERATED TYPES" << endl; + cout << "VALUE (unsigned short) = " << (*(&((PVDataL)->enmval)+i+offset)) << endl; + cout << "NO OF ENUMERATED STRINGS = " << noStrings << " WITH VALUES: " << endl; + for (unsigned int j=0; jstrval))[offset], sizeof(dbr_string_t)*nelem) ; break; @@ -788,58 +777,49 @@ int Transpose::get( break; case DBR_STS_ENUM: - for (unsigned int i=0; ino_str; - memcpy( stig, &(((struct dbr_ctrl_enum *) dataEnum)->strs), sizeof(stig)) ; + { + //Special treatment of ENUM: Transform VAL to String equivalent + dataEnum = (dbr_ctrl_enum *) (*it_handle).getCtrlBuffer(); + noStrings = ((struct dbr_ctrl_enum *) dataEnum)->no_str; + memcpy( stig, &(((struct dbr_ctrl_enum *) dataEnum)->strs), sizeof(stig)) ; - - - unsigned int noEmptyStrings=0; - //Check for empty strings: - for (unsigned int j=0; jtenmval.value)+i+offset)) < noStrings) && (noStrings!=noEmptyStrings)) { - sprintf(val[i], "%s", stig[(*(&((PVDataL)->tenmval.value)+i+offset))] ); - } - else { - sprintf(val[i], "%d", (*(&((PVDataL)->tenmval.value)+i+offset)) ); - if ( ((*(&((PVDataL)->tenmval.value)+i+offset)) >= noStrings) ) { - cout << "*** WARNING FROM " << __METHOD__ << " *** " << endl; - cout << "ENUM UNSIGNED SHORT VALUE IS GREATER THAN THE NO OF ENUMERATED TYPES" << endl; - cout << "VALUE (unsigned short) = " << (*(&((PVDataL)->tenmval.value)+i+offset)) << endl; - cout << "NO OF ENUMERATED STRINGS = " << noStrings << " WITH VALUES: " << endl; - for (unsigned int j=0; jsenmval.value)+i+offset))] ); - //} } + if (noStrings==noEmptyStrings) { + cout << "*** WARNING FROM " << __METHOD__ << " *** " << endl; + cout << "ENUM STRING OPTIONS ARE ALL EMPTY! " << endl; + cout << "BADLY CONFIGURED EPICS " << (*it_handle).getChannelRegalia().getClassName() << " RECORD. " << endl; + cout << "CHANNEL: " << (*it_handle).getPV() << " (handle=" << (*it_handle).getHandle() <<") " << endl; + } + + for (unsigned int i=0; isenmval.value)+i+offset)) < noStrings) && (noStrings!=noEmptyStrings)) { + sprintf(val[i], "%s", stig[(*(&((PVDataL)->senmval.value)+i+offset))] ); + } + else { + sprintf(val[i], "%d", (*(&((PVDataL)->senmval.value)+i+offset)) ); + if ( ((*(&((PVDataL)->senmval.value)+i+offset)) >= noStrings) ) { + cout << "*** WARNING FROM " << __METHOD__ << " *** " << endl; + cout << "ENUM UNSIGNED SHORT VALUE IS GREATER THAN THE NO OF ENUMERATED TYPES" << endl; + cout << "VALUE (unsigned short) = " << (*(&((PVDataL)->senmval.value)+i+offset)) << endl; + cout << "NO OF ENUMERATED STRINGS = " << noStrings << " WITH VALUES: " << endl; + for (unsigned int j=0; jstatus; alarmSeverity = ((struct dbr_sts_enum *) PVDataL)->severity; break; - + } case DBR_STS_STRING: for (unsigned int i=0; isstrval.value)+i+offset))) ; @@ -853,7 +833,6 @@ int Transpose::get( for (unsigned int i=0; itchrval.value)+i+offset))); } - //cout << "TRANSPOSE " << val[0] << endl; ts = ((struct dbr_time_char *) PVDataL)->stamp; alarmStatus = ((struct dbr_time_char *) PVDataL)->status; alarmSeverity = ((struct dbr_time_char *) PVDataL)->severity; @@ -899,56 +878,56 @@ int Transpose::get( break; case DBR_TIME_ENUM: - for (unsigned int i=0; ino_str; + noStrings = ((struct dbr_ctrl_enum *) dataEnum)->no_str; - memcpy( stig, &(((struct dbr_ctrl_enum *) dataEnum)->strs), sizeof(stig )) ; + memcpy( stig, &(((struct dbr_ctrl_enum *) dataEnum)->strs), sizeof(stig )) ; - //if native DataType is ENUM then overwrite call Enum method and then convert to string! - //Check data type - //cout << "Classname " << (*it_handle).getChannelRegalia().getClassName() << endl; + //if native DataType is ENUM then overwrite call Enum method and then convert to string! + //Check data type + //cout << "Classname " << (*it_handle).getChannelRegalia().getClassName() << endl; - unsigned int noEmptyStrings=0; - //Check for empty strings: - for (unsigned int j=0; jtenmval.value)+i+offset)) < noStrings) && (noStrings!=noEmptyStrings)) { - sprintf(val[i], "%s", stig[(*(&((PVDataL)->tenmval.value)+i+offset))] ); - } - else { - sprintf(val[i], "%d", (*(&((PVDataL)->tenmval.value)+i+offset)) ); - if ( ((*(&((PVDataL)->tenmval.value)+i+offset)) >= noStrings) ) { - cout << "*** WARNING FROM " << __METHOD__ << " *** " << endl; - cout << "ENUM UNSIGNED SHORT VALUE IS GREATER THAN THE NO OF ENUMERATED TYPES" << endl; - cout << "VALUE (unsigned short) = " << (*(&((PVDataL)->tenmval.value)+i+offset)) << endl; - cout << "NO OF ENUMERATED STRINGS = " << noStrings << " WITH VALUES: " << endl; - for (unsigned int j=0; jtenmval.value)+i+offset)) < noStrings) && (noStrings!=noEmptyStrings)) { + sprintf(val[i], "%s", stig[(*(&((PVDataL)->tenmval.value)+i+offset))] ); + } + else { + sprintf(val[i], "%d", (*(&((PVDataL)->tenmval.value)+i+offset)) ); + if ( ((*(&((PVDataL)->tenmval.value)+i+offset)) >= noStrings) ) { + cout << "*** WARNING FROM " << __METHOD__ << " *** " << endl; + cout << "ENUM UNSIGNED SHORT VALUE IS GREATER THAN THE NO OF ENUMERATED TYPES" << endl; + cout << "VALUE (unsigned short) = " << (*(&((PVDataL)->tenmval.value)+i+offset)) << endl; + cout << "NO OF ENUMERATED STRINGS = " << noStrings << " WITH VALUES: " << endl; + for (unsigned int j=0; jstamp; alarmStatus = ((struct dbr_time_enum *) PVDataL)->status; alarmSeverity = ((struct dbr_time_enum *) PVDataL)->severity; break; + } case DBR_TIME_STRING: for (unsigned int i=0; i