mirror of
https://github.com/Serial-Studio/Serial-Studio.git
synced 2025-01-15 05:22:53 +08:00
Clang-tidy fixes
This commit is contained in:
parent
4d027135df
commit
6d094c95bd
@ -55,13 +55,24 @@ QT += core5compat
|
||||
QT += printsupport
|
||||
QT += quickcontrols2
|
||||
|
||||
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x050F00
|
||||
|
||||
#-----------------------------------------------------------------------------------------
|
||||
# Compiler options
|
||||
#-----------------------------------------------------------------------------------------
|
||||
|
||||
*g++*: {
|
||||
QMAKE_CXXFLAGS_RELEASE -= -O
|
||||
QMAKE_CXXFLAGS_RELEASE -= -O1
|
||||
QMAKE_CXXFLAGS_RELEASE -= -O2
|
||||
QMAKE_CXXFLAGS_RELEASE *= -O3
|
||||
QMAKE_CXXFLAGS_RELEASE *= -Ofast
|
||||
}
|
||||
|
||||
*clang*: {
|
||||
QMAKE_CXXFLAGS_RELEASE -= -O1
|
||||
QMAKE_CXXFLAGS_RELEASE -= -O2
|
||||
QMAKE_CXXFLAGS_RELEASE *= -O3
|
||||
QMAKE_CXXFLAGS_RELEASE *= -Ofast
|
||||
}
|
||||
|
||||
*msvc*: {
|
||||
@ -69,7 +80,7 @@ QT += quickcontrols2
|
||||
QMAKE_CXXFLAGS_RELEASE *= /O2
|
||||
}
|
||||
|
||||
CONFIG += c++17
|
||||
CONFIG += c++11
|
||||
CONFIG += silent
|
||||
|
||||
#-----------------------------------------------------------------------------------------
|
||||
|
@ -28,7 +28,6 @@
|
||||
#include <QFile>
|
||||
#include <QTimer>
|
||||
#include <QObject>
|
||||
#include <QStringList>
|
||||
#include <QJsonDocument>
|
||||
|
||||
namespace CSV
|
||||
@ -104,7 +103,7 @@ private:
|
||||
QFile m_csvFile;
|
||||
QTimer m_frameTimer;
|
||||
QString m_timestamp;
|
||||
QList<QStringList> m_csvData;
|
||||
QVector<QVector<QString>> m_csvData;
|
||||
QMap<QString, QSet<QString>> m_model;
|
||||
QMap<QString, QMap<QString, int>> m_datasetIndexes;
|
||||
};
|
||||
|
@ -203,9 +203,9 @@ QString Console::currentHistoryString() const
|
||||
* Returns a list with the available data (sending) modes. This list must be synchronized
|
||||
* with the order of the @c DataMode enums.
|
||||
*/
|
||||
QStringList Console::dataModes() const
|
||||
QVector<QString> Console::dataModes() const
|
||||
{
|
||||
QStringList list;
|
||||
QVector<QString> list;
|
||||
list.append(tr("ASCII"));
|
||||
list.append(tr("HEX"));
|
||||
return list;
|
||||
@ -215,9 +215,9 @@ QStringList Console::dataModes() const
|
||||
* Returns a list with the available line endings options. This list must be synchronized
|
||||
* with the order of the @c LineEnding enums.
|
||||
*/
|
||||
QStringList Console::lineEndings() const
|
||||
QVector<QString> Console::lineEndings() const
|
||||
{
|
||||
QStringList list;
|
||||
QVector<QString> list;
|
||||
list.append(tr("No line ending"));
|
||||
list.append(tr("New line"));
|
||||
list.append(tr("Carriage return"));
|
||||
@ -229,9 +229,9 @@ QStringList Console::lineEndings() const
|
||||
* Returns a list with the available console display modes. This list must be synchronized
|
||||
* with the order of the @c DisplayMode enums.
|
||||
*/
|
||||
QStringList Console::displayModes() const
|
||||
QVector<QString> Console::displayModes() const
|
||||
{
|
||||
QStringList list;
|
||||
QVector<QString> list;
|
||||
list.append(tr("Plain text"));
|
||||
list.append(tr("Hexadecimal"));
|
||||
return list;
|
||||
@ -307,7 +307,7 @@ void Console::clear()
|
||||
}
|
||||
|
||||
/**
|
||||
* Comamnds sent by the user are stored in a @c QStringList, in which the first items
|
||||
* Comamnds sent by the user are stored in a @c QVector<QString>, in which the first items
|
||||
* are the oldest commands.
|
||||
*
|
||||
* The user can navigate the list using the up/down keys. This function allows the user
|
||||
@ -323,7 +323,7 @@ void Console::historyUp()
|
||||
}
|
||||
|
||||
/**
|
||||
* Comamnds sent by the user are stored in a @c QStringList, in which the first items
|
||||
* Comamnds sent by the user are stored in a @c QVector<QString>, in which the first items
|
||||
* are the oldest commands.
|
||||
*
|
||||
* The user can navigate the list using the up/down keys. This function allows the user
|
||||
|
@ -24,7 +24,6 @@
|
||||
#define IO_CONSOLE_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QStringList>
|
||||
|
||||
namespace IO
|
||||
{
|
||||
@ -122,9 +121,9 @@ public:
|
||||
DisplayMode displayMode() const;
|
||||
QString currentHistoryString() const;
|
||||
|
||||
Q_INVOKABLE QStringList dataModes() const;
|
||||
Q_INVOKABLE QStringList lineEndings() const;
|
||||
Q_INVOKABLE QStringList displayModes() const;
|
||||
Q_INVOKABLE QVector<QString> dataModes() const;
|
||||
Q_INVOKABLE QVector<QString> lineEndings() const;
|
||||
Q_INVOKABLE QVector<QString> displayModes() const;
|
||||
Q_INVOKABLE QString formatUserHex(const QString &text);
|
||||
|
||||
public slots:
|
||||
@ -167,8 +166,8 @@ private:
|
||||
bool m_showTimestamp;
|
||||
bool m_isStartingLine;
|
||||
|
||||
QStringList m_lines;
|
||||
QStringList m_historyItems;
|
||||
QVector<QString> m_lines;
|
||||
QVector<QString> m_historyItems;
|
||||
|
||||
QString m_textBuffer;
|
||||
QString m_printFont;
|
||||
|
@ -117,9 +117,9 @@ bool Network::configurationOk() const
|
||||
/**
|
||||
* Returns a list with the available socket types
|
||||
*/
|
||||
QStringList Network::socketTypes() const
|
||||
QVector<QString> Network::socketTypes() const
|
||||
{
|
||||
return QStringList { "TCP", "UDP" };
|
||||
return QVector<QString> { "TCP", "UDP" };
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -59,7 +59,7 @@ class Network : public QObject
|
||||
READ socketTypeIndex
|
||||
WRITE setSocketTypeIndex
|
||||
NOTIFY socketTypeChanged)
|
||||
Q_PROPERTY(QStringList socketTypes
|
||||
Q_PROPERTY(QVector<QString> socketTypes
|
||||
READ socketTypes
|
||||
CONSTANT)
|
||||
Q_PROPERTY(QString defaultHost
|
||||
@ -87,7 +87,7 @@ public:
|
||||
bool lookupActive() const;
|
||||
int socketTypeIndex() const;
|
||||
bool configurationOk() const;
|
||||
QStringList socketTypes() const;
|
||||
QVector<QString> socketTypes() const;
|
||||
QAbstractSocket::SocketType socketType() const;
|
||||
|
||||
static QString defaultHost() { return "127.0.0.1"; }
|
||||
|
@ -127,7 +127,7 @@ quint8 Serial::portIndex() const
|
||||
|
||||
/**
|
||||
* Returns the correspoding index of the parity configuration in relation
|
||||
* to the @c QStringList returned by the @c parityList() function.
|
||||
* to the @c QVector<QString> returned by the @c parityList() function.
|
||||
*/
|
||||
quint8 Serial::parityIndex() const
|
||||
{
|
||||
@ -136,7 +136,7 @@ quint8 Serial::parityIndex() const
|
||||
|
||||
/**
|
||||
* Returns the correspoding index of the data bits configuration in relation
|
||||
* to the @c QStringList returned by the @c dataBitsList() function.
|
||||
* to the @c QVector<QString> returned by the @c dataBitsList() function.
|
||||
*/
|
||||
quint8 Serial::dataBitsIndex() const
|
||||
{
|
||||
@ -145,7 +145,7 @@ quint8 Serial::dataBitsIndex() const
|
||||
|
||||
/**
|
||||
* Returns the correspoding index of the stop bits configuration in relation
|
||||
* to the @c QStringList returned by the @c stopBitsList() function.
|
||||
* to the @c QVector<QString> returned by the @c stopBitsList() function.
|
||||
*/
|
||||
quint8 Serial::stopBitsIndex() const
|
||||
{
|
||||
@ -154,7 +154,7 @@ quint8 Serial::stopBitsIndex() const
|
||||
|
||||
/**
|
||||
* Returns the correspoding index of the flow control config. in relation
|
||||
* to the @c QStringList returned by the @c flowControlList() function.
|
||||
* to the @c QVector<QString> returned by the @c flowControlList() function.
|
||||
*/
|
||||
quint8 Serial::flowControlIndex() const
|
||||
{
|
||||
@ -169,7 +169,7 @@ quint8 Serial::flowControlIndex() const
|
||||
* be "Select Serial Device". This is inteded to make the user interface
|
||||
* a little more friendly.
|
||||
*/
|
||||
QStringList Serial::portList() const
|
||||
QVector<QString> Serial::portList() const
|
||||
{
|
||||
return m_portList;
|
||||
}
|
||||
@ -178,9 +178,9 @@ QStringList Serial::portList() const
|
||||
* Returns a list with the available parity configurations.
|
||||
* This function can be used with a combo-box to build UIs.
|
||||
*/
|
||||
QStringList Serial::parityList() const
|
||||
QVector<QString> Serial::parityList() const
|
||||
{
|
||||
QStringList list;
|
||||
QVector<QString> list;
|
||||
list.append(tr("None"));
|
||||
list.append(tr("Even"));
|
||||
list.append(tr("Odd"));
|
||||
@ -193,7 +193,7 @@ QStringList Serial::parityList() const
|
||||
* Returns a list with the available baud rate configurations.
|
||||
* This function can be used with a combo-box to build UIs.
|
||||
*/
|
||||
QStringList Serial::baudRateList() const
|
||||
QVector<QString> Serial::baudRateList() const
|
||||
{
|
||||
return m_baudRateList;
|
||||
}
|
||||
@ -202,27 +202,27 @@ QStringList Serial::baudRateList() const
|
||||
* Returns a list with the available data bits configurations.
|
||||
* This function can be used with a combo-box to build UIs.
|
||||
*/
|
||||
QStringList Serial::dataBitsList() const
|
||||
QVector<QString> Serial::dataBitsList() const
|
||||
{
|
||||
return QStringList { "5", "6", "7", "8" };
|
||||
return QVector<QString> { "5", "6", "7", "8" };
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list with the available stop bits configurations.
|
||||
* This function can be used with a combo-box to build UIs.
|
||||
*/
|
||||
QStringList Serial::stopBitsList() const
|
||||
QVector<QString> Serial::stopBitsList() const
|
||||
{
|
||||
return QStringList { "1", "1.5", "2" };
|
||||
return QVector<QString> { "1", "1.5", "2" };
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list with the available flow control configurations.
|
||||
* This function can be used with a combo-box to build UIs.
|
||||
*/
|
||||
QStringList Serial::flowControlList() const
|
||||
QVector<QString> Serial::flowControlList() const
|
||||
{
|
||||
QStringList list;
|
||||
QVector<QString> list;
|
||||
list.append(tr("None"));
|
||||
list.append("RTS/CTS");
|
||||
list.append("XON/XOFF");
|
||||
@ -546,14 +546,14 @@ void Serial::setFlowControl(const quint8 flowControlIndex)
|
||||
}
|
||||
|
||||
/**
|
||||
* Scans for new serial ports available & generates a QStringList with current
|
||||
* Scans for new serial ports available & generates a QVector<QString> with current
|
||||
* serial ports.
|
||||
*/
|
||||
void Serial::refreshSerialDevices()
|
||||
{
|
||||
// Create device list, starting with dummy header
|
||||
// (for a more friendly UI when no devices are attached)
|
||||
QStringList ports;
|
||||
QVector<QString> ports;
|
||||
ports.append(tr("Select Port"));
|
||||
|
||||
// Search for available ports and add them to the lsit
|
||||
@ -619,7 +619,7 @@ void Serial::handleError(QSerialPort::SerialPortError error)
|
||||
void Serial::readSettings()
|
||||
{
|
||||
// Register standard baud rates
|
||||
QStringList stdBaudRates
|
||||
QVector<QString> stdBaudRates
|
||||
= { "300", "1200", "2400", "4800", "9600", "19200", "38400", "57600",
|
||||
"74880", "115200", "230400", "250000", "500000", "1000000", "2000000" };
|
||||
|
||||
|
@ -27,7 +27,6 @@
|
||||
#include <QString>
|
||||
#include <QSettings>
|
||||
#include <QByteArray>
|
||||
#include <QStringList>
|
||||
#include <QtSerialPort>
|
||||
#include <QTextCursor>
|
||||
#include <QQuickTextDocument>
|
||||
@ -76,22 +75,22 @@ class Serial : public QObject
|
||||
READ baudRate
|
||||
WRITE setBaudRate
|
||||
NOTIFY baudRateChanged)
|
||||
Q_PROPERTY(QStringList portList
|
||||
Q_PROPERTY(QVector<QString> portList
|
||||
READ portList
|
||||
NOTIFY availablePortsChanged)
|
||||
Q_PROPERTY(QStringList parityList
|
||||
Q_PROPERTY(QVector<QString> parityList
|
||||
READ parityList
|
||||
CONSTANT)
|
||||
Q_PROPERTY(QStringList baudRateList
|
||||
Q_PROPERTY(QVector<QString> baudRateList
|
||||
READ baudRateList
|
||||
NOTIFY baudRateListChanged)
|
||||
Q_PROPERTY(QStringList dataBitsList
|
||||
Q_PROPERTY(QVector<QString> dataBitsList
|
||||
READ dataBitsList
|
||||
CONSTANT)
|
||||
Q_PROPERTY(QStringList stopBitsList
|
||||
Q_PROPERTY(QVector<QString> stopBitsList
|
||||
READ stopBitsList
|
||||
CONSTANT)
|
||||
Q_PROPERTY(QStringList flowControlList
|
||||
Q_PROPERTY(QVector<QString> flowControlList
|
||||
READ flowControlList
|
||||
CONSTANT)
|
||||
// clang-format on
|
||||
@ -125,12 +124,12 @@ public:
|
||||
quint8 stopBitsIndex() const;
|
||||
quint8 flowControlIndex() const;
|
||||
|
||||
QStringList portList() const;
|
||||
QStringList parityList() const;
|
||||
QStringList baudRateList() const;
|
||||
QStringList dataBitsList() const;
|
||||
QStringList stopBitsList() const;
|
||||
QStringList flowControlList() const;
|
||||
QVector<QString> portList() const;
|
||||
QVector<QString> parityList() const;
|
||||
QVector<QString> baudRateList() const;
|
||||
QVector<QString> dataBitsList() const;
|
||||
QVector<QString> stopBitsList() const;
|
||||
QVector<QString> flowControlList() const;
|
||||
|
||||
qint32 baudRate() const;
|
||||
QSerialPort::Parity parity() const;
|
||||
@ -181,8 +180,8 @@ private:
|
||||
quint8 m_stopBitsIndex;
|
||||
quint8 m_flowControlIndex;
|
||||
|
||||
QStringList m_portList;
|
||||
QStringList m_baudRateList;
|
||||
QVector<QString> m_portList;
|
||||
QVector<QString> m_baudRateList;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -268,9 +268,9 @@ QString Manager::receivedDataLength() const
|
||||
/**
|
||||
* Returns a list with the possible data source options.
|
||||
*/
|
||||
QStringList Manager::dataSourcesList() const
|
||||
QVector<QString> Manager::dataSourcesList() const
|
||||
{
|
||||
QStringList list;
|
||||
QVector<QString> list;
|
||||
list.append(tr("Serial port"));
|
||||
list.append(tr("Network port"));
|
||||
return list;
|
||||
|
@ -151,7 +151,7 @@ public:
|
||||
QString separatorSequence() const;
|
||||
QString receivedDataLength() const;
|
||||
|
||||
Q_INVOKABLE QStringList dataSourcesList() const;
|
||||
Q_INVOKABLE QVector<QString> dataSourcesList() const;
|
||||
Q_INVOKABLE qint64 writeData(const QByteArray &data);
|
||||
|
||||
public slots:
|
||||
|
@ -90,19 +90,19 @@ Editor *Editor::getInstance()
|
||||
* interface to allow the user to build accelerometer, gyro & map widgets directly from
|
||||
* the UI.
|
||||
*/
|
||||
QStringList Editor::availableGroupLevelWidgets()
|
||||
QVector<QString> Editor::availableGroupLevelWidgets()
|
||||
{
|
||||
return QStringList { tr("Dataset widgets"), tr("Accelerometer"), tr("Gyroscope"),
|
||||
tr("Map"), tr("Multiple data plot") };
|
||||
return QVector<QString> { tr("Dataset widgets"), tr("Accelerometer"), tr("Gyroscope"),
|
||||
tr("Map"), tr("Multiple data plot") };
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list with the available dataset-level widgets. This list is used by the user
|
||||
* interface to allow the user to build gauge, bar & compass widgets directly from the UI.
|
||||
*/
|
||||
QStringList Editor::availableDatasetLevelWidgets()
|
||||
QVector<QString> Editor::availableDatasetLevelWidgets()
|
||||
{
|
||||
return QStringList { tr("None"), tr("Gauge"), tr("Bar/level"), tr("Compass") };
|
||||
return QVector<QString> { tr("None"), tr("Gauge"), tr("Bar/level"), tr("Compass") };
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -24,7 +24,6 @@
|
||||
#define JSON_EDITOR_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QStringList>
|
||||
|
||||
#include "Group.h"
|
||||
#include "Dataset.h"
|
||||
@ -89,8 +88,8 @@ signals:
|
||||
public:
|
||||
static Editor *getInstance();
|
||||
|
||||
Q_INVOKABLE QStringList availableGroupLevelWidgets();
|
||||
Q_INVOKABLE QStringList availableDatasetLevelWidgets();
|
||||
Q_INVOKABLE QVector<QString> availableGroupLevelWidgets();
|
||||
Q_INVOKABLE QVector<QString> availableDatasetLevelWidgets();
|
||||
|
||||
QString title() const;
|
||||
QString separator() const;
|
||||
|
@ -180,17 +180,17 @@ bool Client::isConnectedToHost() const
|
||||
/**
|
||||
* Returns a list with the available client operation modes.
|
||||
*/
|
||||
QStringList Client::clientModes() const
|
||||
QVector<QString> Client::clientModes() const
|
||||
{
|
||||
return QStringList { tr("Publisher"), tr("Subscriber") };
|
||||
return QVector<QString> { tr("Publisher"), tr("Subscriber") };
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list with the supported MQTT versions
|
||||
*/
|
||||
QStringList Client::mqttVersions() const
|
||||
QVector<QString> Client::mqttVersions() const
|
||||
{
|
||||
return QStringList { "MQTT 3.1.0", "MQTT 3.1.1" };
|
||||
return QVector<QString> { "MQTT 3.1.0", "MQTT 3.1.1" };
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -76,10 +76,10 @@ class Client : public QObject
|
||||
Q_PROPERTY(bool lookupActive
|
||||
READ lookupActive
|
||||
NOTIFY lookupActiveChanged)
|
||||
Q_PROPERTY(QStringList mqttVersions
|
||||
Q_PROPERTY(QVector<QString> mqttVersions
|
||||
READ mqttVersions
|
||||
CONSTANT)
|
||||
Q_PROPERTY(QStringList clientModes
|
||||
Q_PROPERTY(QVector<QString> clientModes
|
||||
READ clientModes
|
||||
CONSTANT)
|
||||
Q_PROPERTY(quint16 defaultPort
|
||||
@ -114,8 +114,8 @@ public:
|
||||
bool lookupActive() const;
|
||||
bool isSubscribed() const;
|
||||
bool isConnectedToHost() const;
|
||||
QStringList clientModes() const;
|
||||
QStringList mqttVersions() const;
|
||||
QVector<QString> clientModes() const;
|
||||
QVector<QString> mqttVersions() const;
|
||||
|
||||
quint16 defaultPort() const { return 1883; }
|
||||
QString defaultHost() const { return "127.0.0.1"; }
|
||||
|
@ -101,7 +101,7 @@ void ThemeManager::setTheme(const int id)
|
||||
if (ans == QMessageBox::Yes)
|
||||
{
|
||||
qApp->quit();
|
||||
QProcess::startDetached(qApp->arguments()[0], qApp->arguments());
|
||||
QProcess::startDetached(qApp->arguments().at(0), qApp->arguments());
|
||||
}
|
||||
}
|
||||
|
||||
@ -519,12 +519,12 @@ QColor ThemeManager::connectButtonUnchecked() const
|
||||
return m_connectButtonUnchecked;
|
||||
}
|
||||
|
||||
QStringList ThemeManager::widgetColors() const
|
||||
QVector<QString> ThemeManager::widgetColors() const
|
||||
{
|
||||
return m_widgetColors;
|
||||
}
|
||||
|
||||
QStringList ThemeManager::availableThemes() const
|
||||
QVector<QString> ThemeManager::availableThemes() const
|
||||
{
|
||||
return m_availableThemes;
|
||||
}
|
||||
|
@ -192,10 +192,10 @@ class ThemeManager : public QObject
|
||||
Q_PROPERTY(QColor connectButtonUnchecked
|
||||
READ connectButtonUnchecked
|
||||
NOTIFY themeChanged)
|
||||
Q_PROPERTY(QStringList widgetColors
|
||||
Q_PROPERTY(QVector<QString> widgetColors
|
||||
READ widgetColors
|
||||
NOTIFY themeChanged)
|
||||
Q_PROPERTY(QStringList availableThemes
|
||||
Q_PROPERTY(QVector<QString> availableThemes
|
||||
READ availableThemes
|
||||
NOTIFY availableThemesChanged)
|
||||
// clang-format on
|
||||
@ -262,8 +262,8 @@ public:
|
||||
QColor connectButtonChecked() const;
|
||||
QColor connectButtonUnchecked() const;
|
||||
|
||||
QStringList widgetColors() const;
|
||||
QStringList availableThemes() const;
|
||||
QVector<QString> widgetColors() const;
|
||||
QVector<QString> availableThemes() const;
|
||||
|
||||
public slots:
|
||||
void setTheme(const int id);
|
||||
@ -278,8 +278,8 @@ private:
|
||||
private:
|
||||
int m_themeId;
|
||||
QSettings m_settings;
|
||||
QStringList m_availableThemes;
|
||||
QStringList m_availableThemesPaths;
|
||||
QVector<QString> m_availableThemes;
|
||||
QVector<QString> m_availableThemesPaths;
|
||||
|
||||
QColor m_base;
|
||||
QColor m_link;
|
||||
@ -333,7 +333,7 @@ private:
|
||||
QColor m_widgetControlBackground;
|
||||
QColor m_connectButtonChecked;
|
||||
QColor m_connectButtonUnchecked;
|
||||
QStringList m_widgetColors;
|
||||
QVector<QString> m_widgetColors;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -147,9 +147,9 @@ QString Translator::acknowledgementsText() const
|
||||
/**
|
||||
* Returns a list with the available translation languages.
|
||||
*/
|
||||
QStringList Translator::availableLanguages() const
|
||||
QVector<QString> Translator::availableLanguages() const
|
||||
{
|
||||
return QStringList { "English", "Español", "简体中文", "Deutsch", "Русский" };
|
||||
return QVector<QString> { "English", "Español", "简体中文", "Deutsch", "Русский" };
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -41,7 +41,7 @@ class Translator : public QObject
|
||||
READ language
|
||||
WRITE setLanguage
|
||||
NOTIFY languageChanged)
|
||||
Q_PROPERTY(QStringList availableLanguages
|
||||
Q_PROPERTY(QVector<QString> availableLanguages
|
||||
READ availableLanguages
|
||||
CONSTANT)
|
||||
// clang-format on
|
||||
@ -57,7 +57,7 @@ public:
|
||||
|
||||
int language() const;
|
||||
int systemLanguage() const;
|
||||
QStringList availableLanguages() const;
|
||||
QVector<QString> availableLanguages() const;
|
||||
Q_INVOKABLE QString welcomeConsoleText() const;
|
||||
Q_INVOKABLE QString acknowledgementsText() const;
|
||||
|
||||
|
@ -168,13 +168,13 @@ int Dashboard::accelerometerCount() const { return m_accelerometerWidgets.count(
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Returns a @c QStringList with the titles of all the widgets that compose the current
|
||||
* JSON frame.
|
||||
* Returns a @c list with the titles of all the widgets that compose the current JSON
|
||||
* frame.
|
||||
*
|
||||
* We need to be careful to sincronize the order of the widgets in order to allow
|
||||
* the global-index system to work correctly.
|
||||
*/
|
||||
QStringList Dashboard::widgetTitles() const
|
||||
QVector<QString> Dashboard::widgetTitles() const
|
||||
{
|
||||
// Warning: maintain same order as the view option repeaters in ViewOptions.qml!
|
||||
|
||||
@ -505,16 +505,16 @@ bool Dashboard::accelerometerVisible(const int index) const { return getVisibili
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
// clang-format off
|
||||
QStringList Dashboard::barTitles() const { return datasetTitles(m_barWidgets); }
|
||||
QStringList Dashboard::mapTitles() const { return groupTitles(m_mapWidgets); }
|
||||
QStringList Dashboard::plotTitles() const { return datasetTitles(m_plotWidgets); }
|
||||
QStringList Dashboard::groupTitles() const { return groupTitles(m_groupWidgets); }
|
||||
QStringList Dashboard::gaugeTitles() const { return datasetTitles(m_gaugeWidgets); }
|
||||
QStringList Dashboard::compassTitles() const { return datasetTitles(m_compassWidgets); }
|
||||
QStringList Dashboard::gyroscopeTitles() const { return groupTitles(m_gyroscopeWidgets); }
|
||||
QStringList Dashboard::multiPlotTitles() const { return groupTitles(m_multiPlotWidgets); }
|
||||
QStringList Dashboard::thermometerTitles() const { return datasetTitles(m_thermometerWidgets); }
|
||||
QStringList Dashboard::accelerometerTitles() const { return groupTitles(m_accelerometerWidgets); }
|
||||
QVector<QString> Dashboard::barTitles() const { return datasetTitles(m_barWidgets); }
|
||||
QVector<QString> Dashboard::mapTitles() const { return groupTitles(m_mapWidgets); }
|
||||
QVector<QString> Dashboard::plotTitles() const { return datasetTitles(m_plotWidgets); }
|
||||
QVector<QString> Dashboard::groupTitles() const { return groupTitles(m_groupWidgets); }
|
||||
QVector<QString> Dashboard::gaugeTitles() const { return datasetTitles(m_gaugeWidgets); }
|
||||
QVector<QString> Dashboard::compassTitles() const { return datasetTitles(m_compassWidgets); }
|
||||
QVector<QString> Dashboard::gyroscopeTitles() const { return groupTitles(m_gyroscopeWidgets); }
|
||||
QVector<QString> Dashboard::multiPlotTitles() const { return groupTitles(m_multiPlotWidgets); }
|
||||
QVector<QString> Dashboard::thermometerTitles() const { return datasetTitles(m_thermometerWidgets); }
|
||||
QVector<QString> Dashboard::accelerometerTitles() const { return groupTitles(m_accelerometerWidgets); }
|
||||
// clang-format on
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -770,9 +770,9 @@ QVector<JSON::Dataset *> Dashboard::getWidgetDatasets(const QString &handle) con
|
||||
/**
|
||||
* Returns the titles of the datasets contained in the specified @a vector.
|
||||
*/
|
||||
QStringList Dashboard::datasetTitles(const QVector<JSON::Dataset *> &vector) const
|
||||
QVector<QString> Dashboard::datasetTitles(const QVector<JSON::Dataset *> &vector) const
|
||||
{
|
||||
QStringList list;
|
||||
QVector<QString> list;
|
||||
foreach (auto set, vector)
|
||||
list.append(set->title());
|
||||
|
||||
@ -782,9 +782,9 @@ QStringList Dashboard::datasetTitles(const QVector<JSON::Dataset *> &vector) con
|
||||
/**
|
||||
* Returns the titles of the groups contained in the specified @a vector.
|
||||
*/
|
||||
QStringList Dashboard::groupTitles(const QVector<JSON::Group *> &vector) const
|
||||
QVector<QString> Dashboard::groupTitles(const QVector<JSON::Group *> &vector) const
|
||||
{
|
||||
QStringList list;
|
||||
QVector<QString> list;
|
||||
foreach (auto group, vector)
|
||||
list.append(group->title());
|
||||
|
||||
|
@ -73,34 +73,34 @@ class Dashboard : public QObject
|
||||
Q_PROPERTY(int accelerometerCount
|
||||
READ accelerometerCount
|
||||
NOTIFY widgetCountChanged)
|
||||
Q_PROPERTY(QStringList mapTitles
|
||||
Q_PROPERTY(QVector<QString> mapTitles
|
||||
READ mapTitles
|
||||
NOTIFY widgetCountChanged)
|
||||
Q_PROPERTY(QStringList barTitles
|
||||
Q_PROPERTY(QVector<QString> barTitles
|
||||
READ barTitles
|
||||
NOTIFY widgetCountChanged)
|
||||
Q_PROPERTY(QStringList plotTitles
|
||||
Q_PROPERTY(QVector<QString> plotTitles
|
||||
READ plotTitles
|
||||
NOTIFY widgetCountChanged)
|
||||
Q_PROPERTY(QStringList groupTitles
|
||||
Q_PROPERTY(QVector<QString> groupTitles
|
||||
READ groupTitles
|
||||
NOTIFY widgetCountChanged)
|
||||
Q_PROPERTY(QStringList gaugeTitles
|
||||
Q_PROPERTY(QVector<QString> gaugeTitles
|
||||
READ gaugeTitles
|
||||
NOTIFY widgetCountChanged)
|
||||
Q_PROPERTY(QStringList compassTitles
|
||||
Q_PROPERTY(QVector<QString> compassTitles
|
||||
READ compassTitles
|
||||
NOTIFY widgetCountChanged)
|
||||
Q_PROPERTY(QStringList gyroscopeTitles
|
||||
Q_PROPERTY(QVector<QString> gyroscopeTitles
|
||||
READ gyroscopeTitles
|
||||
NOTIFY widgetCountChanged)
|
||||
Q_PROPERTY(QStringList multiPlotTitles
|
||||
Q_PROPERTY(QVector<QString> multiPlotTitles
|
||||
READ multiPlotTitles
|
||||
NOTIFY widgetCountChanged)
|
||||
Q_PROPERTY(QStringList thermometerTitles
|
||||
Q_PROPERTY(QVector<QString> thermometerTitles
|
||||
READ thermometerTitles
|
||||
NOTIFY widgetCountChanged)
|
||||
Q_PROPERTY(QStringList accelerometerTitles
|
||||
Q_PROPERTY(QVector<QString> accelerometerTitles
|
||||
READ accelerometerTitles
|
||||
NOTIFY widgetCountChanged)
|
||||
// clang-format on
|
||||
@ -159,7 +159,7 @@ public:
|
||||
int accelerometerCount() const;
|
||||
|
||||
Q_INVOKABLE bool frameValid() const;
|
||||
Q_INVOKABLE QStringList widgetTitles() const;
|
||||
Q_INVOKABLE QVector<QString> widgetTitles() const;
|
||||
Q_INVOKABLE int relativeIndex(const int globalIndex) const;
|
||||
Q_INVOKABLE bool widgetVisible(const int globalIndex) const;
|
||||
Q_INVOKABLE QString widgetIcon(const int globalIndex) const;
|
||||
@ -176,16 +176,16 @@ public:
|
||||
Q_INVOKABLE bool thermometerVisible(const int index) const;
|
||||
Q_INVOKABLE bool accelerometerVisible(const int index) const;
|
||||
|
||||
QStringList barTitles() const;
|
||||
QStringList mapTitles() const;
|
||||
QStringList plotTitles() const;
|
||||
QStringList groupTitles() const;
|
||||
QStringList gaugeTitles() const;
|
||||
QStringList compassTitles() const;
|
||||
QStringList gyroscopeTitles() const;
|
||||
QStringList multiPlotTitles() const;
|
||||
QStringList thermometerTitles() const;
|
||||
QStringList accelerometerTitles() const;
|
||||
QVector<QString> barTitles() const;
|
||||
QVector<QString> mapTitles() const;
|
||||
QVector<QString> plotTitles() const;
|
||||
QVector<QString> groupTitles() const;
|
||||
QVector<QString> gaugeTitles() const;
|
||||
QVector<QString> compassTitles() const;
|
||||
QVector<QString> gyroscopeTitles() const;
|
||||
QVector<QString> multiPlotTitles() const;
|
||||
QVector<QString> thermometerTitles() const;
|
||||
QVector<QString> accelerometerTitles() const;
|
||||
|
||||
public slots:
|
||||
void setBarVisible(const int index, const bool visible);
|
||||
@ -211,8 +211,8 @@ private:
|
||||
QVector<JSON::Group *> getWidgetGroups(const QString &handle) const;
|
||||
QVector<JSON::Dataset *> getWidgetDatasets(const QString &handle) const;
|
||||
|
||||
QStringList groupTitles(const QVector<JSON::Group *> &vector) const;
|
||||
QStringList datasetTitles(const QVector<JSON::Dataset *> &vector) const;
|
||||
QVector<QString> groupTitles(const QVector<JSON::Group *> &vector) const;
|
||||
QVector<QString> datasetTitles(const QVector<JSON::Dataset *> &vector) const;
|
||||
|
||||
bool getVisibility(const QVector<bool> &vector, const int index) const;
|
||||
void setVisibility(QVector<bool> &vector, const int index, const bool visible);
|
||||
|
@ -357,9 +357,11 @@ void Plot::replot()
|
||||
curveData->values().unlock();
|
||||
}
|
||||
|
||||
void Plot::updateData() {
|
||||
void Plot::updateData()
|
||||
{
|
||||
auto dataset = UI::Dashboard::getInstance()->getPlot(m_index);
|
||||
const QPointF s(static_cast<qreal>(m_elapsedTimer.elapsed()), dataset->value().toDouble());
|
||||
const QPointF s(static_cast<qreal>(m_elapsedTimer.elapsed()),
|
||||
dataset->value().toDouble());
|
||||
SignalData::instance().append(s);
|
||||
updateCurve();
|
||||
}
|
||||
@ -370,8 +372,6 @@ void Plot::setIntervalLength(double interval)
|
||||
{
|
||||
m_interval.setMaxValue(m_interval.minValue() + interval);
|
||||
setAxisScale(QwtAxis::XBottom, m_interval.minValue(), m_interval.maxValue());
|
||||
|
||||
replot();
|
||||
}
|
||||
}
|
||||
|
||||
@ -412,7 +412,7 @@ void Plot::updateCurve()
|
||||
void Plot::incrementInterval()
|
||||
{
|
||||
m_interval
|
||||
= QwtInterval(m_interval.maxValue(), m_interval.maxValue() + m_interval.width());
|
||||
= QwtInterval(m_interval.maxValue(), m_interval.maxValue() + m_interval.width());
|
||||
|
||||
CurveData *curveData = static_cast<CurveData *>(m_curve->data());
|
||||
curveData->values().clearStaleValues(m_interval.minValue());
|
||||
|
@ -934,7 +934,7 @@ QList<FormattedText> AnsiEscapeCodeHandler::parseText(const FormattedText &input
|
||||
}
|
||||
// get the number
|
||||
QString strNumber;
|
||||
QStringList numbers;
|
||||
QVector<QString> numbers;
|
||||
while (!strippedText.isEmpty())
|
||||
{
|
||||
if (strippedText.at(0).isDigit())
|
||||
|
Loading…
x
Reference in New Issue
Block a user