mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-21 15:25:22 +03:00
Merge remote-tracking branch 'cleanflight/development' into new_stuff
# Conflicts: # _locales/en/messages.json # tabs/pid_tuning.html
This commit is contained in:
commit
13aac48a79
14 changed files with 261 additions and 36 deletions
|
@ -514,6 +514,21 @@
|
|||
"configurationBatteryMultiwiiCurrent": {
|
||||
"message": "Enable support for legacy Multiwii MSP current output"
|
||||
},
|
||||
"configuration3d": {
|
||||
"message": "3D"
|
||||
},
|
||||
"configuration3dDeadbandLow": {
|
||||
"message": "3D Deadband Low"
|
||||
},
|
||||
"configuration3dDeadbandHigh": {
|
||||
"message": "3D Deadband High"
|
||||
},
|
||||
"configuration3dNeutral": {
|
||||
"message": "3D Neutral"
|
||||
},
|
||||
"configuration3dDeadbandThrottle": {
|
||||
"message": "3D Deadband Throttle"
|
||||
},
|
||||
"configurationSystem": {
|
||||
"message": "System configuration"
|
||||
},
|
||||
|
@ -1203,6 +1218,30 @@
|
|||
"controlAxisAux8": {
|
||||
"message": "AUX 8"
|
||||
},
|
||||
"pidTuningBasic": {
|
||||
"message": "Basic/Acro"
|
||||
},
|
||||
"pidTuningLevel": {
|
||||
"message": "Angle/Horizon"
|
||||
},
|
||||
"pidTuningAltitude": {
|
||||
"message": "Barometer & Sonar/Altitude"
|
||||
},
|
||||
"pidTuningMag": {
|
||||
"message": "Magnometer/Heading"
|
||||
},
|
||||
"pidTuningGps": {
|
||||
"message": "GPS Navigation"
|
||||
},
|
||||
"pidTuningLevelP": {
|
||||
"message": "Strength (Angle)"
|
||||
},
|
||||
"pidTuningLevelI": {
|
||||
"message": "Strength (Horizon)"
|
||||
},
|
||||
"pidTuningLevelD": {
|
||||
"message": "Transition (Horizon)"
|
||||
},
|
||||
"pidHelp1": {
|
||||
"message": "The values below change the behaviour of the ANGLE and HORIZON flight modes. Different PID controllers handle the LEVEL values differently. Please check the documentation."
|
||||
},
|
||||
|
|
|
@ -11,7 +11,7 @@ function startApplication() {
|
|||
frame: 'chrome',
|
||||
innerBounds: {
|
||||
minWidth: 1024,
|
||||
minHeight: 700
|
||||
minHeight: 550
|
||||
}
|
||||
}, function (createdWindow) {
|
||||
createdWindow.contentWindow.addEventListener('load', function () {
|
||||
|
|
|
@ -165,6 +165,13 @@ var MISC = {
|
|||
vbatwarningcellvoltage: 0
|
||||
};
|
||||
|
||||
var _3D = {
|
||||
deadband3d_low: 0,
|
||||
deadband3d_high: 0,
|
||||
neutral3d: 0,
|
||||
deadband3d_throttle: 0
|
||||
};
|
||||
|
||||
var DATAFLASH = {
|
||||
ready: false,
|
||||
sectors: 0,
|
||||
|
|
23
js/msp.js
23
js/msp.js
|
@ -52,6 +52,7 @@ var MSP_codes = {
|
|||
MSP_WP: 118,
|
||||
MSP_BOXIDS: 119,
|
||||
MSP_SERVO_CONFIGURATIONS: 120,
|
||||
MSP_3D: 124,
|
||||
|
||||
MSP_SET_RAW_RC: 200,
|
||||
MSP_SET_RAW_GPS: 201,
|
||||
|
@ -67,6 +68,7 @@ var MSP_codes = {
|
|||
MSP_SET_HEAD: 211,
|
||||
MSP_SET_SERVO_CONFIGURATION: 212,
|
||||
MSP_SET_MOTOR: 214,
|
||||
MSP_SET_3D: 217,
|
||||
|
||||
// MSP_BIND: 240,
|
||||
|
||||
|
@ -409,6 +411,16 @@ var MSP = {
|
|||
MISC.vbatmaxcellvoltage = data.getUint8(offset++, 1) / 10; // 10-50
|
||||
MISC.vbatwarningcellvoltage = data.getUint8(offset++, 1) / 10; // 10-50
|
||||
break;
|
||||
case MSP_codes.MSP_3D:
|
||||
var offset = 0;
|
||||
_3D.deadband3d_low = data.getUint16(offset, 1);
|
||||
offset += 2;
|
||||
_3D.deadband3d_high = data.getUint16(offset, 1);
|
||||
offset += 2;
|
||||
_3D.neutral3d = data.getUint16(offset, 1);
|
||||
offset += 2;
|
||||
_3D.deadband3d_throttle = data.getUint16(offset, 1);
|
||||
break;
|
||||
case MSP_codes.MSP_MOTOR_PINS:
|
||||
console.log(data);
|
||||
break;
|
||||
|
@ -1130,6 +1142,17 @@ MSP.crunch = function (code) {
|
|||
}
|
||||
break;
|
||||
|
||||
case MSP_codes.MSP_SET_3D:
|
||||
buffer.push(lowByte(_3D.deadband3d_low));
|
||||
buffer.push(highByte(_3D.deadband3d_low));
|
||||
buffer.push(lowByte(_3D.deadband3d_high));
|
||||
buffer.push(highByte(_3D.deadband3d_high));
|
||||
buffer.push(lowByte(_3D.neutral3d));
|
||||
buffer.push(highByte(_3D.neutral3d));
|
||||
buffer.push(lowByte(_3D.deadband3d_throttle));
|
||||
buffer.push(highByte(_3D.deadband3d_throttle));
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
|
18
main.css
18
main.css
|
@ -491,6 +491,13 @@ input[type="number"]::-webkit-inner-spin-button {
|
|||
background-color: #2e2e2e;
|
||||
}
|
||||
|
||||
.tab_container.logopen {
|
||||
height: calc(100% - 235px);
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
|
||||
#tabs {
|
||||
font-size: 13px;
|
||||
}
|
||||
|
@ -502,7 +509,6 @@ input[type="number"]::-webkit-inner-spin-button {
|
|||
|
||||
#tabs.logopen ul {
|
||||
/* Cause the height to shrink to contain its floated contents while log is open */
|
||||
|
||||
}
|
||||
|
||||
.header-wrapper .mode-connected {
|
||||
|
@ -1329,6 +1335,7 @@ dialog {
|
|||
font-size: 10px;
|
||||
}
|
||||
|
||||
|
||||
.fixfalse {
|
||||
background-color: #e60000;
|
||||
padding: 2px;
|
||||
|
@ -1539,3 +1546,12 @@ dialog {
|
|||
overflow-y: auto;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-height: 700px) , only screen and (max-device-height: 700px) {
|
||||
|
||||
.tab_container {
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
2
main.js
2
main.js
|
@ -376,7 +376,7 @@ $("#showlog").on('click', function() {
|
|||
$("#log").animate({height: 111}, 200);
|
||||
$("#log").addClass('active');
|
||||
$("#content").addClass('logopen');
|
||||
$("#tabs").addClass('logopen');
|
||||
$(".tab_container").addClass('logopen');
|
||||
$("#scrollicon").addClass('active');
|
||||
|
||||
state = true;
|
||||
|
|
|
@ -393,6 +393,35 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="leftWrapper 3d">
|
||||
<div class="gui_box grey">
|
||||
<div class="gui_box_titlebar">
|
||||
<div class="spacer_box_title" i18n="configuration3d"></div>
|
||||
</div>
|
||||
<div class="spacer_box">
|
||||
<div class="number">
|
||||
<label> <input type="number" name="3ddeadbandlow" step="1" min="1000" max="2000" /> <span
|
||||
i18n="configuration3dDeadbandLow"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="number">
|
||||
<label> <input type="number" name="3ddeadbandhigh" step="1" min="1000" max="2000" /> <span
|
||||
i18n="configuration3dDeadbandHigh"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="number">
|
||||
<label> <input type="number" name="3dneutral" step="1" min="1000" max="2000" /> <span
|
||||
i18n="configuration3dNeutral"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="number">
|
||||
<label> <input type="number" name="3ddeadbandthrottle" step="1" min="0" max="1000" /> <span
|
||||
i18n="configuration3dDeadbandThrottle"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clear-both"></div>
|
||||
</div>
|
||||
<div class="content_toolbar">
|
||||
|
|
|
@ -27,7 +27,11 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
|||
}
|
||||
|
||||
function load_misc() {
|
||||
MSP.send_message(MSP_codes.MSP_MISC, false, false, load_acc_trim);
|
||||
MSP.send_message(MSP_codes.MSP_MISC, false, false, load_3d);
|
||||
}
|
||||
|
||||
function load_3d() {
|
||||
MSP.send_message(MSP_codes.MSP_3D, false, false, load_acc_trim);
|
||||
}
|
||||
|
||||
function load_acc_trim() {
|
||||
|
@ -313,6 +317,11 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
|||
$('input[name="currentoffset"]').val(BF_CONFIG.currentoffset);
|
||||
$('input[name="multiwiicurrentoutput"]').prop('checked', MISC.multiwiicurrentoutput);
|
||||
|
||||
//fill 3D
|
||||
$('input[name="3ddeadbandlow"]').val(_3D.deadband3d_low);
|
||||
$('input[name="3ddeadbandhigh"]').val(_3D.deadband3d_high);
|
||||
$('input[name="3dneutral"]').val(_3D.neutral3d);
|
||||
$('input[name="3ddeadbandthrottle"]').val(_3D.deadband3d_throttle);
|
||||
|
||||
// UI hooks
|
||||
$('input[name="looptime"]').change(function() {
|
||||
|
@ -389,6 +398,11 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
|||
BF_CONFIG.currentoffset = parseInt($('input[name="currentoffset"]').val());
|
||||
MISC.multiwiicurrentoutput = ~~$('input[name="multiwiicurrentoutput"]').is(':checked'); // ~~ boolean to decimal conversion
|
||||
|
||||
_3D.deadband3d_low = parseInt($('input[name="3ddeadbandlow"]').val());
|
||||
_3D.deadband3d_high = parseInt($('input[name="3ddeadbandhigh"]').val());
|
||||
_3D.neutral3d = parseInt($('input[name="3dneutral"]').val());
|
||||
_3D.deadband3d_throttle = ($('input[name="3ddeadbandthrottle"]').val());
|
||||
|
||||
function save_serial_config() {
|
||||
if (semver.lt(CONFIG.apiVersion, "1.6.0")) {
|
||||
MSP.send_message(MSP_codes.MSP_SET_CF_SERIAL_CONFIG, MSP.crunch(MSP_codes.MSP_SET_CF_SERIAL_CONFIG), false, save_misc);
|
||||
|
@ -398,7 +412,11 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
|
|||
}
|
||||
|
||||
function save_misc() {
|
||||
MSP.send_message(MSP_codes.MSP_SET_MISC, MSP.crunch(MSP_codes.MSP_SET_MISC), false, save_acc_trim);
|
||||
MSP.send_message(MSP_codes.MSP_SET_MISC, MSP.crunch(MSP_codes.MSP_SET_MISC), false, save_3d);
|
||||
}
|
||||
|
||||
function save_3d() {
|
||||
MSP.send_message(MSP_codes.MSP_SET_3D, MSP.crunch(MSP_codes.MSP_SET_3D), false, save_acc_trim);
|
||||
}
|
||||
|
||||
function save_acc_trim() {
|
||||
|
|
|
@ -124,8 +124,42 @@
|
|||
.tab-dataflash dialog .buttons {
|
||||
position: static;
|
||||
margin-top: 2em;
|
||||
overflow: hidden;
|
||||
width: auto;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.tab-dataflash .buttons a {
|
||||
margin-top: 9px;
|
||||
margin-bottom: 0px;
|
||||
margin-right: 10px;
|
||||
background-color: #59aa29;
|
||||
border-radius: 3px;
|
||||
border: 1px solid #4c8829;
|
||||
color: #fff;
|
||||
float: left;
|
||||
font-family: 'open_sansbold', Arial;
|
||||
font-size: 12px;
|
||||
text-shadow: 0px 1px rgba(0, 0, 0, 0.25);
|
||||
display: block;
|
||||
cursor: pointer;
|
||||
transition: all ease 0.2s;
|
||||
padding: 0px;
|
||||
padding-left: 9px;
|
||||
padding-right: 9px;
|
||||
line-height: 28px;
|
||||
}
|
||||
|
||||
.tab-dataflash .buttons a:hover {
|
||||
background-color: #6ac435;
|
||||
border: 1px solid #4d9324;
|
||||
text-shadow: 0px 1px rgba(0, 0, 0, 0.25);
|
||||
color: #fff;
|
||||
transition: all ease 0.2s;
|
||||
}
|
||||
|
||||
.tab-dataflash .buttons a:active {
|
||||
background-color: #4d9324;
|
||||
transition: all ease 0.0s;
|
||||
box-shadow: inset 0px 1px 5px rgba(0, 0, 0, 0.35);
|
||||
}
|
||||
|
||||
.tab-dataflash dialog h3 {
|
||||
|
|
|
@ -12,7 +12,15 @@ TABS.motors.initialize = function (callback) {
|
|||
}
|
||||
|
||||
function get_arm_status() {
|
||||
MSP.send_message(MSP_codes.MSP_STATUS, false, false, get_motor_data);
|
||||
MSP.send_message(MSP_codes.MSP_STATUS, false, false, load_config);
|
||||
}
|
||||
|
||||
function load_config() {
|
||||
MSP.send_message(MSP_codes.MSP_BF_CONFIG, false, false, load_3d);
|
||||
}
|
||||
|
||||
function load_3d() {
|
||||
MSP.send_message(MSP_codes.MSP_3D, false, false, get_motor_data);
|
||||
}
|
||||
|
||||
function update_arm_status() {
|
||||
|
@ -287,9 +295,14 @@ TABS.motors.initialize = function (callback) {
|
|||
|
||||
$('div.sliders input').prop('min', MISC.mincommand);
|
||||
$('div.sliders input').prop('max', MISC.maxthrottle);
|
||||
$('div.sliders input').val(MISC.mincommand);
|
||||
$('div.values li:not(:last)').text(MISC.mincommand);
|
||||
|
||||
if(bit_check(BF_CONFIG.features,12)){
|
||||
$('div.sliders input').val(_3D.neutral3d);
|
||||
}else{
|
||||
$('div.sliders input').val(MISC.mincommand);
|
||||
}
|
||||
|
||||
// UI hooks
|
||||
var buffering_set_motor = [],
|
||||
buffer_delay = false;
|
||||
|
@ -341,7 +354,11 @@ TABS.motors.initialize = function (callback) {
|
|||
$('div.sliders input').prop('disabled', true);
|
||||
|
||||
// change all values to default
|
||||
if (! bit_check(BF_CONFIG.features,12)) {
|
||||
$('div.sliders input').val(MISC.mincommand);
|
||||
} else {
|
||||
$('div.sliders input').val(_3D.neutral3d);
|
||||
}
|
||||
|
||||
// trigger change event so values are sent to mcu
|
||||
$('div.sliders input').trigger('input');
|
||||
|
@ -351,11 +368,18 @@ TABS.motors.initialize = function (callback) {
|
|||
// check if motors are already spinning
|
||||
var motors_running = false;
|
||||
|
||||
for (var i = 0; i < MOTOR_DATA.length; i++) {
|
||||
for (var i = 0; i < number_of_valid_outputs; i++) {
|
||||
if( ! bit_check(BF_CONFIG.features,12) ){
|
||||
if (MOTOR_DATA[i] > MISC.mincommand) {
|
||||
motors_running = true;
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
if( (MOTOR_DATA[i] < _3D.deadband3d_low) || (MOTOR_DATA[i] > _3D.deadband3d_high) ){
|
||||
motors_running = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (motors_running) {
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
<table id="pid_main" class="pid_tuning">
|
||||
<tr>
|
||||
<th colspan="4">
|
||||
<div class="pid_mode">Basic/Acro</div>
|
||||
<div class="pid_mode" i18n="pidTuningBasic"></div>
|
||||
</th>
|
||||
</tr>
|
||||
<tr class="ROLL">
|
||||
|
@ -67,7 +67,7 @@
|
|||
<table id="pid_baro" class="pid_tuning">
|
||||
<tr>
|
||||
<th colspan="4">
|
||||
<div class="pid_mode">Barometer & Sonar/Altitude</div>
|
||||
<div class="pid_mode" i18n="pidTuningAltitude"></div>
|
||||
</th>
|
||||
</tr>
|
||||
<tr class="ALT">
|
||||
|
@ -88,7 +88,7 @@
|
|||
<table id="pid_mag" class="pid_tuning">
|
||||
<tr>
|
||||
<th colspan="4">
|
||||
<div class="pid_mode">Magnometer/Heading</div>
|
||||
<div class="pid_mode" i18n="pidTuningMag"></div>
|
||||
</th>
|
||||
</tr>
|
||||
<tr class="MAG">
|
||||
|
@ -102,7 +102,7 @@
|
|||
<table id="pid_gps" class="pid_tuning">
|
||||
<tr>
|
||||
<th colspan="4">
|
||||
<div class="pid_mode">GPS Navigation</div>
|
||||
<div class="pid_mode" i18n="pidTuningGps"></div>
|
||||
</th>
|
||||
</tr>
|
||||
<tr class="Pos">
|
||||
|
@ -134,14 +134,14 @@
|
|||
<th colspan="4">
|
||||
<div class="pid_mode">
|
||||
<div style="width: 25%; float: left; text-align: left;">
|
||||
Angle/Horizon
|
||||
<div i18n="pidTuningLevel" style="float:left;"></div>
|
||||
<div class="helpicon cf_tip">
|
||||
<div class="cf_tooltiptext" i18n="pidHelp1" style="display: none;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width:25%; float:left;">Strength (Angle)</div>
|
||||
<div style="width:25%; float:left;">Strength (Horizon)</div>
|
||||
<div style="width:25%; float:left;">Transition (Horizon)</div>
|
||||
<div style="width:25%; float:left;" i18n="pidTuningLevelP"></div>
|
||||
<div style="width:25%; float:left;" i18n="pidTuningLevelI"></div>
|
||||
<div style="width:25%; float:left;" i18n="pidTuningLevelD"></div>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
|
|
|
@ -98,10 +98,44 @@ body {
|
|||
left: -65px;
|
||||
}
|
||||
|
||||
.button-enable {
|
||||
padding: 0.5em;
|
||||
font-size: 110%;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
display: block;
|
||||
a {
|
||||
text-decoration: none;
|
||||
color: #000;
|
||||
font-family: 'open_sanssemibold', Arial;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.button-enable a {
|
||||
/* common styles for content toolbar buttons */
|
||||
margin-top: 0px;
|
||||
margin-bottom: 0px;
|
||||
margin-left: 0px;
|
||||
background-color: #59aa29;
|
||||
border-radius: 3px;
|
||||
border: 1px solid #4c8829;
|
||||
color: #fff;
|
||||
float: left;
|
||||
font-family: 'open_sansbold', Arial;
|
||||
font-size: 12px;
|
||||
text-shadow: 0px 1px rgba(0, 0, 0, 0.25);
|
||||
display: block;
|
||||
cursor: pointer;
|
||||
transition: all ease 0.2s;
|
||||
padding: 0px;
|
||||
padding-left: 9px;
|
||||
padding-right: 9px;
|
||||
line-height: 28px;
|
||||
}
|
||||
|
||||
.button-enable a:hover {
|
||||
background-color: #6ac435;
|
||||
transition: all ease 0.2s;
|
||||
}
|
||||
.button-enable a:active {
|
||||
background-color: #4d9324;
|
||||
transition: all ease 0.0s;
|
||||
box-shadow: inset 0px 1px 5px rgba(0, 0, 0, 0.35);
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
<html>
|
||||
<head>
|
||||
<link type="text/css" rel="stylesheet" href="../css/opensans_webfontkit/fonts.css" media="all" />
|
||||
<script type="text/javascript" src="/js/libraries/jquery-2.1.4.min.js"></script>
|
||||
<script type="text/javascript" src="/js/libraries/jquery-ui-1.11.4.min.js"></script>
|
||||
<script type="text/javascript" src="/js/libraries/jquery.nouislider.all.min.js"></script>
|
||||
|
@ -56,7 +57,9 @@
|
|||
This feature does not guarantee reliable control of your craft. <strong>Serious injury is likely to
|
||||
result if propellers are left on.</strong>
|
||||
</p>
|
||||
<button class="button-enable" type="button">Enable controls</button>
|
||||
<div class="button-enable btn">
|
||||
<a class="button-enable" href="#">Enable controls</a>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -14,7 +14,6 @@
|
|||
border-radius: 5px;
|
||||
border: 1px solid #e4e4e4;
|
||||
margin-bottom: 10px;
|
||||
/* min-height:400px; */
|
||||
}
|
||||
|
||||
.attitude_info {
|
||||
|
@ -173,7 +172,6 @@
|
|||
#interactive_block {
|
||||
position: absolute;
|
||||
width: calc(75% - 20px);
|
||||
min-height: 300px;
|
||||
height: calc(100% - 218px);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue