Add jumbo build again

This commit is contained in:
Alex Spataru 2021-12-08 02:30:01 -06:00
parent 8334b4e6c1
commit a312cff6d2
12 changed files with 705 additions and 83 deletions

View File

@ -54,7 +54,7 @@ jobs:
- name: '🚧 Compile application'
run: |
qmake ${{env.QMAKE_PROJECT}} CONFIG+=release PREFIX=/usr
qmake ${{env.QMAKE_PROJECT}} CONFIG+=release CONFIG+=unity_build PREFIX=/usr
make -j16
- name: '💭 Perform CodeQL Analysis'

View File

@ -69,7 +69,7 @@ jobs:
- name: '🚧 Compile application'
run: |
${{env.QMAKE}} ${{env.QMAKE_PROJECT}} CONFIG+=release PREFIX=/usr
${{env.QMAKE}} ${{env.QMAKE_PROJECT}} CONFIG+=release CONFIG+=unity_build PREFIX=/usr
make -j${{env.CORES}}
- name: '⚙️ Install linuxdeployqt'
@ -118,7 +118,7 @@ jobs:
- name: '🚧 Compile application'
run: |
${{env.QMAKE}} ${{env.QMAKE_PROJECT}} CONFIG+=release PREFIX=/usr
${{env.QMAKE}} ${{env.QMAKE_PROJECT}} CONFIG+=release CONFIG+=unity_build PREFIX=/usr
make -j${{env.CORES}}
- name: '📦 Package application (macdeployqt and zipfile)'
@ -176,7 +176,7 @@ jobs:
- name: '🚧 Compile application'
run: |
${{env.QMAKE}} ${{env.QMAKE_PROJECT}} CONFIG+=release PREFIX=/usr
${{env.QMAKE}} ${{env.QMAKE_PROJECT}} CONFIG+=release CONFIG+=unity_build PREFIX=/usr
nmake
# Copy Qt DLLs, compiler runtime & application icon

View File

