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

omgclimatedataprocessorcontroller.h

Go to the documentation of this file.
00001 /******************************************************
00002   climatedataprocessor.h  -  description
00003   -------------------
00004 begin                : Thu May 15 2003
00005 copyright            : (C) 2003 by Tim Sutton
00006 email                : t.sutton@reading.ac.uk
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 
00019 
00020 #ifndef OMGCLIMATEDATAPROCESSORCONTROLLER_H
00021 #define OMGCLIMATEDATAPROCESSORCONTROLLER_H
00022 
00023 #include "omgclimatedataprocessor.h"
00024 #include "omgfilewriter.h"
00025 #include "omgclimatefilereader.h"
00026 #include "omgclimatefilegroup.h"
00027 #include <QMap>
00028 #include <QString>
00029 #include <QObject>
00030 
00035 struct OMG_LIB_EXPORT  OmgFileWriterStruct
00036 {
00038     OmgFileWriter * fileWriter;
00040     QString fullFileName;
00041 };
00042 
00043 
00050 class OMG_LIB_EXPORT  OmgClimateDataProcessorController : public QObject {
00051     Q_OBJECT;
00052     public:
00054         OmgClimateDataProcessorController();
00055 
00056         /*
00057         OmgClimateDataProcessorController(
00058                 int theFileStartYear,
00059                 int theJobStartYear,
00060                 int theJobEndYear,
00061                 QString theInputFileTypeString,
00062                 QString theOutputFileTypeString
00063                 );
00064         */
00066         ~OmgClimateDataProcessorController();
00067 
00068         // Getters and setters
00069 
00075         void setMeanTempFileName ( QString theFileName);
00080         const QString  getMeanTempFileName ();
00081 
00087         void setMinTempFileName ( QString theFileName);
00092         const QString  getMinTempFileName ();
00093 
00099         void setMaxTempFileName ( QString theFileName);
00104         const QString  getMaxTempFileName ();
00105 
00111         void setDiurnalTempFileName ( QString theFileName);
00116         const QString  getDiurnalTempFileName ();
00117 
00123         void setMeanPrecipFileName ( QString theFileName);
00128         const QString  getMeanPrecipFileName ();
00129 
00135         void setFrostDaysFileName ( QString theFileName);
00140         const QString  getFrostDaysFileName ();
00141 
00147         void setTotalSolarRadFileName ( QString theFileName);
00152         const QString  getTotalSolarRadFileName ();
00153 
00159         void setWindSpeedFileName ( QString theFileName);
00164         const QString  getWindSpeedFileName ();
00165 
00171         void setOutputFilePathString( QString theFilePathString);
00175         const QString getOutputFilePathString();
00176 
00185         void setFileStartYear( const int theYear);
00187         const int getFileStartYear();
00188 
00196         void setJobStartYear( const int theYear);
00202         const int getJobStartYear();
00203 
00211         void setJobEndYear( const int theYear);
00217         const int getJobEndYear();
00218 
00224         void setInputFileType( const OmgClimateFileReader::FileType theInputFileType);
00243         void setInputFileType( const QString theInputFileTypeString);
00248         const OmgClimateFileReader::FileType getInputFileType();
00249 
00256         void setOutputFileType( const OmgFileWriter::FileType theOutputFileType);
00269         void setOutputFileType( const QString theOutputFileTypeString);
00274         const OmgFileWriter::FileType getOutputFileType();
00275 
00276 
00281         bool makeFileGroups();
00282 
00287         bool  makeAvailableCalculationsMap();
00294         QMap <QString, bool > getAvailableCalculationsMap();
00295 
00304         bool addUserCalculation(QString theCalculationName);
00305 
00317         bool run();
00318 
00326         QString getDescription();
00327 
00349         void setFilesInSeriesFlag( const bool theFlag);
00355         const bool getFilesInSeriesFlag();
00356 
00363         void setOutputHeader( const QString& theOutputHeader);
00368         const QString getOutputHeader();
00369 
00370 
00371     signals:
00378         void numberOfVariablesToCalc(int theNumber);
00385         void numberOfCellsToCalc(int theNumber);
00393         void variableStart(QString theName);
00400         void variableDone(QString theFileName);
00407         void cellDone(float theResult);
00408 
00409     private:
00410 
00411         // Private methods
00412 
00414         void printVectorAndResult(QVector<float> theVector, float theResult);
00415 
00418         OmgClimateFileGroup *initialiseFileGroup(QString theFileName,int theStartYear);
00419 
00423         bool makeInputFileTypeMap();
00424 
00428         bool makeOutputFileTypeMap();
00429 
00431         QString intToString(int theInt);
00432 
00433         // Private attributes
00435         QString outputFilePath;
00437         OmgClimateFileReader::FileType inputFileType;
00438 
00440         OmgFileWriter::FileType outputFileType;
00441 
00449         QMap <QString,OmgClimateFileReader::FileType > inputFileTypeMap;
00450 
00451 
00459         QMap <QString, OmgFileWriter::FileType > outputFileTypeMap;
00460 
00469         QMap <QString, bool > availableCalculationsMap;
00470 
00471 
00473         OmgClimateFileGroup * meanTempFileGroup;
00477         QString meanTempFileName;
00478 
00480         OmgClimateFileGroup *minTempFileGroup;
00484         QString minTempFileName;
00485 
00487         OmgClimateFileGroup * maxTempFileGroup;
00491         QString maxTempFileName;
00492 
00494         OmgClimateFileGroup * diurnalTempFileGroup;
00498         QString diurnalTempFileName;
00499 
00501         OmgClimateFileGroup * meanPrecipFileGroup;
00505         QString meanPrecipFileName;
00506 
00508         OmgClimateFileGroup * frostDaysFileGroup;
00512         QString frostDaysFileName;
00513 
00515         OmgClimateFileGroup * totalSolarRadFileGroup;
00519         QString totalSolarRadFileName;
00520 
00522         OmgClimateFileGroup * windSpeedFileGroup;
00526         QString windSpeedFileName;
00527 
00533         bool filesInSeriesFlag;
00534 
00536         QString outputHeader;
00537 };
00538 
00539 #endif //CLIMATEDATAPROCESSORCONTROLLER
00540 /*
00541    bool meanPrecipOverDriestQ
00542    bool meanTempOverWarmestQ
00543    bool meanPrecipOverWettestQ
00544    bool meanTempOverCoolestM
00545    bool lowestTempOverCoolestM
00546    bool meanPrecipOverDriestM
00547    bool meanTempOverWarmestM
00548    bool highestTempOverWarmestM
00549    bool meanPrecipOverWettestM
00550    bool meanTemp
00551    bool meanPrecip
00552    bool meanDiurnal
00553    bool meanFrostDays
00554    bool meanRadiation
00555    bool meanWindSpeed
00556    bool stdevMeanTemp
00557    bool stdevMeanPrecip
00558    bool meanPrecipOverCoolestM
00559    bool meanDiurnalOverCoolestM
00560    bool meanRadiationOverCoolestM
00561    bool meanRadiationOverDriestM
00562    bool meanPrecipOverWarmestM
00563    bool meanDiurnalOverWarmestM
00564    bool meanRadiationOverWarmestM
00565    bool meanRadiationOverWettestM
00566    bool meanPrecipOverCoolestQ
00567    bool meanRadiationOverCoolestQ
00568    bool meanRadiationOverDriestQ
00569    bool meanPrecipOverWarmestQ
00570    bool meanRadiationOverWarmestQ
00571    bool meanRadiationOverWettestQ
00572    bool annualTempRange
00573    bool meanTempOverFrostFreeM
00574    bool meanPrecipOverFrostFreeM
00575    bool monthCountAboveFreezing
00576    */

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