1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +03:00

disable servo ui when its not necessary

This commit is contained in:
cTn 2013-12-08 20:19:49 +01:00
parent 66b7f31498
commit ac02c9ac5e
2 changed files with 40 additions and 21 deletions

View file

@ -121,26 +121,30 @@
</style>
<div class="tab-servos">
Model: <strong class="model"></strong>
<div class="title" style="width: 258px">Gyroscope / Accelerometer Direction</div>
<table class="directions" style="width: 260px">
<tr class="main">
<th style="width: 200px">Name</th>
<th>Direction</th>
</tr>
</table>
<div class="title">Change Direction in TX To Match</div>
<table class="fields">
<tr class="main">
<th>Name</th>
<th style="width: 70px">MID</th>
<th style="width: 70px">MIN</th>
<th style="width: 70px">MAX</th>
<th style="width: 320px">Throt | Roll | Pitch | Yaw | AUX1 | AUX2 | AUX3 | AUX4</th>
<th style="width: 200px">Direction</th>
</tr>
</table>
<div class="live">
<span>Enable Live mode: </span><input type="checkbox" />
<div class="supported_wrapper">
<div class="direction_wrapper">
<div class="title" style="width: 258px">Gyroscope / Accelerometer Direction</div>
<table class="directions" style="width: 260px">
<tr class="main">
<th style="width: 200px">Name</th>
<th>Direction</th>
</tr>
</table>
</div>
<div class="title">Change Direction in TX To Match</div>
<table class="fields">
<tr class="main">
<th>Name</th>
<th style="width: 70px">MID</th>
<th style="width: 70px">MIN</th>
<th style="width: 70px">MAX</th>
<th style="width: 320px">Throt | Roll | Pitch | Yaw | AUX1 | AUX2 | AUX3 | AUX4</th>
<th style="width: 200px">Direction</th>
</tr>
</table>
<div class="live">
<span>Enable Live mode: </span><input type="checkbox" />
</div>
<a class="update" href="#" title="">Save</a>
</div>
<a class="update" href="#" title="">Save</a>
</div>

View file

@ -47,6 +47,9 @@ function tab_initialize_servos() {
// rate
process_servos('Pitch Servo', '', 0, 2);
process_servos('Roll Servo', '', 1, 2);
// gyro / acc direction is not shown in this model
$('div.direction_wrapper').hide();
break;
case 8: // Flying Wing
// looking ok so far
@ -68,6 +71,9 @@ function tab_initialize_servos() {
process_servos('Wing 2', '', 4, 2);
process_servos('Rudd', '', 5, 2);
process_servos('Elev', '', 6, 2);
// gyro / acc direction is not shown in this model
$('div.direction_wrapper').hide();
break;
case 20: // Dualcopter
// looking ok so far
@ -87,6 +93,9 @@ function tab_initialize_servos() {
process_servos('Left', 'L YAW', 4, true);
process_servos('Front', 'F YAW', 5, true);
process_servos('Rear', 'YAW', 6, true);
// gyro / acc direction is not shown in this model
$('div.direction_wrapper').hide();
break;
default:
model.html('Doesn\'t support servos');
@ -100,6 +109,12 @@ function tab_initialize_servos() {
// rate
process_servos('Pitch Servo', '', 0, 2);
process_servos('Roll Servo', '', 1, 2);
// gyro / acc direction is not shown in this model
$('div.direction_wrapper').hide();
} else {
// disable UI
$('div.supported_wrapper').hide();
}
}