Ignore:
Timestamp:
Jan 11, 2006, 3:55:15 PM (19 years ago)
Author:
dkearney
Message:

modified matlab bindings and tests.
includes all popular functions available in RpLibrary? and RpUnits
compile and run, but not all tests work as they should
some of these functions will be removed soon because the id field is
no longer a valid argument. path ids should be incorporated in paths from now on.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/matlab/rpLibElement.cc

    r135 r154  
    33 *  INTERFACE: Matlab Rappture Library Source
    44 *
    5  *    nodeHandle = rpLibElement(libHandle,path)
     5 *    [nodeHandle,err] = rpLibElement(libHandle,path)
    66 *
    77 * ======================================================================
     
    1616#include "RpMatlabInterface.h"
    1717
     18/**********************************************************************/
     19// METHOD: [retVal,err] = rpLibElement(libHandle,path)
     20/// Return a handle to the element at location 'path' in 'libHandle'
     21/**
     22 * This method searches the Rappture Library Object 'libHandle' for the
     23 * node at the location described by the path 'path' and returns
     24 * a handle to it.
     25 *
     26 * If path is an empty string, the root of the node is used. 'libHandle'
     27 * is the handle representing the instance of the RpLibrary object.
     28 * Error code, err=0 on success, anything else is failure.
     29 */
     30
     31
    1832void mexFunction(int nlhs, mxArray *plhs[],
    1933                 int nrhs, const mxArray *prhs[])
     
    2135    int         libIndex = 0;
    2236    int         retLibIndex = 0;
     37    int         err = 1;
    2338    RpLibrary*  lib = NULL;
    2439    RpLibrary*  retLib = NULL;
     
    2843    if (nrhs != 2)
    2944        mexErrMsgTxt("Two input required.");
    30     else if (nlhs > 1)
     45    else if (nlhs > 2)
    3146        mexErrMsgTxt("Too many output arguments.");
    3247
     
    4055            retLib = rpElement(lib,path);
    4156            retLibIndex = storeObject_Lib(retLib);
     57            if (retLibIndex) {
     58                err = 0;
     59            }
    4260        }
    4361    }
     
    4563    /* Set double scalar node handle to MATLAB mexFunction output*/
    4664    plhs[0] = mxCreateDoubleScalar(retLibIndex);
     65    plhs[1] = mxCreateDoubleScalar(err);
    4766
    4867    return;
Note: See TracChangeset for help on using the changeset viewer.