[GRASS-SVN] r55166 - in grass/branches/releasebranch_6_4/gui/wxpython: gui_core modules

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Feb 22 02:35:08 PST 2013


Author: annakrat
Date: 2013-02-22 02:35:07 -0800 (Fri, 22 Feb 2013)
New Revision: 55166

Modified:
   grass/branches/releasebranch_6_4/gui/wxpython/gui_core/goutput.py
   grass/branches/releasebranch_6_4/gui/wxpython/modules/mcalc_builder.py
Log:
wxGUI: fix #1894

Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_core/goutput.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_core/goutput.py	2013-02-22 10:15:13 UTC (rev 55165)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_core/goutput.py	2013-02-22 10:35:07 UTC (rev 55166)
@@ -549,7 +549,7 @@
             else:
                 # other GRASS commands (r|v|g|...)
                 hasParams = False
-                if command[0] != 'r.mapcalc':
+                if command[0] not in ('r.mapcalc', 'r3.mapcalc'):
                     try:
                         task = GUI(show = None).ParseCommand(command)
                     except GException, e:
@@ -880,7 +880,7 @@
         if self.parent.GetName() == "LayerManager":
             self.btnCmdAbort.Enable(False)
             if event.cmd[0] not in globalvar.grassCmd or \
-                    event.cmd[0] == 'r.mapcalc':
+                    event.cmd[0] in ('r.mapcalc', 'r3.mapcalc'):
                 return
             
             tree = self.parent.GetLayerTree()

Modified: grass/branches/releasebranch_6_4/gui/wxpython/modules/mcalc_builder.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/modules/mcalc_builder.py	2013-02-22 10:15:13 UTC (rev 55165)
+++ grass/branches/releasebranch_6_4/gui/wxpython/modules/mcalc_builder.py	2013-02-22 10:35:07 UTC (rev 55166)
@@ -20,7 +20,7 @@
 import sys
 
 if __name__ == "__main__":
-    sys.path.append(os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython'))
+    sys.path.append(os.path.join(os.getenv('GISBASE'), 'etc', 'wxpython'))
 from core import globalvar
 import wx
 
@@ -419,8 +419,11 @@
     def OnUpdateStatusBar(self, event):
         """!Update statusbar text"""
         expr = self.text_mcalc.GetValue().strip().replace("\n", " ")
-        self.SetStatusText("r.mapcalc '%s = %s'" % (self.newmaptxt.GetValue(),
-                                                    expr))
+        cmd = 'r.mapcalc'
+        if self.rast3d:
+            cmd = 'r3.mapcalc'
+        self.SetStatusText("%s '%s = %s'" % (cmd, self.newmaptxt.GetValue(),
+                                             expr))
         event.Skip()
         
     def _addSomething(self, what):
@@ -475,18 +478,23 @@
             self.parent.Raise()
         else:
             RunCommand(self.cmd,
-                       "%s=%s" % (name, expr))
-        
+                       **{name: expr})
+
     def OnDone(self, cmd, returncode):
         """!Add create map to the layer tree"""
         if not self.addbox.IsChecked():
             return
         name = self.newmaptxt.GetValue().strip(' "') + '@' + grass.gisenv()['MAPSET']
+        ltype = 'raster'
+        lcmd = 'd.rast'
+        if self.rast3d:
+            ltype = '3d-raster'
+            lcmd = 'd.rast3d.py'
         mapTree = self.parent.GetLayerTree()
         if not mapTree.GetMap().GetListOfLayers(l_name = name):
-            mapTree.AddLayer(ltype = 'raster',
+            mapTree.AddLayer(ltype = ltype,
                              lname = name,
-                             lcmd = ['d.rast', 'map=%s' % name],
+                             lcmd = [lcmd, 'map=%s' % name],
                              multiple = False)
         
         display = self.parent.GetLayerTree().GetMapDisplay()



More information about the grass-commit mailing list