[GRASS-SVN] r63588 - in grass/trunk/gui/wxpython: animation core gmodeler gui_core lmgr mapwin modules

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Dec 18 07:35:41 PST 2014


Author: martinl
Date: 2014-12-18 07:35:41 -0800 (Thu, 18 Dec 2014)
New Revision: 63588

Modified:
   grass/trunk/gui/wxpython/animation/dialogs.py
   grass/trunk/gui/wxpython/core/layerlist.py
   grass/trunk/gui/wxpython/core/render.py
   grass/trunk/gui/wxpython/gmodeler/model.py
   grass/trunk/gui/wxpython/gui_core/dialogs.py
   grass/trunk/gui/wxpython/gui_core/forms.py
   grass/trunk/gui/wxpython/gui_core/gselect.py
   grass/trunk/gui/wxpython/gui_core/simplelmgr.py
   grass/trunk/gui/wxpython/lmgr/datacatalog.py
   grass/trunk/gui/wxpython/lmgr/frame.py
   grass/trunk/gui/wxpython/lmgr/layertree.py
   grass/trunk/gui/wxpython/mapwin/decorations.py
   grass/trunk/gui/wxpython/modules/mcalc_builder.py
Log:
wxGUI: update for `raster_3d`


Modified: grass/trunk/gui/wxpython/animation/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/animation/dialogs.py	2014-12-18 15:18:43 UTC (rev 63587)
+++ grass/trunk/gui/wxpython/animation/dialogs.py	2014-12-18 15:35:41 UTC (rev 63588)
@@ -1280,7 +1280,7 @@
 
         types = [('raster', _("Multiple raster maps")),
                  ('vector', _("Multiple vector maps")),
-                 ('3draster', _("Multiple 3D raster maps")),
+                 ('raster_3d', _("Multiple 3D raster maps")),
                  ('strds', _("Space time raster dataset")),
                  ('stvds', _("Space time vector dataset")),
                  ('str3ds', _("Space time 3D raster dataset"))]
@@ -1381,10 +1381,10 @@
             cmd.append('d.rast')
         elif self._mapType in ('vector', 'stvds'):
             cmd.append('d.vect')
-        elif self._mapType in ('3draster', 'str3ds'):
+        elif self._mapType in ('raster_3d', 'str3ds'):
             cmd.append('d.rast3d')
         if self._name:
-            if self._mapType in ('raster', 'vector', '3draster'):
+            if self._mapType in ('raster', 'vector', 'raster_3d'):
                 cmd.append('map={name}'.format(name=self._name.split(',')[0]))
             else:
                 try:

Modified: grass/trunk/gui/wxpython/core/layerlist.py
===================================================================
--- grass/trunk/gui/wxpython/core/layerlist.py	2014-12-18 15:18:43 UTC (rev 63587)
+++ grass/trunk/gui/wxpython/core/layerlist.py	2014-12-18 15:35:41 UTC (rev 63588)
@@ -191,10 +191,10 @@
         self._hidden = False
         self._initialized = False
 
-        self._mapTypes = ['raster', 'vector', '3draster', 'rgb']
+        self._mapTypes = ['raster', 'vector', 'raster_3d', 'rgb']
         self._internalTypes = {'raster': 'cell',
                                'vector': 'vector',
-                               '3draster': 'grid3',
+                               'raster_3d': 'grid3',
                                'rgb': 'rgb'}
 
     def GetName(self):
@@ -362,7 +362,7 @@
             mapType = 'raster'
         elif layer.mapType == 'vector':
             mapType = 'vector'
-        elif layer.mapType == '3draster':
+        elif layer.mapType == 'raster_3d':
             mapType = '3d-raster'
         elif layer.mapType == 'rgb':
             mapType = 'rgb'

Modified: grass/trunk/gui/wxpython/core/render.py
===================================================================
--- grass/trunk/gui/wxpython/core/render.py	2014-12-18 15:18:43 UTC (rev 63587)
+++ grass/trunk/gui/wxpython/core/render.py	2014-12-18 15:35:41 UTC (rev 63588)
@@ -651,7 +651,7 @@
             cmd['vector'] = ','.join(vect)
 
         if rast3d:
