GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
model.Model Class Reference

Class representing the model. More...

Inheritance diagram for model.Model:
Collaboration diagram for model.Model:

Public Member Functions

def __init__
 
def GetCanvas
 Get canvas or None. More...
 
def GetItems
 Get list of model items. More...
 
def GetItem
 Get item of given id. More...
 
def GetNumItems
 Get number of items. More...
 
def GetNextId
 Get next id (data ignored) More...
 
def GetProperties
 Get model properties. More...
 
def GetVariables
 Get model variables. More...
 
def SetVariables
 Set model variables. More...
 
def Reset
 Reset model. More...
 
def RemoveItem
 Remove item from model. More...
 
def FindAction
 Find action by id. More...
 
def GetData
 Get list of data items. More...
 
def FindData
 Find data item in the model. More...
 
def LoadModel
 Load model definition stored in GRASS Model XML file (gxm) More...
 
def AddItem
 Add item to the list. More...
 
def IsValid
 
def Validate
 Validate model, return None if model is valid otherwise error string. More...
 
def OnPrepare
 
def RunAction
 Run given action. More...
 
def Run
 Run model. More...
 
def DeleteIntermediateData
 Detele intermediate data. More...
 
def GetIntermediateData
 Get info about intermediate data. More...
 
def Update
 Update model. More...
 
def IsParameterized
 Return True if model is parameterized. More...
 
def Parameterize
 Return parameterized options. More...
 

Data Fields

 items
 
 properties
 
 variables
 
 variablesParams
 
 canvas
 
 fileInput
 

Detailed Description

Class representing the model.

Definition at line 52 of file model.py.

Constructor & Destructor Documentation

def model.Model.__init__ (   self,
  canvas = None 
)

Definition at line 54 of file model.py.

Member Function Documentation

def model.Model.AddItem (   self,
  newItem 
)

Add item to the list.

Definition at line 340 of file model.py.

References model.Model.items.

Referenced by gselect.TreeCtrlComboPopup.GetAdjustedSize(), and model.Model.LoadModel().

def model.Model.DeleteIntermediateData (   self,
  log 
)

Detele intermediate data.

Definition at line 632 of file model.py.

References model.Model.GetIntermediateData().

Referenced by model.Model.Run().

def model.Model.FindAction (   self,
  aId 
)
def model.Model.FindData (   self,
  value,
  prompt 
)

Find data item in the model.

Parameters
valuevalue
promptprompt
Returns
ModelData instance
None if not found

Definition at line 205 of file model.py.

References model.Model.GetData(), dialogs.VariableListCtrl.GetData(), and dialogs.ItemListCtrl.GetData().

def model.Model.GetCanvas (   self)

Get canvas or None.

Definition at line 67 of file model.py.

References model.Model.canvas, and frame.ModelFrame.canvas.

def model.Model.GetData (   self)
def model.Model.GetIntermediateData (   self)

Get info about intermediate data.

Definition at line 643 of file model.py.

References model.Model.GetData(), dialogs.VariableListCtrl.GetData(), and dialogs.ItemListCtrl.GetData().

Referenced by model.Model.DeleteIntermediateData().

def model.Model.GetItems (   self,
  objType = None 
)
def model.Model.GetNextId (   self)

Get next id (data ignored)

Returns
next id to be used (default: 1)

Definition at line 108 of file model.py.

References model.Model.items.

def model.Model.GetNumItems (   self,
  actionOnly = False 
)
def model.Model.GetProperties (   self)

Get model properties.

Definition at line 122 of file model.py.

References model.Model.properties.

def model.Model.GetVariables (   self,
  params = False 
)

Get model variables.

Definition at line 126 of file model.py.

References model.Model.variables, and model.Model.variablesParams.

Referenced by model.Model.Run(), and model.Model.Validate().

def model.Model.IsParameterized (   self)

Return True if model is parameterized.

Definition at line 678 of file model.py.

References model.Model.Parameterize().

def model.Model.IsValid (   self)
Return True if model is valid

Definition at line 353 of file model.py.

References model.Model.Validate().

def model.Model.LoadModel (   self,
  filename 
)

Load model definition stored in GRASS Model XML file (gxm)

Todo:
Validate against DTD

Raise exception on error.

Definition at line 221 of file model.py.

References model.Model.AddItem(), model.Model.canvas, frame.ModelFrame.canvas, model.Model.FindAction(), model.Model.GetItem(), model.Model.properties, and model.Model.variables.

def model.Model.OnPrepare (   self,
  item,
  params 
)

Definition at line 464 of file model.py.

References model.Model._substituteFile().

Referenced by model.Model.RunAction().

def model.Model.RemoveItem (   self,
  item 
)

Remove item from model.

Returns
list of related items to remove/update

Definition at line 141 of file model.py.

References model.Model.GetItems(), dialogs.ModelLoopDialog.GetItems(), dialogs.ModelConditionDialog.GetItems(), and dialogs.ItemCheckListCtrl.GetItems().

def model.Model.Reset (   self)

Reset model.

Definition at line 137 of file model.py.

References model.Model.items.

def model.Model.Run (   self,
  log,
  onDone,
  parent = None 
)
def model.Model.RunAction (   self,
  item,
  params,
  log,
  onDone,
  onPrepare = None,
  statusbar = None 
)

Run given action.

Parameters
itemaction item
paramsparameters dict
loglogging window
onDoneon-done method
onPrepareon-prepare method
statusbarwx.StatusBar instance or None

Definition at line 467 of file model.py.

References model.Model.OnPrepare().

Referenced by model.Model.Run().

def model.Model.SetVariables (   self,
  data 
)

Set model variables.

Definition at line 133 of file model.py.

References model.Model.variables.

def model.Model.Validate (   self)

Field Documentation

model.Model.canvas

Definition at line 65 of file model.py.

Referenced by gprint.MapPrint.__init__(), model.Model.GetCanvas(), and model.Model.LoadModel().

model.Model.fileInput

Definition at line 403 of file model.py.

model.Model.variables
model.Model.variablesParams

Definition at line 63 of file model.py.

Referenced by model.Model.GetVariables(), and model.Model.Parameterize().


The documentation for this class was generated from the following file: