[GRASS5] Sockets code

Eric,

I was able to get the new sockets code
running on Cygwin. To do this I had to
remove the '#ifndef __CYGWIN__' and
'#endif' statements sandwiching the
FONT and TEXT case statements in
SWITCHER.c, i.e.:

/*
#ifndef __CYGWIN__
*/
            case FONT:
                RECTEXT(text);
                x = Font_get(text);
                SEND(&x, sizeof(x));
                break;
            case TEXT:
                RECTEXT(text);
                Text(text);
                break;
/*
#endif
*/

After that minor fix the sockets XDRIVER
seems to run on winNT/Cygwin. So far
I've just tested with some of the basic
d.* commands: d.mon, d.rast, d.vect,
d.histogram and d.erase, but once these
were working for the IPC version the
others worked as well.

Note that, we made these same changes to
the IPC version to run it.

Good work.

Malcolm

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

On Wed, Feb 14, 2001 at 03:27:00AM -0400, Malcolm Blue wrote:

Eric,

I was able to get the new sockets code
running on Cygwin. To do this I had to
remove the '#ifndef __CYGWIN__' and
'#endif' statements sandwiching the
FONT and TEXT case statements in
SWITCHER.c, i.e.:

Okay, then I can safely delete that cruft? I've been trying to remove
some other unused junk as well (-Wall is helpful ;).

[snip]

Note that, we made these same changes to
the IPC version to run it.

Let me know if there other things needed. Can you check if CygWin
supports nanosleep() (/usr/include/time.h probably)? I'd like to use it
if I can, but I wonder about it's portability...

--
Eric G. Miller <egm2@jps.net>

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Eric,

I don't think cygwin supports nanosleep(). It is in time.h, but the faq lists
this as unimplimented. It's probably just a stub to allow compilation. I'll try
to check further since in some cases the faq is out of date.

Malcolm

"Eric G . Miller" wrote:

On Wed, Feb 14, 2001 at 03:27:00AM -0400, Malcolm Blue wrote:
> Eric,
>
> I was able to get the new sockets code
> running on Cygwin. To do this I had to
> remove the '#ifndef __CYGWIN__' and
> '#endif' statements sandwiching the
> FONT and TEXT case statements in
> SWITCHER.c, i.e.:

Okay, then I can safely delete that cruft? I've been trying to remove
some other unused junk as well (-Wall is helpful ;).

[snip]
> Note that, we made these same changes to
> the IPC version to run it.

Let me know if there other things needed. Can you check if CygWin
supports nanosleep() (/usr/include/time.h probably)? I'd like to use it
if I can, but I wonder about it's portability...

--
Eric G. Miller <egm2@jps.net>

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

Hi Eric,

after spending more time on this I have finished the
small "scale" program. Example run:

Xserver screen resolution: x:90.060942 dpi y:95.976384 dpi
Map parameters:

True map size: we_meters: 5277.500000 ns_meters: 4032.500000
Pixel numbers used in screen: ns: 961.228802 we:1258.000000
Map rows: 1613 map cols: 2111

Map height in meter: 0.271097
Map width in meter: 0.332928

Current map scale (note: Xserver x_res != y_res):
   y-scale: 1:14874.773747
   x-scale: 1:15851.788407

Hey, my first Xserver-related software :slight_smile:

Find attached:
scale2.tar,gz

BTW: The Xserver x_res != y_res is really odd! I hope all the GRASS
display/measure modules take care of this. In fact the maps will be
displayed stretched always. I wasn't aware of that.

It would be great to have the map scale displayed in top line of
GRASS monitor (of course get the sockets fully working is highest
priority).

Cheers

Markus

(attachments)

scale2.tar,gz (43.1 KB)

Hi again,

it seems the tar was corrupted. Here again.

Sorry,

Markus

(attachments)

scale3.tar.gz (1.79 KB)

Malcolm, (Eric?)

Did you commit the changes to the cvs?

John Huddleston

----- Original Message -----
From: "Malcolm Blue" <mblue@nb.sympatico.ca>
To: "grass5 Developers List" <grass5@geog.uni-hannover.de>
Sent: Wednesday, February 14, 2001 12:27 AM
Subject: [GRASS5] Sockets code

Eric,

I was able to get the new sockets code
running on Cygwin. To do this I had to
remove the '#ifndef __CYGWIN__' and
'#endif' statements sandwiching the
FONT and TEXT case statements in
SWITCHER.c, i.e.:

