mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-20 23:05:19 +03:00
added profile select in PID tab
This commit is contained in:
parent
ddee2f424b
commit
65555b224c
4 changed files with 51 additions and 5 deletions
|
@ -465,6 +465,7 @@ function process_data(code, message_buffer, message_length) {
|
||||||
send_message(MSP_codes.MSP_ACC_TRIM, MSP_codes.MSP_ACC_TRIM);
|
send_message(MSP_codes.MSP_ACC_TRIM, MSP_codes.MSP_ACC_TRIM);
|
||||||
break;
|
break;
|
||||||
case MSP_codes.MSP_SELECT_SETTING:
|
case MSP_codes.MSP_SELECT_SETTING:
|
||||||
|
console.log('Profile selected');
|
||||||
break;
|
break;
|
||||||
case MSP_codes.MSP_SET_SERVO_CONF:
|
case MSP_codes.MSP_SET_SERVO_CONF:
|
||||||
console.log('Servo Configuration saved');
|
console.log('Servo Configuration saved');
|
||||||
|
|
|
@ -39,6 +39,32 @@
|
||||||
padding: 0 5px 0 5px;
|
padding: 0 5px 0 5px;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
.tab-pid_tuning .profile {
|
||||||
|
float: left;
|
||||||
|
|
||||||
|
margin-top: 10px;
|
||||||
|
|
||||||
|
width: 70px;
|
||||||
|
|
||||||
|
border: 1px solid silver;
|
||||||
|
}
|
||||||
|
.tab-pid_tuning .profile .head {
|
||||||
|
display: block;
|
||||||
|
|
||||||
|
text-align: center;
|
||||||
|
line-height: 20px;
|
||||||
|
font-weight: bold;
|
||||||
|
|
||||||
|
border-bottom: 1px solid silver;
|
||||||
|
background-color: #ececec;
|
||||||
|
}
|
||||||
|
.tab-pid_tuning .profile input {
|
||||||
|
padding-left: 30px;
|
||||||
|
|
||||||
|
width: 40px;
|
||||||
|
height: 20px;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
.tab-pid_tuning .rate-tpa {
|
.tab-pid_tuning .rate-tpa {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,4 +78,9 @@
|
||||||
</table>
|
</table>
|
||||||
<a class="update" href="#">Save</a>
|
<a class="update" href="#">Save</a>
|
||||||
<a class="refresh" href="#">Refresh</a>
|
<a class="refresh" href="#">Refresh</a>
|
||||||
|
<div class="clear-both"></div>
|
||||||
|
<div class="profile">
|
||||||
|
<span class="head">Profile</span>
|
||||||
|
<input type="number" name="profile" min="1" max="3" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
|
@ -142,7 +142,21 @@ function tab_initialize_pid_tuning() {
|
||||||
$('.rate-tpa input[name="yaw"]').val(RC_tuning.yaw_rate.toFixed(2));
|
$('.rate-tpa input[name="yaw"]').val(RC_tuning.yaw_rate.toFixed(2));
|
||||||
$('.rate-tpa input[name="tpa"]').val(RC_tuning.dynamic_THR_PID.toFixed(2));
|
$('.rate-tpa input[name="tpa"]').val(RC_tuning.dynamic_THR_PID.toFixed(2));
|
||||||
|
|
||||||
|
// Fill in currently selected profile
|
||||||
|
$('input[name="profile"]').val(CONFIG.profile + 1); // +1 because the range is 0-2
|
||||||
|
|
||||||
// UI Hooks
|
// UI Hooks
|
||||||
|
$('input[name="profile"]').change(function() {
|
||||||
|
var profile = parseInt($(this).val());
|
||||||
|
send_message(MSP_codes.MSP_SELECT_SETTING, [profile - 1], false, function() {
|
||||||
|
GUI.log('Loaded Profile: <strong>' + profile + '</strong>');
|
||||||
|
|
||||||
|
GUI.tab_switch_cleanup(function() {
|
||||||
|
tab_initialize_pid_tuning();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
$('a.refresh').click(function() {
|
$('a.refresh').click(function() {
|
||||||
GUI.tab_switch_cleanup(function() {
|
GUI.tab_switch_cleanup(function() {
|
||||||
GUI.log('PID data <strong>refreshed</strong>');
|
GUI.log('PID data <strong>refreshed</strong>');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue