Sfoglia il codice sorgente

implement g.gui.gmodeler

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@53744 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 12 anni fa
parent
commit
b1321fbfd1

+ 1 - 1
gui/wxpython/Makefile

@@ -1,6 +1,6 @@
 MODULE_TOPDIR = ../..
 
-SUBDIRS = docs mapswipe
+SUBDIRS = docs mapswipe gmodeler
 EXTRA_CLEAN_FILES = menustrings.py build_ext.pyc
 
 include $(MODULE_TOPDIR)/include/Make/Dir.make

+ 13 - 0
gui/wxpython/gmodeler/Makefile

@@ -0,0 +1,13 @@
+MODULE_TOPDIR = ../../..
+
+PGM = g.gui.gmodeler
+WXPGM = Modeler
+
+include $(MODULE_TOPDIR)/include/Make/Script.make
+
+default: script
+	-rm -f $(PGM).tmp.html
+	$(MAKE) $(HTMLDIR)/wxGUI.$(WXPGM).html
+
+$(HTMLDIR)/wxGUI.$(WXPGM).html: $(PGM).html | $(HTMLDIR)
+	$(PYTHON) $(GISBASE)/tools/mkhtml.py $(PGM) $(GRASS_VERSION_DATE) > $@

+ 0 - 19
gui/wxpython/gmodeler/frame.py

@@ -28,9 +28,6 @@ import tempfile
 import copy
 import re
 
-if __name__ == "__main__":
-    sys.path.append(os.path.join(os.getenv('GISBASE'), 'etc', 'gui', 'wxpython'))
-
 import wx
 from   wx.lib import ogl
 import wx.lib.flatnotebook    as FN
@@ -1635,19 +1632,3 @@ class PythonPanel(wx.Panel):
     def IsEmpty(self):
         """!Check if python script is empty"""
         return len(self.body.GetText()) == 0
-        
-def main():
-    import gettext
-    gettext.install('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale'), unicode = True)
-    
-    app = wx.PySimpleApp()
-    wx.InitAllImageHandlers()
-    frame = ModelFrame(parent = None)
-    if len(sys.argv) > 1:
-        frame.LoadModelFile(sys.argv[1])
-    frame.Show()
-    
-    app.MainLoop()
-    
-if __name__ == "__main__":
-    main()

+ 1 - 1
gui/wxpython/docs/wxGUI.Modeler.html

@@ -28,7 +28,7 @@ The modeler currently allows to:
 
 <center>
 <br>
-<img src="wxGUI_modeler.jpg" border="1" alt="screenshot">
+<img src="gmodeler_frame.jpg" border="1" alt="screenshot">
 <br><br>
 </center>
 

+ 61 - 0
gui/wxpython/gmodeler/g.gui.gmodeler.py

@@ -0,0 +1,61 @@
+#!/usr/bin/env python
+############################################################################
+#
+# MODULE:    Graphical Modeler
+# AUTHOR(S): Martin Landa <landa.martin gmail.com>
+# PURPOSE:   Graphical Modeler to create, edit, and manage models
+# COPYRIGHT: (C) 2010-2012 by Martin Landa, and the GRASS Development Team
+#
+#  This program is free software; you can 1redistribute it and/or
+#  modify it under the terms of the GNU General Public License as
+#  published by the Free Software Foundation; either version 2 of the
+#  License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful, but
+#  WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  General Public License for more details.
+#
+############################################################################
+
+#%module
+#% description: Allows to interactively create, edit and manage models.
+#% keywords: general
+#% keywords: gui
+#% keywords: graphical modeler
+#% keywords: workflow
+#%end
+#%option G_OPT_F_INPUT
+#% key: file
+#% description: Name of model file to be loaded (*.gmx)
+#% required: no
+#%end
+
+import os
+import sys
+
+import  wx
+import gettext
+
+import grass.script as grass
+
+sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
+
+from gmodeler.frame import ModelFrame
+
+def main():
+    import gettext
+    gettext.install('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale'), unicode = True)
+    
+    app = wx.PySimpleApp()
+    wx.InitAllImageHandlers()
+    frame = ModelFrame(parent = None)
+    if options['file']:
+        frame.LoadModelFile(options['file'])
+    frame.Show()
+    
+    app.MainLoop()
+    
+if __name__ == "__main__":
+    options, flags = grass.parser()
+    main()

+ 48 - 0
gui/wxpython/gmodeler/g.gui.mapswipe.html

@@ -0,0 +1,48 @@
+<!-- meta page description: wxGUI Map Swipe -->
+<!-- meta page index: wxGUI -->
+<h2>DESCRIPTION</h2>
+
+The <b>Map Swipe</b> is a <em><a href="wxGUI.html">wxGUI</a></em> component
+which allows the user to interactively compare two raster maps of the same
+area by revealing different parts of the raster maps.
+It is useful e.g. for comparing raster maps from different time periods.
+Map Swipe can be launched from the menu <tt>File -&gt; Map Swipe</tt>.
+
+<p>
+Map Swipe allows to:
+
+<ul>
+  <li>switch orientation of the swipe line (horizontal or vertical)</li>
+  <li>zooming, panning</li>
+  <li>automatically load maps when opening Map Swipe with two selected raster maps in Layer Manager</li>
+</ul>
+
+<center>
+<br>
+<img src="mapswipe_tsunami.jpg" border="1" alt="Map swipe screenshot">
+<br>Pre and post disaster images of the tsunami in Japan in 2011. The upper MODIS image
+taken on February 26, 2011, shows the coastline under normal conditions while the lower
+MODIS image on March 13, 2011, shows a clear view of tsunami flooding along the coastline.
+Water, black and dark blue in these false-color images, still covers the ground as much
+as five kilometers (three miles) from the coast.
+Source: <a href="http://earthobservatory.nasa.gov/NaturalHazards/view.php?id=49634">Earth Observatory/NASA</a>
+<br>
+</center>
+
+<h2>SEE ALSO</h2>
+
+<em>
+  <a href="wxGUI.html">wxGUI</a><br>
+  <a href="wxGUI.Components.html">wxGUI components</a>
+</em>
+
+<p>
+See also the user <a href="http://grass.osgeo.org/wiki/WxGUI_Map_Swipe">wiki</a> page.
+
+<h2>AUTHOR</h2>
+
+Anna Kratochvilova,
+<a href="http://www.cvut.cz">Czech Technical University in Prague</a>, Czech Republic
+
+<p>
+<i>$Date$</i>

gui/wxpython/docs/wxGUI_modeler.jpg → gui/wxpython/gmodeler/gmodeler_frame.jpg