[GRASS-SVN] r41646 - in grass/branches/develbranch_6/gui/wxpython: . gui_modules xml

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Apr 1 09:44:34 EDT 2010


Author: martinl
Date: 2010-04-01 09:44:33 -0400 (Thu, 01 Apr 2010)
New Revision: 41646

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py
   grass/branches/develbranch_6/gui/wxpython/wxgui.py
   grass/branches/develbranch_6/gui/wxpython/xml/menudata.xml
Log:
wxGUI: add modeler to the menu
	GModeler: run model


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py	2010-04-01 11:46:48 UTC (rev 41645)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py	2010-04-01 13:44:33 UTC (rev 41646)
@@ -35,6 +35,7 @@
     globalvar.CheckForWx()
 import wx
 import wx.lib.ogl as ogl
+import wx.lib.flatnotebook as FN
 
 import menu
 import menudata
@@ -42,6 +43,7 @@
 import menuform
 import prompt
 import utils
+import goutput
 from   debug import Debug
 from   gcmd import GMessage
 
@@ -76,9 +78,18 @@
         self.SetToolBar(self.toolbar)
 
         self.statusbar = self.CreateStatusBar(number = 1)
+
+        self.notebook = FN.FlatNotebook(parent = self, id = wx.ID_ANY,
+                                        style = FN.FNB_FANCY_TABS | FN.FNB_BOTTOM |
+                                        FN.FNB_NO_NAV_BUTTONS | FN.FNB_NO_X_BUTTON)
         
         self.canvas = ModelCanvas(self)
         self.canvas.SetBackgroundColour(wx.WHITE)
+
+        self.goutput = goutput.GMConsole(parent = self, pageid = 1)
+                
+        self.modelPage   = self.notebook.AddPage(self.canvas, text=_('Model'))
+        self.commandPage = self.notebook.AddPage(self.goutput, text=_('Command output'))
         
         self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
         
@@ -89,7 +100,7 @@
         """!Do layout"""
         sizer = wx.BoxSizer(wx.VERTICAL)
 
-        sizer.Add(item = self.canvas, proportion = 1,
+        sizer.Add(item = self.notebook, proportion = 1,
                   flag = wx.EXPAND)
         
         self.SetAutoLayout(True)
@@ -193,8 +204,15 @@
         
     def OnRunModel(self, event):
         """!Run entire model"""
-        pass
-
+        for action in self.actions:
+            self.SetStatusText(_('Running model...'), 0)
+            self.goutput.RunCmd(command = action.GetLog(string = False),
+                                onDone = self.OnDone)
+        
+    def OnDone(self, event):
+        """!Computation finished"""
+        self.SetStatusText('', 0)
+        
     def OnValidateModel(self, event):
         """!Validate entire model"""
         for s in self.actions:

Modified: grass/branches/develbranch_6/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/wxgui.py	2010-04-01 11:46:48 UTC (rev 41645)
+++ grass/branches/develbranch_6/gui/wxpython/wxgui.py	2010-04-01 13:44:33 UTC (rev 41646)
@@ -89,6 +89,7 @@
 import gui_modules.ogc_services as ogc_services
 import gui_modules.prompt as prompt
 import gui_modules.menu as menu
+import gui_modules.gmodeler as gmodeler
 from   gui_modules.debug import Debug
 from   gui_modules.help import MenuTreeWindow
 from   gui_modules.help import AboutWindow
@@ -254,11 +255,17 @@
             self.SetTitle(self.baseTitle + " - " +  os.path.basename(self.workspaceFile) + '*')
         
     def OnGeorectify(self, event):
+        """!Launch georectifier module
         """
-        Launch georectifier module
-        """
         georect.GeorectWizard(self)
+
+    def OnGModeler(self, event):
+        """!Launch Graphical Modeler"""
+        win = gmodeler.ModelFrame(parent = self)
+        win.CentreOnScreen()
         
+        win.Show()
+        
     def OnMapsets(self, event):
         """
         Launch mapset access dialog

Modified: grass/branches/develbranch_6/gui/wxpython/xml/menudata.xml
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/xml/menudata.xml	2010-04-01 11:46:48 UTC (rev 41645)
+++ grass/branches/develbranch_6/gui/wxpython/xml/menudata.xml	2010-04-01 13:44:33 UTC (rev 41646)
@@ -628,6 +628,12 @@
 	</menuitem>
 	<separator />
 	<menuitem>
+	  <label>Graphical modeler</label>
+	  <help>Launch Graphical modeler</help>
+	  <handler>OnGModeler</handler>
+	</menuitem>
+	<separator />
+	<menuitem>
 	  <label>NVIZ (requires Tcl/Tk)</label>
 	  <help>nviz - Visualization and animation tool for GRASS data.</help>
 	  <keywords>raster,vector,visualization</keywords>



More information about the grass-commit mailing list