[GRASS5] XDRIVER and redraw - suggestion

Hi,

while on the one hand the redraw function of XDRIVER is nice,
it can become rather annoying with large maps (say, 500MB-1GB
remote sensing data).

What about following suggestion: the XDRIVER reads the environmental
variable
XDRIVER_MAX_NREDRAW
which defines the maximal number of maps kept in the monitor
list. If not defined, no limitation, if defined, the user
can specify the maximum numbers of maps to be redrawn. Inthis
case the XDRIVER forgets about the older drawn maps.

It would be nice to have this optional variable.

Markus

Markus Neteler wrote:

while on the one hand the redraw function of XDRIVER is nice,
it can become rather annoying with large maps (say, 500MB-1GB
remote sensing data).

What about following suggestion: the XDRIVER reads the environmental
variable
XDRIVER_MAX_NREDRAW
which defines the maximal number of maps kept in the monitor
list. If not defined, no limitation, if defined, the user
can specify the maximum numbers of maps to be redrawn. Inthis
case the XDRIVER forgets about the older drawn maps.

It would be nice to have this optional variable.

Note that XDRIVER doesn't know anything about "maps"; it just has a
list of commands which it runs whenever the monitor is resized.
Determining which commands constitute a "map" and which don't isn't
straightforward; "d.rast" isn't the only command which draws maps.

Ultimately the XDRIVER resize kludge is just a quick workaround to
compensate for the absence of an interactive UI. Realistically, the
monitors should just be dumb graphic "devices"; state management
belongs elsewhere (the fact that, currently, there isn't a suitable
"elsewhere" doesn't doesn't change that).

If the command list is getting too long, use "d.erase".

--
Glynn Clements <glynn.clements@virgin.net>

Hi Glynn,

On Wed, Jan 30, 2002 at 05:31:26PM +0000, Glynn Clements wrote:

Markus Neteler wrote:

> while on the one hand the redraw function of XDRIVER is nice,
> it can become rather annoying with large maps (say, 500MB-1GB
> remote sensing data).
>
> What about following suggestion: the XDRIVER reads the environmental
> variable
> XDRIVER_MAX_NREDRAW
> which defines the maximal number of maps kept in the monitor
> list. If not defined, no limitation, if defined, the user
> can specify the maximum numbers of maps to be redrawn. Inthis
> case the XDRIVER forgets about the older drawn maps.
>
> It would be nice to have this optional variable.

Note that XDRIVER doesn't know anything about "maps"; it just has a
list of commands which it runs whenever the monitor is resized.
Determining which commands constitute a "map" and which don't isn't
straightforward; "d.rast" isn't the only command which draws maps.

yes, agreed.

Ultimately the XDRIVER resize kludge is just a quick workaround to
compensate for the absence of an interactive UI. Realistically, the
monitors should just be dumb graphic "devices"; state management
belongs elsewhere (the fact that, currently, there isn't a suitable
"elsewhere" doesn't doesn't change that).

also agreed.

If the command list is getting too long, use "d.erase".

Mhh, that's not unknown to me - but still inconvenient to be
the only way to solve the problem. The proposed variable would
change nothing for the standard behaviour of the monitor but
allows in (our?) particular case to improve the situation unless
a new, great system is written.

Probably you can think again about the idea? :slight_smile:

Thanks,

Markus

Markus Neteler wrote:

> If the command list is getting too long, use "d.erase".

Mhh, that's not unknown to me - but still inconvenient to be
the only way to solve the problem. The proposed variable would
change nothing for the standard behaviour of the monitor but
allows in (our?) particular case to improve the situation unless
a new, great system is written.

Probably you can think again about the idea? :slight_smile:

Well, it wouldn't be hard to limit the number of commands which are
executed. That's not the same thing as the number of maps, but it
would probably suffice if the user is just running e.g. d.rast
repeatedly.

--
Glynn Clements <glynn.clements@virgin.net>

Markus Neteler wrote:

Hi Glynn,

On Wed, Jan 30, 2002 at 05:31:26PM +0000, Glynn Clements wrote:

Markus Neteler wrote:

while on the one hand the redraw function of XDRIVER is nice,
it can become rather annoying with large maps (say, 500MB-1GB
remote sensing data).

What about following suggestion: the XDRIVER reads the environmental
variable
XDRIVER_MAX_NREDRAW
which defines the maximal number of maps kept in the monitor
list. If not defined, no limitation, if defined, the user
can specify the maximum numbers of maps to be redrawn. Inthis
case the XDRIVER forgets about the older drawn maps.

It would be nice to have this optional variable.

Note that XDRIVER doesn't know anything about "maps"; it just has a
list of commands which it runs whenever the monitor is resized. Determining which commands constitute a "map" and which don't isn't
straightforward; "d.rast" isn't the only command which draws maps.

yes, agreed.

Ultimately the XDRIVER resize kludge is just a quick workaround to
compensate for the absence of an interactive UI. Realistically, the
monitors should just be dumb graphic "devices"; state management
belongs elsewhere (the fact that, currently, there isn't a suitable
"elsewhere" doesn't doesn't change that).

also agreed.

If the command list is getting too long, use "d.erase".

Mhh, that's not unknown to me - but still inconvenient to be
the only way to solve the problem. The proposed variable would
change nothing for the standard behaviour of the monitor but
allows in (our?) particular case to improve the situation unless
a new, great system is written.

Probably you can think again about the idea? :slight_smile:

Thanks,

Markus

Hi Glynn & Markus,

Sorry about wading into this one a bit late, but I have been away for the last week.

A couple of questions that I have for the auto-redraw (which is a great feature) are:

