diff --git a/resources/motor_order/quad_x.svg b/resources/motor_order/quad_x.svg index 9ad6c785..e34e8837 100644 --- a/resources/motor_order/quad_x.svg +++ b/resources/motor_order/quad_x.svg @@ -1,44 +1,121 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/resources/motor_order/quad_x_reverse.svg b/resources/motor_order/quad_x_reverse.svg index e8d03084..fd41f0aa 100644 --- a/resources/motor_order/quad_x_reverse.svg +++ b/resources/motor_order/quad_x_reverse.svg @@ -8,10 +8,9 @@ version="1.1" id="svg52" sodipodi:docname="quad_x_reverse.svg" - inkscape:version="1.1 (c68e22c387, 2021-05-23)" + inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" - xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg"> + inkscape:current-layer="g862" /> - - - - - - - - - - - -
- + +
1
+
2
+
3
+
4
@@ -254,4 +258,4 @@
- \ No newline at end of file + diff --git a/tabs/mixer.js b/tabs/mixer.js index 0cc125d8..85d1f262 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(); @@ -675,7 +715,7 @@ TABS.mixer.initialize = function (callback, scrollPosition) { } updateRefreshButtonStatus(); - + labelMotorNumbers(); updateMotorDirection(); });