Opened 10 years ago

Closed 10 years ago

Last modified 7 years ago

#2315 closed enhancement (fixed)

wxGUI mapswipe: icon AddLayerRGB wish

Reported by: neteler Owned by: grass-dev@…
Priority: normal Milestone: 7.0.0
Component: wxGUI Version: svn-releasebranch70
Keywords: mapswipe Cc:
CPU: Unspecified Platform: Unspecified

Description

It would be very useful to have RGB layer support in mapswipe since it is often used for multispectral data visualization.

There might be some potentially re-usable code in iclass:

wxpython/iclass/frame.py 
 def AddLayerRGB(self, cmd):
 ...

wxpython/iclass/toolbars.py
 def OnAddRGB(self, event):
 ...

Change History (14)

comment:1 by annakrat, 10 years ago

Please try 60594. It's available in the 'advanced mode'.

in reply to:  1 ; comment:2 by neteler, 10 years ago

Thanks - I tried r60594, switching to 'advanced mode' but somehow the new addRGB icon does now show up...

in reply to:  2 comment:3 by annakrat, 10 years ago

Replying to neteler:

Thanks - I tried r60594, switching to 'advanced mode' but somehow the new addRGB icon does now show up...

Sorry I somehow forgot to commit the changes which activate it, done in r60611.

comment:4 by neteler, 10 years ago

Now the icon is there and the RGB channels can be loaded. Only this issue happens when adding as second map a "normal" raster map:

GRASS 7.1.svn (nc_spm_08_grass7):~ > g.gui.mapswipe
GRASS 7.1.svn (nc_spm_08_grass7):~ > Traceback (most recent call last):
  File "/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/gui/wxpython/gui_core/forms.py", line 662, in OnOK
    cmd = self.OnApply(event)
  File "/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/gui/wxpython/gui_core/forms.py", line 677, in OnApply
    self)
  File "/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/gui/wxpython/gui_core/simplelmgr.py", line 333, in GetOptData
    self._update()
  File "/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/gui/wxpython/gui_core/simplelmgr.py", line 301, in _update
    self._checkList.SetItems(items)
  File "/usr/lib64/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/_core.py", line 11984, in SetItems
    self.AppendItems(items)
  File "/usr/lib64/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/_core.py", line 11846, in AppendItems
    return _core_.ItemContainer_AppendItems(*args, **kwargs)
TypeError: String or Unicode type required

in reply to:  4 comment:5 by annakrat, 10 years ago

Replying to neteler:

Now the icon is there and the RGB channels can be loaded. Only this issue happens when adding as second map a "normal" raster map:

GRASS 7.1.svn (nc_spm_08_grass7):~ > g.gui.mapswipe
GRASS 7.1.svn (nc_spm_08_grass7):~ > Traceback (most recent call last):
    return _core_.ItemContainer_AppendItems(*args, **kwargs)
TypeError: String or Unicode type required

Could you try it again? Similar things happen to me but only sometimes and I was not able to reproduce it.

comment:6 by neteler, 10 years ago

Tried again: I open g.gui.mapswipe, switch to "Advanced mode", then bacl to "Simple mode" and

GRASS 7.1.svn (nc_spm_08_grass7):~ > Traceback (most recent call last):
  File "/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/gui/wxpython/mapswipe/dialogs.py", line 176, in OnSwitchMode
    self._switchMode(simple=True)
  File "/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/gui/wxpython/mapswipe/dialogs.py", line 172, in _switchMode
    self.applyChanges.emit()
  File "/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/etc/python/grass/pydispatch/signal.py", line 229, in emit
    dispatcher.send(signal=self, *args, **kwargs)
  File "/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/etc/python/grass/pydispatch/dispatcher.py", line 343, in send
    **named
  File "/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/etc/python/grass/pydispatch/robustapply.py", line 57, in robustApply
    return receiver(*arguments, **named)
  File "/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/gui/wxpython/mapswipe/frame.py", line 401, in OnApplyInputChanges
    self.ZoomToMap()
  File "/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/gui/wxpython/mapswipe/frame.py", line 337, in ZoomToMap
    self.GetFirstWindow().ZoomToMap(layers = layers)
  File "/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/gui/wxpython/mapwin/buffered.py", line 1742, in ZoomToMap
    layers = self._giface.GetLayerList().GetSelectedLayers(checkedOnly=False)
  File "/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/gui/wxpython/core/giface.py", line 257, in GetLayerList
    raise NotImplementedError()
