Changeset 962
- Timestamp:
- Mar 25, 2008 12:19:50 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/gauge.tcl
r738 r962 234 234 switch -- $itk_option(-type) { 235 235 integer { 236 if {![string is integer $nv]} { 236 if {[string length $nv] <= 0 237 || ![string is integer $nv] } { 237 238 error "Should be an integer value" 238 239 } 239 240 } 240 241 real { 241 if {![string is double $nv] 242 if {[string length $nv] <= 0 243 || ![string is double $nv] 242 244 || [regexp -nocase {^(inf|nan)$} $nv]} { 243 245 error "Should be a real number" -
trunk/python/Rappture/PyRpEncode.cc
r671 r962 27 27 int dlen = 0; 28 28 PyObject* rv = NULL; 29 int result = 0;30 29 31 30 static char *kwlist[] = {"data", NULL}; -
trunk/src/cee/RpLibraryCInterface.cc
r789 r962 23 23 rpLibrary (const char* path) 24 24 { 25 if (path == NULL) { 26 return (new RpLibrary()); 27 } 28 25 29 return (new RpLibrary(path)); 26 30 } -
trunk/src/core/RpDict.h
r568 r962 1 1 /* 2 2 * ====================================================================== 3 * RpDict 4 * 5 * AUTHOR: Derrick Kearney, Purdue University 3 6 * Copyright (c) 2004-2005 Purdue Research Foundation 4 7 * -
trunk/src/core/RpLibrary.cc
r872 r962 1750 1750 // library doesn't exist, do nothing; 1751 1751 status.error("invalid library object"); 1752 status.addContext("RpLibrary::put() ");1752 status.addContext("RpLibrary::put() - putString"); 1753 1753 return *this; 1754 1754 } … … 1763 1763 retNode = _find(path,CREATE_PATH); 1764 1764 1765 if (retNode) { 1766 1767 if (append == RPLIB_APPEND) { 1768 if ( (contents = scew_element_contents(retNode)) ) { 1769 tmpVal = std::string(contents); 1770 } 1771 value = tmpVal + value; 1772 } 1773 1774 if (translateFlag == RPLIB_TRANSLATE) { 1775 translatedContents = ERTranslator.encode(value.c_str(),0); 1776 } 1777 else { 1778 translatedContents = value.c_str(); 1779 } 1780 1765 if (retNode == NULL) { 1766 // node not found, set error 1767 status.error("Error while searching for node: node not found"); 1768 status.addContext("RpLibrary::put() - putString"); 1769 return *this; 1770 } 1771 1772 if (translateFlag == RPLIB_TRANSLATE) { 1773 translatedContents = ERTranslator.encode(value.c_str(),0); 1781 1774 if (translatedContents == NULL) { 1782 1775 // entity referene translation failed … … 1786 1779 } 1787 1780 else { 1788 scew_element_set_contents(retNode,translatedContents);1781 value = std::string(translatedContents); 1789 1782 translatedContents = NULL; 1790 1783 } 1791 1784 } 1792 else { 1793 // node not found, set error 1794 if (!status) { 1795 status.error("Error while searching for node: node not found"); 1796 } 1797 } 1785 1786 if (append == RPLIB_APPEND) { 1787 contents = scew_element_contents(retNode); 1788 if (contents != NULL) { 1789 tmpVal = std::string(contents); 1790 value = tmpVal + value; 1791 } 1792 } 1793 1794 scew_element_set_contents(retNode,value.c_str()); 1798 1795 1799 1796 status.addContext("RpLibrary::put() - putString"); … … 2212 2209 std::string hostname = ""; 2213 2210 char *user = NULL; 2214 char *host = NULL;2215 2211 2216 2212 if (this->root) { -
trunk/src/matlab/rpLib.cc
r162 r962 40 40 41 41 /* Call the C++ subroutine. */ 42 if (!path.empty()) { 43 lib = new RpLibrary(path); 44 if (lib) { 45 // store the library and return a dictionary key 46 libIndex = storeObject_Lib(lib); 47 if (libIndex) { 48 err = 0; 49 } 42 lib = new RpLibrary(path); 43 if (lib) { 44 // store the library and return a dictionary key 45 libIndex = storeObject_Lib(lib); 46 if (libIndex) { 47 err = 0; 50 48 } 51 49 } -
trunk/src/matlab/rpLibResult.cc
r789 r962 17 17 18 18 /**********************************************************************/ 19 // METHOD: [err] = rpLibResult (libHandle )19 // METHOD: [err] = rpLibResult (libHandle,status) 20 20 /// Write Rappture Library to run.xml and signal end of processing. 21 21 /** … … 30 30 int libIndex = 0; 31 31 int err = 1; 32 int status = 0; 32 33 RpLibrary* lib = NULL; 33 34 34 35 /* Check for proper number of arguments. */ 35 if (nrhs != 1) { 36 if (nrhs > 2) { 37 mexErrMsgTxt("At most two input allowed."); 38 } 39 40 if (nrhs < 1) { 36 41 mexErrMsgTxt("One input required."); 37 42 } … … 40 45 libIndex = getIntInput(prhs[0]); 41 46 47 if (nrhs == 2) { 48 status = getIntInput(prhs[1]); 49 } 50 42 51 /* Call the C subroutine. */ 43 52 if (libIndex > 0) { … … 45 54 if (lib) { 46 55 lib->put("tool.version.rappture.language", "matlab"); 47 lib->result( );56 lib->result(status); 48 57 err = 0; 49 58 // cleanLibDict(); -
trunk/src/octave/rpLib.cc
r156 r962 47 47 if (args(0).is_string ()) { 48 48 path = args(0).string_value (); 49 if (!path.empty()) {50 lib = new RpLibrary(path);49 lib = new RpLibrary(path); 50 if (lib != NULL) { 51 51 err = 0; 52 52 } -
trunk/src/octave/rpLibResult.cc
r789 r962 6 6 * 7 7 * ====================================================================== 8 * AUTHOR: Derrick Kearney, Purdue University9 * Copyright (c) 2005 8 * AUTHOR: Derrick S. Kearney, Purdue University 9 * Copyright (c) 2005-2008 10 10 * Purdue Research Foundation, West Lafayette, IN 11 11 * ====================================================================== … … 15 15 16 16 /**********************************************************************/ 17 // METHOD: [err] = rpLibResult (libHandle )17 // METHOD: [err] = rpLibResult (libHandle,status) 18 18 /// Write Rappture Library to run.xml and signal end of processing. 19 19 /** … … 25 25 DEFUN_DLD (rpLibResult, args, , 26 26 "-*- texinfo -*-\n\ 27 [err] = rpLibResult (@var{libHandle} )\n\27 [err] = rpLibResult (@var{libHandle},@var{status})\n\ 28 28 \n\ 29 29 Usually the last call of the program, this function signals to the gui\n\ … … 37 37 octave_value_list retval; 38 38 39 int nargin = args.length 39 int nargin = args.length(); 40 40 RpLibrary* lib = NULL; 41 41 int libHandle = 0; 42 int status = 0; 42 43 int err = 0; 43 44 44 if (nargin == 1) { 45 if (args(0).is_real_scalar ()) { 46 libHandle= args(0).int_value (); 47 /* Call the C subroutine. */ 48 if (libHandle > 0) { 49 lib = getObject_Lib(libHandle); 50 if (lib) { 51 lib->put("tool.version.rappture.language", "octave"); 52 lib->result(); 53 // cleanLibDict(); 54 err = 0; 55 } 56 } 45 if ((nargin < 1) || (nargin > 2)) { 46 // wrong number of arguments 47 print_usage ("rpLibResult"); 48 goto done; 49 } 50 51 if (! args(0).is_real_scalar()) { 52 // wrong argument type 53 print_usage ("rpLibResult"); 54 goto done; 55 } 56 57 libHandle = args(0).int_value(); 58 59 if (nargin == 2) { 60 if (! args(1).is_real_scalar()) { 61 // wrong argument type 62 print_usage ("rpLibResult"); 63 goto done; 57 64 } 58 else { 59 // wrong argument type 60 print_usage ("rpLib"); 65 66 status = args(1).int_value(); 67 } 68 69 /* Call the C subroutine. */ 70 if (libHandle > 0) { 71 lib = getObject_Lib(libHandle); 72 if (lib) { 73 lib->put("tool.version.rappture.language", "octave"); 74 lib->result(status); 75 // cleanLibDict(); 76 err = 0; 61 77 } 62 78 } 63 else {64 // wrong number of arguments65 print_usage ("rpLib");66 }67 79 80 done: 68 81 retval(0) = err; 69 70 return retval; 82 return retval; 71 83 }
Note: See TracChangeset
for help on using the changeset viewer.