SimulationStorage Class Reference
Class for storing and retrieving simulation data as csv files.
More...
List of all members.
Public Member Functions |
| SimulationStorage (simulationtype_t simulationType, int simulationID, QDir folderPath, const Data *data) |
| ~SimulationStorage () |
bool | addData (QString dataName, std::vector< double > simulationData) |
void | store (bool flow=true) |
Static Public Member Functions |
static void | listSimulationParameters (simulationtype_t simulationType, int idStart, int idEnd, QDir folderPath, std::vector< int > &ids, std::vector< QString > ®imeNames, std::vector< QString > &variableNames, std::vector< double > &variablesMin, std::vector< double > &variablesMax, std::vector< double > &Usgs, std::vector< double > &Usls, std::vector< double > &angles, std::vector< double > &diameters, std::vector< double > &roughnesses) |
static bool | loadSimulation (simulationtype_t simulationType, int simulationID, QDir folderPath, std::vector< QString > &dataNames, std::vector< std::vector< double > > &simulationData) |
static bool | deleteSimulation (simulationtype_t simulationType, int simulationID, QDir folderPath) |
static Data * | loadSimulationParameters (simulationtype_t simulationType, int simulationID, QDir folderPath) |
static QString | fileNamePrefix (simulationtype_t simulationType) |
Private Attributes |
simulationtype_t | _simulationType |
int | _simulationID |
QString | _fileName |
QDir | _folderPath |
const Data * | _data |
unsigned int | _numData |
int | _lengthData |
std::vector< std::vector
< double > > | _simulationData |
std::vector< QString > | _dataName |
Detailed Description
Class for storing and retrieving simulation data as csv files.
Constructor & Destructor Documentation
SimulationStorage::SimulationStorage |
( |
simulationtype_t |
simulationType, |
|
|
int |
simulationID, |
|
|
QDir |
folderPath, |
|
|
const Data * |
data | |
|
) |
| | |
Constructor for storing simulations
- Parameters:
-
| simulationType | What type of simulation has been run, of type simulationtype_t (SIMULATION_FLOW or SIMULATION_REGIMETRANSITION) |
| simulationID | Unique identification number of simulation |
| folderPath | Folder path to the file where the simulation will be stored |
| data | Pointer to Data class with the parameters used to make simulation, const |
SimulationStorage::~SimulationStorage |
( |
|
) |
|
Member Function Documentation
bool SimulationStorage::addData |
( |
QString |
dataName, |
|
|
std::vector< double > |
simulationData | |
|
) |
| | |
Add data to the simulation storage Only store() will actually write data to disk
- Parameters:
-
| dataName | Name (description) on what the data is |
| simulationData | Vector of doubles with the data to store |
bool SimulationStorage::deleteSimulation |
( |
simulationtype_t |
simulationType, |
|
|
int |
simulationID, |
|
|
QDir |
folderPath | |
|
) |
| | [static] |
QString SimulationStorage::fileNamePrefix |
( |
simulationtype_t |
simulationType |
) |
[static] |
void SimulationStorage::listSimulationParameters |
( |
simulationtype_t |
simulationType, |
|
|
int |
idStart, |
|
|
int |
idEnd, |
|
|
QDir |
folderPath, |
|
|
std::vector< int > & |
ids, |
|
|
std::vector< QString > & |
regimeNames, |
|
|
std::vector< QString > & |
variableNames, |
|
|
std::vector< double > & |
variablesMin, |
|
|
std::vector< double > & |
variablesMax, |
|
|
std::vector< double > & |
Usgs, |
|
|
std::vector< double > & |
Usls, |
|
|
std::vector< double > & |
angles, |
|
|
std::vector< double > & |
diameters, |
|
|
std::vector< double > & |
roughnesses | |
|
) |
| | [static] |
Read all simulations saved with identification numbers between idStart and idEnd and puts the data into std::vectors of double and QString This function is intended to be used for loading data into listview in MainWindow
- Parameters:
-
| simulationType | What type of simulation has been run, of type simulationtype_t (SIMULATION_FLOW or SIMULATION_REGIMETRANSITION) |
| idStart | Integer id of first simulation to load (list) |
| idEnd | Integer id of last simulation to load (list) |
| folderPath | Folder path to the file where the simulation will be stored |
| ids | Vector of integers to where all ids will be written, data already in vector will be removed (Applies to all following vectors as well) |
| regimeNames | Vector of QString to where all regime names will be written (shortened to 4 chars) |
| variableNames | Vector of QString to where all variable names will be written |
| variablesMin | Vector of double to where all minimum variables values will be written |
| variablesMax | Vector of double to where all maximum variables values will be written |
| Usgs | Vector of double to where all Usg values will be written |
| Usls | Vector of double to where all Usl values will be written |
| angles | Vector of double to where all angles values will be written |
| diameters | Vector of double to where all diameters values will be written |
| roughnesses | Vector of double to where all roughnesses values will be written |
bool SimulationStorage::loadSimulation |
( |
simulationtype_t |
simulationType, |
|
|
int |
simulationID, |
|
|
QDir |
folderPath, |
|
|
std::vector< QString > & |
dataNames, |
|
|
std::vector< std::vector< double > > & |
simulationData | |
|
) |
| | [static] |
Data * SimulationStorage::loadSimulationParameters |
( |
simulationtype_t |
simulationType, |
|
|
int |
simulationID, |
|
|
QDir |
folderPath | |
|
) |
| | [static] |
void SimulationStorage::store |
( |
bool |
flow = true |
) |
|
Write the data to disk Disk format is a semicolon separated csv file
Member Data Documentation