fixed getString in transpose.cpp for ENUM types for STS and TIME datatypes; indents made consistent; angled brackets for headers

This commit is contained in:
2018-12-19 11:56:16 +01:00
parent b09186294d
commit ab743baa8b
26 changed files with 391 additions and 385 deletions

Binary file not shown.

View File

@@ -66,7 +66,6 @@ int main( int argc, char *argv[] )
//------------------------------------------------------------
//(1) Establishing connections to EPICS Process Variables (PVs)
//------------------------------------------------------------

View File

@@ -10,8 +10,8 @@
#define CAFEENUMSTRINGS_H
#include "cafeEnum.h"
#include "enumStrings.h"
#include <cafeEnum.h>
#include <enumStrings.h>
template<> char const * enumStrings<CAFENUM::ChannelWaitForResponsePolicyKind>::data[]
= {"CAFENUM::WAIT", "CAFENUM::NO_WAIT"};

View File

@@ -8,9 +8,9 @@
#ifndef EXCEPTIONSHELPER_H
#define EXCEPTIONSHELPER_H
#include "exceptions.h"
#include "statusCodes.h"
#include "defines.h"
#include <exceptions.h>
#include <statusCodes.h>
#include <defines.h>
class ExceptionsHelper {
private:

View File

@@ -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!!!

View File

@@ -420,7 +420,7 @@ public:
};
#include "instant.cpp"
#include <instant.cpp>
#endif // INSTANT_H

View File

@@ -13,7 +13,7 @@
#ifndef LOADCOLLECTIONXMLPARSER_H
#define LOADCOLLECTIONXMLPARSER_H
#include "deviceCollection.h"
#include <deviceCollection.h>
#include <QtXml/QXmlDefaultHandler>

View File

@@ -12,7 +12,7 @@
#ifndef LOADGROUPXMLPARSER_H
#define LOADGROUPXMLPARSER_H
#include "deviceCollection.h"
#include <deviceCollection.h>
#include <QtXml/QXmlDefaultHandler>

View File

@@ -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

View File

@@ -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

View File

