[665] | 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 | |
---|
| 27 | void mexFunction(int nlhs, mxArray *plhs[], |
---|
| 28 | int nrhs, const mxArray *prhs[]) |
---|
| 29 | { |
---|
| 30 | int err = 1; |
---|
| 31 | int percent = 0; |
---|
[737] | 32 | const char* message = NULL; |
---|
[665] | 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. */ |
---|
[737] | 43 | err = Rappture::Utils::progress(percent,message); |
---|
[665] | 44 | |
---|
| 45 | plhs[0] = mxCreateDoubleScalar(err); |
---|
| 46 | |
---|
[737] | 47 | freeStringInput((void*)message); |
---|
| 48 | rpmxFlush(); |
---|
[665] | 49 | return; |
---|
| 50 | } |
---|