[GRASS-dev] ganim troubles in latest cvs

Just rebuilt with:

    # regexp {nsres= *([0-9]+)} $region dummy oldres1
    # regexp {ewres= *([0-9]+)} $region dummy oldres2
    # regexp {rows= *([0-9]+)} $region dummy vrows
    # regexp {cols= *([0-9]+)} $region dummy vcols

     set reglist [split $region "\n"]

     foreach line $reglist {
         set line [string trim $line]
         set key [lindex [split $line "="] 0]
         switch $key {
             nsres {set oldres1 [lindex [split $line "="] 1]}
             ewres {set oldres2 [lindex [split $line "="] 1]}
             rows {set vrows [lindex [split $line "="] 1]}
             cols {set vcols [lindex [split $line "="] 1]}
         }

     }

Here is the new error (upon starting GmAnim):

invalid command name "Proc"
     while executing
"Proc GmAnim::do_run {} {
     # procedure that displays maps in an animation and controls the animation
     global loop
     global swing
     global a..."
     (file "/Applications/GRASS-6.3.app/Contents/MacOS/etc/gm/animate.tcl" line 635)
     invoked from within
"source /Applications/GRASS-6.3.app/Contents/MacOS/etc/gm/animate.tcl"
     (in namespace eval "::" script line 1)
     invoked from within
"namespace eval :: $auto_index($name)"
     (procedure "auto_load" line 13)
     invoked from within
"auto_load $name [uplevel 1 {::namespace current}]"
     (autoloading "GmAnim::main")
     invoked from within
"GmAnim::main"
     ("uplevel" body line 1)
     invoked from within
"uplevel \#0 $cmd"
     (procedure "Button::_release" line 18)
     invoked from within
"Button::_release .mainframe.topf.tb1.bbox4.b0"
     (command bound to event)

On Oct 1, 2007, at 9:17 PM, Michael Barton wrote:

Kirk,

You seem to be missing a line (maybe my fault). Note the line defining
reglist.

Michael

    set reglist [split $region "\n"]

    foreach line $reglist {
        set line [string trim $line]
        set key [lindex [split $line "="] 0]
        switch $key {
            nsres {set oldres1 [lindex [split $line "="] 1]}
            ewres {set oldres2 [lindex [split $line "="] 1]}
            rows {set vrows [lindex [split $line "="] 1]}
            cols {set vcols [lindex [split $line "="] 1]}
        }

    }

On 10/1/07 6:36 AM, "Kirk Wythers" <kwythers@umn.edu> wrote:

On Sep 30, 2007, at 11:23 PM, Michael Barton wrote:

Well, after asking for help, I figured out how to this without the
dread
regexp ;-). This might even be a bit better routine.

Anyway, I can't commit this because I'm out of town, but if anyone
wants to
try it, you need to change lines in procedure GmAnim::main (module
animate.tcl). Replace the commented lines with the uncommented
lines below.

    foreach line $reglist {
        set line [string trim $line]
        set key [lindex [split $line "="] 0]
        switch $key {
            nsres {set oldres1 [lindex [split $line "="] 1]}
            ewres {set oldres2 [lindex [split $line "="] 1]}
            rows {set vrows [lindex [split $line "="] 1]}
            cols {set vcols [lindex [split $line "="] 1]}
        }

    }

# regexp {nsres= *([0-9]+)} $region dummy oldres1
# regexp {ewres= *([0-9]+)} $region dummy oldres2
# regexp {rows= *([0-9]+)} $region dummy vrows
# regexp {cols= *([0-9]+)} $region dummy vcols

Michael,

Thanks for the email. I made the following changes but ended up with
a new error. I might have altered the wrong file. Here is what I tried.

