@@ -142,7 +142,7 void VariableAcquisitionWorker::onVariableDataAcquired(QUuid acqIdentifier, | |||
|
142 | 142 | |
|
143 | 143 | if (it != impl->m_VIdentifierToCurrrentAcqIdNextIdPairMap.cend()) { |
|
144 | 144 | if (it->second.second.isNull()) { |
|
145 |
// There is no next request, we can remove the vari |
|
|
145 | // There is no next request, we can remove the variable request | |
|
146 | 146 | impl->removeVariableRequest(acqRequest.m_vIdentifier); |
|
147 | 147 | } |
|
148 | 148 | else { |
@@ -23,36 +23,36 Q_LOGGING_CATEGORY(LOG_VariableController, "VariableController") | |||
|
23 | 23 | |
|
24 | 24 | namespace { |
|
25 | 25 | |
|
26 |
SqpRange computeSynchroRangeRequested(const SqpRange &varRange, const SqpRange &graph |
|
|
26 | SqpRange computeSynchroRangeRequested(const SqpRange &varRange, const SqpRange &graphRange, | |
|
27 | 27 | const SqpRange &oldGraphRange) |
|
28 | 28 | { |
|
29 |
auto zoomType = VariableController::getZoomType(graph |
|
|
29 | auto zoomType = VariableController::getZoomType(graphRange, oldGraphRange); | |
|
30 | 30 | |
|
31 | 31 | auto varRangeRequested = varRange; |
|
32 | 32 | switch (zoomType) { |
|
33 | 33 | case AcquisitionZoomType::ZoomIn: { |
|
34 |
auto deltaLeft = graph |
|
|
35 |
auto deltaRight = oldGraphRange.m_TEnd - graph |
|
|
34 | auto deltaLeft = graphRange.m_TStart - oldGraphRange.m_TStart; | |
|
35 | auto deltaRight = oldGraphRange.m_TEnd - graphRange.m_TEnd; | |
|
36 | 36 | varRangeRequested.m_TStart += deltaLeft; |
|
37 | 37 | varRangeRequested.m_TEnd -= deltaRight; |
|
38 | 38 | break; |
|
39 | 39 | } |
|
40 | 40 | |
|
41 | 41 | case AcquisitionZoomType::ZoomOut: { |
|
42 |
auto deltaLeft = oldGraphRange.m_TStart - graph |
|
|
43 |
auto deltaRight = graph |
|
|
42 | auto deltaLeft = oldGraphRange.m_TStart - graphRange.m_TStart; | |
|
43 | auto deltaRight = graphRange.m_TEnd - oldGraphRange.m_TEnd; | |
|
44 | 44 | varRangeRequested.m_TStart -= deltaLeft; |
|
45 | 45 | varRangeRequested.m_TEnd += deltaRight; |
|
46 | 46 | break; |
|
47 | 47 | } |
|
48 | 48 | case AcquisitionZoomType::PanRight: { |
|
49 |
auto deltaRight = graph |
|
|
49 | auto deltaRight = graphRange.m_TEnd - oldGraphRange.m_TEnd; | |
|
50 | 50 | varRangeRequested.m_TStart += deltaRight; |
|
51 | 51 | varRangeRequested.m_TEnd += deltaRight; |
|
52 | 52 | break; |
|
53 | 53 | } |
|
54 | 54 | case AcquisitionZoomType::PanLeft: { |
|
55 |
auto deltaLeft = oldGraphRange.m_TStart - graph |
|
|
55 | auto deltaLeft = oldGraphRange.m_TStart - graphRange.m_TStart; | |
|
56 | 56 | varRangeRequested.m_TStart -= deltaLeft; |
|
57 | 57 | varRangeRequested.m_TEnd -= deltaLeft; |
|
58 | 58 | break; |
@@ -263,8 +263,7 void VariableController::onDataProvided(QUuid vIdentifier, const SqpRange &range | |||
|
263 | 263 | const SqpRange &cacheRangeRequested, |
|
264 | 264 | QVector<AcquisitionDataPacket> dataAcquired) |
|
265 | 265 | { |
|
266 |
auto var = impl->findVariable(vIdentifier) |
|
|
267 | if (var != nullptr) { | |
|
266 | if (auto var = impl->findVariable(vIdentifier)) { | |
|
268 | 267 | var->setRange(rangeRequested); |
|
269 | 268 | var->setCacheRange(cacheRangeRequested); |
|
270 | 269 | qCDebug(LOG_VariableController()) << tr("1: onDataProvided") << rangeRequested; |
@@ -284,8 +283,7 void VariableController::onDataProvided(QUuid vIdentifier, const SqpRange &range | |||
|
284 | 283 | |
|
285 | 284 | void VariableController::onVariableRetrieveDataInProgress(QUuid identifier, double progress) |
|
286 | 285 | { |
|
287 |
auto var = impl->findVariable(identifier) |
|
|
288 | if (var != nullptr) { | |
|
286 | if (auto var = impl->findVariable(identifier)) { | |
|
289 | 287 | impl->m_VariableModel->setDataProgress(var, progress); |
|
290 | 288 | } |
|
291 | 289 | else { |
@@ -331,14 +329,14 void VariableController::onAddSynchronized(std::shared_ptr<Variable> variable, | |||
|
331 | 329 | { |
|
332 | 330 | qCDebug(LOG_VariableController()) << "TORM: VariableController::onAddSynchronized" |
|
333 | 331 | << synchronizationGroupId; |
|
334 |
auto v |
|
|
335 |
if (v |
|
|
336 |
auto |
|
|
332 | auto varToVarIdIt = impl->m_VariableToIdentifierMap.find(variable); | |
|
333 | if (varToVarIdIt != impl->m_VariableToIdentifierMap.cend()) { | |
|
334 | auto groupIdToVSGIt | |
|
337 | 335 | = impl->m_GroupIdToVariableSynchronizationGroupMap.find(synchronizationGroupId); |
|
338 |
if ( |
|
|
336 | if (groupIdToVSGIt != impl->m_GroupIdToVariableSynchronizationGroupMap.cend()) { | |
|
339 | 337 | impl->m_VariableIdGroupIdMap.insert( |
|
340 |
std::make_pair(v |
|
|
341 |
|
|
|
338 | std::make_pair(varToVarIdIt->second, synchronizationGroupId)); | |
|
339 | groupIdToVSGIt->second->addVariableId(varToVarIdIt->second); | |
|
342 | 340 | } |
|
343 | 341 | else { |
|
344 | 342 | qCCritical(LOG_VariableController()) |
@@ -359,13 +357,13 void VariableController::onRequestDataLoading(QVector<std::shared_ptr<Variable> | |||
|
359 | 357 | { |
|
360 | 358 | // NOTE: oldRange isn't really necessary since oldRange == variable->range(). |
|
361 | 359 | |
|
362 |
qC |
|
|
363 | << QThread::currentThread()->objectName(); | |
|
360 | qCDebug(LOG_VariableController()) << "VariableController::onRequestDataLoading" | |
|
361 | << QThread::currentThread()->objectName(); | |
|
364 | 362 | // we want to load data of the variable for the dateTime. |
|
365 | 363 | // First we check if the cache contains some of them. |
|
366 | 364 | // For the other, we ask the provider to give them. |
|
367 | 365 | |
|
368 |
for |
|
|
366 | for (const auto &var : variables) { | |
|
369 | 367 | qCDebug(LOG_VariableController()) << "processRequest for" << var->name(); |
|
370 | 368 | impl->processRequest(var, range); |
|
371 | 369 | } |
@@ -373,9 +371,9 void VariableController::onRequestDataLoading(QVector<std::shared_ptr<Variable> | |||
|
373 | 371 | if (synchronise) { |
|
374 | 372 | // Get the group ids |
|
375 | 373 | qCDebug(LOG_VariableController()) |
|
376 | << "VariableController::onRequestDataLoading for synchro var ENABLE"; | |
|
374 | << "TORM VariableController::onRequestDataLoading for synchro var ENABLE"; | |
|
377 | 375 | auto groupIds = std::set<QUuid>(); |
|
378 |
for |
|
|
376 | for (const auto &var : variables) { | |
|
379 | 377 | auto varToVarIdIt = impl->m_VariableToIdentifierMap.find(var); |
|
380 | 378 | if (varToVarIdIt != impl->m_VariableToIdentifierMap.cend()) { |
|
381 | 379 | auto vId = varToVarIdIt->second; |
@@ -391,7 +389,7 void VariableController::onRequestDataLoading(QVector<std::shared_ptr<Variable> | |||
|
391 | 389 | } |
|
392 | 390 | |
|
393 | 391 | // We assume here all group ids exist |
|
394 |
for |
|
|
392 | for (const auto &gId : groupIds) { | |
|
395 | 393 | auto vSynchronizationGroup = impl->m_GroupIdToVariableSynchronizationGroupMap.at(gId); |
|
396 | 394 | auto vSyncIds = vSynchronizationGroup->getIds(); |
|
397 | 395 | qCDebug(LOG_VariableController()) << "Var in synchro group "; |
@@ -30,6 +30,8 struct VisualizationGraphHelper { | |||
|
30 | 30 | */ |
|
31 | 31 | static QVector<QCPAbstractPlottable *> create(std::shared_ptr<Variable> variable, |
|
32 | 32 | QCustomPlot &plot) noexcept; |
|
33 | static QVector<QCPAbstractPlottable *> createV2(std::shared_ptr<Variable> variable, | |
|
34 | QCustomPlot &plot) noexcept; | |
|
33 | 35 | |
|
34 | 36 | static void updateData(QVector<QCPAbstractPlottable *> plotableVect, |
|
35 | 37 | std::shared_ptr<IDataSeries> dataSeries, const SqpRange &dateTime); |
@@ -30,12 +30,13 public: | |||
|
30 | 30 | /// If acquisition isn't enable, requestDataLoading signal cannot be emit |
|
31 | 31 | void enableAcquisition(bool enable); |
|
32 | 32 | |
|
33 | void addVariable(std::shared_ptr<Variable> variable); | |
|
34 | void addVariableUsingGraph(std::shared_ptr<Variable> variable); | |
|
33 | void addVariable(std::shared_ptr<Variable> variable, SqpRange range); | |
|
34 | ||
|
35 | 35 | /// Removes a variable from the graph |
|
36 | 36 | void removeVariable(std::shared_ptr<Variable> variable) noexcept; |
|
37 | 37 | |
|
38 | 38 | void setRange(std::shared_ptr<Variable> variable, const SqpRange &range); |
|
39 | void setYRange(const SqpRange &range); | |
|
39 | 40 | SqpRange graphRange() const noexcept; |
|
40 | 41 | void setGraphRange(const SqpRange &range); |
|
41 | 42 |
@@ -79,6 +79,29 void updateScalarData(QCPAbstractPlottable *component, std::shared_ptr<ScalarSer | |||
|
79 | 79 | } |
|
80 | 80 | } |
|
81 | 81 | |
|
82 | QCPAbstractPlottable *createScalarSeriesComponentV2(std::shared_ptr<ScalarSeries> scalarSeries, | |
|
83 | QCustomPlot &plot) | |
|
84 | { | |
|
85 | auto component = plot.addGraph(); | |
|
86 | ||
|
87 | if (component) { | |
|
88 | // Axes properties | |
|
89 | /// @todo : for the moment, no control is performed on the axes: the units and the tickers | |
|
90 | /// are fixed for the default x-axis and y-axis of the plot, and according to the new graph | |
|
91 | ||
|
92 | auto setAxisProperties = [](auto axis, const auto &unit) { | |
|
93 | // label (unit name) | |
|
94 | axis->setLabel(unit.m_Name); | |
|
95 | ||
|
96 | // ticker (depending on the type of unit) | |
|
97 | axis->setTicker(axisTicker(unit.m_TimeUnit)); | |
|
98 | }; | |
|
99 | setAxisProperties(plot.xAxis, scalarSeries->xAxisUnit()); | |
|
100 | setAxisProperties(plot.yAxis, scalarSeries->valuesUnit()); | |
|
101 | } | |
|
102 | return component; | |
|
103 | } | |
|
104 | ||
|
82 | 105 | QCPAbstractPlottable *createScalarSeriesComponent(std::shared_ptr<ScalarSeries> scalarSeries, |
|
83 | 106 | QCustomPlot &plot, const SqpRange &dateTime) |
|
84 | 107 | { |
@@ -119,6 +142,30 QCPAbstractPlottable *createScalarSeriesComponent(std::shared_ptr<ScalarSeries> | |||
|
119 | 142 | |
|
120 | 143 | } // namespace |
|
121 | 144 | |
|
145 | QVector<QCPAbstractPlottable *> | |
|
146 | VisualizationGraphHelper::createV2(std::shared_ptr<Variable> variable, QCustomPlot &plot) noexcept | |
|
147 | { | |
|
148 | auto result = QVector<QCPAbstractPlottable *>{}; | |
|
149 | ||
|
150 | if (variable) { | |
|
151 | // Gets the data series of the variable to call the creation of the right components | |
|
152 | // according to its type | |
|
153 | if (auto scalarSeries = std::dynamic_pointer_cast<ScalarSeries>(variable->dataSeries())) { | |
|
154 | result.append(createScalarSeriesComponentV2(scalarSeries, plot)); | |
|
155 | } | |
|
156 | else { | |
|
157 | qCDebug(LOG_VisualizationGraphHelper()) | |
|
158 | << QObject::tr("Can't create graph plottables : unmanaged data series type"); | |
|
159 | } | |
|
160 | } | |
|
161 | else { | |
|
162 | qCDebug(LOG_VisualizationGraphHelper()) | |
|
163 | << QObject::tr("Can't create graph plottables : the variable is null"); | |
|
164 | } | |
|
165 | ||
|
166 | return result; | |
|
167 | } | |
|
168 | ||
|
122 | 169 | QVector<QCPAbstractPlottable *> VisualizationGraphHelper::create(std::shared_ptr<Variable> variable, |
|
123 | 170 | QCustomPlot &plot) noexcept |
|
124 | 171 | { |
@@ -93,13 +93,10 void VisualizationGraphWidget::enableAcquisition(bool enable) | |||
|
93 | 93 | impl->m_DoAcquisition = enable; |
|
94 | 94 | } |
|
95 | 95 | |
|
96 | void VisualizationGraphWidget::addVariable(std::shared_ptr<Variable> variable) | |
|
96 | void VisualizationGraphWidget::addVariable(std::shared_ptr<Variable> variable, SqpRange range) | |
|
97 | 97 | { |
|
98 | auto calibrationState = impl->m_IsCalibration; | |
|
99 | impl->m_IsCalibration = true; | |
|
100 | 98 | // Uses delegate to create the qcpplot components according to the variable |
|
101 | auto createdPlottables = VisualizationGraphHelper::create(variable, *ui->widget); | |
|
102 | impl->m_IsCalibration = calibrationState; | |
|
99 | auto createdPlottables = VisualizationGraphHelper::createV2(variable, *ui->widget); | |
|
103 | 100 | |
|
104 | 101 | for (auto createdPlottable : qAsConst(createdPlottables)) { |
|
105 | 102 | impl->m_VariableToPlotMultiMap.insert({variable, createdPlottable}); |
@@ -107,18 +104,16 void VisualizationGraphWidget::addVariable(std::shared_ptr<Variable> variable) | |||
|
107 | 104 | |
|
108 | 105 | connect(variable.get(), SIGNAL(updated()), this, SLOT(onDataCacheVariableUpdated())); |
|
109 | 106 | |
|
110 | emit variableAdded(variable); | |
|
111 | } | |
|
112 | void VisualizationGraphWidget::addVariableUsingGraph(std::shared_ptr<Variable> variable) | |
|
113 | { | |
|
114 | // Uses delegate to create the qcpplot components according to the variable | |
|
115 | this->addVariable(variable); | |
|
107 | auto varRange = variable->range(); | |
|
116 | 108 | |
|
117 | // Request range for the variable | |
|
118 | auto graphRange = ui->widget->xAxis->range(); | |
|
109 | this->enableAcquisition(false); | |
|
110 | this->setGraphRange(range); | |
|
111 | this->enableAcquisition(true); | |
|
112 | ||
|
113 | emit requestDataLoading(QVector<std::shared_ptr<Variable> >() << variable, range, varRange, | |
|
114 | false); | |
|
119 | 115 | |
|
120 | emit requestDataLoading(QVector<std::shared_ptr<Variable> >() << variable, | |
|
121 | SqpRange{graphRange.lower, graphRange.upper}, variable->range(), false); | |
|
116 | emit variableAdded(variable); | |
|
122 | 117 | } |
|
123 | 118 | |
|
124 | 119 | void VisualizationGraphWidget::removeVariable(std::shared_ptr<Variable> variable) noexcept |
@@ -147,10 +142,15 void VisualizationGraphWidget::setRange(std::shared_ptr<Variable> variable, cons | |||
|
147 | 142 | ui->widget->replot(); |
|
148 | 143 | } |
|
149 | 144 | |
|
145 | void VisualizationGraphWidget::setYRange(const SqpRange &range) | |
|
146 | { | |
|
147 | ui->widget->yAxis->setRange(range.m_TStart, range.m_TEnd); | |
|
148 | } | |
|
149 | ||
|
150 | 150 | SqpRange VisualizationGraphWidget::graphRange() const noexcept |
|
151 | 151 | { |
|
152 |
auto graph |
|
|
153 |
return SqpRange{graph |
|
|
152 | auto graphRange = ui->widget->xAxis->range(); | |
|
153 | return SqpRange{graphRange.lower, graphRange.upper}; | |
|
154 | 154 | } |
|
155 | 155 | |
|
156 | 156 | void VisualizationGraphWidget::setGraphRange(const SqpRange &range) |
@@ -288,8 +288,8 void VisualizationGraphWidget::onDataCacheVariableUpdated() | |||
|
288 | 288 | // - use an ordered_multimap and the algos of std to group the values by key |
|
289 | 289 | // - use a map (unique keys) and store as values directly the list of components |
|
290 | 290 | |
|
291 |
auto graph |
|
|
292 |
auto dateTime = SqpRange{graph |
|
|
291 | auto graphRange = ui->widget->xAxis->range(); | |
|
292 | auto dateTime = SqpRange{graphRange.lower, graphRange.upper}; | |
|
293 | 293 | |
|
294 | 294 | for (auto it = impl->m_VariableToPlotMultiMap.cbegin(); |
|
295 | 295 | it != impl->m_VariableToPlotMultiMap.cend(); ++it) { |
@@ -6,6 +6,7 | |||
|
6 | 6 | #include "ui_VisualizationZoneWidget.h" |
|
7 | 7 | |
|
8 | 8 | #include <Data/SqpRange.h> |
|
9 | #include <Variable/Variable.h> | |
|
9 | 10 | #include <Variable/VariableController.h> |
|
10 | 11 | |
|
11 | 12 | #include <QUuid> |
@@ -81,10 +82,10 VisualizationGraphWidget *VisualizationZoneWidget::createGraph(std::shared_ptr<V | |||
|
81 | 82 | |
|
82 | 83 | |
|
83 | 84 | // Lambda to synchronize zone widget |
|
84 |
auto synchronizeZoneWidget = [this, graphWidget](const SqpRange &graph |
|
|
85 | auto synchronizeZoneWidget = [this, graphWidget](const SqpRange &graphRange, | |
|
85 | 86 | const SqpRange &oldGraphRange) { |
|
86 | 87 | |
|
87 |
auto zoomType = VariableController::getZoomType(graph |
|
|
88 | auto zoomType = VariableController::getZoomType(graphRange, oldGraphRange); | |
|
88 | 89 | auto frameLayout = ui->visualizationZoneFrame->layout(); |
|
89 | 90 | for (auto i = 0; i < frameLayout->count(); ++i) { |
|
90 | 91 | auto graphChild |
@@ -94,8 +95,8 VisualizationGraphWidget *VisualizationZoneWidget::createGraph(std::shared_ptr<V | |||
|
94 | 95 | auto graphChildRange = graphChild->graphRange(); |
|
95 | 96 | switch (zoomType) { |
|
96 | 97 | case AcquisitionZoomType::ZoomIn: { |
|
97 |
auto deltaLeft = graph |
|
|
98 |
auto deltaRight = oldGraphRange.m_TEnd - graph |
|
|
98 | auto deltaLeft = graphRange.m_TStart - oldGraphRange.m_TStart; | |
|
99 | auto deltaRight = oldGraphRange.m_TEnd - graphRange.m_TEnd; | |
|
99 | 100 | graphChildRange.m_TStart += deltaLeft; |
|
100 | 101 | graphChildRange.m_TEnd -= deltaRight; |
|
101 | 102 | qCCritical(LOG_VisualizationZoneWidget()) << tr("TORM: ZoomIn"); |
@@ -104,37 +105,37 VisualizationGraphWidget *VisualizationZoneWidget::createGraph(std::shared_ptr<V | |||
|
104 | 105 | qCCritical(LOG_VisualizationZoneWidget()) << tr("TORM: deltaRight") |
|
105 | 106 | << deltaRight; |
|
106 | 107 | qCCritical(LOG_VisualizationZoneWidget()) |
|
107 |
<< tr("TORM: dt") << graph |
|
|
108 | << tr("TORM: dt") << graphRange.m_TEnd - graphRange.m_TStart; | |
|
108 | 109 | |
|
109 | 110 | break; |
|
110 | 111 | } |
|
111 | 112 | |
|
112 | 113 | case AcquisitionZoomType::ZoomOut: { |
|
113 | 114 | qCCritical(LOG_VisualizationZoneWidget()) << tr("TORM: ZoomOut"); |
|
114 |
auto deltaLeft = oldGraphRange.m_TStart - graph |
|
|
115 |
auto deltaRight = graph |
|
|
115 | auto deltaLeft = oldGraphRange.m_TStart - graphRange.m_TStart; | |
|
116 | auto deltaRight = graphRange.m_TEnd - oldGraphRange.m_TEnd; | |
|
116 | 117 | qCCritical(LOG_VisualizationZoneWidget()) << tr("TORM: deltaLeft") |
|
117 | 118 | << deltaLeft; |
|
118 | 119 | qCCritical(LOG_VisualizationZoneWidget()) << tr("TORM: deltaRight") |
|
119 | 120 | << deltaRight; |
|
120 | 121 | qCCritical(LOG_VisualizationZoneWidget()) |
|
121 |
<< tr("TORM: dt") << graph |
|
|
122 | << tr("TORM: dt") << graphRange.m_TEnd - graphRange.m_TStart; | |
|
122 | 123 | graphChildRange.m_TStart -= deltaLeft; |
|
123 | 124 | graphChildRange.m_TEnd += deltaRight; |
|
124 | 125 | break; |
|
125 | 126 | } |
|
126 | 127 | case AcquisitionZoomType::PanRight: { |
|
127 | 128 | qCCritical(LOG_VisualizationZoneWidget()) << tr("TORM: PanRight"); |
|
128 |
auto deltaRight = graph |
|
|
129 | auto deltaRight = graphRange.m_TEnd - oldGraphRange.m_TEnd; | |
|
129 | 130 | graphChildRange.m_TStart += deltaRight; |
|
130 | 131 | graphChildRange.m_TEnd += deltaRight; |
|
131 | 132 | qCCritical(LOG_VisualizationZoneWidget()) |
|
132 |
<< tr("TORM: dt") << graph |
|
|
133 | << tr("TORM: dt") << graphRange.m_TEnd - graphRange.m_TStart; | |
|
133 | 134 | break; |
|
134 | 135 | } |
|
135 | 136 | case AcquisitionZoomType::PanLeft: { |
|
136 | 137 | qCCritical(LOG_VisualizationZoneWidget()) << tr("TORM: PanLeft"); |
|
137 |
auto deltaLeft = oldGraphRange.m_TStart - graph |
|
|
138 | auto deltaLeft = oldGraphRange.m_TStart - graphRange.m_TStart; | |
|
138 | 139 | graphChildRange.m_TStart -= deltaLeft; |
|
139 | 140 | graphChildRange.m_TEnd -= deltaLeft; |
|
140 | 141 | break; |
@@ -168,9 +169,27 VisualizationGraphWidget *VisualizationZoneWidget::createGraph(std::shared_ptr<V | |||
|
168 | 169 | connect(graphWidget, &VisualizationGraphWidget::variableAdded, this, |
|
169 | 170 | &VisualizationZoneWidget::onVariableAdded); |
|
170 | 171 | |
|
172 | auto range = SqpRange{}; | |
|
173 | ||
|
174 | // Apply visitor to graph children | |
|
175 | auto layout = ui->visualizationZoneFrame->layout(); | |
|
176 | if (layout->count() > 0) { | |
|
177 | // Case of a new graph in a existant zone | |
|
178 | if (auto visualizationGraphWidget | |
|
179 | = dynamic_cast<VisualizationGraphWidget *>(layout->itemAt(0)->widget())) { | |
|
180 | range = visualizationGraphWidget->graphRange(); | |
|
181 | } | |
|
182 | } | |
|
183 | else { | |
|
184 | // Case of a new graph as the first of the zone | |
|
185 | range = variable->range(); | |
|
186 | } | |
|
187 | ||
|
171 | 188 | this->addGraph(graphWidget); |
|
172 | 189 | |
|
173 | graphWidget->addVariable(variable); | |
|
190 | graphWidget->addVariable(variable, range); | |
|
191 | // TODO: get y using variable range | |
|
192 | graphWidget->setYRange(SqpRange{-10, 10}); | |
|
174 | 193 | |
|
175 | 194 | return graphWidget; |
|
176 | 195 | } |
@@ -155,6 +155,7 void GenerateVariableMenuOperation::visitEnter(VisualizationZoneWidget *zoneWidg | |||
|
155 | 155 | |
|
156 | 156 | void GenerateVariableMenuOperation::visitLeave(VisualizationZoneWidget *zoneWidget) |
|
157 | 157 | { |
|
158 | qCCritical(LOG_GenerateVariableMenuOperation(), "Open in a new graph DETECTED !!"); | |
|
158 | 159 | if (zoneWidget) { |
|
159 | 160 | // 'Plot' menu |
|
160 | 161 | impl->visitNodeLeavePlot( |
@@ -181,7 +182,7 void GenerateVariableMenuOperation::visit(VisualizationGraphWidget *graphWidget) | |||
|
181 | 182 | impl->visitLeafPlot(*graphWidget, QObject::tr("Open in %1").arg(graphWidget->name()), |
|
182 | 183 | [ varW = std::weak_ptr<Variable>{impl->m_Variable}, graphWidget ]() { |
|
183 | 184 | if (auto var = varW.lock()) { |
|
184 |
graphWidget->addVariable |
|
|
185 | graphWidget->addVariable(var, graphWidget->graphRange()); | |
|
185 | 186 | } |
|
186 | 187 | }); |
|
187 | 188 |
@@ -62,7 +62,9 void AmdaProvider::requestDataLoading(QUuid acqIdentifier, const DataProviderPar | |||
|
62 | 62 | const auto data = parameters.m_Data; |
|
63 | 63 | for (const auto &dateTime : qAsConst(times)) { |
|
64 | 64 | this->retrieveData(acqIdentifier, dateTime, data); |
|
65 | QThread::msleep(200); | |
|
65 | ||
|
66 | // TORM | |
|
67 | // QThread::msleep(200); | |
|
66 | 68 | } |
|
67 | 69 | } |
|
68 | 70 | |
@@ -92,7 +94,7 void AmdaProvider::retrieveData(QUuid token, const SqpRange &dateTime, const QVa | |||
|
92 | 94 | auto endDate = dateFormat(dateTime.m_TEnd); |
|
93 | 95 | |
|
94 | 96 | auto url = QUrl{QString{AMDA_URL_FORMAT}.arg(startDate, endDate, productId)}; |
|
95 | qCInfo(LOG_AmdaProvider()) << tr("AmdaProvider::retrieveData url:") << url; | |
|
97 | qCInfo(LOG_AmdaProvider()) << tr("TORM AmdaProvider::retrieveData url:") << url; | |
|
96 | 98 | auto tempFile = std::make_shared<QTemporaryFile>(); |
|
97 | 99 | |
|
98 | 100 | // LAMBDA |
@@ -128,8 +130,8 void AmdaProvider::retrieveData(QUuid token, const SqpRange &dateTime, const QVa | |||
|
128 | 130 | auto downloadFileUrl = QUrl{QString{reply->readAll()}}; |
|
129 | 131 | |
|
130 | 132 | |
|
131 |
qCInfo(LOG_AmdaProvider()) |
|
|
132 | << downloadFileUrl; | |
|
133 | qCInfo(LOG_AmdaProvider()) | |
|
134 | << tr("TORM AmdaProvider::retrieveData downloadFileUrl:") << downloadFileUrl; | |
|
133 | 135 | // Executes request for downloading file // |
|
134 | 136 | |
|
135 | 137 | // Creates destination file |
@@ -73,7 +73,7 void CosinusProvider::requestDataLoading(QUuid acqIdentifier, | |||
|
73 | 73 | { |
|
74 | 74 | // TODO: Add Mutex |
|
75 | 75 | m_VariableToEnableProvider[acqIdentifier] = true; |
|
76 | qCDebug(LOG_CosinusProvider()) << "CosinusProvider::requestDataLoading" | |
|
76 | qCDebug(LOG_CosinusProvider()) << "TORM: CosinusProvider::requestDataLoading" | |
|
77 | 77 | << QThread::currentThread()->objectName(); |
|
78 | 78 | // NOTE: Try to use multithread if possible |
|
79 | 79 | const auto times = parameters.m_Times; |
@@ -81,7 +81,7 void CosinusProvider::requestDataLoading(QUuid acqIdentifier, | |||
|
81 | 81 | for (const auto &dateTime : qAsConst(times)) { |
|
82 | 82 | if (m_VariableToEnableProvider[acqIdentifier]) { |
|
83 | 83 | auto scalarSeries = this->retrieveData(acqIdentifier, dateTime); |
|
84 |
qC |
|
|
84 | qCDebug(LOG_CosinusProvider()) << "TORM: CosinusProvider::dataProvided"; | |
|
85 | 85 | emit dataProvided(acqIdentifier, scalarSeries, dateTime); |
|
86 | 86 | } |
|
87 | 87 | } |
General Comments 0
You need to be logged in to leave comments.
Login now