Last change
on this file since 829 was
665,
checked in by dkearney, 17 years ago
|
Updates to Rappture::Utils::progress for all languages
removed the dependancy on Rappture.Units from within number.py, it should only depend on Rappture which will include Rappture.Units
added Rappture.Units as a module to load when people import Rappture in python.
added -V pbs variable to queue.py to include qsub environment variables in the submitted job.
updated setup.py.in to install Rappture.Utils
added progress bar to all app-fermi examples showing how to use the Rappture::Utils::progress function in all languages.
added destructor definitions to Node classes in src2/core
|
File size:
1.6 KB
|
Line | |
---|
1 | #include "rappture.h" |
---|
2 | #include <string> |
---|
3 | |
---|
4 | #include "EXTERN.h" |
---|
5 | #include "perl.h" |
---|
6 | #include "XSUB.h" |
---|
7 | |
---|
8 | #include "ppport.h" |
---|
9 | |
---|
10 | using namespace std; |
---|
11 | |
---|
12 | MODULE = Rappture PACKAGE = Rappture::RpLibrary |
---|
13 | PROTOTYPES: ENABLE |
---|
14 | |
---|
15 | RpLibrary * |
---|
16 | RpLibrary::new(filename = "") |
---|
17 | char *filename |
---|
18 | CODE: |
---|
19 | RpLibrary *library; |
---|
20 | if ((filename == NULL) || (*filename == '\0')) |
---|
21 | library = new RpLibrary(); |
---|
22 | else |
---|
23 | library = new RpLibrary(filename); |
---|
24 | |
---|
25 | if (library->isNull()) |
---|
26 | { |
---|
27 | delete library; |
---|
28 | XSRETURN_UNDEF; |
---|
29 | } |
---|
30 | else |
---|
31 | RETVAL = library; |
---|
32 | OUTPUT: |
---|
33 | RETVAL |
---|
34 | |
---|
35 | void * |
---|
36 | RpLibrary::DESTROY() |
---|
37 | CODE: |
---|
38 | RETVAL = 0; |
---|
39 | |
---|
40 | const char * |
---|
41 | RpLibrary::get( path ) |
---|
42 | char *path |
---|
43 | CODE: |
---|
44 | string result; |
---|
45 | result = THIS->get(path); |
---|
46 | RETVAL = result.c_str(); |
---|
47 | OUTPUT: |
---|
48 | RETVAL |
---|
49 | |
---|
50 | void |
---|
51 | RpLibrary::put( path, value, append ) |
---|
52 | char *path |
---|
53 | char *value |
---|
54 | int append |
---|
55 | CODE: |
---|
56 | THIS->put(path,value,"",append); |
---|
57 | |
---|
58 | void |
---|
59 | RpLibrary::putFile( path, fileName, compress, append ) |
---|
60 | char *path |
---|
61 | char *fileName |
---|
62 | int compress |
---|
63 | int append |
---|
64 | CODE: |
---|
65 | THIS->putFile(path,fileName,compress,append); |
---|
66 | |
---|
67 | void |
---|
68 | RpLibrary::result() |
---|
69 | |
---|
70 | MODULE = Rappture PACKAGE = Rappture::RpUnits |
---|
71 | |
---|
72 | const char * |
---|
73 | convert( fromVal, toUnitsName, showUnits = 1 ) |
---|
74 | const char *fromVal |
---|
75 | const char *toUnitsName |
---|
76 | int showUnits |
---|
77 | CODE: |
---|
78 | string result; |
---|
79 | result = RpUnits::convert(fromVal,toUnitsName,showUnits); |
---|
80 | |
---|
81 | if (result.empty()) |
---|
82 | XSRETURN_UNDEF; |
---|
83 | |
---|
84 | RETVAL = result.c_str(); |
---|
85 | OUTPUT: |
---|
86 | RETVAL |
---|
87 | |
---|
88 | MODULE = Rappture PACKAGE = Rappture::Utils |
---|
89 | |
---|
90 | int |
---|
91 | progress( percent, message ) |
---|
92 | int percent |
---|
93 | const char *message |
---|
94 | CODE: |
---|
95 | RETVAL = Rappture::Utils::progress(percent,message); |
---|
96 | OUTPUT: |
---|
97 | RETVAL |
---|
Note: See
TracBrowser
for help on using the repository browser.