added StandardPVField
StandardField, which creates standard introspection interfaces, is complele
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
#include "pvIntrospect.h"
|
||||
#include "pvData.h"
|
||||
#include "standardField.h"
|
||||
#include "standardPVField.h"
|
||||
|
||||
using namespace epics::pvData;
|
||||
|
||||
@@ -21,7 +22,7 @@ static String buffer("");
|
||||
|
||||
void testBoolean() {
|
||||
printf("\ntestBoolean\n");
|
||||
PVScalar *pvScalar = getStandardField()->scalarValue(pvBoolean);
|
||||
PVScalar *pvScalar = getStandardPVField()->scalarValue(pvBoolean);
|
||||
PVBoolean *pvValue = (PVBoolean *)pvScalar;
|
||||
bool value = true;
|
||||
pvValue->put(value);
|
||||
@@ -57,7 +58,7 @@ void testBoolean() {
|
||||
pvValue->toString(&buffer);
|
||||
printf("%s\n",buffer.c_str());
|
||||
pvScalar->message(String("this is a test message"),infoMessage);
|
||||
PVScalar *other = getStandardField()->scalarValue(pvDouble);
|
||||
PVScalar *other = getStandardPVField()->scalarValue(pvDouble);
|
||||
bool isEqual = pvScalar==other;
|
||||
printf("expect false isEqual %s\n",(isEqual ? "true" : "false"));
|
||||
delete pvValue;
|
||||
@@ -65,7 +66,7 @@ void testBoolean() {
|
||||
|
||||
void testByte() {
|
||||
printf("\ntestByte\n");
|
||||
PVScalar *pvScalar = getStandardField()->scalarValue(pvByte);
|
||||
PVScalar *pvScalar = getStandardPVField()->scalarValue(pvByte);
|
||||
PVByte *pvValue = (PVByte *)pvScalar;
|
||||
epicsInt8 value = 2;
|
||||
pvValue->put(value);
|
||||
@@ -97,7 +98,7 @@ void testByte() {
|
||||
pvValue->toString(&buffer);
|
||||
printf("%s\n",buffer.c_str());
|
||||
pvScalar->message(String("this is a test message"),infoMessage);
|
||||
PVScalar *other = getStandardField()->scalarValue(pvDouble);
|
||||
PVScalar *other = getStandardPVField()->scalarValue(pvDouble);
|
||||
bool isEqual = pvScalar==other;
|
||||
printf("expect false isEqual %s\n",(isEqual ? "true" : "false"));
|
||||
delete pvValue;
|
||||
@@ -105,7 +106,7 @@ void testByte() {
|
||||
|
||||
void testShort() {
|
||||
printf("\ntestShort\n");
|
||||
PVScalar *pvScalar = getStandardField()->scalarValue(pvShort);
|
||||
PVScalar *pvScalar = getStandardPVField()->scalarValue(pvShort);
|
||||
PVShort *pvValue = (PVShort *)pvScalar;
|
||||
epicsInt16 value = 2;
|
||||
pvValue->put(value);
|
||||
@@ -137,7 +138,7 @@ void testShort() {
|
||||
pvValue->toString(&buffer);
|
||||
printf("%s\n",buffer.c_str());
|
||||
pvScalar->message(String("this is a test message"),infoMessage);
|
||||
PVScalar *other = getStandardField()->scalarValue(pvDouble);
|
||||
PVScalar *other = getStandardPVField()->scalarValue(pvDouble);
|
||||
bool isEqual = pvScalar==other;
|
||||
printf("expect false isEqual %s\n",(isEqual ? "true" : "false"));
|
||||
delete pvValue;
|
||||
@@ -145,7 +146,7 @@ void testShort() {
|
||||
|
||||
void testInt() {
|
||||
printf("\ntestInt\n");
|
||||
PVScalar *pvScalar = getStandardField()->scalarValue(pvInt);
|
||||
PVScalar *pvScalar = getStandardPVField()->scalarValue(pvInt);
|
||||
PVInt *pvValue = (PVInt *)pvScalar;
|
||||
epicsInt32 value = 2;
|
||||
pvValue->put(value);
|
||||
@@ -177,7 +178,7 @@ void testInt() {
|
||||
pvValue->toString(&buffer);
|
||||
printf("%s\n",buffer.c_str());
|
||||
pvScalar->message(String("this is a test message"),infoMessage);
|
||||
PVScalar *other = getStandardField()->scalarValue(pvDouble);
|
||||
PVScalar *other = getStandardPVField()->scalarValue(pvDouble);
|
||||
bool isEqual = pvScalar==other;
|
||||
printf("expect false isEqual %s\n",(isEqual ? "true" : "false"));
|
||||
delete pvValue;
|
||||
@@ -185,7 +186,7 @@ void testInt() {
|
||||
|
||||
void testLong() {
|
||||
printf("\ntestLong\n");
|
||||
PVScalar *pvScalar = getStandardField()->scalarValue(pvLong);
|
||||
PVScalar *pvScalar = getStandardPVField()->scalarValue(pvLong);
|
||||
PVLong *pvValue = (PVLong *)pvScalar;
|
||||
epicsInt64 value = 2;
|
||||
pvValue->put(value);
|
||||
@@ -217,7 +218,7 @@ void testLong() {
|
||||
pvValue->toString(&buffer);
|
||||
printf("%s\n",buffer.c_str());
|
||||
pvScalar->message(String("this is a test message"),infoMessage);
|
||||
PVScalar *other = getStandardField()->scalarValue(pvDouble);
|
||||
PVScalar *other = getStandardPVField()->scalarValue(pvDouble);
|
||||
bool isEqual = pvScalar==other;
|
||||
printf("expect false isEqual %s\n",(isEqual ? "true" : "false"));
|
||||
delete pvValue;
|
||||
@@ -225,7 +226,7 @@ void testLong() {
|
||||
|
||||
void testFloat() {
|
||||
printf("\ntestFloat\n");
|
||||
PVScalar *pvScalar = getStandardField()->scalarValue(pvFloat);
|
||||
PVScalar *pvScalar = getStandardPVField()->scalarValue(pvFloat);
|
||||
PVFloat *pvValue = (PVFloat *)pvScalar;
|
||||
float value = 2;
|
||||
pvValue->put(value);
|
||||
@@ -264,7 +265,7 @@ void testFloat() {
|
||||
|
||||
void testDouble() {
|
||||
printf("\ntestDouble\n");
|
||||
PVScalar *pvScalar = getStandardField()->scalarValue(pvDouble);
|
||||
PVScalar *pvScalar = getStandardPVField()->scalarValue(pvDouble);
|
||||
PVDouble *pvValue = (PVDouble *)pvScalar;
|
||||
double value = 2;
|
||||
pvValue->put(value);
|
||||
@@ -303,7 +304,7 @@ void testDouble() {
|
||||
|
||||
void testString() {
|
||||
printf("\ntestString\n");
|
||||
PVScalar *pvScalar = getStandardField()->scalarValue(pvString);
|
||||
PVScalar *pvScalar = getStandardPVField()->scalarValue(pvString);
|
||||
PVString *pvValue = (PVString *)pvScalar;
|
||||
String value = "testString";
|
||||
pvValue->put(value);
|
||||
|
||||
Reference in New Issue
Block a user