Ignore:
Timestamp:
Jun 22, 2009, 3:16:39 PM (15 years ago)
Author:
dkearney
Message:

updating the objects code and adding some more examples describing how i want developers to use the objects. some of the objects don't work yet, like the tree, anything with an example should work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/objects/axis/axis.cc

    r1386 r1528  
    11#include <iostream>
    22#include "RpArray1D.h"
     3
     4
     5int 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}
    322
    423int
    524printAxis(Rappture::Array1D *n)
    625{
    7     std::cout << "path: " << n->path() << std::endl;
     26    std::cout << "name: " << n->name() << std::endl;
    827    std::cout << "label: " << n->label() << std::endl;
    928    std::cout << "desc: " << n->desc() << std::endl;
     
    2241}
    2342
     43int 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
    2455int main()
    2556{
     
    2758    double d[] = {70,400,199,502,832924};
    2859
    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");
    3166
    3267    printAxis(n);
    3368
    34     Rappture::Array1D n1("output.axis(t)",d,5);
     69    Rappture::Array1D n1(d,5);
     70    n1.name("output.axis(t)");
    3571    printAxis(&n1);
    3672
    3773    delete n;
    3874
     75    axis_0_0();
     76
    3977    return 0;
    4078}
Note: See TracChangeset for help on using the changeset viewer.