-
-
+
+
+
@@ -44,7 +59,11 @@
-

+

+
1
+
2
+
3
+
4
-
\ No newline at end of file
+
diff --git a/tabs/mixer.js b/tabs/mixer.js
index bdf7c2be..bc82e83a 100644
--- a/tabs/mixer.js
+++ b/tabs/mixer.js
@@ -421,6 +421,45 @@ TABS.mixer.initialize = function (callback, scrollPosition) {
return (parseInt(weight) + 100) * 1000 / 200 + 1000;
}
+
+ function labelMotorNumbers() {
+
+ let index = 0;
+ var rules
+
+ if (currentMixerPreset.id == loadedMixerPresetID) {
+ rules = MOTOR_RULES.get();
+ } else {
+ rules = currentMixerPreset.motorMixer;
+ }
+
+ for (const i in rules) {
+ if (rules.hasOwnProperty(i)) {
+ const rule = rules[i];
+ index++;
+
+ if (currentMixerPreset.image != 'quad_x') {
+ $("#motorNumber"+index).css("visibility", "hidden");
+ continue;
+ }
+
+ let top_px = 30;
+ let left_px = 28;
+ if (rule.getRoll() < -0.5) {
+ left_px = $("#motor-mixer-preview-img").width() - 42;
+ }
+
+ if (rule.getPitch() > 0.5) {
+ top_px = $("#motor-mixer-preview-img").height() - 42;
+ }
+ $("#motorNumber"+index).css("left", left_px + "px");
+ $("#motorNumber"+index).css("top", top_px + "px");
+ $("#motorNumber"+index).css("visibility", "visible");
+ }
+ }
+ }
+
+
function renderMotorMixRules() {
/*
@@ -484,6 +523,7 @@ TABS.mixer.initialize = function (callback, scrollPosition) {
}
}
+ labelMotorNumbers();
localize();
}
@@ -591,7 +631,7 @@ TABS.mixer.initialize = function (callback, scrollPosition) {
r.getYaw()
)
);
-
+
}
renderMotorMixRules();
@@ -601,25 +641,17 @@ TABS.mixer.initialize = function (callback, scrollPosition) {
});
const updateMotorDirection = function () {
- let motorDirectionCheckbox = $("#motor_direction_inverted");
- const isReversed = motorDirectionCheckbox.is(":checked") && (MIXER_CONFIG.platformType == PLATFORM_MULTIROTOR || MIXER_CONFIG.platformType == PLATFORM_TRICOPTER);
+ let motorDirectionCheckbox = $('input[name=motor_direction_inverted]:checked');
+ const isReversed = motorDirectionCheckbox.val() == 1 && (MIXER_CONFIG.platformType == PLATFORM_MULTIROTOR || MIXER_CONFIG.platformType == PLATFORM_TRICOPTER);
const path = './resources/motor_order/'
+ currentMixerPreset.image + (isReversed ? "_reverse" : "") + '.svg';
$('.mixerPreview img').attr('src', path);
- if (MIXER_CONFIG.platformType == PLATFORM_MULTIROTOR || MIXER_CONFIG.platformType == PLATFORM_TRICOPTER) {
- if (isReversed) {
- motorDirectionCheckbox.parent().find("label span").html(chrome.i18n.getMessage("motor_direction_isInverted"));
- } else {
- motorDirectionCheckbox.parent().find("label span").html(chrome.i18n.getMessage("motor_direction_inverted"));
- }
- }
-
renderServoOutputImage();
};
- $("#motor_direction_inverted").change(updateMotorDirection);
+ $("input[name=motor_direction_inverted]").change(updateMotorDirection);
$platformSelect.find("*").remove();
@@ -675,7 +707,7 @@ TABS.mixer.initialize = function (callback, scrollPosition) {
}
updateRefreshButtonStatus();
-
+ labelMotorNumbers();
updateMotorDirection();
});
diff --git a/tabs/options.html b/tabs/options.html
index 1ef62632..af41f97a 100644
--- a/tabs/options.html
+++ b/tabs/options.html
@@ -20,6 +20,11 @@
+
+