@@ -40,6 +40,10 public: | |||
|
40 | 40 | SqpRange cacheRange() const noexcept; |
|
41 | 41 | void setCacheRange(const SqpRange &cacheRange) noexcept; |
|
42 | 42 | |
|
43 | /// @return the number of points hold by the variable. The number of points is updated each time | |
|
44 | /// the data series changes | |
|
45 | int nbPoints() const noexcept; | |
|
46 | ||
|
43 | 47 | /// Returns the real range of the variable, i.e. the min and max x-axis values of the data |
|
44 | 48 | /// series between the range of the variable. The real range is updated each time the variable |
|
45 | 49 | /// range or the data series changed |
@@ -16,7 +16,8 struct Variable::VariablePrivate { | |||
|
16 | 16 | m_Range{dateTime}, |
|
17 | 17 | m_Metadata{metadata}, |
|
18 | 18 | m_DataSeries{nullptr}, |
|
19 | m_RealRange{INVALID_RANGE} | |
|
19 | m_RealRange{INVALID_RANGE}, | |
|
20 | m_NbPoints{0} | |
|
20 | 21 | { |
|
21 | 22 | } |
|
22 | 23 | |
@@ -25,7 +26,8 struct Variable::VariablePrivate { | |||
|
25 | 26 | m_Range{other.m_Range}, |
|
26 | 27 | m_Metadata{other.m_Metadata}, |
|
27 | 28 | m_DataSeries{other.m_DataSeries != nullptr ? other.m_DataSeries->clone() : nullptr}, |
|
28 | m_RealRange{other.m_RealRange} | |
|
29 | m_RealRange{other.m_RealRange}, | |
|
30 | m_NbPoints{other.m_NbPoints} | |
|
29 | 31 | { |
|
30 | 32 | } |
|
31 | 33 | |
@@ -67,6 +69,7 struct Variable::VariablePrivate { | |||
|
67 | 69 | QVariantHash m_Metadata; |
|
68 | 70 | std::shared_ptr<IDataSeries> m_DataSeries; |
|
69 | 71 | SqpRange m_RealRange; |
|
72 | int m_NbPoints; | |
|
70 | 73 | |
|
71 | 74 | QReadWriteLock m_Lock; |
|
72 | 75 | }; |
@@ -135,6 +138,11 void Variable::setCacheRange(const SqpRange &cacheRange) noexcept | |||
|
135 | 138 | impl->unlock(); |
|
136 | 139 | } |
|
137 | 140 | |
|
141 | int Variable::nbPoints() const noexcept | |
|
142 | { | |
|
143 | return impl->m_NbPoints; | |
|
144 | } | |
|
145 | ||
|
138 | 146 | SqpRange Variable::realRange() const noexcept |
|
139 | 147 | { |
|
140 | 148 | return impl->m_RealRange; |
General Comments 0
You need to be logged in to leave comments.
Login now