Changeset 1528 for trunk/examples/objects/axis/axis.cc
- Timestamp:
- Jun 22, 2009, 3:16:39 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 }
Note: See TracChangeset
for help on using the changeset viewer.