source: trunk/lang/matlab/rpUtilsProgress.cc @ 1018

Last change on this file since 1018 was 737, checked in by dkearney, 17 years ago

added the rpmxFlush function to flush matlab's buffers on demand.
this is used in the progress function.

File size: 1.5 KB
Line 
1/*
2 * ----------------------------------------------------------------------
3 *  INTERFACE: Matlab Rappture Progress Source
4 *
5 *    [err] = rpUtilsProgress(percent,message)
6 *
7 * ======================================================================
8 *  AUTHOR:  Derrick Kearney, Purdue University
9 *  Copyright (c) 2004-2007  Purdue Research Foundation
10 *
11 *  See the file "license.terms" for information on usage and
12 *  redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
13 * ======================================================================
14 */
15
16#include "RpMatlabInterface.h"
17
18/**********************************************************************/
19// METHOD: [err] = rpUtilsProgress (percent,message)
20/// Print the Rappture Progress message.
21/**
22 * Clients use this to generate the super secret Rappture
23 * Progress message, and generate a progress bar in the
24 * Rappture graphical user interface.
25 */
26
27void mexFunction(int nlhs, mxArray *plhs[],
28                 int nrhs, const mxArray *prhs[])
29{
30    int         err = 1;
31    int         percent = 0;
32    const char* message = NULL;
33
34    /* Check for proper number of arguments. */
35    if (nrhs != 2) {
36        mexErrMsgTxt("Two input required.");
37    }
38
39    percent = getIntInput(prhs[0]);
40    message = getStringInput(prhs[1]);
41
42    /* Call the C++ subroutine. */
43    err = Rappture::Utils::progress(percent,message);
44
45    plhs[0] = mxCreateDoubleScalar(err);
46
47    freeStringInput((void*)message);
48    rpmxFlush();
49    return;
50}
Note: See TracBrowser for help on using the repository browser.