##// END OF EJS Templates
Removed old Variable impl...
jeandet -
r1422:a323cf6b7201
parent child
Show More
@@ -32,7 +32,6
32 32 #include <SqpApplication.h>
33 33 #include <Time/TimeController.h>
34 34 #include <TimeWidget/TimeWidget.h>
35 #include <Variable/Variable.h>
36 35 #include <Visualization/VisualizationController.h>
37 36
38 37 #include <QAction>
@@ -1,1 +1,1
1 Subproject commit ae48b17833443bc2730a7511f964569dc7cdb1df
1 Subproject commit cc26524fb5d10feca3820e6921c9cd3cfb1a3591
@@ -8,7 +8,6
8 8 #include "Visualization/operations/FindVariableOperation.h"
9 9
10 10 #include "DataSource/DataSourceController.h"
11 #include "Variable/Variable.h"
12 11 #include "Variable/VariableController2.h"
13 12
14 13 #include "Common/MimeTypesDef.h"
@@ -256,7 +255,7 bool DragDropGuiController::checkMimeDataForVisualization(
256 255 if (mimeData->hasFormat(MIME_TYPE_VARIABLE_LIST))
257 256 {
258 257 auto variables = sqpApp->variableController().variables(
259 Variable::variablesIDs(mimeData->data(MIME_TYPE_VARIABLE_LIST)));
258 Variable2::IDs(mimeData->data(MIME_TYPE_VARIABLE_LIST)));
260 259
261 260 if (variables.size() == 1)
262 261 {
@@ -8,7 +8,6
8 8 #include <Network/NetworkController.h>
9 9 #include <QThread>
10 10 #include <Time/TimeController.h>
11 #include <Variable/Variable.h>
12 11 #include <Variable/VariableController2.h>
13 12 #include <Variable/VariableModel2.h>
14 13 #include <Visualization/VisualizationController.h>
@@ -1,6 +1,5
1 1 #include <DataSource/DataSourceController.h>
2 2 #include <Variable/RenameVariableDialog.h>
3 #include <Variable/Variable.h>
4 3 #include <Variable/VariableController2.h>
5 4 #include <Variable/VariableInspectorWidget.h>
6 5 #include <Variable/VariableMenuHeaderWidget.h>
@@ -2,10 +2,6
2 2
3 3 #include <Common/ColorUtils.h>
4 4
5 #include <Data/ScalarSeries.h>
6 #include <Data/SpectrogramSeries.h>
7 #include <Data/VectorSeries.h>
8
9 5 #include <Variable/Variable2.h>
10 6
11 7 #include <Visualization/qcustomplot.h>
@@ -133,5 +129,5 std::unique_ptr<IPlottablesHelper> IPlottablesHelperFactory::create(Variable2& v
133 129 break;
134 130 }
135 131
136 return std::make_unique<PlottablesHelper<IDataSeries>>();
132 return std::make_unique<PlottablesHelper<TimeSeries::ITimeSerie>>();
137 133 }
@@ -1,40 +1,41
1 1 #include "Visualization/SqpColorScale.h"
2 2
3 #include <Data/DataSeriesUtils.h>
4
5 3 #include <Visualization/QCPColorMapIterator.h>
6 4
7 5 Q_LOGGING_CATEGORY(LOG_SqpColorScale, "SqpColorScale")
8 6
9 namespace {
7 namespace
8 {
10 9
11 10 const auto DEFAULT_GRADIENT_PRESET = QCPColorGradient::gpJet;
12 const auto DEFAULT_RANGE = QCPRange{1.0e3, 1.7e7};
11 const auto DEFAULT_RANGE = QCPRange { 1.0e3, 1.7e7 };
13 12
14 13 } // namespace
15 14
16 std::pair<double, double> SqpColorScale::computeThresholds(const SqpColorScale &scale)
15 std::pair<double, double> SqpColorScale::computeThresholds(const SqpColorScale& scale)
17 16 {
18 17 auto qcpScale = scale.m_Scale;
19 18
20 19 auto colorMaps = qcpScale->colorMaps();
21 if (colorMaps.size() != 1) {
22 return {std::numeric_limits<double>::quiet_NaN(), std::numeric_limits<double>::quiet_NaN()};
20 if (colorMaps.size() != 1)
21 {
22 return { std::numeric_limits<double>::quiet_NaN(),
23 std::numeric_limits<double>::quiet_NaN() };
23 24 }
24 25
25 26 // Computes thresholds
26 27 auto isLogarithmicScale = qcpScale->dataScaleType() == QCPAxis::stLogarithmic;
27 28 auto colorMapData = colorMaps.first()->data();
28 QCPColorMapIterator begin{colorMapData, true};
29 QCPColorMapIterator end{colorMapData, false};
29 QCPColorMapIterator begin { colorMapData, true };
30 QCPColorMapIterator end { colorMapData, false };
30 31
31 return DataSeriesUtils::thresholds(begin, end, isLogarithmicScale);
32 return {}; // DataSeriesUtils::thresholds(begin, end, isLogarithmicScale);
32 33 }
33 34
34 SqpColorScale::SqpColorScale(QCustomPlot &plot)
35 : m_Scale{new QCPColorScale{&plot}},
36 m_AutomaticThreshold{false},
37 m_GradientPreset{DEFAULT_GRADIENT_PRESET}
35 SqpColorScale::SqpColorScale(QCustomPlot& plot)
36 : m_Scale { new QCPColorScale { &plot } }
37 , m_AutomaticThreshold { false }
38 , m_GradientPreset { DEFAULT_GRADIENT_PRESET }
38 39 {
39 40 m_Scale->setGradient(m_GradientPreset);
40 41 m_Scale->setDataRange(DEFAULT_RANGE);
@@ -43,18 +44,20 SqpColorScale::SqpColorScale(QCustomPlot &plot)
43 44 void SqpColorScale::updateDataRange() noexcept
44 45 {
45 46 // Updates data range only if mode is automatic
46 if (!m_AutomaticThreshold) {
47 if (!m_AutomaticThreshold)
48 {
47 49 return;
48 50 }
49 51
50 52 double minThreshold, maxThreshold;
51 53 std::tie(minThreshold, maxThreshold) = computeThresholds(*this);
52 if (std::isnan(minThreshold) || std::isnan(maxThreshold)) {
54 if (std::isnan(minThreshold) || std::isnan(maxThreshold))
55 {
53 56 qCCritical(LOG_SqpColorScale())
54 57 << "Can't update data range of color scale: thresholds computed are invalid";
55 58 return;
56 59 }
57 60
58 61 // Updates thresholds
59 m_Scale->setDataRange({minThreshold, maxThreshold});
62 m_Scale->setDataRange({ minThreshold, maxThreshold });
60 63 }
@@ -1,7 +1,6
1 1 #include "Visualization/VisualizationGraphHelper.h"
2 2 #include "Visualization/qcustomplot.h"
3 3
4 #include <Data/DataSeriesUtils.h>
5 4 #include <Data/ScalarTimeSerie.h>
6 5 #include <Data/SpectrogramTimeSerie.h>
7 6 #include <Data/VectorTimeSerie.h>
@@ -8,9 +8,6
8 8
9 9 #include <Common/DateUtils.h>
10 10
11 #include <Data/IDataSeries.h>
12 #include <Variable/Variable.h>
13
14 11 #include <SqpApplication.h>
15 12
16 13 namespace
@@ -15,10 +15,7
15 15 #include <Actions/FilteringAction.h>
16 16 #include <Common/MimeTypesDef.h>
17 17 #include <Common/containers.h>
18 #include <Data/ArrayData.h>
19 18 #include <Data/DateTimeRangeHelper.h>
20 #include <Data/IDataSeries.h>
21 #include <Data/SpectrogramSeries.h>
22 19 #include <DragAndDrop/DragDropGuiController.h>
23 20 #include <Settings/SqpSettingsDefs.h>
24 21 #include <SqpApplication.h>
@@ -10,7 +10,6
10 10 #include <QtTest>
11 11
12 12 #include <SqpApplication.h>
13 #include <Variable/Variable.h>
14 13 #include <Variable/VariableController2.h>
15 14 #include <qcustomplot.h>
16 15
General Comments 0
You need to be logged in to leave comments. Login now