Commit 92e043e7 authored by Pawel Spychalski (DzikuVx)'s avatar Pawel Spychalski (DzikuVx)
Browse files

Fix mixer wizard

parent 2b3ebd4e
This diff is collapsed.
......@@ -5,16 +5,6 @@ TABS.mixer = {};
TABS.mixer.initialize = function (callback, scrollPosition) {
function wizardSelectCompare(a, b) {
let aid = $(a).attr("data-motor"),
bid = $(a).attr("data-motor");
if (aid > bid) return 1;
if (bid > aid) return -1;
return 0;
}
let loadChainer = new MSPChainerClass(),
saveChainer = new MSPChainerClass(),
currentPlatform,
......@@ -326,27 +316,28 @@ TABS.mixer.initialize = function (callback, scrollPosition) {
MOTOR_RULES.flush();
const motorSelects = $(".wizard-motor-select").get();
motorSelects.sort(wizardSelectCompare);
for (let element in motorSelects) {
if (motorSelects.hasOwnProperty(element)) {
const $select = $(motorSelects[element]),
ruleToApply = $(':selected', $select).attr('id');
const r = currentMixerPreset.motorMixer[ruleToApply];
MOTOR_RULES.put(
new MotorMixRule(
r.getThrottle(),
r.getRoll(),
r.getPitch(),
r.getYaw()
)
);
for (let i = 0; i < 4; i++) {
const $selects = $(".wizard-motor-select");
let rule = -1;
}
};
$selects.each(function () {
if (parseInt($(this).find(":selected").attr("id"), 10) == i) {
rule = parseInt($(this).attr("data-motor"), 10);
}
});
const r = currentMixerPreset.motorMixer[rule];
MOTOR_RULES.put(
new MotorMixRule(
r.getThrottle(),
r.getRoll(),
r.getPitch(),
r.getYaw()
)
);
}
renderMotorMixRules();
renderOutputMapping();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment