Compare commits
29 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e803240fbf | ||
|
|
54c07f705f | ||
|
|
fa23ddd370 | ||
|
|
41d56fdf89 | ||
|
|
a65fc3ef30 | ||
|
|
b69bc44974 | ||
|
|
a90f0173a7 | ||
|
|
83342beb7e | ||
|
|
f6e6cf037f | ||
|
|
80920ae0b0 | ||
|
|
1f7667b22d | ||
|
|
e15e84fb14 | ||
|
|
ba2e1c8a1d | ||
|
|
fb6873e9a3 | ||
|
|
2f4c0eea9d | ||
|
|
a2b635c2fe | ||
|
|
abd029aa71 | ||
|
|
57c6d07a93 | ||
|
|
91c5136883 | ||
|
|
5e151c3b7a | ||
|
|
fc4b51cb49 | ||
|
|
fc703958b3 | ||
|
|
1b156c92cd | ||
|
|
2c75f1d1e9 | ||
|
|
e03096c35e | ||
|
|
4b0970ffcb | ||
|
|
048d6ef737 | ||
|
|
4768444b8a | ||
|
|
0ce3613acc |
10
.ci/travis-build.sh
Executable file
10
.ci/travis-build.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
set -e -x
|
||||
|
||||
make -j2 $EXTRA
|
||||
|
||||
if [ "$TEST" != "NO" ]
|
||||
then
|
||||
make -j2 tapfiles
|
||||
make -j2 -s test-results
|
||||
fi
|
||||
107
.ci/travis-prepare.sh
Executable file
107
.ci/travis-prepare.sh
Executable file
@@ -0,0 +1,107 @@
|
||||
#!/bin/sh
|
||||
set -e -x
|
||||
|
||||
CURDIR="$PWD"
|
||||
|
||||
cat << EOF > $CURDIR/configure/RELEASE.local
|
||||
EPICS_BASE=$HOME/.source/epics-base
|
||||
EOF
|
||||
|
||||
install -d "$HOME/.source"
|
||||
cd "$HOME/.source"
|
||||
|
||||
add_gh_flat() {
|
||||
MODULE=$1
|
||||
REPOOWNER=$2
|
||||
REPONAME=$3
|
||||
BRANCH=$4
|
||||
MODULE_UC=$(echo $MODULE | tr 'a-z' 'A-Z')
|
||||
( git clone --quiet --depth 5 --branch $BRANCH https://github.com/$REPOOWNER/$REPONAME.git $MODULE && \
|
||||
cd $MODULE && git log -n1 )
|
||||
cat < $CURDIR/configure/RELEASE.local > $MODULE/configure/RELEASE.local
|
||||
cat << EOF >> $CURDIR/configure/RELEASE.local
|
||||
${MODULE_UC}=$HOME/.source/$MODULE
|
||||
EOF
|
||||
}
|
||||
|
||||
# not recursive
|
||||
git clone --quiet --depth 5 --branch "$BRBASE" https://github.com/${REPOBASE:-epics-base}/epics-base.git epics-base
|
||||
(cd epics-base && git log -n1 )
|
||||
add_gh_flat pvData ${REPOPVD:-epics-base} pvDataCPP ${BRPVD:-master}
|
||||
|
||||
if [ -e $CURDIR/configure/RELEASE.local ]
|
||||
then
|
||||
cat $CURDIR/configure/RELEASE.local
|
||||
fi
|
||||
|
||||
EPICS_HOST_ARCH=`sh epics-base/startup/EpicsHostArch`
|
||||
|
||||
# requires wine and g++-mingw-w64-i686
|
||||
if [ "$WINE" = "32" ]
|
||||
then
|
||||
echo "Cross mingw32"
|
||||
sed -i -e '/CMPLR_PREFIX/d' epics-base/configure/os/CONFIG_SITE.linux-x86.win32-x86-mingw
|
||||
cat << EOF >> epics-base/configure/os/CONFIG_SITE.linux-x86.win32-x86-mingw
|
||||
CMPLR_PREFIX=i686-w64-mingw32-
|
||||
EOF
|
||||
cat << EOF >> epics-base/configure/CONFIG_SITE
|
||||
CROSS_COMPILER_TARGET_ARCHS+=win32-x86-mingw
|
||||
EOF
|
||||
fi
|
||||
|
||||
if [ "$STATIC" = "YES" ]
|
||||
then
|
||||
echo "Build static libraries/executables"
|
||||
cat << EOF >> epics-base/configure/CONFIG_SITE
|
||||
SHARED_LIBRARIES=NO
|
||||
STATIC_BUILD=YES
|
||||
EOF
|
||||
fi
|
||||
|
||||
case "$CMPLR" in
|
||||
clang)
|
||||
echo "Host compiler is clang"
|
||||
cat << EOF >> epics-base/configure/os/CONFIG_SITE.Common.$EPICS_HOST_ARCH
|
||||
GNU = NO
|
||||
CMPLR_CLASS = clang
|
||||
CC = clang
|
||||
CCC = clang++
|
||||
EOF
|
||||
|
||||
# hack
|
||||
sed -i -e 's/CMPLR_CLASS = gcc/CMPLR_CLASS = clang/' epics-base/configure/CONFIG.gnuCommon
|
||||
|
||||
clang --version
|
||||
;;
|
||||
*)
|
||||
echo "Host compiler is default"
|
||||
gcc --version
|
||||
;;
|
||||
esac
|
||||
|
||||
cat <<EOF >> epics-base/configure/CONFIG_SITE
|
||||
USR_CPPFLAGS += $USR_CPPFLAGS
|
||||
USR_CFLAGS += $USR_CFLAGS
|
||||
USR_CXXFLAGS += $USR_CXXFLAGS
|
||||
EOF
|
||||
|
||||
# set RTEMS to eg. "4.9" or "4.10"
|
||||
# requires qemu, bison, flex, texinfo, install-info
|
||||
if [ -n "$RTEMS" ]
|
||||
then
|
||||
echo "Cross RTEMS${RTEMS} for pc386"
|
||||
curl -L "https://github.com/mdavidsaver/rsb/releases/download/20171203-${RTEMS}/i386-rtems${RTEMS}-trusty-20171203-${RTEMS}.tar.bz2" \
|
||||
| tar -C / -xmj
|
||||
|
||||
sed -i -e '/^RTEMS_VERSION/d' -e '/^RTEMS_BASE/d' epics-base/configure/os/CONFIG_SITE.Common.RTEMS
|
||||
cat << EOF >> epics-base/configure/os/CONFIG_SITE.Common.RTEMS
|
||||
RTEMS_VERSION=$RTEMS
|
||||
RTEMS_BASE=$HOME/.rtems
|
||||
EOF
|
||||
cat << EOF >> epics-base/configure/CONFIG_SITE
|
||||
CROSS_COMPILER_TARGET_ARCHS += RTEMS-pc386-qemu
|
||||
EOF
|
||||
fi
|
||||
|
||||
make -j2 -C epics-base $EXTRA
|
||||
make -j2 -C pvData $EXTRA
|
||||
23
.gitignore
vendored
23
.gitignore
vendored
@@ -1,9 +1,14 @@
|
||||
bin/
|
||||
include/
|
||||
lib/
|
||||
db/
|
||||
dbd/
|
||||
configure/*.local
|
||||
html/
|
||||
**/O.*
|
||||
**/**/O.*
|
||||
/cfg/
|
||||
/bin/
|
||||
/lib/
|
||||
/db/
|
||||
/dbd/
|
||||
/html/
|
||||
/include/
|
||||
/templates/
|
||||
/configure/*.local
|
||||
O.*/
|
||||
/QtC-*
|
||||
*.orig
|
||||
*.log
|
||||
.*.swp
|
||||
|
||||
31
.travis.yml
Normal file
31
.travis.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
sudo: false
|
||||
dist: trusty
|
||||
language: c++
|
||||
compiler:
|
||||
- gcc
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- libreadline6-dev
|
||||
- libncurses5-dev
|
||||
- perl
|
||||
- clang
|
||||
- g++-mingw-w64-i686
|
||||
- qemu-system-x86
|
||||
install:
|
||||
- ./.ci/travis-prepare.sh
|
||||
script:
|
||||
- ./.ci/travis-build.sh
|
||||
env:
|
||||
- BRBASE=7.0
|
||||
- BRBASE=7.0 CMPLR=clang
|
||||
- BRBASE=7.0 EXTRA="CMD_CXXFLAGS=-std=c++98"
|
||||
- BRBASE=7.0 EXTRA="CMD_CXXFLAGS=-std=c++11"
|
||||
- BRBASE=7.0 CMPLR=clang EXTRA="CMD_CXXFLAGS=-std=c++11"
|
||||
- BRBASE=7.0 WINE=32 TEST=NO STATIC=YES
|
||||
- BRBASE=7.0 WINE=32 TEST=NO STATIC=NO
|
||||
- BRBASE=7.0 RTEMS=4.10 TEST=NO
|
||||
- BRBASE=7.0 RTEMS=4.9 TEST=NO
|
||||
- BRBASE=3.16
|
||||
- BRBASE=3.15
|
||||
- BRBASE=3.14
|
||||
83
README.md
83
README.md
@@ -1,78 +1,17 @@
|
||||
normativeTypesCPP
|
||||
=================
|
||||
# normativeTypesCPP
|
||||
|
||||
normativeTypesCPP is a C++ module containing helper classes which implement
|
||||
and provide support for the EPICS V4 Normative Types.
|
||||
The EPICS **Normative Types** are a set of standard high-level data types, designed to aid interoperability between EPICS PVA applications.
|
||||
|
||||
The latter are a set of standard high-level data types to aid interoperability
|
||||
of EPICS V4 applications and are specified in the
|
||||
[NormativeTypes Specification](http://epics-pvdata.sourceforge.net/alpha/normativeTypes/normativeTypes.html).
|
||||
This normativeTypesCPP module is a part of the EPICS software toolkit that provides C++ helper classes which implement the EPICS Normative Types.
|
||||
|
||||
## Links
|
||||
|
||||
Status
|
||||
------
|
||||
- General information about EPICS can be found at the
|
||||
[EPICS Controls website](https://epics-controls.org).
|
||||
- API documentation for this module can be found in its
|
||||
documentation directory, in particular the file
|
||||
normativeTypesCPP.html
|
||||
|
||||
The current release (5.0) implements fully the
|
||||
[16 Mar 2015 version](http://epics-pvdata.sourceforge.net/alpha/normativeTypes/normativeTypes_20150316.html)
|
||||
of the Normative Types Specification.
|
||||
|
||||
The module status is alpha and the API and behaviour may change in future
|
||||
versions.
|
||||
|
||||
The previous release (4.0) supported only 6 types.
|
||||
There is no documentation yet for the new types added in 5.0.
|
||||
|
||||
|
||||
Further Info
|
||||
------------
|
||||
|
||||
Consult the documents in the documentation directory, in particular
|
||||
|
||||
* normativeTypesCPP.html
|
||||
* RELEASE_NOTES.md
|
||||
|
||||
Also see the [EPICS Version 4 website](http://epics-pvdata.sourceforge.net)
|
||||
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
|
||||
normativeTypesCPP requires recent versions of the following software:
|
||||
|
||||
1. EPICS Base (v3.14.12.3 or later)
|
||||
2. EPICS4 pvCommonCPP (4.1.0 or later)
|
||||
2. pvDataCPP (5.0.0 or later)
|
||||
|
||||
(pvCommonCPP may not be needed depending on host/compiler.)
|
||||
|
||||
|
||||
Building
|
||||
--------
|
||||
|
||||
Building uses the make utility and the EPICS base build system.
|
||||
|
||||
The build system needs the location of the prerequisites, e.g. by placing the
|
||||
lines of the form
|
||||
|
||||
PVDATA = /home/install/epicsV4/pvDataCPP
|
||||
PVCOMMON = /home/install/epicsV4/pvCommonCPP
|
||||
EPICS_BASE = /home/install/epics/base
|
||||
|
||||
pointing to the locations in a file called RELEASE.local
|
||||
in the configure directory or the parent directory of normativeTypesCPP.
|
||||
|
||||
With this in place, to build type make
|
||||
|
||||
make
|
||||
|
||||
To perform a clean build type
|
||||
|
||||
make clean uninstall
|
||||
|
||||
To run the unit tests type
|
||||
|
||||
make runtests
|
||||
|
||||
For more information on the EPICS build system consult the
|
||||
[Application Development guide](http://www.aps.anl.gov/epics/base/R3-14/12-docs/AppDevGuide.pdf).
|
||||
## Building
|
||||
|
||||
This module is included as a submodule of a full EPICS 7 release and will be compiled during builds of that software.
|
||||
|
||||
@@ -1,32 +1,40 @@
|
||||
#RELEASE Location of external products
|
||||
# RELEASE - Location of external support modules
|
||||
#
|
||||
# IF YOU MAKE ANY CHANGES to this file you MUST at least run
|
||||
# "gnumake" in this directory afterwards; you usually need
|
||||
# to run "gnumake rebuild" in the application's top level
|
||||
# directory each time this file is changed.
|
||||
# IF YOU CHANGE ANY PATHS in this file or make API changes to
|
||||
# any modules it refers to, you should do a "make rebuild" in
|
||||
# this application's top level directory.
|
||||
#
|
||||
# NOTE: The build does not check dependencies against files
|
||||
# that are outside this application, thus you should run
|
||||
# "gnumake distclean install" in the top directory each time
|
||||
# EPICS_BASE, SNCSEQ, or any other external module defined
|
||||
# in the RELEASE file is rebuilt.
|
||||
# The EPICS build process does not check dependencies against
|
||||
# any files from outside the application, so it is safest to
|
||||
# rebuild it completely if any modules it depends on change.
|
||||
#
|
||||
# Host/target specific settings can be specified in files named
|
||||
# Host- or target-specific settings can be given in files named
|
||||
# RELEASE.$(EPICS_HOST_ARCH).Common
|
||||
# RELEASE.Common.$(T_A)
|
||||
# RELEASE.$(EPICS_HOST_ARCH).$(T_A)
|
||||
#
|
||||
# This file is parsed by both GNUmake and an EPICS Perl script,
|
||||
# so it may ONLY contain definititions of paths to other support
|
||||
# modules, variable definitions that are used in module paths,
|
||||
# and include statements that pull in other RELEASE files.
|
||||
# Variables may be used before their values have been set.
|
||||
# Build variables that are NOT used in paths should be set in
|
||||
# the CONFIG_SITE file.
|
||||
|
||||
TEMPLATE_TOP=$(EPICS_BASE)/templates/makeBaseApp/top
|
||||
# Variables and paths to dependent modules:
|
||||
#MODULES = /path/to/modules
|
||||
#MYMODULE = $(MODULES)/my-module
|
||||
|
||||
#If using the sequencer, point SNCSEQ at its top directory:
|
||||
#SNCSEQ=$(EPICS_BASE)/../modules/soft/seq
|
||||
# If building the EPICS modules individually, set these:
|
||||
#EPICS_PVDATA = $(MODULES)/pvData-7.0.0
|
||||
#EPICS_LIBCOM = $(MODULES)/libcom-3.17.0
|
||||
#EPICS_BASE = $(MODULES)/core-7.0.1
|
||||
|
||||
# EPICS_BASE usually appears last so other apps can override stuff:
|
||||
#EPICS_BASE=/opt/epics/base
|
||||
|
||||
#Capfast users may need the following definitions
|
||||
#CAPFAST_TEMPLATES=
|
||||
#SCH2EDIF_PATH=
|
||||
# Set RULES here if you want to use build rules from elsewhere:
|
||||
#RULES = $(MODULES)/build-rules
|
||||
|
||||
# These allow developers to override the RELEASE variable settings
|
||||
# without having to modify the configure/RELEASE file itself.
|
||||
-include $(TOP)/../RELEASE.local
|
||||
-include $(TOP)/../RELEASE.$(EPICS_HOST_ARCH).local
|
||||
-include $(TOP)/configure/RELEASE.local
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
<h1>Release 5.0</h1>
|
||||
|
||||
<p>This release adds support through wrapper classes and builders for the
|
||||
remaining Normative Types:</p>
|
||||
|
||||
<ul>
|
||||
<li>NTEnum</li>
|
||||
<li>NTMatrix</li>
|
||||
<li>NTURI</li>
|
||||
<li>NTAttribute</li>
|
||||
<li>NTContinuum</li>
|
||||
<li>NTHistogram</li>
|
||||
<li>NTAggregate</li>
|
||||
<li>NTUnion</li>
|
||||
<li>NTScalarMultiChannel</li>
|
||||
</ul>
|
||||
|
||||
<p>Release 5.0 therefore implements fully the
|
||||
<a href="http://epics-pvdata.sourceforge.net/alpha/normativeTypes/normativeTypes_20150316.html">16 Mar 2015 version</a>
|
||||
of the normativeTypes specification.</p>
|
||||
|
||||
<p>Each wrapper class has an extended API:</p>
|
||||
|
||||
<ul>
|
||||
<li>is_a now has a convenience overload taking a PVStructure.</li>
|
||||
<li>isCompatible, reporting introspection type compatibility, now has an overload
|
||||
taking a Structure. The PVStructure version is retained as a convenience
|
||||
method and for backwards compatibility.</li>
|
||||
<li>An isValid function now reports validity of a compatible PVStructure's data
|
||||
with respect to the specification.</li>
|
||||
</ul>
|
||||
|
||||
<p>Other changes are:</p>
|
||||
|
||||
<ul>
|
||||
<li>Support for NTAttributes extended as required by NTNDArray
|
||||
(NTNDArrayAttributes).</li>
|
||||
<li>A new class for parsing NT IDs (NTID).</li>
|
||||
<li>Resolution of the confusion between column names and labels in NTTable and
|
||||
improved API. Function for adding columns is now addColumn rather than add.
|
||||
New getColumnNames function provided.</li>
|
||||
<li>isConnected is treated as an optional rather than a required field in
|
||||
NTMultiChannelArray. isConnected() and addIsConnected() functions added to
|
||||
wrapper and builder respectively.</li>
|
||||
<li>Unit tests for all new classes.</li>
|
||||
</ul>
|
||||
|
||||
<h1>Release 4.0</h1>
|
||||
|
||||
<p>This is the first release of normativeTypesCPP that is part of an official
|
||||
EPICS V4 release.
|
||||
It is a major rewrite of the previous versions of normativeTypesCPP.</p>
|
||||
|
||||
<p>This release provides support through wrapper classes and builders for the
|
||||
following Normative Types:</p>
|
||||
|
||||
<ul>
|
||||
<li>NTScalar</li>
|
||||
<li>NTScalarArray</li>
|
||||
<li>NTNameValue</li>
|
||||
<li>NTTable</li>
|
||||
<li>NTMultiChannel</li>
|
||||
<li>NTNDArray</li>
|
||||
</ul>
|
||||
|
||||
<p>Each type has a wrapper class of the same name which has functions for checking
|
||||
compatibility of existing PVStructures (isCompatible) and the reported types of
|
||||
Structures (is_a), wraps existing PVStructures (wrap, wrapUnsafe) and provides
|
||||
a convenient interface to all required and optional fields.</p>
|
||||
|
||||
<p>Each type has a builder which can create a Structure, a PVStructure or a
|
||||
wrapper around a new PVStructure. In each case optional or extra fields can be
|
||||
added and options such as choice of scalar type can be made.</p>
|
||||
|
||||
<p>Additional features are:</p>
|
||||
|
||||
<ul>
|
||||
<li>Utility classes NTField and NTPVField for standard structure fields and
|
||||
NTUtils for type IDs.</li>
|
||||
<li>Unit tests for the implemented classes.</li>
|
||||
</ul>
|
||||
@@ -1,5 +1,63 @@
|
||||
Release 5.0
|
||||
===========
|
||||
# normativeTypes Module
|
||||
|
||||
This document summarizes the changes to the module between releases.
|
||||
|
||||
## Release 5.2.2
|
||||
|
||||
- Fix NTTable::getColumnNames().
|
||||
|
||||
## Release 5.2.1 (EPICS 7.0.2, Dec 2018)
|
||||
|
||||
* No functional changes.
|
||||
* Removal of declaration for unimplemented PVNTField::createAlarmLimit() and elimination of unused variables.
|
||||
|
||||
|
||||
## Release 5.2.0 (EPICS 7.0.1, Dec 2017)
|
||||
|
||||
This release contains bug fixes and minor source updates needed to
|
||||
build against the latest version of pvData.
|
||||
|
||||
|
||||
## Release 5.1.2 (EPICS V4.6, Aug 2016)
|
||||
|
||||
The main changes since release 5.1.1 are:
|
||||
|
||||
* NTUnionBuilder: Add missing value() function
|
||||
* Updated document: Now document all Normative Types
|
||||
|
||||
|
||||
## Release 5.1.1
|
||||
|
||||
The main changes since release 5.0 are:
|
||||
|
||||
* Linux shared library version added
|
||||
* Headers and source locations have changed
|
||||
* Missing is_a implementations added
|
||||
* NTAttribute::addTags() is now non-virtual
|
||||
* New license file replaces LICENSE and COPYRIGHT
|
||||
|
||||
### Shared library version added
|
||||
|
||||
Linux shared library version numbers have been added by setting SHRLIB_VERSION
|
||||
(to 5.1 in this case). So shared object will be libnt.so.5.1 instead of
|
||||
libpvData.so.
|
||||
|
||||
### Headers and source locations have changed
|
||||
|
||||
Source has moved out of nt directory directly into src.
|
||||
|
||||
Headers have been moved into a pv directory. This facilitates using some IDEs
|
||||
such as Qt Creator.
|
||||
|
||||
src/nt/ntscalar.cpp -> src/ntscalar.cpp
|
||||
src/nt/ntscalar.h -> src/pv/ntscalar.h
|
||||
|
||||
### Missing is_a implementations added
|
||||
|
||||
is_a(PVStructurePtr const &) implementation has been added for each type.
|
||||
|
||||
|
||||
## Release 5.0 (EPICS V4.5, Oct 2015)
|
||||
|
||||
This release adds support through wrapper classes and builders for the
|
||||
remaining Normative Types:
|
||||
@@ -40,8 +98,7 @@ Other changes are:
|
||||
wrapper and builder respectively.
|
||||
* Unit tests for all new classes.
|
||||
|
||||
Release 4.0
|
||||
===========
|
||||
## Release 4.0 (EPICS V4.4, Dec 2014)
|
||||
|
||||
This is the first release of normativeTypesCPP that is part of an official
|
||||
EPICS V4 release.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -21,23 +21,15 @@ installE4 () {
|
||||
local module=$1
|
||||
local branch=$2
|
||||
|
||||
# If microbench version does not exist, try without
|
||||
if [ "${MB}" = "WITH_MICROBENCH" ]; then
|
||||
if ! wget -nv https://openepics.ci.cloudbees.com/job/e4-cpp-${module}-${branch}-build/BASE=${BASE},MB=WITH_MICROBENCH/lastSuccessfulBuild/artifact/${module}.CB-dist.tar.gz; then
|
||||
wget -nv https://openepics.ci.cloudbees.com/job/e4-cpp-${module}-${branch}-build/BASE=${BASE},MB=NO_MICROBENCH/lastSuccessfulBuild/artifact/${module}.CB-dist.tar.gz
|
||||
fi
|
||||
else
|
||||
wget -nv https://openepics.ci.cloudbees.com/job/e4-cpp-${module}-${branch}-build/BASE=${BASE},MB=NO_MICROBENCH/lastSuccessfulBuild/artifact/${module}.CB-dist.tar.gz
|
||||
fi
|
||||
wget -nv https://openepics.ci.cloudbees.com/job/e4-cpp-${module}-${branch}-build/BASE=${BASE}/lastSuccessfulBuild/artifact/${module}.CB-dist.tar.gz
|
||||
tar -xzf ${module}.CB-dist.tar.gz
|
||||
}
|
||||
|
||||
###########################################
|
||||
# Defaults for EPICS Base and MB
|
||||
# Defaults for EPICS Base
|
||||
|
||||
DEFAULT_BASE=3.15.4
|
||||
BASE=${BASE:-${DEFAULT_BASE}}
|
||||
MB=${MB:-"NO_MICROBENCH"}
|
||||
|
||||
###########################################
|
||||
# Dependent module branches
|
||||
@@ -80,6 +72,6 @@ make distclean all
|
||||
make runtests
|
||||
|
||||
###########################################
|
||||
# Create distribution
|
||||
# Create cache
|
||||
|
||||
tar --exclude=test* -czf normativeTypes.CB-dist.tar.gz lib include
|
||||
|
||||
@@ -21,14 +21,7 @@ installE4 () {
|
||||
local module=$1
|
||||
local branch=$2
|
||||
|
||||
# If microbench version does not exist, try without
|
||||
if [ "${MB}" = "WITH_MICROBENCH" ]; then
|
||||
if wget -nv https://openepics.ci.cloudbees.com/job/e4-cpp-${module}-${branch}-build/BASE=${BASE},MB=WITH_MICROBENCH/lastSuccessfulBuild/artifact/${module}.CB-dist.tar.gz; then
|
||||
wget -nv https://openepics.ci.cloudbees.com/job/e4-cpp-${module}-${branch}-build/BASE=${BASE},MB=NO_MICROBENCH/lastSuccessfulBuild/artifact/${module}.CB-dist.tar.gz
|
||||
fi
|
||||
else
|
||||
wget -nv https://openepics.ci.cloudbees.com/job/e4-cpp-${module}-${branch}-build/BASE=${BASE},MB=NO_MICROBENCH/lastSuccessfulBuild/artifact/${module}.CB-dist.tar.gz
|
||||
fi
|
||||
wget -nv https://openepics.ci.cloudbees.com/job/e4-cpp-${module}-${branch}-build/BASE=${BASE}/lastSuccessfulBuild/artifact/${module}.CB-dist.tar.gz
|
||||
tar -xzf ${module}.CB-dist.tar.gz
|
||||
}
|
||||
|
||||
@@ -38,7 +31,6 @@ installE4 () {
|
||||
BASE=3.15.4
|
||||
PUBLISH=${PUBLISH:-NO}
|
||||
BRANCH=${BRANCH:-master}
|
||||
MB=NO_MICROBENCH
|
||||
|
||||
###########################################
|
||||
# Fetch and unpack dependencies
|
||||
|
||||
@@ -47,7 +47,7 @@ LIBRARY = nt
|
||||
nt_LIBS += pvData Com
|
||||
|
||||
# shared library ABI version.
|
||||
SHRLIB_VERSION ?= 5.1
|
||||
SHRLIB_VERSION ?= 5.2.2
|
||||
|
||||
include $(TOP)/configure/RULES
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include <pv/lock.h>
|
||||
|
||||
#define epicsExportSharedSymbols
|
||||
#include <pv/ntndarray.h>
|
||||
#include <pv/ntndarrayAttribute.h>
|
||||
@@ -350,10 +352,10 @@ bool NTNDArray::isCompatible(StructureConstPtr const &structure)
|
||||
|
||||
|
||||
StructureArrayConstPtr attributeField = structure->getField<StructureArray>( "attribute");
|
||||
if (!attributeField)
|
||||
return false;
|
||||
|
||||
StructureConstPtr attributeElementStruc = attributeField->getStructure();
|
||||
|
||||
if (!NTNDArrayAttribute::isCompatible(attributeElementStruc))
|
||||
if (!NTNDArrayAttribute::isCompatible(attributeField->getStructure()))
|
||||
return false;
|
||||
|
||||
|
||||
@@ -361,7 +363,7 @@ bool NTNDArray::isCompatible(StructureConstPtr const &structure)
|
||||
if (field.get())
|
||||
{
|
||||
ScalarConstPtr descriptorField = structure->getField<Scalar>("descriptor");
|
||||
if (!descriptorField.get() || descriptorField->getScalarType() != pvString)
|
||||
if (!descriptorField || descriptorField->getScalarType() != pvString)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -93,6 +93,7 @@ NTNDArrayAttributeBuilder::NTNDArrayAttributeBuilder()
|
||||
|
||||
void NTNDArrayAttributeBuilder::reset()
|
||||
{
|
||||
tags = false;
|
||||
descriptor = false;
|
||||
alarm = false;
|
||||
timeStamp = false;
|
||||
|
||||
@@ -270,7 +270,7 @@ PVStringArrayPtr NTTable::getLabels() const
|
||||
|
||||
StringArray const & NTTable::getColumnNames() const
|
||||
{
|
||||
return pvNTTable->getStructure()->getFieldNames();
|
||||
return pvValue->getStructure()->getFieldNames();
|
||||
}
|
||||
|
||||
PVFieldPtr NTTable::getColumn(std::string const & columnName) const
|
||||
|
||||
@@ -18,6 +18,12 @@ static NTFieldPtr ntField = NTField::get();
|
||||
namespace detail {
|
||||
|
||||
|
||||
NTUnionBuilder::shared_pointer NTUnionBuilder::value(UnionConstPtr unionType)
|
||||
{
|
||||
valueType = unionType;
|
||||
return shared_from_this();
|
||||
}
|
||||
|
||||
StructureConstPtr NTUnionBuilder::createStructure()
|
||||
{
|
||||
FieldBuilderPtr builder =
|
||||
|
||||
@@ -93,7 +93,6 @@ namespace detail {
|
||||
|
||||
void reset();
|
||||
|
||||
bool dim;
|
||||
bool descriptor;
|
||||
bool alarm;
|
||||
bool timeStamp;
|
||||
|
||||
@@ -197,12 +197,6 @@ public:
|
||||
*/
|
||||
epics::pvData::PVStructurePtr createDisplay();
|
||||
|
||||
/**
|
||||
* Creates an alarmLimit PVStructure.
|
||||
* @return an alarmLimit PVStructure.
|
||||
*/
|
||||
epics::pvData::PVStructurePtr createAlarmLimit();
|
||||
|
||||
/**
|
||||
* Creates a control PVStructure.
|
||||
* @return a control PVStructure.
|
||||
|
||||
@@ -103,7 +103,6 @@ namespace detail {
|
||||
bool valueTypeSet;
|
||||
epics::pvData::ScalarType valueType;
|
||||
|
||||
bool dim;
|
||||
bool descriptor;
|
||||
bool alarm;
|
||||
bool timeStamp;
|
||||
|
||||
@@ -40,6 +40,14 @@ namespace detail {
|
||||
public:
|
||||
POINTER_DEFINITIONS(NTUnionBuilder);
|
||||
|
||||
/**
|
||||
* Specifies the union for the value field.
|
||||
* If this is not called then a variant union is the default.
|
||||
* @param unionType the introspection object for the union value field
|
||||
* @return this instance of NTUnionBuilder
|
||||
*/
|
||||
shared_pointer value(epics::pvData::UnionConstPtr unionType);
|
||||
|
||||
/**
|
||||
* Adds descriptor field to the NTUnion.
|
||||
* @return this instance of <b>NTUnionBuilder</b>.
|
||||
|
||||
@@ -47,7 +47,6 @@ void test_builder()
|
||||
testOk(valueField.get() != 0, "value is enum");
|
||||
|
||||
std::cout << *structure << std::endl;
|
||||
|
||||
}
|
||||
|
||||
void test_ntunion()
|
||||
@@ -158,11 +157,43 @@ void test_wrap()
|
||||
testOk(ptr.get() != 0, "wrapUnsafe OK");
|
||||
}
|
||||
|
||||
|
||||
void test_variant_union()
|
||||
{
|
||||
StructureConstPtr structure = NTUnion::createBuilder()->
|
||||
addDescriptor()->
|
||||
addAlarm()->
|
||||
addTimeStamp()->
|
||||
createStructure();
|
||||
testOk1(structure->getField<Union>("value")->isVariant());
|
||||
}
|
||||
|
||||
void test_regular_union()
|
||||
{
|
||||
UnionConstPtr u = getFieldCreate()->createFieldBuilder()->
|
||||
add("x", pvDouble)->
|
||||
add("i", pvInt)->
|
||||
createUnion();
|
||||
|
||||
StructureConstPtr structure = NTUnion::createBuilder()->
|
||||
value(u)->
|
||||
addDescriptor()->
|
||||
addAlarm()->
|
||||
addTimeStamp()->
|
||||
createStructure();
|
||||
testOk1(!structure->getField<Union>("value")->isVariant());
|
||||
testOk1(structure->getField<Union>("value") == u);
|
||||
}
|
||||
|
||||
|
||||
|
||||
MAIN(testNTUnion) {
|
||||
testPlan(29);
|
||||
testPlan(32);
|
||||
test_builder();
|
||||
test_ntunion();
|
||||
test_wrap();
|
||||
test_variant_union();
|
||||
test_regular_union();
|
||||
return testDone();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user