<HTML>
<HEAD>
<TITLE>Re: problema programacion</TITLE>
</HEAD>
<BODY>
<FONT FACE="Skia, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'>Aruizro,<BR>
<BR>
Sorry I didn&#8217;t get your previous message. Possibly caught by my spam filter. I am answering in English this time because it is quicker and perhaps I can explain better. It helps to know that you are running GRASS 5.3<BR>
<BR>
1. When you compile a module in GRASS, it&#8217;s binary needs to go into a directory that can be recognized by a script running in GRASS. Normally, this is either $GISBASE/bin or $GISBASE/scripts. From within tcltkgrass, a program can also be run from $GISBASE/tcltkgrass/module, $GISBASE/tcltkgrass/main, or $GISBASE/tcltkgrass/script. Anything in your system path can also be run. If you are using bash, you can type $PATH from the terminal window to see what is in your system path. To run anything that is not in your system (or GRASS or tcltkgrass) path, you must explicitly supply the path name to it. For example to run the module &#8216;myprogram&#8217; from &nbsp;inside GRASS (i.e., from the GRASS terminal prompt) you can simply type <BR>
<BR>
&gt;myprogram<BR>
<BR>
If my program is located in $GISBASE/bin<BR>
<BR>
However, if myprogram is located in a new directory $GISBASE/mystuff/ you would have to type<BR>
<BR>
&gt;$GISBASE/mystuff/myprogram for it to run<BR>
<BR>
2. $GISBASE is the string substitution for a variable (GISBASE) that holds the path to your GRASS installation. In your case, yes &nbsp;it is /usr/local/grass53. This variable is set automatically by GRASS, but you can change it in your ~/.grassrc5 file. <BR>
<BR>
3. tcltk is a (from my perspective at least) scripting language that is used in GRASS to build a user interface for GRASS commands. In essence, when you select a menu item tcltkgrass, it activates a tcltk script (or a line of a script to be more precise) that calls that program just like you would if you run it manually in the terminal. In GRASS 5.3, you need to do 2 things to 1) create a module for your program (see examples in $GISBASE/tcltkgrass/module) and 2) create an entry in menu.tcl to run your module. There is pretty good documentation for &nbsp;how to do this in the header of the $GISBASE/tcltkgrass/main/gui.tcl file and in the documentation files in $GISBASE/tcltkgrass/docs. Read these and look at some that exist.<BR>
<BR>
4. If you create a new module in GRASS, it must be compiled. When compiled, it produces a binary. I was under the assumption that binaries automatically end up in $GISBASE/bin. If not, I&#8217;m not sure where they end up. I do know that all the GRASS modules called by tcltkgrass are located in $GISBASE/bib, scripts called are located in $GISBASE/scripts; special shellscripts and tcltk script files are located in$GISBASE/tcltkgrass/module, $GISBASE/tcltkgrass/main, or $GISBASE/tcltkgrass/script. My guess is that your module needs to end up in $GISBASE/bin in order to run from tcltkgrass. (though stuff in $GISBASE/etc might also run; I&#8217;d need to recheck the path setting in init.sh)<BR>
<BR>
Espero que eso explica mejor las respuestas a tus preguntas. <BR>
<BR>
Un saludo<BR>
Michael<BR>
<BR>
<BR>
<BR>
On 11/17/04 8:30 AM, &quot;aruizro@unal.edu.co&quot; &lt;aruizro@unal.edu.co&gt; wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Skia, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'><BR>
<BR>
<BR>
&gt; Un saludo Michael, yo te envie un correo la semana pasada y pues <BR>
&gt; no he recibido una respuesta, realmente necesito que me ayudes. <BR>
&gt; Pues la cosa es de urgencia. Que pena tanta molestia, envio a <BR>
&gt; continuaci&oacute;n una copia del mensaje. <BR>
&gt; <BR>
&gt; <BR>
&gt; Muchas Gracias <BR>
&gt; Alejandro <BR>
&gt; <BR>
&gt; ----- Mensaje original ----- <BR>
&gt; De: &lt;aruizro@unal.edu.co&gt; <BR>
&gt; Fecha: Martes, Noviembre 9, 2004 8:07 pm <BR>
&gt; Asunto: Re: problem menu.tcl <BR>
&gt; <BR>
&gt; &gt; Buenos Dias Michael. <BR>
&gt; &gt; <BR>
&gt; &gt; Gracias por tu respuesta. <BR>
&gt; &gt; La versi&oacute;n de Grass que utilizo es 5.3.0. <BR>
&gt; &gt; <BR>
&gt; &gt; Hay algo que todavia no entiendo y que creo que no me has entendido. <BR>
&gt; &gt; <BR>
&gt; &gt; Yo ya tengo mi modulo desarrollado y compilado con su Makefile, <BR>
&gt; &gt; que ademas esta funcionando como yo quiero, desde la terminal. <BR>
&gt; Que <BR>
&gt; &gt; esta guardado en la carpeta /src.contrib. Que lo hice <BR>
&gt; modificando <BR>
&gt; &gt; otro programa C, de un modulo, y que le adicione mi modelo <BR>
&gt; tambien <BR>
&gt; &gt; hecho en C. <BR>
&gt; &gt; Ademas ya modifique el archivo menu.tcl de la carpeta main del <BR>
&gt; &gt; tcltkgrass, y por lo tanto tengo mi interfaz hecha con los <BR>
&gt; mismos <BR>
&gt; &gt; datos que me exige el modulo en la terminal. <BR>
&gt; &gt; El problema es que el modulo r.suelos no se ejecuta bien desde <BR>
&gt; &gt; esta interfaz. <BR>
&gt; &gt; Tengo varias dudas que todavia no entiendo de GRASS. <BR>
&gt; &gt; <BR>
&gt; &gt; 1. Que es el PATH. y su senda.??? <BR>
&gt; &gt; <BR>
&gt; &gt; 2 .La $GISBASE, es la ruta de donde esta compilado el GRASS, es <BR>
&gt; &gt; decir mi $GISBASE, se refiere a mi ruta /usr/local/grass53 ??? o <BR>
&gt; &gt; las carpetas donde por defecto se guarda grass <BR>
&gt; &gt; /opt/src/grass53sources/grass-5.3.0. <BR>
&gt; &gt; <BR>
&gt; &gt; 3. Tu me dices que el script no puede encontrar mi modulo <BR>
&gt; &gt; r.suelos. Cual script? y si es el script de tcltk, como hago <BR>
&gt; para <BR>
&gt; &gt; que encuentre mi modulo. Como especificamente modifico ese <BR>
&gt; script, <BR>
&gt; &gt; para que encuentre mi modulo. <BR>
&gt; &gt; <BR>
&gt; &gt; 4.Ahora, que es lo que debo colocar en las carpetas que tu me <BR>
&gt; &gt; referencias ($GISBASE/bin o $GISBASE/scripts), pues estuve <BR>
&gt; viendo <BR>
&gt; &gt; y por ejemplo en la carpeta bin aparecen archivos de los <BR>
&gt; &gt; modulos,(con sus nombres propios), que son binarios y que no se <BR>
&gt; &gt; como se crean y se ponen a funcionar. <BR>
&gt; &gt; <BR>
&gt; &gt; Que pena tanta molestia, pero no me gusta que mi trabajo no lo <BR>
&gt; &gt; haya podido concluir por esto, creo que no es dificil, pero <BR>
&gt; estoy <BR>
&gt; &gt; confundido en la situacion. <BR>
&gt; &gt; <BR>
&gt; &gt; Realmente agradezco tu ayuda <BR>
&gt; &gt; <BR>
&gt; &gt; Hasta luego <BR>
&gt; &gt; <BR>
&gt; &gt; Alejandro Ruiz Romero. <BR>
&gt; &gt; Estudiante de Ingenieria &nbsp;Agr&iacute;cola <BR>
&gt; &gt; Monitor becario sala SIG. <BR>
&gt; &gt; Departamento de Ingenieria Civil y Agr&iacute;cola <BR>
&gt; &gt; Universidad Nacional de Colombia - Sede Bogot&aacute;. <BR>
&gt; &gt; Tel. 3165000 ext. 16605. <BR>
&gt; &gt; <BR>
&gt; &gt; <BR>
&gt; &gt; ----- Original Message ----- <BR>
&gt; &gt; From: Michael Barton &lt;michael.barton@asu.edu&gt; <BR>
&gt; &gt; Date: Saturday, November 6, 2004 10:06 pm <BR>
&gt; &gt; Subject: Re: problem menu.tcl <BR>
&gt; &gt; <BR>
&gt; &gt; &gt; <BR>
&gt; &gt; &gt; <BR>
&gt; &gt; &gt; <BR>
&gt; &gt; &gt; On 11/6/04 10:33 AM, &quot;aruizro@unal.edu.co&quot; <BR>
&gt; &lt;aruizro@unal.edu.co&gt; <BR>
&gt; &gt; &gt; wrote: <BR>
&gt; &gt; &gt; &gt; Gracias por la respuesta, pero no entiendo algo de lo que me <BR>
&gt; &gt; &gt; dice, dentro del <BR>
&gt; &gt; &gt; &gt; script &nbsp;&quot;init.sh&quot; estan la inicializacion del grass como <BR>
&gt; tal, <BR>
&gt; &gt; o <BR>
&gt; &gt; &gt; eso es lo que <BR>
&gt; &gt; &gt; &gt; entiendo. <BR>
&gt; &gt; &gt; <BR>
&gt; &gt; &gt; Es un script que aparece bastante complicado pero el major <BR>
&gt; parte <BR>
&gt; &gt; solo&gt; averig&uuml;a la sistema, la existencia de las carpetas <BR>
&gt; corectas, <BR>
&gt; &gt; etc.&gt; <BR>
&gt; &gt; &gt; Para empezar un menu de tcltk, seria mas ayudoso mirar el <BR>
&gt; script <BR>
&gt; &gt; &gt; tcltkgrassque mencion&eacute;. <BR>
&gt; &gt; &gt; <BR>
&gt; &gt; &gt; &gt; Eso me sirve, pero es que no he podido entender, es como <BR>
&gt; &gt; teniendo <BR>
&gt; &gt; &gt; yo mi <BR>
&gt; &gt; &gt; &gt; interface, con mis menus y submenus, y mi modulo (r.suelos), <BR>
&gt; &gt; que <BR>
&gt; &gt; &gt; tiene unos <BR>
&gt; &gt; &gt; &gt; datos de entrada, que este caso son mapas raster. Puede <BR>
&gt; hacer <BR>
&gt; &gt; que <BR>
&gt; &gt; &gt; lo mismo que <BR>
&gt; &gt; &gt; &gt; me hace desde una terminal (xterm), lo pueda hacer desde <BR>
&gt; esta <BR>
&gt; &gt; &gt; interfaz, cuando <BR>
&gt; &gt; &gt; &gt; yo le doy los datos de entrada y salida , y le doy ejecutar <BR>
&gt; me <BR>
&gt; &gt; &gt; sale un error <BR>
&gt; &gt; &gt; &gt; &quot;Couldn't execute &quot;r.suelos&quot;:no such file or directory&quot;. <BR>
&gt; &gt; &gt; <BR>
&gt; &gt; &gt; El problema aqui es que el script (de tcltk supongo) no puede <BR>
&gt; &gt; &gt; encontrar el <BR>
&gt; &gt; &gt; modulo r.suelos. Hay que estar en la senda (&quot;PATH&quot;). Si va <BR>
&gt; bien <BR>
&gt; &gt; los <BR>
&gt; &gt; &gt; otrosmodulos, pongalo en la carpeta de $GISBASE/bin o <BR>
&gt; &gt; &gt; $GISBASE/scripts. Esas <BR>
&gt; &gt; &gt; carpetas estan en la senda de iniciaci&oacute;n. <BR>
&gt; &gt; &gt; <BR>
&gt; &gt; &gt; &gt; Mas o menos lo que <BR>
&gt; &gt; &gt; &gt; pregunto seria algo asi como un subtitulo en un tutorial. <BR>
&gt; &gt; &quot;Pasos <BR>
&gt; &gt; &gt; para generar <BR>
&gt; &gt; &gt; &gt; un modulo en grass, con ejecucion desde terminal e interfaz <BR>
&gt; &gt; grafica&quot;&gt; &gt; <BR>
&gt; &gt; &gt; &gt; Yo creia que se hacia desde la programacion de menu.tcl pero <BR>
&gt; &gt; no <BR>
&gt; &gt; &gt; me sale bien, <BR>
&gt; &gt; &gt; &gt; pueda que este haciendo algo mal. <BR>
&gt; &gt; &gt; <BR>
&gt; &gt; &gt; Creo que la mejora manera de empezar es solo editar el <BR>
&gt; menu.tcl <BR>
&gt; &gt; que ya <BR>
&gt; &gt; &gt; existe y funciona bien. Copia una linea que ya existe y <BR>
&gt; &gt; cambiarla para <BR>
&gt; &gt; &gt; iniciar su m&oacute;dulo al mismo menu.tcl para una pueba. Si va <BR>
&gt; bien, <BR>
&gt; &gt; puedas&gt; cambiar algo mas. Opino que es mejor que hacer un <BR>
&gt; interfaz <BR>
&gt; &gt; de nuevo. <BR>
&gt; &gt; &gt; <BR>
&gt; &gt; &gt; Una pregunta. &iquest;Qual version de GRASS usas? <BR>
&gt; &gt; &gt; <BR>
&gt; &gt; &gt; Michael <BR>
&gt; &gt; &gt; <BR>
&gt; &gt; &gt; &gt; <BR>
&gt; &gt; &gt; &gt; Agradezco su atencion y tiempo. <BR>
&gt; &gt; &gt; &gt; <BR>
&gt; &gt; &gt; &gt; <BR>
&gt; &gt; &gt; &gt; Alejandro Ruiz Romero. <BR>
&gt; &gt; &gt; &gt; Estudiante de Ingenieria &nbsp;Agr&iacute;cola <BR>
&gt; &gt; &gt; &gt; Monitor becario sala SIG. <BR>
&gt; &gt; &gt; &gt; Departamento de Ingenieria Civil y Agr&iacute;cola <BR>
&gt; &gt; &gt; &gt; Universidad Nacional de Colombia - Sede Bogot&aacute;. <BR>
&gt; &gt; &gt; &gt; Tel. 3165000 ext. 16605. <BR>
&gt; &gt; &gt; <BR>
&gt; &gt; &gt; ____________________ <BR>
&gt; &gt; &gt; C. Michael Barton, Professor of Anthropology <BR>
&gt; &gt; &gt; School of Human, Cultural, and Social Change <BR>
&gt; &gt; &gt; PO Box 872402 <BR>
&gt; &gt; &gt; Arizona State University <BR>
&gt; &gt; &gt; Tempe, AZ &nbsp;85287-2402 <BR>
&gt; &gt; &gt; USA <BR>
&gt; &gt; &gt; <BR>
&gt; &gt; &gt; Phone: 480-965-6262 <BR>
&gt; &gt; &gt; Fax: 480-965-7671 <BR>
&gt; &gt; &gt; www: &lt;www.public.asu.edu/~cmbarton&gt; <BR>
&gt; &gt; &gt; <BR>
&gt; &gt; &gt; <BR>
&gt; &gt; <BR>
&gt; <BR>
&gt; <BR>
<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Skia, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:12.0px'><BR>
<BR>
____________________<BR>
C. Michael Barton, Professor of Anthropology<BR>
School of Human Evolution and Social Change<BR>
PO Box 872402<BR>
Arizona State University<BR>
Tempe, AZ &nbsp;85287-2402<BR>
USA<BR>
<BR>
Phone: 480-965-6262<BR>
Fax: 480-965-7671<BR>
www: &lt;www.public.asu.edu/~cmbarton&gt;<BR>
</SPAN></FONT>
</BODY>
</HTML>