Changeset 1528 for trunk/examples
- Timestamp:
- Jun 22, 2009, 3:16:39 PM (15 years ago)
- Location:
- trunk/examples/objects
- Files:
-
- 18 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/objects/Makefile.in
r1386 r1528 15 15 RM = rm -f 16 16 17 examples 17 examples = \ 18 18 axis \ 19 19 curve \ 20 20 dxWriter \ 21 21 floatBuffer \ 22 histogram \ 22 23 number \ 24 path \ 23 25 plot \ 24 string 26 string \ 27 tree \ 28 xmlparser 25 29 26 30 destdir = $(prefix)/examples/objects -
trunk/examples/objects/axis/Makefile.in
r1386 r1528 18 18 CXXFLAGS = @CFLAGS@ 19 19 DEFINES = -g -Wall 20 INCLUDES = -I$(srcdir)/../../../src/core \ 20 INCLUDES = -I../../../src/core \ 21 -I../../../src/objects \ 22 -I$(srcdir)/../../../src/core \ 21 23 -I$(srcdir)/../../../src/objects \ 22 24 -I$(includedir) -
trunk/examples/objects/axis/axis.cc
r1386 r1528 1 1 #include <iostream> 2 2 #include "RpArray1D.h" 3 4 5 int test( 6 const char *testname, 7 const char *desc, 8 const char *expected, 9 const char *received) 10 { 11 /* 12 if (strcmp(expected,received) != 0) { 13 printf("Error: %s\n", testname); 14 printf("\t%s\n", desc); 15 printf("\texpected \"%s\"\n",expected); 16 printf("\treceived \"%s\"\n",received); 17 return 1; 18 } 19 */ 20 return 0; 21 } 3 22 4 23 int 5 24 printAxis(Rappture::Array1D *n) 6 25 { 7 std::cout << " path: " << n->path() << std::endl;26 std::cout << "name: " << n->name() << std::endl; 8 27 std::cout << "label: " << n->label() << std::endl; 9 28 std::cout << "desc: " << n->desc() << std::endl; … … 22 41 } 23 42 43 int axis_0_0 () 44 { 45 const char *desc = ""; 46 const char *testname = "axis_0_0"; 47 48 49 const char *expected = NULL; 50 const char *received = NULL; 51 52 return test(testname,desc,expected,received); 53 } 54 24 55 int main() 25 56 { … … 27 58 double d[] = {70,400,199,502,832924}; 28 59 29 n = new Rappture::Array1D("output.axis(temperature)",d,5,"mylabel", 30 "mydesc","K","linear"); 60 n = new Rappture::Array1D(d,5); 61 n->name("output.axis(temperature)"); 62 n->label("mylabel"); 63 n->desc("mydesc"); 64 n->units("K"); 65 n->scale("linear"); 31 66 32 67 printAxis(n); 33 68 34 Rappture::Array1D n1("output.axis(t)",d,5); 69 Rappture::Array1D n1(d,5); 70 n1.name("output.axis(t)"); 35 71 printAxis(&n1); 36 72 37 73 delete n; 38 74 75 axis_0_0(); 76 39 77 return 0; 40 78 } -
trunk/examples/objects/curve/curve.cc
r1386 r1528 1 1 #include <iostream> 2 2 #include "RpCurve.h" 3 4 int test( 5 const char *testname, 6 const char *desc, 7 const char *expected, 8 const char *received) 9 { 10 if (strcmp(expected,received) != 0) { 11 printf("Error: %s\n", testname); 12 printf("\t%s\n", desc); 13 printf("\texpected \"%s\"\n",expected); 14 printf("\treceived \"%s\"\n",received); 15 return 1; 16 } 17 return 0; 18 } 3 19 4 20 int … … 18 34 } 19 35 36 std::cout << "xml: " << n->xml() << std::endl; 20 37 return 0; 38 } 39 40 int curve_0_0 () 41 { 42 const char *desc = "test basic constructor"; 43 const char *testname = "curve_0_0"; 44 45 const char *expected = "output.curve(myid)"; 46 const char *received = NULL; 47 48 Rappture::Curve c(expected); 49 received = c.path(); 50 51 return test(testname,desc,expected,received); 21 52 } 22 53 … … 31 62 "mydesc","mygroup"); 32 63 33 n->axis("x label","xdesc","xunits","xscale",x,10);34 n->axis("y label","ydesc","yunits","yscale",y,10);35 n->axis("z label","zdesc","zunits","zscale",z,10);64 n->axis("xaxis","xlabel","xdesc","xunits","xscale",x,10); 65 n->axis("yaxis","ylabel","ydesc","yunits","yscale",y,10); 66 n->axis("zaxis","zlabel","zdesc","zunits","zscale",z,10); 36 67 printCurve(n); 37 68 n->delAxis("zlabel"); -
trunk/examples/objects/number/number.cc
r1386 r1528 13 13 std::cout << "max: " << n->max() << std::endl; 14 14 std::cout << "units: " << n->units() << std::endl; 15 std::cout << "xml: " << n->xml() << std::endl; 15 16 return 0; 16 17 } -
trunk/examples/objects/plot/plot.cc
r1397 r1528 41 41 std::printf("curveCnt = %zu\n",curveCnt); 42 42 43 std::printf("xml: %s\n",p1->xml()); 44 45 /* 43 46 // retrieve curve from curve name 44 47 // may want to add curve to another plot … … 51 54 size_t ylen = 0; 52 55 53 xlen = c->data(Rappture:: Plot::xaxis,&ax);54 ylen = c->data(Rappture:: Plot::yaxis,&ay);56 xlen = c->data(Rappture::Curve::xaxis,&ax); 57 ylen = c->data(Rappture::Curve::yaxis,&ay); 55 58 56 59 std::printf("xlen = %zu\nylen = %zu\n",xlen,ylen); 57 std::printf("fmt = %s\n",c->propstr(Rappture:: Plot::format,NULL));60 std::printf("fmt = %s\n",c->propstr(Rappture::Curve::format,NULL)); 58 61 59 62 if ( (ax != NULL) … … 63 66 } 64 67 } 68 */ 65 69 66 70 delete p1;
Note: See TracChangeset
for help on using the changeset viewer.