mirror of
https://github.com/Serial-Studio/Serial-Studio.git
synced 2025-01-31 17:42:55 +08:00
Add Q_SLOTS/Q_SIGNALS & fix FFT samples error in JSON editor
This commit is contained in:
parent
0bcfebb09b
commit
6f5046fb79
@ -60,7 +60,7 @@ class Export : public QObject
|
||||
NOTIFY enabledChanged)
|
||||
// clang-format on
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void openChanged();
|
||||
void enabledChanged();
|
||||
|
||||
@ -74,12 +74,12 @@ private:
|
||||
Export();
|
||||
~Export();
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void closeFile();
|
||||
void openCurrentCsv();
|
||||
void setExportEnabled(const bool enabled);
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void writeValues();
|
||||
void createCsvFile(const RawFrame &frame);
|
||||
void registerFrame(const QByteArray &data);
|
||||
|
@ -53,7 +53,7 @@ class Player : public QObject
|
||||
NOTIFY timestampChanged)
|
||||
// clang-format on
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void openChanged();
|
||||
void timestampChanged();
|
||||
void playerStateChanged();
|
||||
@ -73,7 +73,7 @@ public:
|
||||
private:
|
||||
Player();
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void play();
|
||||
void pause();
|
||||
void toggle();
|
||||
@ -84,7 +84,7 @@ public slots:
|
||||
void openFile(const QString &filePath);
|
||||
void setProgress(const qreal &progress);
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void updateData();
|
||||
|
||||
private:
|
||||
|
@ -73,7 +73,7 @@ class Console : public QObject
|
||||
NOTIFY historyItemChanged)
|
||||
// clang-format on
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void echoChanged();
|
||||
void dataReceived();
|
||||
void dataModeChanged();
|
||||
@ -126,7 +126,7 @@ public:
|
||||
Q_INVOKABLE StringList displayModes() const;
|
||||
Q_INVOKABLE QString formatUserHex(const QString &text);
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void save();
|
||||
void clear();
|
||||
void historyUp();
|
||||
@ -141,7 +141,7 @@ public slots:
|
||||
void setDisplayMode(const IO::Console::DisplayMode &mode);
|
||||
void append(const QString &str, const bool addTimestamp = false);
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void displayData();
|
||||
void onDataSent(const QByteArray &data);
|
||||
void addToHistory(const QString &command);
|
||||
|
@ -92,7 +92,7 @@ class Network : public QObject
|
||||
NOTIFY udpMulticastChanged)
|
||||
// clang-format on
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void portChanged();
|
||||
void addressChanged();
|
||||
void socketTypeChanged();
|
||||
@ -125,7 +125,7 @@ public:
|
||||
|
||||
QIODevice *openNetworkPort();
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void setTcpSocket();
|
||||
void setUdpSocket();
|
||||
void disconnectDevice();
|
||||
@ -138,7 +138,7 @@ public slots:
|
||||
void setRemoteAddress(const QString &address);
|
||||
void setSocketType(const QAbstractSocket::SocketType type);
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void lookupFinished(const QHostInfo &info);
|
||||
void onErrorOccurred(const QAbstractSocket::SocketError socketError);
|
||||
|
||||
|
@ -96,7 +96,7 @@ class Serial : public QObject
|
||||
CONSTANT)
|
||||
// clang-format on
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void portChanged();
|
||||
void parityChanged();
|
||||
void baudRateChanged();
|
||||
@ -140,7 +140,7 @@ public:
|
||||
|
||||
QSerialPort *openSerialPort();
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void disconnectDevice();
|
||||
void setBaudRate(const qint32 rate);
|
||||
void setParity(const quint8 parityIndex);
|
||||
@ -151,7 +151,7 @@ public slots:
|
||||
void setAutoReconnect(const bool autoreconnect);
|
||||
void setFlowControl(const quint8 flowControlIndex);
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void readSettings();
|
||||
void writeSettings();
|
||||
void refreshSerialDevices();
|
||||
|
@ -93,7 +93,7 @@ class Manager : public QObject
|
||||
NOTIFY configurationChanged)
|
||||
// clang-format on
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void deviceChanged();
|
||||
void connectedChanged();
|
||||
void watchdogTriggered();
|
||||
@ -148,7 +148,7 @@ public:
|
||||
Q_INVOKABLE StringList dataSourcesList() const;
|
||||
Q_INVOKABLE qint64 writeData(const QByteArray &data);
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void connectDevice();
|
||||
void toggleConnection();
|
||||
void disconnectDevice();
|
||||
@ -161,7 +161,7 @@ public slots:
|
||||
void setWatchdogInterval(const int interval = 15);
|
||||
void setDataSource(const IO::Manager::DataSource &source);
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void readFrames();
|
||||
void feedWatchdog();
|
||||
void onDataReceived();
|
||||
|
@ -782,16 +782,17 @@ void Editor::openJsonFile(const QString &path)
|
||||
setDatasetGraph(g, d, JFI_Value(dataset, "graph", "g").toBool());
|
||||
setDatasetTitle(g, d, JFI_Value(dataset, "title", "t").toString());
|
||||
setDatasetUnits(g, d, JFI_Value(dataset, "units", "u").toString());
|
||||
setDatasetFFTSamples(g, d, JFI_Value(dataset, "fftSamples").toString());
|
||||
setDatasetWidgetData(g, d, JFI_Value(dataset, "widget", "w").toString());
|
||||
|
||||
// Get max/min texts
|
||||
auto min = JFI_Value(dataset, "min").toDouble();
|
||||
auto max = JFI_Value(dataset, "max").toDouble();
|
||||
auto alarm = JFI_Value(dataset, "alarm").toDouble();
|
||||
auto fftSamples = JFI_Value(dataset, "fftSamples").toInt();
|
||||
setDatasetWidgetMin(g, d, QString::number(min));
|
||||
setDatasetWidgetMax(g, d, QString::number(max));
|
||||
setDatasetWidgetAlarm(g, d, QString::number(alarm));
|
||||
setDatasetFFTSamples(g, d, QString::number(fftSamples));
|
||||
|
||||
// Calculate dataset index
|
||||
auto index = JFI_Value(dataset, "value", "v").toString();
|
||||
|
@ -73,7 +73,7 @@ class Editor : public QObject
|
||||
NOTIFY jsonFileChanged)
|
||||
// clang-format on
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void titleChanged();
|
||||
void jsonFileChanged();
|
||||
void modifiedChanged();
|
||||
@ -129,7 +129,7 @@ public:
|
||||
|
||||
Q_INVOKABLE bool setGroupWidget(const int group, const int widgetId);
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void newJsonFile();
|
||||
void openJsonFile();
|
||||
void openJsonFile(const QString &path);
|
||||
@ -162,7 +162,7 @@ public slots:
|
||||
void setDatasetWidgetAlarm(const int group, const int dataset, const QString &alarm);
|
||||
void setDatasetFFTSamples(const int group, const int dataset, const QString &samples);
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void onJsonLoaded();
|
||||
void onModelChanged();
|
||||
void onGroupChanged(const int group);
|
||||
|
@ -47,14 +47,14 @@ class JSONWorker : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void finished();
|
||||
void jsonReady(const JFI_Object &info);
|
||||
|
||||
public:
|
||||
JSONWorker(const QByteArray &data, const quint64 frame, const QDateTime &time);
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void process();
|
||||
|
||||
private:
|
||||
@ -105,7 +105,7 @@ class Generator : public QObject
|
||||
NOTIFY processFramesInSeparateThreadChanged)
|
||||
// clang-format on
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void jsonFileMapChanged();
|
||||
void operationModeChanged();
|
||||
void jsonChanged(const JFI_Object &info);
|
||||
@ -128,7 +128,7 @@ public:
|
||||
OperationMode operationMode() const;
|
||||
bool processFramesInSeparateThread() const;
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void loadJsonMap();
|
||||
void loadJsonMap(const QString &path);
|
||||
void setProcessFramesInSeparateThread(const bool threaded);
|
||||
@ -137,13 +137,13 @@ public slots:
|
||||
private:
|
||||
Generator();
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void readSettings();
|
||||
void loadJFI(const JFI_Object &object);
|
||||
void writeSettings(const QString &path);
|
||||
void loadJSON(const QJsonDocument &json);
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void reset();
|
||||
void readData(const QByteArray &data);
|
||||
void processFrame(const QByteArray &data, const quint64 frame, const QDateTime &time);
|
||||
|
@ -138,7 +138,7 @@ class Client : public QObject
|
||||
NOTIFY caFilePathChanged)
|
||||
// clang-format on
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void qosChanged();
|
||||
void portChanged();
|
||||
void hostChanged();
|
||||
@ -183,7 +183,7 @@ public:
|
||||
quint16 defaultPort() const { return 1883; }
|
||||
QString defaultHost() const { return "127.0.0.1"; }
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void loadCaFile();
|
||||
void connectToHost();
|
||||
void toggleConnection();
|
||||
@ -207,7 +207,7 @@ private:
|
||||
Client();
|
||||
~Client();
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void sendData();
|
||||
void resetStatistics();
|
||||
void onConnectedChanged();
|
||||
|
@ -38,7 +38,7 @@ class MacExtras : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void setupClicked();
|
||||
void connectClicked();
|
||||
void consoleClicked();
|
||||
@ -47,13 +47,13 @@ signals:
|
||||
public:
|
||||
static MacExtras *getInstance();
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void setSetupChecked(const bool checked);
|
||||
void setConsoleChecked(const bool checked);
|
||||
void setDashboardChecked(const bool checked);
|
||||
void setDashboardEnabled(const bool enabled);
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void updateButtonText();
|
||||
|
||||
private:
|
||||
|
@ -51,7 +51,7 @@ public:
|
||||
void initializeQmlInterface();
|
||||
QQmlApplicationEngine *engine();
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void onQuit();
|
||||
void hideSplashscreen();
|
||||
void setSplashScreenMessage(const QString &message);
|
||||
|
@ -195,7 +195,7 @@ class ThemeManager : public QObject
|
||||
NOTIFY availableThemesChanged)
|
||||
// clang-format on
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void themeChanged();
|
||||
void availableThemesChanged();
|
||||
|
||||
@ -255,10 +255,10 @@ public:
|
||||
StringList widgetColors() const;
|
||||
StringList availableThemes() const;
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void setTheme(const int id);
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void populateThemes();
|
||||
void loadTheme(const int id);
|
||||
|
||||
|
@ -48,7 +48,7 @@ class TimerEvents : public QObject
|
||||
NOTIFY highFreqTimeoutChanged)
|
||||
// clang-format on
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void lowFreqTimeout();
|
||||
void highFreqTimeout();
|
||||
void highFreqTimeoutChanged();
|
||||
@ -57,7 +57,7 @@ public:
|
||||
static TimerEvents *getInstance();
|
||||
int highFreqTimeoutHz() const;
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void stopTimers();
|
||||
void startTimers();
|
||||
void setHighFreqTimeout(const int hz);
|
||||
|
@ -53,7 +53,7 @@ class Translator : public QObject
|
||||
CONSTANT)
|
||||
// clang-format on
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void languageChanged();
|
||||
|
||||
private:
|
||||
@ -68,7 +68,7 @@ public:
|
||||
Q_INVOKABLE QString welcomeConsoleText() const;
|
||||
Q_INVOKABLE QString acknowledgementsText() const;
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void setLanguage(const int language);
|
||||
void setLanguage(const QLocale &locale, const QString &language);
|
||||
|
||||
|
@ -52,7 +52,7 @@ public:
|
||||
const QMessageBox::StandardButtons &bt = QMessageBox::Ok);
|
||||
//clang-format on
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
static void aboutQt();
|
||||
static void revealFile(const QString& pathToReveal);
|
||||
};
|
||||
|
@ -60,18 +60,18 @@ class Server : public QObject
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void enabledChanged();
|
||||
|
||||
public:
|
||||
static Server *getInstance();
|
||||
bool enabled() const;
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void removeConnection();
|
||||
void setEnabled(const bool enabled);
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void onDataReceived();
|
||||
void acceptConnection();
|
||||
void sendProcessedData();
|
||||
|
@ -145,7 +145,7 @@ class Dashboard : public QObject
|
||||
NOTIFY widgetCountChanged)
|
||||
// clang-format on
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void updated();
|
||||
void dataReset();
|
||||
void titleChanged();
|
||||
@ -240,7 +240,7 @@ public:
|
||||
QVector<PlotData> *fftPlotValues() { return &m_fftPlotValues; }
|
||||
QVector<PlotData> *linearPlotValues() { return &m_linearPlotValues; }
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void setPoints(const int points);
|
||||
void setPrecision(const int precision);
|
||||
void setBarVisible(const int index, const bool visible);
|
||||
@ -255,7 +255,7 @@ public slots:
|
||||
void setMultiplotVisible(const int index, const bool visible);
|
||||
void setAccelerometerVisible(const int index, const bool visible);
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void resetData();
|
||||
void updateData();
|
||||
void updatePlots();
|
||||
|
@ -86,7 +86,7 @@ class WidgetLoader : public QQuickPaintedItem
|
||||
NOTIFY widgetVisibleChanged)
|
||||
// clang-format on
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void widgetIndexChanged();
|
||||
void widgetVisibleChanged();
|
||||
void isExternalWindowChanged();
|
||||
@ -107,13 +107,13 @@ public:
|
||||
bool isExternalWindow() const;
|
||||
UI::Dashboard::WidgetType widgetType() const;
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void setVisible(const bool visible);
|
||||
void setWidgetIndex(const int index);
|
||||
void setIsExternalWindow(const bool isWindow);
|
||||
void processMouseHover(const bool containsMouse);
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void updateWidgetSize();
|
||||
void updateWidgetVisible();
|
||||
|
||||
|
@ -34,7 +34,7 @@ class Accelerometer : public BaseWidget
|
||||
public:
|
||||
Accelerometer(const int index = -1);
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void updateData();
|
||||
|
||||
private:
|
||||
|
@ -34,7 +34,7 @@ class Bar : public BaseWidget
|
||||
public:
|
||||
Bar(const int index = -1);
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void updateData();
|
||||
void onResized();
|
||||
|
||||
|
@ -39,7 +39,7 @@ public:
|
||||
double angle() const;
|
||||
double gradient() const;
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void setAngle(const double &angle);
|
||||
void setGradient(const double &gradient);
|
||||
|
||||
|
@ -32,7 +32,7 @@ class BaseWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void resized();
|
||||
|
||||
public:
|
||||
|
@ -37,7 +37,7 @@ public:
|
||||
Qt::WindowFlags flags = Qt::WindowFlags());
|
||||
void setType(const Qt::TextElideMode type);
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void setText(const QString &text);
|
||||
void elide();
|
||||
|
||||
|
@ -34,7 +34,7 @@ class Compass : public BaseWidget
|
||||
public:
|
||||
Compass(const int index = -1);
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void update();
|
||||
|
||||
private:
|
||||
|
@ -39,7 +39,7 @@ public:
|
||||
DataGroup(const int index = -1);
|
||||
~DataGroup();
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void updateData();
|
||||
|
||||
protected:
|
||||
|
@ -40,7 +40,7 @@ public:
|
||||
FFTPlot(const int index = -1);
|
||||
~FFTPlot();
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void updateData();
|
||||
|
||||
private:
|
||||
|
@ -42,7 +42,7 @@ public:
|
||||
GPS(const int index = -1);
|
||||
~GPS();
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void updateData();
|
||||
|
||||
protected:
|
||||
|
@ -34,7 +34,7 @@ class Gauge : public BaseWidget
|
||||
public:
|
||||
Gauge(const int index = -1);
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void updateData();
|
||||
|
||||
private:
|
||||
|
@ -36,7 +36,7 @@ class Gyroscope : public BaseWidget
|
||||
public:
|
||||
Gyroscope(const int index = -1);
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void updateData();
|
||||
void updateLabel();
|
||||
|
||||
|
@ -40,7 +40,7 @@ public:
|
||||
LEDPanel(const int index = -1);
|
||||
~LEDPanel();
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void updateData();
|
||||
|
||||
protected:
|
||||
|
@ -41,7 +41,7 @@ class MultiPlot : public QWidget
|
||||
public:
|
||||
MultiPlot(const int index = -1);
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void updateData();
|
||||
void updateRange();
|
||||
|
||||
|
@ -37,7 +37,7 @@ class Plot : public QWidget
|
||||
public:
|
||||
Plot(const int index = -1);
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void updateData();
|
||||
void updateRange();
|
||||
|
||||
|
@ -126,7 +126,7 @@ class Terminal : public QQuickPaintedItem
|
||||
NOTIFY vt100EmulationChanged)
|
||||
// clang-format on
|
||||
|
||||
signals:
|
||||
Q_SIGNALS:
|
||||
void textChanged();
|
||||
void fontChanged();
|
||||
void readOnlyChanged();
|
||||
@ -170,7 +170,7 @@ public:
|
||||
QTextDocument *document() const;
|
||||
QPlainTextEdit *textEdit() const;
|
||||
|
||||
public slots:
|
||||
public Q_SLOTS:
|
||||
void copy();
|
||||
void clear();
|
||||
void selectAll();
|
||||
@ -192,7 +192,7 @@ public slots:
|
||||
void scrollToBottom(const bool repaint = false);
|
||||
void setMaximumBlockCount(const int maxBlockCount);
|
||||
|
||||
private slots:
|
||||
private Q_SLOTS:
|
||||
void updateWidgetSize();
|
||||
void updateScrollbarVisibility();
|
||||
void setCopyAvailable(const bool yes);
|
||||
|
Loading…
x
Reference in New Issue
Block a user