Browse Source

Disconnect Vehicle support

QGC4.4
Don Gagne 9 years ago
parent
commit
f788d38048
  1. 3
      src/FlightMap/Widgets/QGCInstrumentWidget.qml
  2. 3
      src/FlightMap/Widgets/ValuesWidget.qml
  3. 3
      src/FlightMap/Widgets/VibrationWidget.qml
  4. 2
      src/QmlControls/QGroundControlQmlGlobal.h
  5. 3
      src/Vehicle/MultiVehicleManager.cc
  6. 4
      src/Vehicle/MultiVehicleManager.h

3
src/FlightMap/Widgets/QGCInstrumentWidget.qml

@ -131,7 +131,7 @@ Item { @@ -131,7 +131,7 @@ Item {
Rectangle {
anchors.fill: _valuesWidget
color: _backgroundColor
visible: !_showCompass && _activeVehicle
visible: !_showCompass
radius: _spacing
}
@ -145,7 +145,6 @@ Item { @@ -145,7 +145,6 @@ Item {
}
}
Rectangle {
id: _spacer2
height: 1

3
src/FlightMap/Widgets/ValuesWidget.qml

@ -33,7 +33,6 @@ import QGroundControl 1.0 @@ -33,7 +33,6 @@ import QGroundControl 1.0
QGCFlickable {
id: _root
visible: _activeVehicle
height: Math.min(maxHeight, _smallFlow.y + _smallFlow.height)
contentHeight: _smallFlow.y + _smallFlow.height
flickableDirection: Flickable.VerticalFlick
@ -43,7 +42,7 @@ QGCFlickable { @@ -43,7 +42,7 @@ QGCFlickable {
property color textColor
property var maxHeight
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle ? QGroundControl.multiVehicleManager.activeVehicle : QGroundControl.multiVehicleManager.disconnectedVehicle
property real _margins: ScreenTools.defaultFontPixelWidth / 2
QGCPalette { id:qgcPal; colorGroupEnabled: true }

3
src/FlightMap/Widgets/VibrationWidget.qml

@ -33,7 +33,6 @@ import QGroundControl 1.0 @@ -33,7 +33,6 @@ import QGroundControl 1.0
QGCFlickable {
id: _root
visible: _activeVehicle
height: Math.min(maxHeight, innerItem.height)
contentHeight: innerItem.height
flickableDirection: Flickable.VerticalFlick
@ -43,7 +42,7 @@ QGCFlickable { @@ -43,7 +42,7 @@ QGCFlickable {
property color backgroundColor
property var maxHeight
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle ? QGroundControl.multiVehicleManager.activeVehicle : QGroundControl.multiVehicleManager.disconnectedVehicle
property real _margins: ScreenTools.defaultFontPixelWidth / 2
property real _barWidth: Math.round(ScreenTools.defaultFontPixelWidth * 3)

2
src/QmlControls/QGroundControlQmlGlobal.h

@ -55,7 +55,7 @@ public: @@ -55,7 +55,7 @@ public:
Q_PROPERTY(LinkManager* linkManager READ linkManager CONSTANT)
Q_PROPERTY(MissionCommands* missionCommands READ missionCommands CONSTANT)
Q_PROPERTY(MultiVehicleManager* multiVehicleManager READ multiVehicleManager CONSTANT)
Q_PROPERTY(QGCMapEngineManager* mapEngineManager READ mapEngineManager CONSTANT)
Q_PROPERTY(QGCMapEngineManager* mapEngineManager READ mapEngineManager CONSTANT)
Q_PROPERTY(qreal zOrderTopMost READ zOrderTopMost CONSTANT) ///< z order for top most items, toolbar, main window sub view
Q_PROPERTY(qreal zOrderWidgets READ zOrderWidgets CONSTANT) ///< z order value to widgets, for example: zoom controls, hud widgetss

3
src/Vehicle/MultiVehicleManager.cc

@ -50,6 +50,7 @@ MultiVehicleManager::MultiVehicleManager(QGCApplication* app) @@ -50,6 +50,7 @@ MultiVehicleManager::MultiVehicleManager(QGCApplication* app)
, _activeVehicleAvailable(false)
, _parameterReadyVehicleAvailable(false)
, _activeVehicle(NULL)
, _disconnectedVehicle(NULL)
, _firmwarePluginManager(NULL)
, _autopilotPluginManager(NULL)
, _joystickManager(NULL)
@ -66,6 +67,8 @@ MultiVehicleManager::MultiVehicleManager(QGCApplication* app) @@ -66,6 +67,8 @@ MultiVehicleManager::MultiVehicleManager(QGCApplication* app)
if (_gcsHeartbeatEnabled) {
_gcsHeartbeatTimer.start();
}
_disconnectedVehicle = new Vehicle(this);
}
void MultiVehicleManager::setToolbox(QGCToolbox *toolbox)

4
src/Vehicle/MultiVehicleManager.h

@ -57,6 +57,9 @@ public: @@ -57,6 +57,9 @@ public:
Q_PROPERTY(QmlObjectListModel* vehicles READ vehicles CONSTANT)
Q_PROPERTY(bool gcsHeartBeatEnabled READ gcsHeartbeatEnabled WRITE setGcsHeartbeatEnabled NOTIFY gcsHeartBeatEnabledChanged)
/// A disconnected vehicle is used to access FactGroup information for the Vehicle object when no active vehicle is available
Q_PROPERTY(Vehicle* disconnectedVehicle MEMBER _disconnectedVehicle CONSTANT)
// Methods
Q_INVOKABLE Vehicle* getVehicleById(int vehicleId);
@ -104,6 +107,7 @@ private: @@ -104,6 +107,7 @@ private:
bool _activeVehicleAvailable; ///< true: An active vehicle is available
bool _parameterReadyVehicleAvailable; ///< true: An active vehicle with ready parameters is available
Vehicle* _activeVehicle; ///< Currently active vehicle from a ui perspective
Vehicle* _disconnectedVehicle; ///< Disconnected vechicle for FactGroup access
QList<Vehicle*> _vehiclesBeingDeleted; ///< List of Vehicles being deleted in queued phases
Vehicle* _vehicleBeingSetActive; ///< Vehicle being set active in queued phases

Loading…
Cancel
Save