Skip to content

Commit

Permalink
Don't show motor numbers for non-quad, do show onChange
Browse files Browse the repository at this point in the history
  • Loading branch information
sensei-hacker committed Nov 29, 2024
1 parent 2d685df commit 921a462
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
1 change: 1 addition & 0 deletions src/css/tabs/motors.css
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@
.tab-motors .motorNumber {
position: absolute;
font-size: 1.4em;
visibility: hidden;
}

.tab-motors .mixer-preview-image-numbers {
Expand Down
6 changes: 3 additions & 3 deletions tabs/mixer.js
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ TABS.mixer.initialize = function (callback, scrollPosition) {
$("#motorNumber"+index).css("left", left_px + "px");
$("#motorNumber"+index).css("top", top_px + "px");
$("#motorNumber"+index).removeClass("is-hidden");
$("#motorNumber"+index).css("visibility", "visible");
}
}
}
Expand Down Expand Up @@ -544,7 +545,7 @@ TABS.mixer.initialize = function (callback, scrollPosition) {
}

}
labelMotorNumbers();
labelMotorNumbers();
i18n.localize();;
}

Expand Down Expand Up @@ -610,7 +611,6 @@ TABS.mixer.initialize = function (callback, scrollPosition) {
}

}

return (errorCount == 0);
}

Expand Down Expand Up @@ -661,7 +661,7 @@ TABS.mixer.initialize = function (callback, scrollPosition) {
const path = './resources/motor_order/'
+ currentMixerPreset.image + (isReversed ? "_reverse" : "") + '.svg';
$('.mixerPreview img').attr('src', path);

// labelMotorNumbers();
renderServoOutputImage();
};

Expand Down
16 changes: 7 additions & 9 deletions tabs/outputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ TABS.outputs.initialize = function (callback) {
const path = './resources/motor_order/'
+ mixer.getById(val).image + (isReversed ? "_reverse" : "") + '.svg';
$('.mixerPreview img').attr('src', path);
labelMotorNumbers();
}

function process_servos() {
Expand Down Expand Up @@ -501,8 +502,6 @@ TABS.outputs.initialize = function (callback) {
$motorSliders.append('<div class="motor-slider-container"><input type="range" min="1000" max="2000" value="1000" disabled="disabled" class="master"/></div>');
$motorValues.append('<li style="font-weight: bold" data-i18n="motorsMaster"></li>');

labelMotorNumbers();

for (let i = 0; i < FC.SERVO_RULES.getServoCount(); i++) {

let opacity = "";
Expand Down Expand Up @@ -720,6 +719,12 @@ TABS.outputs.initialize = function (callback) {
}

function labelMotorNumbers() {

if (mixer.getById(FC.MIXER_CONFIG.appliedMixerPreset).image != 'quad_x') {
return;
}


let index = 0;
var rules = FC.MOTOR_RULES.get();

Expand All @@ -728,13 +733,6 @@ TABS.outputs.initialize = function (callback) {
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) {
Expand Down

0 comments on commit 921a462

Please sign in to comment.