-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from mrkraimer/master
Changes because of enhancements to pvDatabaseCPP and pvaClientCPP
- Loading branch information
Showing
39 changed files
with
1,601 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/* | ||
* Copyright information and license terms for this software can be | ||
* found in the file LICENSE that is included with the distribution | ||
*/ | ||
|
||
/** | ||
* @author mrk | ||
*/ | ||
|
||
/* Author: Marty Kraimer */ | ||
|
||
#include <iostream> | ||
|
||
#include <pv/pvaClientMultiChannel.h> | ||
#include <pv/convert.h> | ||
|
||
using std::tr1::static_pointer_cast; | ||
using namespace std; | ||
using namespace epics::pvData; | ||
using namespace epics::pvAccess; | ||
using namespace epics::pvaClient; | ||
|
||
|
||
static void example( | ||
PvaClientPtr const &pva, | ||
string provider, | ||
shared_vector<const string> const &channelNames) | ||
{ | ||
cout << "_example provider " << provider << " channels " << channelNames << "_\n"; | ||
size_t num = channelNames.size(); | ||
PvaClientMultiChannelPtr multiChannel( | ||
PvaClientMultiChannel::create(pva,channelNames,provider)); | ||
Status status = multiChannel->connect(); | ||
if(!status.isSuccess()) { | ||
cout << "Did not connect: "; | ||
shared_vector<epics::pvData::boolean> isConnected = multiChannel->getIsConnected(); | ||
for(size_t i=0; i<num; ++i) { | ||
if(!isConnected[i]) cout << channelNames[i] << " "; | ||
} | ||
cout << endl; | ||
return; | ||
} | ||
PvaClientNTMultiGetPtr multiGet(multiChannel->createNTGet()); | ||
multiGet->get(); | ||
PvaClientNTMultiDataPtr multiData = multiGet->getData(); | ||
PVStructurePtr pvStructure = multiData->getNTMultiChannel()->getPVStructure(); | ||
PVUnionArrayPtr pvUnionArray = static_pointer_cast<PVUnionArray>(pvStructure->getSubField("value")); | ||
shared_vector<const PVUnionPtr> values = pvUnionArray->view(); | ||
for(size_t ind=0; ind < values.size(); ++ind) | ||
{ | ||
PVUnionPtr pvUnion = values[ind]; | ||
PVFieldPtr pvField = pvUnion->get(); | ||
cout << channelNames[ind] << " = " << pvField << "\n"; | ||
} | ||
} | ||
|
||
int main(int argc,char *argv[]) | ||
{ | ||
cout << "_____examplePvaClientNTMultiGet starting_______\n"; | ||
try { | ||
PvaClientPtr pva = PvaClient::get("pva ca"); | ||
size_t num = 4; | ||
shared_vector<string> channelNames(num); | ||
channelNames[0] = "PVRdouble"; | ||
channelNames[1] = "PVRstring"; | ||
channelNames[2] = "PVRdoubleArray"; | ||
channelNames[3] = "PVRstringArray"; | ||
shared_vector<const string> names(freeze(channelNames)); | ||
example(pva,"pva",names); | ||
cout << "_____examplePvaClientNTMultiGet done_______\n"; | ||
} catch (std::exception& e) { | ||
cout << "exception " << e.what() << endl; | ||
return 1; | ||
} | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Makefile at top of application tree | ||
|
||
TOP = . | ||
include $(TOP)/configure/CONFIG | ||
|
||
DIRS += configure | ||
|
||
DIRS += src | ||
src_DEPEND_DIRS = configure | ||
|
||
include $(TOP)/configure/RULES_TOP | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# CONFIG - Load build configuration data | ||
# | ||
# Do not make changes to this file! | ||
|
||
# Allow user to override where the build rules come from | ||
RULES = $(EPICS_BASE) | ||
|
||
# RELEASE files point to other application tops | ||
include $(TOP)/configure/RELEASE | ||
-include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).Common | ||
ifdef T_A | ||
-include $(TOP)/configure/RELEASE.Common.$(T_A) | ||
-include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).$(T_A) | ||
endif | ||
|
||
CONFIG = $(RULES)/configure | ||
include $(CONFIG)/CONFIG | ||
|
||
# Override the Base definition: | ||
INSTALL_LOCATION = $(TOP) | ||
|
||
# CONFIG_SITE files contain other build configuration settings | ||
include $(TOP)/configure/CONFIG_SITE | ||
-include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).Common | ||
ifdef T_A | ||
-include $(TOP)/configure/CONFIG_SITE.Common.$(T_A) | ||
-include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A) | ||
endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# CONFIG_SITE | ||
|
||
# Make any application-specific changes to the EPICS build | ||
# configuration variables in this file. | ||
# | ||
# Host/target specific settings can be specified in files named | ||
# CONFIG_SITE.$(EPICS_HOST_ARCH).Common | ||
# CONFIG_SITE.Common.$(T_A) | ||
# CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A) | ||
|
||
# CHECK_RELEASE controls the consistency checking of the support | ||
# applications pointed to by the RELEASE* files. | ||
# Normally CHECK_RELEASE should be set to YES. | ||
# Set CHECK_RELEASE to NO to disable checking completely. | ||
# Set CHECK_RELEASE to WARN to perform consistency checking but | ||
# continue building anyway if conflicts are found. | ||
CHECK_RELEASE = YES | ||
|
||
# Set this when you only want to compile this application | ||
# for a subset of the cross-compiled target architectures | ||
# that Base is built for. | ||
#CROSS_COMPILER_TARGET_ARCHS = | ||
|
||
# To install files into a location other than $(TOP) define | ||
# INSTALL_LOCATION here. | ||
#INSTALL_LOCATION=</path/name/to/install/top> | ||
|
||
# Set this when your IOC and the host use different paths | ||
# to access the application. This will be needed to boot | ||
# from a Microsoft FTP server or with some NFS mounts. | ||
# You must rebuild in the iocBoot directory for this to | ||
# take effect. | ||
#IOCS_APPL_TOP = </IOC/path/to/application/top> | ||
|
||
-include $(TOP)/../../CONFIG_SITE.local | ||
-include $(TOP)/../CONFIG_SITE.local | ||
-include $(TOP)/configure/CONFIG_SITE.local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
TOP=.. | ||
|
||
include $(TOP)/configure/CONFIG | ||
|
||
TARGETS = $(CONFIG_TARGETS) | ||
CONFIGS += $(subst ../,,$(wildcard $(CONFIG_INSTALLS))) | ||
|
||
include $(TOP)/configure/RULES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# RELEASE - Location of external support modules | ||
# | ||
# IF YOU CHANGE this file or any file it includes you must | ||
# do a "gnumake rebuild" in the application's top level directory. | ||
# | ||
# The build process does not check dependencies against files | ||
# that are outside this application, thus you should also do a | ||
# "gnumake rebuild" in the top level directory after EPICS_BASE | ||
# or any other external module pointed to below is rebuilt. | ||
# | ||
# 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) | ||
|
||
# EPICS V4 Developers: Do not edit the locations in this file! | ||
# | ||
# To create a file RELEASE.local in this directory | ||
# copy ExampleRELEASE.local to RELEASE.local | ||
# edit RELEASE.local | ||
# rebuild | ||
|
||
-include $(TOP)/../../RELEASE.local | ||
-include $(TOP)/../configure/RELEASE.local | ||
-include $(TOP)/configure/RELEASE.local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# RULES | ||
|
||
include $(CONFIG)/RULES | ||
|
||
# Library should be rebuilt because LIBOBJS may have changed. | ||
$(LIBNAME): ../Makefile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#RULES.ioc | ||
include $(CONFIG)/RULES.ioc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#RULES_DIRS | ||
include $(CONFIG)/RULES_DIRS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#RULES_TOP | ||
include $(CONFIG)/RULES_TOP | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# exampleCPP/testClient/scripts | ||
|
||
This contains tests for pvaClient methods: | ||
**getDouble**, **putDouble**, **getString**, **putString**, | ||
**getDoubleArray**, **putDoubleArray**, **getStringArray**, and **putStringArray**. | ||
|
||
Before the test can be run the following database must be started: | ||
|
||
mrk> pwd | ||
/home/epicsv4/masterCPP/exampleCPP/database/iocBoot/exampleDatabase | ||
mrk> ../../bin/linux-x86_64/exampleDatabase st.cmd | ||
|
||
To run the tests do the following in this directory: | ||
|
||
./testAll &> temp | ||
diff temp testSuccess | ||
rm temp | ||
|
||
You should not see any differences. | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
export TESTCLIENT=../bin/linux-x86_64/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
source ./setEnv | ||
echo ___testPutDouble___ | ||
./testPutDouble | ||
echo ___testGetDouble___ | ||
./testGetDouble | ||
echo ___testPutString___ | ||
./testPutString | ||
echo ___testGetString___ | ||
./testGetString | ||
echo ___testPutDoubleArray___ | ||
./testPutDoubleArray | ||
echo ___testGetDoubleArray___ | ||
./testGetDoubleArray | ||
echo ___testPutStringArray___ | ||
./testPutStringArray | ||
echo ___testGetStringArray___ | ||
./testGetStringArray |
Oops, something went wrong.