/*
#ifndef __CYGWIN__
*/
            case FONT:
                RECTEXT(text);
                x = Font_get(text);
                SEND(&x, sizeof(x));
                break;
            case TEXT:
                RECTEXT(text);
                Text(text);
                break;
/*
#endif
*/

After that minor fix the sockets XDRIVER
seems to run on winNT/Cygwin. So far
I've just tested with some of the basic
d.* commands: d.mon, d.rast, d.vect,
d.histogram and d.erase, but once these
were working for the IPC version the
others worked as well.

Note that, we made these same changes to
the IPC version to run it.

Good work.

Malcolm

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

On Sat, Feb 17, 2001 at 07:45:41AM -0700, John Huddleston wrote:

Malcolm, (Eric?)

Did you commit the changes to the cvs?

John Huddleston

Hi John,

yes, Eric submitted to CVS.

Markus

----- Original Message -----
From: "Malcolm Blue" <mblue@nb.sympatico.ca>
To: "grass5 Developers List" <grass5@geog.uni-hannover.de>
Sent: Wednesday, February 14, 2001 12:27 AM
Subject: [GRASS5] Sockets code

> Eric,
>
> I was able to get the new sockets code
> running on Cygwin. To do this I had to
> remove the '#ifndef __CYGWIN__' and
> '#endif' statements sandwiching the
> FONT and TEXT case statements in
> SWITCHER.c, i.e.:
>
> /*
> #ifndef __CYGWIN__
> */
> case FONT:
> RECTEXT(text);
> x = Font_get(text);
> SEND(&x, sizeof(x));
> break;
> case TEXT:
> RECTEXT(text);
> Text(text);
> break;
> /*
> #endif
> */
>
> After that minor fix the sockets XDRIVER
> seems to run on winNT/Cygwin. So far
> I've just tested with some of the basic
> d.* commands: d.mon, d.rast, d.vect,
> d.histogram and d.erase, but once these
> were working for the IPC version the
> others worked as well.
>
> Note that, we made these same changes to
> the IPC version to run it.
>
>
> Good work.
>
>
> Malcolm
>
>
> ----------------------------------------
> If you want to unsubscribe from GRASS Development Team mailing list write to:
> minordomo@geog.uni-hannover.de with
> subject 'unsubscribe grass5'

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

--
Markus Neteler * University of Hannover
Institute of Physical Geography and Landscape Ecology
Schneiderberg 50 * D-30167 Hannover * Germany
Tel: ++49-(0)511-762-4494 Fax: -3984

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'

On Wed, Feb 14, 2001 at 03:24:35PM +0000, Markus Neteler wrote:

Hi Eric,

after spending more time on this I have finished the
small "scale" program. Example run:

Xserver screen resolution: x:90.060942 dpi y:95.976384 dpi
Map parameters:

True map size: we_meters: 5277.500000 ns_meters: 4032.500000
Pixel numbers used in screen: ns: 961.228802 we:1258.000000
Map rows: 1613 map cols: 2111

Map height in meter: 0.271097
Map width in meter: 0.332928

Current map scale (note: Xserver x_res != y_res):
   y-scale: 1:14874.773747
   x-scale: 1:15851.788407

Hey, my first Xserver-related software :slight_smile:

Find attached:
scale2.tar,gz

BTW: The Xserver x_res != y_res is really odd! I hope all the GRASS
display/measure modules take care of this. In fact the maps will be
displayed stretched always. I wasn't aware of that.

I think this is hardware specific...

$ ./scale
Xserver screen resolution: x:100.036923 dpi y:100.036923 dpi
Map parameters:

True map size: we_meters: 372.437764 ns_meters: 344.119786
Pixel numbers used in screen: ns: 494.321745 we:535.000000
Map rows: 865 map cols: 958

Map height in meter: 0.125511
Map width in meter: 0.135840

Current map scale (note: Xserver x_res != y_res):
   y-scale: 1:2741.741697
   x-scale: 1:2741.741697

[Ahh, but they are the same on my hardware...]

I recall reading the the DisplayHeightMM type routines might not return
true measurements. That is, these routines are dependent on the
hardware reporting which apparently isn't always reliable.

It would be great to have the map scale displayed in top line of
GRASS monitor (of course get the sockets fully working is highest
priority).

The server would have to query the region settings, like you did. And,
it would need a hook to recalculate when the window is resized.

--
Eric G. Miller <egm2@jps.net>

----------------------------------------
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo@geog.uni-hannover.de with
subject 'unsubscribe grass5'