[GRASS-SVN] r39891 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Dec 4 04:04:50 EST 2009


Author: hcho
Date: 2009-12-04 04:04:45 -0500 (Fri, 04 Dec 2009)
New Revision: 39891

Modified:
   grass/trunk/gui/wxpython/gui_modules/mapdisp_command.py
   grass/trunk/gui/wxpython/gui_modules/render.py
Log:
Imported debug as Debug.
Removed item= parameters (not valid anymore) from AddLayer.
Fixed a bug in command file reading.


Modified: grass/trunk/gui/wxpython/gui_modules/mapdisp_command.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mapdisp_command.py	2009-12-04 07:30:47 UTC (rev 39890)
+++ grass/trunk/gui/wxpython/gui_modules/mapdisp_command.py	2009-12-04 09:04:45 UTC (rev 39891)
@@ -17,6 +17,7 @@
 import sys
 import time
 
+from debug import Debug
 from threading import Thread
 
 class Command(Thread):
@@ -48,10 +49,21 @@
                 try:
                     Debug.msg (3, "Command.run(): cmd=%s" % (line))
 
-                    self.map.AddLayer(item=None, type="raster",
+                    cmd = line.split(" ")
+                    opacity = 1
+                    if " opacity=" in line:
+                        cmd2 = cmd
+                        cmd = []
+                        for c in cmd2:
+                            if c.find("opacity=") == 0:
+                                opacity = float(c.split("=")[1]) / 100
+                            else:
+                                cmd.append(c)
+
+                    self.map.AddLayer(type="raster",
                                       name='',
-                                      command=line,
-                                      l_opacity=1)
+                                      command=cmd,
+                                      l_opacity=opacity)
 
                     self.parent.redraw =True
 

Modified: grass/trunk/gui/wxpython/gui_modules/render.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/render.py	2009-12-04 07:30:47 UTC (rev 39890)
+++ grass/trunk/gui/wxpython/gui_modules/render.py	2009-12-04 09:04:45 UTC (rev 39891)
@@ -1335,14 +1335,12 @@
     map.width = 640
     map.height = 480
 
-    map.AddLayer(item=None,
-                 type="raster",
+    map.AddLayer(type="raster",
                  name="elevation.dem",
                  command = ["d.rast", "elevation.dem at PERMANENT", "catlist=1000-1500", "-i"],
                  l_opacity=.7)
 
-    map.AddLayer(item=None,
-                 type="vector",
+    map.AddLayer(type="vector",
                  name="streams",
                  command = ["d.vect", "streams at PERMANENT", "color=red", "width=3", "type=line"])
 



More information about the grass-commit mailing list