-            cmd['3draster'] = rast3d
+            cmd['raster_3d'] = rast3d
 
         ret, reg, msg = RunCommand('g.region',
                                    read = True,

Modified: grass/trunk/gui/wxpython/gmodeler/model.py
===================================================================
--- grass/trunk/gui/wxpython/gmodeler/model.py	2014-12-18 15:18:43 UTC (rev 63587)
+++ grass/trunk/gui/wxpython/gmodeler/model.py	2014-12-18 15:35:41 UTC (rev 63588)
@@ -729,7 +729,7 @@
                 rast.append(name)
             elif prompt == 'vector':
                 vect.append(name)
-            elif prompt == '3draster':
+            elif prompt == 'raster_3d':
                 rast3d.append(name)
         
         msg = ''
@@ -2348,7 +2348,7 @@
 """% ','.join(map(lambda x: "'" + x + "'", vect)))
         if rast3d:
             self.fd.write(
-r"""  run_command('g.remove', flags='f', type='3draster',
+r"""  run_command('g.remove', flags='f', type='raster_3d',
                       name=%s)
 """% ','.join(map(lambda x: "'" + x + "'", rast3d)))
         if not rast and not vect and not rast3d:

Modified: grass/trunk/gui/wxpython/gui_core/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/dialogs.py	2014-12-18 15:18:43 UTC (rev 63587)
+++ grass/trunk/gui/wxpython/gui_core/dialogs.py	2014-12-18 15:35:41 UTC (rev 63588)
@@ -1523,7 +1523,7 @@
         if sel == 0:
             ltype = 'raster'
         elif sel == 1:
-            ltype = '3draster'
+            ltype = 'raster_3d'
         else:
             ltype = 'vector'
         

Modified: grass/trunk/gui/wxpython/gui_core/forms.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/forms.py	2014-12-18 15:18:43 UTC (rev 63587)
+++ grass/trunk/gui/wxpython/gui_core/forms.py	2014-12-18 15:35:41 UTC (rev 63588)
@@ -206,7 +206,7 @@
                 maps_param = self.task.get_param('maps', element='name', raiseError=False)
                 if self.task.get_name().startswith('t') and maps_param is not None:
                     if maps_param['wxId'][0] != uid:
-                        element_dict = {'raster': 'strds', 'vector': 'stvds', '3draster': 'str3ds'}
+                        element_dict = {'raster': 'strds', 'vector': 'stvds', 'raster_3d': 'str3ds'}
                         self.data[win.GetParent().SetType] = {'etype': element_dict[type_param.get('value')]}
 
             map = layer = None
@@ -1195,7 +1195,7 @@
                                 # for t.(un)register:
                                 maps_param = self.task.get_param('maps', element = 'name', raiseError = False)
                                 if maps_param and orig_elem == 'stds':
-                                    element_dict = {'raster': 'strds', 'vector': 'stvds', '3draster': 'str3ds'}
+                                    element_dict = {'raster': 'strds', 'vector': 'stvds', 'raster_3d': 'str3ds'}
                                     elem = element_dict[type_param.get('default')]
                         
                         if self._giface and hasattr(self._giface, "_model"):

Modified: grass/trunk/gui/wxpython/gui_core/gselect.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/gselect.py	2014-12-18 15:18:43 UTC (rev 63587)
+++ grass/trunk/gui/wxpython/gui_core/gselect.py	2014-12-18 15:35:41 UTC (rev 63588)
@@ -434,11 +434,11 @@
         elementdict = {'cell':'raster',
                        'raster': 'raster',
                        'raster files':'raster',
-                       'grid3':'3draster',
-                       '3draster':'3draster',
-                       '3d-raster':'3draster',
-                       'raster3D':'3draster',
-                       'raster3D files':'3draster',
+                       'grid3':'raster_3d',
+                       '3draster':'raster_3d',
+                       '3d-raster':'raster_3d',
+                       'raster3D':'raster_3d',
+                       'raster3D files':'raster_3d',
                        'vector' : 'vector',
                        'binary vector files':'vector',
                        'dig':'oldvect',

Modified: grass/trunk/gui/wxpython/gui_core/simplelmgr.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/simplelmgr.py	2014-12-18 15:18:43 UTC (rev 63587)
+++ grass/trunk/gui/wxpython/gui_core/simplelmgr.py	2014-12-18 15:35:41 UTC (rev 63588)
@@ -348,7 +348,7 @@
 
     def AddRast3d(self, name, cmd, hidden, dialog):
         """Ads new raster3d layer."""
-        layer = self._layerList.AddNewLayer(name=name, mapType='3draster',
+        layer = self._layerList.AddNewLayer(name=name, mapType='raster_3d',
                                             active=True,
                                             cmd=cmd, hidden=hidden)
         return layer

Modified: grass/trunk/gui/wxpython/lmgr/datacatalog.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/datacatalog.py	2014-12-18 15:18:43 UTC (rev 63587)
+++ grass/trunk/gui/wxpython/lmgr/datacatalog.py	2014-12-18 15:35:41 UTC (rev 63588)
@@ -395,7 +395,7 @@
                 node = 'raster'
             else:
                 pasted = RunCommand('g.copy', rast3d=string)
-                node = '3draster'
+                node = 'raster_3d'
             if pasted == 0:
                 if self.selected_type == None:
                     self.selected_type = self.getItemByName(node, self.selected_mapset)
@@ -436,7 +436,7 @@
                     removed = RunCommand('g.remove', flags='f', type='raster',
                                          name=string)
                 else:
-                    removed = RunCommand('g.remove', flags='f', type='3draster',
+                    removed = RunCommand('g.remove', flags='f', type='raster_3d',
                                          name=string)
                 if (removed==0):
                     self.Delete(self.selected_layer)
@@ -459,7 +459,7 @@
             elif (self.GetItemText(self.selected_type)=='raster'):
                 self.parent.parent.AddMaps(layerName, 'raster', True)     
             else:
-                self.parent.parent.AddMaps(layerName, '3draster', True)
+                self.parent.parent.AddMaps(layerName, 'raster_3d', True)
                 label = "d.rast --q map="+string+"    -- completed. Go to 'Map layers' for further operations." # generate this message (command) automatically?
             self.showNotification.emit(message=label)
             Debug.msg(1,"LAYER "+self.GetItemText(self.selected_layer)+" DISPLAYED")

Modified: grass/trunk/gui/wxpython/lmgr/frame.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/frame.py	2014-12-18 15:18:43 UTC (rev 63587)
+++ grass/trunk/gui/wxpython/lmgr/frame.py	2014-12-18 15:35:41 UTC (rev 63588)
@@ -1851,7 +1851,7 @@
         """Add map layers to layer tree.
 
         :param list mapLayers: list of map names
-        :param str ltype: layer type ('raster', '3draster', 'vector')
+        :param str ltype: layer type ('raster', 'raster_3d', 'vector')
         :param bool check: True if new layers should be checked in
                            layer tree False otherwise
         """
@@ -1865,7 +1865,7 @@
             if ltype == 'raster':
                 cmd = ['d.rast', 'map=%s' % layerName]
                 wxType = 'raster'
-            elif ltype == '3draster':
+            elif ltype == 'raster_3d':
                 cmd = ['d.rast3d', 'map=%s' % layerName]
                 wxType = '3d-raster'
             elif ltype == 'vector':
@@ -1911,7 +1911,7 @@
 
         # TODO: standardize type identifiers
         convertType = {'raster': 'raster',
-                       '3d-raster': '3draster',
+                       '3d-raster': 'raster_3d',
                        'vector': 'vector'}
         try:
             grassType = convertType[ltype]

Modified: grass/trunk/gui/wxpython/lmgr/layertree.py
===================================================================
--- grass/trunk/gui/wxpython/lmgr/layertree.py	2014-12-18 15:18:43 UTC (rev 63587)
+++ grass/trunk/gui/wxpython/lmgr/layertree.py	2014-12-18 15:35:41 UTC (rev 63588)
@@ -732,11 +732,11 @@
         
         cmd = ['g.region']
         if rast:
-            cmd.append('rast=%s' % ','.join(rast))
+            cmd.append('raster=%s' % ','.join(rast))
         if vect:
-            cmd.append('vect=%s' % ','.join(vect))
+            cmd.append('vector=%s' % ','.join(vect))
         if rast3d:
-            cmd.append('3draster=%s' % ','.join(rast3d))
+            cmd.append('raster_3d=%s' % ','.join(rast3d))
         
         # print output to command log area
         if len(cmd) > 1:
@@ -801,7 +801,7 @@
             key = 'vector'
             label = _('Vector map')
         elif ltype == '3d-raster':
-            key = '3draster'
+            key = 'raster_3d'
             label = _('3D raster map')
         else:
             GError(_("Unsupported map type <%s>") % ltype, parent = self)

Modified: grass/trunk/gui/wxpython/mapwin/decorations.py
===================================================================
--- grass/trunk/gui/wxpython/mapwin/decorations.py	2014-12-18 15:18:43 UTC (rev 63587)
+++ grass/trunk/gui/wxpython/mapwin/decorations.py	2014-12-18 15:35:41 UTC (rev 63588)
@@ -236,7 +236,7 @@
             param = param.split('=')
             if param[0] == 'raster' and len(param) == 2:
                 inputs += 1
-            elif param[0] == '3draster' and len(param) == 2:
+            elif param[0] == 'raster_3d' and len(param) == 2:
                 inputs += 1
             if inputs == 1:
                 return True

Modified: grass/trunk/gui/wxpython/modules/mcalc_builder.py
===================================================================
--- grass/trunk/gui/wxpython/modules/mcalc_builder.py	2014-12-18 15:18:43 UTC (rev 63587)
+++ grass/trunk/gui/wxpython/modules/mcalc_builder.py	2014-12-18 15:35:41 UTC (rev 63588)
@@ -110,7 +110,7 @@
         if self.rast3d:
             self.funct_dict['z()'] = 'z()'
             self.funct_dict['tbres()'] = 'tbres()'
-            element = '3draster'
+            element = 'raster_3d'
         else:
             element = 'cell'
 
@@ -603,7 +603,7 @@
         name = self.newmaptxt.GetValue().strip(' "') + '@' + grass.gisenv()['MAPSET']
         ltype = 'raster'
         if self.rast3d:
-            ltype = '3draster'
+            ltype = 'raster_3d'
         self._giface.mapCreated.emit(name=name, ltype=ltype, add=self.addbox.IsChecked())
 
     def OnSaveExpression(self, event):



More information about the grass-commit mailing list