##// END OF EJS Templates
Add cmath header missing
perrinel -
r135:ae2e706837b9
parent child
Show More
@@ -1,28 +1,30
1 1 #include "CosinusProvider.h"
2 2
3 3 #include <Data/DataProviderParameters.h>
4 4 #include <Data/ScalarSeries.h>
5 5
6 #include <cmath>
7
6 8 std::unique_ptr<IDataSeries>
7 9 CosinusProvider::retrieveData(const DataProviderParameters &parameters) const
8 10 {
9 11 // Gets the timerange from the parameters
10 12 auto start = parameters.m_TStart;
11 13 auto end = parameters.m_TEnd;
12 14
13 15 // We assure that timerange is valid
14 16 if (end < start) {
15 17 std::swap(start, end);
16 18 }
17 19
18 20 // Generates scalar series containing cosinus values (one value per second)
19 21 auto scalarSeries
20 22 = std::make_unique<ScalarSeries>(end - start, QStringLiteral("t"), QStringLiteral(""));
21 23
22 24 for (auto time = start; time < end; ++time) {
23 25 auto dataIndex = time - start;
24 26 scalarSeries->setData(dataIndex, time, std::cos(time));
25 27 }
26 28
27 29 return scalarSeries;
28 30 }
General Comments 0
You need to be logged in to leave comments. Login now