Commit bab4a3d2 authored by Pierre TILAK's avatar Pierre TILAK

Merge branch 'master' into MapProviders

parents b366823d 214529d9
...@@ -64,7 +64,6 @@ addons: ...@@ -64,7 +64,6 @@ addons:
- libgstreamer-plugins-base1.0-dev - libgstreamer-plugins-base1.0-dev
- libgstreamer1.0-0:amd64 - libgstreamer1.0-0:amd64
- libgstreamer1.0-dev - libgstreamer1.0-dev
- libsdl2-dev
- libudev-dev - libudev-dev
- wget - wget
...@@ -81,6 +80,11 @@ before_install: ...@@ -81,6 +80,11 @@ before_install:
export JOBS=$((`sysctl -n hw.ncpu`+1)); export JOBS=$((`sysctl -n hw.ncpu`+1));
fi fi
# Linux needs sdl2 but not android
- if [ "${SPEC}" = "linux-g++-64" ]; then
sudo apt-get install -y libsdl2-dev;
fi
install: install:
# linux dependencies: qt # linux dependencies: qt
- if [ "${SPEC}" = "linux-g++-64" ]; then - if [ "${SPEC}" = "linux-g++-64" ]; then
......
...@@ -85,8 +85,11 @@ void CodingStyle::_methodWithManyArguments(QWidget* parent, ...@@ -85,8 +85,11 @@ void CodingStyle::_methodWithManyArguments(QWidget* parent,
const QString& caption, const QString& caption,
const QString& dir, const QString& dir,
Options options1, Options options1,
Options options2, Options /* options2 */,
Options options3) Options options3)
{ {
// options2 is an unused method argument.
// Do not use Q_UNUSUED and do not just remove the argument name and leave the type.
// Implementataion here... // Implementataion here...
} }
...@@ -323,16 +323,16 @@ const QVariantList &FirmwarePlugin::toolBarIndicators(const Vehicle* vehicle) ...@@ -323,16 +323,16 @@ const QVariantList &FirmwarePlugin::toolBarIndicators(const Vehicle* vehicle)
//-- Default list of indicators for all vehicles. //-- Default list of indicators for all vehicles.
if(_toolBarIndicatorList.size() == 0) { if(_toolBarIndicatorList.size() == 0) {
_toolBarIndicatorList = QVariantList({ _toolBarIndicatorList = QVariantList({
QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/MultiVehicleSelector.qml")),
QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/MessageIndicator.qml")), QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/MessageIndicator.qml")),
QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/GPSIndicator.qml")), QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/GPSIndicator.qml")),
QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/TelemetryRSSIIndicator.qml")), QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/TelemetryRSSIIndicator.qml")),
QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/RCRSSIIndicator.qml")), QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/RCRSSIIndicator.qml")),
QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/BatteryIndicator.qml")), QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/BatteryIndicator.qml")),
QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/GPSRTKIndicator.qml")),
QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/ModeIndicator.qml")), QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/ModeIndicator.qml")),
QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/VTOLModeIndicator.qml")), QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/VTOLModeIndicator.qml")),
QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/ArmedIndicator.qml")), QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/ArmedIndicator.qml")),
QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/GPSRTKIndicator.qml")), QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/MultiVehicleSelector.qml")),
QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/LinkIndicator.qml")), QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/LinkIndicator.qml")),
}); });
} }
......
...@@ -5713,8 +5713,8 @@ the setpoint will be capped to MPC_XY_VEL_MAX</short_desc> ...@@ -5713,8 +5713,8 @@ the setpoint will be capped to MPC_XY_VEL_MAX</short_desc>
<boolean /> <boolean />
</parameter> </parameter>
<parameter default="0.0" name="THR_MDL_FAC" type="FLOAT"> <parameter default="0.0" name="THR_MDL_FAC" type="FLOAT">
<short_desc>Thrust to PWM model parameter</short_desc> <short_desc>Thrust to motor control signal model parameter</short_desc>
<long_desc>Parameter used to model the relationship between static thrust and motor input PWM. Model is: thrust = (1-factor)*PWM + factor * PWM^2</long_desc> <long_desc>Parameter used to model the nonlinear relationship between motor control signal (e.g. PWM) and static thrust. The model is: rel_thrust = factor * rel_signal^2 + (1-factor) * rel_signal, where rel_thrust is the normalized thrust between 0 and 1, and rel_signal is the relative motor control signal between 0 and 1.</long_desc>
<min>0.0</min> <min>0.0</min>
<max>1.0</max> <max>1.0</max>
</parameter> </parameter>
......
...@@ -31,11 +31,6 @@ FlightMap { ...@@ -31,11 +31,6 @@ FlightMap {
allowVehicleLocationCenter: !_keepVehicleCentered allowVehicleLocationCenter: !_keepVehicleCentered
planView: false planView: false
onVisibleChanged: {
// I don't know what is causing this to become invisible when a connection is dropped
if(!visible) visible = true
}
property alias scaleState: mapScale.state property alias scaleState: mapScale.state
// The following properties must be set by the consumer // The following properties must be set by the consumer
...@@ -190,7 +185,7 @@ FlightMap { ...@@ -190,7 +185,7 @@ FlightMap {
line.width: 3 line.width: 3
line.color: "red" line.color: "red"
z: QGroundControl.zOrderTrajectoryLines z: QGroundControl.zOrderTrajectoryLines
visible: true//mainIsMap visible: mainIsMap
Connections { Connections {
target: QGroundControl.multiVehicleManager target: QGroundControl.multiVehicleManager
...@@ -320,9 +315,9 @@ FlightMap { ...@@ -320,9 +315,9 @@ FlightMap {
property bool inGotoFlightMode: activeVehicle ? activeVehicle.flightMode === activeVehicle.gotoFlightMode : false property bool inGotoFlightMode: activeVehicle ? activeVehicle.flightMode === activeVehicle.gotoFlightMode : false
onInGotoFlightModeChanged: { onInGotoFlightModeChanged: {
if (!inGotoFlightMode && visible) { if (!inGotoFlightMode && gotoLocationItem.visible) {
// Hide goto indicator when vehicle falls out of guided mode // Hide goto indicator when vehicle falls out of guided mode
visible = false gotoLocationItem.visible = false
} }
} }
...@@ -330,7 +325,7 @@ FlightMap { ...@@ -330,7 +325,7 @@ FlightMap {
target: mainWindow target: mainWindow
onActiveVehicleChanged: { onActiveVehicleChanged: {
if (!activeVehicle) { if (!activeVehicle) {
visible = false gotoLocationItem.visible = false
} }
} }
} }
...@@ -368,7 +363,7 @@ FlightMap { ...@@ -368,7 +363,7 @@ FlightMap {
target: mainWindow target: mainWindow
onActiveVehicleChanged: { onActiveVehicleChanged: {
if (!activeVehicle) { if (!activeVehicle) {
visible = false orbitMapCircle.visible = false
} }
} }
} }
......
...@@ -50,7 +50,7 @@ Item { ...@@ -50,7 +50,7 @@ Item {
anchors.bottomMargin: 1 anchors.bottomMargin: 1
anchors.rightMargin: ScreenTools.defaultFontPixelWidth / 2 anchors.rightMargin: ScreenTools.defaultFontPixelWidth / 2
anchors.fill: parent anchors.fill: parent
spacing: ScreenTools.defaultFontPixelWidth * 2 spacing: ScreenTools.defaultFontPixelWidth / 2
ButtonGroup { ButtonGroup {
buttons: viewRow.children buttons: viewRow.children
......
...@@ -18,61 +18,49 @@ import QGroundControl.ScreenTools 1.0 ...@@ -18,61 +18,49 @@ import QGroundControl.ScreenTools 1.0
import QGroundControl.Palette 1.0 import QGroundControl.Palette 1.0
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
//-- Mode Indicator //-- Multiple Vehicle Selector
Item { QGCComboBox {
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
visible: _multiVehicles font.pointSize: ScreenTools.mediumFontPointSize
width: _multiVehicles ? multiVehicleSelector.width : 0 currentIndex: -1
sizeToContents: true
model: _vehicleModel
visible: _multipleVehicles
property bool _multiVehicles: activeVehicle ? QGroundControl.multiVehicleManager.vehicles.count > 1 : false property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _multipleVehicles: _activeVehicle ? QGroundControl.multiVehicleManager.vehicles.count > 1 : false
property var _vehicleModel: [ ]
Connections { Connections {
target: QGroundControl.multiVehicleManager.vehicles target: QGroundControl.multiVehicleManager.vehicles
onCountChanged: multiVehicleSelector.updatemultiVehiclesMenu() onCountChanged: _updateVehicleModel()
} }
QGCLabel { Component.onCompleted: _updateVehicleModel()
id: multiVehicleSelector
text: "Vehicle " + (activeVehicle ? activeVehicle.id : "None") function _updateVehicleModel() {
font.pointSize: ScreenTools.mediumFontPointSize var newCurrentIndex = -1
color: qgcPal.buttonText var newModel = [ ]
anchors.verticalCenter: parent.verticalCenter if (_multipleVehicles) {
QGCMenu { for (var i = 0; i < QGroundControl.multiVehicleManager.vehicles.count; i++) {
id: multiVehiclesMenu var vehicle = QGroundControl.multiVehicleManager.vehicles.get(i)
} newModel.push(qsTr("Vehicle") + " " + vehicle.id)
Component {
id: multiVehicleMenuItemComponent if (vehicle.id === _activeVehicle.id) {
QGCMenuItem { newCurrentIndex = i
onTriggered: QGroundControl.multiVehicleManager.activeVehicle = vehicle
property int vehicleId: Number(text.split(" ")[1])
property var vehicle: QGroundControl.multiVehicleManager.getVehicleById(vehicleId)
}
}
property var multiVehiclesMenuItems: []
function updatemultiVehiclesMenu() {
if (_multiVehicles) {
// Remove old menu items
for (var i = 0; i < multiVehiclesMenuItems.length; i++) {
multiVehiclesMenu.removeItem(multiVehiclesMenuItems[i])
}
multiVehiclesMenuItems.length = 0
// Add new items
for (i = 0; i < QGroundControl.multiVehicleManager.vehicles.count; i++) {
var vehicle = QGroundControl.multiVehicleManager.vehicles.get(i)
var menuItem = multiVehicleMenuItemComponent.createObject(null, { "text": "Vehicle " + vehicle.id })
multiVehiclesMenuItems.push(menuItem)
multiVehiclesMenu.insertItem(i, menuItem)
} }
} }
} }
Component.onCompleted: { currentIndex = -1
multiVehicleSelector.updatemultiVehiclesMenu() _vehicleModel = newModel
} currentIndex = newCurrentIndex
} }
MouseArea {
visible: _multiVehicles onActivated: {
anchors.fill: parent var vehicleId = textAt(index).split(" ")[1]
onClicked: multiVehiclesMenu.popup() var vehicle = QGroundControl.multiVehicleManager.getVehicleById(vehicleId)
QGroundControl.multiVehicleManager.activeVehicle = vehicle
} }
} }
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