@ -65,14 +65,56 @@ DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x050F00
# Compiler options
#-----------------------------------------------------------------------------------------
*msvc*: {
QMAKE_CXXFLAGS *= -MP
*g++*: {
QMAKE_CXXFLAGS_RELEASE -= -O1
QMAKE_CXXFLAGS_RELEASE -= -O2
QMAKE_CXXFLAGS_RELEASE *= -O3
QMAKE_CXXFLAGS_RELEASE *= -Ofast
QMAKE_CXXFLAGS_RELEASE *= -flto
}
*clang*: {
QMAKE_CXXFLAGS_RELEASE -= -O1
QMAKE_CXXFLAGS_RELEASE -= -O2
QMAKE_CXXFLAGS_RELEASE *= -O3
QMAKE_CXXFLAGS_RELEASE *= -Ofast
QMAKE_CXXFLAGS_RELEASE *= -flto
}
*msvc*: {
QMAKE_CXXFLAGS *= -MP
QMAKE_CXXFLAGS_RELEASE -= /O
QMAKE_CXXFLAGS_RELEASE *= /O2
QMAKE_CXXFLAGS_RELEASE *= /GL
INCLUDEPATH += $$OUT_PWD
INCLUDEPATH += $$OUT_PWD/debug
INCLUDEPATH += $$OUT_PWD/release
}
CONFIG += ltcg
CONFIG += c++11
CONFIG += silent
#-----------------------------------------------------------------------------------------
# Unity build
#-----------------------------------------------------------------------------------------
CONFIG += unity_build # Uncomment for final releases, the unity
# build reduces compile time by mashing
# together all the C++ files in a single
# file. This approach also allows the
# compiler to perform more optimizations,
# resulting in a smaller & faster binary.
#
# Unity build is automatically enabled
# for GitHub CI jobs.
CONFIG(unity_build) {
CONFIG += ltcg # Enable linker optimization
DEFINES += UNITY_BUILD=1 # Enable unity build
DEFINES += UNITY_BUILD_INCLUDE_QML=0 # Do not optimize QtQuick compiler cache
SOURCES += src/SingleCompilationUnit.cpp # Include single compilation unit in code
}
#-----------------------------------------------------------------------------------------
# Serial Studio compile-time settings
#-----------------------------------------------------------------------------------------

View File

@ -44,6 +44,8 @@ Dataset::Dataset(QObject *parent)
{
}
Dataset::~Dataset() { }
/**
* @return @c true if the UI should generate a FFT plot of this dataset
*/

View File

@ -66,6 +66,7 @@ class Dataset : public QObject
{
public:
Dataset(QObject *parent = Q_NULLPTR);
~Dataset();
bool fft() const;
bool led() const;

View File

@ -29,8 +29,9 @@ namespace JSON
/**
* Constructor function
*/
Frame::Frame()
: m_title("")
Frame::Frame(QObject *parent)
: QObject(parent)
, m_title("")
{
}
@ -49,10 +50,8 @@ Frame::~Frame()
*/
void Frame::clear()
{
for (int i = 0; i < groupCount(); ++i)
m_groups.at(i)->deleteLater();
m_title = "";
qDeleteAll(m_groups);
m_groups.clear();
}
@ -104,7 +103,7 @@ bool Frame::read(const QJsonObject &object)
// Generate groups & datasets from data frame
for (auto i = 0; i < groups.count(); ++i)
{
Group *group = new Group;
Group *group = new Group(this);
if (group->read(groups.at(i).toObject()))
m_groups.append(group);
else

View File

@ -52,10 +52,10 @@ namespace JSON
* frame.
* 9) UI dashboard updates the widgets with the C++ model provided by this class.
*/
class Frame
class Frame : public QObject
{
public:
Frame();
Frame(QObject *parent = nullptr);
~Frame();
void clear();

View File

@ -39,9 +39,7 @@ Group::Group(QObject *parent)
*/
Group::~Group()
{
for (int i = 0; i < datasetCount(); ++i)
m_datasets.at(i)->deleteLater();
qDeleteAll(m_datasets);
m_datasets.clear();
}

View File

@ -0,0 +1,603 @@
//
// Well, this will be a PITA to maintain. But we can implement some interesting
// optimizations by using this approach, for example this build approach can lead to
// faster code, because the compiler can do more aggressive optimizations on all the
// program's code.
//
// See these articles for more information:
// https://en.wikipedia.org/wiki/Single_Compilation_Unit
// https://en.wikipedia.org/wiki/Unity_build
// https://mesonbuild.com/Unity-builds.html
//
// TODOs:
// - Write a script that generates this file automagically
//
#if UNITY_BUILD
// clang-format off
//----------------------------------------------------------------------------------------
// 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"
#include "QMapControl/src/curve.h"
#include "QMapControl/src/geometry.h"
#include "QMapControl/src/imagemanager.h"
#include "QMapControl/src/layer.h"
#include "QMapControl/src/layermanager.h"
#include "QMapControl/src/linestring.h"
#include "QMapControl/src/mapadapter.h"
#include "QMapControl/src/mapcontrol.h"
#include "QMapControl/src/mapnetwork.h"
#include "QMapControl/src/point.h"
#include "QMapControl/src/tilemapadapter.h"
#include "QMapControl/src/wmsmapadapter.h"
#include "QMapControl/src/circlepoint.h"
#include "QMapControl/src/imagepoint.h"
#include "QMapControl/src/gps_position.h"
#include "QMapControl/src/osmmapadapter.h"
#include "QMapControl/src/maplayer.h"
#include "QMapControl/src/geometrylayer.h"
#include "QMapControl/src/googlemapadapter.h"
#include "QMapControl/src/openaerialmapadapter.h"
#include "QMapControl/src/fixedimageoverlay.h"
#include "QMapControl/src/emptymapadapter.h"
#include "QMapControl/src/arrowpoint.h"
#include "QMapControl/src/invisiblepoint.h"
#include "QMapControl/src/qmapcontrol_global.h"
#include "QMapControl/src/bingapimapadapter.h"
#include "QMapControl/src/googleapimapadapter.h"
//----------------------------------------------------------------------------------------
// App headers
//----------------------------------------------------------------------------------------
#include "AppInfo.h"
#include "DataTypes.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 (Qwt)
//----------------------------------------------------------------------------------------
#include "qwt/src/qwt.cpp"
#include "qwt/src/qwt_abstract_scale_draw.cpp"
#include "qwt/src/qwt_bezier.cpp"
#include "qwt/src/qwt_clipper.cpp"
#include "qwt/src/qwt_color_map.cpp"
#include "qwt/src/qwt_column_symbol.cpp"
#include "qwt/src/qwt_date.cpp"
#include "qwt/src/qwt_date_scale_draw.cpp"
#include "qwt/src/qwt_date_scale_engine.cpp"
#include "qwt/src/qwt_dyngrid_layout.cpp"
#include "qwt/src/qwt_event_pattern.cpp"
#include "qwt/src/qwt_graphic.cpp"
#include "qwt/src/qwt_interval.cpp"
#include "qwt/src/qwt_interval_symbol.cpp"
#include "qwt/src/qwt_math.cpp"
#include "qwt/src/qwt_magnifier.cpp"
#include "qwt/src/qwt_null_paintdevice.cpp"
#include "qwt/src/qwt_painter.cpp"
#include "qwt/src/qwt_painter_command.cpp"
#include "qwt/src/qwt_panner.cpp"
#include "qwt/src/qwt_picker.cpp"
#include "qwt/src/qwt_picker_machine.cpp"
#include "qwt/src/qwt_pixel_matrix.cpp"
#include "qwt/src/qwt_point_3d.cpp"
#include "qwt/src/qwt_point_polar.cpp"
#include "qwt/src/qwt_round_scale_draw.cpp"
#include "qwt/src/qwt_scale_div.cpp"
#include "qwt/src/qwt_scale_draw.cpp"
#include "qwt/src/qwt_scale_map.cpp"
#include "qwt/src/qwt_scale_engine.cpp"
#include "qwt/src/qwt_spline.cpp"
#include "qwt/src/qwt_spline_basis.cpp"
#include "qwt/src/qwt_spline_parametrization.cpp"
#include "qwt/src/qwt_spline_local.cpp"
#include "qwt/src/qwt_spline_cubic.cpp"
#include "qwt/src/qwt_spline_pleasing.cpp"
#include "qwt/src/qwt_spline_polynomial.cpp"
#include "qwt/src/qwt_symbol.cpp"
#include "qwt/src/qwt_system_clock.cpp"
#include "qwt/src/qwt_text_engine.cpp"
#include "qwt/src/qwt_text_label.cpp"
#include "qwt/src/qwt_text.cpp"
#include "qwt/src/qwt_transform.cpp"
#include "qwt/src/qwt_widget_overlay.cpp"
#include "qwt/src/qwt_curve_fitter.cpp"
#include "qwt/src/qwt_spline_curve_fitter.cpp"
#include "qwt/src/qwt_weeding_curve_fitter.cpp"
#include "qwt/src/qwt_abstract_legend.cpp"
#include "qwt/src/qwt_legend.cpp"
#include "qwt/src/qwt_legend_data.cpp"
#include "qwt/src/qwt_legend_label.cpp"
#include "qwt/src/qwt_plot.cpp"
#include "qwt/src/qwt_plot_renderer.cpp"
#include "qwt/src/qwt_plot_axis.cpp"
#include "qwt/src/qwt_plot_curve.cpp"
#include "qwt/src/qwt_plot_dict.cpp"
#include "qwt/src/qwt_plot_directpainter.cpp"
#include "qwt/src/qwt_plot_graphicitem.cpp"
#include "qwt/src/qwt_plot_grid.cpp"
#include "qwt/src/qwt_plot_histogram.cpp"
#include "qwt/src/qwt_plot_item.cpp"
#include "qwt/src/qwt_plot_abstract_barchart.cpp"
#include "qwt/src/qwt_plot_barchart.cpp"
#include "qwt/src/qwt_plot_multi_barchart.cpp"
#include "qwt/src/qwt_plot_intervalcurve.cpp"
#include "qwt/src/qwt_plot_zoneitem.cpp"
#include "qwt/src/qwt_plot_tradingcurve.cpp"
#include "qwt/src/qwt_plot_spectrogram.cpp"
#include "qwt/src/qwt_plot_spectrocurve.cpp"
#include "qwt/src/qwt_plot_scaleitem.cpp"
#include "qwt/src/qwt_plot_legenditem.cpp"
#include "qwt/src/qwt_plot_seriesitem.cpp"
#include "qwt/src/qwt_plot_shapeitem.cpp"
#include "qwt/src/qwt_plot_vectorfield.cpp"
#include "qwt/src/qwt_plot_marker.cpp"
#include "qwt/src/qwt_plot_textlabel.cpp"
#include "qwt/src/qwt_plot_layout.cpp"
#include "qwt/src/qwt_plot_abstract_canvas.cpp"
#include "qwt/src/qwt_plot_canvas.cpp"
#include "qwt/src/qwt_plot_panner.cpp"
#include "qwt/src/qwt_plot_rasteritem.cpp"
#include "qwt/src/qwt_plot_picker.cpp"
#include "qwt/src/qwt_plot_zoomer.cpp"
#include "qwt/src/qwt_plot_magnifier.cpp"
#include "qwt/src/qwt_plot_rescaler.cpp"
#include "qwt/src/qwt_point_mapper.cpp"
#include "qwt/src/qwt_raster_data.cpp"
#include "qwt/src/qwt_matrix_raster_data.cpp"
#include "qwt/src/qwt_vectorfield_symbol.cpp"
#include "qwt/src/qwt_sampling_thread.cpp"
#include "qwt/src/qwt_series_data.cpp"
#include "qwt/src/qwt_point_data.cpp"
#include "qwt/src/qwt_scale_widget.cpp"
#include "qwt/src/qwt_polar_canvas.cpp"
#include "qwt/src/qwt_polar_curve.cpp"
#include "qwt/src/qwt_polar_fitter.cpp"
#include "qwt/src/qwt_polar_grid.cpp"
#include "qwt/src/qwt_polar_item.cpp"
#include "qwt/src/qwt_polar_itemdict.cpp"
#include "qwt/src/qwt_polar_layout.cpp"
#include "qwt/src/qwt_polar_magnifier.cpp"
#include "qwt/src/qwt_polar_marker.cpp"
#include "qwt/src/qwt_polar_panner.cpp"
#include "qwt/src/qwt_polar_picker.cpp"
#include "qwt/src/qwt_polar_plot.cpp"
#include "qwt/src/qwt_polar_renderer.cpp"
#include "qwt/src/qwt_polar_spectrogram.cpp"
#include "qwt/src/qwt_abstract_slider.cpp"
#include "qwt/src/qwt_abstract_scale.cpp"
#include "qwt/src/qwt_arrow_button.cpp"
#include "qwt/src/qwt_analog_clock.cpp"
#include "qwt/src/qwt_compass.cpp"
#include "qwt/src/qwt_compass_rose.cpp"
#include "qwt/src/qwt_counter.cpp"
#include "qwt/src/qwt_dial.cpp"
#include "qwt/src/qwt_dial_needle.cpp"
#include "qwt/src/qwt_knob.cpp"
#include "qwt/src/qwt_slider.cpp"
#include "qwt/src/qwt_thermo.cpp"
#include "qwt/src/qwt_wheel.cpp"
//----------------------------------------------------------------------------------------
// Third-party source files (non-Qwt)
//----------------------------------------------------------------------------------------
#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"
#include "QMapControl/src/curve.cpp"
#include "QMapControl/src/geometry.cpp"
#include "QMapControl/src/imagemanager.cpp"
#include "QMapControl/src/layer.cpp"
#include "QMapControl/src/layermanager.cpp"
#include "QMapControl/src/linestring.cpp"
#include "QMapControl/src/mapadapter.cpp"
#include "QMapControl/src/mapcontrol.cpp"
#include "QMapControl/src/mapnetwork.cpp"
#include "QMapControl/src/point.cpp"
#include "QMapControl/src/tilemapadapter.cpp"
#include "QMapControl/src/wmsmapadapter.cpp"
#include "QMapControl/src/circlepoint.cpp"
#include "QMapControl/src/imagepoint.cpp"
#include "QMapControl/src/gps_position.cpp"
#include "QMapControl/src/osmmapadapter.cpp"
#include "QMapControl/src/maplayer.cpp"
#include "QMapControl/src/geometrylayer.cpp"
#include "QMapControl/src/googlemapadapter.cpp"
#include "QMapControl/src/openaerialmapadapter.cpp"
#include "QMapControl/src/fixedimageoverlay.cpp"
#include "QMapControl/src/emptymapadapter.cpp"
#include "QMapControl/src/arrowpoint.cpp"
#include "QMapControl/src/invisiblepoint.cpp"
#include "QMapControl/src/bingapimapadapter.cpp"
#include "QMapControl/src/googleapimapadapter.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"
//----------------------------------------------------------------------------------------
// Meta object compiler code
//----------------------------------------------------------------------------------------
#include "moc_Accelerometer.cpp"
#include "moc_Bar.cpp"
#include "moc_BaseWidget.cpp"
#include "moc_Client.cpp"
#include "moc_Compass.cpp"
#include "moc_Console.cpp"
#include "moc_Dashboard.cpp"
#include "moc_WidgetLoader.cpp"
#include "moc_DataGroup.cpp"
#include "moc_Editor.cpp"
#include "moc_Export.cpp"
#include "moc_FFTPlot.cpp"
#include "moc_Gauge.cpp"
#include "moc_Generator.cpp"
#include "moc_GPS.cpp"
#include "moc_Gyroscope.cpp"
#include "moc_KLed.cpp"
#include "moc_LEDPanel.cpp"
#include "moc_MacExtras.cpp"
#include "moc_Manager.cpp"
#include "moc_ModuleManager.cpp"
#include "moc_MultiPlot.cpp"
#include "moc_Network.cpp"
#include "moc_Player.cpp"
#include "moc_Plot.cpp"
#include "moc_Serial.cpp"
#include "moc_Server.cpp"
#include "moc_Terminal.cpp"
#include "moc_ThemeManager.cpp"
#include "moc_TimerEvents.cpp"
#include "moc_Translator.cpp"
#include "moc_Utilities.cpp"
//----------------------------------------------------------------------------------------
// Meta object compiler code from third-party libraries
//----------------------------------------------------------------------------------------
#include "moc_qmqtt_networkinterface.cpp"
#include "moc_qmqtt_socketinterface.cpp"
#include "moc_qmqtt_timerinterface.cpp"
#ifdef Q_OS_MAC
#include "moc_kdmactouchbar.cpp"
#endif
//----------------------------------------------------------------------------------------
// QtQuickCompiler code
//----------------------------------------------------------------------------------------
#if UNITY_BUILD_INCLUDE_QML
#include "assets_qml_main_qml.cpp"
#include "assets_qml_Windows_Acknowledgements_qml.cpp"
#include "assets_qml_Windows_CsvPlayer_qml.cpp"
#include "assets_qml_Windows_MainWindow_qml.cpp"
#include "assets_qml_Windows_Donate_qml.cpp"
#include "assets_qml_Windows_JsonEditor_qml.cpp"
#include "assets_qml_Windows_About_qml.cpp"
#include "assets_qml_Widgets_JSONDropArea_qml.cpp"
#include "assets_qml_Widgets_Window_qml.cpp"
#include "assets_qml_Widgets_Shadow_qml.cpp"
#include "assets_qml_Widgets_Icon_qml.cpp"
#include "assets_qml_Widgets_LED_qml.cpp"
#include "assets_qml_Widgets_Terminal_qml.cpp"
#include "assets_qml_Panes_Console_qml.cpp"
#include "assets_qml_Panes_Dashboard_qml.cpp"
#include "assets_qml_Panes_Setup_qml.cpp"
#include "assets_qml_Panes_Toolbar_qml.cpp"
#include "assets_qml_Panes_SetupPanes_MQTT_qml.cpp"
#include "assets_qml_Panes_SetupPanes_Serial_qml.cpp"
#include "assets_qml_Panes_SetupPanes_Settings_qml.cpp"
#include "assets_qml_Panes_SetupPanes_Network_qml.cpp"
#include "assets_qml_PlatformDependent_DecentMenuItem_qml.cpp"
#include "assets_qml_PlatformDependent_Menubar_qml.cpp"
#include "assets_qml_PlatformDependent_MenubarMacOS_qml.cpp"
#include "assets_qml_PlatformDependent_WindowButton_qml.cpp"
#include "assets_qml_PlatformDependent_WindowBorder_qml.cpp"
#include "assets_qml_PlatformDependent_CustomWindow_qml.cpp"
#include "assets_qml_JsonEditor_JsonGroupDelegate_qml.cpp"
#include "assets_qml_JsonEditor_TreeView_qml.cpp"
#include "assets_qml_JsonEditor_Header_qml.cpp"
#include "assets_qml_JsonEditor_Footer_qml.cpp"
#include "assets_qml_JsonEditor_JsonDatasetDelegate_qml.cpp"
#include "assets_qml_JsonEditor_GroupEditor_qml.cpp"
#include "assets_qml_Dashboard_DashboardTitle_qml.cpp"
#include "assets_qml_Dashboard_ViewOptions_qml.cpp"
#include "assets_qml_Dashboard_WidgetGrid_qml.cpp"
#include "assets_qml_Dashboard_WidgetDelegate_qml.cpp"
#include "assets_qml_Dashboard_ViewOptionsDelegate_qml.cpp"
#include "assets_qml_Dashboard_WidgetModel_qml.cpp"
#include "qmlcache_loader.cpp"
#endif
// clang-format on
#endif

View File

@ -20,6 +20,8 @@
* THE SOFTWARE.
*/
#include <QtAlgorithms>
#include <IO/Manager.h>
#include <IO/Console.h>
#include <CSV/Player.h>
@ -584,10 +586,9 @@ void Dashboard::setPoints(const int points)
m_linearPlotValues.clear();
// Regenerate x-axis values
m_xData.clear();
m_xData.reserve(points);
m_xData.resize(points);
for (int i = 0; i < points; ++i)
m_xData.append(i);
m_xData[i] = i;
// Update plots
emit pointsChanged();
@ -688,7 +689,7 @@ void Dashboard::updateData()
// Save widget count
const int barC = barCount();
const int fftC = fftCount();
const int mapC = gpsCount();
const int gpsC = gpsCount();
const int ledC = ledCount();
const int plotC = plotCount();
const int groupC = groupCount();
@ -706,19 +707,6 @@ void Dashboard::updateData()
if (!m_latestFrame.read(lastJson.jsonDocument.object()))
return;
// Clear widget data
m_barWidgets.clear();
m_fftWidgets.clear();
m_gpsWidgets.clear();
m_ledWidgets.clear();
m_plotWidgets.clear();
m_gaugeWidgets.clear();
m_groupWidgets.clear();
m_compassWidgets.clear();
m_gyroscopeWidgets.clear();
m_multiPlotWidgets.clear();
m_accelerometerWidgets.clear();
// Regenerate plot data
updatePlots();
@ -754,7 +742,7 @@ void Dashboard::updateData()
bool regenerateWidgets = false;
regenerateWidgets |= (barC != barCount());
regenerateWidgets |= (fftC != fftCount());
regenerateWidgets |= (mapC != gpsCount());
regenerateWidgets |= (gpsC != gpsCount());
regenerateWidgets |= (ledC != ledCount());
regenerateWidgets |= (plotC != plotCount());
regenerateWidgets |= (gaugeC != gaugeCount());
@ -767,41 +755,28 @@ void Dashboard::updateData()
// Regenerate widget visiblity models
if (regenerateWidgets)
{
m_barVisibility.clear();
m_fftVisibility.clear();
m_gpsVisibility.clear();
m_ledVisibility.clear();
m_plotVisibility.clear();
m_gaugeVisibility.clear();
m_groupVisibility.clear();
m_compassVisibility.clear();
m_gyroscopeVisibility.clear();
m_multiPlotVisibility.clear();
m_accelerometerVisibility.clear();
int i;
for (i = 0; i < barCount(); ++i)
m_barVisibility.append(true);
for (i = 0; i < fftCount(); ++i)
m_fftVisibility.append(true);
for (i = 0; i < gpsCount(); ++i)
m_gpsVisibility.append(true);
for (i = 0; i < ledCount(); ++i)
m_ledVisibility.append(true);
for (i = 0; i < plotCount(); ++i)
m_plotVisibility.append(true);
for (i = 0; i < gaugeCount(); ++i)
m_gaugeVisibility.append(true);
for (i = 0; i < groupCount(); ++i)
m_groupVisibility.append(true);
for (i = 0; i < compassCount(); ++i)
m_compassVisibility.append(true);
for (i = 0; i < gyroscopeCount(); ++i)
m_gyroscopeVisibility.append(true);
for (i = 0; i < multiPlotCount(); ++i)
m_multiPlotVisibility.append(true);
for (i = 0; i < accelerometerCount(); ++i)
m_accelerometerVisibility.append(true);
m_barVisibility.resize(barCount());
m_fftVisibility.resize(fftCount());
m_gpsVisibility.resize(gpsCount());
m_ledVisibility.resize(ledCount());
m_plotVisibility.resize(plotCount());
m_gaugeVisibility.resize(gaugeCount());
m_groupVisibility.resize(groupCount());
m_compassVisibility.resize(compassCount());
m_gyroscopeVisibility.resize(gyroscopeCount());
m_multiPlotVisibility.resize(multiPlotCount());
m_accelerometerVisibility.resize(accelerometerCount());
std::fill(m_barVisibility.begin(), m_barVisibility.end(), 1);
std::fill(m_fftVisibility.begin(), m_fftVisibility.end(), 1);
std::fill(m_gpsVisibility.begin(), m_gpsVisibility.end(), 1);
std::fill(m_ledVisibility.begin(), m_ledVisibility.end(), 1);
std::fill(m_plotVisibility.begin(), m_plotVisibility.end(), 1);
std::fill(m_gaugeVisibility.begin(), m_gaugeVisibility.end(), 1);
std::fill(m_groupVisibility.begin(), m_groupVisibility.end(), 1);
std::fill(m_compassVisibility.begin(), m_compassVisibility.end(), 1);
std::fill(m_gyroscopeVisibility.begin(), m_gyroscopeVisibility.end(), 1);
std::fill(m_multiPlotVisibility.begin(), m_multiPlotVisibility.end(), 1);
std::fill(m_accelerometerVisibility.begin(), m_accelerometerVisibility.end(), 1);
emit widgetCountChanged();
emit widgetVisibilityChanged();
@ -852,9 +827,13 @@ void Dashboard::updatePlots()
for (int i = 0; i < linearDatasets.count(); ++i)
{
m_linearPlotValues.append(PlotData());
m_linearPlotValues.last().reserve(points());
for (int j = 0; j < points(); ++j)
m_linearPlotValues[i].append(0.0001);
m_linearPlotValues.last().resize(points());
// clang-format off
std::fill(m_linearPlotValues.last().begin(),
m_linearPlotValues.last().end(),
0.0001);
// clang-format on
}
}
@ -866,9 +845,13 @@ void Dashboard::updatePlots()
for (int i = 0; i < fftDatasets.count(); ++i)
{
m_fftPlotValues.append(PlotData());
m_fftPlotValues.last().reserve(fftDatasets[i]->fftSamples());
for (int j = 0; j < fftDatasets[i]->fftSamples(); ++j)
m_fftPlotValues[i].append(0);
m_fftPlotValues.last().resize(fftDatasets[i]->fftSamples());
// clang-format off
std::fill(m_fftPlotValues.last().begin(),
m_fftPlotValues.last().end(),
0);
// clang-format on
}
}

View File

@ -34,9 +34,6 @@ namespace Widgets
*/
GPS::GPS(const int index)
: m_index(index)
, m_lat(0)
, m_lon(0)
, m_alt(0)
{
// Get pointers to serial studio modules
const auto dash = UI::Dashboard::getInstance();

View File

@ -51,9 +51,6 @@ protected:
private:
int m_index;
qreal m_lat;
qreal m_lon;
qreal m_alt;
QLabel *m_label;
QVBoxLayout m_layout;
QPushButton *m_zoomIn;