diff --git a/Applications/DataExplorer/DataView/DiagramView/DiagramList.cpp b/Applications/DataExplorer/DataView/DiagramView/DiagramList.cpp index 0083b08a56a84d28ab2841c4fd4facd864ed41e6..bc736215ddfa37374a9ed7a49dee3613ee45e402 100644 --- a/Applications/DataExplorer/DataView/DiagramView/DiagramList.cpp +++ b/Applications/DataExplorer/DataView/DiagramView/DiagramList.cpp @@ -192,12 +192,15 @@ int DiagramList::readList(const QString &path, std::vector<DiagramList*> &lists) first_loop = false; } - float const numberOfSecs = static_cast<float>(startDate.secsTo(currentDate)); + float const numberOfSecs = + static_cast<float>(startDate.secsTo(currentDate)); for (int i = 0; i < nLists; i++) { - float const value = static_cast<float>(strtod( - BaseLib::replaceString(",", ".", fields.takeFirst().toStdString()).c_str(), - nullptr)); + float const value = static_cast<float>( + strtod(BaseLib::replaceString( + ",", ".", fields.takeFirst().toStdString()) + .c_str(), + nullptr)); lists[i]->addNextPoint(numberOfSecs,value); } } @@ -261,12 +264,15 @@ int DiagramList::readList(const SensorData* data, std::vector<DiagramList*> &lis if (is_date) { l->setXUnit("day"); - QDateTime const startDate(getDateTime(BaseLib::int2date(time_steps[0]))); + QDateTime const startDate( + getDateTime(BaseLib::int2date(time_steps[0]))); lists[i]->setStartDate(startDate); for (std::size_t j = 0; j < nValues; j++) { - QDateTime const currentDate(getDateTime(BaseLib::int2date(time_steps[j]))); - float numberOfSecs = static_cast<float>(startDate.secsTo(currentDate)); + QDateTime const currentDate( + getDateTime(BaseLib::int2date(time_steps[j]))); + float numberOfSecs = + static_cast<float>(startDate.secsTo(currentDate)); lists[i]->addNextPoint(numberOfSecs, (*time_series)[j]); } } @@ -296,8 +302,11 @@ void DiagramList::truncateToRange(QDateTime const& start, QDateTime const& end) if (start_secs == 0 && end_secs == _coords.back().first) return; - _coords.erase(std::remove_if(_coords.begin(), _coords.end(), - [&](std::pair<float, float> const& c){return (c.first<start_secs || c.first>end_secs);}), + _coords.erase( + std::remove_if(_coords.begin(), _coords.end(), + [&](std::pair<float, float> const& c) { + return (c.first < start_secs || c.first > end_secs); + }), _coords.end()); _startDate = start; for (auto& c : _coords) @@ -305,7 +314,8 @@ void DiagramList::truncateToRange(QDateTime const& start, QDateTime const& end) update(); } -void DiagramList::setList(std::vector<std::pair<QDateTime, float>> const& coords) +void DiagramList::setList( + std::vector<std::pair<QDateTime, float>> const& coords) { if (coords.empty()) return; @@ -324,7 +334,7 @@ void DiagramList::setList(std::vector<std::pair<QDateTime, float>> const& coords update(); } -void DiagramList::setList(std::vector< std::pair<float, float> > const& coords) +void DiagramList::setList(std::vector<std::pair<float, float>> const& coords) { if (coords.empty()) return; diff --git a/Applications/DataExplorer/DataView/DiagramView/DiagramList.h b/Applications/DataExplorer/DataView/DiagramView/DiagramList.h index 36f45a45fc9be745c8584fafe4c6aae7821fbd3c..25056016fe80276c0e002d15da14f5764275a9cb 100644 --- a/Applications/DataExplorer/DataView/DiagramView/DiagramList.h +++ b/Applications/DataExplorer/DataView/DiagramView/DiagramList.h @@ -124,7 +124,7 @@ public: * Sets the list of x/y-coordinates. * \param coords List of coordinates. */ - void setList(std::vector< std::pair<float, float> > const& coords); + void setList(std::vector<std::pair<float, float>> const& coords); /** * Sets the list of x/y-coordinates. @@ -132,7 +132,7 @@ public: * days from the first date (which is set as day 0) * \param coords List of coordinates. */ - void setList(std::vector< std::pair<QDateTime, float> > const& coords); + void setList(std::vector<std::pair<QDateTime, float>> const& coords); /// Specifies the unit of the x Axis. void setXUnit(QString unit) { _xUnit = unit; } diff --git a/Applications/DataExplorer/DataView/DiagramView/DiagramPrefsDialog.cpp b/Applications/DataExplorer/DataView/DiagramView/DiagramPrefsDialog.cpp index fa90b934052cad26ade2135afd93dcc814022e46..6cc1344e0149ba15ebd07a70f23cd16f1e416ab2 100644 --- a/Applications/DataExplorer/DataView/DiagramView/DiagramPrefsDialog.cpp +++ b/Applications/DataExplorer/DataView/DiagramView/DiagramPrefsDialog.cpp @@ -85,7 +85,8 @@ void DiagramPrefsDialog::accept() } // Data has been loaded. - // If loading lists beyond the first one fails at least nothing terrible will happen. + // If loading lists beyond the first one fails at least nothing terrible + // will happen. bool window_is_empty(false); if (_window == nullptr) { @@ -145,7 +146,8 @@ int DiagramPrefsDialog::loadFile(const QString &filename) item->setColor(QColor(Qt::red)); } fromDateLine->setText(_list[0]->getStartDate().toString("dd.MM.yyyy")); - QDateTime endDate = _list[0]->getStartDate().addSecs(static_cast<int>(_list[0]->maxXValue())); + QDateTime endDate = _list[0]->getStartDate().addSecs( + static_cast<int>(_list[0]->maxXValue())); toDateLine->setText(endDate.toString("dd.MM.yyyy")); this->createVisibilityCheckboxes(); return 1; diff --git a/Applications/DataExplorer/DataView/DiagramView/DiagramScene.cpp b/Applications/DataExplorer/DataView/DiagramView/DiagramScene.cpp index 0c02905aabbc7ef2780bb68719042172a8d9a33f..9dac32b30edf3615f49146714f3cdcc04b561e31 100644 --- a/Applications/DataExplorer/DataView/DiagramView/DiagramScene.cpp +++ b/Applications/DataExplorer/DataView/DiagramView/DiagramScene.cpp @@ -68,7 +68,7 @@ DiagramScene::~DiagramScene() } /// Adds an arrow object to the diagram which might be used as a coordinate axis, etc. -QArrow* DiagramScene::addArrow(qreal length, qreal angle, QPen &pen) +QArrow* DiagramScene::addArrow(qreal length, qreal angle, QPen& pen) { auto* arrow = new QArrow(length, angle, 8, 5, pen); addItem(arrow); @@ -229,9 +229,9 @@ void DiagramScene::constructGrid() for (int j = 0; j <= numYTicks; ++j) { - qreal y = _bounds.bottom() / _scaleY - - (j * (_bounds.height() / _scaleY) / numYTicks); - qreal label = _bounds.top() / _scaleY + + qreal y = _bounds.bottom() / _scaleY - + (j * (_bounds.height() / _scaleY) / numYTicks); + qreal label = _bounds.top() / _scaleY + (j * (_bounds.height() / _scaleY) / numYTicks); _yTicksText.push_back(addNonScalableText(QString::number(label))); _yTicksText.last()->setPos(_bounds.left() - MARGIN / 2, y * _scaleY); diff --git a/Applications/DataExplorer/DataView/DiagramView/DiagramScene.h b/Applications/DataExplorer/DataView/DiagramView/DiagramScene.h index 3eef400d7ca8941d1dbe3c676df2d3977a1ba424..3fe924ea1bd37da5255a2be371a93da97387e295 100644 --- a/Applications/DataExplorer/DataView/DiagramView/DiagramScene.h +++ b/Applications/DataExplorer/DataView/DiagramView/DiagramScene.h @@ -32,7 +32,7 @@ public: DiagramScene(DiagramList* list, QObject* parent = nullptr); ~DiagramScene() override; - QArrow* addArrow(qreal length, qreal angle, QPen &pen); + QArrow* addArrow(qreal length, qreal angle, QPen& pen); void addGraph(DiagramList* list); QGraphicsGrid* addGrid(const QRectF &rect, int xTicks, int yTicks, const QPen &pen); diff --git a/Applications/DataExplorer/DataView/DiagramView/QArrow.cpp b/Applications/DataExplorer/DataView/DiagramView/QArrow.cpp index e54f20f7a0d3347daba65c8ab47aff5a6dac0034..a843635294b678e7ba409ac1d0aba370f86bb438 100644 --- a/Applications/DataExplorer/DataView/DiagramView/QArrow.cpp +++ b/Applications/DataExplorer/DataView/DiagramView/QArrow.cpp @@ -26,7 +26,8 @@ * \param parent The parent QGraphicsItem. */ QArrow::QArrow(qreal l, qreal a, qreal hl, qreal hw, QPen& pen, - QGraphicsItem* parent) : QGraphicsItem(parent) + QGraphicsItem* parent) + : QGraphicsItem(parent) { _arrowLength = l; _arrowAngle = a;