NotImplementedError

Still the windows are existing. Then I go back to "Advanced", select RGB, when closing that dialog I get

Traceback (most recent call last):
  File "/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/gui/wxpython/gui_core/forms.py", line 662, in OnOK
    cmd = self.OnApply(event)
  File "/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/gui/wxpython/gui_core/forms.py", line 677, in OnApply
    self)
  File "/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/gui/wxpython/gui_core/simplelmgr.py", line 333, in GetOptData
    self._update()
  File "/home/neteler/software/grass71/dist.x86_64-unknown-linux-gnu/gui/wxpython/gui_core/simplelmgr.py", line 301, in _update
    self._checkList.SetItems(items)
  File "/usr/lib64/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/_core.py", line 11984, in SetItems
    self.AppendItems(items)
  File "/usr/lib64/python2.7/site-packages/wx-2.8-gtk2-unicode/wx/_core.py", line 11846, in AppendItems
    return _core_.ItemContainer_AppendItems(*args, **kwargs)
TypeError: String or Unicode type required

Some initialization issue is still there...

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

Replying to neteler:

Tried again: I open g.gui.mapswipe, switch to "Advanced mode", then bacl to "Simple mode" and

that's not related, I will look at it later

Still the windows are existing. Then I go back to "Advanced", select RGB, when closing that dialog I get

Traceback (most recent call last):
    return _core_.ItemContainer_AppendItems(*args, **kwargs)
TypeError: String or Unicode type required

Some initialization issue is still there...

I am still not able to reproduce it, I got it once from something like 7 attempts.

in reply to:  7 ; comment:8 by annakrat, 10 years ago

Replying to annakrat:

Replying to neteler:

Traceback (most recent call last):
    return _core_.ItemContainer_AppendItems(*args, **kwargs)
TypeError: String or Unicode type required

Some initialization issue is still there...

I am still not able to reproduce it, I got it once from something like 7 attempts.

Please try r60753. It is supposed to fix the string or Unicode type required error. Do we want this new feature in beta3?

in reply to:  8 ; comment:9 by neteler, 10 years ago

Replying to annakrat: ...

Please try r60753. It is supposed to fix the string or Unicode type required error.

Excellent, seems to be solved.

Do we want this new feature in beta3?

For users very important, so I would say yes. It does not look too invasive and we are pre-feature freeze here.

in reply to:  9 comment:10 by annakrat, 10 years ago

Replying to neteler:

Replying to annakrat: ...

Please try r60753. It is supposed to fix the string or Unicode type required error.

Excellent, seems to be solved.

Do we want this new feature in beta3?

For users very important, so I would say yes. It does not look too invasive and we are pre-feature freeze here.

Backported in r60756. The other error should be fixed in 60757 (and already backported).

comment:11 by neteler, 10 years ago

Resolution: fixed
Status: newclosed

Thanks for the enhancement. Closing.

comment:12 by mmetz, 7 years ago

In 69838:

r.texture: fix #3210, #2315, clean up code

comment:13 by mmetz, 7 years ago

In 69839:

r.texture: fix #3210, #2315, clean up code (backport from trunk r69838)

comment:14 by mmetz, 7 years ago

In 69840:

r.texture: fix #3210, #2315, clean up code (backport from trunk r69838)

Note: See TracTickets for help on using tickets.