@@ -9,11 +9,11 @@
#define POLICYHELPER_H
#include <cadef.h>
#include "helper.h"
#include "defines.h"
#include "hashConduit.h"
#include "hashConduitGroup.h"
#include "conduitFriends.h"
#include <helper.h>
#include <defines.h>
#include <hashConduit.h>
#include <hashConduitGroup.h>
#include <conduitFriends.h>
class PolicyHelper : Helper {
private:

View File

@@ -12,7 +12,7 @@
#ifndef RESTOREPVGROUPXMLPARSER_H
#define RESTOREPVGROUPXMLPARSER_H
#include "PVGroup.h"
#include <PVGroup.h>
#include <QtXml/QXmlDefaultHandler>

View File

@@ -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

View File

@@ -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<unsigned int> hV)
{
#define __METHOD__ "CAFE::supplementHandles(vector<unsigned int>)"
cafeConduit_set_by_handle & handle_index = cs.get<by_handle> ();
cafeConduit_set_by_handle::iterator it_handle;
int overallStatus=ICAFE_NORMAL;
for (unsigned int i=0; i<hV.size(); ++i) {
it_handle = handle_index.find(hV[i]);
if (it_handle != handle_index.end()) {
}
else {
overallStatus=ECAFE_INVALID_HANDLE;
}
}
return overallStatus;
return ICAFE_NORMAL;
#undef __METHOD__
}
*/
/**
* \brief Supplment all handles with Severity levels and Desc information.
* If PV has a special field (DESC, HHSV HSV etc..) then do not supplement
@@ -3996,7 +4026,8 @@ int CAFE::getAllChannelInfo(unsigned int handle, ChannelRegalia & channelInfo, P
*/
int CAFE::supplementHandles()
{
#define __METHOD__ "CAFE::supplementHandlesV()"
#define __METHOD__ "CAFE::supplementHandles()"
cafeConduit_set_by_handle & handle_index=cs.get<by_handle>();
cafeConduit_set_by_handle::iterator it_handle;
std::vector<std::string> pvV;
@@ -4171,173 +4202,173 @@ int CAFE::supplementHandlesV(std::vector<unsigned int> hV)
cafeConduit_set_by_handle & handle_index=cs.get<by_handle>();
cafeConduit_set_by_handle::iterator it_handle;
std::vector<std::string> pvV;
std::vector<std::string> pvAsGivenV;
std::vector<std::string> pvsToClose;
std::vector<unsigned int> allHandles;
std::vector<std::string> allPVs;
std::size_t found;
std::size_t foundField;
std::string field=""; std::string pv=""; std::string pvDevAttrib="";
std::vector<std::string> 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<std::string> pvContainer; pvContainer.reserve(5);
unsigned int localHandle=0;
int status=ICAFE_NORMAL;
int overallStatus=ICAFE_NORMAL;
std::vector<std::string> pvV;
std::vector<std::string> pvAsGivenV;
std::vector<std::string> pvsToClose;
std::vector<unsigned int> allHandles;
std::vector<std::string> allPVs;
std::size_t found;
std::size_t foundField;
std::string field=""; std::string pv=""; std::string pvDevAttrib="";
std::vector<std::string> 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<std::string> pvContainer; pvContainer.reserve(5);
unsigned int localHandle=0;
int status=ICAFE_NORMAL;
int overallStatus=ICAFE_NORMAL;
for (unsigned int i=0; i<hV.size(); ++i) {
it_handle = handle_index.find(hV[i]);
if (it_handle != handle_index.end()) {
pv=(*it_handle).getPV();
pvDevAttrib=pv;
field="";
found = pv.find(".");
if (it_handle != handle_index.end()) {
pv=(*it_handle).getPV();
pvDevAttrib=pv;
field="";
found = pv.find(".");
if (found != std::string::npos) {
field=pv.substr(found, pv.size()-1);
//DO NOT SUPPLEMENT CONDUIT OBJECT FOR PVS WITH SPECIAL FIELDS
bool breakFlag=false;
for (int j=0; j<specialFields.size(); ++j) {
foundField=field.find(specialFields[j]);
if (foundField != std::string::npos) {
breakFlag=true;
break;
}
}
//std::cout << "field = " << field << std::endl;
//std::cout << "pv.substr = " << pv.substr(0,found) << std::endl;
if (breakFlag) {
std::cout << "This pv is not supplemented = " << pv << std::endl;
continue;
}
if ( (*it_handle).hasDescription() && (*it_handle).hasAlarmSeverityStruct() ) {
std::cout << "This pv has already been supplemented = " << pv << std::endl;
continue;
}
pvDevAttrib=pv.substr(0,found);
pvV.push_back(pvDevAttrib);
//DO NOT SUPPLEMENT CONDUIT OBJECT FOR PVS WITH SPECIAL FIELDS
bool breakFlag=false;
for (int j=0; j<specialFields.size(); ++j) {
foundField=field.find(specialFields[j]);
if (foundField != std::string::npos) {
breakFlag=true;
break;
}
}
//std::cout << "field = " << field << std::endl;
//std::cout << "pv.substr = " << pv.substr(0,found) << std::endl;
if (breakFlag) {
std::cout << "This pv is not supplemented = " << pv << std::endl;
continue;
}
if ( (*it_handle).hasDescription() && (*it_handle).hasAlarmSeverityStruct() ) {
std::cout << "This pv has already been supplemented = " << pv << std::endl;
continue;
}
pvDevAttrib=pv.substr(0,found);
pvV.push_back(pvDevAttrib);
}
else {
pvV.push_back(pv);
}
pvAsGivenV.push_back(pv);
pvContainer.clear();
else {
pvV.push_back(pv);
}
pvAsGivenV.push_back(pv);
pvContainer.clear();
for (int j=0; j<specialFields.size(); ++j) {
std::string pvS=pvDevAttrib; pvS.append((char *)"."); pvS.append(specialFields[j]);
pvContainer.push_back(pvS);
}
//Check if already open -if yes do not add to pvHandlestoOpenAndClose
for (int i=0; i<pvContainer.size(); ++i) {
localHandle= handleHelper.getHandleFromPV(pvContainer[i].c_str());
if (localHandle == 0 ) {
pvsToClose.push_back(pvContainer[i]);
allPVs.push_back(pvContainer[i]);
}
else {
//pvHandlesAlreadyExisiting.insert(pvContainer[i]);
allPVs.push_back(pvContainer[i]);
}
}
}
else {
std::string pvS=pvDevAttrib; pvS.append((char *)"."); pvS.append(specialFields[j]);
pvContainer.push_back(pvS);
}
//Check if already open -if yes do not add to pvHandlestoOpenAndClose
for (int k=0; k<pvContainer.size(); ++k) {
localHandle= handleHelper.getHandleFromPV(pvContainer[k].c_str());
if (localHandle == 0 ) {
pvsToClose.push_back(pvContainer[k]);
allPVs.push_back(pvContainer[k]);
}
else {
//pvHandlesAlreadyExisiting.insert(pvContainer[k]);
allPVs.push_back(pvContainer[k]);
}
}
}
else {
cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << endl;
cafeStatus.report(ECAFE_INVALID_HANDLE);
cout << "Handle=" << hV[i] << " either never existed or no longer exists " << endl;
overallStatus=ECAFE_INVALID_HANDLE;
}
}//for
CAFE::openPrepare();
try {
CAFE::open(allPVs, allHandles);
}
catch(CAFEException_open &e) {
return e.pvEx.statusCode;
}
CAFE::openNowAndWait(2.0);
//CAFE::printHandles();
//Get Asyn No Blocking
std::vector<int> allStatus;
std::vector<int> 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<pvV.size(); ++i) {
pvContainer.clear();
CAFE::openPrepare();
try {
CAFE::open(allPVs, allHandles);
}
catch(CAFEException_open &e) {
return e.pvEx.statusCode;
}
CAFE::openNowAndWait(2.0);
//CAFE::printHandles();
//Get Asyn No Blocking
std::vector<int> allStatus;
std::vector<int> 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<pvV.size(); ++i) {
pvContainer.clear();
for (int j=0; j<specialFields.size(); ++j) {
std::string pvS=pvV[i]; pvS.append((char *)"."); pvS.append(specialFields[j]);
pvContainer.push_back(pvS);
}
alarmSeverityStruct ass;
std::string desc="";
CAFE::getCache(pvContainer[0].c_str(), desc);
CAFE::getCache(pvContainer[1].c_str(), ass.hhsv);
CAFE::getCache(pvContainer[2].c_str(), ass.hsv);
CAFE::getCache(pvContainer[3].c_str(), ass.lsv);
CAFE::getCache(pvContainer[4].c_str(), ass.llsv);
std::cout << i << " " << pvContainer[0] << " " << desc << std::endl;
std::cout << i << " " << pvContainer[1] << " " << ass.hhsv << std::endl;
std::cout << i << " " << pvContainer[2] << " " << ass.hsv << std::endl;
std::cout << i << " " << pvContainer[3] << " " << ass.lsv << std::endl;
std::cout << i << " " << pvContainer[4] << " " << ass.llsv << std::endl;
std::string pvS=pvV[i]; pvS.append((char *)"."); pvS.append(specialFields[j]);
pvContainer.push_back(pvS);
}
alarmSeverityStruct ass;
std::string desc="";
CAFE::getCache(pvContainer[0].c_str(), desc);
CAFE::getCache(pvContainer[1].c_str(), ass.hhsv);
CAFE::getCache(pvContainer[2].c_str(), ass.hsv);
CAFE::getCache(pvContainer[3].c_str(), ass.lsv);
CAFE::getCache(pvContainer[4].c_str(), ass.llsv);
std::cout << i << " " << pvContainer[0] << " " << desc << std::endl;
std::cout << i << " " << pvContainer[1] << " " << ass.hhsv << std::endl;
std::cout << i << " " << pvContainer[2] << " " << ass.hsv << std::endl;
std::cout << i << " " << pvContainer[3] << " " << ass.lsv << std::endl;
std::cout << i << " " << pvContainer[4] << " " << ass.llsv << std::endl;
it_handle = handle_index.find(handleHelper.getHandleFromPV(pvAsGivenV[i].c_str()));
if (it_handle != handle_index.end()) {
if(MUTEX) {
cafeMutex.lock();
};
cafeMutex.lock();
};
handle_index.modify(it_handle, change_supplementHandle(ass,desc));
if(MUTEX) {
cafeMutex.unlock();
};
cafeMutex.unlock();
};
}
else {
std::cout << __METHOD__ << " INVALID HANDLE " <<std::endl;
}
}
CAFE::openPrepare();
for (int i=0; i < pvsToClose.size(); ++i) {
CAFE::close(handleHelper.getHandleFromPV(pvsToClose[i].c_str()));
}
CAFE::flushNow();
//CAFE::printHandles();
for (int i=0; i<pvAsGivenV.size(); ++i) {
std::string desc="";
handleHelper.getDescription( handleHelper.getHandleFromPV(pvAsGivenV[i].c_str()), desc);
std::cout << i << " DESC=" << desc << " for pv= " << pvAsGivenV[i].c_str() << std::endl;
}
}
CAFE::openPrepare();
for (int i=0; i < pvsToClose.size(); ++i) {
CAFE::close(handleHelper.getHandleFromPV(pvsToClose[i].c_str()));
}
CAFE::flushNow();
//CAFE::printHandles();
for (int i=0; i<pvAsGivenV.size(); ++i) {
std::string desc="";
handleHelper.getDescription( handleHelper.getHandleFromPV(pvAsGivenV[i].c_str()), desc);
std::cout << i << " DESC=" << desc << " for pv= " << pvAsGivenV[i].c_str() << std::endl;
}
return ICAFE_NORMAL;
#undef __METHOD__
}

View File

@@ -5,8 +5,8 @@
/// \version CAFE 1.0.0
///
#include "cafeEnum.h"
#include "enumStrings.h"
#include <cafeEnum.h>
#include <enumStrings.h>
template<> char const * enumStrings<CAFENUM::ChannelWaitForResponsePolicyKind>::data[]
= {"CAFENUM::WAIT", "CAFENUM::NO_WAIT"};

View File

@@ -6,13 +6,13 @@
///
#include <cadef.h>
#include "global.h"
#include "policies.h"
#include "conduitFriends.h"
#include "conduitConnectionHandlerArgs.h"
#include "conduitEventHandlerArgs.h"
#include "methodCallbacks.h"
#include "granules.h"
#include <global.h>
#include <policies.h>
#include <conduitFriends.h>
#include <conduitConnectionHandlerArgs.h>
#include <conduitEventHandlerArgs.h>
#include <methodCallbacks.h>
#include <granules.h>
using namespace std;

View File

@@ -5,8 +5,8 @@
/// \version CAFE 1.0.0
///
#include "connect.h"
#include "conduitFriends.h"
#include <connect.h>
#include <conduitFriends.h>
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.");

View File

@@ -6,10 +6,10 @@
/// \version CAFE 1.0.0
#include "enumStrings.h"
#include "defines.h"
#include "policies.h"
#include "cafeEnum.h"
#include <enumStrings.h>
#include <defines.h>
#include <policies.h>
#include <cafeEnum.h>
template<typename T>

