Commit 91fd6ae8 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #3536 from DonLakeFlyer/Testing3.0Fixes

Testing 3.0 fixes
parents d3df08b7 95f9b8fb
......@@ -579,7 +579,11 @@ APMCompassCal::APMCompassCal(void)
APMCompassCal::~APMCompassCal()
{
if (_calWorkerThread) {
_calWorkerThread->terminate();
// deleteLater so it happens on correct thread
_calWorkerThread->deleteLater();
}
}
void APMCompassCal::setVehicle(Vehicle* vehicle)
......@@ -601,7 +605,7 @@ void APMCompassCal::startCalibration(void)
// Simulate a start message
_emitVehicleTextMessage("[cal] calibration started: mag");
_calWorkerThread = new CalWorkerThread(_vehicle, this);
_calWorkerThread = new CalWorkerThread(_vehicle);
connect(_calWorkerThread, &CalWorkerThread::vehicleTextMessage, this, &APMCompassCal::vehicleTextMessage);
// Clear the offset parameters so we get raw data
......
......@@ -169,6 +169,14 @@ QGCView {
}
}
Component.onCompleted: {
var usingUDP = controller.usingUDPLink()
if (usingUDP) {
console.log("onUsingUDPLink")
showMessage("Sensor Calibration", "Performing sensor calibration over a WiFi connection is known to be unreliable. You should disconnect and perform calibration using a direct USB connection instead.", StandardButton.Ok)
}
}
QGCPalette { id: qgcPal; colorGroupEnabled: panel.enabled }
Component {
......@@ -450,12 +458,17 @@ QGCView {
Flow {
anchors.topMargin: ScreenTools.defaultFontPixelWidth
anchors.top: orientationCalAreaHelpText.bottom
anchors.left: orientationCalAreaHelpText.left
width: parent.width
height: parent.height - orientationCalAreaHelpText.implicitHeight
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
spacing: ScreenTools.defaultFontPixelWidth
property real indicatorWidth: (width / 3) - (spacing * 2)
property real indicatorHeight: (height / 2) - spacing
VehicleRotationCal {
width: parent.indicatorWidth
height: parent.indicatorHeight
visible: controller.orientationCalDownSideVisible
calValid: controller.orientationCalDownSideDone
calInProgress: controller.orientationCalDownSideInProgress
......@@ -463,6 +476,8 @@ QGCView {
imageSource: controller.orientationCalDownSideRotate ? "qrc:///qmlimages/VehicleDownRotate.png" : "qrc:///qmlimages/VehicleDown.png"
}
VehicleRotationCal {
width: parent.indicatorWidth
height: parent.indicatorHeight
visible: controller.orientationCalUpsideDownSideVisible
calValid: controller.orientationCalUpsideDownSideDone
calInProgress: controller.orientationCalUpsideDownSideInProgress
......@@ -470,6 +485,8 @@ QGCView {
imageSource: controller.orientationCalUpsideDownSideRotate ? "qrc:///qmlimages/VehicleUpsideDownRotate.png" : "qrc:///qmlimages/VehicleUpsideDown.png"
}
VehicleRotationCal {
width: parent.indicatorWidth
height: parent.indicatorHeight
visible: controller.orientationCalNoseDownSideVisible
calValid: controller.orientationCalNoseDownSideDone
calInProgress: controller.orientationCalNoseDownSideInProgress
......@@ -477,6 +494,8 @@ QGCView {
imageSource: controller.orientationCalNoseDownSideRotate ? "qrc:///qmlimages/VehicleNoseDownRotate.png" : "qrc:///qmlimages/VehicleNoseDown.png"
}
VehicleRotationCal {
width: parent.indicatorWidth
height: parent.indicatorHeight
visible: controller.orientationCalTailDownSideVisible
calValid: controller.orientationCalTailDownSideDone
calInProgress: controller.orientationCalTailDownSideInProgress
......@@ -484,6 +503,8 @@ QGCView {
imageSource: controller.orientationCalTailDownSideRotate ? "qrc:///qmlimages/VehicleTailDownRotate.png" : "qrc:///qmlimages/VehicleTailDown.png"
}
VehicleRotationCal {
width: parent.indicatorWidth
height: parent.indicatorHeight
visible: controller.orientationCalLeftSideVisible
calValid: controller.orientationCalLeftSideDone
calInProgress: controller.orientationCalLeftSideInProgress
......@@ -491,6 +512,8 @@ QGCView {
imageSource: controller.orientationCalLeftSideRotate ? "qrc:///qmlimages/VehicleLeftRotate.png" : "qrc:///qmlimages/VehicleLeft.png"
}
VehicleRotationCal {
width: parent.indicatorWidth
height: parent.indicatorHeight
visible: controller.orientationCalRightSideVisible
calValid: controller.orientationCalRightSideDone
calInProgress: controller.orientationCalRightSideInProgress
......
......@@ -464,3 +464,8 @@ bool APMSensorsComponentController::accelSetupNeeded(void) const
{
return _sensorsComponent->accelSetupNeeded();
}
bool APMSensorsComponentController::usingUDPLink(void)
{
return _vehicle->priorityLink()->getLinkConfiguration()->type() == LinkConfiguration::TypeUdp;
}
......@@ -77,6 +77,7 @@ public:
Q_INVOKABLE void calibrateAccel(void);
Q_INVOKABLE void cancelCalibration(void);
Q_INVOKABLE void nextClicked(void);
Q_INVOKABLE bool usingUDPLink(void);
bool compassSetupNeeded(void) const;
bool accelSetupNeeded(void) const;
......
......@@ -51,6 +51,12 @@ void PX4SimpleFlightModesController::_rcChannelsChanged(int channelCount, int pw
}
int flightModeChannel = pFact->rawValue().toInt() - 1;
if (flightModeChannel == -1) {
// Flight mode channel not set, can't track active flight mode
_activeFlightMode = 0;
emit activeFlightModeChanged(_activeFlightMode);
return;
}
pFact = getParameterFact(-1, QString("RC%1_REV").arg(flightModeChannel + 1));
if(!pFact) {
......
......@@ -30,7 +30,7 @@ QGCView {
readonly property string boardRotationText: qsTr("If the orientation is in the direction of flight, select ROTATION_NONE.")
readonly property string compassRotationText: qsTr("If the orientation is in the direction of flight, select ROTATION_NONE.")
readonly property string compassHelp: qsTr("For Compass calibration you will need to rotate your vehicle through a number of positions. Most users prefer to do this wirelessly with the telemetry link.")
readonly property string compassHelp: qsTr("For Compass calibration you will need to rotate your vehicle through a number of positions.")
readonly property string gyroHelp: qsTr("For Gyroscope calibration you will need to place your vehicle on a surface and leave it still.")
readonly property string accelHelp: qsTr("For Accelerometer calibration you will need to place your vehicle on all six sides on a perfectly level surface and hold it still in each orientation for a few seconds.")
readonly property string levelHelp: qsTr("To level the horizon you need to place the vehicle in its level flight position and press OK.")
......@@ -160,8 +160,8 @@ QGCView {
}
Column {
anchors.fill: parent
spacing: 5
anchors.fill: parent
spacing: 5
QGCLabel {
width: parent.width
......@@ -170,17 +170,25 @@ QGCView {
}
QGCLabel {
id: boardRotationHelp
width: parent.width
wrapMode: Text.WordWrap
visible: (preCalibrationDialogType != "airspeed") && (preCalibrationDialogType != "gyro")
text: boardRotationText
}
FactComboBox {
width: rotationColumnWidth
model: rotations
visible: preCalibrationDialogType != "airspeed" && (preCalibrationDialogType != "gyro")
fact: sens_board_rot
Column {
visible: boardRotationHelp.visible
QGCLabel {
text: qsTr("Autopilot Orientation:")
}
FactComboBox {
id: boardRotationCombo
width: rotationColumnWidth;
model: rotations
fact: sens_board_rot
}
}
}
}
......@@ -454,8 +462,6 @@ QGCView {
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
width: parent.width
height: parent.height - orientationCalAreaHelpText.implicitHeight
spacing: ScreenTools.defaultFontPixelWidth / 2
property real indicatorWidth: (width / 3) - (spacing * 2)
......
......@@ -223,7 +223,7 @@ QGCView {
//-- Virtual Joystick
Loader {
id: multiTouchItem
id: virtualJoystickMultiTouch
z: _panel.z + 5
width: parent.width - (_flightVideoPipControl.width / 2)
height: Math.min(ScreenTools.availableHeight * 0.25, ScreenTools.defaultFontPixelWidth * 16)
......
......@@ -27,9 +27,11 @@ Item {
property alias guidedModeBar: _guidedModeBar
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _isSatellite: _mainIsMap ? (_flightMap ? _flightMap.isSatelliteMap : true) : true
property bool _lightWidgetBorders: _mainIsMap ? (_flightMap ? _flightMap.isSatelliteMap : true) : true
property var _activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
property bool _isSatellite: _mainIsMap ? (_flightMap ? _flightMap.isSatelliteMap : true) : true
property bool _lightWidgetBorders: _mainIsMap ? (_flightMap ? _flightMap.isSatelliteMap : true) : true
property bool _useAlternateInstruments: QGroundControl.virtualTabletJoystick || ScreenTools.isTinyScreen
readonly property real _margins: ScreenTools.defaultFontPixelHeight / 2
......@@ -69,7 +71,7 @@ Item {
QGCLabel {
anchors.horizontalCenter: parent.horizontalCenter
visible: _activeVehicle && !_activeVehicle.coordinateValid
visible: _activeVehicle && _activeVehicle.prearmError
z: QGroundControl.zOrderTopMost
color: mapPal.text
font.pointSize: ScreenTools.largeFontPointSize
......@@ -94,7 +96,7 @@ Item {
anchors.margins: ScreenTools.defaultFontPixelHeight / 2
anchors.right: altitudeSlider.visible ? altitudeSlider.left : parent.right
anchors.verticalCenter: parent.verticalCenter
visible: !QGroundControl.virtualTabletJoystick
visible: !_useAlternateInstruments
size: getGadgetWidth()
active: _activeVehicle != null
heading: _heading
......@@ -113,8 +115,8 @@ Item {
anchors.margins: ScreenTools.defaultFontPixelHeight / 2
anchors.top: parent.top
anchors.right: altitudeSlider.visible ? altitudeSlider.left : parent.right
visible: QGroundControl.virtualTabletJoystick
width: ScreenTools.isTinyScreen ? getGadgetWidth() * 2 : getGadgetWidth()
visible: _useAlternateInstruments
width: ScreenTools.isTinyScreen ? getGadgetWidth() * 1.5 : getGadgetWidth()
active: _activeVehicle != null
heading: _heading
rollAngle: _roll
......@@ -126,14 +128,14 @@ Item {
}
ValuesWidget {
anchors.topMargin: ScreenTools.defaultFontPixelHeight
anchors.top: instrumentGadgetAlternate.bottom
anchors.left: instrumentGadgetAlternate.left
width: getGadgetWidth()
qgcView: parent.parent.qgcView
textColor: _isSatellite ? "white" : "black"
visible: QGroundControl.virtualTabletJoystick
maxHeight: multiTouchItem.y - y
anchors.topMargin: ScreenTools.defaultFontPixelHeight
anchors.top: instrumentGadgetAlternate.bottom
anchors.horizontalCenter: instrumentGadgetAlternate.horizontalCenter
width: getGadgetWidth()
qgcView: parent.parent.qgcView
textColor: _isSatellite ? "white" : "black"
visible: _useAlternateInstruments
maxHeight: virtualJoystickMultiTouch.visible ? virtualJoystickMultiTouch.y - y : parent.height - anchors.margins - y
}
//-- Vertical Tool Buttons
......@@ -443,27 +445,31 @@ Item {
}
Row {
spacing: _margins
spacing: _margins * 2
QGCButton {
pointSize: ScreenTools.largeFontPointSize
text: (_activeVehicle && _activeVehicle.armed) ? (_activeVehicle.flying ? qsTr("Emergency Stop") : qsTr("Disarm")) : qsTr("Arm")
visible: _activeVehicle
onClicked: _guidedModeBar.confirmAction(_activeVehicle.armed ? (_activeVehicle.flying ? _guidedModeBar.confirmEmergencyStop : _guidedModeBar.confirmDisarm) : _guidedModeBar.confirmArm)
}
QGCButton {
pointSize: ScreenTools.largeFontPointSize
text: qsTr("RTL")
visible: (_activeVehicle && _activeVehicle.armed) && _activeVehicle.guidedModeSupported && _activeVehicle.flying
onClicked: _guidedModeBar.confirmAction(_guidedModeBar.confirmHome)
}
QGCButton {
pointSize: ScreenTools.largeFontPointSize
text: (_activeVehicle && _activeVehicle.flying) ? qsTr("Land"): qsTr("Takeoff")
visible: _activeVehicle && _activeVehicle.guidedModeSupported && _activeVehicle.armed
onClicked: _guidedModeBar.confirmAction(_activeVehicle.flying ? _guidedModeBar.confirmLand : _guidedModeBar.confirmTakeoff)
}
QGCButton {
pointSize: ScreenTools.largeFontPointSize
text: qsTr("Pause")
visible: (_activeVehicle && _activeVehicle.armed) && _activeVehicle.pauseVehicleSupported && _activeVehicle.flying
onClicked: {
......@@ -473,6 +479,7 @@ Item {
}
QGCButton {
pointSize: ScreenTools.largeFontPointSize
text: qsTr("Change Altitude")
visible: (_activeVehicle && _activeVehicle.flying) && _activeVehicle.guidedModeSupported && _activeVehicle.armed
onClicked: _guidedModeBar.confirmAction(_guidedModeBar.confirmChangeAlt)
......@@ -493,7 +500,7 @@ Item {
anchors.bottomMargin: _margins
anchors.bottom: parent.bottom
anchors.horizontalCenter: parent.horizontalCenter
height: ScreenTools.defaultFontPixelHeight * 3
height: _guidedModeBar.height
visible: false
z: QGroundControl.zOrderWidgets
......
......@@ -20,8 +20,6 @@
Q_DECLARE_LOGGING_CATEGORY(JoystickManagerLog)
class QGCApplicaiton;
class JoystickManager : public QGCTool
{
Q_OBJECT
......
......@@ -7,8 +7,8 @@ import QGroundControl.Palette 1.0
import QGroundControl.ScreenTools 1.0
Button {
property bool primary: false ///< primary button for a group of buttons
property bool primary: false ///< primary button for a group of buttons
property real pointSize: ScreenTools.defaultFontPointSize ///< Point size for button text
property var _qgcPal: QGCPalette { colorGroupEnabled: enabled }
property bool _showHighlight: (pressed | hovered | checked) && !__forceHoverOff
......@@ -102,7 +102,7 @@ Button {
id: text
antialiasing: true
text: control.text
font.pointSize: ScreenTools.defaultFontPointSize
font.pointSize: pointSize
font.family: ScreenTools.normalFontFamily
anchors.verticalCenter: parent.verticalCenter
color: _showHighlight ?
......
......@@ -23,10 +23,11 @@ Rectangle {
QGCPalette { id: qgcPal; colorGroupEnabled: true }
QGCLabel {
id: label
id: label
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
text: qsTr("Slide to %1").arg(confirmText)
font.pointSize: ScreenTools.largeFontPointSize
text: qsTr("Slide to %1").arg(confirmText)
}
Rectangle {
......
......@@ -1057,7 +1057,10 @@ void Vehicle::_loadSettings(void)
_joystickMode = JoystickModeRC;
}
_joystickEnabled = settings.value(_joystickEnabledSettingsKey, false).toBool();
// Joystick enabled is a global setting so first make sure there are any joysticks connected
if (qgcApp()->toolbox()->joystickManager()->joysticks().count()) {
_joystickEnabled = settings.value(_joystickEnabledSettingsKey, false).toBool();
}
}
void Vehicle::_saveSettings(void)
......
......@@ -244,10 +244,11 @@ QGCView {
}
QGCComboBox {
id: vehicleTypeSelectionCombo
width: 200
visible: apmFlightStack.checked
model: controller.apmAvailableVersions
id: vehicleTypeSelectionCombo
anchors.left: parent.left
anchors.right: parent.right
visible: apmFlightStack.checked
model: controller.apmAvailableVersions
}
Row {
......@@ -291,7 +292,8 @@ QGCView {
QGCComboBox {
id: firmwareVersionCombo
width: 200
anchors.left: parent.left
anchors.right: parent.right
visible: showFirmwareTypeSelection
model: px4Flow ? px4FlowTypeList : firmwareTypeList
currentIndex: controller.selectedFirmwareType
......
......@@ -173,7 +173,7 @@ Row {
visible: activeVehicle && !isNaN(activeVehicle.gps.hdop.value)
font.pointSize: ScreenTools.smallFontPointSize
color: qgcPal.buttonText
text: activeVehicle ? activeVehicle.gps.hdop.value.toFixed(0) : ""
text: activeVehicle ? activeVehicle.gps.hdop.value.toFixed(1) : ""
}
MouseArea {
anchors.fill: parent
......
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