Blame view

src/ParamOutputImpl/Download/DownloadProperties.cc 3.67 KB
fbe3c2bb   Benjamin Renard   First commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/*
 * DownLoadProperties.cc
 *
 *  Created on: Oct 1, 2014
 *      Author: m.mazel
 */

#include "DownloadProperties.hh"

namespace AMDA {
namespace ParamOutputImpl {
namespace Download {

DownloadProperties::DownloadProperties() :
e8595a44   Hacene SI HADJ MOHAND   J'ai corrigĂ© les ...
15
	_timeFormat(FORMAT_OUTPUT_TIME_DOYTIME),
fbe3c2bb   Benjamin Renard   First commit
16
17
18
19
	_fileFormat(ASCII_FILE_FORMAT),
	_fileName(),
	_timeResolution(0),
	_outputStructure(OutputStructure::ONE_FILE_PER_INTERVAL),
4f3abe6a   Benjamin Renard   Give the possibil...
20
21
22
	_precision(false),
	_separateInfoFile(false)

fbe3c2bb   Benjamin Renard   First commit
23
24
25
26
27
28
29
30
31
{
	// TODO Auto-generated constructor stub
}

DownloadProperties::~DownloadProperties() {
	for (auto paramProperties : _paramPropertiesList) {
		delete paramProperties;
	}
	_paramPropertiesList.clear();
26dc55e4   Erdogan Furkan   For now
32
33
34
35
	for (auto tableParamProperties : _tableParamPropertiesList) {
		delete tableParamProperties;
	}
	_tableParamPropertiesList.clear();
fbe3c2bb   Benjamin Renard   First commit
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
}

OutputFileFormat DownloadProperties::getFileFormat() const {
	return _fileFormat;
}

void DownloadProperties::setFileFormat(OutputFileFormat fileFormat) {
	_fileFormat = fileFormat;
}

const std::string& DownloadProperties::getFileName() const {
	return _fileName;
}

void DownloadProperties::setFileName(const std::string& fileName) {
	_fileName = fileName;
}

OutputStructure DownloadProperties::getOutputStructure() const {
	return _outputStructure;
}

void DownloadProperties::setOutputStructure(OutputStructure outputStructure) {
	_outputStructure = outputStructure;
}

OutputFormatTime DownloadProperties::getTimeFormat() const {
	return _timeFormat;
}

void DownloadProperties::setTimeFormat(OutputFormatTime timeFormat) {
	_timeFormat = timeFormat;
}

f7b99646   Benjamin Renard   Give the possibil...
70
double DownloadProperties::getTimeResolution() const {
fbe3c2bb   Benjamin Renard   First commit
71
72
73
	return _timeResolution;
}

f7b99646   Benjamin Renard   Give the possibil...
74
void DownloadProperties::setTimeResolution(double timeResolution) {
fbe3c2bb   Benjamin Renard   First commit
75
76
77
78
79
80
81
	_timeResolution = timeResolution;
}

ParamPropertiesList& DownloadProperties::getParamPropertiesList() {
	return _paramPropertiesList;
}

26dc55e4   Erdogan Furkan   For now
82
83
84
85
ParamPropertiesList& DownloadProperties::getTableParamPropertiesList() {
	return _tableParamPropertiesList;
}

5291eadc   Erdogan Furkan   For now - Ca avance
86
87
88
89
90
91
92
93
ParamPropertiesList DownloadProperties::getAllParamPropertiesList(){
	ParamPropertiesList allParamPropertiesList;
	for (auto paramProperties: _paramPropertiesList){
		allParamPropertiesList.push_back(paramProperties);
	}
	for (auto tableParamProperties: _tableParamPropertiesList){
		allParamPropertiesList.push_back(tableParamProperties);
	}
26dc55e4   Erdogan Furkan   For now
94
95
96
	return allParamPropertiesList;
}

fbe3c2bb   Benjamin Renard   First commit
97
98
99
100
void DownloadProperties::addParamProperties(ParamProperties *paramProperties) {
	_paramPropertiesList.push_back (paramProperties);
}

26dc55e4   Erdogan Furkan   For now
101
102
103
104
void DownloadProperties::addTableParamProperties(ParamProperties *tableParamProperties) {
	_tableParamPropertiesList.push_back (tableParamProperties);
}

fbe3c2bb   Benjamin Renard   First commit
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
ParamProperties* DownloadProperties::getParamPropertiesFromOriginalId(std::string originalId)
{
	for (auto paramProp : _paramPropertiesList)
	{
		if (paramProp->getOriginalId() == originalId)
			return paramProp;
	}
	return NULL;
}

ParamProperties* DownloadProperties::getParamPropertiesFromOutputId(std::string outputId)
{
	for (auto paramProp : _paramPropertiesList)
	{
		if (paramProp->getOutputId() == outputId)
			return paramProp;
	}
	return NULL;
}

5291eadc   Erdogan Furkan   For now - Ca avance
125
126
127
128
129
130
131
132
133
134
ParamProperties* DownloadProperties::getTableParamPropertiesFromOutputId(std::string outputId)
{
	for (auto paramProp : _tableParamPropertiesList)
	{
		if (paramProp->getOutputId() == outputId)
			return paramProp;
	}
	return NULL;
}

fbe3c2bb   Benjamin Renard   First commit
135
136
137
138
139
140
141
142
143
bool DownloadProperties::getPrecision(void) const {
	return _precision;
}

void DownloadProperties::setPrecision(bool precision)
{
	_precision = precision;
}

4f3abe6a   Benjamin Renard   Give the possibil...
144
145
146
147
148
149
150
151
152
153
154
155

bool DownloadProperties::getSeparateInfoFile(void) const {
        return _separateInfoFile;
}

void DownloadProperties::setSeparateInfoFile(bool separateInfoFile)
{
        _separateInfoFile = separateInfoFile;
}



fbe3c2bb   Benjamin Renard   First commit
156
157
158
} // namespace Download
} // namespace ParamOutputImpl
} // namespace AMDA