Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

OmgModellerLocalPlugin Class Reference

#include <omgmodellerlocalplugin.h>

Inheritance diagram for OmgModellerLocalPlugin:

Inheritance graph
[legend]
Collaboration diagram for OmgModellerLocalPlugin:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 OmgModellerLocalPlugin (QObject *parent=0)
 ~OmgModellerLocalPlugin ()
QString createModel (OmgModel *theModel)
void projectModel (OmgModel *theModel)
const QStringList getAlgorithmList ()
const OmgAlgorithmSet getAlgorithmSet ()
const OmgAlgorithm getAlgorithm (QString theAlgorithmId)
void setCreationProgress (int theProgress)
void setProjectionProgress (int theProgress)
const QString getLayers (QString theBaseDir)
const QString getName ()

Private Slots

void appendToLog (QString theGuid, QString theMessage)

Private Member Functions

 Q_INTERFACES (OmgModellerPluginInterface)
bool initialise ()
void setMapProgress (int theProgress)
void setModelProgress (int theProgress)

Private Attributes

OpenModeller * mpOpenModeller
OmgOmLogCallbackmpLogCallBack
QTextStream mTextStream
int mModelProgress
int mMapProgress
QString mModelGuid
QString mModelLog

Static Private Attributes

static bool mAlgFactoryStartedFlag = false

Constructor & Destructor Documentation

OmgModellerLocalPlugin::OmgModellerLocalPlugin QObject parent = 0  ) 
 

Definition at line 60 of file omgmodellerlocalplugin.cpp.

References initialise(), and output.

Here is the call graph for this function:

OmgModellerLocalPlugin::~OmgModellerLocalPlugin  ) 
 

Note:
setting the callback to 0 will delete mpLogCallBack so there is no need to delete mpLogCallBack manually

Definition at line 70 of file omgmodellerlocalplugin.cpp.

References mpLogCallBack, and mpOpenModeller.


Member Function Documentation

void OmgModellerLocalPlugin::appendToLog QString  theGuid,
QString  theMessage
[private, slot]
 

Slot for recordng messages from the plugin messenger into a string that can then be appended to the model log.

Parameters:
theGuid of the model as passed by the messenger
theMessage the first parameter is silently dropped but its needed to match the signal

Definition at line 390 of file omgmodellerlocalplugin.cpp.

References mModelLog.

Referenced by initialise().

QString OmgModellerLocalPlugin::createModel OmgModel theModel  )  [virtual]
 

Create an initial model definition

Parameters:
&OmgModel Reference to the model object that will be used as a basis for the model

Implements OmgModellerPluginInterface.

Definition at line 118 of file omgmodellerlocalplugin.cpp.

References OmgPluginMessenger::emitModelCreationProgress(), OmgPluginMessenger::emitModelDone(), OmgPluginMessenger::emitModelError(), OmgPluginMessenger::emitModelMessage(), mModelGuid, mModelLog, mModelProgress, mpLogCallBack, mpOpenModeller, and OmgOmLogCallback::setModelGuid().

Here is the call graph for this function:

const OmgAlgorithm OmgModellerLocalPlugin::getAlgorithm QString  theAlgorithmId  ) 
 

Get an algorithm given its id.

Returns:
OmgAlgorithm An empty algorithm will be returned if the algorithm id could not be found.

Definition at line 293 of file omgmodellerlocalplugin.cpp.

References OmgAlgorithm::addParameter(), mpOpenModeller, OmgAlgorithm::setAbsence(), OmgAlgorithm::setAuthor(), OmgAlgorithm::setBibliography(), OmgAlgorithm::setCategorical(), OmgAlgorithm::setCodeAuthor(), OmgAlgorithm::setContact(), OmgAlgorithmParameter::setDefault(), OmgAlgorithmParameter::setDescription(), OmgAlgorithm::setDescription(), OmgGuid::setGuid(), OmgAlgorithmParameter::setId(), OmgAlgorithm::setId(), OmgAlgorithmParameter::setMaximum(), OmgAlgorithmParameter::setMinimum(), OmgAlgorithmParameter::setName(), OmgAlgorithm::setName(), OmgAlgorithm::setOrigin(), OmgAlgorithmParameter::setOverview(), OmgAlgorithm::setOverview(), OmgAlgorithmParameter::setType(), and OmgAlgorithm::setVersion().

Referenced by getAlgorithmSet().

Here is the call graph for this function:

const QStringList OmgModellerLocalPlugin::getAlgorithmList  )  [virtual]
 

Get a list of the algorithm names. Use getAlgorithmId with one of the returned names to find out an algs id

Returns:
QStringList A String List of the algorithm names

Implements OmgModellerPluginInterface.

Definition at line 255 of file omgmodellerlocalplugin.cpp.

References mpOpenModeller.

Referenced by OmgModellerLocalPluginTest::getAlgorithms().

const OmgAlgorithmSet OmgModellerLocalPlugin::getAlgorithmSet  )  [virtual]
 

Get a collection of algorithm objects in the form of an AgorithmSet. The collection represents every algorithm that is available from the plugin implementing this interface

Returns:
OmgAlgorithmSet - a set of algorithms

Implements OmgModellerPluginInterface.

Definition at line 272 of file omgmodellerlocalplugin.cpp.

References OmgAlgorithmSet::addAlgorithm(), getAlgorithm(), mpOpenModeller, OmgAlgorithmSet::setDescription(), and OmgAlgorithmSet::setName().

Here is the call graph for this function:

const QString OmgModellerLocalPlugin::getLayers QString  theBaseDir  )  [virtual]
 

Get a list of layers by recursively searching a directory heirachy and testing if each file is a gdal loadable file or not. The actual implementation of how this is done is up to the plugin - remote services may have a preconfigured list of available layers that is simply returned without any filesystem scanning.

