merge SF branch

This commit is contained in:
Ralph Lange
2013-02-26 16:23:54 +01:00
11 changed files with 2387 additions and 66 deletions

9
README
View File

@@ -16,8 +16,9 @@ g++ -g -O3 -I${GTEST_DIR}/include -I${GTEST_DIR} -c ${GTEST_DIR}/src/gtest-all.c
g++ -g -O3 -I${GTEST_DIR}/include -I${GTEST_DIR} -c ${GTEST_DIR}/src/gtest_main.cc
ar -rv libgtest_main.a gtest_main.o gtest-all.o
mkdir -p $EPICS_HOME/gtest/lib
cp -r ${GTEST_DIR}/include $EPICS_HOME/gtest
cp libgtest_main.a $EPICS_HOME/gtest/lib
# INSTALL is where you put build artifacts
mkdir -p $INSTALL/gtest/lib/$EPICS_HOST_ARCH
cp -r ${GTEST_DIR}/include $INSTALL/gtest
cp libgtest_main.a $INSTALL/gtest/lib/$EPICS_HOST_ARCH
(you can use cmake, see gtest README)

View File

@@ -85,6 +85,10 @@ SRC_DIRS += $(PVACCESS)/rpcClient
INC += rpcClient.h
LIBSRCS += rpcClient.cpp
SRC_DIRS += $(PVACCESS)/mb
INC += pvAccessMB.h
LIBSRCS += pvAccessMB.cpp
LIBRARY = pvAccess
pvAccess_LIBS += Com
pvAccess_LIBS += pvData

View File

@@ -0,0 +1,3 @@
#include "pvAccessMB.h"
MB_DECLARE(channelGet, 100000);

View File

@@ -0,0 +1,8 @@
#ifndef _PVACCESSMB_H_
#define _PVACCESSMB_H_
#include <pv/mb.h>
MB_DECLARE_EXTERN(channelGet);
#endif

View File

@@ -31,6 +31,8 @@
#include <pv/serializationHelper.h>
#include <pv/convert.h>
#include <pv/pvAccessMB.h>
//#include <tr1/unordered_map>
using std::tr1::dynamic_pointer_cast;
@@ -542,6 +544,10 @@ namespace epics {
virtual void send(ByteBuffer* buffer, TransportSendControl* control) {
int32 pendingRequest = getPendingRequest();
bool initStage = (pendingRequest & QOS_INIT);
MB_POINT_CONDITIONAL(channelGet, 1, !initStage);
if (pendingRequest < 0)
{
BaseRequestImpl::send(buffer, control);
@@ -553,12 +559,14 @@ namespace epics {
buffer->putInt(m_ioid);
buffer->putByte((int8)m_pendingRequest);
if (pendingRequest & QOS_INIT)
if (initStage)
{
// pvRequest
SerializationHelper::serializePVRequest(buffer, control, m_pvRequest);
}
MB_POINT_CONDITIONAL(channelGet, 2, !initStage);
stopRequest();
}
@@ -591,6 +599,9 @@ namespace epics {
}
virtual bool normalResponse(Transport::shared_pointer const & transport, int8 /*version*/, ByteBuffer* payloadBuffer, int8 /*qos*/, const Status& status) {
MB_POINT(channelGet, 8);
if (!status.isSuccess())
{
EXCEPTION_GUARD(m_channelGetRequester->getDone(status));
@@ -604,6 +615,8 @@ namespace epics {
m_structure->deserialize(payloadBuffer, transport.get(), m_bitSet.get());
}
MB_POINT(channelGet, 9);
EXCEPTION_GUARD(m_channelGetRequester->getDone(status));
return true;
}
@@ -611,6 +624,9 @@ namespace epics {
virtual void get(bool lastRequest) {
{
MB_INC_AUTO_ID(channelGet);
MB_POINT(channelGet, 0);
Lock guard(m_mutex);
if (m_destroyed) {
EXCEPTION_GUARD(m_channelGetRequester->getDone(destroyedStatus));
@@ -3025,6 +3041,7 @@ namespace epics {
ChannelProviderImpl(std::tr1::shared_ptr<ClientContextImpl> const & context) :
m_context(context)
{
MB_INIT;
}
virtual epics::pvData::String getProviderName()

View File

@@ -16,6 +16,8 @@
#include <sstream>
#include <pv/pvAccessMB.h>
using std::ostringstream;
using std::hex;
@@ -45,8 +47,9 @@ void ServerBadResponse::handleResponse(osiSockAddr* responseFrom,
ServerResponseHandler::ServerResponseHandler(ServerContextImpl::shared_pointer const & context)
{
MB_INIT;
ResponseHandler::shared_pointer badResponse(new ServerBadResponse(context));
m_handlerTable.resize(CMD_RPC+1);
m_handlerTable[CMD_BEACON].reset(new ServerNoopResponse(context, "Beacon")); /* 0 */
@@ -554,6 +557,9 @@ void ServerGetHandler::handleResponse(osiSockAddr* responseFrom,
}
else
{
MB_INC_AUTO_ID(channelGet);
MB_POINT(channelGet, 3);
const bool lastRequest = (QOS_DESTROY & qosCode) != 0;
ServerChannelGetRequesterImpl::shared_pointer request = static_pointer_cast<ServerChannelGetRequesterImpl>(channel->getRequest(ioid));
@@ -569,6 +575,8 @@ void ServerGetHandler::handleResponse(osiSockAddr* responseFrom,
return;
}
MB_POINT(channelGet, 4);
request->getChannelGet()->get(lastRequest);
}
}
@@ -632,6 +640,7 @@ void ServerChannelGetRequesterImpl::channelGetConnect(const Status& status, Chan
void ServerChannelGetRequesterImpl::getDone(const Status& status)
{
MB_POINT(channelGet, 5);
{
Lock guard(_mutex);
_status = status;
@@ -691,11 +700,15 @@ void ServerChannelGetRequesterImpl::send(ByteBuffer* buffer, TransportSendContro
}
else
{
MB_POINT(channelGet, 6);
{
// we locked _mutex above, so _channelGet is valid
ScopedLock lock(_channelGet);
_bitSet->serialize(buffer, control);
_pvStructure->serialize(buffer, control, _bitSet.get());
}
MB_POINT(channelGet, 7);
}
}

View File

@@ -38,7 +38,7 @@ void formatNTAny(std::ostream& o, PVStructurePtr const & pvStruct)
PVFieldPtr value = pvStruct->getSubField("value");
if (value.get() == 0)
{
std::cerr << "no 'value' column in NTAny" << std::endl;
std::cerr << "no 'value' field in NTAny" << std::endl;
return;
}
@@ -50,7 +50,7 @@ void formatNTScalar(std::ostream& o, PVStructurePtr const & pvStruct)
PVScalarPtr value = dynamic_pointer_cast<PVScalar>(pvStruct->getSubField("value"));
if (value.get() == 0)
{
std::cerr << "no scalar_t 'value' column in NTScalar" << std::endl;
std::cerr << "no scalar_t 'value' field in NTScalar" << std::endl;
return;
}
@@ -117,7 +117,7 @@ void formatNTScalarArray(std::ostream& o, PVStructurePtr const & pvStruct)
PVScalarArrayPtr value = dynamic_pointer_cast<PVScalarArray>(pvStruct->getSubField("value"));
if (value.get() == 0)
{
std::cerr << "no scalar_t[] 'value' column in NTScalarArray" << std::endl;
std::cerr << "no scalar_t[] 'value' field in NTScalarArray" << std::endl;
return;
}
@@ -258,7 +258,7 @@ void formatNTTable(std::ostream& o, PVStructurePtr const & pvStruct)
PVStringArrayPtr labels = dynamic_pointer_cast<PVStringArray>(pvStruct->getScalarArrayField("labels", pvString));
if (labels.get() == 0)
{
std::cerr << "no string[] 'labels' column in NTTable" << std::endl;
std::cerr << "no string[] 'labels' field in NTTable" << std::endl;
return;
}
@@ -304,7 +304,7 @@ void formatNTMatrix(std::ostream& o, PVStructurePtr const & pvStruct)
PVDoubleArrayPtr value = dynamic_pointer_cast<PVDoubleArray>(pvStruct->getScalarArrayField("value", pvDouble));
if (value.get() == 0)
{
std::cerr << "no double[] 'value' column in NTMatrix" << std::endl;
std::cerr << "no double[] 'value' field in NTMatrix" << std::endl;
return;
}
@@ -328,7 +328,7 @@ void formatNTMatrix(std::ostream& o, PVStructurePtr const & pvStruct)
if (rows <= 0 || cols <= 0)
{
std::cerr << "malformed NTMatrix, dim[] must contain elements >= 0" << std::endl;
std::cerr << "malformed NTMatrix, dim[] must contain elements > 0" << std::endl;
return;
}
}
@@ -490,6 +490,139 @@ void formatNTNameValue(std::ostream& o, PVStructurePtr const & pvStruct)
}
void formatNTURI(std::ostream& o, PVStructurePtr const & pvStruct)
{
PVStringPtr scheme = dynamic_pointer_cast<PVString>(pvStruct->getStringField("scheme"));
if (scheme.get() == 0)
{
std::cerr << "no string 'scheme' field in NTURI" << std::endl;
}
PVStringPtr authority = dynamic_pointer_cast<PVString>(pvStruct->getSubField("authority"));
PVStringPtr path = dynamic_pointer_cast<PVString>(pvStruct->getStringField("path"));
if (path.get() == 0)
{
std::cerr << "no string 'path' field in NTURI" << std::endl;
return;
}
PVStructurePtr query = dynamic_pointer_cast<PVStructure>(pvStruct->getSubField("query"));
o << scheme->get() << "://";
if (authority.get()) o << authority->get();
o << '/' << path->get();
// query
if (query.get())
{
PVFieldPtrArray fields = query->getPVFields();
size_t numColumns = fields.size();
if (numColumns > 0)
{
o << '?';
for (size_t i = 0; i < numColumns; i++)
{
if (i)
o << '&';
// TODO encode value!!!
o << fields[i]->getFieldName() << '=' << *(fields[i].get());
}
}
}
o << std::endl;
}
void formatNTImage(std::ostream& /*o*/, PVStructurePtr const & pvStruct)
{
PVScalarArrayPtr value = dynamic_pointer_cast<PVScalarArray>(pvStruct->getSubField("value"));
if (value.get() == 0)
{
std::cerr << "no scalar array 'value' field in NTImage" << std::endl;
return;
}
int32 rows, cols;
PVIntArrayPtr dim = dynamic_pointer_cast<PVIntArray>(pvStruct->getScalarArrayField("dim", pvInt));
if (dim.get() == 0)
{
std::cerr << "no int[] 'dim' field in NTImage" << std::endl;
return;
}
// dim[] = { rows, columns }
size_t dims = dim->getLength();
if (dims != 2)
{
std::cerr << "malformed NTImage, dim[] must 2 elements instead of " << dims << std::endl;
return;
}
IntArrayData data;
dim->get(0, dims, data);
cols = data.data[0];
rows = data.data[1];
if (rows <= 0 || cols <= 0)
{
std::cerr << "malformed NTImage, dim[] must contain elements > 0" << std::endl;
return;
}
// TODO !!!
PVByteArrayPtr array = dynamic_pointer_cast<PVByteArray>(value);
if (array.get() == 0)
{
std::cerr << "currently only grayscale NTImage with byte[] value field are supported" << std::endl;
return;
}
ByteArrayData img;
array->get(0, array->getLength(), img);
/*
size_t len = static_cast<size_t>(rows*cols);
for (size_t i = 0; i < len; i++)
o << img.data[i];
*/
//eget -s testImage | gnuplot -e "set size ratio -1; set palette grey; set cbrange [0:255]; plot '-' binary array=(512,384) flipy format='%uchar' with image"
FILE* gnuplotPipe = popen ("gnuplot -p", "w");
const char *prologue = getenv("EGET_GNUPLOT_PROLOGUE");
if (prologue)
fprintf(gnuplotPipe, "%s\n", prologue);
fprintf(gnuplotPipe, "set format \"\"\n");
fprintf(gnuplotPipe, "unset key\n");
fprintf(gnuplotPipe, "unset border\n");
fprintf(gnuplotPipe, "unset colorbox\n");
fprintf(gnuplotPipe, "unset xtics\n");
fprintf(gnuplotPipe, "unset ytics\n");
fprintf(gnuplotPipe, "set size ratio 1\n");
fprintf(gnuplotPipe, "set xrange [0:%u]\n", cols-1);
fprintf(gnuplotPipe, "set yrange [0:%u]\n", rows-1);
fprintf(gnuplotPipe, "set palette grey\n");
fprintf(gnuplotPipe, "set cbrange [0:255]\n");
fprintf(gnuplotPipe, "plot '-' binary array=(%u,%u) flipy format='%%uchar' with image\n", cols, rows);
size_t len = static_cast<size_t>(rows*cols);
for (size_t i = 0; i < len; i++)
fprintf(gnuplotPipe, "%c", img.data[i]);
fflush(gnuplotPipe);
pclose(gnuplotPipe);
}
typedef void(*NTFormatterFunc)(std::ostream& o, PVStructurePtr const & pvStruct);
typedef map<String, NTFormatterFunc> NTFormatterLUTMap;
@@ -503,21 +636,8 @@ void initializeNTFormatterLUT()
ntFormatterLUT["uri:ev4:nt/2012/pwd:NTMatrix"] = formatNTMatrix;
ntFormatterLUT["uri:ev4:nt/2012/pwd:NTAny"] = formatNTAny;
ntFormatterLUT["uri:ev4:nt/2012/pwd:NTNameValue"] = formatNTNameValue;
//
// TODO remove: smooth transition
//
ntFormatterLUT["NTScalar"] = formatNTScalar;
ntFormatterLUT["NTScalarArray"] = formatNTScalarArray;
ntFormatterLUT["NTTable"] = formatNTTable;
ntFormatterLUT["NTMatrix"] = formatNTMatrix;
ntFormatterLUT["NTAny"] = formatNTAny;
ntFormatterLUT["NTNameValue"] = formatNTNameValue;
// StandardPV "support"
ntFormatterLUT["scalar_t"] = formatNTScalar;
ntFormatterLUT["scalarArray_t"] = formatNTScalarArray;
ntFormatterLUT["uri:ev4:nt/2012/pwd:NTURI"] = formatNTURI;
ntFormatterLUT["uri:ev4:nt/2012/pwd:NTImage"] = formatNTImage;
}
void formatNT(std::ostream& o, PVFieldPtr const & pv)
@@ -962,7 +1082,7 @@ int main (int argc, char *argv[])
bool serviceRequest = false;
bool onlyQuery = false;
string service;
string urlEncodedRequest;
//string urlEncodedRequest;
vector< pair<string,string> > parameters;
setvbuf(stdout,NULL,_IOLBF,BUFSIZ); /* Set stdout to line buffering */
@@ -995,11 +1115,13 @@ int main (int argc, char *argv[])
return 1;
}
parameters.push_back(pair<string,string>(param.substr(0, eqPos), param.substr(eqPos+1, string::npos)));
/*
if (urlEncodedRequest.size())
urlEncodedRequest += '&';
char* encoded = url_encode(optarg);
urlEncodedRequest += encoded;
free(encoded);
*/
break;
}
case 's': /* Service name */
@@ -1176,6 +1298,8 @@ int main (int argc, char *argv[])
// service RPC mode
else
{
String authority;
URI uri;
bool validURI = URI::parse(service, uri);
if (validURI)
@@ -1187,6 +1311,8 @@ int main (int argc, char *argv[])
return 1;
}
authority = uri.host;
if (uri.path.length() <= 1)
{
std::cerr << "invalid URI, empty path" << std::endl;
@@ -1262,11 +1388,15 @@ int main (int argc, char *argv[])
StringArray uriFieldNames;
uriFieldNames.push_back("scheme");
if (!authority.empty()) uriFieldNames.push_back("authority");
uriFieldNames.push_back("path");
uriFieldNames.push_back("query");
FieldConstPtrArray uriFields;
uriFields.push_back(getFieldCreate()->createScalar(pvString));
if (!authority.empty()) uriFields.push_back(getFieldCreate()->createScalar(pvString));
uriFields.push_back(getFieldCreate()->createScalar(pvString));
uriFields.push_back(queryStructure);
Structure::const_shared_pointer uriStructure(
@@ -1283,6 +1413,8 @@ int main (int argc, char *argv[])
getPVDataCreate()->createPVStructure(uriStructure)
);
request->getStringField("scheme")->put("pva");
if (!authority.empty()) request->getStringField("authority")->put(authority);
request->getStringField("path")->put(service);
PVStructure::shared_pointer query = request->getStructureField("query");
for (vector< pair<string, string> >::iterator iter = parameters.begin();
@@ -1304,7 +1436,11 @@ int main (int argc, char *argv[])
ChannelProvider::shared_pointer provider = getChannelAccess()->getProvider("pvAccess");
shared_ptr<ChannelRequesterImpl> channelRequesterImpl(new ChannelRequesterImpl());
Channel::shared_pointer channel = provider->createChannel(service, channelRequesterImpl);
Channel::shared_pointer channel =
authority.empty() ?
provider->createChannel(service, channelRequesterImpl) :
provider->createChannel(service, channelRequesterImpl,
ChannelProvider::PRIORITY_DEFAULT, authority);
if (channelRequesterImpl->waitUntilConnected(timeOut))
{

File diff suppressed because it is too large Load Diff

View File

@@ -23,9 +23,10 @@ using namespace std::tr1;
using namespace epics::pvData;
using namespace epics::pvAccess;
#define COUNT 1000 // repetitions per result
#define CHANNELS 1000
#define ARRAY_SIZE 1
#define COUNT 10000 // repetitions per result
#define CHANNELS 1
#define ARRAY_SIZE 0 // 0 means scalar
#define LOOP_FOREVER 1
#define DEFAULT_TIMEOUT 600.0
#define DEFAULT_REQUEST "field(value)"
@@ -78,7 +79,7 @@ void get_all()
(*i)->get(false);
last = *i;
}
last->get(true);
// bulk testing dirty trigger last->get(true);
}
@@ -175,8 +176,11 @@ class ChannelGetRequesterImpl : public ChannelGetRequester
allCount = 0;
gettimeofday(&startTime, NULL);
get_all();
if (LOOP_FOREVER)
get_all();
else
exit(0); // TODO not the nicest way to exit
}
else if (channelCount == 0)
@@ -258,8 +262,6 @@ public:
int main (int argc, char *argv[])
{
printf("this does not work... since this impl. requires bulk get control... tODO\n");
return -1;
int opt; // getopt() current option
Requester::shared_pointer requester(new RequesterImpl());
@@ -298,13 +300,16 @@ return -1;
}
}
printf("%d channels of double array size of %d elements, %d repetitions per sample\n", CHANNELS, ARRAY_SIZE, COUNT);
printf("%d channels of double array size of %d elements (0==scalar), %d repetitions per sample\n", CHANNELS, ARRAY_SIZE, COUNT);
vector<string> pvs;
char buf[64];
for (int i = 0; i < CHANNELS; i++)
{
sprintf(buf, "testArray%d_%d", ARRAY_SIZE, i);
if (ARRAY_SIZE > 0)
sprintf(buf, "testArray%d_%d", ARRAY_SIZE, i);
else
sprintf(buf, "test%d", i);
pvs.push_back(buf);
//printf("%s\n", buf);
}

View File

@@ -0,0 +1,144 @@
#include "epicsv4Grayscale.h"
epics::pvData::StructureConstPtr makeVariantArrayStruc()
{
FieldConstPtrArray vaFields;
StringArray vaNames;
vaFields.push_back(getFieldCreate()->createScalar(epics::pvData::pvInt));
vaNames.push_back("dataType");
vaFields.push_back(getFieldCreate()->createScalarArray(epics::pvData::pvInt));
vaNames.push_back("value");
epics::pvData::StructureConstPtr varrayStruc = getFieldCreate()->createStructure("uri:ev4:nt/2012/pwd:NTVariantArray", vaNames, vaFields);
return varrayStruc;
}
epics::pvData::StructureConstPtr makeImageStruc()
{
static epics::pvData::StructureConstPtr imageStruc;
if (imageStruc == NULL)
{
FieldConstPtrArray fields;
StringArray names;
// Array part
fields.push_back(getFieldCreate()->createScalarArray(epics::pvData::pvByte));
names.push_back("value");
fields.push_back(getFieldCreate()->createScalarArray(epics::pvData::pvInt));
names.push_back("dim");
// Image part
fields.push_back(getFieldCreate()->createScalar(epics::pvData::pvInt));
names.push_back("colorMode");
fields.push_back(getFieldCreate()->createScalar(epics::pvData::pvInt));
names.push_back("bayerPattern");
fields.push_back(getFieldCreate()->createScalar(epics::pvData::pvString));
names.push_back("fourcc");
fields.push_back(getFieldCreate()->createScalarArray(epics::pvData::pvInt));
names.push_back("offset");
fields.push_back(getFieldCreate()->createScalarArray(epics::pvData::pvInt));
names.push_back("binning");
fields.push_back(getFieldCreate()->createScalarArray(epics::pvData::pvInt));
names.push_back("reverse");
fields.push_back(getFieldCreate()->createScalarArray(epics::pvData::pvInt));
names.push_back("fullDim");
// Metadata part
fields.push_back(getFieldCreate()->createScalar(epics::pvData::pvInt));
names.push_back("uniqueId");
fields.push_back(getFieldCreate()->createScalarArray(epics::pvData::pvInt));
names.push_back("attributeSourceTypes");
fields.push_back(getFieldCreate()->createScalarArray(epics::pvData::pvString));
names.push_back("attributeSources");
fields.push_back(getFieldCreate()->createStructureArray(makeVariantArrayStruc()));
names.push_back("attributes");
imageStruc = getFieldCreate()->createStructure("uri:ev4:nt/2012/pwd:NTImage", names, fields);
}
return imageStruc;
}
void setImageArrayValues(PVStructure::shared_pointer const & imagePV)
{
String id = imagePV->getStructure()->getID();
PVByteArrayPtr pvField = static_pointer_cast<PVByteArray>(imagePV->getSubField("value"));
size_t dataSize = epicsv4_raw_size;
pvField->setCapacity(dataSize);
const int8_t *data = epicsv4_raw;
pvField->put(0, dataSize, data, 0);
PVIntArrayPtr dimField = static_pointer_cast<PVIntArray>(
imagePV->getScalarArrayField(String("dim"), pvInt));
dimField->setCapacity(2);
const int32_t *dim = epicsv4_raw_dim;
dimField->put(0, 2, dim, 0);
}
void setImageImageValues(PVStructure::shared_pointer const & imagePV)
{
PVIntArrayPtr offsetField = static_pointer_cast<PVIntArray>(
imagePV->getScalarArrayField(String("offset"), pvInt));
offsetField->setCapacity(2);
int32_t offsets[] = { 0, 0 };
offsetField->put(0, 2, offsets, 0);
PVIntArrayPtr binningField = static_pointer_cast<PVIntArray>(
imagePV->getScalarArrayField(String("binning"), pvInt));
binningField->setCapacity(2);
int32_t binnings[] = { 1, 1 };
binningField->put(0, 2, binnings, 0);
PVIntArrayPtr reverseField = static_pointer_cast<PVIntArray>(
imagePV->getScalarArrayField(String("reverse"), pvInt));
reverseField->setCapacity(2);
int32_t reverses[] = { 0, 0 };
reverseField->put(0, 2, reverses, 0);
PVIntArrayPtr fullDimField = static_pointer_cast<PVIntArray>(
imagePV->getScalarArrayField(String("fullDim"), pvInt));
fullDimField->setCapacity(2);
const int32_t *fullDim = epicsv4_raw_dim;
fullDimField->put(0, 2, fullDim, 0);
}
void setImageUniqueId(PVStructure::shared_pointer const & imagePV)
{
PVIntPtr uniqueIdField = imagePV->getIntField(String("uniqueId"));
uniqueIdField->put(0);
}
void setImageMetadataValues(PVStructure::shared_pointer const & imagePV)
{
setImageUniqueId(imagePV);
}
void initImage(PVStructure::shared_pointer const & imagePV)
{
setImageArrayValues(imagePV);
setImageImageValues(imagePV);
setImageMetadataValues(imagePV);
}

View File

@@ -18,12 +18,14 @@
// TODO temp
#include "testADCSim.cpp"
using namespace epics::pvAccess;
using namespace epics::pvData;
using namespace std;
using std::tr1::static_pointer_cast;
// TODO temp
#include "testNTImage.cpp"
map<String, PVStructure::shared_pointer> structureStore;
@@ -1031,6 +1033,20 @@ class MockChannelRPC : public ChannelRPC
m_channelRPCRequester->requestDone(Status::Ok, result);
}
}
else if (m_channelName == "testNTURI")
{
if (pvArgument->getStructure()->getID() != "uri:ev4:nt/2012/pwd:NTURI")
{
PVStructure::shared_pointer nullPtr;
Status errorStatus(Status::STATUSTYPE_ERROR, "argument is not a NTURI structure");
m_channelRPCRequester->requestDone(errorStatus, nullPtr);
}
else
{
// return argument as result
m_channelRPCRequester->requestDone(Status::Ok, pvArgument);
}
}
else
{
@@ -1362,33 +1378,10 @@ class MockChannel : public Channel {
printf("=============------------------------------------!!!\n");
*/
}
else if (m_name.find("testImage") == 0)
else if (m_name.find("testNTImage") == 0)
{
String allProperties("alarm,timeStamp,display,control");
m_pvStructure = getStandardPVField()->scalarArray(pvByte,allProperties);
PVByteArrayPtr pvField = static_pointer_cast<PVByteArray>(m_pvStructure->getScalarArrayField(String("value"), pvByte));
int ix = 0;
const int COUNT = 1024;
pvField->setCapacity(1024*COUNT);
for (int n = 0; n < 1024; n++)
{
int8 array[COUNT];
for (int i = 0; i < COUNT; i++)
{
array[i] = ix;
}
pvField->put(ix, COUNT, array, 0);
ix += COUNT;
}
/*
printf("array prepared------------------------------------!!!\n");
String str;
pvField->toString(&str);
printf("%s\n", str.c_str());
printf("=============------------------------------------!!!\n");
*/
m_pvStructure = getPVDataCreate()->createPVStructure(makeImageStruc());
initImage(m_pvStructure);
}
else if (m_name.find("testADC") == 0)
{