Ticket #1381 (new enhancement)

Opened 3 years ago

Last modified 12 months ago

wxgui: add monitor calibrate option to prefs

Reported by: hamish Owned by: grass-dev@…
Priority: major Milestone: 6.5.0
Component: wxGUI Version: svn-releasebranch64
Keywords: map scale Cc:
Platform: All CPU: All

Description

Hi,

currently the wxGUI offers a 1:xxxxx map scale option in the status bar of the Map Display window. By definition this is the ratio of the distance (in map units) on the ground to the distance (in map units) on the rendered display.

Without knowing the monitor size + resolution the currently displayed value seems to just be like region_distance/number_of_pixels. So it's missing being multiplied by a pixels_per_meter factor (if map units were in meters..).

source:grass/trunk/gui/wxpython/gui_modules/mapdisp.py@46524#L742

X11 and I suspect OSX & MS Windows provide some info about the monitor, but in the past those reported values have been quite unreliable. Maybe it is a little better now and could be used for setting a seed value?

I propose to do as GIMP and Inkscape do, and offer a calibration tool in the Preferences menu's "Display" setting tab. Then we know the DPI to map-units conversion factor specific to the user's screen resolution and monitor size, and after calibration they can trust the scale shown in the info bar. Either that or remove the currently erroneous option altogether.

I've just looked at the version in Inkscape 0.48.1 and it seems quite nice and easy to use. Inkscape is written using wx(C++) but maybe there is still some pre-fab code in there we could quickly adapt?

The gv program uses another way, in its State->Setup options it lets you define "Screen size (mm): _ x _"

note that this isn't an issue for ps.map, because we already know the exact dimensions of the paper sizes.

thanks, Hamish

Change History

Changed 3 years ago by hamish

tooltip explaining that 'map scale' as currently given is only really accurate to within the order of magnitude committed in trunk and devbr6 in r48228,9.

Hamish

Changed 12 months ago by vincent

  • milestone changed from 6.5.0 to 6.4.3

OK for the tooltip

The notion of display scale is very useful when performing on-the-fly snapshots of the display. Would be great if one could precisely trim his display settings.

I understand retrieving monitor size is not straight, and obviously much platform-dependant... GIMP's method relies on monitor information delivered by xdpyinfo (am I wrong ?), but sometimes this info is not reliable.

Could the first-aid solution be an option in the Display preferences menu (2 input datafields) that allows user to set manually his vertical- & horizontal resolutions ? after all, we can believe the user who cares for this parameter is aware of how to calculate his proper values, no ?

Changed 12 months ago by hamish

  • milestone changed from 6.4.3 to 6.5.0

(as a matter of short time to the next release this probably won't be in 6.4.3, but look out for it in future versions)

fwiw, for ideas on how to do it:

In my version of GIMP it is in Edit -> Preferences -> Display.

Then in Monitor Resolution there is:

  • Detect automatically (currently XX x YY ppi) <- probably from xdpyinfo
  • Enter manually
    • Horiz Vert units

or

[Calibrate]

In the calibrate window you get a horizontal and vertical ruler in a window, you put a ruler up to the screen and type in the true length of the bars. (and then don't change your monitor or resolution :)

I've no idea how to get that on MS Windows or a Mac, I suppose it is possible somehow and the GIMP code is open to borrow from, but I think a universal solution would be better. In practice I've found those reported sizes not always very accurate. Probably it is better these days post-CRT.

Could the first-aid solution be an option in the Display preferences menu (2 input datafields) that allows user to set manually his vertical- & horizontal resolutions ? after all, we can believe the user who cares for this parameter is aware of how to calculate his proper values, no ?

Entering the measured width and height of the monitor screen, and the current resolution sounds easy enough first step, but to avoid errors/be easy I would have the program do all the calculations, just have the user enter the distances.

For ease of use, I still like Inkscape's calibration method the best: you drag the slider until the on-screen ruler matches your real one. (File -> Inkscape Prefs -> Interface -> Zoom correction factor) Then it does the math. Although theirs is just horizontal; I've noticed on one of my systems the correct scale factor is not the same for horiz/vert.

Hamish

Note: See TracTickets for help on using tickets.