@@ -3,6 +3,7 | |||||
3 |
|
3 | |||
4 | #include <Common/spimpl.h> |
|
4 | #include <Common/spimpl.h> | |
5 |
|
5 | |||
|
6 | class IDataSeries; | |||
6 | class QString; |
|
7 | class QString; | |
7 |
|
8 | |||
8 | /** |
|
9 | /** | |
@@ -16,6 +17,8 public: | |||||
16 | QString mission() const noexcept; |
|
17 | QString mission() const noexcept; | |
17 | QString unit() const noexcept; |
|
18 | QString unit() const noexcept; | |
18 |
|
19 | |||
|
20 | void addDataSeries(std::unique_ptr<IDataSeries> dataSeries) noexcept; | |||
|
21 | ||||
19 | private: |
|
22 | private: | |
20 | class VariablePrivate; |
|
23 | class VariablePrivate; | |
21 | spimpl::unique_impl_ptr<VariablePrivate> impl; |
|
24 | spimpl::unique_impl_ptr<VariablePrivate> impl; |
@@ -1,14 +1,17 | |||||
1 | #include "Variable/Variable.h" |
|
1 | #include "Variable/Variable.h" | |
2 |
|
2 | |||
|
3 | #include <Data/IDataSeries.h> | |||
|
4 | ||||
3 | struct Variable::VariablePrivate { |
|
5 | struct Variable::VariablePrivate { | |
4 | explicit VariablePrivate(const QString &name, const QString &unit, const QString &mission) |
|
6 | explicit VariablePrivate(const QString &name, const QString &unit, const QString &mission) | |
5 | : m_Name{name}, m_Unit{unit}, m_Mission{mission} |
|
7 | : m_Name{name}, m_Unit{unit}, m_Mission{mission}, m_DataSeries{nullptr} | |
6 | { |
|
8 | { | |
7 | } |
|
9 | } | |
8 |
|
10 | |||
9 | QString m_Name; |
|
11 | QString m_Name; | |
10 | QString m_Unit; |
|
12 | QString m_Unit; | |
11 | QString m_Mission; |
|
13 | QString m_Mission; | |
|
14 | std::unique_ptr<IDataSeries> m_DataSeries; | |||
12 | }; |
|
15 | }; | |
13 |
|
16 | |||
14 | Variable::Variable(const QString &name, const QString &unit, const QString &mission) |
|
17 | Variable::Variable(const QString &name, const QString &unit, const QString &mission) | |
@@ -30,3 +33,11 QString Variable::unit() const noexcept | |||||
30 | { |
|
33 | { | |
31 | return impl->m_Unit; |
|
34 | return impl->m_Unit; | |
32 | } |
|
35 | } | |
|
36 | ||||
|
37 | void Variable::addDataSeries(std::unique_ptr<IDataSeries> dataSeries) noexcept | |||
|
38 | { | |||
|
39 | if (!impl->m_DataSeries) { | |||
|
40 | impl->m_DataSeries = std::move(dataSeries); | |||
|
41 | } | |||
|
42 | /// @todo : else, merge the two data series (if possible) | |||
|
43 | } |
General Comments 0
You need to be logged in to leave comments.
Login now