Unverified Commit 2d83e17e authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #8655 from DonLakeFlyer/ValueRanges

Value range visual change support
parents b458b751 8cf5f75c
......@@ -571,6 +571,7 @@ HEADERS += \
src/Camera/QGCCameraManager.h \
src/CmdLineOptParser.h \
src/FirmwarePlugin/PX4/px4_custom_mode.h \
src/FlightMap/Widgets/InstrumentValue.h \
src/FlightMap/Widgets/ValuesWidgetController.h \
src/FollowMe/FollowMe.h \
src/Joystick/Joystick.h \
......@@ -778,6 +779,7 @@ SOURCES += \
src/Camera/QGCCameraIO.cc \
src/Camera/QGCCameraManager.cc \
src/CmdLineOptParser.cc \
src/FlightMap/Widgets/InstrumentValue.cc \
src/FlightMap/Widgets/ValuesWidgetController.cc \
src/FollowMe/FollowMe.cc \
src/Joystick/Joystick.cc \
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -12,109 +12,10 @@
#include "FactSystem.h"
#include "QmlObjectListModel.h"
#include "QGCApplication.h"
#include "InstrumentValue.h"
#include <QObject>
class ValuesWidgetController;
class InstrumentValue : public QObject
enum FontSize {
enum IconPosition {
IconAbove = 0,
InstrumentValue(Vehicle* activeVehicle, FontSize fontSize, QmlObjectListModel* rowModel);
Q_PROPERTY(QStringList factGroupNames MEMBER _factGroupNames NOTIFY factGroupNamesChanged)
Q_PROPERTY(QStringList factValueNames MEMBER _factValueNames NOTIFY factValueNamesChanged)
Q_PROPERTY(QString factGroupName MEMBER _factGroupName NOTIFY factGroupNameChanged)
Q_PROPERTY(QString factName MEMBER _factName NOTIFY factNameChanged)
Q_PROPERTY(Fact* fact READ fact NOTIFY factChanged)
Q_PROPERTY(QString label READ label WRITE setLabel NOTIFY labelChanged)
Q_PROPERTY(QString icon READ icon WRITE setIcon NOTIFY iconChanged) ///< If !isEmpty icon will be show instead of label
Q_PROPERTY(IconPosition iconPosition READ iconPosition WRITE setIconPosition NOTIFY iconPositionChanged)
Q_PROPERTY(QStringList iconPositionNames MEMBER _iconPositionNames CONSTANT)
Q_PROPERTY(QStringList iconNames MEMBER _iconNames CONSTANT)
Q_PROPERTY(FontSize fontSize READ fontSize WRITE setFontSize NOTIFY fontSizeChanged)
Q_PROPERTY(QStringList fontSizeNames MEMBER _fontSizeNames CONSTANT)
Q_PROPERTY(bool showUnits READ showUnits WRITE setShowUnits NOTIFY showUnitsChanged)
Q_INVOKABLE void setFact(const QString& factGroupName, const QString& factName);
Q_INVOKABLE void clearFact(void);
Fact* fact (void) { return _fact; }
FontSize fontSize (void) const { return _fontSize; }
QString label (void) const { return _label; }
bool showUnits (void) const { return _showUnits; }
QString icon (void) const { return _icon; }
IconPosition iconPosition (void) const { return _iconPosition; }
void setFontSize (FontSize fontSize);
void setLabel (const QString& label);
void setShowUnits (bool showUnits);
void setIcon (const QString& icon);
void setIconPosition (IconPosition iconPosition);
void activeVehicleChanged (Vehicle* activeVehicle);
void saveToSettings (QSettings& settings) const;
void readFromSettings (const QSettings& settings);
void factChanged (Fact* fact);
void factNameChanged (const QString& factName);
void factGroupNameChanged (const QString& factGroup);
void labelChanged (QString label);
void fontSizeChanged (FontSize fontSize);
void showUnitsChanged (bool showUnits);
void iconChanged (const QString& icon);
void iconPositionChanged (IconPosition iconPosition);
void factGroupNamesChanged (const QStringList& factGroupNames);
void factValueNamesChanged (const QStringList& factValueNames);
void _setFontSize (FontSize fontSize);
Vehicle* _activeVehicle = nullptr;
QmlObjectListModel* _rowModel = nullptr;
Fact* _fact = nullptr;
QString _factName;
QString _factGroupName;
QString _label;
bool _showUnits = true;
FontSize _fontSize = DefaultFontSize;
QString _icon;
IconPosition _iconPosition = IconLeft;
QStringList _factGroupNames;
QStringList _factValueNames;
static const QStringList _iconPositionNames;
static QStringList _iconNames;
static const QStringList _fontSizeNames;
static const char* _factGroupNameKey;
static const char* _factNameKey;
static const char* _labelKey;
static const char* _fontSizeKey;
static const char* _showUnitsKey;
static const char* _iconKey;
static const char* _iconPositionKey;
static const char* _vehicleFactGroupName;
class ValuesWidgetController : public QObject
......@@ -156,9 +156,9 @@ Popup {
Item {
id: item
width: dialogComponentLoader.width + (_contentMargin * 2)
height: dialogComponentLoader.height + _contentMargin
id: item
Layout.preferredWidth: dialogComponentLoader.width + (_contentMargin * 2)
Layout.preferredHeight: dialogComponentLoader.height + _contentMargin
Loader {
id: dialogComponentLoader
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment