Opened 12 years ago

Closed 12 years ago

#1711 closed defect (fixed)

Plot settings in profiler now broken

Reported by: cmbarton Owned by: grass-dev@…
Priority: critical Milestone: 6.4.3
Component: Default Version: svn-releasebranch64
Keywords: Cc:
CPU: Unspecified Platform: Unspecified


The plotting settings in the wxGUI profiler have been recently broken in GRASS 6.4 svn. When I try to access them (using the NC demo data), I get the following error:

Settings: unable to get value 'profile:raster:None'
Traceback (most recent call last):
  File "/Applications/GRASS/
tc/wxpython/wxplot/", line 489, in PlotOptions

title = _('Plot settings'))
  File "/Applications/GRASS/
tc/wxpython/wxplot/", line 455, in __init__

wx.Dialog.__init__(self, parent, id, title, style = style,
  File "/Applications/GRASS/
tc/python/wx/", line 651, in __init__

'plottype' is an invalid keyword argument for this function

This is on a version compiled 23 August


Change History (20)

comment:1 by annakrat, 12 years ago

The problem is that when you fix this error, another appears which is probably caused by the major gui backport half a year ago. I am not sure how the wxplot tools are tested in grass 7 but I think now it would be easier to copy all wxplot from 7 to 6.4 (no idea what is in 6.5). In general it is quite difficult to maintain two different versions of gui since classes in wxGUI are connected together (which is a sign of not well designed class model).


comment:2 by cmbarton, 12 years ago

I echo these difficulties.


comment:3 by cmbarton, 12 years ago

Everything works fine with GRASS 7.

comment:4 by cmbarton, 12 years ago

I spoke too soon. You can open the settings in GRASS 7 and some of them work. But hitting apply or save raises the following error:

Traceback (most recent call last):
  File "/Users/Shared/grass_dev/grass70_dev/macosx/dist/GRAS"
, line 1231, in OnApply

  File "/Users/Shared/grass_dev/grass70_dev/macosx/dist/GRAS",
line 299, in SetGraphStyle

  File "/Users/Shared/grass_dev/grass70_dev/macosx/dist/GRAS", line
895, in SetEnableGrid

  File "/Users/Shared/grass_dev/grass70_dev/macosx/dist/GRAS", line
1264, in Redraw

  File "/Users/Shared/grass_dev/grass70_dev/macosx/dist/GRAS", line
1258, in _Draw

  File "/Users/Shared/grass_dev/grass70_dev/macosx/dist/GRAS", line
1855, in _adjustScrollbars

r_max = list(self._getYMaxRange())
  File "/Users/Shared/grass_dev/grass70_dev/macosx/dist/GRAS", line
1067, in _getYMaxRange

yAxis = self._axisInterval(self._ySpec, p1[1], p2[1])
  File "/Users/Shared/grass_dev/grass70_dev/macosx/dist/GRAS", line
1665, in _axisInterval

raise ValueError, str(spec) + ': illegal axis specification'
{'max': 0.0, 'type': u'auto', 'log': False, 'min': 0.0}:
illegal axis specification

comment:5 by annakrat, 12 years ago

I can't reproduce this error. However I can see some inconsistency in the settings - when you change value (color, text) of certain widgets the change is automatically applied on the graph. But this doesn't work for all widgets. When the dialog has Apply button, these changes should apply only after clicking on the button and not earlier. After pressing Save you get this output in console: Plot settings saved to file 'None'. The settings file is changed but I cannot see the changed values.

comment:6 by neteler, 12 years ago

Not sure how much it is related to this ticket, but r53039 fixed the settings for the profile tool. Successfully tested under XP, profile tool is back working.

comment:7 by neteler, 12 years ago

OK, maybe not related. This error remains:

Map display -> Profile Icon -> Settings -> Plot Settings:

Traceback (most recent call last):
  File "C:\Programmi\GRASS GIS
6.4.3svn\etc\wxpython\wxplot\", line 472, in

title = _('Plot settings'))
  File "C:\Programmi\GRASS GIS
6.4.3svn\etc\wxpython\wxplot\", line 495, in

  File "C:\Programmi\GRASS GIS
6.4.3svn\etc\wxpython\wxplot\", line 568, in

size = (120, -1), choices = self.linestyledict.keys(), style
  File "C:\Programmi\GRASS GIS 6.4.3svn\Python27\lib\site-
packages\wx-2.8-msw-unicode\wx\", line 494, in

C++ assertion "!(style & wxCB_DROPDOWN) && !(style &
wxCB_READONLY) && !(style & wxCB_SIMPLE)" failed at
..\..\src\msw\choice.cpp(121) in wxChoice::Create(): this
style flag is ignored by wxChoice, you probably want to use
a wxComboBox

comment:8 by cmbarton, 12 years ago


This seems like a Windows-specific problem. Can you tell me a bit more specifically what things do and do not work so I can check on it?


comment:9 by neteler, 12 years ago

On XP, the bug is triggered when starting the profiler tool and going to settings:

Map display -> Profile Icon -> Settings -> Plot Settings

comment:10 by cmbarton, 12 years ago

OK. I'm pretty sure I fixed this. CB_DROPDOWN is not a valid style for wx.Choice, but for wxComboBox. I guess nix and Mac don't care, but Windows does. There was a mix of mostly wx.Choice controls and a couple wx.ComboBox controls on the options dialog. I made them all wx.Choice for consistency and got rid of the invalid style.

Please test r5348.

PS: is there any way to add a cc on a ticket? There used to be I thought but I can't find it now. I'd like to cc Anna.


comment:11 by cmbarton, 12 years ago

That should be r53048

in reply to:  11 comment:12 by neteler, 12 years ago

Replying to cmbarton:

That should be r53048

Yes, it fixes the problem to open the plot settings dialog. Unfortunately one more now when changing settings therein and clicking Apply/OK:

Traceback (most recent call last):
  File "C:\Programmi\GRASS GIS
6.4.3svn\etc\wxpython\wxplot\", line 867, in OnOk

  File "C:\Programmi\GRASS GIS
6.4.3svn\etc\wxpython\wxplot\", line 860, in

  File "C:\Programmi\GRASS GIS
6.4.3svn\etc\wxpython\wxplot\", line 837, in
UpdateSettings['marker']['type'] =
'Choice' object has no attribute 'GetValue'

comment:13 by cmbarton, 12 years ago

OK. Back now and will check on this. Thanks for testing.


comment:14 by cmbarton, 12 years ago

Try r53049


comment:15 by cmbarton, 12 years ago

added tooltips as per Anna's suggestion and tweaked labels in options in r53049

comment:16 by cmbarton, 12 years ago

Also updated GRASS 7 with same fixes. I'll try to see how best to update 6.5.


comment:17 by cmbarton, 12 years ago

It looks like GRASS 5 devbranch (AKA 6.5) is enough like 6.4.3 to allow backporting for the profile fixes. So I've done this. Please test. If all is well, we can close this.


comment:18 by cmbarton, 12 years ago

I've tested on Mac for 6.4.3, 6.5, and 7. Work for me in all branches.


comment:19 by neteler, 12 years ago

Works now in 6.4.svn also on XP and Linux, thanks! I did not test 6.5 and 7.

comment:20 by cmbarton, 12 years ago

Resolution: fixed
Status: newclosed

I'm closing because it is fixed in 6.4.3 (the original ticket). Can be reopened for 6.5 and 7 if needed. But probably OK there since the code is the same in 6.5 and the same plus unaffected modules for different plots in 7.


Note: See TracTickets for help on using tickets.