Skip to content

Commit e8021d5

Browse files
committed
fmt
1 parent a5729a0 commit e8021d5

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

chart.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Chart::Chart(QObject *parent) : QObject(parent) {
1313
dataUpdater.setSingleShot(true);
1414
QObject::connect(&dataUpdater, &QTimer::timeout, this, &Chart::updateAllSeries);
1515

16-
matrix = new MatrixXd(250,24);
16+
matrix = new MatrixXd(250, 24);
1717
}
1818

1919
void Chart::startUpdating(const QList<QLineSeries *> &seriesList, const QVector<qreal> &values, qreal windowWidth,
@@ -25,7 +25,7 @@ void Chart::startUpdating(const QList<QLineSeries *> &seriesList, const QVector<
2525
}
2626

2727
auto valuesVector = std::vector<qreal>(values.begin(), values.end());
28-
RowVectorXd vector = Map<RowVectorXd, Unaligned>(valuesVector.data(), (long)valuesVector.size());
28+
RowVectorXd vector = Map<RowVectorXd, Unaligned>(valuesVector.data(), (long) valuesVector.size());
2929
// cout << vector << endl;
3030

3131
c_seriesList = seriesList;
@@ -91,20 +91,16 @@ void Chart::updateAllSeries() {
9191
matrix = new MatrixXd(250, 24);
9292
}
9393

94-
void Chart::removeZeroRows(Eigen::MatrixXd& mat)
95-
{
94+
void Chart::removeZeroRows(Eigen::MatrixXd &mat) {
9695
Matrix<bool, Dynamic, 1> empty = (mat.array() == 0).rowwise().all();
9796

9897
auto last = mat.rows() - 1;
99-
for (long i = 0; i < last + 1;)
100-
{
101-
if (empty(i))
102-
{
98+
for (long i = 0; i < last + 1;) {
99+
if (empty(i)) {
103100
mat.row(i).swap(mat.row(last));
104101
empty.segment<1>(i).swap(empty.segment<1>(last));
105102
--last;
106-
}
107-
else {
103+
} else {
108104
++i;
109105
}
110106
}

chart.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ Q_OBJECT
2929
* @param windowWidth Width of the UI window
3030
* @param frequency Frequency of the streaming. This will change depending on the OS and the hardware
3131
*/
32-
void startUpdating(const QList<QLineSeries *> &seriesList, const QVector<qreal> &values, qreal windowWidth, qreal frequency);
32+
void startUpdating(const QList<QLineSeries *> &seriesList, const QVector<qreal> &values, qreal windowWidth,
33+
qreal frequency);
3334

3435
private slots:
3536
/**
@@ -52,7 +53,7 @@ private slots:
5253
* Removes an row with 0s in it.
5354
* @param mat new MatrixXd
5455
*/
55-
static void removeZeroRows(Eigen::MatrixXd& mat);
56+
static void removeZeroRows(Eigen::MatrixXd &mat);
5657

5758
};
5859

0 commit comments

Comments
 (0)