##// END OF EJS Templates
Correction clang format
perrinel -
r365:557d1cdcb95a
parent child
Show More
@@ -27,14 +27,14 public:
27 DataSourceController::DataSourceController(QObject *parent)
27 DataSourceController::DataSourceController(QObject *parent)
28 : impl{spimpl::make_unique_impl<DataSourceControllerPrivate>()}
28 : impl{spimpl::make_unique_impl<DataSourceControllerPrivate>()}
29 {
29 {
30 qCDebug(LOG_DataSourceController())
30 qCDebug(LOG_DataSourceController()) << tr("DataSourceController construction")
31 << tr("DataSourceController construction") << QThread::currentThread();
31 << QThread::currentThread();
32 }
32 }
33
33
34 DataSourceController::~DataSourceController()
34 DataSourceController::~DataSourceController()
35 {
35 {
36 qCDebug(LOG_DataSourceController())
36 qCDebug(LOG_DataSourceController()) << tr("DataSourceController destruction")
37 << tr("DataSourceController destruction") << QThread::currentThread();
37 << QThread::currentThread();
38 this->waitForFinish();
38 this->waitForFinish();
39 }
39 }
40
40
@@ -97,8 +97,8 void DataSourceController::loadProductItem(const QUuid &dataSourceUid,
97
97
98 void DataSourceController::initialize()
98 void DataSourceController::initialize()
99 {
99 {
100 qCDebug(LOG_DataSourceController())
100 qCDebug(LOG_DataSourceController()) << tr("DataSourceController init")
101 << tr("DataSourceController init") << QThread::currentThread();
101 << QThread::currentThread();
102 impl->m_WorkingMutex.lock();
102 impl->m_WorkingMutex.lock();
103 qCDebug(LOG_DataSourceController()) << tr("DataSourceController init END");
103 qCDebug(LOG_DataSourceController()) << tr("DataSourceController init END");
104 }
104 }
@@ -33,8 +33,8 VariableCacheController::VariableCacheController(QObject *parent)
33 void VariableCacheController::addDateTime(std::shared_ptr<Variable> variable,
33 void VariableCacheController::addDateTime(std::shared_ptr<Variable> variable,
34 const SqpDateTime &dateTime)
34 const SqpDateTime &dateTime)
35 {
35 {
36 qCInfo(LOG_VariableCacheController())
36 qCInfo(LOG_VariableCacheController()) << "VariableCacheController::addDateTime"
37 << "VariableCacheController::addDateTime" << QThread::currentThread()->objectName();
37 << QThread::currentThread()->objectName();
38 if (variable) {
38 if (variable) {
39 auto findVariableIte = impl->m_VariableToSqpDateTimeListMap.find(variable);
39 auto findVariableIte = impl->m_VariableToSqpDateTimeListMap.find(variable);
40 if (findVariableIte == impl->m_VariableToSqpDateTimeListMap.end()) {
40 if (findVariableIte == impl->m_VariableToSqpDateTimeListMap.end()) {
@@ -107,8 +107,8 VariableCacheController::provideNotInCacheDateTimeList(std::shared_ptr<Variable>
107 QVector<SqpDateTime>
107 QVector<SqpDateTime>
108 VariableCacheController::dateCacheList(std::shared_ptr<Variable> variable) const noexcept
108 VariableCacheController::dateCacheList(std::shared_ptr<Variable> variable) const noexcept
109 {
109 {
110 qCInfo(LOG_VariableCacheController())
110 qCInfo(LOG_VariableCacheController()) << "VariableCacheController::dateCacheList"
111 << "VariableCacheController::dateCacheList" << QThread::currentThread()->objectName();
111 << QThread::currentThread()->objectName();
112 try {
112 try {
113 return impl->m_VariableToSqpDateTimeListMap.at(variable);
113 return impl->m_VariableToSqpDateTimeListMap.at(variable);
114 }
114 }
@@ -218,8 +218,8 void VariableCacheController::displayCache(std::shared_ptr<Variable> variable) c
218 {
218 {
219 auto variableDateTimeList = impl->m_VariableToSqpDateTimeListMap.find(variable);
219 auto variableDateTimeList = impl->m_VariableToSqpDateTimeListMap.find(variable);
220 if (variableDateTimeList != impl->m_VariableToSqpDateTimeListMap.end()) {
220 if (variableDateTimeList != impl->m_VariableToSqpDateTimeListMap.end()) {
221 qCInfo(LOG_VariableCacheController())
221 qCInfo(LOG_VariableCacheController()) << tr("VariableCacheController::displayCache")
222 << tr("VariableCacheController::displayCache") << variableDateTimeList->second;
222 << variableDateTimeList->second;
223 }
223 }
224 else {
224 else {
225 qCWarning(LOG_VariableCacheController())
225 qCWarning(LOG_VariableCacheController())
@@ -56,14 +56,14 struct VariableController::VariableControllerPrivate {
56 VariableController::VariableController(QObject *parent)
56 VariableController::VariableController(QObject *parent)
57 : QObject{parent}, impl{spimpl::make_unique_impl<VariableControllerPrivate>(this)}
57 : QObject{parent}, impl{spimpl::make_unique_impl<VariableControllerPrivate>(this)}
58 {
58 {
59 qCDebug(LOG_VariableController())
59 qCDebug(LOG_VariableController()) << tr("VariableController construction")
60 << tr("VariableController construction") << QThread::currentThread();
60 << QThread::currentThread();
61 }
61 }
62
62
63 VariableController::~VariableController()
63 VariableController::~VariableController()
64 {
64 {
65 qCDebug(LOG_VariableController())
65 qCDebug(LOG_VariableController()) << tr("VariableController destruction")
66 << tr("VariableController destruction") << QThread::currentThread();
66 << QThread::currentThread();
67 this->waitForFinish();
67 this->waitForFinish();
68 }
68 }
69
69
@@ -152,8 +152,8 void VariableController::createVariable(const QString &name,
152
152
153 void VariableController::onDateTimeOnSelection(const SqpDateTime &dateTime)
153 void VariableController::onDateTimeOnSelection(const SqpDateTime &dateTime)
154 {
154 {
155 qCDebug(LOG_VariableController())
155 qCDebug(LOG_VariableController()) << "VariableController::onDateTimeOnSelection"
156 << "VariableController::onDateTimeOnSelection" << QThread::currentThread()->objectName();
156 << QThread::currentThread()->objectName();
157 auto selectedRows = impl->m_VariableSelectionModel->selectedRows();
157 auto selectedRows = impl->m_VariableSelectionModel->selectedRows();
158
158
159 for (const auto &selectedRow : qAsConst(selectedRows)) {
159 for (const auto &selectedRow : qAsConst(selectedRows)) {
@@ -168,8 +168,8 void VariableController::onDateTimeOnSelection(const SqpDateTime &dateTime)
168 void VariableController::onRequestDataLoading(std::shared_ptr<Variable> variable,
168 void VariableController::onRequestDataLoading(std::shared_ptr<Variable> variable,
169 const SqpDateTime &dateTime)
169 const SqpDateTime &dateTime)
170 {
170 {
171 qCDebug(LOG_VariableController())
171 qCDebug(LOG_VariableController()) << "VariableController::onRequestDataLoading"
172 << "VariableController::onRequestDataLoading" << QThread::currentThread()->objectName();
172 << QThread::currentThread()->objectName();
173 // we want to load data of the variable for the dateTime.
173 // we want to load data of the variable for the dateTime.
174 // First we check if the cache contains some of them.
174 // First we check if the cache contains some of them.
175 // For the other, we ask the provider to give them.
175 // For the other, we ask the provider to give them.
@@ -37,8 +37,8 QSharedPointer<QCPAxisTicker> axisTicker(bool isTimeAxis)
37 void updateScalarData(QCPAbstractPlottable *component, ScalarSeries &scalarSeries,
37 void updateScalarData(QCPAbstractPlottable *component, ScalarSeries &scalarSeries,
38 const SqpDateTime &dateTime)
38 const SqpDateTime &dateTime)
39 {
39 {
40 qCInfo(LOG_VisualizationGraphHelper())
40 qCInfo(LOG_VisualizationGraphHelper()) << "TORM: updateScalarData"
41 << "TORM: updateScalarData" << QThread::currentThread()->objectName();
41 << QThread::currentThread()->objectName();
42 if (auto qcpGraph = dynamic_cast<QCPGraph *>(component)) {
42 if (auto qcpGraph = dynamic_cast<QCPGraph *>(component)) {
43 // Clean the graph
43 // Clean the graph
44 // NAIVE approch
44 // NAIVE approch
@@ -47,8 +47,8 void updateScalarData(QCPAbstractPlottable *component, ScalarSeries &scalarSerie
47 const auto xData = scalarSeries.xAxisData()->data();
47 const auto xData = scalarSeries.xAxisData()->data();
48 const auto valuesData = scalarSeries.valuesData()->data();
48 const auto valuesData = scalarSeries.valuesData()->data();
49 const auto count = xData.count();
49 const auto count = xData.count();
50 qCInfo(LOG_VisualizationGraphHelper())
50 qCInfo(LOG_VisualizationGraphHelper()) << "TORM: Current points in cache"
51 << "TORM: Current points in cache" << xData.count();
51 << xData.count();
52
52
53 auto dataContainer = qcpGraph->data();
53 auto dataContainer = qcpGraph->data();
54 dataContainer->clear();
54 dataContainer->clear();
@@ -62,8 +62,8 void updateScalarData(QCPAbstractPlottable *component, ScalarSeries &scalarSerie
62 }
62 }
63 }
63 }
64 sqpDataContainer->sort();
64 sqpDataContainer->sort();
65 qCInfo(LOG_VisualizationGraphHelper())
65 qCInfo(LOG_VisualizationGraphHelper()) << "TORM: Current points displayed"
66 << "TORM: Current points displayed" << sqpDataContainer->size();
66 << sqpDataContainer->size();
67 }
67 }
68 scalarSeries.unlock();
68 scalarSeries.unlock();
69
69
@@ -177,8 +177,8 void VisualizationGraphWidget::onGraphMenuRequested(const QPoint &pos) noexcept
177
177
178 void VisualizationGraphWidget::onRangeChanged(const QCPRange &t1)
178 void VisualizationGraphWidget::onRangeChanged(const QCPRange &t1)
179 {
179 {
180 qCDebug(LOG_VisualizationGraphWidget())
180 qCDebug(LOG_VisualizationGraphWidget()) << tr("VisualizationGraphWidget::onRangeChanged")
181 << tr("VisualizationGraphWidget::onRangeChanged") << QThread::currentThread()->objectName();
181 << QThread::currentThread()->objectName();
182
182
183 for (auto it = impl->m_VariableToPlotMultiMap.cbegin();
183 for (auto it = impl->m_VariableToPlotMultiMap.cbegin();
184 it != impl->m_VariableToPlotMultiMap.cend(); ++it) {
184 it != impl->m_VariableToPlotMultiMap.cend(); ++it) {
@@ -1049,9 +1049,8 QCPLayer::~QCPLayer()
1049 mChildren.last()->setLayer(0); // removes itself from mChildren via removeChild()
1049 mChildren.last()->setLayer(0); // removes itself from mChildren via removeChild()
1050
1050
1051 if (mParentPlot->currentLayer() == this)
1051 if (mParentPlot->currentLayer() == this)
1052 qDebug() << Q_FUNC_INFO
1052 qDebug() << Q_FUNC_INFO << "The parent plot's mCurrentLayer will be a dangling pointer. "
1053 << "The parent plot's mCurrentLayer will be a dangling pointer. "
1053 "Should have been set to a valid layer or 0 beforehand.";
1054 "Should have been set to a valid layer or 0 beforehand.";
1055 }
1054 }
1056
1055
1057 /*!
1056 /*!
@@ -1575,7 +1574,10 void QCPLayerable::applyAntialiasingHint(QCPPainter *painter, bool localAntialia
1575
1574
1576 \see initializeParentPlot
1575 \see initializeParentPlot
1577 */
1576 */
1578 void QCPLayerable::parentPlotInitialized(QCustomPlot *parentPlot){Q_UNUSED(parentPlot)}
1577 void QCPLayerable::parentPlotInitialized(QCustomPlot *parentPlot)
1578 {
1579 Q_UNUSED(parentPlot)
1580 }
1579
1581
1580 /*! \internal
1582 /*! \internal
1581
1583
@@ -8483,9 +8485,8 void QCPAxis::scaleRange(double factor, double center)
8483 mRange = newRange.sanitizedForLogScale();
8485 mRange = newRange.sanitizedForLogScale();
8484 }
8486 }
8485 else
8487 else
8486 qDebug() << Q_FUNC_INFO
8488 qDebug() << Q_FUNC_INFO << "Center of scaling operation doesn't lie in same "
8487 << "Center of scaling operation doesn't lie in same "
8489 "logarithmic sign domain as range:"
8488 "logarithmic sign domain as range:"
8489 << center;
8490 << center;
8490 }
8491 }
8491 emit rangeChanged(mRange);
8492 emit rangeChanged(mRange);
@@ -9256,16 +9257,14 void QCPAxisPainterPrivate::draw(QCPPainter *painter)
9256 painter->setBrush(QBrush(basePen.color()));
9257 painter->setBrush(QBrush(basePen.color()));
9257 QCPVector2D baseLineVector(baseLine.dx(), baseLine.dy());
9258 QCPVector2D baseLineVector(baseLine.dx(), baseLine.dy());
9258 if (lowerEnding.style() != QCPLineEnding::esNone)
9259 if (lowerEnding.style() != QCPLineEnding::esNone)
9259 lowerEnding.draw(painter,
9260 lowerEnding.draw(painter, QCPVector2D(baseLine.p1())
9260 QCPVector2D(baseLine.p1())
9261 - baseLineVector.normalized() * lowerEnding.realLength()
9261 - baseLineVector.normalized() * lowerEnding.realLength()
9262 * (lowerEnding.inverted() ? -1 : 1),
9262 * (lowerEnding.inverted() ? -1 : 1),
9263 -baseLineVector);
9263 -baseLineVector);
9264 if (upperEnding.style() != QCPLineEnding::esNone)
9264 if (upperEnding.style() != QCPLineEnding::esNone)
9265 upperEnding.draw(painter,
9265 upperEnding.draw(painter, QCPVector2D(baseLine.p2())
9266 QCPVector2D(baseLine.p2())
9266 + baseLineVector.normalized() * upperEnding.realLength()
9267 + baseLineVector.normalized() * upperEnding.realLength()
9267 * (upperEnding.inverted() ? -1 : 1),
9268 * (upperEnding.inverted() ? -1 : 1),
9269 baseLineVector);
9268 baseLineVector);
9270 painter->setAntialiasing(antialiasingBackup);
9269 painter->setAntialiasing(antialiasingBackup);
9271
9270
@@ -9571,16 +9570,14 void QCPAxisPainterPrivate::placeTickLabel(QCPPainter *painter, double position,
9571 bool labelClippedByBorder = false;
9570 bool labelClippedByBorder = false;
9572 if (tickLabelSide == QCPAxis::lsOutside) {
9571 if (tickLabelSide == QCPAxis::lsOutside) {
9573 if (QCPAxis::orientation(type) == Qt::Horizontal)
9572 if (QCPAxis::orientation(type) == Qt::Horizontal)
9574 labelClippedByBorder = finalPosition.x()
9573 labelClippedByBorder = finalPosition.x() + (labelData.rotatedTotalBounds.width()
9575 + (labelData.rotatedTotalBounds.width()
9574 + labelData.rotatedTotalBounds.left())
9576 + labelData.rotatedTotalBounds.left())
9577 > viewportRect.right()
9575 > viewportRect.right()
9578 || finalPosition.x() + labelData.rotatedTotalBounds.left()
9576 || finalPosition.x() + labelData.rotatedTotalBounds.left()
9579 < viewportRect.left();
9577 < viewportRect.left();
9580 else
9578 else
9581 labelClippedByBorder = finalPosition.y()
9579 labelClippedByBorder = finalPosition.y() + (labelData.rotatedTotalBounds.height()
9582 + (labelData.rotatedTotalBounds.height()
9580 + labelData.rotatedTotalBounds.top())
9583 + labelData.rotatedTotalBounds.top())
9584 > viewportRect.bottom()
9581 > viewportRect.bottom()
9585 || finalPosition.y() + labelData.rotatedTotalBounds.top()
9582 || finalPosition.y() + labelData.rotatedTotalBounds.top()
9586 < viewportRect.top();
9583 < viewportRect.top();
@@ -12531,9 +12528,8 double QCPAbstractItem::rectDistance(const QRectF &rect, const QPointF &pos, boo
12531 */
12528 */
12532 QPointF QCPAbstractItem::anchorPixelPosition(int anchorId) const
12529 QPointF QCPAbstractItem::anchorPixelPosition(int anchorId) const
12533 {
12530 {
12534 qDebug() << Q_FUNC_INFO
12531 qDebug() << Q_FUNC_INFO << "called on item which shouldn't have any anchors (this method not "
12535 << "called on item which shouldn't have any anchors (this method not "
12532 "reimplemented). anchorId"
12536 "reimplemented). anchorId"
12537 << anchorId;
12533 << anchorId;
12538 return QPointF();
12534 return QPointF();
12539 }
12535 }
@@ -13459,10 +13455,9 void QCustomPlot::setOpenGl(bool enabled, int multisampling)
13459 setupPaintBuffers();
13455 setupPaintBuffers();
13460 #else
13456 #else
13461 Q_UNUSED(enabled)
13457 Q_UNUSED(enabled)
13462 qDebug() << Q_FUNC_INFO
13458 qDebug() << Q_FUNC_INFO << "QCustomPlot can't use OpenGL because QCUSTOMPLOT_USE_OPENGL was "
13463 << "QCustomPlot can't use OpenGL because QCUSTOMPLOT_USE_OPENGL was "
13459 "not defined during compilation (add 'DEFINES += "
13464 "not defined during compilation (add 'DEFINES += "
13460 "QCUSTOMPLOT_USE_OPENGL' to your qmake .pro file)";
13465 "QCUSTOMPLOT_USE_OPENGL' to your qmake .pro file)";
13466 #endif
13461 #endif
13467 }
13462 }
13468
13463
@@ -13819,9 +13814,8 QCPGraph *QCustomPlot::addGraph(QCPAxis *keyAxis, QCPAxis *valueAxis)
13819 if (!valueAxis)
13814 if (!valueAxis)
13820 valueAxis = yAxis;
13815 valueAxis = yAxis;
13821 if (!keyAxis || !valueAxis) {
13816 if (!keyAxis || !valueAxis) {
13822 qDebug() << Q_FUNC_INFO
13817 qDebug() << Q_FUNC_INFO << "can't use default QCustomPlot xAxis or yAxis, because at least "
13823 << "can't use default QCustomPlot xAxis or yAxis, because at least "
13818 "one is invalid (has been deleted)";
13824 "one is invalid (has been deleted)";
13825 return 0;
13819 return 0;
13826 }
13820 }
13827 if (keyAxis->parentPlot() != this || valueAxis->parentPlot() != this) {
13821 if (keyAxis->parentPlot() != this || valueAxis->parentPlot() != this) {
@@ -15243,9 +15237,8 QCPAbstractPaintBuffer *QCustomPlot::createPaintBuffer()
15243 return new QCPPaintBufferGlPbuffer(viewport().size(), mBufferDevicePixelRatio,
15237 return new QCPPaintBufferGlPbuffer(viewport().size(), mBufferDevicePixelRatio,
15244 mOpenGlMultisamples);
15238 mOpenGlMultisamples);
15245 #else
15239 #else
15246 qDebug() << Q_FUNC_INFO
15240 qDebug() << Q_FUNC_INFO << "OpenGL enabled even though no support for it compiled in, this "
15247 << "OpenGL enabled even though no support for it compiled in, this "
15241 "shouldn't have happened. Falling back to pixmap paint buffer.";
15248 "shouldn't have happened. Falling back to pixmap paint buffer.";
15249 return new QCPPaintBufferPixmap(viewport().size(), mBufferDevicePixelRatio);
15242 return new QCPPaintBufferPixmap(viewport().size(), mBufferDevicePixelRatio);
15250 #endif
15243 #endif
15251 }
15244 }
@@ -16476,9 +16469,8 void QCPColorGradient::updateColorBuffer()
16476 hue -= 1.0;
16469 hue -= 1.0;
16477 if (useAlpha) {
16470 if (useAlpha) {
16478 const QRgb rgb
16471 const QRgb rgb
16479 = QColor::fromHsvF(hue,
16472 = QColor::fromHsvF(hue, (1 - t) * lowHsv.saturationF()
16480 (1 - t) * lowHsv.saturationF()
16473 + t * highHsv.saturationF(),
16481 + t * highHsv.saturationF(),
16482 (1 - t) * lowHsv.valueF() + t * highHsv.valueF())
16474 (1 - t) * lowHsv.valueF() + t * highHsv.valueF())
16483 .rgb();
16475 .rgb();
16484 const float alpha = (1 - t) * lowHsv.alphaF() + t * highHsv.alphaF();
16476 const float alpha = (1 - t) * lowHsv.alphaF() + t * highHsv.alphaF();
@@ -16487,9 +16479,8 void QCPColorGradient::updateColorBuffer()
16487 }
16479 }
16488 else {
16480 else {
16489 mColorBuffer[i]
16481 mColorBuffer[i]
16490 = QColor::fromHsvF(hue,
16482 = QColor::fromHsvF(hue, (1 - t) * lowHsv.saturationF()
16491 (1 - t) * lowHsv.saturationF()
16483 + t * highHsv.saturationF(),
16492 + t * highHsv.saturationF(),
16493 (1 - t) * lowHsv.valueF() + t * highHsv.valueF())
16484 (1 - t) * lowHsv.valueF() + t * highHsv.valueF())
16494 .rgb();
16485 .rgb();
16495 }
16486 }
General Comments 0
You need to be logged in to leave comments. Login now