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

Description

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/GRASS-6.4.3.app/Contents/MacOS/e
tc/wxpython/wxplot/base.py", line 489, in PlotOptions

title = _('Plot settings'))
  File "/Applications/GRASS/GRASS-6.4.3.app/Contents/MacOS/e
tc/wxpython/wxplot/dialogs.py", line 455, in __init__

wx.Dialog.__init__(self, parent, id, title, style = style,
**kwargs)
  File "/Applications/GRASS/GRASS-6.4.3.app/Contents/MacOS/e
tc/python/wx/_windows.py", line 651, in __init__

_windows_.Dialog_swiginit(self,_windows_.new_Dialog(*args,
**kwargs))
TypeError
:
'plottype' is an invalid keyword argument for this function

This is on a version compiled 23 August

Michael

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).

Anna

comment:2 by cmbarton, 12 years ago

I echo these difficulties.

Michael

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
S-7.0.app/Contents/MacOS/etc/gui/wxpython/wxplot/dialogs.py"
, line 1231, in OnApply

self.parent.SetGraphStyle()
  File "/Users/Shared/grass_dev/grass70_dev/macosx/dist/GRAS
S-7.0.app/Contents/MacOS/etc/gui/wxpython/wxplot/base.py",
line 299, in SetGraphStyle

self.client.SetEnableGrid(self.properties['grid']['enabled']
)
  File "/Users/Shared/grass_dev/grass70_dev/macosx/dist/GRAS
S-7.0.app/Contents/MacOS/etc/python/wx/lib/plot.py", line
895, in SetEnableGrid

self.Redraw()
  File "/Users/Shared/grass_dev/grass70_dev/macosx/dist/GRAS
S-7.0.app/Contents/MacOS/etc/python/wx/lib/plot.py", line
1264, in Redraw

self._Draw(graphics,xAxis,yAxis,dc)
  File "/Users/Shared/grass_dev/grass70_dev/macosx/dist/GRAS
S-7.0.app/Contents/MacOS/etc/python/wx/lib/plot.py", line
1258, in _Draw

self._adjustScrollbars()
  File "/Users/Shared/grass_dev/grass70_dev/macosx/dist/GRAS
S-7.0.app/Contents/MacOS/etc/python/wx/lib/plot.py", line
1855, in _adjustScrollbars

r_max = list(self._getYMaxRange())
  File "/Users/Shared/grass_dev/grass70_dev/macosx/dist/GRAS
S-7.0.app/Contents/MacOS/etc/python/wx/lib/plot.py", line
1067, in _getYMaxRange

yAxis = self._axisInterval(self._ySpec, p1[1], p2[1])
  File "/Users/Shared/grass_dev/grass70_dev/macosx/dist/GRAS
S-7.0.app/Contents/MacOS/etc/python/wx/lib/plot.py", line
1665, in _axisInterval

raise ValueError, str(spec) + ': illegal axis specification'
ValueError
:
{'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\base.py", line 472, in
PlotOptions

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

self._do_layout()
  File "C:\Programmi\GRASS GIS
6.4.3svn\etc\wxpython\wxplot\dialogs.py", line 568, in
_do_layout

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

_controls_.Choice_swiginit(self,_controls_.new_Choice(*args,
**kwargs))
wx._core
.
PyAssertionError
:
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

Markus,

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?

Michael

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.

Michael

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\dialogs.py", line 867, in OnOk

self.OnApply(None)
  File "C:\Programmi\GRASS GIS
6.4.3svn\etc\wxpython\wxplot\dialogs.py", line 860, in
OnApply

self.UpdateSettings()
  File "C:\Programmi\GRASS GIS
6.4.3svn\etc\wxpython\wxplot\dialogs.py", line 837, in
UpdateSettings

self.properties['marker']['type'] =
self.FindWindowById(self.wxId['marker']['type']).GetValue()
AttributeError
:
'Choice' object has no attribute 'GetValue'

comment:13 by cmbarton, 12 years ago

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

Michael

comment:14 by cmbarton, 12 years ago

Try r53049

Michael

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.

Michael

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.

Michael

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.

Michael

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.

Michael

Note: See TracTickets for help on using tickets.