change motor tab behavior/ui

fixes #26
pull/3/head
cTn 11 years ago
parent 0339f87d86
commit 6889c0c800

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

@ -69,17 +69,6 @@
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"] {
margin-left: 5px;

@ -81,9 +81,7 @@
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 />
<br />
Min: <input class="min" type="number" min="1000" max="2000" disabled="disabled" />
Max: <input class="max" type="number" min="1000" max="2000" disabled="disabled" />
Check: <input type="checkbox" />
<label>Check: <input type="checkbox" /></label>
</div>
<div class="cler-both"></div>
</div>

@ -9,14 +9,14 @@ function tab_initialize_motor_outputs() {
$('div.motor_testing').show();
}
$('input.min').val(MISC.minthrottle);
$('input.min').val(MISC.mincommand);
$('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').val(MISC.minthrottle);
$('div.values li:not(:last)').html(MISC.minthrottle);
$('div.sliders input').val(MISC.mincommand);
$('div.values li:not(:last)').html(MISC.mincommand);
// UI hooks
$('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
GUI.interval_add('motor_poll', function() {
// Request New data

Loading…
Cancel
Save