Opened 11 years ago

Closed 10 years ago

#2088 closed defect (fixed)

G7: digitizer python error

Reported by: neteler Owned by: martinl
Priority: normal Milestone: 7.0.0
Component: wxGUI Version: svn-trunk
Keywords: digitizer, python Cc: grass-dev@…
CPU: x86-64 Platform: Linux

Description

The wxGUI digitizer shows this problem:

Traceback (most recent call last):
  File "/home/neteler/grass70/dist.x86_64-unknown-linux-
gnu/etc/gui/wxpython/mapwin/buffered.py", line 1025, in
MouseActions

self.OnLeftUp(event)
  File "/home/neteler/grass70/dist.x86_64-unknown-linux-
gnu/etc/gui/wxpython/mapwin/buffered.py", line 1206, in
OnLeftUp

self._onLeftUp(event)
  File "/home/neteler/grass70/dist.x86_64-unknown-linux-
gnu/etc/gui/wxpython/vdigit/mapwindow.py", line 850, in
_onLeftUp

self.OnLeftUpCopyLine(event)
  File "/home/neteler/grass70/dist.x86_64-unknown-linux-
gnu/etc/gui/wxpython/vdigit/mapwindow.py", line 758, in
OnLeftUpCopyLine

nselected = self.bdigit.GetDisplay().SelectLinesByBox((pos1,
pos2))
AttributeError
:
'VDigitWindow' object has no attribute 'bdigit'

To reproduce it:

  • NC location
  • load and show the "geology" map
  • start the digitizer from the map display window
  • create a new vector map

Note: the "geology" map disappears, "Render map" icon shows it again

  • From "Additional tools": select "Copy feature from (background) vector map

The error message appears (see above).

Furthermore there is no dialog from which vector map the user could copy from (should be one of the maps loaded into the layer manager).

Change History (8)

in reply to:  description comment:1 by martinl, 10 years ago

Replying to neteler:

> nselected = self.bdigit.GetDisplay().SelectLinesByBox((pos1,
> pos2))
> AttributeError
> :
> 'VDigitWindow' object has no attribute 'bdigit'

it seems to a typo, should be fixed in r58935.

in reply to:  description comment:2 by martinl, 10 years ago

Replying to neteler:

Furthermore there is no dialog from which vector map the user could copy from (should be one of the maps loaded into the layer manager).

A new dialog introduced in r58937. Selecting background map from layer tree has been disabled.

in reply to:  description ; comment:3 by martinl, 10 years ago

Replying to neteler:

Note: the "geology" map disappears, "Render map" icon shows it again

should be fixed in r58939 (no idea why this code has such effect). Testing welcomed. Martin

comment:4 by martinl, 10 years ago

Cc: grass-dev@… added
Owner: changed from grass-dev@… to martinl
Status: newassigned

in reply to:  3 ; comment:5 by wenzeslaus, 10 years ago

Replying to martinl:

Replying to neteler:

Note: the "geology" map disappears, "Render map" icon shows it again

should be fixed in r58939 (no idea why this code has such effect). Testing welcomed. Martin

This hiding of layers (not showing rendered layers in map window) happens a lot, especially with vectors. I have no idea what's behind.

in reply to:  5 ; comment:6 by martinl, 10 years ago

Replying to wenzeslaus:

This hiding of layers (not showing rendered layers in map window) happens a lot, especially with vectors. I have no idea what's behind.

I discovered that CheckItem() callled in AddLayer() source:grass/trunk/gui/wxpython/lmgr/layertree.py#L1103 causes that Map.layers appears to be empty (even there are maps in layer tree). I really have no idea why. Anyway wx.CallAfter() avoids it (at least it seems to)

in reply to:  6 comment:7 by wenzeslaus, 10 years ago

Replying to martinl:

Replying to wenzeslaus:

This hiding of layers (not showing rendered layers in map window) happens a lot, especially with vectors. I have no idea what's behind.

I discovered that CheckItem() callled in AddLayer() source:grass/trunk/gui/wxpython/lmgr/layertree.py#L1103 causes that Map.layers appears to be empty (even there are maps in layer tree). I really have no idea why. Anyway wx.CallAfter() avoids it (at least it seems to)

So, r58939 fixed the problem I had which occurred when you used d.vect from Command console in GUI or when vector map was output of some module (and map was added automatically). Thanks.

I agree that wx.CallAfter() is probably workaround for some problem but there is no other option now.

How about the original reported issue? Can we close the ticket?

comment:8 by neteler, 10 years ago

Resolution: fixed
Status: assignedclosed

The original issue has been fixed, thanks!

Closing.

Note: See TracTickets for help on using tickets.