Browse Source

Merge remote-tracking branch 'Mavlink/master' into uiTweaks

* Mavlink/master:
  Update PX4 param meta (#3304)
  0 is a valid RSSI value, use 255 to indicate unknown instead
  Vehicle: perform proper RSSI filter init
  RSSI indicator: Indicate full for 95 percent or greater
  Px4 usability (#3302)
QGC4.4
dogmaphobic 9 years ago
parent
commit
a2c8716b96
  1. 2
      src/AutoPilotPlugins/Common/RadioComponent.qml
  2. 2
      src/AutoPilotPlugins/PX4/CameraComponentSummary.qml
  3. 4
      src/AutoPilotPlugins/PX4/PowerComponent.qml
  4. 5
      src/AutoPilotPlugins/PX4/SafetyComponent.qml
  5. 881
      src/FirmwarePlugin/PX4/PX4ParameterFactMetaData.xml
  6. 12
      src/Vehicle/Vehicle.cc
  7. 13
      src/ui/QGCMapRCToParamDialog.cpp
  8. 22
      src/ui/QGCMapRCToParamDialog.ui
  9. 4
      src/ui/toolbar/MainToolBar.qml
  10. 2
      src/ui/toolbar/SignalStrength.qml

2
src/AutoPilotPlugins/Common/RadioComponent.qml

@ -469,7 +469,7 @@ QGCView { @@ -469,7 +469,7 @@ QGCView {
}
Repeater {
model: QGroundControl.multiVehicleManager.activeVehicle.px4Firmware ? [ "RC_MAP_FLAPS", "RC_MAP_AUX1", "RC_MAP_AUX2", "RC_MAP_AUX3" ] : 0
model: QGroundControl.multiVehicleManager.activeVehicle.px4Firmware ? [ "RC_MAP_FLAPS", "RC_MAP_AUX1", "RC_MAP_AUX2", "RC_MAP_PARAM1", "RC_MAP_PARAM2", "RC_MAP_PARAM3"] : 0
Row {
spacing: ScreenTools.defaultFontPixelWidth

2
src/AutoPilotPlugins/PX4/CameraComponentSummary.qml

@ -14,7 +14,7 @@ FactPanel { @@ -14,7 +14,7 @@ FactPanel {
QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
FactPanelController { id: controller; factPanel: panel }
property Fact _camTriggerMode: controller.getParameterFact(-1, "TRIG_MODE")
property Fact _camTriggerMode: controller.getParameterFact(-1, "TRIG_MODE", false)
property Fact _camTriggerPol: controller.getParameterFact(-1, "TRIG_POLARITY", false) // Don't bitch about missing as these only exist if trigger mode is enabled
property Fact _auxPins: controller.getParameterFact(-1, "TRIG_PINS", false) // Ditto
property Fact _timeInterval: controller.getParameterFact(-1, "TRIG_INTERVAL", false) // Ditto

4
src/AutoPilotPlugins/PX4/PowerComponent.qml

@ -46,6 +46,7 @@ QGCView { @@ -46,6 +46,7 @@ QGCView {
property Fact battHighVolt: controller.getParameterFact(-1, "BAT_V_CHARGED")
property Fact battLowVolt: controller.getParameterFact(-1, "BAT_V_EMPTY")
property Fact battVoltLoadDrop: controller.getParameterFact(-1, "BAT_V_LOAD_DROP")
property Fact uavcanEnable: controller.getParameterFact(-1, "UAVCAN_ENABLE", false)
readonly property string highlightPrefix: "<font color=\"" + qgcPal.warningText + "\">"
readonly property string highlightSuffix: "</font>"
@ -270,6 +271,7 @@ QGCView { @@ -270,6 +271,7 @@ QGCView {
QGCCheckBox {
id: showUAVCAN
text: qsTr("Show UAVCAN Settings")
visible: uavcanEnable !== -1
}
QGCLabel {
@ -294,7 +296,7 @@ QGCView { @@ -294,7 +296,7 @@ QGCView {
FactCheckBox {
id: uavcanEnabledCheckBox
width: ScreenTools.defaultFontPixelWidth * 20
fact: controller.getParameterFact(-1, "UAVCAN_ENABLE")
fact: _uavcanEnabled
checkedValue: 3
uncheckedValue: 0
text: qsTr("Enable UAVCAN as the default MAIN output bus (requires autopilot restart)")

5
src/AutoPilotPlugins/PX4/SafetyComponent.qml

@ -55,6 +55,7 @@ QGCView { @@ -55,6 +55,7 @@ QGCView {
property Fact _rcLossAction: controller.getParameterFact(-1, "NAV_RCL_ACT")
property Fact _dlLossAction: controller.getParameterFact(-1, "NAV_DLL_ACT")
property Fact _disarmLandDelay: controller.getParameterFact(-1, "COM_DISARM_LAND")
property Fact _landSpeedMC: controller.getParameterFact(-1, "MPC_LAND_SPEED", false)
QGCViewPanel {
id: panel
@ -483,7 +484,7 @@ QGCView { @@ -483,7 +484,7 @@ QGCView {
spacing: _margins * 0.5
anchors.verticalCenter: parent.verticalCenter
Row {
visible: !controller.fixedWing
visible: _landSpeedMC !== -1
QGCLabel {
anchors.baseline: landVelField.baseline
width: _middleRowWidth
@ -491,7 +492,7 @@ QGCView { @@ -491,7 +492,7 @@ QGCView {
}
FactTextField {
id: landVelField
fact: controller.getParameterFact(-1, "MPC_LAND_SPEED")
fact: _landSpeedMC
showUnits: true
width: _editFieldWidth
}

881
src/FirmwarePlugin/PX4/PX4ParameterFactMetaData.xml

File diff suppressed because it is too large Load Diff

12
src/Vehicle/Vehicle.cc

@ -99,8 +99,8 @@ Vehicle::Vehicle(LinkInterface* link, @@ -99,8 +99,8 @@ Vehicle::Vehicle(LinkInterface* link,
, _navigationTargetBearing(0.0f)
, _refreshTimer(new QTimer(this))
, _updateCount(0)
, _rcRSSI(0)
, _rcRSSIstore(100.0)
, _rcRSSI(255)
, _rcRSSIstore(255)
, _autoDisconnect(false)
, _flying(false)
, _connectionLost(false)
@ -270,8 +270,8 @@ Vehicle::Vehicle(QObject* parent) @@ -270,8 +270,8 @@ Vehicle::Vehicle(QObject* parent)
, _navigationTargetBearing(0.0f)
, _refreshTimer(new QTimer(this))
, _updateCount(0)
, _rcRSSI(0)
, _rcRSSIstore(100.0)
, _rcRSSI(255)
, _rcRSSIstore(255)
, _autoDisconnect(false)
, _connectionLost(false)
, _connectionLostEnabled(true)
@ -1336,6 +1336,10 @@ void Vehicle::_imageReady(UASInterface*) @@ -1336,6 +1336,10 @@ void Vehicle::_imageReady(UASInterface*)
void Vehicle::_remoteControlRSSIChanged(uint8_t rssi)
{
if (_rcRSSIstore < 0 || _rcRSSIstore > 100) {
_rcRSSIstore = rssi;
}
// Low pass to git rid of jitter
_rcRSSIstore = (_rcRSSIstore * 0.9f) + ((float)rssi * 0.1);
uint8_t filteredRSSI = (uint8_t)ceil(_rcRSSIstore);

13
src/ui/QGCMapRCToParamDialog.cpp

@ -42,16 +42,21 @@ QGCMapRCToParamDialog::QGCMapRCToParamDialog(QString param_id, UASInterface *mav @@ -42,16 +42,21 @@ QGCMapRCToParamDialog::QGCMapRCToParamDialog(QString param_id, UASInterface *mav
{
ui->setupUi(this);
// refresh the parameter from onboard to make sure the current value is used
AutoPilotPlugin* autopilot = _multiVehicleManager->getVehicleById(mav->getUASID())->autopilotPlugin();
Q_ASSERT(autopilot);
Fact* paramFact = autopilot->getParameterFact(FactSystem::defaultComponentId, param_id);
ui->minValueDoubleSpinBox->setValue(paramFact->rawMin().toDouble());
ui->maxValueDoubleSpinBox->setValue(paramFact->rawMax().toDouble());
// only enable ok button when param was refreshed
QPushButton *okButton = ui->buttonBox->button(QDialogButtonBox::Ok);
okButton->setEnabled(false);
ui->paramIdLabel->setText(param_id);
// refresh the parameter from onboard to make sure the current value is used
AutoPilotPlugin* autopilot = _multiVehicleManager->getVehicleById(mav->getUASID())->autopilotPlugin();
Q_ASSERT(autopilot);
connect(autopilot->getParameterFact(FactSystem::defaultComponentId, param_id), &Fact::valueChanged, this, &QGCMapRCToParamDialog::_parameterUpdated);
connect(paramFact, &Fact::valueChanged, this, &QGCMapRCToParamDialog::_parameterUpdated);
autopilot->refreshParameter(FactSystem::defaultComponentId, param_id);
}

22
src/ui/QGCMapRCToParamDialog.ui

@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
<x>9</x>
<y>9</y>
<width>381</width>
<height>271</height>
<height>296</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout">
@ -52,7 +52,7 @@ @@ -52,7 +52,7 @@
<item row="1" column="0">
<widget class="QLabel" name="rcParamChannelInfoLabel">
<property name="text">
<string>RC-Parameter Channel (Knob No.)</string>
<string>Parameter Tuning ID</string>
</property>
</widget>
</item>
@ -81,13 +81,6 @@ @@ -81,13 +81,6 @@
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label2">
<property name="text">
<string>to</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="paramIdInfoLabel">
<property name="text">
@ -112,7 +105,7 @@ @@ -112,7 +105,7 @@
<item row="5" column="0">
<widget class="QLabel" name="scaleInfoLabel">
<property name="text">
<string>Scale</string>
<string>Scale (keep default)</string>
</property>
</widget>
</item>
@ -126,7 +119,7 @@ @@ -126,7 +119,7 @@
<item row="6" column="0">
<widget class="QLabel" name="value0InfoLabel">
<property name="text">
<string>Initial Value</string>
<string>Center value</string>
</property>
</widget>
</item>
@ -212,6 +205,13 @@ @@ -212,6 +205,13 @@
</property>
</spacer>
</item>
<item row="2" column="0" colspan="2">
<widget class="QLabel" name="label2">
<property name="text">
<string>Tuning IDs can be mapped to channels in the RC settings</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>

4
src/ui/toolbar/MainToolBar.qml

@ -314,14 +314,14 @@ Rectangle { @@ -314,14 +314,14 @@ Rectangle {
QGCLabel {
id: rssiLabel
text: activeVehicle ? (activeVehicle.rcRSSI > 0 ? qsTr("RC RSSI Status") : qsTr("RC RSSI Data Unavailable")) : qsTr("N/A", "No data avaliable")
text: activeVehicle ? (activeVehicle.rcRSSI != 255 ? qsTr("RC RSSI Status") : qsTr("RC RSSI Data Unavailable")) : qsTr("N/A", "No data avaliable")
font.weight:Font.DemiBold
anchors.horizontalCenter: parent.horizontalCenter
}
GridLayout {
id: rcrssiGrid
visible: activeVehicle && activeVehicle.rcRSSI > 0
visible: activeVehicle && activeVehicle.rcRSSI != 255
anchors.margins: ScreenTools.defaultFontPixelHeight
columnSpacing: ScreenTools.defaultFontPixelWidth
columns: 2

2
src/ui/toolbar/SignalStrength.qml

@ -51,7 +51,7 @@ Item { @@ -51,7 +51,7 @@ Item {
return "/qmlimages/Signal40.svg"
if (percent < 80)
return "/qmlimages/Signal60.svg"
if (percent < 100)
if (percent < 95)
return "/qmlimages/Signal80.svg"
return "/qmlimages/Signal100.svg"
}

Loading…
Cancel
Save