Work on implementing an unity build

This commit is contained in:
Alex Spataru 2021-11-05 00:44:03 -06:00
parent 249fb6e66f
commit b71541a782
39 changed files with 512 additions and 168 deletions

View File

@ -24,13 +24,13 @@
# Make options
#-----------------------------------------------------------------------------------------
DEFINES += SERIAL_STUDIO_MOC_INCLUDE=1
UI_DIR = uic
MOC_DIR = moc
RCC_DIR = qrc
OBJECTS_DIR = obj
DEFINES += SERIAL_STUDIO_MOC_INCLUDE=1
isEmpty(PREFIX) {
PREFIX = /usr
}
@ -236,7 +236,8 @@ SOURCES += \
src/Widgets/MultiPlot.cpp \
src/Widgets/Plot.cpp \
src/Widgets/Terminal.cpp \
src/main.cpp
src/main.cpp \
src/SingleCompilationUnit.cpp
#-------------------------------------------------------------------------------
# Deploy files

6
libs/Libraries.pri vendored
View File

@ -26,6 +26,12 @@
DEFINES += QTCSV_STATIC_LIB
#-------------------------------------------------------------------------------
# Useful hack for the unity build
#-------------------------------------------------------------------------------
INCLUDEPATH += $$PWD
#-------------------------------------------------------------------------------
# Include *.pri files
#-------------------------------------------------------------------------------

2
libs/qmqtt vendored

@ -1 +1 @@
Subproject commit 7b7f213c3a5fe4a35cf08dad2c9301d63202197b
Subproject commit 65483240cb70f35a62f9e73ec83f29710e864642

View File