View File

@@ -5,7 +5,7 @@
/// \version CAFE 1.0.0
///
#include "exceptionsHelper.h"
#include <exceptionsHelper.h>
using namespace std;

View File

@@ -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 <helper.h>
using namespace std;

View File

@@ -7,7 +7,7 @@
#include "loadGroupXMLParser.h"
#include <loadGroupXMLParser.h>
#if HAVE_LIBQTXML
#include <stdio.h>

View File

@@ -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

View File

@@ -4,9 +4,9 @@
/// \date Release: February 2015
/// \version CAFE 1.0.0
#include "conduitEventHandlerArgs.h"
#include "methodCallbacks.h"
#include "connect.h"
#include <conduitEventHandlerArgs.h>
#include <methodCallbacks.h>
#include <connect.h>
using namespace std;

View File

@@ -5,8 +5,8 @@
/// \version CAFE 1.0.0
///
#include "policyHelper.h"
#include "global.h"
#include <policyHelper.h>
#include <global.h>
using namespace std;

View File

@@ -7,7 +7,7 @@
#include "restorePVGroupXMLParser.h"
#include <restorePVGroupXMLParser.h>
#if HAVE_LIBQTXML

View File

@@ -8,7 +8,7 @@
#ifndef TRANSPOSE_CC
#define TRANSPOSE_CC
#include "transpose.h"
#include <transpose.h>
using namespace std;
@@ -108,8 +108,6 @@ int Transpose<dbr_string_t>::putString
memcpy( stig, &(((struct dbr_ctrl_enum *) dataEnum)->strs), sizeof(stig )) ;
for (unsigned int i=0; i<nelem; ++i) {
//Remove leading and blank spaces
@@ -690,58 +688,49 @@ int Transpose<dbr_string_t>::get(
break;
case DBR_ENUM:
for (unsigned int i=0; i<nelem; ++i) {
//Special treatment of ENUM: Transform VAL to String equivalent
dataEnum = (dbr_ctrl_enum *) (*it_handle).getCtrlBuffer();
noStrings = ((struct dbr_ctrl_enum *) dataEnum)->no_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; j<noStrings; ++j) {
if (strcmp(stig[j],"")==0) {
++noEmptyStrings;
}
unsigned int noEmptyStrings=0;
//Check for empty strings:
for (unsigned int j=0; j<noStrings; ++j) {
if (strcmp(stig[j],"")==0) {
++noEmptyStrings;
}
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; i<nelem; ++i) {
if ( ((*(&((PVDataL)->tenmval.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; j<noStrings; ++j) {
cout << stig[j] << " [" <<j << "] ";
}
cout << endl;
}
}
}
//if native DataType is ENUM then overwrite call Enum method and then convert to string!
//for (unsigned int i=0; i<nelem; ++i) {
// sprintf(val[i], "%s", stig[(*(&((PVDataL)->enmval)+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; i<nelem; ++i) {
if ( ((*(&((PVDataL)->enmval)+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; j<noStrings; ++j) {
cout << stig[j] << " [" <<j << "] ";
}
cout << endl;
}
}
}
break;
}
case DBR_STRING:
memcpy( val, &(&((PVDataL)->strval))[offset], sizeof(dbr_string_t)*nelem) ;
break;
@@ -788,58 +777,49 @@ int Transpose<dbr_string_t>::get(
break;
case DBR_STS_ENUM:
for (unsigned int i=0; i<nelem; ++i) {
//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)) ;
{
//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; j<noStrings; ++j) {
if (strcmp(stig[j],"")==0) {
++noEmptyStrings;
}
unsigned int noEmptyStrings=0;
//Check for empty strings:
for (unsigned int j=0; j<noStrings; ++j) {
if (strcmp(stig[j],"")==0) {
++noEmptyStrings;
}
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; i<nelem; ++i) {
if ( ((*(&((PVDataL)->tenmval.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; j<noStrings; ++j) {
cout << stig[j] << " [" <<j << "] ";
}
cout << endl;
}
}
}
//if native DataType is ENUM then overwrite call Enum method and then convert to string!
//for (unsigned int i=0; i<nelem; ++i) {
// sprintf(val[i], "%s", stig[(*(&((PVDataL)->senmval.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; i<nelem; ++i) {
if ( ((*(&((PVDataL)->senmval.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; j<noStrings; ++j) {
cout << stig[j] << " [" <<j << "] ";
}
cout << endl;
}
}
}
alarmStatus = ((struct dbr_sts_enum *) PVDataL)->status;
alarmSeverity = ((struct dbr_sts_enum *) PVDataL)->severity;
break;
}
case DBR_STS_STRING:
for (unsigned int i=0; i<nelem; ++i) {
strcpy(val[i], (*(&((PVDataL)->sstrval.value)+i+offset))) ;
@@ -853,7 +833,6 @@ int Transpose<dbr_string_t>::get(
for (unsigned int i=0; i<nelem; ++i) {
sprintf(val[i], "%u", (*(&((PVDataL)->tchrval.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<dbr_string_t>::get(
break;
case DBR_TIME_ENUM:
for (unsigned int i=0; i<nelem; ++i) {
{
//Special treatment of ENUM: Transform VAL to String equivalent
dataEnum = (dbr_ctrl_enum *) (*it_handle).getCtrlBuffer();
//Special treatment of ENUM: Transform VAL to String equivalent
dataEnum = (dbr_ctrl_enum *) (*it_handle).getCtrlBuffer();
noStrings = ((struct dbr_ctrl_enum *) dataEnum)->no_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; j<noStrings; ++j) {
if (strcmp(stig[j],"")==0) {
++noEmptyStrings;
}
}
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; i<nelem; ++i) {
if ( ((*(&((PVDataL)->tenmval.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; j<noStrings; ++j) {
cout << stig[j] << " [" <<j << "] ";
}
cout << endl;
}
}
unsigned int noEmptyStrings=0;
//Check for empty strings:
for (unsigned int j=0; j<noStrings; ++j) {
if (strcmp(stig[j],"")==0) {
++noEmptyStrings;
}
}
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; i<nelem; ++i) {
if ( ((*(&((PVDataL)->tenmval.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; j<noStrings; ++j) {
cout << stig[j] << " [" <<j << "] ";
}
cout << endl;
}
}
}
ts = ((struct dbr_time_enum *) PVDataL)->stamp;
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<nelem; ++i) {