Implement version checking part 3

10.3.x-maintenance
U-DESKTOP-12PPI61\boris.bozic 2016-06-25 01:27:32 +02:00
parent eaaebf86a7
commit 4f76835ce2
3 changed files with 48 additions and 30 deletions

View File

@ -160,6 +160,11 @@
margin-right: 5px; margin-right: 5px;
} }
.tab-configuration .disarm .checkboxPwm {
margin-top: 2px;
margin-right: 5px;
}
.tab-configuration .disarm .checkbox div { .tab-configuration .disarm .checkbox div {
margin-bottom: 0px; margin-bottom: 0px;
margin-top: 0px; margin-top: 0px;
@ -227,6 +232,26 @@
float: left; float: left;
} }
.tab-configuration .selectProtocol
{
margin-bottom: 5px;
clear: left;
padding-bottom: 5px;
border-bottom: 1px solid #ddd;
width: 100%;
float: left;
}
.tab-configuration .pidProcessDenom
{
margin-bottom: 5px;
clear: left;
padding-bottom: 5px;
border-bottom: 1px solid #ddd;
width: 100%;
float: left;
}
.tab-configuration .number:last-child, .tab-configuration .number:last-child,
.tab-configuration .select:last-child { .tab-configuration .select:last-child {
border-bottom: none; border-bottom: none;

View File

@ -32,7 +32,7 @@
<div class="spacer_box_title" i18n="configurationEscFeatures"></div> <div class="spacer_box_title" i18n="configurationEscFeatures"></div>
</div> </div>
<div class="spacer_box"> <div class="spacer_box">
<div class="select"> <div class="selectProtocol">
<label> <label>
<select class="escprotocol"> <select class="escprotocol">
<!-- list generated here --> <!-- list generated here -->
@ -41,7 +41,7 @@
</label> </label>
</div> </div>
<div class="checkbox" style="border-bottom: 1px solid #ddd; padding-bottom: 5px;"> <div class="checkboxPwm" style="border-bottom: 1px solid #ddd; padding-bottom: 5px;">
<div style="float: left; height: 20px; margin-right: 5px; margin-left: 3px;"> <div style="float: left; height: 20px; margin-right: 5px; margin-left: 3px;">
<input type="checkbox" name="unsyncedPWMSwitch" class="toggle" /> <input type="checkbox" name="unsyncedPWMSwitch" class="toggle" />
</div> </div>
@ -363,7 +363,7 @@
<span i18n="configurationGyroSyncDenom"></span> <span i18n="configurationGyroSyncDenom"></span>
</label> </label>
</div> </div>
<div class="select"> <div class="selectPidProcessDenom">
<label> <label>
<select class="pidProcessDenom"> <select class="pidProcessDenom">
<!-- list generated here --> <!-- list generated here -->

View File

@ -63,7 +63,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
function esc_protocol() { function esc_protocol() {
var next_callback = load_sensor_alignment; var next_callback = load_sensor_alignment;
if (semver.gte(CONFIG.apiVersion, "1.16.0")) { if (CONFIG.flightControllerIdentifier == "BTFL" && semver.gte(CONFIG.flightControllerVersion, "2.8.1")) {
MSP.send_message(MSP_codes.MSP_PID_ADVANCED_CONFIG, false, false, next_callback); MSP.send_message(MSP_codes.MSP_PID_ADVANCED_CONFIG, false, false, next_callback);
} else { } else {
next_callback(); next_callback();
@ -94,17 +94,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
} }
MSP.send_message(MSP_codes.MSP_IDENT, false, false, load_config); MSP.send_message(MSP_codes.MSP_IDENT, false, false, load_config);
function recalculate_cycles_sec() {
var looptime = $('input[name="looptime"]').val();
var message = 'Max';
if (looptime > 0) {
message = parseFloat((1 / looptime) * 1000 * 1000).toFixed(0);
}
$('input[name="looptimehz"]').val(message);
}
function process_html() { function process_html() {
@ -354,8 +343,13 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
$('select.pidProcessDenom option[value="'+(i+1)+'"]').text((pidF / 100).toString()+'KHz');} $('select.pidProcessDenom option[value="'+(i+1)+'"]').text((pidF / 100).toString()+'KHz');}
}); });
if (CONFIG.flightControllerIdentifier == "BTFL" && semver.lt(CONFIG.flightControllerVersion, "2.8.1")) {
$('.selectProtocol').hide();
$('.checkboxPwm').hide();
$('.selectPidProcessDenom').hide();
}
// generate GPS // generate GPS
var gpsProtocols = [ var gpsProtocols = [
'NMEA', 'NMEA',
@ -472,12 +466,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
$('div.disarmdelay').show(); $('div.disarmdelay').show();
else else
$('div.disarmdelay').hide(); $('div.disarmdelay').hide();
// fill FC loop time
$('input[name="looptime"]').val(FC_CONFIG.loopTime);
recalculate_cycles_sec();
$('div.cycles').show(); $('div.cycles').show();
} }
@ -512,11 +501,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
} }
} }
// UI hooks
$('input[name="looptime"]').change(function() {
recalculate_cycles_sec();
});
$('input[type="checkbox"].feature', features_e).change(function () { $('input[type="checkbox"].feature', features_e).change(function () {
var element = $(this), var element = $(this),
index = element.data('bit'), index = element.data('bit'),
@ -579,7 +563,6 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
if(semver.gte(CONFIG.apiVersion, "1.8.0")) { if(semver.gte(CONFIG.apiVersion, "1.8.0")) {
ARMING_CONFIG.auto_disarm_delay = parseInt($('input[name="autodisarmdelay"]').val()); ARMING_CONFIG.auto_disarm_delay = parseInt($('input[name="autodisarmdelay"]').val());
ARMING_CONFIG.disarm_kill_switch = ~~$('input[name="disarmkillswitch"]').is(':checked'); // ~~ boolean to decimal conversion ARMING_CONFIG.disarm_kill_switch = ~~$('input[name="disarmkillswitch"]').is(':checked'); // ~~ boolean to decimal conversion
FC_CONFIG.loopTime = parseInt($('input[name="looptime"]').val());
} }
MISC.minthrottle = parseInt($('input[name="minthrottle"]').val()); MISC.minthrottle = parseInt($('input[name="minthrottle"]').val());
@ -645,7 +628,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
} }
function save_esc_protocol() { function save_esc_protocol() {
var next_callback = save_acc_trim; var next_callback = save_acc_trim;
if(semver.gte(CONFIG.apiVersion, "1.16.0")) { if (CONFIG.flightControllerIdentifier == "BTFL" && semver.gte(CONFIG.flightControllerVersion, "2.8.1")) {
MSP.send_message(MSP_codes.MSP_SET_PID_ADVANCED_CONFIG, MSP.crunch(MSP_codes.MSP_SET_PID_ADVANCED_CONFIG), false, next_callback); MSP.send_message(MSP_codes.MSP_SET_PID_ADVANCED_CONFIG, MSP.crunch(MSP_codes.MSP_SET_PID_ADVANCED_CONFIG), false, next_callback);
} else { } else {
next_callback(); next_callback();
@ -658,7 +641,17 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
} }
function save_arming_config() { function save_arming_config() {
MSP.send_message(MSP_codes.MSP_SET_ARMING_CONFIG, MSP.crunch(MSP_codes.MSP_SET_ARMING_CONFIG), false, save_to_eeprom); MSP.send_message(MSP_codes.MSP_SET_ARMING_CONFIG, MSP.crunch(MSP_codes.MSP_SET_ARMING_CONFIG), false, save_looptime_config);
}
function save_looptime_config() {
var next_callback = save_to_eeprom;
if (CONFIG.flightControllerIdentifier == "BTFL" && semver.lt(CONFIG.flightControllerVersion, "2.8.1")) {
FC_CONFIG.loopTime = PID_ADVANCED_CONFIG.gyro_sync_denom * 125;
MSP.send_message(MSP_codes.MSP_SET_LOOP_TIME, MSP.crunch(MSP_codes.MSP_SET_LOOP_TIME), false, next_callback);
} else {
next_callback();
}
} }
function save_to_eeprom() { function save_to_eeprom() {