Commit bab4a3d2 authored by Pierre TILAK's avatar Pierre TILAK

Merge branch 'master' into MapProviders

parents b366823d 214529d9
......@@ -64,7 +64,6 @@ addons:
- libgstreamer-plugins-base1.0-dev
- libgstreamer1.0-0:amd64
- libgstreamer1.0-dev
- libsdl2-dev
- libudev-dev
- wget
......@@ -81,6 +80,11 @@ before_install:
export JOBS=$((`sysctl -n hw.ncpu`+1));
fi
# Linux needs sdl2 but not android
- if [ "${SPEC}" = "linux-g++-64" ]; then
sudo apt-get install -y libsdl2-dev;
fi
install:
# linux dependencies: qt
- if [ "${SPEC}" = "linux-g++-64" ]; then
......
......@@ -85,8 +85,11 @@ void CodingStyle::_methodWithManyArguments(QWidget* parent,
const QString& caption,
const QString& dir,
Options options1,
Options options2,
Options /* options2 */,
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...
}
......@@ -323,16 +323,16 @@ const QVariantList &FirmwarePlugin::toolBarIndicators(const Vehicle* vehicle)
//-- Default list of indicators for all vehicles.
if(_toolBarIndicatorList.size() == 0) {
_toolBarIndicatorList = QVariantList({
QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/MultiVehicleSelector.qml")),
QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/MessageIndicator.qml")),
QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/GPSIndicator.qml")),
QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/TelemetryRSSIIndicator.qml")),
QVariant::fromValue(QUrl::fromUserInput("qrc:/toolbar/RCRSSIIndicator.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/VTOLModeIndicator.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")),
});
}
......
......@@ -5713,8 +5713,8 @@ the setpoint will be capped to MPC_XY_VEL_MAX</short_desc>
<boolean />
</parameter>
<parameter default="0.0" name="THR_MDL_FAC" type="FLOAT">
<short_desc>Thrust to PWM 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>
<short_desc>Thrust to motor control signal model parameter</short_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>
<max>1.0</max>
</parameter>
......
......@@ -31,11 +31,6 @@ FlightMap {
allowVehicleLocationCenter: !_keepVehicleCentered
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
// The following properties must be set by the consumer
......@@ -190,7 +185,7 @@ FlightMap {
line.width: 3
line.color: "red"
z: QGroundControl.zOrderTrajectoryLines
visible: true//mainIsMap
visible: mainIsMap
Connections {
target: QGroundControl.multiVehicleManager
......@@ -320,9 +315,9 @@ FlightMap {
property bool inGotoFlightMode: activeVehicle ? activeVehicle.flightMode === activeVehicle.gotoFlightMode : false
onInGotoFlightModeChanged: {
if (!inGotoFlightMode && visible) {
if (!inGotoFlightMode && gotoLocationItem.visible) {
// Hide goto indicator when vehicle falls out of guided mode
visible = false
gotoLocationItem.visible = false
}
}
......@@ -330,7 +325,7 @@ FlightMap {
target: mainWindow
onActiveVehicleChanged: {
if (!activeVehicle) {
visible = false
gotoLocationItem.visible = false
}
}
}
......@@ -368,7 +363,7 @@ FlightMap {
target: mainWindow
onActiveVehicleChanged: {
if (!activeVehicle) {
visible = false
orbitMapCircle.visible = false
}
}
}
......
......@@ -50,7 +50,7 @@ Item {
anchors.bottomMargin: 1
anchors.rightMargin: ScreenTools.defaultFontPixelWidth / 2
anchors.fill: parent
spacing: ScreenTools.defaultFontPixelWidth * 2
spacing: ScreenTools.defaultFontPixelWidth / 2
ButtonGroup {
buttons: viewRow.children
......
......@@ -18,61 +18,49 @@ import QGroundControl.ScreenTools 1.0
import QGroundControl.Palette 1.0
//-------------------------------------------------------------------------
//-- Mode Indicator
Item {
//-- Multiple Vehicle Selector
QGCComboBox {
anchors.top: parent.top
anchors.bottom: parent.bottom
visible: _multiVehicles
width: _multiVehicles ? multiVehicleSelector.width : 0
font.pointSize: ScreenTools.mediumFontPointSize
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 {
target: QGroundControl.multiVehicleManager.vehicles
onCountChanged: multiVehicleSelector.updatemultiVehiclesMenu()
onCountChanged: _updateVehicleModel()
}
QGCLabel {
id: multiVehicleSelector
text: "Vehicle " + (activeVehicle ? activeVehicle.id : "None")
font.pointSize: ScreenTools.mediumFontPointSize
color: qgcPal.buttonText
anchors.verticalCenter: parent.verticalCenter
QGCMenu {
id: multiVehiclesMenu
}
Component {
id: multiVehicleMenuItemComponent
QGCMenuItem {
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: _updateVehicleModel()
function _updateVehicleModel() {
var newCurrentIndex = -1
var newModel = [ ]
if (_multipleVehicles) {
for (var i = 0; i < QGroundControl.multiVehicleManager.vehicles.count; i++) {
var vehicle = QGroundControl.multiVehicleManager.vehicles.get(i)
newModel.push(qsTr("Vehicle") + " " + vehicle.id)
if (vehicle.id === _activeVehicle.id) {
newCurrentIndex = i
}
}
}
Component.onCompleted: {
multiVehicleSelector.updatemultiVehiclesMenu()
}
currentIndex = -1
_vehicleModel = newModel
currentIndex = newCurrentIndex
}
MouseArea {
visible: _multiVehicles
anchors.fill: parent
onClicked: multiVehiclesMenu.popup()
onActivated: {
var vehicleId = textAt(index).split(" ")[1]
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