diff --git a/core/include/Data/DataSeries.h b/core/include/Data/DataSeries.h index da79366..458b28d 100644 --- a/core/include/Data/DataSeries.h +++ b/core/include/Data/DataSeries.h @@ -191,16 +191,16 @@ public: std::make_unique >(*this, false)}}; } - /// @sa IDataSeries::minData() - DataSeriesIterator minData(double minXAxisData) const override + /// @sa IDataSeries::minXAxisData() + DataSeriesIterator minXAxisData(double minXAxisData) const override { return std::lower_bound( cbegin(), cend(), minXAxisData, [](const auto &itValue, const auto &value) { return itValue.x() < value; }); } - /// @sa IDataSeries::maxData() - DataSeriesIterator maxData(double maxXAxisData) const override + /// @sa IDataSeries::maxXAxisData() + DataSeriesIterator maxXAxisData(double maxXAxisData) const override { // Gets the first element that greater than max value auto it = std::upper_bound( diff --git a/core/include/Data/IDataSeries.h b/core/include/Data/IDataSeries.h index a9059c4..5ccf611 100644 --- a/core/include/Data/IDataSeries.h +++ b/core/include/Data/IDataSeries.h @@ -72,11 +72,11 @@ public: /// @return the iterator to the first entry of the data series whose x-axis data is greater than /// or equal to the value passed in parameter, or the end iterator if there is no matching value - virtual DataSeriesIterator minData(double minXAxisData) const = 0; + virtual DataSeriesIterator minXAxisData(double minXAxisData) const = 0; /// @return the iterator to the last entry of the data series whose x-axis data is less than or /// equal to the value passed in parameter, or the end iterator if there is no matching value - virtual DataSeriesIterator maxData(double maxXAxisData) const = 0; + virtual DataSeriesIterator maxXAxisData(double maxXAxisData) const = 0; virtual std::pair subData(double min, double max) const = 0; diff --git a/core/src/Variable/VariableModel.cpp b/core/src/Variable/VariableModel.cpp index 2bce556..0093876 100644 --- a/core/src/Variable/VariableModel.cpp +++ b/core/src/Variable/VariableModel.cpp @@ -174,11 +174,11 @@ QVariant VariableModel::data(const QModelIndex &index, int role) const case TSTART_COLUMN: // Shows the min value of the data series above the range tstart return dateTimeVariant([min = variable->range().m_TStart]( - const auto &dataSeries) { return dataSeries.minData(min); }); + const auto &dataSeries) { return dataSeries.minXAxisData(min); }); case TEND_COLUMN: // Shows the max value of the data series under the range tend return dateTimeVariant([max = variable->range().m_TEnd]( - const auto &dataSeries) { return dataSeries.maxData(max); }); + const auto &dataSeries) { return dataSeries.maxXAxisData(max); }); case UNIT_COLUMN: return variable->metadata().value(QStringLiteral("units")); case MISSION_COLUMN: diff --git a/core/tests/Data/TestDataSeries.cpp b/core/tests/Data/TestDataSeries.cpp index d6c75b8..9ac0052 100644 --- a/core/tests/Data/TestDataSeries.cpp +++ b/core/tests/Data/TestDataSeries.cpp @@ -24,18 +24,18 @@ private slots: void testMerge(); /// Input test data - /// @sa testMinData() - void testMinData_data(); + /// @sa testMinXAxisData() + void testMinXAxisData_data(); - /// Tests get min data of a data series - void testMinData(); + /// Tests get min x-axis data of a data series + void testMinXAxisData(); /// Input test data - /// @sa testMaxData() - void testMaxData_data(); + /// @sa testMaxXAxisData() + void testMaxXAxisData_data(); - /// Tests get max data of a data series - void testMaxData(); + /// Tests get max x-axis data of a data series + void testMaxXAxisData(); /// Input test data /// @sa testSubdata() @@ -181,7 +181,7 @@ void TestDataSeries::testMerge() seriesValuesData.cbegin())); } -void TestDataSeries::testMinData_data() +void TestDataSeries::testMinXAxisData_data() { // ////////////// // // Test structure // @@ -217,7 +217,7 @@ void TestDataSeries::testMinData_data() << std::numeric_limits::quiet_NaN(); } -void TestDataSeries::testMinData() +void TestDataSeries::testMinXAxisData() { QFETCH(std::shared_ptr, dataSeries); QFETCH(double, min); @@ -225,7 +225,7 @@ void TestDataSeries::testMinData() QFETCH(bool, expectedOK); QFETCH(double, expectedMin); - auto it = dataSeries->minData(min); + auto it = dataSeries->minXAxisData(min); QCOMPARE(expectedOK, it != dataSeries->cend()); @@ -235,7 +235,7 @@ void TestDataSeries::testMinData() } } -void TestDataSeries::testMaxData_data() +void TestDataSeries::testMaxXAxisData_data() { // ////////////// // // Test structure // @@ -271,7 +271,7 @@ void TestDataSeries::testMaxData_data() << std::numeric_limits::quiet_NaN(); } -void TestDataSeries::testMaxData() +void TestDataSeries::testMaxXAxisData() { QFETCH(std::shared_ptr, dataSeries); QFETCH(double, max); @@ -279,7 +279,7 @@ void TestDataSeries::testMaxData() QFETCH(bool, expectedOK); QFETCH(double, expectedMax); - auto it = dataSeries->maxData(max); + auto it = dataSeries->maxXAxisData(max); QCOMPARE(expectedOK, it != dataSeries->cend());