From d4a04c6469c4d0a59b3443b97388b0bb0b8e8c9d Mon Sep 17 00:00:00 2001 From: Willian Galvani Date: Fri, 26 Jun 2026 13:27:50 -0300 Subject: [PATCH 1/4] Frontend: diplay batteryfailsafecard with a warning if params missing --- .../configuration/failsafes/FailsafeCard.vue | 55 ++++++++++++++++--- .../configuration/failsafes/Failsafes.vue | 7 +++ .../configuration/failsafes/types.ts | 7 +++ 3 files changed, 61 insertions(+), 8 deletions(-) diff --git a/core/frontend/src/components/vehiclesetup/configuration/failsafes/FailsafeCard.vue b/core/frontend/src/components/vehiclesetup/configuration/failsafes/FailsafeCard.vue index 5639429acf..15d327c1c6 100644 --- a/core/frontend/src/components/vehiclesetup/configuration/failsafes/FailsafeCard.vue +++ b/core/frontend/src/components/vehiclesetup/configuration/failsafes/FailsafeCard.vue @@ -1,8 +1,11 @@ @@ -87,6 +99,22 @@ export default Vue.extend({ } return this.params[controlParam.name].value === 0 }, + dependency_unmet(): boolean { + const dep = this.failsafeDefinition.dependsOn + if (!dep) { + return false + } + // If the dependency parameter itself hasn't loaded yet, don't show a + // spurious notice; once params load, this re-evaluates to the truth. + const depParam = autopilot_data.parameters.find((p) => p.name === dep.paramName) + if (!depParam) { + return false + } + return depParam.value === dep.disabledValue + }, + dependency_message(): string { + return this.failsafeDefinition.dependsOn?.message ?? '' + }, actionParamName(): string | undefined { return this.findControlParam()?.name }, @@ -135,18 +163,20 @@ i.svg-icon svg { margin: auto; } -.disabled-failsafe { +.disabled-failsafe, +.unavailable-failsafe { border: 1px solid var(--v-warning-base) !important; position: relative; } -.disabled-failsafe:hover { +.disabled-failsafe:hover, +.unavailable-failsafe:hover { border-color: var(--v-warning-lighten1) !important; box-shadow: 0 2px 8px rgba(224, 166, 0, 0.2); } -.disabled-failsafe::after { - content: 'DISABLED'; +.disabled-failsafe::after, +.unavailable-failsafe::after { position: absolute; top: 8px; right: 8px; @@ -161,7 +191,16 @@ i.svg-icon svg { pointer-events: none; } -.disabled-failsafe .svg-icon { +.disabled-failsafe::after { + content: 'DISABLED'; +} + +.unavailable-failsafe::after { + content: 'UNAVAILABLE'; +} + +.disabled-failsafe .svg-icon, +.unavailable-failsafe .svg-icon { opacity: 0.7; filter: grayscale(30%); } diff --git a/core/frontend/src/components/vehiclesetup/configuration/failsafes/Failsafes.vue b/core/frontend/src/components/vehiclesetup/configuration/failsafes/Failsafes.vue index f7f24314cf..88458d4fa8 100644 --- a/core/frontend/src/components/vehiclesetup/configuration/failsafes/Failsafes.vue +++ b/core/frontend/src/components/vehiclesetup/configuration/failsafes/Failsafes.vue @@ -119,6 +119,13 @@ export default { generalDescription: 'Triggers when the voltage goes below specified thresholds.\n This can help to avoid ' + 'damage to the battery and potentially loss of the vehicle.', image: (await import('@/assets/img/configuration/failsafes/battery.svg')).default as string, + dependsOn: { + paramName: 'BATT_MONITOR', + disabledValue: 0, + message: 'Battery monitoring is disabled (BATT_MONITOR = 0). ' + + 'Enable a battery monitor on the Power configuration page ' + + 'to use the low-battery failsafe.', + }, params: [ // TODO: add support for the MAH params and coloumb counting { diff --git a/core/frontend/src/components/vehiclesetup/configuration/failsafes/types.ts b/core/frontend/src/components/vehiclesetup/configuration/failsafes/types.ts index c06b788f48..22487efc52 100644 --- a/core/frontend/src/components/vehiclesetup/configuration/failsafes/types.ts +++ b/core/frontend/src/components/vehiclesetup/configuration/failsafes/types.ts @@ -6,9 +6,16 @@ export interface ParamDefinitions { icon?: string } +export interface FailsafeDependency { + paramName: string, + disabledValue: number, + message: string, +} + export interface FailsafeDefinition { name: string, generalDescription: string, params: ParamDefinitions[], image: string, + dependsOn?: FailsafeDependency, } From 5e25fde4863c98a0e4a41b9fd7bbe944868c63fd Mon Sep 17 00:00:00 2001 From: Willian Galvani Date: Mon, 29 Jun 2026 13:10:04 -0300 Subject: [PATCH 2/4] Frontend: InlineParameterEditor: fix wrong setRebootRequired --- .../src/components/parameter-editor/InlineParameterEditor.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/frontend/src/components/parameter-editor/InlineParameterEditor.vue b/core/frontend/src/components/parameter-editor/InlineParameterEditor.vue index 2fea8b7b5d..882f5ffff4 100644 --- a/core/frontend/src/components/parameter-editor/InlineParameterEditor.vue +++ b/core/frontend/src/components/parameter-editor/InlineParameterEditor.vue @@ -306,7 +306,7 @@ export default Vue.extend({ return } if (this.param?.rebootRequired) { - autopilot_data.setRebootRequired(false) + autopilot_data.setRebootRequired(true) } this.last_sent_value = value mavlink2rest.setParam(this.param.name, value, autopilot_data.system_id, this.param.paramType.type) From a515c2ea98ae87db5b21526045d4223d721d516f Mon Sep 17 00:00:00 2001 From: Willian Galvani Date: Mon, 29 Jun 2026 13:10:54 -0300 Subject: [PATCH 3/4] Frontend: fix capacity/arming voltage being hidden when expanding advanced parameters --- .../configuration/power/BatteryCard.vue | 47 +++++++++---------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/core/frontend/src/components/vehiclesetup/configuration/power/BatteryCard.vue b/core/frontend/src/components/vehiclesetup/configuration/power/BatteryCard.vue index 30a0cdf172..9c0de73fd7 100644 --- a/core/frontend/src/components/vehiclesetup/configuration/power/BatteryCard.vue +++ b/core/frontend/src/components/vehiclesetup/configuration/power/BatteryCard.vue @@ -159,31 +159,30 @@ Adjust if the vehicle reports current draw when there is none flowing. - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + From 2822cd1d66d0556f871bdafc6992f9a021818194 Mon Sep 17 00:00:00 2001 From: Willian Galvani Date: Mon, 29 Jun 2026 13:57:19 -0300 Subject: [PATCH 4/4] Frontend: BatteryCard: show parameter labels when params are unavailable Display parameter labels and a transparent "not found" indicator even when the parameter is missing, gate the preset selector and editors on parameter availability, and surface a reboot note with a reboot button since enable parameters with rebootRequired can hide their dependent parameters until reboot. Co-authored-by: Cursor --- .../parameter-editor/ParameterLabel.vue | 27 ++++---- .../configuration/power/BatteryCard.vue | 65 ++++++++++++++++--- 2 files changed, 72 insertions(+), 20 deletions(-) diff --git a/core/frontend/src/components/parameter-editor/ParameterLabel.vue b/core/frontend/src/components/parameter-editor/ParameterLabel.vue index 7748e66bc7..cd906bd79d 100644 --- a/core/frontend/src/components/parameter-editor/ParameterLabel.vue +++ b/core/frontend/src/components/parameter-editor/ParameterLabel.vue @@ -1,24 +1,28 @@