Parameters:
baseDirectory This is the directory from which to start scanning. This parameter may be ignored by the plugin if the remote resource does not support user specified base directories. In the case of the local modeller plugin the parameter is accepted.
Returns:
QString An xml document providing teh list of available layers.

Implements OmgModellerPluginInterface.

Definition at line 395 of file omgmodellerlocalplugin.cpp.

References Omgui::getLayers().

Referenced by OmgModellerLocalPluginTest::getLayers().

Here is the call graph for this function:

const QString OmgModellerLocalPlugin::getName  )  [inline, virtual]
 

Get the user friendly name for this plugin

Returns:
QString - the name of this plugin

Implements OmgModellerPluginInterface.

Definition at line 140 of file omgmodellerlocalplugin.h.

bool OmgModellerLocalPlugin::initialise  )  [private]
 

Private method called by any ctor on initial start up. It will go and find the algorithm list etc.

Definition at line 79 of file omgmodellerlocalplugin.cpp.

References appendToLog(), mAlgFactoryStartedFlag, mapCallback(), modelCallback(), mpLogCallBack, and mpOpenModeller.

Referenced by OmgModellerLocalPlugin().

Here is the call graph for this function:

void OmgModellerLocalPlugin::projectModel OmgModel theModel  )  [virtual]
 

Project a model into a climate dataset. the model passed in as a parameter must have a valid model definition

Parameters:
&OmgModel Reference to the model object that will be used to project this model.

Implements OmgModellerPluginInterface.

Definition at line 171 of file omgmodellerlocalplugin.cpp.

References OmgPluginMessenger::emitModelError(), OmgPluginMessenger::emitModelMessage(), OmgPluginMessenger::emitModelProjectionProgress(), Omgui::getOutputFormatExtension(), mModelGuid, mModelLog, mModelProgress, mpLogCallBack, mpOpenModeller, and OmgOmLogCallback::setModelGuid().

Here is the call graph for this function:

OmgModellerLocalPlugin::Q_INTERFACES OmgModellerPluginInterface   )  [private]
 

void OmgModellerLocalPlugin::setCreationProgress int  theProgress  ) 
 

Mutator for creation progress variable Mainly intended to be used by callbacks. Will emit a modelCreationProgressUpdate signal if the new value differs from the old one.

Parameters:
int theProgress

Definition at line 371 of file omgmodellerlocalplugin.cpp.

References OmgPluginMessenger::emitModelCreationProgress(), mModelGuid, and mModelProgress.

Referenced by modelCallback().

void OmgModellerLocalPlugin::setMapProgress int  theProgress  )  [private]
 

This is used by the om callbacks to let us know of model creation progress changes

Parameters:
theProgress how far the task has progressed.

void OmgModellerLocalPlugin::setModelProgress int  theProgress  )  [private]
 

This is used by the om callbacks to let us know of map projection progress changes

Parameters:
theProgress how far the task has progressed.

void OmgModellerLocalPlugin::setProjectionProgress int  theProgress  ) 
 

Mutator for projection progress variable Mainly intended to be used by callbacks. Will emit a modelCreationProgressUpdate signal if the new value differs from the old one.

Parameters:
int theProgress

Definition at line 380 of file omgmodellerlocalplugin.cpp.

References OmgPluginMessenger::emitModelProjectionProgress(), mMapProgress, mModelGuid, and mModelProgress.

Referenced by mapCallback().


Member Data Documentation

bool OmgModellerLocalPlugin::mAlgFactoryStartedFlag = false [static, private]
 

A flag to see whether the Om Aglorithm Factory has already been initialised. The factory should only be initialised once in the entire lifetime of you application. If you do it more than once you will get duplicate entries when you read the alg list. Because of this we use teh flag below to determin if the Factory has previously been initialised. C++ does not guarantee the initialised state of a variable, so variable is initialised outside the class (see top of accompanying .cpp file).

Definition at line 60 of file omgmodellerlocalplugin.cpp.

Referenced by initialise().

int OmgModellerLocalPlugin::mMapProgress [private]
 

Definition at line 163 of file omgmodellerlocalplugin.h.

Referenced by setProjectionProgress().

QString OmgModellerLocalPlugin::mModelGuid [private]
 

Globally unique id of the model currently being executed

Definition at line 165 of file omgmodellerlocalplugin.h.

Referenced by createModel(), projectModel(), setCreationProgress(), and setProjectionProgress().

QString OmgModellerLocalPlugin::mModelLog [private]
 

Log for the model currently being executed

Definition at line 167 of file omgmodellerlocalplugin.h.

Referenced by appendToLog(), createModel(), and projectModel().

int OmgModellerLocalPlugin::mModelProgress [private]
 

Definition at line 162 of file omgmodellerlocalplugin.h.

Referenced by createModel(), projectModel(), setCreationProgress(), and setProjectionProgress().

OmgOmLogCallback* OmgModellerLocalPlugin::mpLogCallBack [private]
 

Definition at line 160 of file omgmodellerlocalplugin.h.

Referenced by createModel(), initialise(), projectModel(), and ~OmgModellerLocalPlugin().

OpenModeller* OmgModellerLocalPlugin::mpOpenModeller [private]
 

Definition at line 159 of file omgmodellerlocalplugin.h.

Referenced by createModel(), getAlgorithm(), getAlgorithmList(), getAlgorithmSet(), initialise(), projectModel(), and ~OmgModellerLocalPlugin().

QTextStream OmgModellerLocalPlugin::mTextStream [private]
 

Definition at line 161 of file omgmodellerlocalplugin.h.


The documentation for this class was generated from the following files:
Generated on Mon Apr 28 15:13:48 2008 for openModellerDesktop by  doxygen 1.4.1-20050210