@ -37,9 +37,9 @@
#include <QJsonDocument>
#include <QDesktopServices>
using namespace CSV;
static Export *INSTANCE = nullptr;
namespace CSV
{
static Export *EXPORT = nullptr;
/**
* Connect JSON Parser & Serial Manager signals to begin registering JSON
@ -69,10 +69,10 @@ Export::~Export()
*/
Export *Export::getInstance()
{
if (!INSTANCE)
INSTANCE = new Export;
if (!EXPORT)
EXPORT = new Export;
return INSTANCE;
return EXPORT;
}
/**
@ -297,6 +297,7 @@ void Export::registerFrame(const JFI_Object &info)
// Update JSON list
m_jsonList.append(info);
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_Export.cpp"

View File

@ -37,16 +37,9 @@
#include <Misc/Utilities.h>
#include <JSON/Generator.h>
using namespace CSV;
//
// Here be dragons...
//
/*
* Only instance of the class
*/
static Player *INSTANCE = nullptr;
namespace CSV
{
static Player *PLAYER = nullptr;
/**
* Constructor function
@ -64,10 +57,10 @@ Player::Player()
*/
Player *Player::getInstance()
{
if (!INSTANCE)
INSTANCE = new Player;
if (!PLAYER)
PLAYER = new Player;
return INSTANCE;
return PLAYER;
}
/**
@ -642,6 +635,7 @@ int Player::getDatasetIndex(const QString &groupKey, const QString &datasetKey)
return 0;
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_Player.cpp"

View File

@ -33,8 +33,9 @@
#include <Misc/Utilities.h>
#include <Misc/TimerEvents.h>
using namespace IO;
static Console *INSTANCE = nullptr;
namespace IO
{
static Console *CONSOLE = nullptr;
/**
* Generates a hexdump of the given data
@ -107,10 +108,10 @@ Console::Console()
*/
Console *Console::getInstance()
{
if (!INSTANCE)
INSTANCE = new Console;
if (!CONSOLE)
CONSOLE = new Console;
return INSTANCE;
return CONSOLE;
}
/**
@ -666,6 +667,7 @@ QString Console::hexadecimalStr(const QByteArray &data)
// Return string
return str;
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_Console.cpp"

View File

@ -25,8 +25,9 @@
#include <IO/Manager.h>
#include <Misc/Utilities.h>
using namespace IO::DataSources;
static Network *INSTANCE = nullptr;
namespace IO::DataSources
{
static Network *NETWORK = nullptr;
/**
* Constructor function
@ -58,10 +59,10 @@ Network::~Network()
*/
Network *Network::getInstance()
{
if (!INSTANCE)
INSTANCE = new Network;
if (!NETWORK)
NETWORK = new Network;
return INSTANCE;
return NETWORK;
}
/**
@ -374,6 +375,7 @@ void Network::onErrorOccurred(const QAbstractSocket::SocketError socketError)
Manager::getInstance()->disconnectDevice();
Misc::Utilities::showMessageBox(tr("Network socket error"), error);
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_Network.cpp"

View File

@ -26,12 +26,9 @@
#include <Misc/Utilities.h>
#include <Misc/TimerEvents.h>
using namespace IO::DataSources;
/**
* Pointer to the only instance of the class.
*/
static Serial *INSTANCE = nullptr;
namespace IO::DataSources
{
static Serial *SERIAL = nullptr;
/**
* Constructor function
@ -75,10 +72,10 @@ Serial::~Serial()
*/
Serial *Serial::getInstance()
{
if (INSTANCE == nullptr)
INSTANCE = new Serial;
if (SERIAL == nullptr)
SERIAL = new Serial;
return INSTANCE;
return SERIAL;
}
/**
@ -692,6 +689,7 @@ QVector<QSerialPortInfo> Serial::validPorts() const
// Return list
return ports;
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_Serial.cpp"

View File

@ -30,12 +30,9 @@
#include <QNetworkDatagram>
using namespace IO;
/**
* Pointer to the only instance of the class.
*/
static Manager *INSTANCE = nullptr;
namespace IO
{
static Manager *MANAGER = nullptr;
/**
* Adds support for C escape sequences to the given @a str.
@ -95,10 +92,10 @@ Manager::~Manager() { }
*/
Manager *Manager::getInstance()
{
if (!INSTANCE)
INSTANCE = new Manager;
if (!MANAGER)
MANAGER = new Manager;
return INSTANCE;
return MANAGER;
}
/**
@ -787,6 +784,7 @@ Manager::ValidationStatus Manager::integrityChecks(const QByteArray &frame,
// Checksum data incomplete
return ValidationStatus::ChecksumIncomplete;
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_Manager.cpp"

View File

@ -23,7 +23,8 @@
#include "Dataset.h"
#include "Generator.h"
using namespace JSON;
namespace JSON
{
Dataset::Dataset(QObject *parent)
: QObject(parent)
@ -209,3 +210,4 @@ bool Dataset::read(const QJsonObject &object)
return false;
}
}

View File

@ -32,8 +32,9 @@
#include <QJsonObject>
#include <QJsonDocument>
using namespace JSON;
static Editor *INSTANCE = nullptr;
namespace JSON
{
static Editor *EDITOR = nullptr;
//--------------------------------------------------------------------------------------------------
// Constructor/deconstructor & singleton
@ -75,10 +76,10 @@ Editor::~Editor() { }
*/
Editor *Editor::getInstance()
{
if (!INSTANCE)
INSTANCE = new Editor();
if (!EDITOR)
EDITOR = new Editor();
return INSTANCE;
return EDITOR;
}
//--------------------------------------------------------------------------------------------------
@ -1441,6 +1442,7 @@ int Editor::nextDatasetIndex()
return maxIndex;
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_Editor.cpp"

View File

@ -22,7 +22,8 @@
#include "Frame.h"
using namespace JSON;
namespace JSON
{
/**
* Constructor function
@ -132,3 +133,4 @@ JSON::Group *Frame::getGroup(const int index)
return Q_NULLPTR;
}
}

View File

@ -32,12 +32,9 @@
#include <QFileDialog>
#include <QRegularExpression>
using namespace JSON;
/*
* Only instance of the class
*/
static Generator *INSTANCE = nullptr;
namespace JSON
{
static Generator *GENERATOR = nullptr;
/**
* Initializes the JSON Parser class and connects appropiate SIGNALS/SLOTS
@ -61,10 +58,10 @@ Generator::Generator()
*/
Generator *Generator::getInstance()
{
if (!INSTANCE)
INSTANCE = new Generator();
if (!GENERATOR)
GENERATOR = new Generator();
return INSTANCE;
return GENERATOR;
}
/**
@ -526,6 +523,7 @@ void JSONWorker::process()
// Delete object in 500 ms
QTimer::singleShot(500, this, SIGNAL(finished()));
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_Generator.cpp"

View File

@ -23,7 +23,8 @@
#include "Group.h"
#include "Dataset.h"
using namespace JSON;
namespace JSON
{
Group::Group(QObject *parent)
: QObject(parent)
@ -130,3 +131,4 @@ bool Group::read(const QJsonObject &object)
return false;
}
}

View File

@ -26,12 +26,9 @@
#include <Misc/Utilities.h>
#include <Misc/TimerEvents.h>
using namespace MQTT;
/**
* The only instance of this class
*/
static Client *INSTANCE = nullptr;
namespace MQTT
{
static Client *CLIENT = nullptr;
/**
* Constructor function
@ -75,10 +72,10 @@ Client::~Client()
*/
Client *Client::getInstance()
{
if (!INSTANCE)
INSTANCE = new Client;
if (!CLIENT)
CLIENT = new Client;
return INSTANCE;
return CLIENT;
}
/**
@ -526,6 +523,7 @@ void Client::onMessageReceived(const QMQTT::Message &message)
// Let IO manager process incoming data
IO::Manager::getInstance()->processPayload(mpayld);
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_Client.cpp"

View File

@ -27,9 +27,9 @@
# include <kdmactouchbar.h>
#endif
using namespace Misc;
MacExtras *INSTANCE = nullptr;
namespace Misc
{
static MacExtras *MAC_EXTRAS = nullptr;
MacExtras::MacExtras()
{
@ -71,10 +71,10 @@ MacExtras::MacExtras()
MacExtras *MacExtras::getInstance()
{
if (!INSTANCE)
INSTANCE = new MacExtras;
if (!MAC_EXTRAS)
MAC_EXTRAS = new MacExtras;
return INSTANCE;
return MAC_EXTRAS;
}
void MacExtras::setSetupChecked(const bool checked)
@ -103,6 +103,7 @@ void MacExtras::updateButtonText()
m_consoleAction.setText(tr("Console"));
m_dashboardAction.setText(tr("Dashboard"));
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_MacExtras.cpp"

View File

@ -33,12 +33,9 @@
#include <QApplication>
#include <QJsonDocument>
using namespace Misc;
/**
* Pointer to the single instance of this class
*/
static ThemeManager *INSTANCE = Q_NULLPTR;
namespace Misc
{
static ThemeManager *THEME_MANAGER = Q_NULLPTR;
/**
* Constructor function, searches for available themes & loads
@ -55,10 +52,10 @@ ThemeManager::ThemeManager()
*/
ThemeManager *ThemeManager::getInstance()
{
if (!INSTANCE)
INSTANCE = new ThemeManager;
if (!THEME_MANAGER)
THEME_MANAGER = new ThemeManager;
return INSTANCE;
return THEME_MANAGER;
}
/**
@ -503,6 +500,7 @@ QVector<QString> ThemeManager::availableThemes() const
{
return m_availableThemes;
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_ThemeManager.cpp"

View File

@ -24,12 +24,13 @@
#include <QtMath>
using namespace Misc;
namespace Misc
{
/**º
/**
* Pointer to the only instance of the class
*/
static TimerEvents *INSTANCE = nullptr;
static TimerEvents *TIMER_EVENTS = nullptr;
/**
* Converts the given @a hz to milliseconds
@ -64,10 +65,10 @@ TimerEvents::TimerEvents()
*/
TimerEvents *TimerEvents::getInstance()
{
if (!INSTANCE)
INSTANCE = new TimerEvents;
if (!TIMER_EVENTS)
TIMER_EVENTS = new TimerEvents;
return INSTANCE;
return TIMER_EVENTS;
}
/**
@ -113,6 +114,7 @@ void TimerEvents::setHighFreqTimeout(const int hz)
emit highFreqTimeoutChanged();
}
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_TimerEvents.cpp"

View File

@ -22,12 +22,9 @@
#include "Translator.h"
using namespace Misc;
/**
* Only instance of the class
*/
static Translator *INSTANCE = nullptr;
namespace Misc
{
static Translator *TRANSLATOR = nullptr;
/**
* Constructor function
@ -42,10 +39,10 @@ Translator::Translator()
*/
Translator *Translator::getInstance()
{
if (!INSTANCE)
INSTANCE = new Translator;
if (!TRANSLATOR)
TRANSLATOR = new Translator;
return INSTANCE;
return TRANSLATOR;
}
/**
@ -214,6 +211,7 @@ void Translator::setLanguage(const QLocale &locale, const QString &language)
emit languageChanged();
}
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_Translator.cpp"

View File

@ -33,18 +33,16 @@
#include <AppInfo.h>
using namespace Misc;
namespace Misc
{
static Utilities *UTILITIES = nullptr;
/**
* Returns the onlt instance of the class, this is to be used by the QML interface
*/
static Utilities *INSTANCE = nullptr;
Utilities *Utilities::getInstance()
{
if (!INSTANCE)
INSTANCE = new Utilities;
if (!UTILITIES)
UTILITIES = new Utilities;
return INSTANCE;
return UTILITIES;
}
bool Utilities::askAutomaticUpdates()
@ -120,6 +118,7 @@ void Utilities::revealFile(const QString &pathToReveal)
QDesktopServices::openUrl(QUrl::fromLocalFile(pathToReveal));
#endif
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_Utilities.cpp"

View File

@ -31,12 +31,9 @@
#include <Misc/Utilities.h>
#include <Misc/TimerEvents.h>
using namespace Plugins;
/*
* Singleton pointer
*/
static Server *INSTANCE = nullptr;
namespace Plugins
{
static Server *SERVER = nullptr;
/**
* Constructor function
@ -79,10 +76,10 @@ Server::~Server()
*/
Server *Server::getInstance()
{
if (!INSTANCE)
INSTANCE = new Server;
if (!SERVER)
SERVER = new Server;
return INSTANCE;
return SERVER;
}
/**
@ -306,6 +303,7 @@ void Server::onErrorOccurred(const QAbstractSocket::SocketError socketError)
else
qDebug() << socketError;
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_Server.cpp"

View File

@ -0,0 +1,320 @@
//
// Well, this will be a PITA to maintain. But we can implement some interesting
// optimizations by using this approach.
//
// See these articles for more information:
// https://en.wikipedia.org/wiki/Single_Compilation_Unit
// https://en.wikipedia.org/wiki/Unity_build
//
// TODOs:
// - Change Qwt source code for inclusion in this file
// - Write a script that generates this file automagically
// - Only use this file for release builds (to avoid recompiling everything when running
// a debug build...)
//
//--------------------------------------------------------------------------------------------------
// Third-party library headers
//--------------------------------------------------------------------------------------------------
#include "qwt/src/qwt.h"
#include "qwt/src/qwt_abstract_scale_draw.h"
#include "qwt/src/qwt_bezier.h"
#include "qwt/src/qwt_clipper.h"
#include "qwt/src/qwt_color_map.h"
#include "qwt/src/qwt_column_symbol.h"
#include "qwt/src/qwt_date.h"
#include "qwt/src/qwt_date_scale_draw.h"
#include "qwt/src/qwt_date_scale_engine.h"
#include "qwt/src/qwt_dyngrid_layout.h"
#include "qwt/src/qwt_global.h"
#include "qwt/src/qwt_graphic.h"
#include "qwt/src/qwt_interval.h"
#include "qwt/src/qwt_interval_symbol.h"
#include "qwt/src/qwt_math.h"
#include "qwt/src/qwt_magnifier.h"
#include "qwt/src/qwt_null_paintdevice.h"
#include "qwt/src/qwt_painter.h"
#include "qwt/src/qwt_painter_command.h"
#include "qwt/src/qwt_panner.h"
#include "qwt/src/qwt_picker.h"
#include "qwt/src/qwt_picker_machine.h"
#include "qwt/src/qwt_pixel_matrix.h"
#include "qwt/src/qwt_point_3d.h"
#include "qwt/src/qwt_point_polar.h"
#include "qwt/src/qwt_round_scale_draw.h"
#include "qwt/src/qwt_scale_div.h"
#include "qwt/src/qwt_scale_draw.h"
#include "qwt/src/qwt_scale_engine.h"
#include "qwt/src/qwt_scale_map.h"
#include "qwt/src/qwt_spline.h"
#include "qwt/src/qwt_spline_basis.h"
#include "qwt/src/qwt_spline_parametrization.h"
#include "qwt/src/qwt_spline_local.h"
#include "qwt/src/qwt_spline_cubic.h"
#include "qwt/src/qwt_spline_pleasing.h"
#include "qwt/src/qwt_spline_polynomial.h"
#include "qwt/src/qwt_symbol.h"
#include "qwt/src/qwt_system_clock.h"
#include "qwt/src/qwt_text_engine.h"
#include "qwt/src/qwt_text_label.h"
#include "qwt/src/qwt_text.h"
#include "qwt/src/qwt_transform.h"
#include "qwt/src/qwt_widget_overlay.h"
#include "qwt/src/qwt_axis.h"
#include "qwt/src/qwt_axis_id.h"
#include "qwt/src/qwt_curve_fitter.h"
#include "qwt/src/qwt_spline_curve_fitter.h"
#include "qwt/src/qwt_weeding_curve_fitter.h"
#include "qwt/src/qwt_event_pattern.h"
#include "qwt/src/qwt_abstract_legend.h"
#include "qwt/src/qwt_legend.h"
#include "qwt/src/qwt_legend_data.h"
#include "qwt/src/qwt_legend_label.h"
#include "qwt/src/qwt_plot.h"
#include "qwt/src/qwt_plot_renderer.h"
#include "qwt/src/qwt_plot_curve.h"
#include "qwt/src/qwt_plot_dict.h"
#include "qwt/src/qwt_plot_directpainter.h"
#include "qwt/src/qwt_plot_graphicitem.h"
#include "qwt/src/qwt_plot_grid.h"
#include "qwt/src/qwt_plot_histogram.h"
#include "qwt/src/qwt_plot_item.h"
#include "qwt/src/qwt_plot_abstract_barchart.h"
#include "qwt/src/qwt_plot_barchart.h"
#include "qwt/src/qwt_plot_multi_barchart.h"
#include "qwt/src/qwt_plot_intervalcurve.h"
#include "qwt/src/qwt_plot_tradingcurve.h"
#include "qwt/src/qwt_plot_layout.h"
#include "qwt/src/qwt_plot_marker.h"
#include "qwt/src/qwt_plot_zoneitem.h"
#include "qwt/src/qwt_plot_textlabel.h"
#include "qwt/src/qwt_plot_rasteritem.h"
#include "qwt/src/qwt_plot_spectrogram.h"
#include "qwt/src/qwt_plot_spectrocurve.h"
#include "qwt/src/qwt_plot_scaleitem.h"
#include "qwt/src/qwt_plot_legenditem.h"
#include "qwt/src/qwt_plot_seriesitem.h"
#include "qwt/src/qwt_plot_shapeitem.h"
#include "qwt/src/qwt_plot_vectorfield.h"
#include "qwt/src/qwt_plot_abstract_canvas.h"
#include "qwt/src/qwt_plot_canvas.h"
#include "qwt/src/qwt_plot_panner.h"
#include "qwt/src/qwt_plot_picker.h"
#include "qwt/src/qwt_plot_zoomer.h"
#include "qwt/src/qwt_plot_magnifier.h"
#include "qwt/src/qwt_plot_rescaler.h"
#include "qwt/src/qwt_point_mapper.h"
#include "qwt/src/qwt_raster_data.h"
#include "qwt/src/qwt_matrix_raster_data.h"
#include "qwt/src/qwt_vectorfield_symbol.h"
#include "qwt/src/qwt_sampling_thread.h"
#include "qwt/src/qwt_samples.h"
#include "qwt/src/qwt_series_data.h"
#include "qwt/src/qwt_series_store.h"
#include "qwt/src/qwt_point_data.h"
#include "qwt/src/qwt_scale_widget.h"
#include "qwt/src/qwt_polar.h"
#include "qwt/src/qwt_polar_canvas.h"
#include "qwt/src/qwt_polar_curve.h"
#include "qwt/src/qwt_polar_fitter.h"
#include "qwt/src/qwt_polar_grid.h"
#include "qwt/src/qwt_polar_itemdict.h"
#include "qwt/src/qwt_polar_item.h"
#include "qwt/src/qwt_polar_layout.h"
#include "qwt/src/qwt_polar_magnifier.h"
#include "qwt/src/qwt_polar_marker.h"
#include "qwt/src/qwt_polar_panner.h"
#include "qwt/src/qwt_polar_picker.h"
#include "qwt/src/qwt_polar_plot.h"
#include "qwt/src/qwt_polar_renderer.h"
#include "qwt/src/qwt_polar_spectrogram.h"
#include "qwt/src/qwt_abstract_slider.h"
#include "qwt/src/qwt_abstract_scale.h"
#include "qwt/src/qwt_arrow_button.h"
#include "qwt/src/qwt_analog_clock.h"
#include "qwt/src/qwt_compass.h"
#include "qwt/src/qwt_compass_rose.h"
#include "qwt/src/qwt_counter.h"
#include "qwt/src/qwt_dial.h"
#include "qwt/src/qwt_dial_needle.h"
#include "qwt/src/qwt_knob.h"
#include "qwt/src/qwt_slider.h"
#include "qwt/src/qwt_thermo.h"
#include "qwt/src/qwt_wheel.h"
#include "qtcsv/include/qtcsv/qtcsv_global.h"
#include "qtcsv/include/qtcsv/writer.h"
#include "qtcsv/include/qtcsv/variantdata.h"
#include "qtcsv/include/qtcsv/stringdata.h"
#include "qtcsv/include/qtcsv/reader.h"
#include "qtcsv/include/qtcsv/abstractdata.h"
#include "qtcsv/sources/filechecker.h"
#include "qtcsv/sources/contentiterator.h"
#include "qtcsv/sources/symbols.h"
#include "qmqtt/src/mqtt/qmqtt.h"
#include "qmqtt/src/mqtt/qmqtt_client.h"
#include "qmqtt/src/mqtt/qmqtt_client_p.h"
#include "qmqtt/src/mqtt/qmqtt_frame.h"
#include "qmqtt/src/mqtt/qmqtt_global.h"
#include "qmqtt/src/mqtt/qmqtt_message.h"
#include "qmqtt/src/mqtt/qmqtt_message_p.h"
#include "qmqtt/src/mqtt/qmqtt_network_p.h"
#include "qmqtt/src/mqtt/qmqtt_networkinterface.h"
#include "qmqtt/src/mqtt/qmqtt_routedmessage.h"
#include "qmqtt/src/mqtt/qmqtt_router.h"
#include "qmqtt/src/mqtt/qmqtt_routesubscription.h"
#include "qmqtt/src/mqtt/qmqtt_socket_p.h"
#include "qmqtt/src/mqtt/qmqtt_socketinterface.h"
#include "qmqtt/src/mqtt/qmqtt_timer_p.h"
#include "qmqtt/src/mqtt/qmqtt_timerinterface.h"
#include "qmqtt/src/mqtt/qmqtt_ssl_socket_p.h"
#include "QRealFourier/fftreal/Array.h"
#include "QRealFourier/fftreal/Array.h"
#include "QRealFourier/fftreal/DynArray.h"
#include "QRealFourier/fftreal/DynArray.h"
#include "QRealFourier/fftreal/FFTReal.h"
#include "QRealFourier/fftreal/FFTReal.h"
#include "QRealFourier/fftreal/FFTRealFixLen.h"
#include "QRealFourier/fftreal/FFTRealFixLen.h"
#include "QRealFourier/fftreal/FFTRealFixLenParam.h"
#include "QRealFourier/fftreal/FFTRealPassDirect.h"
#include "QRealFourier/fftreal/FFTRealPassDirect.h"
#include "QRealFourier/fftreal/FFTRealPassInverse.h"
#include "QRealFourier/fftreal/FFTRealPassInverse.h"
#include "QRealFourier/fftreal/FFTRealSelect.h"
#include "QRealFourier/fftreal/FFTRealSelect.h"
#include "QRealFourier/fftreal/FFTRealUseTrigo.h"
#include "QRealFourier/fftreal/FFTRealUseTrigo.h"
#include "QRealFourier/fftreal/OscSinCos.h"
#include "QRealFourier/fftreal/OscSinCos.h"
#include "QRealFourier/fftreal/def.h"
#include "QRealFourier/headers/qcomplexnumber.h"
#include "QRealFourier/headers/qfouriercalculator.h"
#include "QRealFourier/headers/qfourierfixedcalculator.h"
#include "QRealFourier/headers/qfouriertransformer.h"
#include "QRealFourier/headers/qfouriervariablecalculator.h"
#include "QRealFourier/headers/qwindowfunction.h"
#include "QSimpleUpdater/include/QSimpleUpdater.h"
#include "QSimpleUpdater/src/Updater.h"
#include "QSimpleUpdater/src/Downloader.h"
#include "KDMacTouchBar/src/kdmactouchbar.h"
#include "KDMacTouchBar/src/kdmactouchbar_global.h"
//--------------------------------------------------------------------------------------------------
// App headers
//--------------------------------------------------------------------------------------------------
#include "AppInfo.h"
#include "CSV/Export.h"
#include "CSV/Player.h"
#include "IO/Checksum.h"
#include "IO/Console.h"
#include "IO/DataSources/Network.h"
#include "IO/DataSources/Serial.h"
#include "IO/Manager.h"
#include "JSON/Dataset.h"
#include "JSON/Editor.h"
#include "JSON/Frame.h"
#include "JSON/FrameInfo.h"
#include "JSON/Generator.h"
#include "JSON/Group.h"
#include "MQTT/Client.h"
#include "Misc/MacExtras.h"
#include "Misc/ModuleManager.h"
#include "Misc/ThemeManager.h"
#include "Misc/TimerEvents.h"
#include "Misc/Translator.h"
#include "Misc/Utilities.h"
#include "Plugins/Server.h"
#include "UI/Dashboard.h"
#include "UI/WidgetLoader.h"
#include "Widgets/Accelerometer.h"
#include "Widgets/Bar.h"
#include "Widgets/Common/AnalogGauge.h"
#include "Widgets/Common/AttitudeIndicator.h"
#include "Widgets/Common/BaseWidget.h"
#include "Widgets/Common/KLed.h"
#include "Widgets/Compass.h"
#include "Widgets/DataGroup.h"
#include "Widgets/FFTPlot.h"
#include "Widgets/GPS.h"
#include "Widgets/Gauge.h"
#include "Widgets/Gyroscope.h"
#include "Widgets/LEDPanel.h"
#include "Widgets/MultiPlot.h"
#include "Widgets/Plot.h"
#include "Widgets/Terminal.h"
//--------------------------------------------------------------------------------------------------
// Third-party source files (skip Qwt due to their architecture)
//--------------------------------------------------------------------------------------------------
#include "qtcsv/sources/writer.cpp"
#include "qtcsv/sources/variantdata.cpp"
#include "qtcsv/sources/stringdata.cpp"
#include "qtcsv/sources/reader.cpp"
#include "qtcsv/sources/contentiterator.cpp"
#include "qmqtt/src/mqtt/qmqtt_client.cpp"
#include "qmqtt/src/mqtt/qmqtt_client_p.cpp"
#include "qmqtt/src/mqtt/qmqtt_frame.cpp"
#include "qmqtt/src/mqtt/qmqtt_message.cpp"
#include "qmqtt/src/mqtt/qmqtt_network.cpp"
#include "qmqtt/src/mqtt/qmqtt_router.cpp"
#include "qmqtt/src/mqtt/qmqtt_routesubscription.cpp"
#include "qmqtt/src/mqtt/qmqtt_socket.cpp"
#include "qmqtt/src/mqtt/qmqtt_timer.cpp"
#include "qmqtt/src/mqtt/qmqtt_ssl_socket.cpp"
#include "QRealFourier/sources/qcomplexnumber.cpp"
#include "QRealFourier/sources/qfouriercalculator.cpp"
#include "QRealFourier/sources/qfourierfixedcalculator.cpp"
#include "QRealFourier/sources/qfouriertransformer.cpp"
#include "QRealFourier/sources/qfouriervariablecalculator.cpp"
#include "QRealFourier/sources/qwindowfunction.cpp"
#include "QSimpleUpdater/src/Updater.cpp"
#include "QSimpleUpdater/src/Downloader.cpp"
#include "QSimpleUpdater/src/QSimpleUpdater.cpp"
//--------------------------------------------------------------------------------------------------
// App source files
//--------------------------------------------------------------------------------------------------
#include "CSV/Export.cpp"
#include "CSV/Player.cpp"
#include "IO/Checksum.cpp"
#include "IO/Console.cpp"
#include "IO/DataSources/Network.cpp"
#include "IO/DataSources/Serial.cpp"
#include "IO/Manager.cpp"
#include "JSON/Dataset.cpp"
#include "JSON/Editor.cpp"
#include "JSON/Frame.cpp"
#include "JSON/FrameInfo.cpp"
#include "JSON/Generator.cpp"
#include "JSON/Group.cpp"
#include "MQTT/Client.cpp"
#include "Misc/MacExtras.cpp"
#include "Misc/ModuleManager.cpp"
#include "Misc/ThemeManager.cpp"
#include "Misc/TimerEvents.cpp"
#include "Misc/Translator.cpp"
#include "Misc/Utilities.cpp"
#include "Plugins/Server.cpp"
#include "UI/Dashboard.cpp"
#include "UI/WidgetLoader.cpp"
#include "Widgets/Accelerometer.cpp"
#include "Widgets/Bar.cpp"
#include "Widgets/Common/AnalogGauge.cpp"
#include "Widgets/Common/AttitudeIndicator.cpp"
#include "Widgets/Common/BaseWidget.cpp"
#include "Widgets/Common/KLed.cpp"
#include "Widgets/Compass.cpp"
#include "Widgets/DataGroup.cpp"
#include "Widgets/FFTPlot.cpp"
#include "Widgets/GPS.cpp"
#include "Widgets/Gauge.cpp"
#include "Widgets/Gyroscope.cpp"
#include "Widgets/LEDPanel.cpp"
#include "Widgets/MultiPlot.cpp"
#include "Widgets/Plot.cpp"
#include "Widgets/Terminal.cpp"
#include "main.cpp"

View File

@ -28,12 +28,9 @@
#include "Dashboard.h"
using namespace UI;
/*
* Pointer to the only instance of the class.
*/
static Dashboard *INSTANCE = nullptr;
namespace UI
{
static Dashboard *DASHBOARD = nullptr;
//--------------------------------------------------------------------------------------------------
// Constructor/deconstructor & singleton
@ -62,10 +59,10 @@ Dashboard::Dashboard()
*/
Dashboard *Dashboard::getInstance()
{
if (!INSTANCE)
INSTANCE = new Dashboard();
if (!DASHBOARD)
DASHBOARD = new Dashboard();
return INSTANCE;
return DASHBOARD;
}
//--------------------------------------------------------------------------------------------------
@ -1071,6 +1068,7 @@ JSON::Dataset *Dashboard::getDatasetWidget(const QVector<JSON::Dataset *> vector
return nullptr;
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_Dashboard.cpp"

View File

@ -39,9 +39,8 @@
#include <Misc/ThemeManager.h>
using namespace UI;
using namespace Widgets;
namespace UI
{
/**
* Constructor function
*/
@ -251,37 +250,37 @@ void WidgetLoader::setWidgetIndex(const int index)
switch (widgetType())
{
case UI::Dashboard::WidgetType::Group:
m_widget = new DataGroup(relativeIndex());
m_widget = new Widgets::DataGroup(relativeIndex());
break;
case UI::Dashboard::WidgetType::MultiPlot:
m_widget = new MultiPlot(relativeIndex());
m_widget = new Widgets::MultiPlot(relativeIndex());
break;
case UI::Dashboard::WidgetType::FFT:
m_widget = new FFTPlot(relativeIndex());
m_widget = new Widgets::FFTPlot(relativeIndex());
break;
case UI::Dashboard::WidgetType::Plot:
m_widget = new Plot(relativeIndex());
m_widget = new Widgets::Plot(relativeIndex());
break;
case UI::Dashboard::WidgetType::Bar:
m_widget = new Bar(relativeIndex());
m_widget = new Widgets::Bar(relativeIndex());
break;
case UI::Dashboard::WidgetType::Gauge:
m_widget = new Gauge(relativeIndex());
m_widget = new Widgets::Gauge(relativeIndex());
break;
case UI::Dashboard::WidgetType::Compass:
m_widget = new Compass(relativeIndex());
m_widget = new Widgets::Compass(relativeIndex());
break;
case UI::Dashboard::WidgetType::Gyroscope:
m_widget = new Gyroscope(relativeIndex());
m_widget = new Widgets::Gyroscope(relativeIndex());
break;
case UI::Dashboard::WidgetType::Accelerometer:
m_widget = new Accelerometer(relativeIndex());
m_widget = new Widgets::Accelerometer(relativeIndex());
break;
case UI::Dashboard::WidgetType::GPS:
m_widget = new GPS(relativeIndex());
m_widget = new Widgets::GPS(relativeIndex());
break;
case UI::Dashboard::WidgetType::LED:
m_widget = new LEDPanel(relativeIndex());
m_widget = new Widgets::LEDPanel(relativeIndex());
break;
default:
break;
@ -458,6 +457,7 @@ void WidgetLoader::processWheelEvents(QWheelEvent *event)
static_cast<Hack *>(m_widget)->wheelEvent(event);
update();
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_WidgetLoader.cpp"

View File

@ -27,7 +27,8 @@
#include <QtMath>
#include <QResizeEvent>
using namespace Widgets;
namespace Widgets
{
/**
* Constructor function, configures widget style & signal/slot connections.
@ -120,6 +121,7 @@ void Accelerometer::updateData()
QString::number(G, 'f', UI::Dashboard::getInstance()->precision())));
}
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_Accelerometer.cpp"

View File

@ -26,7 +26,8 @@
#include <QResizeEvent>
using namespace Widgets;
namespace Widgets
{
/**
* Constructor function, configures widget style & signal/slot connections.
@ -122,6 +123,7 @@ void Bar::onResized()
{
m_thermo.setPipeWidth(width() * 0.25);
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_Bar.cpp"

View File

@ -27,11 +27,8 @@
#include "AnalogGauge.h"
#include "Misc/ThemeManager.h"
using namespace Widgets;
/**
* Configures the @c QwtDial so that it resembles a speedometer gauge.
*/
namespace Widgets
{
AnalogGauge::AnalogGauge(QWidget *parent)
: QwtDial(parent)
{
@ -45,3 +42,4 @@ AnalogGauge::AnalogGauge(QWidget *parent)
setOrigin(135);
setScaleArc(0, 270);
}
}

View File

@ -29,8 +29,8 @@
#include <QwtDialNeedle>
#include <QwtRoundScaleDraw>
using namespace Widgets;
namespace Widgets
{
namespace
{
class Needle : public QwtDialNeedle
@ -153,3 +153,4 @@ void AttitudeIndicator::drawScaleContents(QPainter *painter, const QPointF &cent
painter->drawChord(scaleInnerRect(), (dir - arc) * 16, 2 * arc * 16);
painter->restore();
}
}

View File

@ -26,8 +26,8 @@
#include <QResizeEvent>
using namespace Widgets;
namespace Widgets
{
BaseWidget::BaseWidget()
: m_index(-1)
, m_widget(nullptr)
@ -142,6 +142,7 @@ void BaseWidget::resizeEvent(QResizeEvent *event)
// Emit resize signal
emit resized();
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_BaseWidget.cpp"

View File

@ -28,7 +28,8 @@
#include <QwtCompassScaleDraw>
#include <QwtCompassMagnetNeedle>
using namespace Widgets;
namespace Widgets
{
/**
* Constructor function, configures widget style & signal/slot connections.
@ -102,6 +103,7 @@ void Compass::update()
setValue(text);
}
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_Compass.cpp"

View File

@ -31,7 +31,8 @@
static QRegularExpression REGEXP("^[+-]?(\\d*\\.)?\\d+$");
using namespace Widgets;
namespace Widgets
{
/**
* Generates the user interface elements & layout
@ -300,6 +301,7 @@ void DataGroup::mouseDoubleClickEvent(QMouseEvent *event)
auto hack = static_cast<Hack *>(m_scrollArea);
hack->mouseDoubleClickEvent(event);
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_DataGroup.cpp"

View File

@ -24,7 +24,8 @@
#include "UI/Dashboard.h"
#include "Misc/ThemeManager.h"
using namespace Widgets;
namespace Widgets
{
/**
* Constructor function, configures widget style & signal/slot connections.
@ -174,6 +175,7 @@ void FFTPlot::updateData()
m_plot.replot();
}
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_FFTPlot.cpp"

View File

@ -30,7 +30,8 @@
#include <QNetworkReply>
#include <QDesktopServices>
using namespace Widgets;
namespace Widgets
{
#define APP_ID QStringLiteral("36496bad1955bf3365448965a42b9eac")
#define G_MAPS QStringLiteral("https://www.google.com/maps/search/?api=1&query=%1,%2")
@ -431,6 +432,7 @@ void GPS::mouseDoubleClickEvent(QMouseEvent *event)
openMap();
event->accept();
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_GPS.cpp"

View File

@ -24,7 +24,8 @@
#include "UI/Dashboard.h"
#include "Misc/ThemeManager.h"
using namespace Widgets;
namespace Widgets
{
/**
* Constructor function, configures widget style & signal/slot connections.
@ -102,6 +103,7 @@ void Gauge::updateData()
dataset->units()));
}
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_Gauge.cpp"

View File

@ -26,7 +26,8 @@
#include <QResizeEvent>
using namespace Widgets;
namespace Widgets
{
/**
* Constructor function, configures widget style & signal/slot connections.
@ -128,6 +129,7 @@ void Gyroscope::updateLabel()
if (m_displayNum > 2)
m_displayNum = 0;
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_Gyroscope.cpp"

View File

@ -28,7 +28,8 @@
#include <QWheelEvent>
#include <QResizeEvent>
using namespace Widgets;
namespace Widgets
{
/**
* Generates the user interface elements & layout
@ -260,6 +261,7 @@ void LEDPanel::mouseDoubleClickEvent(QMouseEvent *event)
auto hack = static_cast<Hack *>(m_scrollArea);
hack->mouseDoubleClickEvent(event);
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_LEDPanel.cpp"

View File

@ -25,7 +25,8 @@
#include "UI/Dashboard.h"
#include "Misc/ThemeManager.h"
using namespace Widgets;
namespace Widgets
{
/**
* Constructor function, configures widget style & signal/slot connections.
@ -199,6 +200,7 @@ void MultiPlot::updateRange()
if (m_curves.count() > i)
m_curves.at(i)->setSamples(*dash->xPlotValues(), m_yData[i]);
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_MultiPlot.cpp"

View File

@ -25,7 +25,8 @@
#include "UI/Dashboard.h"
#include "Misc/ThemeManager.h"
using namespace Widgets;
namespace Widgets
{
/**
* Constructor function, configures widget style & signal/slot connections.
@ -219,6 +220,7 @@ void Plot::updateRange()
m_curve.setSamples(*dash->xPlotValues(), tempYData);
m_plot.replot();
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_Plot.cpp"

View File

@ -28,7 +28,8 @@
#include "Terminal.h"
using namespace Widgets;
namespace Widgets
{
//--------------------------------------------------------------------------------------------------
// QML PlainTextEdit implementation
@ -1097,6 +1098,7 @@ void AnsiEscapeCodeHandler::setFormatScope(const QTextCharFormat &charFormat)
m_previousFormat = charFormat;
m_previousFormatClosed = false;
}
}
#if SERIAL_STUDIO_MOC_INCLUDE
# include "moc_Terminal.cpp"