(i) Is it possible check for duplicate draw commands and only execute the last one. For example I often draw rectified air photos repetitively on top of each other to examine changes. If I then resize the monitor it then re-executes each of the draw commands, even though they are identical.

(ii) The solution to all of this might simply be some sort of cancel command (d.cancel) that kills the current draw execution. In Markus's example of drawing a large image, the draw could be cancelled saving a bit of time. Currently if I want to kill a draw command I have to get the procees ID and execute kill. This may be over-complicated but worth considering??

--
Bob Covill

Tekmap Consulting
P.O. Box 2016 Fall River, N.S.
B2T 1K6
Canada

E-Mail: bcovill@tekmap.ns.ca
Phone: 902-860-1496
Fax: 902-860-1498

Bob Covill wrote:

Sorry about wading into this one a bit late, but I have been away for
the last week.

A couple of questions that I have for the auto-redraw (which is a great
feature) are:

(i) Is it possible check for duplicate draw commands and only execute
the last one. For example I often draw rectified air photos repetitively
on top of each other to examine changes. If I then resize the monitor it
then re-executes each of the draw commands, even though they are identical.

Can we be sure that consecutive identical command strings are always
redundant? Suppose that d.zoom could be run non-interactively; the
sequence:

  d.zoom zoom=1.2
  d.zoom zoom=1.2

would be equivalent to "d.zoom zoom=1.44" and not "d.zoom zoom=1.2".

(ii) The solution to all of this might simply be some sort of cancel
command (d.cancel) that kills the current draw execution. In Markus's
example of drawing a large image, the draw could be cancelled saving a
bit of time. Currently if I want to kill a draw command I have to get
the procees ID and execute kill. This may be over-complicated but worth
considering??

Actually, I think that the solution is to scrap the auto-redraw. It
was a quick hack which has created more problems than it solved. My
initial instinct was that this was a bad idea; I guess I should have
followed it.

A better approach might be to add a "resize" opcode to the monitor
protocol, and write a "d.resize" program. Such a program could
implement various optional behaviours regarding what happens to the
window after resizing, e.g. erase it, blindly redraw it using the
results from d.save, or attempt a more intelligent redraw.

It would also eliminate the problems regarding WM bugs, as the window
wouldn't support interactive resizing. And it would work on all
drivers, not just XDRIVER.

More importantly, it decouples the monitor from the session in which
it was started, and from GRASS in general. GRASS (i.e. libraster)
would still need to know about monitors, but the monitors would return
to the state of not needing to know anything about GRASS.

Beyond that, I think that there really needs to be some form of user
interface, with persistent state. Spawning a shell doesn't really seem
to work, and most of what has been done to try to make it work just
messes things up. In turn, this just makes it harder to build
something useful on top it.

A more useful command line interface would have its own "display
state", consisting "layers" (i.e. arbitrary d.* commands), with
commands to add, remove, replace, move (change the order of) and
enable/disable layers, save/load the state, etc.

The monitor drivers and the d.* commands would then just be "dumb"
programs, which makes them significantly more useful to other
programs; trying to control "intelligent" programs from another
program is a lot harder than controlling "dumb" ones (compare writing
"expect" scripts to conventional shell scripts).

--
Glynn Clements <glynn.clements@virgin.net>

Hello all,

I have successfully built and tested Grass 5.0 pre 3, NVIZ, etc. on Mac OS X (Darwin 5.1).

I just started uploading the binaries to grass.itc.it in the incoming directory.

There is something new that was not happening with previous builds: When I execute tcltkgrass I get the following message:

GRASS 5.0.0pre3 > called create main window
  assigning interp 714928
  tsd is 756320 datakey 756320
  tsdptr 756320 datakey 756320
  start search mainPtr 798816
look for 714928 got 714928
  tsdptr 756320 datakey 756320
  start search mainPtr 798816
look for 714928 got 714928
  tsdptr 756320 datakey 756320
  start search mainPtr 798816
look for 714928 got 714928
  tsdptr 756320 datakey 756320
  start search mainPtr 798816

This goes on and on for about a couple hundred more lines.

Is there a way to deactivate this "feature"? Is Pre 3 being generated with debugging on or something? It does not seem to harm anything, just a bit a of a nuisance.

BTW: This build is 122 MB again, I cannot seem to make it smaller, the Pre 2 binaries are 50 MB...

Cheers,

Jeshua Lacock __________________________
Programmer/Owner Phone: 760.935.4736
http://OpenOSX.com Fax: 760.935.4845
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

Jeshua Lacock wrote:

I have successfully built and tested Grass 5.0 pre 3, NVIZ, etc. on Mac
OS X (Darwin 5.1).

I just started uploading the binaries to grass.itc.it in the incoming
directory.

There is something new that was not happening with previous builds: When
I execute tcltkgrass I get the following message:

GRASS 5.0.0pre3 > called create main window
  assigning interp 714928
  tsd is 756320 datakey 756320
  tsdptr 756320 datakey 756320
  start search mainPtr 798816
look for 714928 got 714928
  tsdptr 756320 datakey 756320
  start search mainPtr 798816
look for 714928 got 714928
  tsdptr 756320 datakey 756320
  start search mainPtr 798816
look for 714928 got 714928
  tsdptr 756320 datakey 756320
  start search mainPtr 798816

This looks like it's being generated by wish itself. I can't see
anything in the tcltkgrass code which would generate it, and it
doesn't happen on Linux.

BTW: This build is 122 MB again, I cannot seem to make it smaller, the
Pre 2 binaries are 50 MB...

Try "make strip". The binaries are no longer stripped automatically.

--
Glynn Clements <glynn.clements@virgin.net>