Commit a25626fd authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #4809 from DonLakeFlyer/CorePlugin

Core plugin changes
parents b97caf30 ad021f6a
...@@ -38,8 +38,8 @@ public: ...@@ -38,8 +38,8 @@ public:
AutoPilotPlugin(Vehicle* vehicle, QObject* parent); AutoPilotPlugin(Vehicle* vehicle, QObject* parent);
~AutoPilotPlugin(); ~AutoPilotPlugin();
Q_PROPERTY(QVariantList vehicleComponents READ vehicleComponents CONSTANT) ///< List of VehicleComponent objects Q_PROPERTY(QVariantList vehicleComponents READ vehicleComponents NOTIFY vehicleComponentsChanged) ///< List of VehicleComponent objects
Q_PROPERTY(bool setupComplete READ setupComplete NOTIFY setupCompleteChanged) ///< false: One or more vehicle components require setup Q_PROPERTY(bool setupComplete READ setupComplete NOTIFY setupCompleteChanged) ///< false: One or more vehicle components require setup
/// Called when parameters are ready for the first time. Note that parameters may still be missing. /// Called when parameters are ready for the first time. Note that parameters may still be missing.
/// Overrides must call base class. /// Overrides must call base class.
...@@ -56,6 +56,7 @@ public: ...@@ -56,6 +56,7 @@ public:
signals: signals:
void setupCompleteChanged(bool setupComplete); void setupCompleteChanged(bool setupComplete);
void vehicleComponentsChanged(void);
protected: protected:
/// All access to AutoPilotPugin objects is through getInstanceForAutoPilotPlugin /// All access to AutoPilotPugin objects is through getInstanceForAutoPilotPlugin
......
...@@ -718,6 +718,7 @@ QGCView { ...@@ -718,6 +718,7 @@ QGCView {
z: QGroundControl.zOrderWidgets z: QGroundControl.zOrderWidgets
showAlternateIcon: [ false, false, _syncDropDownController.dirty, false, false, false, false ] showAlternateIcon: [ false, false, _syncDropDownController.dirty, false, false, false, false ]
rotateImage: [ false, false, _syncDropDownController.syncInProgress, false, false, false, false ] rotateImage: [ false, false, _syncDropDownController.syncInProgress, false, false, false, false ]
animateImage: [ false, false, _syncDropDownController.dirty, false, false, false, false ]
buttonEnabled: [ true, true, !_syncDropDownController.syncInProgress, true, true, true, true ] buttonEnabled: [ true, true, !_syncDropDownController.syncInProgress, true, true, true, true ]
buttonVisible: [ true, true, true, true, true, _showZoom, _showZoom ] buttonVisible: [ true, true, true, true, true, _showZoom, _showZoom ]
maxHeight: mapScale.y - toolStrip.y maxHeight: mapScale.y - toolStrip.y
......
...@@ -24,6 +24,7 @@ Rectangle { ...@@ -24,6 +24,7 @@ Rectangle {
property alias model: repeater.model property alias model: repeater.model
property var showAlternateIcon ///< List of bool values, one for each button in strip - true: show alternate icon, false: show normal icon property var showAlternateIcon ///< List of bool values, one for each button in strip - true: show alternate icon, false: show normal icon
property var rotateImage ///< List of bool values, one for each button in strip - true: animation rotation, false: static image property var rotateImage ///< List of bool values, one for each button in strip - true: animation rotation, false: static image
property var animateImage ///< List of bool values, one for each button in strip - true: animate image, false: static image
property var buttonEnabled ///< List of bool values, one for each button in strip - true: button enabled, false: button disabled property var buttonEnabled ///< List of bool values, one for each button in strip - true: button enabled, false: button disabled
property var buttonVisible ///< List of bool values, one for each button in strip - true: button visible, false: button invisible property var buttonVisible ///< List of bool values, one for each button in strip - true: button visible, false: button invisible
property real maxHeight ///< Maximum height for control, determines whether text is hidden to make control shorter property real maxHeight ///< Maximum height for control, determines whether text is hidden to make control shorter
...@@ -123,6 +124,7 @@ Rectangle { ...@@ -123,6 +124,7 @@ Rectangle {
property var _alternateIconSource: modelData.alternateIconSource property var _alternateIconSource: modelData.alternateIconSource
property var _source: (_root.showAlternateIcon && _root.showAlternateIcon[index]) ? _alternateIconSource : _iconSource property var _source: (_root.showAlternateIcon && _root.showAlternateIcon[index]) ? _alternateIconSource : _iconSource
property bool rotateImage: _root.rotateImage ? _root.rotateImage[index] : false property bool rotateImage: _root.rotateImage ? _root.rotateImage[index] : false
property bool animateImage: _root.animateImage ? _root.animateImage[index] : false
onExclusiveGroupChanged: { onExclusiveGroupChanged: {
if (exclusiveGroup) { if (exclusiveGroup) {
...@@ -139,6 +141,15 @@ Rectangle { ...@@ -139,6 +141,15 @@ Rectangle {
} }
} }
onAnimateImageChanged: {
if (animateImage) {
opacityAnimation.running = true
} else {
opacityAnimation.running = false
button.opacity = 1
}
}
Item { Item {
width: 1 width: 1
height: _buttonSpacing height: _buttonSpacing
...@@ -170,6 +181,14 @@ Rectangle { ...@@ -170,6 +181,14 @@ Rectangle {
running: false running: false
} }
NumberAnimation on opacity {
id: opacityAnimation
running: false
from: 0
to: 1.0
loops: Animation.Infinite
duration: 2000
}
} }
QGCMouseArea { QGCMouseArea {
......
...@@ -36,6 +36,7 @@ Rectangle { ...@@ -36,6 +36,7 @@ Rectangle {
property string _messagePanelText: "missing message panel text" property string _messagePanelText: "missing message panel text"
property bool _fullParameterVehicleAvailable: QGroundControl.multiVehicleManager.parameterReadyVehicleAvailable && !QGroundControl.multiVehicleManager.activeVehicle.parameterManager.missingParameters property bool _fullParameterVehicleAvailable: QGroundControl.multiVehicleManager.parameterReadyVehicleAvailable && !QGroundControl.multiVehicleManager.activeVehicle.parameterManager.missingParameters
property var _corePlugin: QGroundControl.corePlugin
function showSummaryPanel() function showSummaryPanel()
{ {
...@@ -231,14 +232,14 @@ Rectangle { ...@@ -231,14 +232,14 @@ Rectangle {
} }
Repeater { Repeater {
model: QGroundControl.corePlugin.settingsPages model: _corePlugin.settingsPages
visible: QGroundControl.corePlugin.options.combineSettingsAndSetup visible: _corePlugin.options.combineSettingsAndSetup
SubMenuButton { SubMenuButton {
imageResource: modelData.icon imageResource: modelData.icon
setupIndicator: false setupIndicator: false
exclusiveGroup: setupButtonGroup exclusiveGroup: setupButtonGroup
text: modelData.title text: modelData.title
visible: QGroundControl.corePlugin.options.combineSettingsAndSetup visible: _corePlugin.options.combineSettingsAndSetup
onClicked: panelLoader.setSource(modelData.url) onClicked: panelLoader.setSource(modelData.url)
Layout.fillWidth: true Layout.fillWidth: true
} }
...@@ -261,7 +262,7 @@ Rectangle { ...@@ -261,7 +262,7 @@ Rectangle {
imageResource: "/qmlimages/FirmwareUpgradeIcon.png" imageResource: "/qmlimages/FirmwareUpgradeIcon.png"
setupIndicator: false setupIndicator: false
exclusiveGroup: setupButtonGroup exclusiveGroup: setupButtonGroup
visible: !ScreenTools.isMobile visible: !ScreenTools.isMobile && _corePlugin.options.showFirmwareUpgrade
text: "Firmware" text: "Firmware"
Layout.fillWidth: true Layout.fillWidth: true
...@@ -311,7 +312,7 @@ Rectangle { ...@@ -311,7 +312,7 @@ Rectangle {
SubMenuButton { SubMenuButton {
setupIndicator: false setupIndicator: false
exclusiveGroup: setupButtonGroup exclusiveGroup: setupButtonGroup
visible: QGroundControl.multiVehicleManager.parameterReadyVehicleAvailable && QGroundControl.corePlugin.showAdvancedUI visible: QGroundControl.multiVehicleManager.parameterReadyVehicleAvailable && _corePlugin.showAdvancedUI
text: "Parameters" text: "Parameters"
Layout.fillWidth: true Layout.fillWidth: true
......
...@@ -34,6 +34,7 @@ public: ...@@ -34,6 +34,7 @@ public:
Q_PROPERTY(bool showSensorCalibrationLevel READ showSensorCalibrationLevel NOTIFY showSensorCalibrationLevelChanged) Q_PROPERTY(bool showSensorCalibrationLevel READ showSensorCalibrationLevel NOTIFY showSensorCalibrationLevelChanged)
Q_PROPERTY(bool showSensorCalibrationAirspeed READ showSensorCalibrationAirspeed NOTIFY showSensorCalibrationAirspeedChanged) Q_PROPERTY(bool showSensorCalibrationAirspeed READ showSensorCalibrationAirspeed NOTIFY showSensorCalibrationAirspeedChanged)
Q_PROPERTY(bool showSensorCalibrationOrient READ showSensorCalibrationOrient NOTIFY showSensorCalibrationOrientChanged) Q_PROPERTY(bool showSensorCalibrationOrient READ showSensorCalibrationOrient NOTIFY showSensorCalibrationOrientChanged)
Q_PROPERTY(bool showFirmwareUpgrade READ showFirmwareUpgrade NOTIFY showFirmwareUpgradeChanged)
/// Should QGC hide its settings menu and colapse it into one single menu (Settings and Vehicle Setup)? /// Should QGC hide its settings menu and colapse it into one single menu (Settings and Vehicle Setup)?
/// @return true if QGC should consolidate both menus into one. /// @return true if QGC should consolidate both menus into one.
...@@ -59,6 +60,8 @@ public: ...@@ -59,6 +60,8 @@ public:
virtual bool showSensorCalibrationAirspeed () const { return true; } virtual bool showSensorCalibrationAirspeed () const { return true; }
virtual bool showSensorCalibrationOrient () const { return true; } virtual bool showSensorCalibrationOrient () const { return true; }
virtual bool showFirmwareUpgrade () const { return true; }
signals: signals:
void showSensorCalibrationCompassChanged (bool show); void showSensorCalibrationCompassChanged (bool show);
void showSensorCalibrationGyroChanged (bool show); void showSensorCalibrationGyroChanged (bool show);
...@@ -66,6 +69,7 @@ signals: ...@@ -66,6 +69,7 @@ signals:
void showSensorCalibrationLevelChanged (bool show); void showSensorCalibrationLevelChanged (bool show);
void showSensorCalibrationAirspeedChanged (bool show); void showSensorCalibrationAirspeedChanged (bool show);
void showSensorCalibrationOrientChanged (bool show); void showSensorCalibrationOrientChanged (bool show);
void showFirmwareUpgradeChanged (bool show);
private: private:
CustomInstrumentWidget* _defaultInstrumentWidget; CustomInstrumentWidget* _defaultInstrumentWidget;
......
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