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