1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-18 22:05:17 +03:00

change motor tab behavior/ui

fixes #26
This commit is contained in:
cTn 2014-02-22 22:02:07 +01:00
parent 0339f87d86
commit 6889c0c800
4 changed files with 7 additions and 32 deletions

View file

@ -218,8 +218,8 @@ GUI_control.prototype.tab_switch_cleanup = function(callback) {
var buffer_out = []; var buffer_out = [];
for (var i = 0; i < 8; i++) { for (var i = 0; i < 8; i++) {
buffer_out.push(lowByte(MISC.minthrottle)); buffer_out.push(lowByte(MISC.mincommand));
buffer_out.push(highByte(MISC.minthrottle)); buffer_out.push(highByte(MISC.mincommand));
} }
send_message(MSP_codes.MSP_SET_MOTOR, buffer_out, false, function() { send_message(MSP_codes.MSP_SET_MOTOR, buffer_out, false, function() {

View file

@ -69,17 +69,6 @@
border: 1px dotted silver; border: 1px dotted silver;
} }
.tab-motor_outputs .motor_testing .notice input[type="number"] {
margin: 0 10px 0 5px;
width: 45px;
height: 20px;
padding: 0 5px 0 5px;
line-height: 20px;
border: 1px solid silver;
}
.tab-motor_outputs .motor_testing .notice input[type="checkbox"] { .tab-motor_outputs .motor_testing .notice input[type="checkbox"] {
margin-left: 5px; margin-left: 5px;

View file

@ -81,9 +81,7 @@
In order to prevent injury <strong style="color: red">remove ALL propellers</strong> before using this feature.<br /> In order to prevent injury <strong style="color: red">remove ALL propellers</strong> before using this feature.<br />
If you understand these instructions check the <strong>box</strong> below to <strong style="color: green">enable</strong> motor test.<br /> If you understand these instructions check the <strong>box</strong> below to <strong style="color: green">enable</strong> motor test.<br />
<br /> <br />
Min: <input class="min" type="number" min="1000" max="2000" disabled="disabled" /> <label>Check: <input type="checkbox" /></label>
Max: <input class="max" type="number" min="1000" max="2000" disabled="disabled" />
Check: <input type="checkbox" />
</div> </div>
<div class="cler-both"></div> <div class="cler-both"></div>
</div> </div>

View file

@ -9,14 +9,14 @@ function tab_initialize_motor_outputs() {
$('div.motor_testing').show(); $('div.motor_testing').show();
} }
$('input.min').val(MISC.minthrottle); $('input.min').val(MISC.mincommand);
$('input.max').val(MISC.maxthrottle); $('input.max').val(MISC.maxthrottle);
$('div.sliders input').prop('min', MISC.minthrottle); $('div.sliders input').prop('min', MISC.mincommand);
$('div.sliders input').prop('max', MISC.maxthrottle); $('div.sliders input').prop('max', MISC.maxthrottle);
$('div.sliders input').val(MISC.minthrottle); $('div.sliders input').val(MISC.mincommand);
$('div.values li:not(:last)').html(MISC.minthrottle); $('div.values li:not(:last)').html(MISC.mincommand);
// UI hooks // UI hooks
$('div.sliders input:not(.master)').change(function() { $('div.sliders input:not(.master)').change(function() {
@ -60,18 +60,6 @@ function tab_initialize_motor_outputs() {
} }
}); });
$('div.notice input[type="number"]').change(function() {
var min = parseInt($('div.notice .min').val());
var max = parseInt($('div.notice .max').val());
$('div.sliders input').prop('min', min);
$('div.sliders input').prop('max', max);
// trigger change event so values are sent to mcu
$('div.sliders input').change();
});
// enable Motor data pulling // enable Motor data pulling
GUI.interval_add('motor_poll', function() { GUI.interval_add('motor_poll', function() {
// Request New data // Request New data