Commit f788d380 authored by Don Gagne's avatar Don Gagne

Disconnect Vehicle support

parent 903459f7
......@@ -131,7 +131,7 @@ Item {
Rectangle {
anchors.fill: _valuesWidget
color: _backgroundColor
visible: !_showCompass && _activeVehicle
visible: !_showCompass
radius: _spacing
}
......@@ -145,7 +145,6 @@ Item {
}
}
Rectangle {
id: _spacer2
height: 1
......
......@@ -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 {
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 }
......
......@@ -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 {
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)
......
......@@ -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
......
......@@ -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)
if (_gcsHeartbeatEnabled) {
_gcsHeartbeatTimer.start();
}
_disconnectedVehicle = new Vehicle(this);
}
void MultiVehicleManager::setToolbox(QGCToolbox *toolbox)
......
......@@ -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:
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
......
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