[GRASS-user] GRASS window timing question

Hi,

I’m new to GRASS and am running on a 64-bit Windows-7 OS. The app is working quite well for me overall but I’m having one issue with timing on the GRASS window. I kind of suspect there’s no fix for this but I’ll ask anyway.

I am launching GRASS from a batch file with the GRASS_BATCH_JOB variable set. The batch job just calls g.parser on a text file, like this:

“C:\ProgramFiles\GRASS\bin\g.parser.exe” cmds.txt

The cmds.txt file looks roughly like this:

g.region … parms …
d.mon start=wx0 width=1700 height=1000
…some v.proj commands…
d.vect map=…one of the maps…
d.vect …a few more d.vect commands…

The problem I’m having is this: If the actual display window is not visible when the d.vect commands run, the graphics fail to draw properly and I also get errors in some cases.

If I wait for the display window to appear on the monitor before running the d.vect commands, all is well. This seems logical…something about the display object is not fully initialized when the d.vect commands run so things don’t work.

I do have a workaround, which is just to insert a sleep statement to give the window time to initialize but it needs to be rather long and it would be nice if there were some other way to wait for window initialization.

Is there already a way to do this, or would that be an enhancement request?

Again, thanks for the great app, and thanks in advance if you can help on this question!

Zoltan

Hi Zoltan,

On Wed, Aug 27, 2014 at 10:42 PM, Zoltan <zoltan@sonic.net> wrote:

Hi,

I'm new to GRASS and am running on a 64-bit Windows-7 OS. The app is working
quite well for me overall but I'm having one issue with timing on the GRASS
window. I kind of suspect there's no fix for this but I'll ask anyway.

I am launching GRASS from a batch file with the GRASS_BATCH_JOB variable
set. The batch job just calls g.parser on a text file, like this:

    "C:\ProgramFiles\GRASS\bin\g.parser.exe" cmds.txt

The cmds.txt file looks roughly like this:

    g.region ... parms ...
    d.mon start=wx0 width=1700 height=1000

... here you (still) need a "sleep" command.
We need to implement a queuing mechanism for the command line monitor.

    ...some v.proj commands...
    d.vect map=...one of the maps...
    d.vect ...a few more d.vect commands...

The problem I'm having is this: If the actual display window is not visible
when the d.vect commands run, the graphics fail to draw properly and I also
get errors in some cases.

Yes, because the current implementation of wx0 has a kind of race condition.

We hope that we can address this soon, will keep you posted. It also
affects us :slight_smile:

Markus

is it maybe possible to concatenate commands using “&&”
something like

d.mon … && d.vect …

this should work in bash, don’t know in DOS …

···

Il 27/08/2014 22:42, Zoltan ha scritto:

Hi,

I’m new to GRASS and am running on a 64-bit Windows-7 OS. The app is working quite well for me overall but I’m having one issue with timing on the GRASS window. I kind of suspect there’s no fix for this but I’ll ask anyway.

I am launching GRASS from a batch file with the GRASS_BATCH_JOB variable set. The batch job just calls g.parser on a text file, like this:

“C:\ProgramFiles\GRASS\bin\g.parser.exe” cmds.txt

The cmds.txt file looks roughly like this:

g.region … parms …
d.mon start=wx0 width=1700 height=1000
…some v.proj commands…
d.vect map=…one of the maps…
d.vect …a few more d.vect commands…

The problem I’m having is this: If the actual display window is not visible when the d.vect commands run, the graphics fail to draw properly and I also get errors in some cases.

If I wait for the display window to appear on the monitor before running the d.vect commands, all is well. This seems logical…something about the display object is not fully initialized when the d.vect commands run so things don’t work.

I do have a workaround, which is just to insert a sleep statement to give the window time to initialize but it needs to be rather long and it would be nice if there were some other way to wait for window initialization.

Is there already a way to do this, or would that be an enhancement request?

Again, thanks for the great app, and thanks in advance if you can help on this question!

Zoltan

_______________________________________________
grass-user mailing list
[grass-user@lists.osgeo.org](mailto:grass-user@lists.osgeo.org)
[http://lists.osgeo.org/mailman/listinfo/grass-user](http://lists.osgeo.org/mailman/listinfo/grass-user)