testing getUnits for cython

This commit is contained in:
2021-08-11 15:34:25 +02:00
parent cecf4a3f11
commit cc804d2e7b
6 changed files with 56 additions and 44 deletions

View File

@@ -1077,6 +1077,8 @@ int HandleHelper::getUnits(unsigned int _handle, std::string & units)
if (it_handle != handle_index.end())
{
units = (*it_handle).getUnits();
//cout << __FILE__ << "//" << __LINE__ << "//" << __METHOD__ << endl;
//cout << "units" << units << endl;
}
else
{
@@ -2375,10 +2377,11 @@ bool HandleHelper::hasAlarmStatusSeverity(unsigned int _handle)
//Only these have alarm/severity
std::vector<std::string>alarmSeverityRecordTypes;
alarmSeverityRecordTypes.reserve(10);
alarmSeverityRecordTypes.reserve(12);
alarmSeverityRecordTypes.push_back( std::string ( "ai"));
alarmSeverityRecordTypes.push_back( std::string ( "ao"));
alarmSeverityRecordTypes.push_back( std::string ( "calc"));
alarmSeverityRecordTypes.push_back( std::string ( "calcout"));
alarmSeverityRecordTypes.push_back( std::string ( "dfanout"));
alarmSeverityRecordTypes.push_back( std::string ( "longin"));
alarmSeverityRecordTypes.push_back( std::string ( "longout"));
@@ -2388,6 +2391,8 @@ bool HandleHelper::hasAlarmStatusSeverity(unsigned int _handle)
alarmSeverityRecordTypes.push_back( std::string ( "steppermotor"));
alarmSeverityRecordTypes.push_back( std::string ( "sub"));
//else use RTYP to get true type
alarmSeverityRecordTypes.push_back( std::string ( "Not Supported by Gateway"));
if (it_handle != handle_index.end())
{
@@ -2442,8 +2447,8 @@ bool HandleHelper::hasAlarmStatusSeverity(unsigned int _handle)
// if never connected getStatus is 600 ICAFE_CS_NEVER_CONN
// std::cout << (*it_handle).getPV() << " is Connected " << (*it_handle).isConnected() << std::endl;
// std::cout << "getStatus " << (*it_handle).getStatus() << std::endl;
//std::cout << (*it_handle).getPV() << " is Connected " << (*it_handle).isConnected() << std::endl;
//std::cout << "getStatus " << (*it_handle).getStatus() << std::endl;
// Check if handle has already been supplemented
if ((*it_handle).hasAlarmSeverityStruct())
@@ -2458,6 +2463,7 @@ bool HandleHelper::hasAlarmStatusSeverity(unsigned int _handle)
return false;
}
//std::cout << "------ " << std::endl;
PVCtrlHolder _pvc;
@@ -2479,8 +2485,7 @@ bool HandleHelper::hasAlarmStatusSeverity(unsigned int _handle)
}
// if Never connected getStatus is 600 ICAFE_CS_NEVER_CONN
// std::cout << "status from getPVCtrlHolder // " << _stat << std::endl;
// std::cout << "status from getPVCtrlHolder // " << _pvc.getStatus() << std::endl;
//_pvc.print();
//return to previous
@@ -2490,8 +2495,6 @@ bool HandleHelper::hasAlarmStatusSeverity(unsigned int _handle)
}
if (_stat==ICAFE_NORMAL)
{
//Special test for ENUM value - should never reach here as is mbbi/o record
@@ -2501,32 +2504,34 @@ bool HandleHelper::hasAlarmStatusSeverity(unsigned int _handle)
//}
//enums can have alarms states!!!
if (!((boost::math::isnan)(_pvc.getLowerAlarmLimit_AsDouble())))
{
if (_pvc.getLowerAlarmLimit_AsDouble() != 0) {
return true;
}
}
else if (!((boost::math::isnan)(_pvc.getLowerWarningLimit_AsDouble())))
if (!((boost::math::isnan)(_pvc.getLowerWarningLimit_AsDouble())))
{
if (_pvc.getLowerWarningLimit_AsDouble() != 0) {
return true;
}
}
else if (!((boost::math::isnan)(_pvc.getUpperWarningLimit_AsDouble())))
if (!((boost::math::isnan)(_pvc.getUpperWarningLimit_AsDouble())))
{
if (_pvc.getUpperWarningLimit_AsDouble() != 0) {
return true;
}
}
else if (!((boost::math::isnan)(_pvc.getUpperAlarmLimit_AsDouble())))
if (!((boost::math::isnan)(_pvc.getUpperAlarmLimit_AsDouble())))
{
if (_pvc.getUpperAlarmLimit_AsDouble() != 0) {
return true;
}
}
return false;
}
else

View File

@@ -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/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-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_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
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
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/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-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
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
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
LIBOBJS =
LIBS = -lQt5Xml -lQt5Core
LIBS = -lQt5Xml -lQt5Core -lpython3.7m
LIBTOOL = $(SHELL) $(top_builddir)/libtool
LIPO =
LN_S = ln -s
@@ -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-gcc-7.3.0/lib/RHEL7-x86_64
libdir = /opt/gfa/cafe/cpp/cafe-1.14.2-sls2-py37-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-gcc-7.3.0
prefix = /opt/gfa/cafe/cpp/cafe-1.14.2-sls2-py37-gcc-7.3.0
program_transform_name = s,x,x,
psdir = ${docdir}
sbindir = ${exec_prefix}/sbin