From the file ~/src_intel/grass-6.3.cvs/gui/tcltk/gis.m/animate.tcl

     # set initial canvas geometry to match region
     if {[catch {set region [exec g.region -ugp]} error]} {
         Gm::errmsg $error
     }

    # regexp {nsres= *([0-9]+)} $region dummy oldres1
    # regexp {ewres= *([0-9]+)} $region dummy oldres2
    # regexp {rows= *([0-9]+)} $region dummy vrows
    # regexp {cols= *([0-9]+)} $region dummy vcols

     foreach line $reglist {
         set line [string trim $line]
         set key [lindex [split $line "="] 0]
         switch $key {
             nsres {set oldres1 [lindex [split $line "="] 1]}
             ewres {set oldres2 [lindex [split $line "="] 1]}
             rows {set vrows [lindex [split $line "="] 1]}
             cols {set vcols [lindex [split $line "="] 1]}
         }

     }

New error when startring up GmAnim.

can't read "reglist": no such variable
     while executing
"foreach line $reglist {
         set line [string trim $line]
         set key [lindex [split $line "="] 0]
         switch $key {
             nsres {..."
     (procedure "GmAnim::main" line 28)
     invoked from within
"GmAnim::main"
     ("uplevel" body line 1)
     invoked from within
"uplevel \#0 $cmd"
     (procedure "Button::_release" line 18)
     invoked from within
"Button::_release .mainframe.topf.tb1.bbox4.b0"
     (command bound to event)

Perhaps this is not what you intended?

Kirk

__________________________________________
Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

Kirk Wythers wrote:

Just rebuilt with:

    # regexp {nsres= *([0-9]+)} $region dummy oldres1
    # regexp {ewres= *([0-9]+)} $region dummy oldres2
    # regexp {rows= *([0-9]+)} $region dummy vrows
    # regexp {cols= *([0-9]+)} $region dummy vcols

     set reglist [split $region "\n"]

     foreach line $reglist {
         set line [string trim $line]
         set key [lindex [split $line "="] 0]
         switch $key {
             nsres {set oldres1 [lindex [split $line "="] 1]}
             ewres {set oldres2 [lindex [split $line "="] 1]}
             rows {set vrows [lindex [split $line "="] 1]}
             cols {set vcols [lindex [split $line "="] 1]}
         }

     }

Here is the new error (upon starting GmAnim):

invalid command name "Proc"
invalid command name "Proc"
     while executing
"Proc GmAnim::do_run {} {
     # procedure that displays maps in an animation and controls the animation
     global loop
     global swing
     global a..."
     (file "/Applications/GRASS-6.3.app/Contents/MacOS/etc/gm/animate.tcl" line 635)

That's something which has occurred at your end. The source file in
CVS has "proc" in lower case.

--
Glynn Clements <glynn@gclements.plus.com>

Can you clarify? Are you saying that even after "make distclean" and
"configure", the problem with d.m.html doesn't always occur?

No it doesn't, I was clarifying that before the error occurred the first time I had done "make distclean".

Now I can compile with no errors but

Generated HTML docs in ../dist.i686-apple-darwin8.10.1/docs/html/index.html
----------------------------------------------------------------------
Following modules are missing the 'description.html' file in src code:
d.m
----------------------------------------------------------------------
GRASS GIS compilation log
-------------------------
Started compilation: Tue Oct 2 15:59:30 CEST 2007
--
Errors in:
No errors detected.

--
Glynn Clements <glynn@gclements.plus.com>

Thanks to everyone who has responded to my GmAnim problem. Here is the latest.

Suspecting that I had other issues in the src, I dumped the source, re-downloaded new source from cvs, and ran update -dP.

Then I commented out the regex and added Michael's code:

    # set initial canvas geometry to match region
     if {[catch {set region [exec g.region -ugp]} error]} {
         Gm::errmsg $error
     }

     #regexp {nsres= *([0-9]+)} $region dummy oldres1
     #regexp {ewres= *([0-9]+)} $region dummy oldres2
     #regexp {rows= *([0-9]+)} $region dummy vrows
     #regexp {cols= *([0-9]+)} $region dummy vcols

     set reglist [split $region "\n"]

     foreach line $reglist {
         set line [string trim $line]
         set key [lindex [split $line "="] 0]
         switch $key {
             nsres {set oldres1 [lindex [split $line "="] 1]}
             ewres {set oldres2 [lindex [split $line "="] 1]}
             rows {set vrows [lindex [split $line "="] 1]}
             cols {set vcols [lindex [split $line "="] 1]}
         }

     }

Presently GmAnim runs (using the same 30s raster from the worldclim database). However I do notice that several of the buttons on the animation window are broken, including the "exit" button, which gives this error:

WARNING: <tmpanimregion541> nothing removed
     while executing
"exec g.remove region=$tmpregion --q"
     (procedure "GmAnim::cmd_exit" line 21)
     invoked from within
"GmAnim::cmd_exit"
     (command bound to event)

As an odd sidenote, the older version of GmAnim (before the animation window was updated to have buttons on the top of the window) worked fine with:

  regexp {nsres= *([0-9]+)} $region dummy oldres1
  regexp {ewres= *([0-9]+)} $region dummy oldres2
  regexp {rows= *([0-9]+)} $region dummy vrows
  regexp {cols= *([0-9]+)} $region dummy vcols

Kirk Wythers wrote:

Thanks to everyone who has responded to my GmAnim problem. Here is
the latest.
...

Sorry for a stupid comment: why not working with patches
against CVS? The current approach seems to be a bit "lossy".

patch/diff is fairly easy to use (see SUBMITTING in the main
source code directory).

Markus
--
View this message in context: http://www.nabble.com/ganim-troubles-in-latest-cvs-tf4535542.html#a13000761
Sent from the Grass - Dev mailing list archive at Nabble.com.

On Oct 2, 2007, at 10:11 AM, Markus Neteler wrote:

Sorry for a stupid comment: why not working with patches
against CVS? The current approach seems to be a bit "lossy".

patch/diff is fairly easy to use (see SUBMITTING in the main
source code directory).

No worries on the comment. I'll look at SUBMITTING.

My only excuse is that on a fast connection and a fast processor, the "lossy" solution takes less than 10 minutes and then I'm sure that all of my potential personal screw ups are gone :wink:

On 10/2/07 7:55 AM, "Kirk Wythers" <kwythers@umn.edu> wrote:

Presently GmAnim runs (using the same 30s raster from the worldclim
database). However I do notice that several of the buttons on the
animation window are broken, including the "exit" button, which gives
this error:

WARNING: <tmpanimregion541> nothing removed
WARNING: <tmpanimregion541> nothing removed
     while executing
"exec g.remove region=$tmpregion --q"
     (procedure "GmAnim::cmd_exit" line 21)
     invoked from within
"GmAnim::cmd_exit"
     (command bound to event)

The warning is just that, not an error. But I don't know what is causing
this. I'll look into it.

As an odd sidenote, the older version of GmAnim (before the animation
window was updated to have buttons on the top of the window) worked
fine with:

  regexp {nsres= *([0-9]+)} $region dummy oldres1
  regexp {ewres= *([0-9]+)} $region dummy oldres2
  regexp {rows= *([0-9]+)} $region dummy vrows
  regexp {cols= *([0-9]+)} $region dummy vcols

The very first version that was disseminated, was written by Glynn as a
prototype TclTk replacement for Xganim. When I incorporated it into the
overall TclTk GUI, I had to change aspects of how it operated--though not
this part. These statements work fine with integer-level resolutions (e.g.,
1m, 30m), but seem to have problems with resolutions that are floating
point. I'm sure that the regexp statements could be changed to deal with FP
data, but I don't know how to do it. So I accomplished this by another
route.

Michael

__________________________________________
Michael Barton, Professor of Anthropology
Director of Graduate Studies
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

Agustin Diez Castillo wrote:

> Can you clarify? Are you saying that even after "make distclean" and
> "configure", the problem with d.m.html doesn't always occur?
No it doesn't, I was clarifying that before the error occurred the
first time I had done "make distclean".

Now I can compile with no errors but

Generated HTML docs in ../dist.i686-apple-darwin8.10.1/docs/html/
index.html
----------------------------------------------------------------------
Following modules are missing the 'description.html' file in src code:
d.m

That message indicates that d.m.html was found but is missing the
DESCRIPTION section.

FWIW, I've since changed the way that the HTML files are generated;
pattern rules are no longer used. I don't know if this will actually
fix the problem, though.

--
Glynn Clements <glynn@gclements.plus.com>