diff --git a/src/AutoPilotPlugins/Common/RadioComponent.qml b/src/AutoPilotPlugins/Common/RadioComponent.qml index 70dc08f0cfd94f115090793c35194bfa273506d7..291484f0a13953577b6a09d1e3d8d3c7988ffd84 100644 --- a/src/AutoPilotPlugins/Common/RadioComponent.qml +++ b/src/AutoPilotPlugins/Common/RadioComponent.qml @@ -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 diff --git a/src/AutoPilotPlugins/PX4/CameraComponentSummary.qml b/src/AutoPilotPlugins/PX4/CameraComponentSummary.qml index 79aa77724d626f4d2c5332ce7b6d9418aa0639ac..c0fcbdf6000497ed3b858d803d4be2008f5f20cb 100644 --- a/src/AutoPilotPlugins/PX4/CameraComponentSummary.qml +++ b/src/AutoPilotPlugins/PX4/CameraComponentSummary.qml @@ -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 diff --git a/src/AutoPilotPlugins/PX4/PowerComponent.qml b/src/AutoPilotPlugins/PX4/PowerComponent.qml index 6bd86cfbeee3798b92428ab901827b92f8e7f3ba..27e2a8abee153200417b4ad3ca4a0457cdcd7828 100644 --- a/src/AutoPilotPlugins/PX4/PowerComponent.qml +++ b/src/AutoPilotPlugins/PX4/PowerComponent.qml @@ -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: "" readonly property string highlightSuffix: "" @@ -270,6 +271,7 @@ QGCView { QGCCheckBox { id: showUAVCAN text: qsTr("Show UAVCAN Settings") + visible: uavcanEnable !== -1 } QGCLabel { @@ -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)") diff --git a/src/AutoPilotPlugins/PX4/SafetyComponent.qml b/src/AutoPilotPlugins/PX4/SafetyComponent.qml index cd27c1939cc74d27e468aa47103706778a5565f7..0c08fff5dd1916e866e85d56bf381e3fa4c77aa5 100644 --- a/src/AutoPilotPlugins/PX4/SafetyComponent.qml +++ b/src/AutoPilotPlugins/PX4/SafetyComponent.qml @@ -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 { 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 { } FactTextField { id: landVelField - fact: controller.getParameterFact(-1, "MPC_LAND_SPEED") + fact: _landSpeedMC showUnits: true width: _editFieldWidth } diff --git a/src/ui/QGCMapRCToParamDialog.cpp b/src/ui/QGCMapRCToParamDialog.cpp index e3a2dfff1c4560a64b775e8c6f53839ae6e317f3..7b8254fa5f2e7bd89a8bd8f5bbd8b9758a4300ac 100644 --- a/src/ui/QGCMapRCToParamDialog.cpp +++ b/src/ui/QGCMapRCToParamDialog.cpp @@ -41,17 +41,22 @@ QGCMapRCToParamDialog::QGCMapRCToParamDialog(QString param_id, UASInterface *mav , ui(new Ui::QGCMapRCToParamDialog) { 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); } diff --git a/src/ui/QGCMapRCToParamDialog.ui b/src/ui/QGCMapRCToParamDialog.ui index 8fde55314b79ea2913881056387b92e4fb62783d..f42c79ea2310d93b6a0457b3c68b549314e8ea23 100644 --- a/src/ui/QGCMapRCToParamDialog.ui +++ b/src/ui/QGCMapRCToParamDialog.ui @@ -35,7 +35,7 @@ 9 9 381 - 271 + 296 @@ -52,7 +52,7 @@ - RC-Parameter Channel (Knob No.) + Parameter Tuning ID @@ -81,13 +81,6 @@ - - - - to - - - @@ -112,7 +105,7 @@ - Scale + Scale (keep default) @@ -126,7 +119,7 @@ - Initial Value + Center value @@ -212,6 +205,13 @@ + + + + Tuning IDs can be mapped to channels in the RC settings + + +