[winGRASS] Re: generic Windows GRASS driver

Mike Thomas miketh at brisbane.paradigmgeo.com
Mon Sep 24 03:08:35 EDT 2001


Hi all.

I am now getting two types of behaviour depending on whether I use sleep ()
in my debugging code.  Example debug output is appended which shows, for
each case, what happens when I execute the commands

  d.mon x0
  d.mon stop=x0

The code is compiled in __W98__ mode as present in CVS - Malcolm's original
patch.

This behaviour harks back to earlier discussions about inserting waits for
socket connections.

Where would the best place for a wait be?

Why would the monitor screen disappear, leaving a running background
process, when the commands associated with "d.mon select=x0" is executed? (I
believe that the BEGIN command is the point at which the window dies).

I would have expected a crash to kill the process as well as the window.

Cheers

Mike Thomas

----------------------------------------------------------------------------
---------------------------

Case 1.  When I have sleep() embedded in my debugging code, "d.mon x0" gives
a monitor window which hangs around waiting for commands and stops when sent
"d.mon stop=x0".  The debug output is as follows:

----------------------------------------------------------------------------
----------------------
GRASS:~ > d.mon x0

DRIVER main: argv0 = x0
DRIVER main: foreground = 0  param = 1
Socket is already in use or not accepting connections.
Use d.mon to select a monitor
Problem selecting x0. Will try once more
Socket is already in use or not accepting connections.
Use d.mon to select a monitor
GRASS:~ > using default visual which is PseudoColor
ncolors: 252
Graphics driver [x0] started - __W98__
DRIVER main: In while, before get_connection_sock and Do_work(0) loop.
Service_Xevent: In ConfigureNotify branch

GRASS:~ > d.mon stop=x0

DRIVER main: Exited loop - Now before command_init
DRIVER main: before Client_Open
Service_Xevent: In ConfigureNotify branch
Service_Xevent: In ConfigureNotify branch
DRIVER main: before process_command c = 46 (BEGIN)
DRIVER main: before process_command c = 11 (GRAPH_CLOSE)
Monitor 'x0' terminated


----------------------------------------------------------------------------
-----------------------

Case 2. When I don't use sleep(), I get a monitor window, which immediately
disappears, leaving a background task which responds to commands but never
displays anything. A bunch of commands are processed at startup, which seem
to be absent in the other example.  Those commands are exactly the same set
of commands executed after "d.mon select=x0".


----------------------------------------------------------------------------
-----------------------

GRASS:~ > d.mon x0

DRIVER main: argv0 = x0
DRIVER main: foreground = 0  param = 1
using default visual which is PseudoColor
ncolors: 252
Graphics driver [x0] started - __W98__
DRIVER main: In while, before get_connection_sock and Do_work(0) loop.
Service_Xevent: In ConfigureNotify branch
Socket is already in use or not accepting connections.
Use d.mon to select a monitor
Problem selecting x0. Will try once more
DRIVER main: Exited loop - Now before command_init
DRIVER main: before Client_Open
Service_Xevent: In ConfigureNotify branch
Service_Xevent: In ConfigureNotify branch
DRIVER main: before process_command c = 46 (BEGIN)
DRIVER main: before process_command c = 44 (FONT)
DRIVER main: before process_command c = 66 (PAD_SELECT)
DRIVER main: before process_command c = 73 (PAD_GET_ITEM)
DRIVER main: before process_command c = 28 (SCREEN_TOP)
DRIVER main: before process_command c = 27 (SCREEN_BOT)
DRIVER main: before process_command c = 25 (SCREEN_LEFT)
DRIVER main: before process_command c = 26 (SCREEN_RITE)
DRIVER main: before process_command c = 61 (PAD_CREATE)
DRIVER main: before process_command c = 66 (PAD_SELECT)
DRIVER main: before process_command c = 62 (PAD_CURRENT)
DRIVER main: before process_command c = 66 (PAD_SELECT)
DRIVER main: before process_command c = 73 (PAD_GET_ITEM)
DRIVER main: before process_command c = 75 (PAD_SET_ITEM)
DRIVER main: before process_command c = 66 (PAD_SELECT)
DRIVER main: before process_command c = 75 (PAD_SET_ITEM)
DRIVER main: before process_command c = 75 (PAD_SET_ITEM)
DRIVER main: before process_command c = 73 (PAD_GET_ITEM)
DRIVER main: before process_command c = 47 (STANDARD_COLOR)
DRIVER main: before process_command c = 13 (MOVE_ABS)
DRIVER main: before process_command c = 4 (CONT_ABS)
DRIVER main: before process_command c = 4 (CONT_ABS)
DRIVER main: before process_command c = 4 (CONT_ABS)
DRIVER main: before process_command c = 4 (CONT_ABS)
DRIVER main: before process_command c = 45 (RESPOND)
DRIVER main: before process_command c = 66 (PAD_SELECT)
DRIVER main: before process_command c = 66 (PAD_SELECT)
DRIVER main: before process_command c = 73 (PAD_GET_ITEM)
DRIVER main: before process_command c = 66 (PAD_SELECT)
DRIVER main: before process_command c = 72 (PAD_DELETE_ITEM)
DRIVER main: before process_command c = 75 (PAD_SET_ITEM)
DRIVER main: before process_command c = 66 (PAD_SELECT)
DRIVER main: before process_command c = 73 (PAD_GET_ITEM)
DRIVER main: before process_command c = 47 (STANDARD_COLOR)
DRIVER main: before process_command c = 13 (MOVE_ABS)
DRIVER main: before process_command c = 4 (CONT_ABS)
DRIVER main: before process_command c = 4 (CONT_ABS)
DRIVER main: before process_command c = 4 (CONT_ABS)
DRIVER main: before process_command c = 4 (CONT_ABS)
DRIVER main: before process_command c = 45 (RESPOND)
DRIVER main: before process_command c = 73 (PAD_GET_ITEM)
DRIVER main: before process_command c = 40 (SET_WINDOW)
DRIVER main: before process_command c = 73 (PAD_GET_ITEM)
DRIVER main: before process_command c = 73 (PAD_GET_ITEM)
DRIVER main: before process_command c = 75 (PAD_SET_ITEM)
DRIVER main: before process_command c = 40 (SET_WINDOW)
DRIVER main: before process_command c = 13 (MOVE_ABS)
DRIVER main: before process_command c = 45 (RESPOND)
DRIVER main: read encountered EOF - closing
DRIVER main: before Client_Close
DRIVER main: In while, before get_connection_sock and Do_work(0) loop.

GRASS:~ > d.mon stop=x0

DRIVER main: Exited loop - Now before command_init
DRIVER main: before Client_Open
DRIVER main: before process_command c = 46 (BEGIN)
DRIVER main: before process_command c = 11 (GRAPH_CLOSE)
Monitor 'x0' terminated

----------------------------------------------------------------------------
-------------------------




More information about the grass-windows mailing list