mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-24 00:35:39 +03:00
makes no sense at all
This commit is contained in:
parent
00d3833454
commit
d2b1c3553e
2 changed files with 57 additions and 38 deletions
|
@ -33,19 +33,37 @@
|
||||||
|
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
.tab-servos table input[type="checkbox"]:first-child {
|
.tab-servos table .channel input[type="checkbox"]:first-child {
|
||||||
margin-left: 24px;
|
margin-left: 24px;
|
||||||
}
|
}
|
||||||
.tab-servos table input[type="checkbox"] {
|
.tab-servos table .channel input[type="checkbox"] {
|
||||||
margin-top: 4px;
|
margin-top: 4px;
|
||||||
margin-right: 21px;
|
margin-right: 21px;
|
||||||
}
|
}
|
||||||
.tab-servos table select {
|
.tab-servos table .direction {
|
||||||
margin-right: 1px;
|
|
||||||
width: 99px;
|
|
||||||
|
|
||||||
text-align: center;
|
|
||||||
}
|
}
|
||||||
|
.tab-servos .direction .name {
|
||||||
|
float: left;
|
||||||
|
display: block;
|
||||||
|
|
||||||
|
width: 60px;
|
||||||
|
}
|
||||||
|
.tab-servos .direction .alternate {
|
||||||
|
float: left;
|
||||||
|
display: block;
|
||||||
|
|
||||||
|
width: 60px;
|
||||||
|
}
|
||||||
|
.tab-servos .direction .first {
|
||||||
|
float: left;
|
||||||
|
|
||||||
|
margin: 2px 10px 0 20px;
|
||||||
|
}
|
||||||
|
.tab-servos .direction .second {
|
||||||
|
float: left;
|
||||||
|
|
||||||
|
margin: 2px 10px 0 0;
|
||||||
|
}
|
||||||
.tab-servos .update {
|
.tab-servos .update {
|
||||||
display: block;
|
display: block;
|
||||||
float: right;
|
float: right;
|
||||||
|
@ -78,7 +96,7 @@
|
||||||
<th style="width: 70px">MIN</th>
|
<th style="width: 70px">MIN</th>
|
||||||
<th style="width: 70px">MAX</th>
|
<th style="width: 70px">MAX</th>
|
||||||
<th style="width: 320px">Throt | Roll | Pitch | Yaw | AUX1 | AUX2 | AUX3 | AUX4</th>
|
<th style="width: 320px">Throt | Roll | Pitch | Yaw | AUX1 | AUX2 | AUX3 | AUX4</th>
|
||||||
<th style="width: 100px">Direction / Rate</th>
|
<th style="width: 200px">Direction</th>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<a class="update" href="#" title="">Save</a>
|
<a class="update" href="#" title="">Save</a>
|
||||||
|
|
|
@ -15,31 +15,31 @@ function tab_initialize_servos() {
|
||||||
case 1: // TRI
|
case 1: // TRI
|
||||||
model.html('TRI');
|
model.html('TRI');
|
||||||
|
|
||||||
process_servos('Rear', SERVO_CONFIG[5], 5);
|
process_servos('Rear', '', SERVO_CONFIG[5]);
|
||||||
|
|
||||||
servos = [5];
|
servos = [5];
|
||||||
break;
|
break;
|
||||||
case 4: // BI
|
case 4: // BI
|
||||||
model.html('BI');
|
model.html('BI');
|
||||||
|
|
||||||
process_servos('Left', SERVO_CONFIG[4], 4);
|
process_servos('Left', '', SERVO_CONFIG[4]);
|
||||||
process_servos('Right', SERVO_CONFIG[5], 5);
|
process_servos('Right', '', SERVO_CONFIG[5]);
|
||||||
|
|
||||||
servos = [4, 5];
|
servos = [4, 5];
|
||||||
break;
|
break;
|
||||||
case 5: // Gimbal
|
case 5: // Gimbal
|
||||||
model.html('Gimbal');
|
model.html('Gimbal');
|
||||||
|
|
||||||
process_servos('Pitch Servo', SERVO_CONFIG[0], 0);
|
process_servos('Pitch Servo', '', SERVO_CONFIG[0]);
|
||||||
process_servos('Roll Servo', SERVO_CONFIG[1], 1);
|
process_servos('Roll Servo', '', SERVO_CONFIG[1]);
|
||||||
|
|
||||||
servos = [0, 1];
|
servos = [0, 1];
|
||||||
break;
|
break;
|
||||||
case 8: // Flying Wing
|
case 8: // Flying Wing
|
||||||
model.html('Flying Wing');
|
model.html('Flying Wing');
|
||||||
|
|
||||||
process_servos('Left', SERVO_CONFIG[3], 3);
|
process_servos('L ROLL', 'R ROLL', SERVO_CONFIG[3]);
|
||||||
process_servos('Right', SERVO_CONFIG[4], 4);
|
process_servos('L NICK', 'R NICK', SERVO_CONFIG[4]);
|
||||||
|
|
||||||
servos = [3, 4];
|
servos = [3, 4];
|
||||||
break;
|
break;
|
||||||
|
@ -47,34 +47,35 @@ function tab_initialize_servos() {
|
||||||
model.html('Airplane');
|
model.html('Airplane');
|
||||||
|
|
||||||
// rate
|
// rate
|
||||||
process_servos('Wing 1', SERVO_CONFIG[3], 3);
|
process_servos('Wing 1', '', SERVO_CONFIG[3]);
|
||||||
process_servos('Wing 2', SERVO_CONFIG[4], 4);
|
process_servos('Wing 2', '', SERVO_CONFIG[4]);
|
||||||
process_servos('Rudd', SERVO_CONFIG[5], 5);
|
process_servos('Rudd', '', SERVO_CONFIG[5]);
|
||||||
process_servos('Elev', SERVO_CONFIG[6], 6);
|
process_servos('Elev', '', SERVO_CONFIG[6]);
|
||||||
process_servos('Thro', SERVO_CONFIG[7], 7);
|
process_servos('Thro', '', SERVO_CONFIG[7]);
|
||||||
|
|
||||||
servos = [2, 3, 4, 5, 6, 7];
|
servos = [2, 3, 4, 5, 6, 7];
|
||||||
break;
|
break;
|
||||||
case 20: // Dualcopter
|
case 20: // Dualcopter
|
||||||
|
// Broken
|
||||||
|
// Gyro / Acc direction: 4
|
||||||
|
// Roll: 5, Nick: 4
|
||||||
model.html('Dualcopter');
|
model.html('Dualcopter');
|
||||||
|
|
||||||
process_servos('Pitch', SERVO_CONFIG[4], 4);
|
process_servos('PITCH', 'ROLL', SERVO_CONFIG[4]);
|
||||||
process_servos('Roll', SERVO_CONFIG[5], 5);
|
process_servos('Roll', '', SERVO_CONFIG[5]);
|
||||||
process_servos('M 1', SERVO_CONFIG[6], 6);
|
|
||||||
process_servos('M 0', SERVO_CONFIG[7], 7);
|
|
||||||
|
|
||||||
servos = [4, 5, 6, 7];
|
servos = [4, 5];
|
||||||
break;
|
break;
|
||||||
case 21: // Singlecopter
|
case 21: // Singlecopter
|
||||||
|
// Verified
|
||||||
model.html('Singlecopter');
|
model.html('Singlecopter');
|
||||||
|
|
||||||
process_servos('Right', SERVO_CONFIG[3], 3);
|
process_servos('Right', 'R YAW', SERVO_CONFIG[3]);
|
||||||
process_servos('Left', SERVO_CONFIG[4], 4);
|
process_servos('Left', 'L YAW', SERVO_CONFIG[4]);
|
||||||
process_servos('Front', SERVO_CONFIG[5], 5);
|
process_servos('Front', 'F YAW', SERVO_CONFIG[5]);
|
||||||
process_servos('Rear', SERVO_CONFIG[6], 6);
|
process_servos('Rear', 'YAW', SERVO_CONFIG[6]);
|
||||||
process_servos('Motor', SERVO_CONFIG[7], 7);
|
|
||||||
|
|
||||||
servos = [3, 4, 5, 6, 7];
|
servos = [3, 4, 5, 6];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
model.html('Doesn\'t support servos');
|
model.html('Doesn\'t support servos');
|
||||||
|
@ -100,11 +101,11 @@ function tab_initialize_servos() {
|
||||||
|
|
||||||
var rate = 0;
|
var rate = 0;
|
||||||
if ($('.direction input:first', this).is(':checked')) {
|
if ($('.direction input:first', this).is(':checked')) {
|
||||||
rate |= 0x02;
|
rate |= 0x01;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($('.direction input:last', this).is(':checked')) {
|
if ($('.direction input:last', this).is(':checked')) {
|
||||||
rate |= 0x04;
|
rate |= 0x02;
|
||||||
}
|
}
|
||||||
|
|
||||||
SERVO_CONFIG[servos[0] + itter].rate = rate;
|
SERVO_CONFIG[servos[0] + itter].rate = rate;
|
||||||
|
@ -136,7 +137,7 @@ function tab_initialize_servos() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function process_servos(name, obj, pos) {
|
function process_servos(name, alternate, obj) {
|
||||||
$('div.tab-servos table.fields').append('\
|
$('div.tab-servos table.fields').append('\
|
||||||
<tr> \
|
<tr> \
|
||||||
<td style="text-align: center;">' + name + '</td>\
|
<td style="text-align: center;">' + name + '</td>\
|
||||||
|
@ -154,8 +155,8 @@ function process_servos(name, obj, pos) {
|
||||||
<input type="checkbox"/>\
|
<input type="checkbox"/>\
|
||||||
</td>\
|
</td>\
|
||||||
<td class="direction">\
|
<td class="direction">\
|
||||||
<input type="checkbox"/>\
|
<input class="first" type="checkbox"/><span class="name">' + name + '</span>\
|
||||||
<input type="checkbox"/>\
|
<input class="second" type="checkbox"/><span class="alternate">' + alternate + '</span>\
|
||||||
</td>\
|
</td>\
|
||||||
</tr> \
|
</tr> \
|
||||||
'
|
'
|
||||||
|
@ -166,8 +167,8 @@ function process_servos(name, obj, pos) {
|
||||||
$('div.tab-servos table.fields tr:last td.channel').find('input').eq(obj.middle).prop('checked', true);
|
$('div.tab-servos table.fields tr:last td.channel').find('input').eq(obj.middle).prop('checked', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
$('div.tab-servos table.fields tr:last td.direction input:first').prop('checked', bit_check(obj.rate, 1));
|
$('div.tab-servos table.fields tr:last td.direction input:first').prop('checked', bit_check(obj.rate, 0));
|
||||||
$('div.tab-servos table.fields tr:last td.direction input:last').prop('checked', bit_check(obj.rate, 2));
|
$('div.tab-servos table.fields tr:last td.direction input:last').prop('checked', bit_check(obj.rate, 1));
|
||||||
|
|
||||||
// UI hooks
|
// UI hooks
|
||||||
$('div.tab-servos table.fields tr:last td.channel').find('input').click(function() {
|
$('div.tab-servos table.fields tr:last td.channel').find('input').click(function() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue