[GRASS-SVN] r41647 - in grass/trunk/gui/wxpython: . gui_modules xml
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Apr 1 09:47:45 EDT 2010
Author: martinl
Date: 2010-04-01 09:47:44 -0400 (Thu, 01 Apr 2010)
New Revision: 41647
Modified:
grass/trunk/gui/wxpython/gui_modules/gmodeler.py
grass/trunk/gui/wxpython/wxgui.py
grass/trunk/gui/wxpython/xml/menudata.xml
grass/trunk/gui/wxpython/xml/menudata_modeler.xml
Log:
wxGUI: add modeler to the menu
GModeler: run model
about window
(merge r41645 & r41646 from devbr6)
Modified: grass/trunk/gui/wxpython/gui_modules/gmodeler.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gmodeler.py 2010-04-01 13:44:33 UTC (rev 41646)
+++ grass/trunk/gui/wxpython/gui_modules/gmodeler.py 2010-04-01 13:47:44 UTC (rev 41647)
@@ -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:
@@ -260,6 +278,19 @@
grass.run_command('g.manual',
entry = 'wxGUI.Modeler')
+ def OnAbout(self, event):
+ """!Display About window"""
+ info = wx.AboutDialogInfo()
+
+ info.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))
+ info.SetName(_('wxGUI Graphical Modeler'))
+ info.SetWebSite('http://grass.osgeo.org')
+ info.SetDescription(_('(C) 2010 by the GRASS Development Team\n\n'
+ 'This program is free software under the GNU General Public License'
+ '(>=v2). Read the file COPYING that comes with GRASS for details.'))
+
+ wx.AboutBox(info)
+
def GetOptData(self, dcmd, layer, params, propwin):
"""!Process action data"""
layer.SetProperties(dcmd, params, propwin)
@@ -398,7 +429,7 @@
file.close()
return True
-
+
class ModelCanvas(ogl.ShapeCanvas):
"""!Canvas where model is drawn"""
def __init__(self, parent):
Modified: grass/trunk/gui/wxpython/wxgui.py
===================================================================
--- grass/trunk/gui/wxpython/wxgui.py 2010-04-01 13:44:33 UTC (rev 41646)
+++ grass/trunk/gui/wxpython/wxgui.py 2010-04-01 13:47:44 UTC (rev 41647)
@@ -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/trunk/gui/wxpython/xml/menudata.xml
===================================================================
--- grass/trunk/gui/wxpython/xml/menudata.xml 2010-04-01 13:44:33 UTC (rev 41646)
+++ grass/trunk/gui/wxpython/xml/menudata.xml 2010-04-01 13:47:44 UTC (rev 41647)
@@ -621,6 +621,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>
Modified: grass/trunk/gui/wxpython/xml/menudata_modeler.xml
===================================================================
--- grass/trunk/gui/wxpython/xml/menudata_modeler.xml 2010-04-01 13:44:33 UTC (rev 41646)
+++ grass/trunk/gui/wxpython/xml/menudata_modeler.xml 2010-04-01 13:47:44 UTC (rev 41647)
@@ -78,6 +78,13 @@
<help>Display the HTML man pages of Graphical modeler</help>
<handler>OnHelp</handler>
</menuitem>
+ <separator />
+ <menuitem>
+ <label>About Graphical Modeler</label>
+ <help>Display information about Graphical Modeler</help>
+ <handler>OnAbout</handler>
+ </menuitem>
+
</items>
</menu>
</menubar>
More information about the grass-commit
mailing list