Skip to content

Commit 3864cbb

Browse files
Disable motor stop feature when airmode is enabled (#4326)
* Hide motor stop when airmode is enable * Disable instead of hide * Add tooltip * Account for enabling MOTOR_STOP in cli * Style: Disabled switchery styling * Show real status of MOTOR_STOP * Add more opacity --------- Co-authored-by: VitroidFPV <76877124+VitroidFPV@users.noreply.github.com>
1 parent 1e49716 commit 3864cbb

File tree

4 files changed

+14
-4
lines changed

4 files changed

+14
-4
lines changed

locales/en/messages.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,6 +1266,9 @@
12661266
"featureMOTOR_STOP": {
12671267
"message": "Don't spin the motors when armed"
12681268
},
1269+
"featureMOTOR_STOPTip": {
1270+
"message": "This feature is disabled when AIRMODE is enabled"
1271+
},
12691272
"featureSERVO_TILT": {
12701273
"message": "Servo gimbal"
12711274
},

src/css/switchery_custom.less

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@
5555
}
5656
}
5757
.switchery-disabled {
58-
pointer-events: none;
59-
opacity: 0.3;
58+
opacity: 0.25;
59+
.switchery {
60+
cursor: not-allowed !important;
61+
}
6062
}

src/js/Features.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const Features = function (config) {
1111
{ bit: 0, group: "rxMode", mode: "select", name: "RX_PPM" },
1212
{ bit: 2, group: "other", name: "INFLIGHT_ACC_CAL" },
1313
{ bit: 3, group: "rxMode", mode: "select", name: "RX_SERIAL" },
14-
{ bit: 4, group: "escMotorStop", name: "MOTOR_STOP" },
14+
{ bit: 4, group: "escMotorStop", name: "MOTOR_STOP", haveTip: true },
1515
{ bit: 5, group: "other", name: "SERVO_TILT", haveTip: true, dependsOn: "SERVOS" },
1616
{ bit: 6, group: "other", name: "SOFTSERIAL", haveTip: true },
1717
{ bit: 7, group: "other", name: "GPS", haveTip: true, dependsOn: "GPS" },

src/js/tabs/motors.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,12 @@ motors.initialize = async function (callback) {
812812
$("div.checkboxDshotBidir").toggle(digitalProtocolConfigured);
813813
$("div.motorPoles").toggle(protocolConfigured && rpmFeaturesVisible);
814814

815-
$(".escMotorStop").toggle(protocolConfigured);
815+
$(".escMotorStop")
816+
.toggle(protocolConfigured)
817+
.find("input#feature4")
818+
.attr("disabled", FC.FEATURE_CONFIG.features.isEnabled("AIRMODE"))
819+
.parent()
820+
.toggleClass("switchery-disabled", FC.FEATURE_CONFIG.features.isEnabled("AIRMODE"));
816821

817822
$("#escProtocolDisabled").toggle(!protocolConfigured);
818823

0 commit comments

Comments
 (0)