Question regarding GUI Scrits frame

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Question regarding GUI Scrits frame

Jenny Turner
Greetings
 
I'm new at GRASS and I have been developing a few scripts toGRASS but I have afewquestions regarding  Scripts wxpython frame (the one defined by %MODULE):
- I want usersto input a value in an OPTION regarding a parameter (e.g. a string or a number). ==> This is EASY. But, I also want to compute the input, automatically, before I run my scritpt, in order to provide a list of possible values in other OPTION
e.g. in option "Parameter" the users put a value (e.g. Vegetation). Automatically a small processa is run in order to provide a list of possible values for Option "value". And then, users will be able to choose "Values" options that is e.g. 100,10, 0etc". Only after this values were inserted is possible to run the script.
This seems complex but my question is: is it possible to run a function, while I'm inserting values in scripts, and all this before I run the script?
 
Best tregagrds
Jenny

_______________________________________________
grass-gui mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-gui
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Question regarding GUI Scrits frame

Glynn Clements

Jenny Turner wrote:

> I'm new at GRASS and I have been developing a few scripts toGRASS but I have
> afewquestions regarding  Scripts wxpython frame (the one defined by
> %MODULE):
> - I want usersto input a value in an OPTION regarding a parameter (e.g. a
> string or a number). ==> This is EASY. But, I also want to compute the
> input, automatically, before I run my scritpt, in order to provide a list of
> possible values in other OPTION
> e.g. in option "Parameter" the users put a value (e.g. Vegetation).
> Automatically a small processa is run in order to provide a list of possible
> values for Option "value". And then, users will be able to choose "Values"
> options that is e.g. 100,10, 0etc". Only after this values were inserted is
> possible to run the script.
> This seems complex but my question is: is it possible to run a function,
> while I'm inserting values in scripts, and all this before I run the script?

There isn't any straightforward way to do this. Possible solutions
include dynamically creating a script with the appropriate options,
by-passing g.parser and creating the UI yourself, or (in 6.5 and 7.0)
generating a dummy script containing only the parameter details,
invoking "g.parser -s ..." on that, and parsing the output (this is
easier to do in Python than in a shell script).

--
Glynn Clements <[hidden email]>
_______________________________________________
grass-gui mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/grass-gui
Loading...