Ver código fonte

wxGUI: mapdisp module splitted into more modules

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@35190 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 16 anos atrás
pai
commit
bcaf812cff

+ 2 - 0
gui/wxpython/gui_modules/__init__.py

@@ -11,6 +11,8 @@ all = [
     "gselect.py",
     "histogram.py",
     "location_wizard.py",
+    "mapdisp_command.py",
+    "mapdisp_window.py",
     "mapdisp.py",
     "mcalc_builder.py",
     "menudata.py",

Diferenças do arquivo suprimidas por serem muito extensas
+ 13 - 2487
gui/wxpython/gui_modules/mapdisp.py


+ 60 - 0
gui/wxpython/gui_modules/mapdisp_command.py

@@ -0,0 +1,60 @@
+"""
+@package mapdisp.py
+
+@brief Command line useg of GIS map display canvas.view).
+
+Classes:
+ - Command
+
+(C) 2006-2009 by the GRASS Development Team
+This program is free software under the GNU General Public
+License (>=v2). Read the file COPYING that comes with GRASS
+for details.
+
+@author Jachym Cepicky
+"""
+
+from threading import Thread
+
+class Command(Thread):
+    """
+    Creates thread which will observe the command file and see, if
+    there is new command to be executed
+    """
+    def __init__ (self, parent, Map):
+        Thread.__init__(self)
+
+        global cmdfilename
+
+        self.parent = parent
+        self.map = Map
+        self.cmdfile = open(cmdfilename, "r")
+
+    def run(self):
+        """
+        Run this in thread
+        """
+        dispcmd = []
+        while 1:
+            self.parent.redraw = False
+            line = self.cmdfile.readline().strip()
+            if line == "quit":
+                break
+
+            if line:
+                try:
+                    Debug.msg (3, "Command.run(): cmd=%s" % (line))
+
+                    self.map.AddLayer(item=None, type="raster",
+                                      name='',
+                                      command=line,
+                                      l_opacity=1)
+
+                    self.parent.redraw =True
+
+                except Exception, e:
+                    print "Command Thread: ",e
+
+            time.sleep(0.1)
+
+        sys.exit()

Diferenças do arquivo suprimidas por serem muito extensas
+ 2454 - 0
gui/wxpython/gui_modules/mapdisp_window.py