Minor updates to fix build problems and dynamically fetch algorithm list from openModeler lib (still inprogress). Note the makefile is hard coded to look for openmodeller includes in /usr/local/include/openmodeller

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@1116 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
timlinux 2004-03-28 20:58:06 +00:00
parent 20130e358e
commit 35402e471f
3 changed files with 40 additions and 9 deletions

View File

@ -55,12 +55,11 @@ openmodellerguibase.cpp: openmodellerguibase.h openmodellerguibase.ui
BUILT_SOURCES = $(plugin_MOC) $(plugin_UI)
AM_CXXFLAGS := $(CXXFLAGS) $(EXTRA_CXXFLAGS) $(QT_CXXFLAGS) $(DEBUG_QGIS) -I../../src
AM_CXXFLAGS := $(CXXFLAGS) $(EXTRA_CXXFLAGS) $(QT_CXXFLAGS) $(DEBUG_QGIS) -I../../src -I/usr/local/include -I/usr/local/include/openmodeller
libopenmodellerplugin_la_LIBADD = $(QT_LDADD) ../../src/libqgis.la -L/usr/lib -lopenmodeller
libopenmodellerplugin_la_LDFLAGS = -avoid-version -module
##
## For standalone executable
##

View File

@ -29,9 +29,10 @@
//
//openmodeller includes
#include <om_control.hh>
#include <om.hh>
#include <openmodeller/om_control.hh>
#include <openmodeller/om.hh>
#include "file_parser.hh"
#include <openmodeller/om.hh>
//standard includes
#include <stdlib.h>
@ -41,17 +42,46 @@
OpenModellerGui::OpenModellerGui()
: OpenModellerGuiBase()
{
getAlgorithmList();
}
OpenModellerGui::OpenModellerGui( QWidget* parent , const char* name , bool modal , WFlags fl )
: OpenModellerGuiBase( parent, name, modal, fl )
{
getAlgorithmList();
}
OpenModellerGui::~OpenModellerGui()
{
}
void OpenModellerGui::getAlgorithmList()
{
ControlInterface myController;
QStringList * myQStringList = new QStringList();
// Find out which model algorithm is to be used.
Algorithm **myAlgorithmsPointerArray = myController.availableAlgorithms();
Algorithm *myAlgorithm;
std::cerr << "-------------- openModeller plugin : Reading algorithm list..." << std::endl;
while ( myAlgorithm = *myAlgorithmsPointerArray++ )
{
std::cerr << "Found Algorithm: " << myAlgorithm->getID() << std::endl;
myQStringList->append(myAlgorithm->getID());
}
//loop through the algorithm names adding to the algs combo
QStringList::Iterator myIterator= myQStringList->begin();
while( myIterator!= myQStringList->end() )
{
QString myAlgorithmQString=*myIterator;
cboModelAlgorithm->insertItem(myAlgorithmQString);
++myIterator;
}
return ;
}
/** This is the page selected event which I am reimplementing to do some housekeeping
* between wizard pages.
* This routine is a slot that runs each time next is pressed */
@ -198,12 +228,12 @@ void OpenModellerGui::parseAndRun(QString theParametersFileNameQString)
//
if ( ! myOutputFleNameCharArray )
{
QMessageBox::warning( this,QString("Acme Wizard Error"),QString("The 'Output file name' was not specified!"));
QMessageBox::warning( this,QString("openModeller Wizard Error"),QString("The 'Output file name' was not specified!"));
return;
}
if ( ! myOutputFormatCharArray )
{
QMessageBox::warning( this,"Acme Wizard Error","The 'Output format' was not specified!");
QMessageBox::warning( this,"openModeller Wizard Error","The 'Output format' was not specified!");
return;
}
if ( ! myScaleCharArray )
@ -232,7 +262,7 @@ void OpenModellerGui::parseAndRun(QString theParametersFileNameQString)
if ( ! myController.run() )
{
QString myErrorQString;
QMessageBox::warning( this,"Acme Wizard Error",myErrorQString.sprintf("Error: %s\nModel aborted.", myController.error()));
QMessageBox::warning( this,"openModeller Wizard Error",myErrorQString.sprintf("Error: %s\nModel aborted.", myController.error()));
}
else
{

View File

@ -15,7 +15,7 @@
#define OPENMODELLERGUI_H
#include <openmodellerguibase.h>
#include <qstringlist.h>
/**
@author Tim Sutton
*/
@ -26,6 +26,8 @@ public:
OpenModellerGui();
OpenModellerGui( QWidget* parent , const char* name , bool modal , WFlags fl );
~OpenModellerGui();
void getAlgorithmList();
void OpenModellerGui::parseAndRun(QString theParametersFileNameQString);
void makeConfigFile();