00001 00023 #ifndef SIMULATIONSTORAGE_H 00024 #define SIMULATIONSTORAGE_H 00025 00026 #include <QString> 00027 #include <QStringList> 00028 #include <QVariant> 00029 #include <QFile> 00030 #include <QDir> 00031 #include <QTextStream> 00032 #include <QDebug> 00033 00034 #include "../../Support/data.h" 00035 00036 #include <vector> 00037 00039 class SimulationStorage 00040 { 00041 public: 00042 SimulationStorage(simulationtype_t simulationType, int simulationID, QDir folderPath, const Data *data); 00043 ~SimulationStorage(); 00044 00045 bool addData(QString dataName, std::vector<double> simulationData); 00046 void store(bool flow = true); 00047 00048 static void listSimulationParameters(simulationtype_t simulationType, int idStart, int idEnd, QDir folderPath, std::vector<int> &ids, 00049 std::vector<QString> ®imeNames, 00050 std::vector<QString> &variableNames, std::vector<double> &variablesMin, std::vector<double> &variablesMax, 00051 std::vector<double> &Usgs, std::vector<double> &Usls, std::vector<double> &angles, 00052 std::vector<double> &diameters, std::vector<double> &roughnesses); 00053 static bool loadSimulation(simulationtype_t simulationType, int simulationID, QDir folderPath, std::vector<QString> &dataNames, 00054 std::vector<std::vector<double> > &simulationData); 00055 static bool deleteSimulation(simulationtype_t simulationType, int simulationID, QDir folderPath); 00056 static Data * loadSimulationParameters(simulationtype_t simulationType, int simulationID, QDir folderPath); 00057 00058 static QString fileNamePrefix(simulationtype_t simulationType); 00059 00060 private: 00061 simulationtype_t _simulationType; 00062 int _simulationID; 00063 QString _fileName; 00064 QDir _folderPath; 00065 const Data *_data; 00066 unsigned int _numData; 00067 int _lengthData; 00068 std::vector<std::vector<double> > _simulationData; 00069 std::vector<QString> _dataName; 00070 }; 00071 00072 #endif // SIMULATIONSTORAGE_H