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

omgexperiment.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2005 by Tim Sutton   *
00003  *   tim@linfiniti.com   *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU General Public License     *
00016  *   along with this program; if not, write to the                         *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 #ifndef OMGEXPERIMENT_H
00021 #define OMGEXPERIMENT_H
00022 
00023 #include "omgmodel.h"
00024 #include "omgmodellerplugininterface.h"
00025 #include "omgserialisable.h"
00026 #include "omgguid.h"
00027 
00028 //qt includes
00029 #include <QVector>
00030 #include <QList>
00031 #include <QObject>
00032 #include <QMap>
00033 #include <QMutex>
00034 #include <QThread>
00035 #include <QWaitCondition>
00036 
00045 class OMG_LIB_EXPORT OmgExperiment : public QThread, public OmgSerialisable, public OmgGuid
00046 {
00047   Q_OBJECT;
00048 
00049 public:
00050   OmgExperiment();
00051   ~OmgExperiment();
00053   QString name();
00055   void setName(QString theName);
00057   QString description();
00059   void setDescription(QString theDescription);
00061   QString workDir();
00069   void setWorkDir(QString theWorkDir);
00078   QString currentStatus() {return mCurrentStatus;};
00082   void reset();
00088   bool isRunning();
00090   void addModel(OmgModel  * thepModel) ;
00098   OmgModel * getModel(int theModelNo);
00107   OmgModel * getModel(QString theGuid);
00109   void run();
00111   void stop();
00113   int count();
00115   void clear() ;
00117   void removeModel(QString theGuid);
00119   void removeAlgorithm(QString theName);
00121   void removeTaxon(QString theName);
00123   void removeCompleted() ;
00125   OmgModellerPluginInterface * modellerPlugin();
00127   void setModellerPlugin(OmgModellerPluginInterface * theAdapter);
00130   const QString toString();
00132   bool isAborted();
00144   QString toSummaryHtml(bool theForceFlag=false);
00158   QString toPrintHtml(bool theForceFlag=false);
00173   QString toAlgorithmSummaryHtml(QString theAlgorithmName,bool theForceFlag=false);
00188   QString toTaxonSummaryHtml(QString theTaxonName,bool theForceFlag=false);
00192   void makeAlgorithmSummaryGraphs(QString theWorkDir); 
00193   
00195   void save();
00196   
00197   //
00198   // implement the serialisable interface:
00199   //
00200 
00206   QString toXml() const ;
00211   bool fromXml(const QString theXml) ;
00212 
00213 public slots:
00216   void abort();
00217 signals:
00219   void experimentMaximum(int);
00221   void experimentProgress(int);
00223   void modelCreationProgress(int);
00225   void modelProjectionProgress(int);
00227   void logMessage(QString);
00229   void experimentStopped();
00233   void modelCompleted(QString);
00234 private:
00237   QString getStatsHtml();
00240   QString getGraphsHtml(QString theImagePrefix ="", bool theForceFlag =false);
00263   void addValueToSummaryGraph(
00264     QMap<QString,QList <double > > & theMap,
00265     QString theAlgorithmName,
00266     double theValue); 
00285   void summaryMapToGraph( QMap<QString,QList < double > > &theMap, 
00286            QString theWorkDir, 
00287            QString theImageSuffix );
00288 
00289   //
00290   //
00291   //  Members ...
00292   //
00293   //
00294   QMutex mMutex;
00295   QWaitCondition mCondition;
00297   QString mName;
00299   QString mDescription;
00301   QVector <OmgModel * > mModelVector;
00303   int mLastPos;
00305   OmgModellerPluginInterface * mpModellerPlugin;
00309   bool mAbortFlag;
00313   QString mWorkDir;
00321   QString mCurrentStatus;
00323   bool mRunningFlag;
00324 };
00325 
00326 #endif //OMGEXPERIMENT_H

Generated on Mon Apr 28 15:08:23 2008 for openModellerDesktop by  doxygen 1.4.1-20050210