1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-16 12:55:13 +03:00

Basic rework of: Adjustments and PID tabs, little fixes and changes here and there

This commit is contained in:
skaman82 2015-11-04 22:22:23 +01:00
parent 4864abe6fe
commit 8e79a250ed
43 changed files with 2653 additions and 843 deletions

432
configuration.html Normal file
View file

@ -0,0 +1,432 @@
<div class="tab-configuration">
<div class="tab_title" i18n="tabConfiguration">Configuration</div>
<div class="cf_doc_version_bt">
<a id="button-documentation" href="https://github.com/cleanflight/cleanflight/releases" target="_blank"></a>
</div>
<div class="note" style="margin-bottom:20px;">
<div class="note_spacer">
<p i18n="configurationFeaturesHelp"></p>
</div>
</div>
<div class="leftWrapper mixer">
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationMixer"></div>
<div class="helpicon"></div>
</div>
<div class="spacer_box">
<div class="mixerPreview half">
<img src="./resources/motor_order/custom.svg" />
</div>
<div class="half" style="width:calc(50% - 10px); margin-left:10px;">
<select class="mixerList">
<!-- list generated here -->
</select>
</div>
</div>
</div>
</div>
<div class="rightWrapper motorstop">
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationEscFeatures"></div>
<div class="helpicon"></div>
</div>
<div class="spacer_box">
<table cellpadding="0" cellspacing="0">
<thead style="display:none;">
<tr>
<th i18n="configurationFeatureEnabled"></th>
<th i18n="configurationFeatureDescription"></th>
<th i18n="configurationFeatureName"></th>
</tr>
</thead>
<tbody class="features esc">
<!-- table generated here -->
</tbody>
</table>
<!-- -->
<div class="disarm">
<div class="checkbox">
<div style="float:left; height:20px; margin-right:15px; margin-left:3px;">
<input type="checkbox" name="disarmkillswitch" id="toggle"/>
</div><label for="disarmkillswitch">
<span class="freelabel" i18n="configurationDisarmKillSwitch"></span>
</label>
</div>
<div class="number disarmdelay" style="display:none; margin-bottom:5px;">
<label>
<div class="numberspacer">
<input type="number" name="autodisarmdelay" min="0" max="60" />
</div>
<span i18n="configurationAutoDisarmDelay"></span>
</label>
</div>
</div>
<!-- -->
<div class="number">
<label>
<div class="numberspacer">
<input type="number" name="minthrottle" min="0" max="2000" />
</div>
<span i18n="configurationThrottleMinimum"></span>
</label>
</div>
<div class="number">
<label>
<div class="numberspacer">
<input type="number" name="midthrottle" min="0" max="2000" />
</div>
<span i18n="configurationThrottleMid"></span>
</label>
</div>
<div class="number">
<label>
<div class="numberspacer">
<input type="number" name="maxthrottle" min="0" max="2000" />
</div>
<span i18n="configurationThrottleMaximum"></span>
</label>
</div>
<div class="number">
<label>
<div class="numberspacer">
<input type="number" name="mincommand" min="0" max="2000" />
</div>
<span i18n="configurationThrottleMinimumCommand"></span>
</label>
</div>
</div>
</div>
</div>
<div class="clear-both"></div>
<div class="leftWrapper">
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationBoardAlignment"></div>
<div class="helpicon"></div>
</div>
<div class="spacer_box">
<div class="number">
<label>
<input type="number" name="board_align_roll" step="1" min="-180" max="360" />
<span i18n="configurationBoardAlignmentRoll"></span>
</label>
</div>
<div class="number">
<label>
<input type="number" name="board_align_pitch" step="1" min="-180" max="360" />
<span i18n="configurationBoardAlignmentPitch"></span>
</label>
</div>
<div class="number">
<label>
<input type="number" name="board_align_yaw" step="1" min="-180" max="360" />
<span i18n="configurationBoardAlignmentYaw"></span>
</label>
</div>
</div>
</div>
</div>
<div class="rightWrapper acc">
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationAccelTrims"></div>
<div class="helpicon"></div>
</div>
<div class="spacer_box">
<div class="number">
<label>
<input type="number" name="roll" min="-300" max="300" />
<span i18n="configurationAccelTrimRoll"></span>
</label>
</div>
<div class="number">
<label>
<input type="number" name="pitch" min="-300" max="300" />
<span i18n="configurationAccelTrimPitch"></span>
</label>
</div>
</div>
</div>
</div>
<div class="clear-both"></div>
<div class="leftWrapper">
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationReceiver"></div>
<div class="helpicon"></div>
</div>
<div class="spacer_box">
<table cellpadding="0" cellspacing="0">
<thead>
<tr>
<th i18n="configurationFeatureEnabled"></th>
<th i18n="configurationFeatureDescription"></th>
<th i18n="configurationFeatureName"></th>
</tr>
</thead>
<tbody class="features rxMode">
<!-- table generated here -->
</tbody>
</table>
</div>
</div>
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationSerialRX"></div>
<div class="helpicon"></div>
</div>
<div class="spacer_box">
<div class="note">
<div class="note_spacer">
<p i18n="configurationSerialRXHelp"></p>
</div>
</div>
<select class="serialRX" size="4">
<!-- list generated here -->
</select>
</div>
</div>
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationFailsafe"></div>
<div class="helpicon"></div>
</div>
<div class="spacer_box">
<table cellpadding="0" cellspacing="0">
<thead>
<tr>
<th i18n="configurationFeatureEnabled"></th>
<th i18n="configurationFeatureDescription"></th>
<th i18n="configurationFeatureName"></th>
</tr>
</thead>
<tbody class="features rxFailsafe">
<!-- table generated here -->
</tbody>
</table>
<div class="number">
<label>
<input type="number" name="failsafe_throttle" min="0" max="2000" />
<span i18n="configurationThrottleFailsafe"></span>
</label>
</div>
</div>
</div>
</div>
<div class="rightWrapper current voltage">
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationBatteryVoltage"></div>
<div class="helpicon"></div>
</div>
<div class="spacer_box">
<table cellpadding="0" cellspacing="0">
<thead>
<tr>
<th i18n="configurationFeatureEnabled"></th>
<th i18n="configurationFeatureDescription"></th>
<th i18n="configurationFeatureName"></th>
</tr>
</thead>
<tbody class="features batteryVoltage">
<!-- table generated here -->
</tbody>
</table>
<div class="number">
<label>
<input type="number" name="mincellvoltage" step="0.1" min="1" max="5" />
<span i18n="configurationBatteryMinimum"></span>
</label>
</div>
<div class="number">
<label>
<input type="number" name="maxcellvoltage" step="0.1" min="1" max="5" />
<span i18n="configurationBatteryMaximum"></span>
</label>
</div>
<div class="number">
<label>
<input type="number" name="warningcellvoltage" step="0.1" min="1" max="5" />
<span i18n="configurationBatteryWarning"></span>
</label>
</div>
<div class="number">
<label>
<input type="number" name="voltagescale" step="1" min="10" max="255" />
<span i18n="configurationBatteryScale"></span>
</label>
</div>
</div>
</div>
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationCurrent"></div>
<div class="helpicon"></div>
</div>
<div class="spacer_box">
<table cellpadding="0" cellspacing="0">
<thead>
<tr>
<th i18n="configurationFeatureEnabled"></th>
<th i18n="configurationFeatureDescription"></th>
<th i18n="configurationFeatureName"></th>
</tr>
</thead>
<tbody class="features batteryCurrent">
<!-- table generated here -->
</tbody>
</table>
<div class="number">
<label>
<input type="number" name="currentscale" step="1" min="-1000" max="1000" />
<span i18n="configurationCurrentScale"></span>
</label>
</div>
<div class="number">
<label>
<input type="number" name="currentoffset" step="1" min="0" max="3300" />
<span i18n="configurationCurrentOffset"></span>
</label>
</div>
<div class="checkbox">
<div class="numberspacer">
<input type="checkbox" name="multiwiicurrentoutput" id="toggle"/>
</div><label>
<span i18n="configurationBatteryMultiwiiCurrent"></span>
</label>
</div>
</div>
</div>
</div>
<div class="clear-both"></div>
<div class="leftWrapper rssi">
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationRSSI"></div>
<div class="helpicon"></div>
</div>
<div class="spacer_box">
<table cellpadding="0" cellspacing="0">
<thead>
<tr>
<th i18n="configurationFeatureEnabled"></th>
<th i18n="configurationFeatureDescription"></th>
<th i18n="configurationFeatureName"></th>
</tr>
</thead>
<tbody class="features rssi">
<!-- table generated here -->
</tbody>
</table>
</div>
</div>
</div>
<div class="rightWrapper system">
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationSystem"></div>
<div class="helpicon"></div>
</div>
<div class="spacer_box">
<div class="note">
<div class="note_spacer">
<p i18n="configurationLoopTimeHelp"></p>
</div>
</div>
<div class="number">
<label>
<input type="number" name="looptime" step="100" min="0" max="9000"/>
<span i18n="configurationLoopTime"></span>
</label>
</div>
<div class="number">
<label>
<input type="text" name="looptimehz" readonly class="disabled"/>
<span i18n="configurationCalculatedCyclesSec"></span>
</label>
</div>
</div>
</div>
</div>
<div class="clear-both"></div>
<div class="leftWrapper gps">
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationGPS"></div>
<div class="helpicon"></div>
</div>
<div class="spacer_box">
<div class="note">
<div class="note_spacer">
<p i18n="configurationGPSHelp"></p>
</div>
</div>
<table cellpadding="0" cellspacing="0">
<thead>
<tr>
<th i18n="configurationFeatureEnabled"></th>
<th i18n="configurationFeatureDescription"></th>
<th i18n="configurationFeatureName"></th>
</tr>
</thead>
<tbody class="features gps">
<!-- table generated here -->
</tbody>
</table>
<div class="line">
<select class="gps_protocol">
<!-- list generated here -->
</select>
<span i18n="configurationGPSProtocol"></span>
</div>
<div class="line">
<select class="gps_baudrate">
<!-- list generated here -->
</select>
<span i18n="configurationGPSBaudrate"></span>
</div>
<div class="line">
<select class="gps_ubx_sbas">
<!-- list generated here -->
</select>
<span i18n="configurationGPSubxSbas"></span>
</div>
<div class="number">
<label>
<input type="number" name="mag_declination" step="0.1" min="-180" max="180" />
<span i18n="configurationMagDeclination"></span>
</label>
</div>
</div>
</div>
</div>
<div class="rightWrapper">
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationFeatures"></div>
<div class="helpicon"></div>
</div>
<div class="spacer_box">
<table cellpadding="0" cellspacing="0">
<thead>
<tr>
<th i18n="configurationFeatureEnabled"></th>
<th i18n="configurationFeatureDescription"></th>
<th i18n="configurationFeatureName"></th>
</tr>
</thead>
<tbody class="features other" id="noline">
<!-- table generated here -->
</tbody>
</table>
</div>
</div>
</div>
<div class="clear-both"></div>
<div class="fixed_band">
<div class="save_btn"><a class="save" href="#" i18n="configurationButtonSave"></a></div>
</div>
</div>

476
configuration.js Normal file
View file

@ -0,0 +1,476 @@
'use strict';
TABS.configuration = {};
TABS.configuration.initialize = function (callback, scrollPosition) {
var self = this;
if (GUI.active_tab != 'configuration') {
GUI.active_tab = 'configuration';
googleAnalytics.sendAppView('Configuration');
}
function load_config() {
MSP.send_message(MSP_codes.MSP_BF_CONFIG, false, false, load_serial_config);
}
function load_serial_config() {
if (semver.lt(CONFIG.apiVersion, "1.6.0")) {
MSP.send_message(MSP_codes.MSP_CF_SERIAL_CONFIG, false, false, load_rc_map);
} else {
load_rc_map();
}
}
function load_rc_map() {
MSP.send_message(MSP_codes.MSP_RX_MAP, false, false, load_misc);
}
function load_misc() {
MSP.send_message(MSP_codes.MSP_MISC, false, false, load_acc_trim);
}
function load_acc_trim() {
MSP.send_message(MSP_codes.MSP_ACC_TRIM, false, false
, semver.gte(CONFIG.apiVersion, "1.8.0") ? load_arming_config : load_html);
}
function load_arming_config() {
MSP.send_message(MSP_codes.MSP_ARMING_CONFIG, false, false, load_loop_time);
}
function load_loop_time() {
MSP.send_message(MSP_codes.MSP_LOOP_TIME, false, false, load_html);
}
function load_html() {
$('#content').load("./tabs/configuration.html", process_html);
}
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() {
// translate to user-selected language
localize();
var mixer_list_e = $('select.mixerList');
for (var i = 0; i < mixerList.length; i++) {
mixer_list_e.append('<option value="' + (i + 1) + '">' + mixerList[i].name + '</option>');
}
mixer_list_e.change(function () {
var val = parseInt($(this).val());
BF_CONFIG.mixerConfiguration = val;
$('.mixerPreview img').attr('src', './resources/motor_order/' + mixerList[val - 1].image + '.svg');
});
// select current mixer configuration
mixer_list_e.val(BF_CONFIG.mixerConfiguration).change();
// generate features
var features = [
{bit: 0, group: 'rxMode', mode: 'group', name: 'RX_PPM', description: 'PPM RX input'},
{bit: 1, group: 'batteryVoltage', name: 'VBAT', description: 'Battery voltage monitoring'},
{bit: 2, group: 'other', name: 'INFLIGHT_ACC_CAL', description: 'In-flight level calibration'},
{bit: 3, group: 'rxMode', mode: 'group', name: 'RX_SERIAL', description: 'Serial-based receiver (SPEKSAT, SBUS, SUMD)'},
{bit: 4, group: 'esc', name: 'MOTOR_STOP', description: 'Don\'t spin the motors when armed'},
{bit: 5, group: 'other', name: 'SERVO_TILT', description: 'Servo gimbal'},
{bit: 6, group: 'other', name: 'SOFTSERIAL', description: 'Enable CPU based serial ports'},
{bit: 7, group: 'gps', name: 'GPS', description: 'GPS (configure port scenario first)'},
{bit: 8, group: 'rxFailsafe', name: 'FAILSAFE', description: 'Failsafe settings on RX signal loss'},
{bit: 9, group: 'other', name: 'SONAR', description: 'Sonar'},
{bit: 10, group: 'other', name: 'TELEMETRY', description: 'Telemetry output'},
{bit: 11, group: 'batteryCurrent', name: 'CURRENT_METER', description: 'Battery current monitoring'},
{bit: 12, group: 'other', name: '3D', description: '3D mode (for use with reversible ESCs)'},
{bit: 13, group: 'rxMode', mode: 'group', name: 'RX_PARALLEL_PWM', description: 'PWM RX input'},
{bit: 14, group: 'rxMode', mode: 'group', name: 'RX_MSP', description: 'MSP RX input'},
{bit: 15, group: 'rssi', name: 'RSSI_ADC', description: 'Analog RSSI input'},
{bit: 16, group: 'other', name: 'LED_STRIP', description: 'Addressable RGB LED strip support'},
{bit: 17, group: 'other', name: 'DISPLAY', description: 'OLED Screen Display'},
{bit: 18, group: 'esc', name: 'ONESHOT125', description: 'ONESHOT ESC support (disconnect ESCs, remove props)'},
{bit: 19, group: 'other', name: 'BLACKBOX', description: 'Blackbox flight data recorder'}
];
if (semver.gte(CONFIG.apiVersion, "1.12.0")) {
features.push(
{bit: 20, group: 'other', name: 'CHANNEL_FORWARDING', description: 'Forward aux channels to remaining servo outputs'}
);
}
var radioGroups = [];
var features_e = $('.features');
for (var i = 0; i < features.length; i++) {
var row_e;
if (features[i].mode === 'group') {
row_e = $('<tr><td style="width: 15px;"><input style="width: 13px;" class="feature" id="feature-'
+ i
+ '" value="'
+ features[i].bit
+ '" title="'
+ features[i].name
+ '" type="radio" name="'
+ features[i].group
+ '" /></td><td><label for="feature-'
+ i
+ '">'
+ features[i].name
+ '</label></td><td><span>'
+ features[i].description
+ '</td><span>');
radioGroups.push(features[i].group);
} else {
row_e = $('<tr><td><input class="feature"'
+ i
+ '" name="'
+ features[i].name
+ '" title="'
+ features[i].name
+ '" type="checkbox" id="toggle"/></td><td><label for="feature-'
+ i
+ '">'
+ features[i].name
+ '</label></td><td><span>'
+ features[i].description
+ '</span></td>');
var feature_e = row_e.find('input.feature');
feature_e.prop('checked', bit_check(BF_CONFIG.features, features[i].bit));
feature_e.data('bit', features[i].bit);
}
features_e.each(function () {
if ($(this).hasClass(features[i].group)) {
$(this).append(row_e);
}
});
}
for (var i = 0; i < radioGroups.length; i++) {
var group = radioGroups[i];
var controls_e = $('input[name="' + group + '"].feature');
controls_e.each(function() {
var bit = parseInt($(this).attr('value'));
var state = bit_check(BF_CONFIG.features, bit);
$(this).prop('checked', state);
});
}
// generate GPS
var gpsProtocols = [
'NMEA',
'UBLOX'
];
var gpsBaudRates = [
'115200',
'57600',
'38400',
'19200',
'9600'
];
var gpsSbas = [
'Disabled',
'Auto-detect',
'European EGNOS',
'North American WAAS',
'Japanese MSAS',
'Indian GAGAN'
];
var gps_protocol_e = $('select.gps_protocol');
for (var i = 0; i < gpsProtocols.length; i++) {
gps_protocol_e.append('<option value="' + i + '">' + gpsProtocols[i] + '</option>');
}
gps_protocol_e.change(function () {
MISC.gps_type = parseInt($(this).val());
});
gps_protocol_e.val(MISC.gps_type);
var gps_baudrate_e = $('select.gps_baudrate');
for (var i = 0; i < gpsBaudRates.length; i++) {
gps_baudrate_e.append('<option value="' + gpsBaudRates[i] + '">' + gpsBaudRates[i] + '</option>');
}
if (semver.lt(CONFIG.apiVersion, "1.6.0")) {
gps_baudrate_e.change(function () {
SERIAL_CONFIG.gpsBaudRate = parseInt($(this).val());
});
gps_baudrate_e.val(SERIAL_CONFIG.gpsBaudRate);
} else {
gps_baudrate_e.prop("disabled", true);
gps_baudrate_e.parent().hide();
}
var gps_ubx_sbas_e = $('select.gps_ubx_sbas');
for (var i = 0; i < gpsSbas.length; i++) {
gps_ubx_sbas_e.append('<option value="' + (i - 1) + '">' + gpsSbas[i] + '</option>');
}
gps_ubx_sbas_e.change(function () {
MISC.gps_ubx_sbas = parseInt($(this).val());
});
gps_ubx_sbas_e.val(MISC.gps_ubx_sbas);
// generate serial RX
var serialRXtypes = [
'SPEKTRUM1024',
'SPEKTRUM2048',
'SBUS',
'SUMD',
'SUMH',
'XBUS_MODE_B',
'XBUS_MODE_B_RJ01'
];
var serialRX_e = $('select.serialRX');
for (var i = 0; i < serialRXtypes.length; i++) {
serialRX_e.append('<option value="' + i + '">' + serialRXtypes[i] + '</option>');
}
serialRX_e.change(function () {
BF_CONFIG.serialrx_type = parseInt($(this).val());
});
// select current serial RX type
serialRX_e.val(BF_CONFIG.serialrx_type);
// for some odd reason chrome 38+ changes scroll according to the touched select element
// i am guessing this is a bug, since this wasn't happening on 37
// code below is a temporary fix, which we will be able to remove in the future (hopefully)
$('#content').scrollTop((scrollPosition) ? scrollPosition : 0);
// fill board alignment
$('input[name="board_align_roll"]').val(BF_CONFIG.board_align_roll);
$('input[name="board_align_pitch"]').val(BF_CONFIG.board_align_pitch);
$('input[name="board_align_yaw"]').val(BF_CONFIG.board_align_yaw);
// fill accel trims
$('input[name="roll"]').val(CONFIG.accelerometerTrims[1]);
$('input[name="pitch"]').val(CONFIG.accelerometerTrims[0]);
// fill magnetometer
$('input[name="mag_declination"]').val(MISC.mag_declination);
//fill motor disarm params and FC loop time
if(semver.gte(CONFIG.apiVersion, "1.8.0")) {
$('input[name="autodisarmdelay"]').val(ARMING_CONFIG.auto_disarm_delay);
$('input[name="disarmkillswitch"]').prop('checked', ARMING_CONFIG.disarm_kill_switch);
$('div.disarm').show();
if(bit_check(BF_CONFIG.features, 4))//MOTOR_STOP
$('div.disarmdelay').show();
else
$('div.disarmdelay').hide();
// fill FC loop time
$('input[name="looptime"]').val(FC_CONFIG.loopTime);
recalculate_cycles_sec();
$('div.cycles').show();
}
// fill throttle
$('input[name="minthrottle"]').val(MISC.minthrottle);
$('input[name="midthrottle"]').val(MISC.midrc);
$('input[name="maxthrottle"]').val(MISC.maxthrottle);
$('input[name="failsafe_throttle"]').val(MISC.failsafe_throttle);
$('input[name="mincommand"]').val(MISC.mincommand);
// fill battery
$('input[name="mincellvoltage"]').val(MISC.vbatmincellvoltage);
$('input[name="maxcellvoltage"]').val(MISC.vbatmaxcellvoltage);
$('input[name="warningcellvoltage"]').val(MISC.vbatwarningcellvoltage);
$('input[name="voltagescale"]').val(MISC.vbatscale);
// fill current
$('input[name="currentscale"]').val(BF_CONFIG.currentscale);
$('input[name="currentoffset"]').val(BF_CONFIG.currentoffset);
$('input[name="multiwiicurrentoutput"]').prop('checked', MISC.multiwiicurrentoutput);
// UI hooks
$('input[name="looptime"]').change(function() {
recalculate_cycles_sec();
});
$('input[type="checkbox"].feature', features_e).change(function () {
var element = $(this),
index = element.data('bit'),
state = element.is(':checked');
if (state) {
BF_CONFIG.features = bit_set(BF_CONFIG.features, index);
if(element.attr('name') === 'MOTOR_STOP')
$('div.disarmdelay').show();
} else {
BF_CONFIG.features = bit_clear(BF_CONFIG.features, index);
if(element.attr('name') === 'MOTOR_STOP')
$('div.disarmdelay').hide();
}
});
// UI hooks
$('input[type="radio"].feature', features_e).change(function () {
var element = $(this),
group = element.attr('name');
var controls_e = $('input[name="' + group + '"]');
var selected_bit = controls_e.filter(':checked').val();
controls_e.each(function() {
var bit = $(this).attr('value');
var selected = (selected_bit == bit);
if (selected) {
BF_CONFIG.features = bit_set(BF_CONFIG.features, bit);
} else {
BF_CONFIG.features = bit_clear(BF_CONFIG.features, bit);
}
});
});
// load switchery
var elems = Array.prototype.slice.call(document.querySelectorAll('#toggle'));
elems.forEach(function(html) {
var switchery = new Switchery(html,
{
color: '#59aa29',
secondaryColor: '#c4c4c4'
});
});
// load switchery END
$('a.save').click(function () {
// gather data that doesn't have automatic change event bound
BF_CONFIG.board_align_roll = parseInt($('input[name="board_align_roll"]').val());
BF_CONFIG.board_align_pitch = parseInt($('input[name="board_align_pitch"]').val());
BF_CONFIG.board_align_yaw = parseInt($('input[name="board_align_yaw"]').val());
CONFIG.accelerometerTrims[1] = parseInt($('input[name="roll"]').val());
CONFIG.accelerometerTrims[0] = parseInt($('input[name="pitch"]').val());
MISC.mag_declination = parseFloat($('input[name="mag_declination"]').val());
// motor disarm
if(semver.gte(CONFIG.apiVersion, "1.8.0")) {
ARMING_CONFIG.auto_disarm_delay = parseInt($('input[name="autodisarmdelay"]').val());
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.midrc = parseInt($('input[name="midthrottle"]').val());
MISC.maxthrottle = parseInt($('input[name="maxthrottle"]').val());
MISC.failsafe_throttle = parseInt($('input[name="failsafe_throttle"]').val());
MISC.mincommand = parseInt($('input[name="mincommand"]').val());
MISC.vbatmincellvoltage = parseFloat($('input[name="mincellvoltage"]').val());
MISC.vbatmaxcellvoltage = parseFloat($('input[name="maxcellvoltage"]').val());
MISC.vbatwarningcellvoltage = parseFloat($('input[name="warningcellvoltage"]').val());
MISC.vbatscale = parseInt($('input[name="voltagescale"]').val());
BF_CONFIG.currentscale = parseInt($('input[name="currentscale"]').val());
BF_CONFIG.currentoffset = parseInt($('input[name="currentoffset"]').val());
MISC.multiwiicurrentoutput = ~~$('input[name="multiwiicurrentoutput"]').is(':checked'); // ~~ boolean to decimal conversion
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);
} else {
save_misc();
}
}
function save_misc() {
MSP.send_message(MSP_codes.MSP_SET_MISC, MSP.crunch(MSP_codes.MSP_SET_MISC), false, save_acc_trim);
}
function save_acc_trim() {
MSP.send_message(MSP_codes.MSP_SET_ACC_TRIM, MSP.crunch(MSP_codes.MSP_SET_ACC_TRIM), false
, semver.gte(CONFIG.apiVersion, "1.8.0") ? save_arming_config : save_to_eeprom);
}
function save_arming_config() {
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() {
MSP.send_message(MSP_codes.MSP_SET_LOOP_TIME, MSP.crunch(MSP_codes.MSP_SET_LOOP_TIME), false, save_to_eeprom);
}
function save_to_eeprom() {
MSP.send_message(MSP_codes.MSP_EEPROM_WRITE, false, false, reboot);
}
function reboot() {
GUI.log(chrome.i18n.getMessage('configurationEepromSaved'));
GUI.tab_switch_cleanup(function() {
MSP.send_message(MSP_codes.MSP_SET_REBOOT, false, false, reinitialize);
});
}
function reinitialize() {
GUI.log(chrome.i18n.getMessage('deviceRebooting'));
GUI.timeout_add('waiting_for_bootup', function waiting_for_bootup() {
MSP.send_message(MSP_codes.MSP_IDENT, false, false, function () {
GUI.log(chrome.i18n.getMessage('deviceReady'));
TABS.configuration.initialize(false, $('#content').scrollTop());
});
},1500); // 1500 ms seems to be just the right amount of delay to prevent data request timeouts
}
MSP.send_message(MSP_codes.MSP_SET_BF_CONFIG, MSP.crunch(MSP_codes.MSP_SET_BF_CONFIG), false, save_serial_config);
});
// status data pulled via separate timer with static speed
GUI.interval_add('status_pull', function status_pull() {
MSP.send_message(MSP_codes.MSP_STATUS);
}, 250, true);
if (callback) callback();
}
};
TABS.configuration.cleanup = function (callback) {
if (callback) callback();
};

View file

@ -277,11 +277,11 @@ function onConnect() {
if ("CLFL" == CONFIG.flightControllerIdentifier){
/* placing this elsewhere
var documentationButton = $('#button-documentation');
documentationButton.show();
var documentationButton = $('div#content #button-documentation');
documentationButton.html("Documentation for "+CONFIG.flightControllerVersion);
documentationButton.attr("href","https://github.com/cleanflight/cleanflight/tree/v{0}/docs".format(CONFIG.flightControllerVersion));
*/
/* */
var sensor_state = $('#sensor-status');

View file

@ -57,11 +57,12 @@ a:hover {
/* Change here the content of the documentation button in all tabs!!! */
/* Change here the content of the documentation button in all tabs!!!
.cf_doc_version_bt a:before {
content:"Documentation 1.10";
}
*/
.cf_doc_version_bt a {
padding:1px 9px 1px 9px;
@ -587,9 +588,16 @@ input[type="number"]::-webkit-inner-spin-button {
.logswitch a {
color:#656565 !important;
transition: all 0.3s;
}
.logswitch a:hover {
color:#959595 !important;
text-decoration:none !important;
transition: all 0.3s;
}
.tab_container {
float:left;
@ -1062,15 +1070,15 @@ dialog {
.spacer_left {
padding-left:7px;
padding-left:15px;
float:left;
width:calc(100% - 7px);
width:calc(100% - 15px);
}
.spacer_right {
padding-right:7px;
width:calc(100% - 7px);
padding-right:15px;
width:calc(100% - 15px);
float:left;
}
@ -1095,13 +1103,13 @@ dialog {
.gui_box_titlebar {
background-color:#e4e4e4;
border-radius:3px 3px 0px 0px;
font-size:14px;
font-size:13px;
width:100%;
height:25px;
height:27px;
padding-bottom:0px;
float:left;
margin-bottom:7px;
font-family: 'open_sansregular', Arial;
font-family: 'open_sanssemibold', Arial;
}
@ -1154,6 +1162,7 @@ dialog {
padding:0px;
padding-left:9px;
padding-right:9px;
line-height:28px;
}
@ -1280,16 +1289,18 @@ dialog {
float:left;
margin-top:-5px;
font-size:11px;
width:100%;
}
.cf_table td {
border:0px;
border-bottom: solid 1px #ccc;
padding-top:4px;
padding-bottom:4px;
padding-top:2px;
padding-bottom:5px;
border-style: dotted;
}
.noboarder td{
border:none;
@ -1515,8 +1526,8 @@ body {
}
.gui_box_titlebar {
font-size:13px;
height:22px;
font-size:12px;
height:24px;
padding-bottom:0px;
margin-bottom:5px;
}
@ -1524,7 +1535,7 @@ body {
.spacer_box_title {
padding-left: 10px;
padding-right: 10px;
padding-top: 1px;
padding-top: 3px;
margin-bottom: 0px;
}
@ -1542,5 +1553,17 @@ input {
width:14px;
}
.gps_false {
padding:0px 3px 0px 3px;
font-size:10px;
}
.gps_true {
padding:0px 3px 0px 3px;
font-size:10px;
}
}

View file

@ -23,44 +23,63 @@
background: #D2D2D2;
}
.tab-adjustments .help {
padding: 10px;
background-color: #ffcb18;
margin-bottom: 10px;
}
.tab-adjustments .help p {
padding-bottom: 5px;
}
.tab-adjustments .help li {
list-style-type: decimal;
margin-left: 20px;
}
.tab-adjustments .adjustments {
width: 100%;
border-spacing: 0px;
}
.tab-adjustments td {
border-top: 1px solid #fff;
border-bottom: 1px solid #cccccc;
}
.tab-adjustments .range:first-child {
border-top: 0px;
}
.tab-adjustments .range:last-child {
border-bottom: 0px;
}
.tab-adjustments .adjustments thead td {
text-align: center;
white-space: nowrap;
padding: 10px 10px;
background-color: #61B665;
background-color: #828885;
color: white;
}
.tab-adjustments .adjustments thead td:first-child {
border-top-left-radius: 5px;
}
.tab-adjustments .adjustment {
background-color: #ececec;
.tab-adjustments .adjustments thead td:last-child {
border-top-right-radius: 5px;
}
.tab-adjustments .adjustment:nth-child(odd) {
background-color: #ffffff;
background-color:#f4f4f4;
}
.tab-adjustments .adjustments {
background-color:#e4e4e4;
}
.tab-adjustments .adjustment select {
outline: 1px solid silver;
}
/* outline: 1px solid silver; */
border-radius: 3px;
border: 1px solid silver;#}
.tab-adjustments .adjustment td {
text-align: center;
@ -81,7 +100,7 @@
}
.tab-adjustments .adjustment .channelInfo .limits {
padding: 10px 0px;
padding: 5px 0px;
}
.tab-adjustments .adjustment .range {
@ -115,26 +134,10 @@
width: 5%;
}
.tab-adjustments > .buttons {
margin-top: 10px;
}
.tab-adjustments > .buttons a {
float: right;
height: 28px;
.tab-adjustments .save_btn a {
line-height: 28px;
padding: 0 15px 0 15px;
display: block;
}
.tab-adjustments .buttons a {
text-align: center;
font-weight: bold;
border: 1px solid silver;
background-color: #ececec;
}
.tab-adjustments .buttons a:hover {
background-color: #dedcdc;
.tab-adjustments .fixed_band {
margin-top: 5px;
}

View file

@ -1,5 +1,10 @@
<div class="tab-adjustments">
<div class="help">
<div class="tab_title" i18n="tabAdjustments"></div>
<div class="cf_doc_version_bt">
<a id="button-documentation" href="https://github.com/cleanflight/cleanflight/releases" target="_blank"></a>
</div>
<div class="note" style="margin-bottom:20px;">
<div class="note_spacer">
<p i18n="adjustmentsHelp"></p>
<p i18n="adjustmentsExamples"></p>
<ul>
@ -7,6 +12,9 @@
<li i18n="adjustmentsExample2"></li>
</ul>
</div>
</div>
<table class="adjustments">
<thead>
<tr>
@ -28,9 +36,11 @@
</tbody>
</table>
<div class="buttons">
<a class="save" href="#" i18n="adjustmentsSave"></a>
<div class="fixed_band">
<div class="save_btn"><a class="save" href="#" i18n="adjustmentsSave"></a></div>
</div>
</div>
<div id="tab-adjustments-templates">
@ -39,7 +49,7 @@
<tr class="adjustment">
<td class="info">
<div class="enabling">
<input type="checkbox" class="enable"/>
<input type="checkbox" class="enable" id="toggle" />
</div>
</td>
<td class="channelInfo">

View file

@ -178,6 +178,21 @@ TABS.adjustments.initialize = function (callback) {
// translate to user-selected language
localize();
// locating link to used CF version
var documentationButton = $('div#content #button-documentation');
documentationButton.html("Documentation for "+CONFIG.flightControllerVersion);
documentationButton.attr("href","https://github.com/cleanflight/cleanflight/tree/v{0}/docs".format(CONFIG.flightControllerVersion));
// load switchery
var elems = Array.prototype.slice.call(document.querySelectorAll('#toggle'));
elems.forEach(function(html) {
var switchery = new Switchery(html,
{
color: '#59aa29',
secondaryColor: '#c4c4c4'
});
});
// UI Hooks
$('a.save').click(function () {

View file

@ -1,4 +1,5 @@
.tab-auxiliary {
float:left;
}
.tab-auxiliary .help {
@ -9,28 +10,31 @@
.tab-auxiliary .range .marker,
.tab-auxiliary .channel-slider .noUi-connect {
background: #59AA29;
background: #92b67c;
border-radius: 3px;
}
.tab-auxiliary .mode.on .info {
background: #7dc254;
background: #59aa29;
color: white;
}
.tab-auxiliary .mode.on:nth-child(odd) .info {
background: #7dc254;
background: #59aa29;
}
.tab-auxiliary .mode.off .info {
background: #cb4747;
background: #828885;
color: white;
}
.tab-auxiliary .mode.off:nth-child(odd) .info {
background: #cb4747;
background: #828885;
}
#tab-auxiliary-templates {
@ -196,13 +200,14 @@
}
.tab-auxiliary .delete a {
height:16px;
width:16px;
height:15px;
width:15px;
transition: all ease 0.3s;
opacity: 0.3;
position:relative;
float:right;
margin-right:15px;
margin-right:5px;
margin-top:-9px;
background-image: url('../images/icons/close1.svg');
background-repeat: no-repeat;
background-position: center 100%;
@ -216,7 +221,6 @@
}
.tab-auxiliary .fixed_band {
width: 100%;
bottom: 0px;
}
@ -232,7 +236,10 @@
.tab-auxiliary .fixed_band {
width: calc(100% - -5px);
margin: 0px;
width: calc(100% - -30px);
/* width: 100%; */
margin-left: -15px;
}
.tab-auxiliary .fixed_band .save_btn a {

View file

@ -12,7 +12,7 @@
<tbody>
</tbody>
</table>
<div class="fixed_band" style="position: fixed;">
<div class="fixed_band">
<div class="save_btn"><a class="save" href="#" i18n="auxiliaryButtonSave"></a></div>
</div>
</div>

View file

@ -23,6 +23,7 @@ TABS.auxiliary.initialize = function (callback) {
$('#content').load("./tabs/auxiliary.html", process_html);
}
MSP.send_message(MSP_codes.MSP_BOXNAMES, false, false, get_mode_ranges);
function createMode(modeIndex, modeId) {
@ -168,6 +169,11 @@ TABS.auxiliary.initialize = function (callback) {
// translate to user-selected language
localize();
// locating link to used CF version
var documentationButton = $('div#content #button-documentation');
documentationButton.html("Documentation for "+CONFIG.flightControllerVersion);
documentationButton.attr("href","https://github.com/cleanflight/cleanflight/tree/v{0}/docs".format(CONFIG.flightControllerVersion));
// UI Hooks
$('a.save').click(function () {

View file

@ -305,6 +305,27 @@ height:21px;
float:left;
}
.tab-configuration .current td:nth-child(2){
width:30px;
}
.tab-configuration .voltage td:nth-child(2){
width:30px;
}
.tab-configuration .rssi td:nth-child(2){
width:30px;
}
.tab-configuration .rxFailsafe td:nth-child(2){
width:30px;
}
.tab-configuration .gps td:nth-child(2){
width:38px;
}
.tab-configuration .gps .gui_box {
min-height:352px;
float:left;
@ -354,10 +375,12 @@ height:21px;
}
.tab-configuration .gui_box span {
font-style: italic;
font-style: normal;
font-family: 'open_sansregular', Arial;
line-height:19px;
color:#7d7d7d;
font-size:11px;
}
@ -367,6 +390,7 @@ height:21px;
.tab-configuration .gui_box span {
line-height:17px;
}
.tab-configuration .leftWrapper {

View file

@ -67,6 +67,11 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
// translate to user-selected language
localize();
// locating link to used CF version
var documentationButton = $('div#content #button-documentation');
documentationButton.html("Documentation for "+CONFIG.flightControllerVersion);
documentationButton.attr("href","https://github.com/cleanflight/cleanflight/tree/v{0}/docs".format(CONFIG.flightControllerVersion));
var mixer_list_e = $('select.mixerList');
for (var i = 0; i < mixerList.length; i++) {
mixer_list_e.append('<option value="' + (i + 1) + '">' + mixerList[i].name + '</option>');

View file

@ -0,0 +1,424 @@
<div class="tab-configuration">
<div class="tab_title" i18n="tabConfiguration">Configuration</div>
<div class="cf_doc_version_bt">
<a id="button-documentation" href="https://github.com/cleanflight/cleanflight/releases" target="_blank"></a>
</div>
<div class="note" style="margin-bottom:20px;">
<div class="note_spacer">
<p i18n="configurationFeaturesHelp"></p>
</div>
</div>
<div class="leftWrapper mixer">
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationMixer"></div>
<div class="helpicon"></div>
</div>
<div class="spacer_box">
<div class="mixerPreview half">
<img src="./resources/motor_order/custom.svg" />
</div>
<div class="half" style="width:calc(50% - 10px); margin-left:10px;">
<select class="mixerList">
<!-- list generated here -->
</select>
</div>
</div>
</div>
</div>
<div class="rightWrapper motorstop">
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationEscFeatures"></div>
<div class="helpicon"></div>
</div>
<div class="spacer_box">
<table cellpadding="0" cellspacing="0">
<thead style="display:none;">
<tr>
<th i18n="configurationFeatureEnabled configurationFeatureDescription" ></th>
<th i18n="configurationFeatureName"></th>
</tr>
</thead>
<tbody class="features esc">
<!-- table generated here -->
</tbody>
</table>
<!-- -->
<div class="disarm">
<div class="checkbox">
<div style="float:left; height:20px; margin-right:15px; margin-left:3px;">
<input type="checkbox" name="disarmkillswitch" id="toggle"/>
</div><label for="disarmkillswitch">
<span class="freelabel" i18n="configurationDisarmKillSwitch"></span>
</label>
</div>
<div class="number disarmdelay" style="display:none; margin-bottom:5px;">
<label>
<div class="numberspacer">
<input type="number" name="autodisarmdelay" min="0" max="60" />
</div>
<span i18n="configurationAutoDisarmDelay"></span>
</label>
</div>
</div>
<!-- -->
<div class="number">
<label>
<div class="numberspacer">
<input type="number" name="minthrottle" min="0" max="2000" />
</div>
<span i18n="configurationThrottleMinimum"></span>
</label>
</div>
<div class="number">
<label>
<div class="numberspacer">
<input type="number" name="midthrottle" min="0" max="2000" />
</div>
<span i18n="configurationThrottleMid"></span>
</label>
</div>
<div class="number">
<label>
<div class="numberspacer">
<input type="number" name="maxthrottle" min="0" max="2000" />
</div>
<span i18n="configurationThrottleMaximum"></span>
</label>
</div>
<div class="number">
<label>
<div class="numberspacer">
<input type="number" name="mincommand" min="0" max="2000" />
</div>
<span i18n="configurationThrottleMinimumCommand"></span>
</label>
</div>
</div>
</div>
</div>
<div class="clear-both"></div>
<div class="leftWrapper">
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationBoardAlignment"></div>
<div class="helpicon"></div>
</div>
<div class="spacer_box">
<div class="number">
<label>
<input type="number" name="board_align_roll" step="1" min="-180" max="360" />
<span i18n="configurationBoardAlignmentRoll"></span>
</label>
</div>
<div class="number">
<label>
<input type="number" name="board_align_pitch" step="1" min="-180" max="360" />
<span i18n="configurationBoardAlignmentPitch"></span>
</label>
</div>
<div class="number">
<label>
<input type="number" name="board_align_yaw" step="1" min="-180" max="360" />
<span i18n="configurationBoardAlignmentYaw"></span>
</label>
</div>
</div>
</div>
</div>
<div class="rightWrapper acc">
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationAccelTrims"></div>
<div class="helpicon"></div>
</div>
<div class="spacer_box">
<div class="number">
<label>
<input type="number" name="roll" min="-300" max="300" />
<span i18n="configurationAccelTrimRoll"></span>
</label>
</div>
<div class="number">
<label>
<input type="number" name="pitch" min="-300" max="300" />
<span i18n="configurationAccelTrimPitch"></span>
</label>
</div>
</div>
</div>
</div>
<div class="clear-both"></div>
<div class="leftWrapper">
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationReceiver"></div>
<div class="helpicon"></div>
</div>
<div class="spacer_box">
<table cellpadding="0" cellspacing="0">
<thead>
<tr>
<th i18n="configurationFeatureEnabled"></th>
<th i18n="configurationFeatureDescription configurationFeatureName"></th>
</tr>
</thead>
<tbody class="features rxMode">
<!-- table generated here -->
</tbody>
</table>
</div>
</div>
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationSerialRX"></div>
<div class="helpicon"></div>
</div>
<div class="spacer_box">
<div class="note">
<div class="note_spacer">
<p i18n="configurationSerialRXHelp"></p>
</div>
</div>
<select class="serialRX" size="4">
<!-- list generated here -->
</select>
</div>
</div>
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationFailsafe"></div>
<div class="helpicon"></div>
</div>
<div class="spacer_box">
<table cellpadding="0" cellspacing="0">
<thead>
<tr>
<th i18n="configurationFeatureEnabled"></th>
<th i18n="configurationFeatureDescription configurationFeatureName"></th>
</tr>
</thead>
<tbody class="features rxFailsafe">
<!-- table generated here -->
</tbody>
</table>
<div class="number">
<label>
<input type="number" name="failsafe_throttle" min="0" max="2000" />
<span i18n="configurationThrottleFailsafe"></span>
</label>
</div>
</div>
</div>
</div>
<div class="rightWrapper current voltage">
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationBatteryVoltage"></div>
<div class="helpicon"></div>
</div>
<div class="spacer_box">
<table cellpadding="0" cellspacing="0">
<thead>
<tr>
<th i18n="configurationFeatureEnabled"></th>
<th i18n="configurationFeatureDescription configurationFeatureName"></th>
</tr>
</thead>
<tbody class="features batteryVoltage">
<!-- table generated here -->
</tbody>
</table>
<div class="number">
<label>
<input type="number" name="mincellvoltage" step="0.1" min="1" max="5" />
<span i18n="configurationBatteryMinimum"></span>
</label>
</div>
<div class="number">
<label>
<input type="number" name="maxcellvoltage" step="0.1" min="1" max="5" />
<span i18n="configurationBatteryMaximum"></span>
</label>
</div>
<div class="number">
<label>
<input type="number" name="warningcellvoltage" step="0.1" min="1" max="5" />
<span i18n="configurationBatteryWarning"></span>
</label>
</div>
<div class="number">
<label>
<input type="number" name="voltagescale" step="1" min="10" max="255" />
<span i18n="configurationBatteryScale"></span>
</label>
</div>
</div>
</div>
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationCurrent"></div>
<div class="helpicon"></div>
</div>
<div class="spacer_box">
<table cellpadding="0" cellspacing="0">
<thead>
<tr>
<th i18n="configurationFeatureEnabled"></th>
<th i18n="configurationFeatureDescription configurationFeatureName"></th>
</tr>
</thead>
<tbody class="features batteryCurrent">
<!-- table generated here -->
</tbody>
</table>
<div class="number">
<label>
<input type="number" name="currentscale" step="1" min="-1000" max="1000" />
<span i18n="configurationCurrentScale"></span>
</label>
</div>
<div class="number">
<label>
<input type="number" name="currentoffset" step="1" min="0" max="3300" />
<span i18n="configurationCurrentOffset"></span>
</label>
</div>
<div class="checkbox">
<div class="numberspacer">
<input type="checkbox" name="multiwiicurrentoutput" id="toggle"/>
</div><label>
<span i18n="configurationBatteryMultiwiiCurrent"></span>
</label>
</div>
</div>
</div>
</div>
<div class="clear-both"></div>
<div class="leftWrapper rssi">
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationRSSI"></div>
<div class="helpicon"></div>
</div>
<div class="spacer_box">
<table cellpadding="0" cellspacing="0">
<thead>
<tr>
<th i18n="configurationFeatureEnabled"></th>
<th i18n="configurationFeatureDescription configurationFeatureName"></th>
</tr>
</thead>
<tbody class="features rssi">
<!-- table generated here -->
</tbody>
</table>
</div>
</div>
</div>
<div class="rightWrapper system">
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationSystem"></div>
<div class="helpicon"></div>
</div>
<div class="spacer_box">
<div class="note">
<div class="note_spacer">
<p i18n="configurationLoopTimeHelp"></p>
</div>
</div>
<div class="number">
<label>
<input type="number" name="looptime" step="100" min="0" max="9000"/>
<span i18n="configurationLoopTime"></span>
</label>
</div>
<div class="number">
<label>
<input type="text" name="looptimehz" readonly class="disabled"/>
<span i18n="configurationCalculatedCyclesSec"></span>
</label>
</div>
</div>
</div>
</div>
<div class="clear-both"></div>
<div class="leftWrapper gps">
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationGPS"></div>
<div class="helpicon"></div>
</div>
<div class="spacer_box">
<div class="note">
<div class="note_spacer">
<p i18n="configurationGPSHelp"></p>
</div>
</div>
<table cellpadding="0" cellspacing="0">
<thead>
<tr>
<th i18n="configurationFeatureEnabled"></th>
<th i18n="configurationFeatureDescription configurationFeatureName"></th>
</tr>
</thead>
<tbody class="features gps">
<!-- table generated here -->
</tbody>
</table>
<div class="line">
<select class="gps_protocol">
<!-- list generated here -->
</select>
<span i18n="configurationGPSProtocol"></span>
</div>
<div class="line">
<select class="gps_baudrate">
<!-- list generated here -->
</select>
<span i18n="configurationGPSBaudrate"></span>
</div>
<div class="line">
<select class="gps_ubx_sbas">
<!-- list generated here -->
</select>
<span i18n="configurationGPSubxSbas"></span>
</div>
<div class="number">
<label>
<input type="number" name="mag_declination" step="0.1" min="-180" max="180" />
<span i18n="configurationMagDeclination"></span>
</label>
</div>
</div>
</div>
</div>
<div class="rightWrapper">
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="configurationFeatures"></div>
<div class="helpicon"></div>
</div>
<div class="spacer_box">
<table cellpadding="0" cellspacing="0">
<thead>
<tr>
<th i18n="configurationFeatureEnabled"></th>
<th i18n="configurationFeatureDescription configurationFeatureName"></th>
</tr>
</thead>
<tbody class="features other" id="noline">
<!-- table generated here -->
</tbody>
</table>
</div>
</div>
</div>
<div class="clear-both"></div>
<div class="fixed_band">
<div class="save_btn"><a class="save" href="#" i18n="configurationButtonSave"></a></div>
</div>
</div>

View file

@ -0,0 +1,476 @@
'use strict';
TABS.configuration = {};
TABS.configuration.initialize = function (callback, scrollPosition) {
var self = this;
if (GUI.active_tab != 'configuration') {
GUI.active_tab = 'configuration';
googleAnalytics.sendAppView('Configuration');
}
function load_config() {
MSP.send_message(MSP_codes.MSP_BF_CONFIG, false, false, load_serial_config);
}
function load_serial_config() {
if (semver.lt(CONFIG.apiVersion, "1.6.0")) {
MSP.send_message(MSP_codes.MSP_CF_SERIAL_CONFIG, false, false, load_rc_map);
} else {
load_rc_map();
}
}
function load_rc_map() {
MSP.send_message(MSP_codes.MSP_RX_MAP, false, false, load_misc);
}
function load_misc() {
MSP.send_message(MSP_codes.MSP_MISC, false, false, load_acc_trim);
}
function load_acc_trim() {
MSP.send_message(MSP_codes.MSP_ACC_TRIM, false, false
, semver.gte(CONFIG.apiVersion, "1.8.0") ? load_arming_config : load_html);
}
function load_arming_config() {
MSP.send_message(MSP_codes.MSP_ARMING_CONFIG, false, false, load_loop_time);
}
function load_loop_time() {
MSP.send_message(MSP_codes.MSP_LOOP_TIME, false, false, load_html);
}
function load_html() {
$('#content').load("./tabs/configuration.html", process_html);
}
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() {
// translate to user-selected language
localize();
var mixer_list_e = $('select.mixerList');
for (var i = 0; i < mixerList.length; i++) {
mixer_list_e.append('<option value="' + (i + 1) + '">' + mixerList[i].name + '</option>');
}
mixer_list_e.change(function () {
var val = parseInt($(this).val());
BF_CONFIG.mixerConfiguration = val;
$('.mixerPreview img').attr('src', './resources/motor_order/' + mixerList[val - 1].image + '.svg');
});
// select current mixer configuration
mixer_list_e.val(BF_CONFIG.mixerConfiguration).change();
// generate features
var features = [
{bit: 0, group: 'rxMode', mode: 'group', name: 'RX_PPM', description: 'PPM RX input'},
{bit: 1, group: 'batteryVoltage', name: 'VBAT', description: 'Battery voltage monitoring'},
{bit: 2, group: 'other', name: 'INFLIGHT_ACC_CAL', description: 'In-flight level calibration'},
{bit: 3, group: 'rxMode', mode: 'group', name: 'RX_SERIAL', description: 'Serial-based receiver (SPEKSAT, SBUS, SUMD)'},
{bit: 4, group: 'esc', name: 'MOTOR_STOP', description: 'Don\'t spin the motors when armed'},
{bit: 5, group: 'other', name: 'SERVO_TILT', description: 'Servo gimbal'},
{bit: 6, group: 'other', name: 'SOFTSERIAL', description: 'Enable CPU based serial ports'},
{bit: 7, group: 'gps', name: 'GPS', description: 'GPS (configure port scenario first)'},
{bit: 8, group: 'rxFailsafe', name: 'FAILSAFE', description: 'Failsafe settings on RX signal loss'},
{bit: 9, group: 'other', name: 'SONAR', description: 'Sonar'},
{bit: 10, group: 'other', name: 'TELEMETRY', description: 'Telemetry output'},
{bit: 11, group: 'batteryCurrent', name: 'CURRENT_METER', description: 'Battery current monitoring'},
{bit: 12, group: 'other', name: '3D', description: '3D mode (for use with reversible ESCs)'},
{bit: 13, group: 'rxMode', mode: 'group', name: 'RX_PARALLEL_PWM', description: 'PWM RX input'},
{bit: 14, group: 'rxMode', mode: 'group', name: 'RX_MSP', description: 'MSP RX input'},
{bit: 15, group: 'rssi', name: 'RSSI_ADC', description: 'Analog RSSI input'},
{bit: 16, group: 'other', name: 'LED_STRIP', description: 'Addressable RGB LED strip support'},
{bit: 17, group: 'other', name: 'DISPLAY', description: 'OLED Screen Display'},
{bit: 18, group: 'esc', name: 'ONESHOT125', description: 'ONESHOT ESC support (disconnect ESCs, remove props)'},
{bit: 19, group: 'other', name: 'BLACKBOX', description: 'Blackbox flight data recorder'}
];
if (semver.gte(CONFIG.apiVersion, "1.12.0")) {
features.push(
{bit: 20, group: 'other', name: 'CHANNEL_FORWARDING', description: 'Forward aux channels to remaining servo outputs'}
);
}
var radioGroups = [];
var features_e = $('.features');
for (var i = 0; i < features.length; i++) {
var row_e;
if (features[i].mode === 'group') {
row_e = $('<tr><td style="width: 15px;"><input style="width: 13px;" class="feature" id="feature-'
+ i
+ '" value="'
+ features[i].bit
+ '" title="'
+ features[i].name
+ '" type="radio" name="'
+ features[i].group
+ '" /></td><td> <label for="feature-'
+ i
+ '">'
+ features[i].description
+ '</label> <span>'
+ features[i].name
+ '</td></span>');
radioGroups.push(features[i].group);
} else {
row_e = $('<tr><td><input class="feature"'
+ i
+ '" name="'
+ features[i].name
+ '" title="'
+ features[i].name
+ '" type="checkbox" id="toggle"/></td><td> <label for="feature-'
+ i
+ '">'
+ features[i].description
+ '</label> <span>'
+ features[i].name
+ '</span></td>');
var feature_e = row_e.find('input.feature');
feature_e.prop('checked', bit_check(BF_CONFIG.features, features[i].bit));
feature_e.data('bit', features[i].bit);
}
features_e.each(function () {
if ($(this).hasClass(features[i].group)) {
$(this).append(row_e);
}
});
}
for (var i = 0; i < radioGroups.length; i++) {
var group = radioGroups[i];
var controls_e = $('input[name="' + group + '"].feature');
controls_e.each(function() {
var bit = parseInt($(this).attr('value'));
var state = bit_check(BF_CONFIG.features, bit);
$(this).prop('checked', state);
});
}
// generate GPS
var gpsProtocols = [
'NMEA',
'UBLOX'
];
var gpsBaudRates = [
'115200',
'57600',
'38400',
'19200',
'9600'
];
var gpsSbas = [
'Disabled',
'Auto-detect',
'European EGNOS',
'North American WAAS',
'Japanese MSAS',
'Indian GAGAN'
];
var gps_protocol_e = $('select.gps_protocol');
for (var i = 0; i < gpsProtocols.length; i++) {
gps_protocol_e.append('<option value="' + i + '">' + gpsProtocols[i] + '</option>');
}
gps_protocol_e.change(function () {
MISC.gps_type = parseInt($(this).val());
});
gps_protocol_e.val(MISC.gps_type);
var gps_baudrate_e = $('select.gps_baudrate');
for (var i = 0; i < gpsBaudRates.length; i++) {
gps_baudrate_e.append('<option value="' + gpsBaudRates[i] + '">' + gpsBaudRates[i] + '</option>');
}
if (semver.lt(CONFIG.apiVersion, "1.6.0")) {
gps_baudrate_e.change(function () {
SERIAL_CONFIG.gpsBaudRate = parseInt($(this).val());
});
gps_baudrate_e.val(SERIAL_CONFIG.gpsBaudRate);
} else {
gps_baudrate_e.prop("disabled", true);
gps_baudrate_e.parent().hide();
}
var gps_ubx_sbas_e = $('select.gps_ubx_sbas');
for (var i = 0; i < gpsSbas.length; i++) {
gps_ubx_sbas_e.append('<option value="' + (i - 1) + '">' + gpsSbas[i] + '</option>');
}
gps_ubx_sbas_e.change(function () {
MISC.gps_ubx_sbas = parseInt($(this).val());
});
gps_ubx_sbas_e.val(MISC.gps_ubx_sbas);
// generate serial RX
var serialRXtypes = [
'SPEKTRUM1024',
'SPEKTRUM2048',
'SBUS',
'SUMD',
'SUMH',
'XBUS_MODE_B',
'XBUS_MODE_B_RJ01'
];
var serialRX_e = $('select.serialRX');
for (var i = 0; i < serialRXtypes.length; i++) {
serialRX_e.append('<option value="' + i + '">' + serialRXtypes[i] + '</option>');
}
serialRX_e.change(function () {
BF_CONFIG.serialrx_type = parseInt($(this).val());
});
// select current serial RX type
serialRX_e.val(BF_CONFIG.serialrx_type);
// for some odd reason chrome 38+ changes scroll according to the touched select element
// i am guessing this is a bug, since this wasn't happening on 37
// code below is a temporary fix, which we will be able to remove in the future (hopefully)
$('#content').scrollTop((scrollPosition) ? scrollPosition : 0);
// fill board alignment
$('input[name="board_align_roll"]').val(BF_CONFIG.board_align_roll);
$('input[name="board_align_pitch"]').val(BF_CONFIG.board_align_pitch);
$('input[name="board_align_yaw"]').val(BF_CONFIG.board_align_yaw);
// fill accel trims
$('input[name="roll"]').val(CONFIG.accelerometerTrims[1]);
$('input[name="pitch"]').val(CONFIG.accelerometerTrims[0]);
// fill magnetometer
$('input[name="mag_declination"]').val(MISC.mag_declination);
//fill motor disarm params and FC loop time
if(semver.gte(CONFIG.apiVersion, "1.8.0")) {
$('input[name="autodisarmdelay"]').val(ARMING_CONFIG.auto_disarm_delay);
$('input[name="disarmkillswitch"]').prop('checked', ARMING_CONFIG.disarm_kill_switch);
$('div.disarm').show();
if(bit_check(BF_CONFIG.features, 4))//MOTOR_STOP
$('div.disarmdelay').show();
else
$('div.disarmdelay').hide();
// fill FC loop time
$('input[name="looptime"]').val(FC_CONFIG.loopTime);
recalculate_cycles_sec();
$('div.cycles').show();
}
// fill throttle
$('input[name="minthrottle"]').val(MISC.minthrottle);
$('input[name="midthrottle"]').val(MISC.midrc);
$('input[name="maxthrottle"]').val(MISC.maxthrottle);
$('input[name="failsafe_throttle"]').val(MISC.failsafe_throttle);
$('input[name="mincommand"]').val(MISC.mincommand);
// fill battery
$('input[name="mincellvoltage"]').val(MISC.vbatmincellvoltage);
$('input[name="maxcellvoltage"]').val(MISC.vbatmaxcellvoltage);
$('input[name="warningcellvoltage"]').val(MISC.vbatwarningcellvoltage);
$('input[name="voltagescale"]').val(MISC.vbatscale);
// fill current
$('input[name="currentscale"]').val(BF_CONFIG.currentscale);
$('input[name="currentoffset"]').val(BF_CONFIG.currentoffset);
$('input[name="multiwiicurrentoutput"]').prop('checked', MISC.multiwiicurrentoutput);
// UI hooks
$('input[name="looptime"]').change(function() {
recalculate_cycles_sec();
});
$('input[type="checkbox"].feature', features_e).change(function () {
var element = $(this),
index = element.data('bit'),
state = element.is(':checked');
if (state) {
BF_CONFIG.features = bit_set(BF_CONFIG.features, index);
if(element.attr('name') === 'MOTOR_STOP')
$('div.disarmdelay').show();
} else {
BF_CONFIG.features = bit_clear(BF_CONFIG.features, index);
if(element.attr('name') === 'MOTOR_STOP')
$('div.disarmdelay').hide();
}
});
// UI hooks
$('input[type="radio"].feature', features_e).change(function () {
var element = $(this),
group = element.attr('name');
var controls_e = $('input[name="' + group + '"]');
var selected_bit = controls_e.filter(':checked').val();
controls_e.each(function() {
var bit = $(this).attr('value');
var selected = (selected_bit == bit);
if (selected) {
BF_CONFIG.features = bit_set(BF_CONFIG.features, bit);
} else {
BF_CONFIG.features = bit_clear(BF_CONFIG.features, bit);
}
});
});
// load switchery
var elems = Array.prototype.slice.call(document.querySelectorAll('#toggle'));
elems.forEach(function(html) {
var switchery = new Switchery(html,
{
color: '#59aa29',
secondaryColor: '#c4c4c4'
});
});
// load switchery END
$('a.save').click(function () {
// gather data that doesn't have automatic change event bound
BF_CONFIG.board_align_roll = parseInt($('input[name="board_align_roll"]').val());
BF_CONFIG.board_align_pitch = parseInt($('input[name="board_align_pitch"]').val());
BF_CONFIG.board_align_yaw = parseInt($('input[name="board_align_yaw"]').val());
CONFIG.accelerometerTrims[1] = parseInt($('input[name="roll"]').val());
CONFIG.accelerometerTrims[0] = parseInt($('input[name="pitch"]').val());
MISC.mag_declination = parseFloat($('input[name="mag_declination"]').val());
// motor disarm
if(semver.gte(CONFIG.apiVersion, "1.8.0")) {
ARMING_CONFIG.auto_disarm_delay = parseInt($('input[name="autodisarmdelay"]').val());
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.midrc = parseInt($('input[name="midthrottle"]').val());
MISC.maxthrottle = parseInt($('input[name="maxthrottle"]').val());
MISC.failsafe_throttle = parseInt($('input[name="failsafe_throttle"]').val());
MISC.mincommand = parseInt($('input[name="mincommand"]').val());
MISC.vbatmincellvoltage = parseFloat($('input[name="mincellvoltage"]').val());
MISC.vbatmaxcellvoltage = parseFloat($('input[name="maxcellvoltage"]').val());
MISC.vbatwarningcellvoltage = parseFloat($('input[name="warningcellvoltage"]').val());
MISC.vbatscale = parseInt($('input[name="voltagescale"]').val());
BF_CONFIG.currentscale = parseInt($('input[name="currentscale"]').val());
BF_CONFIG.currentoffset = parseInt($('input[name="currentoffset"]').val());
MISC.multiwiicurrentoutput = ~~$('input[name="multiwiicurrentoutput"]').is(':checked'); // ~~ boolean to decimal conversion
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);
} else {
save_misc();
}
}
function save_misc() {
MSP.send_message(MSP_codes.MSP_SET_MISC, MSP.crunch(MSP_codes.MSP_SET_MISC), false, save_acc_trim);
}
function save_acc_trim() {
MSP.send_message(MSP_codes.MSP_SET_ACC_TRIM, MSP.crunch(MSP_codes.MSP_SET_ACC_TRIM), false
, semver.gte(CONFIG.apiVersion, "1.8.0") ? save_arming_config : save_to_eeprom);
}
function save_arming_config() {
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() {
MSP.send_message(MSP_codes.MSP_SET_LOOP_TIME, MSP.crunch(MSP_codes.MSP_SET_LOOP_TIME), false, save_to_eeprom);
}
function save_to_eeprom() {
MSP.send_message(MSP_codes.MSP_EEPROM_WRITE, false, false, reboot);
}
function reboot() {
GUI.log(chrome.i18n.getMessage('configurationEepromSaved'));
GUI.tab_switch_cleanup(function() {
MSP.send_message(MSP_codes.MSP_SET_REBOOT, false, false, reinitialize);
});
}
function reinitialize() {
GUI.log(chrome.i18n.getMessage('deviceRebooting'));
GUI.timeout_add('waiting_for_bootup', function waiting_for_bootup() {
MSP.send_message(MSP_codes.MSP_IDENT, false, false, function () {
GUI.log(chrome.i18n.getMessage('deviceReady'));
TABS.configuration.initialize(false, $('#content').scrollTop());
});
},1500); // 1500 ms seems to be just the right amount of delay to prevent data request timeouts
}
MSP.send_message(MSP_codes.MSP_SET_BF_CONFIG, MSP.crunch(MSP_codes.MSP_SET_BF_CONFIG), false, save_serial_config);
});
// status data pulled via separate timer with static speed
GUI.interval_add('status_pull', function status_pull() {
MSP.send_message(MSP_codes.MSP_STATUS);
}, 250, true);
if (callback) callback();
}
};
TABS.configuration.cleanup = function (callback) {
if (callback) callback();
};

View file

@ -86,6 +86,11 @@ TABS.dataflash.initialize = function (callback) {
// translate to user-selected language
localize();
// locating link to used CF version
var documentationButton = $('div#content #button-documentation');
documentationButton.html("Documentation for "+CONFIG.flightControllerVersion);
documentationButton.attr("href","https://github.com/cleanflight/cleanflight/tree/v{0}/docs".format(CONFIG.flightControllerVersion));
if (TABS.dataflash.available) {
var supportsDataflash = DATAFLASH.totalSize > 0;

View file

@ -1,30 +1,8 @@
.tab-gps {
}
.tab-gps .GPS_info {
float: left;
display: block;
width: 190px;
border: 1px solid silver;
}
.tab-gps .GPS_info table {
padding: 5px;
line-height: 18px;
}
.tab-gps .GPS_signal_strength {
float: left;
margin-left: 10px;
width: 200px;
border: 1px solid silver;
}
.tab-gps .GPS_signal_strength table {
padding: 5px;
line-height: 18px;
.tab-gps progress {
width:100%;
border-radius:3px;
}
.tab-gps .GPS_info .head,
.tab-gps .GPS_signal_strength .head {
@ -33,7 +11,6 @@
text-align: center;
line-height: 20px;
font-weight: bold;
border-bottom: 1px solid silver;
background-color: #ececec;
}
@ -43,3 +20,25 @@
.tab-gps a:hover {
text-decoration: underline;
}
progress[value]::-webkit-progress-bar {
background-color: #d2d2d2;
border-radius: 2px;
box-shadow: 1px 1px 0 rgba(255, 255, 255, 0.95);
box-shadow: 0 0 3px rgba(0, 0, 0, 0.25) inset;
}
progress[value]::-webkit-progress-value {
background-image:
-webkit-linear-gradient(top,
rgba(255, 255, 255, .15),
rgba(0, 0, 0, .15)),
-webkit-linear-gradient(left, #59aa29, #59aa29);
border-radius: 2px;
box-shadow: 0px 0px 3px rgba(0, 0, 0, 0.25) inset;
}

View file

@ -1,7 +1,18 @@
<div class="tab-gps">
<div class="GPS_info">
<span class="head" i18n="gpsHead"></span>
<table>
<div class="tab_title" i18n="tabGPS">GPS</div>
<div class="cf_doc_version_bt">
<a id="button-documentation" href="https://github.com/cleanflight/cleanflight/releases" target="_blank"></a>
</div>
<div class="cf_column fourth">
<div class="spacer_right">
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="gpsHead"></div>
</div>
<div class="spacer_box GPS_info">
<table class="cf_table">
<tr>
<td style="width: 85px" i18n="gps3dFix"></td>
<td class="fix" i18n="gpsFixFalse"></td>
@ -26,19 +37,27 @@
<td i18n="gpsSats"></td>
<td class="sats">0</td>
</tr>
<tr>
<tr class="noboarder">
<td i18n="gpsDistToHome"></td>
<td class="distToHome"></td>
</tr>
</table>
</div>
<div class="GPS_signal_strength">
<span class="head" i18n="gpsSignalStrHead"></span>
<table>
</div>
</div>
</div>
<div class="cf_column fourth">
<div class="spacer_right">
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="gpsSignalStrHead"></div>
</div>
<div class="spacer_box GPS_signal_strength">
<table class="cf_table">
<tr class="titles">
<td style="width: 40px;">Sat ID</td>
<td style="width: 30px;">Qty</td>
<td i18n="gpsSignalStr">Signal Strength</td>
<td style="width: 20%;">Sat ID</td>
<td style="width: 15%;">Qty</td>
<td style="width: 65%;" i18n="gpsSignalStr">Signal Strength</td>
</tr>
<tr>
<td>0</td>
@ -115,11 +134,15 @@
<td>0</td>
<td><progress value="0" max="99"></progress></td>
</tr>
<tr>
<tr class="noboarder">
<td>0</td>
<td>0</td>
<td><progress value="0" max="99"></progress></td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</div>

View file

@ -16,6 +16,12 @@ TABS.gps.initialize = function (callback) {
MSP.send_message(MSP_codes.MSP_STATUS, false, false, load_html);
function process_html() {
// locating link to used CF version
var documentationButton = $('div#content #button-documentation');
documentationButton.html("Documentation for "+CONFIG.flightControllerVersion);
documentationButton.attr("href","https://github.com/cleanflight/cleanflight/tree/v{0}/docs".format(CONFIG.flightControllerVersion));
// translate to user-selected language
localize();

View file

@ -1,7 +1,17 @@
<div class="tab-led-strip">
<div class="help">
<div class="tab-led-strip">
<div class="tab_title" i18n="tabLedStrip" style="float:none;"></div>
<div class="cf_doc_version_bt">
<a id="button-documentation" href="https://github.com/cleanflight/cleanflight/releases" target="_blank"></a>
</div>
<div class="note" style="margin-bottom:10px; float:none;">
<div class="note_spacer">
<p i18n="ledStripHelp"></p>
</div>
</div>
<div class="mainGrid"></div>
<div class="gridSections">
<div class="block"></div>
@ -78,6 +88,8 @@
<p>LEDs without wire ordering number will not be saved.</p>
</div>
<div class="clear-both"></div>
<div class="buttons">
<a class="save" href="#" i18n="ledStripButtonSave"></a>
</div>

View file

@ -43,6 +43,11 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
localize();
// locating link to used CF version
var documentationButton = $('div#content #button-documentation');
documentationButton.html("Documentation for "+CONFIG.flightControllerVersion);
documentationButton.attr("href","https://github.com/cleanflight/cleanflight/tree/v{0}/docs".format(CONFIG.flightControllerVersion));
// Build Grid
var theHTML = [];
var theHTMLlength = 0;

View file

@ -1,11 +1,10 @@
.tab-logging {
}
.tab-logging .note {
padding: 5px;
border: 1px dashed silver;
}
.tab-logging .properties {
margin-top: 10px;
width: 100%;
float:left;
}
.tab-logging .properties dt {
float: left;

View file

@ -1,7 +1,16 @@
<div id="content-watermark"></div>
<div class="tab-logging">
<div class="note" i18n="loggingNote">
<div class="tab_title" i18n="tabLogging"></div>
<div class="cf_doc_version_bt">
<a id="button-documentation" href="https://github.com/cleanflight/cleanflight/releases" target="_blank"></a>
</div>
<div class="note" style="margin-bottom:20px;">
<div class="note_spacer">
<p i18n="loggingNote"></p>
</div>
</div>
<div class="properties">
<dl>
<dt><label><input type="checkbox" name="MSP_RAW_IMU" /> MSP_RAW_IMU</label></dt><dd>9 columns (accel[x, y, z], gyro[x, y, z], mag[x, y, z])</dd>
@ -38,4 +47,3 @@
<a href="#" class="logging" i18n="loggingStart"></a>
<a href="#" class="log_file" i18n="loggingButtonLogFile"></a>
</div>
</div>

View file

@ -30,6 +30,12 @@ TABS.logging.initialize = function (callback) {
// translate to user-selected language
localize();
// locating link to used CF version
var documentationButton = $('div#content #button-documentation');
documentationButton.html("Documentation for "+CONFIG.flightControllerVersion);
documentationButton.attr("href","https://github.com/cleanflight/cleanflight/tree/v{0}/docs".format(CONFIG.flightControllerVersion));
// UI hooks
$('a.log_file').click(prepare_file);

View file

@ -47,6 +47,11 @@ TABS.modes.initialize = function (callback) {
// translate to user-selected language
localize();
// locating link to used CF version
var documentationButton = $('div#content #button-documentation');
documentationButton.html("Documentation for "+CONFIG.flightControllerVersion);
documentationButton.attr("href","https://github.com/cleanflight/cleanflight/tree/v{0}/docs".format(CONFIG.flightControllerVersion));
// generate table from the supplied AUX names and AUX data
for (var i = 0; i < AUX_CONFIG.length; i++) {
var line = '<tr class="switches">';

View file

@ -1,5 +1,8 @@
<div id="content-watermark"></div>
<div class="tab-motors">
<div class="tab_title" i18n="tabMotorTesting">Motors</div>
<div class="cf_doc_version_bt">
<a id="button-documentation" href="https://github.com/cleanflight/cleanflight/releases" target="_blank"></a>
</div>
<div class="wrapper modelAndAccel">
<div class="mixerPreview">
<img src="./resources/motor_order/custom.svg" />
@ -112,4 +115,3 @@
</div>
<div class="cler-both"></div>
</div>
</div>

View file

@ -156,6 +156,11 @@ TABS.motors.initialize = function (callback) {
// translate to user-selected language
localize();
// locating link to used CF version
var documentationButton = $('div#content #button-documentation');
documentationButton.html("Documentation for "+CONFIG.flightControllerVersion);
documentationButton.attr("href","https://github.com/cleanflight/cleanflight/tree/v{0}/docs".format(CONFIG.flightControllerVersion));
$('#motorsEnableTestMode').prop('disabled', 'true');
update_model(CONFIG.multiType);

View file

@ -1,57 +1,114 @@
.tab-pid_tuning {
}
.tab-pid_tuning .rate-tpa th {
font-weight: normal;
background-color: #ECECEC;
padding: 4px;
border-left: 1px solid #ccc;
border-bottom: 1px solid #ccc;
font-weight: bold;
}
.tab-pid_tuning .rate-tpa {
border:1px solid #ccc;
margin-bottom:10px;
}
.tab-pid_tuning input[type="number"]::-webkit-inner-spin-button {
border: 0;
}
}
.tab-pid_tuning table {
float: left;
margin-bottom: 10px;
margin:0px;
border-collapse: collapse;
width: calc(100% - -1px);
}
.tab-pid_tuning .pid_tuning {
}
.tab-pid_tuning table,
.tab-pid_tuning table th,
.tab-pid_tuning table td {
padding: 4px;
border: 1px solid #8b8b8b;
}
.tab-pid_tuning table tr td:first-child {
text-align: center;
width:30%;
}
.tab-pid_tuning table td {
padding: 1px;
border-bottom: 1px solid #ccc;
}
.tab-pid_tuning table th {
padding: 0px;
border: 0px;
height:10px;
font-weight:normal;
}
.tab-pid_tuning .pid_titlebar th {
padding:5px;
text-align:left;
border-right: 1px solid #ccc;
width:calc(100% -1px);
}
.tab-pid_tuning .pid_titlebar th:first-child {
text-align:left;
}
.tab-pid_tuning .pid_titlebar th:last-child {
border-right: none;
}
.tab-pid_tuning table tr td:first-child {
text-align: left;
padding-left:5px;
}
.tab-pid_tuning table tr td:last-child {
border-right: 0px solid #ccc;
}
.tab-pid_tuning table td {
padding: 1px;
width:25%;
border-right: 1px solid #ccc;
}
.tab-pid_tuning table tr td {
text-align: left;
padding-left: 0px;
}
.tab-pid_tuning table tr:nth-child(odd) {
background-color: #ececec;
}
.tab-pid_tuning table input {
display: block;
width: 100%;
width: calc(100% - 2px);
height: 20px;
line-height: 20px;
text-align: right;
border:0px solid #ccc;
border-radius:0px;
}
.tab-pid_tuning .controller {
float: left;
width: calc(40% - 10px);
width: calc(50% - 12px);
margin-left: 10px;
margin-bottom: 10px;
border: 1px solid #8b8b8b;
border-radius: 3px;
border: 1px solid #ccc;
}
.tab-pid_tuning .controller .head {
display: block;
text-align: center;
text-align: left;
line-height: 20px;
font-weight: bold;
border-bottom: 1px solid #8b8b8b;
padding-left:5px;
border-bottom: 1px solid #ccc;
background-color: #ececec;
}
.tab-pid_tuning .controller select {
@ -61,19 +118,17 @@
}
.tab-pid_tuning .profile {
float: left;
width: calc(18% - 2px); /* - border*/
border: 1px solid #8b8b8b;
width: calc(25% - 2px); /* - border*/
border: 1px solid #ccc;
border-radius: 3px;
}
.tab-pid_tuning .profile .head {
display: block;
text-align: center;
text-align: left;
line-height: 20px;
font-weight: bold;
border-bottom: 1px solid #8b8b8b;
padding-left:5px;
border-bottom: 1px solid #ccc;
background-color: #ececec;
}
.tab-pid_tuning .profile select {
@ -82,9 +137,7 @@
height: 20px;
line-height: 20px;
}
.tab-pid_tuning .pid_tuning {
width: 100%;
}
.tab-pid_tuning .pid_tuning .name {
width: 30%;
}
@ -109,7 +162,7 @@
text-align: center;
font-weight: bold;
border: 1px solid silver;
border: 1px solid #ccc;
background-color: #ececec;
}
.tab-pid_tuning .refresh {
@ -124,19 +177,56 @@
}
.tab-pid_tuning .fixed_band {
position: fixed;
position: absolute;
width: 100%;
bottom: 0px;
}
.pid_mode {
width: calc(100% - 5px);
height: 20px;
background-color: #ECECEC;
float: left;
margin: 0px;
padding: 0px;
text-align: center;
padding-left:5px;
line-height: 13px;
padding-top: 6px;
font-size: 12px;
border-bottom: 1px solid #ccc;
color: #595D5B;
font-family: 'open_sanslight', Arial;
}
.pid_titlebar {
color: #fff;
background-color: #828885;
border-top-left-radius:3px;
border-top-right-radius:3px;
height:20px;
}
.pid_titlebar td:first-child {
text-align:left;
}
.show a {
margin-left: 10px;
width: calc(100% - 10px);
}
@media only screen and (max-width: 1055px), only screen and (max-device-width: 1055px) {
.tab-pid_tuning .fixed_band {
width: calc(100% - -5px);
bottom: 0px;
margin: 0px;
width: calc(100% - 0px);
margin-left: -15px;
}
.tab-pid_tuning .fixed_band .save_btn a {

View file

@ -4,7 +4,6 @@
<a id="button-documentation" href="https://github.com/cleanflight/cleanflight/releases" target="_blank"></a>
</div>
<div class="cf_column half">
<div class="spacer_right">
<div class="profile">
<span class="head" i18n="pidTuningProfileHead"></span>
<select name="profile">
@ -24,16 +23,137 @@
<option value="5">5 - Harakiri</option>
</select>
</div>
</div>
</div>
<div class="cf_column third_right">
<div class="spacer_left">
<div class="top-buttons"><a href="#" id="showAllPids">Show All PIDs</a></div>
<div class="cf_column fourth">
<div class="default_btn show"><a href="#" id="showAllPids">Show all PIDs</a></div>
</div>
</div>
<form name="pid-tuning" id="pid-tuning">
<div class="clear-both"></div>
<div class="cf_column third_right">
<div class="cf_column half">
<div class="gui_box grey">
<table class="pid_titlebar">
<tr>
<th class="name" i18n="pidTuningName" style="width:25%;"></th>
<th class="proportional" i18n="pidTuningProportional" style="width:25%;"></th>
<th class="integral" i18n="pidTuningIntegral" style="width:25%;"></th>
<th class="derivative" i18n="pidTuningDerivative" style="width:25%;"></th>
</tr>
</table>
<table id="pid_main" class="pid_tuning">
<tr>
<th colspan="4">
<div class="pid_mode">Basic/Acro</div>
</th>
</tr>
<tr class="ROLL">
<!-- 0 -->
<td></td>
<td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td>
<td><input type="number" name="i" step="0.001" min="0" max="0.255"/></td>
<td><input type="number" name="d" step="1" min="0" max="255"/></td>
</tr>
<tr class="PITCH">
<!-- 1 -->
<td></td>
<td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td>
<td><input type="number" name="i" step="0.001" min="0" max="0.255"/></td>
<td><input type="number" name="d" step="1" min="0" max="255"/></td>
</tr>
<tr class="YAW">
<!-- 2 -->
<td></td>
<td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td>
<td><input type="number" name="i" step="0.001" min="0" max="0.255"/></td>
<td><input type="number" name="d" step="1" min="0" max="255"/></td>
</tr>
</table>
<table id="pid_accel" class="pid_tuning">
<tr>
<th colspan="4">
<div class="pid_mode">Accelerometer/Level</div>
</th>
</tr>
<tr class="LEVEL">
<!-- 7 -->
<td></td>
<td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td>
<td><input type="number" name="i" step="0.001" min="0" max="0.255"/></td>
<td><input type="number" name="d" step="1" min="0" max="255"/></td>
</tr>
</table>
<table id="pid_baro" class="pid_tuning">
<tr>
<th colspan="4">
<div class="pid_mode">Barometer/Altitude</div>
</th>
</tr>
<tr class="ALT">
<!-- 3 -->
<td></td>
<td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td>
<td><input type="number" name="i" step="0.001" min="0" max="0.255"/></td>
<td><input type="number" name="d" step="1" min="0" max="255"/></td>
</tr>
</table>
<table id="pid_mag" class="pid_tuning">
<tr>
<th colspan="4">
<div class="pid_mode">Magnometer/Heading</div>
</th>
</tr>
<tr class="MAG">
<!-- 8 -->
<td></td>
<td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td>
<td></td>
<td></td>
</tr>
</table>
<table id="pid_sonar" class="pid_tuning">
<tr>
<th colspan="4">
<div class="pid_mode">Sonar</div>
</th>
</tr>
<tr class="Vario">
<!-- 9 -->
<td></td>
<td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td>
<td><input type="number" name="i" step="0.001" min="0" max="0.255"/></td>
<td><input type="number" name="d" step="1" min="0" max="255"/></td>
</tr>
</table>
<table id="pid_gps" class="pid_tuning">
<tr>
<th colspan="4">
<div class="pid_mode">GPS Navigation</div>
</th>
</tr>
<tr class="Pos">
<!-- 4 -->
<td></td>
<td><input type="number" name="p" step="0.01" min="0" max="2.55"/></td>
<td><input type="number" name="i" step="0.01" min="0" max="2.55"/></td>
<td></td>
</tr>
<tr class="PosR">
<!-- 5 -->
<td></td>
<td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td>
<td><input type="number" name="i" step="0.01" min="0" max="2.55"/></td>
<td><input type="number" name="d" step="0.001" min="0" max="0.255"/></td>
</tr>
<tr class="NavR">
<!-- 6 -->
<td></td>
<td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td>
<td><input type="number" name="i" step="0.01" min="0" max="2.55"/></td>
<td><input type="number" name="d" step="0.001" min="0" max="0.255"/></td>
</tr>
</table>
</div>
</div>
<div class="cf_column half">
<div class="spacer_left">
<table class="rate-tpa">
<thead>
@ -69,113 +189,6 @@
</table>
</div>
</div>
<div class="cf_column half">
<div class="spacer_right">
<table id="pid_main" class="pid_tuning">
<tr class="title">
<th colspan="4">Basic/Acro</th>
</tr>
<tr>
<th class="name" i18n="pidTuningName"></th>
<th class="proportional" i18n="pidTuningProportional"></th>
<th class="integral" i18n="pidTuningIntegral"></th>
<th class="derivative" i18n="pidTuningDerivative"></th>
</tr>
<tr class="ROLL">
<!-- 0 -->
<td></td>
<td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td>
<td><input type="number" name="i" step="0.001" min="0" max="0.255"/></td>
<td><input type="number" name="d" step="1" min="0" max="255"/></td>
</tr>
<tr class="PITCH">
<!-- 1 -->
<td></td>
<td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td>
<td><input type="number" name="i" step="0.001" min="0" max="0.255"/></td>
<td><input type="number" name="d" step="1" min="0" max="255"/></td>
</tr>
<tr class="YAW">
<!-- 2 -->
<td></td>
<td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td>
<td><input type="number" name="i" step="0.001" min="0" max="0.255"/></td>
<td><input type="number" name="d" step="1" min="0" max="255"/></td>
</tr>
</table>
<table id="pid_accel" class="pid_tuning">
<tr class="title">
<th colspan="4">Accelerometer/Level</th>
</tr>
<tr class="LEVEL">
<!-- 7 -->
<td></td>
<td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td>
<td><input type="number" name="i" step="0.001" min="0" max="0.255"/></td>
<td><input type="number" name="d" step="1" min="0" max="255"/></td>
</tr>
</table>
<table id="pid_baro" class="pid_tuning">
<tr class="title">
<th colspan="4">Barometer/Altitude</th>
</tr>
<tr class="ALT">
<!-- 3 -->
<td></td>
<td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td>
<td><input type="number" name="i" step="0.001" min="0" max="0.255"/></td>
<td><input type="number" name="d" step="1" min="0" max="255"/></td>
</tr>
</table>
<table id="pid_mag" class="pid_tuning">
<tr class="title">
<th colspan="4">Magnometer/Heading</th>
</tr>
<tr class="MAG">
<!-- 8 -->
<td></td>
<td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td>
</tr>
</table>
<table id="pid_sonar" class="pid_tuning">
<tr class="title">
<th colspan="4">Sonar</th>
</tr>
<tr class="Vario">
<!-- 9 -->
<td></td>
<td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td>
<td><input type="number" name="i" step="0.001" min="0" max="0.255"/></td>
<td><input type="number" name="d" step="1" min="0" max="255"/></td>
</tr>
</table>
<table id="pid_gps" class="pid_tuning">
<tr class="title">
<th colspan="4">GPS Navigation</th>
</tr>
<tr class="Pos">
<!-- 4 -->
<td></td>
<td><input type="number" name="p" step="0.01" min="0" max="2.55"/></td>
<td><input type="number" name="i" step="0.01" min="0" max="2.55"/></td>
</tr>
<tr class="PosR">
<!-- 5 -->
<td></td>
<td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td>
<td><input type="number" name="i" step="0.01" min="0" max="2.55"/></td>
<td><input type="number" name="d" step="0.001" min="0" max="0.255"/></td>
</tr>
<tr class="NavR">
<!-- 6 -->
<td></td>
<td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td>
<td><input type="number" name="i" step="0.01" min="0" max="2.55"/></td>
<td><input type="number" name="d" step="0.001" min="0" max="0.255"/></td>
</tr>
</table>
</div>
</div>
</form>
<div class="clear-both"></div>
<div class="fixed_band">

View file

@ -264,15 +264,21 @@ TABS.pid_tuning.initialize = function (callback) {
// translate to user-selected language
localize();
// locating link to used CF version
var documentationButton = $('div#content #button-documentation');
documentationButton.html("Documentation for "+CONFIG.flightControllerVersion);
documentationButton.attr("href","https://github.com/cleanflight/cleanflight/tree/v{0}/docs".format(CONFIG.flightControllerVersion));
hideUnusedPids(CONFIG.activeSensors);
$('#showAllPids').on('click', function(){
if($(this).text() == "Show All PIDs") {
if($(this).text() == "Show all PIDs") {
$('.tab-pid_tuning table.pid_tuning').show();
$(this).text('Hide Unused PIDs');
$(this).text('Hide unused PIDs');
} else {
hideUnusedPids(CONFIG.activeSensors);
$(this).text('Show All PIDs');
$(this).text('Show all PIDs');
}
});

View file

@ -1,5 +1,5 @@
.tab-ports {
position: relative;
position: absolute;
height: calc(100%; - 40px);
}
@ -7,12 +7,9 @@
display: none;
}
.tab-ports table {
margin-bottom: 10px;
width:100%;
border-collapse:collapse;
}
.tab-ports table,
@ -21,42 +18,38 @@
border-left:0px;
border-right:0px;
border-top:0px;
border-right:1px solid #e4e4e4;
border-left:1px solid #e4e4e4;
}
.tab-ports table tr td:first-child {
text-align: left;
}
table.ports tr:first-child td:first-child { border-top-left-radius: 0px;
}
table.ports tr:first-child td:last-child { border-top-right-radius: 0px; }
.tab-ports table td {
border-bottom:1px solid #e4e4e4;
padding-top:4px;
padding-bottom:4px;
padding-top:6px;
padding-bottom:7px;
padding-left:5px;
padding-right:5px;
border-left:1px solid #e4e4e4;
border-right:1px solid #e4e4e4;
}
.tab-ports table thead tr:first-child,
.tab-ports table tr:nth-child(even) {
background-color:#f9f9f9; }
background-color:#f9f9f9;
}
.tab-ports table thead tr:first-child {
background-color:#e4e4e4;
font-size:14px;
font-size:12px;
height:25px;
font-family: 'open_sansregular', Arial;
border-top:0px;
border-right:0px;
border-left:0px;
}
.tab-ports .function input {
@ -71,25 +64,6 @@ table.ports tr:first-child td:last-child { border-top-right-radius: 0px; }
border: 1px solid silver;
}
.tab-ports .save {
display: block;
float: right;
height: 28px;
line-height: 28px;
padding: 0 15px 0 15px;
text-align: center;
font-weight: bold;
border: 1px solid silver;
background-color: #ececec;
}
.tab-ports .save:hover {
background-color: #dedcdc;
}
.tab-ports .require-support {
display:none;
@ -111,6 +85,36 @@ table.ports tr:first-child td:last-child { border-top-right-radius: 0px; }
}
.tab-ports .ports thead td {
text-align: left;
white-space: nowrap;
padding: 5px 7px;
background-color: #828885;
color: white;
}
.tab-ports .ports thead td:first-child {
border-top-left-radius: 5px;
border-left:0px;
}
.tab-ports .ports thead td:last-child {
border-top-right-radius: 5px;
border-right:0px;
}
.tab-ports .ports td:first-child {
font-weight:bold;
}
.tab-ports .fixed_band .save_btn a {
line-height:28px;
}
@media only screen and (max-width: 1055px), only screen and (max-device-width: 1055px) {

View file

@ -26,8 +26,13 @@
</table>
<div class="clear-both"></div>
</div>
<div class="note require-upgrade" i18n="portsFirmwareUpgradeRequired">
<div class="note require-upgrade">
<div class="note_spacer">
<p i18n="portsFirmwareUpgradeRequired"></p>
</div>
</div>
<div class="fixed_band" style="position: fixed;">
<div class="save_btn"><a class="save" href="#" i18n="configurationButtonSave"></a></div>
</div>

View file

@ -73,9 +73,12 @@ TABS.ports.initialize = function (callback, scrollPosition) {
$('#content').load("./tabs/ports.html", on_tab_loaded_handler);
board_definition = BOARD.find_board_definition(CONFIG.boardIdentifier);
console.log('Using board definition', board_definition);
}
}
function update_ui() {
@ -204,6 +207,11 @@ TABS.ports.initialize = function (callback, scrollPosition) {
localize();
// locating link to used CF version
var documentationButton = $('div#content #button-documentation');
documentationButton.html("Documentation for "+CONFIG.flightControllerVersion);
documentationButton.attr("href","https://github.com/cleanflight/cleanflight/tree/v{0}/docs".format(CONFIG.flightControllerVersion));
update_ui();

View file

@ -1,369 +0,0 @@
.tab-receiver {
}
.tab-receiver input[type="number"]::-webkit-inner-spin-button {
border: 0;
}
.tab-receiver .help {
padding: 10px;
background-color: #ffcb18;
margin-bottom: 10px;
}
.tab-receiver .bars {
float: left;
width: 45%;
font-weight: bold;
}
.tab-receiver .bars ul {
margin-bottom: 5px;
clear: left;
}
.tab-receiver .bars li {
float: left;
height: 22px;
line-height: 20px;
white-space: nowrap;
}
.tab-receiver .bars .name {
padding: 0 10px 0 0;
width: 50px;
text-align: right;
}
.tab-receiver .bars .meter {
width: calc(100% - 60px);
}
.tab-receiver .bars .meter-bar {
position: relative;
margin-top: 2px;
width: 100%;
height: 15px;
border: 1px solid silver;
background-color: #f4f4f4;
}
.tab-receiver .bars .meter-bar .label {
position: absolute;
width: 50px;
height: 15px;
line-height: 15px;
text-align: center;
color: #474747;
}
.tab-receiver .bars .meter-bar .fill {
position: relative;
overflow: hidden;
width: 50%;
height: 15px;
background-color: green;
}
.tab-receiver .bars .meter-bar .fill .label {
color: white;
}
.tab-receiver .bars ul:nth-of-type(1) .fill {
background-color: #00A8F0;
}
.tab-receiver .bars ul:nth-of-type(2) .fill {
background-color: #C0D800;
}
.tab-receiver .bars ul:nth-of-type(3) .fill {
background-color: #f8921a;
}
.tab-receiver .bars ul:nth-of-type(4) .fill {
background-color: #f02525;
}
.tab-receiver .bars ul:nth-of-type(5) .fill {
background-color: #9440ED;
}
.tab-receiver .bars ul:nth-of-type(6) .fill {
background-color: #45147a;
}
.tab-receiver .bars ul:nth-of-type(7) .fill {
background-color: #cf7a26;
}
.tab-receiver .bars ul:nth-of-type(8) .fill {
background-color: #147a66;
}
.tab-receiver .bars ul:nth-of-type(9) .fill {
background-color: #0609a9;
}
.tab-receiver .bars ul:nth-of-type(10) .fill {
background-color: #7a1445;
}
.tab-receiver .bars ul:nth-of-type(11) .fill {
background-color: #267acf;
}
.tab-receiver .bars ul:nth-of-type(12) .fill {
background-color: #7a6614;
}
.tab-receiver .bars ul:nth-of-type(13) .fill {
background-color: #cf267d;
}
.tab-receiver .bars ul:nth-of-type(14) .fill {
background-color: #7a1464;
}
.tab-receiver .bars ul:nth-of-type(15) .fill {
background-color: #3a7a14;
}
.tab-receiver .bars ul:nth-of-type(16) .fill {
background-color: #14407a;
}
.tab-receiver .tunings {
float: right;
}
.tab-receiver .tunings table {
border-collapse: collapse;
}
.tab-receiver .tunings .throttle {
margin-bottom: 10px;
}
.tab-receiver .tunings .rate {
margin-bottom: 10px;
}
.tab-receiver .tunings .yaw_rate {
margin-left: 127px;
margin-bottom: 10px;
}
.tab-receiver .tunings table, .tab-receiver .tunings table th, .tab-receiver .tunings table td {
padding: 4px;
border: 1px solid #8b8b8b;
}
.tab-receiver .tunings table th {
width: 118px;
}
.tab-receiver .tunings table td {
padding: 1px;
}
.tab-receiver .tunings table tr:nth-child(odd) {
background-color: #ececec;
}
.tab-receiver .tunings table input {
width: 100%;
height: 20px;
line-height: 20px;
text-align: right;
}
.tab-receiver .rssi_channel_wrapper {
float: right;
margin: 10px 0 0 0;
width: 126px;
border: 1px solid #8b8b8b;
border-left: 0;
}
.tab-receiver .rssi_channel_wrapper .head {
height: 15px;
padding: 4px;
text-align: center;
font-weight: bold;
border-bottom: 1px solid #8b8b8b;
background-color: #ececec;
}
.tab-receiver .rssi_channel_wrapper select {
width: 100%;
height: 22px;
padding-left: 5px;
}
.tab-receiver .rcmap_wrapper {
float: right;
position: relative;
margin: 10px 0 0 0;
width: 126px;
border: 1px solid #8b8b8b;
}
.tab-receiver .rcmap_wrapper .head {
height: 15px;
padding: 4px;
text-align: center;
font-weight: bold;
border-bottom: 1px solid #8b8b8b;
background-color: #ececec;
}
.tab-receiver .rcmap_wrapper .head span {
border-bottom: 1px dashed silver;
}
.tab-receiver .hybrid_element input {
position: absolute;
padding-left: 5px;
width: calc(100% - 24px);
height: 22px;
z-index: 2;
}
.tab-receiver .hybrid_element select {
width: 100%;
height: 22px;
z-index: 1;
}
.tab-receiver .curves {
float: right;
}
.tab-receiver .throttle_curve {
margin: 0 10px 10px 0;
width: 220px;
height: 120px;
border: 1px solid silver;
}
.tab-receiver .pitch_roll_curve {
margin: 0 10px 0 0;
width: 220px;
height: 120px;
border: 1px solid silver;
}
.tab-receiver select[name="rx_refresh_rate"] {
float: right;
border: 1px solid silver;
}
.tab-receiver #RX_plot {
width: 100%;
height: 200px;
}
.tab-receiver #RX_plot .line:nth-child(1) {
stroke: #00A8F0;
}
.tab-receiver #RX_plot .line:nth-child(2) {
stroke: #C0D800;
}
.tab-receiver #RX_plot .line:nth-child(3) {
stroke: #f8921a;
}
.tab-receiver #RX_plot .line:nth-child(4) {
stroke: #f02525;
}
.tab-receiver #RX_plot .line:nth-child(5) {
stroke: #9440ED;
}
.tab-receiver #RX_plot .line:nth-child(6) {
stroke: #45147A;
}
.tab-receiver #RX_plot .line:nth-child(7) {
stroke: #CF7A26;
}
.tab-receiver #RX_plot .line:nth-child(8) {
stroke: #147A66;
}
.tab-receiver #RX_plot .line:nth-child(9) {
stroke: #0609a9;
}
.tab-receiver #RX_plot .line:nth-child(10) {
stroke: #7a1445;
}
.tab-receiver #RX_plot .line:nth-child(11) {
stroke: #267acf;
}
.tab-receiver #RX_plot .line:nth-child(12) {
stroke: #7a6614;
}
.tab-receiver #RX_plot .line:nth-child(13) {
stroke: #cf267d;
}
.tab-receiver #RX_plot .line:nth-child(14) {
stroke: #7a1464;
}
.tab-receiver #RX_plot .line:nth-child(15) {
stroke: #3a7a14;
}
.tab-receiver #RX_plot .line:nth-child(16) {
stroke: #14407a;
}
.tab-receiver .buttons {
width: calc(100% - 20px);
position: absolute;
bottom: 10px;
}
.tab-receiver .sticks,
.tab-receiver .update,
.tab-receiver .refresh {
display: block;
float: right;
margin-top: 22px;
height: 28px;
line-height: 28px;
padding: 0 15px 0 15px;
text-align: center;
font-weight: bold;
border: 1px solid silver;
background-color: #ececec;
}
.tab-receiver .sticks,
.tab-receiver .refresh {
margin-right: 10px;
}
.tab-receiver .update:hover,
.tab-receiver .refresh:hover {
background-color: #dedcdc;
}
/* SVG classes*/
.tab-receiver .grid .tick {
stroke: silver;
shape-rendering: crispEdges;
}
.tab-receiver .line {
stroke-width: 2px;
fill: none;
}
.tab-receiver .grid path {
stroke-width: 0;
}
.tab-receiver .axis path, .axis line {
fill: none;
stroke: #000;
shape-rendering: crispEdges;
}
.tab-receiver .fixed_band {
position: fixed;
width: 100%;
bottom: 0px;
}
@media only screen and (max-width: 1055px), only screen and (max-device-width: 1055px) {
.tab-receiver .fixed_band {
width: calc(100% - -5px);
}
.tab-receiver .fixed_band .save_btn a {
margin-right:15px;
}
}

View file

@ -39,6 +39,12 @@ TABS.receiver.initialize = function (callback) {
// translate to user-selected language
localize();
// locating link to used CF version
var documentationButton = $('div#content #button-documentation');
documentationButton.html("Documentation for "+CONFIG.flightControllerVersion);
documentationButton.attr("href","https://github.com/cleanflight/cleanflight/tree/v{0}/docs".format(CONFIG.flightControllerVersion));
// fill in data from RC_tuning
$('.tunings .throttle input[name="mid"]').val(RC_tuning.throttle_MID.toFixed(2));
$('.tunings .throttle input[name="expo"]').val(RC_tuning.throttle_EXPO.toFixed(2));

View file

@ -3,13 +3,7 @@
.tab-sensors .info {
margin-bottom: 10px;
}
.tab-sensors .info p {
padding: 5px;
border: 1px dashed silver;
margin-bottom: 10px;
}
.tab-sensors .info input {
vertical-align: middle;
margin: 0 5px 0 15px;

View file

@ -1,20 +1,28 @@
<div id="content-watermark"></div>
<div class="tab-sensors">
<div class="tab_title" i18n="tabRawSensorData">tabRawSensorData</div>
<div class="cf_doc_version_bt">
<a id="button-documentation" href="https://github.com/cleanflight/cleanflight/releases" target="_blank"></a></div>
<div class="note" style="margin-bottom:10px;">
<div class="note_spacer">
<p i18n="sensorsInfo">Keep in mind that using fast update periods and rendering multiple graphs at the same time is resource heavy and will burn your battery quicker if you use a laptop. We recommend to only render graphs for sensors you are interested in while using reasonable update periods.
</p>
</div>
</div>
<div class="info">
<p i18n="sensorsInfo">
Keep in mind that using fast update periods and rendering multiple graphs at the same time
is resource heavy and will burn your battery quicker if you use a laptop.<br />
We recommend to only render graphs for sensors you are interested in while using reasonable update periods.
</p>
<div class="checkboxes">
<label><input type="checkbox" name="gyro_on" class="first" />Gyroscope</label>
<label><input type="checkbox" name="accel_on" />Accelerometer</label>
<label><input type="checkbox" name="mag_on" />Magnetometer</label>
<label><input type="checkbox" name="baro_on" />Barometer</label>
<label><input type="checkbox" name="sonar_on" />Sonar</label>
<label><input type="checkbox" name="debug_on" />Debug</label>
<label><input type="checkbox" name="gyro_on" class="first"/>Gyroscope</label>
<label><input type="checkbox" name="accel_on"/>Accelerometer</label>
<label><input type="checkbox" name="mag_on"/>Magnetometer</label>
<label><input type="checkbox" name="baro_on"/>Barometer</label>
<label><input type="checkbox" name="sonar_on"/>Sonar</label>
<label><input type="checkbox" name="debug_on"/>Debug</label>
</div>
</div>
<div class="wrapper gyro">
<div class="plot_control">
<div class="title">Gyroscope - deg/s</div>
@ -266,4 +274,3 @@
<g class="axis y" transform="translate(40, 10)"></g>
</svg>
</div>
</div>

View file

@ -184,6 +184,24 @@ TABS.sensors.initialize = function (callback) {
// translate to user-selected language
localize();
// locating link to used CF version
var documentationButton = $('div#content #button-documentation');
documentationButton.html("Documentation for "+CONFIG.flightControllerVersion);
documentationButton.attr("href","https://github.com/cleanflight/cleanflight/tree/v{0}/docs".format(CONFIG.flightControllerVersion));
// load switchery
var elems = Array.prototype.slice.call(document.querySelectorAll('#toggle'));
elems.forEach(function(html) {
var switchery = new Switchery(html,
{
color: '#59aa29',
secondaryColor: '#c4c4c4'
});
});
// disable graphs for sensors that are missing
var checkboxes = $('.tab-sensors .info .checkboxes input');
if (!bit_check(CONFIG.activeSensors, 1)) { // baro

View file

@ -4,16 +4,15 @@
border: 0;
}
.tab-servos .title {
margin-top: 10px;
line-height: 20px;
margin-top: 0px;
line-height: 30px;
text-align: center;
font-weight: bold;
border: 1px solid #8b8b8b;
border-bottom: 0;
background-color: #ececec;
float:left;
width: calc(100% - 2px);
}
.tab-servos table.directions td.direction select {
height: 19px;
@ -22,6 +21,7 @@
.tab-servos table {
width: 100%;
border-collapse: collapse;
float:left;
}
.tab-servos table th {
line-height: 20px;
@ -123,11 +123,10 @@
border: 1px solid silver;
background-color: #ececec;
}
.tab-servos .update:hover {
background-color: #dedcdc;
}
.tab-servos .require-support {
float:left;
display:none;
}
.tab-servos.supported .require-support {
@ -138,4 +137,35 @@
}
.tab-servos.supported .require-upgrade {
display:none;
float:left;
}
.tab-servos .fixed_band {
bottom: 0px;
float:left;
position:fixed;
bottom:0px;
width:100%;
}
.tab-servos .save_btn a {
line-height: 28px;
}
@media only screen and (max-width: 1055px), only screen and (max-device-width: 1055px) {
.tab-servos .fixed_band {
margin: 0px;
width: calc(100% - 0px);
margin-left: -15px;
}
}

View file

@ -1,4 +1,8 @@
<div class="tab-servos">
<div class="tab_title" i18n="tabServos">Servos</div>
<div class="cf_doc_version_bt">
<a id="button-documentation" href="" target="_blank"></a>
</div>
<div class="require-support">
<div class="title" i18n="servosChangeDirection"></div>
<table class="fields">
@ -16,13 +20,19 @@
</tr>
</table>
<div class="live">
<span i18n="servosLiveMode"></span> <input type="checkbox" />
</div>
<div class="buttons">
<a class="update" href="#" i18n="servosButtonSave"></a>
<input type="checkbox" id="toggle" /> <span i18n="servosLiveMode"></span>
</div>
<div class="fixed_band">
<div class="save_btn"><a class="save" href="#" i18n="servosButtonSave"></a></div>
</div>
<div class="note require-upgrade" i18n="servosFirmwareUpgradeRequired">
</div>
<div class="note require-upgrade">
<div class="note_spacer">
<p i18n="servosFirmwareUpgradeRequired"></p>
</div>
</div>
</div>

View file

@ -37,10 +37,12 @@ TABS.servos.initialize = function (callback) {
function load_html() {
$('#content').load("./tabs/servos.html", process_html);
}
MSP.send_message(MSP_codes.MSP_IDENT, false, false, get_servo_configurations);
function update_ui() {
if (semver.lt(CONFIG.apiVersion, "1.12.0")) {
@ -174,7 +176,7 @@ TABS.servos.initialize = function (callback) {
}
});
$('a.update').click(function () {
$('a.save').click(function () {
servos_update(true);
});
@ -187,6 +189,22 @@ TABS.servos.initialize = function (callback) {
// translate to user-selected language
localize();
// locating link to used CF version
var documentationButton = $('div#content #button-documentation');
documentationButton.html("Documentation for "+CONFIG.flightControllerVersion);
documentationButton.attr("href","https://github.com/cleanflight/cleanflight/tree/v{0}/docs".format(CONFIG.flightControllerVersion));
// load switchery
var elems = Array.prototype.slice.call(document.querySelectorAll('#toggle'));
elems.forEach(function(html) {
var switchery = new Switchery(html,
{
color: '#59aa29',
secondaryColor: '#c4c4c4'
});
});
// status data pulled via separate timer with static speed
GUI.interval_add('status_pull', function () {
MSP.send_message(MSP_codes.MSP_STATUS);

View file

@ -1,6 +1,6 @@
.model-and-info {
.tab_setup .model-and-info {
float: left;
}
@ -16,13 +16,13 @@ margin-bottom:10px;
#interactive_block {
position: absolute;
width: calc(75% - 40px);
width: calc(75% - 30px);
height: calc(100% - 245px);
background-color:#f9f9f9;
border-radius: 5px;
border:1px solid #e4e4e4;
margin-bottom:10px;
min-height:404px;
min-height:400px;
}
.attitude_info {
@ -60,22 +60,16 @@ margin-bottom:10px;
right:10px;
z-index:10;
border-radius:3px;
bottom: 10px;
right: 10px;
height: 28px;
line-height: 28px;
padding: 0 15px 0 15px;
text-align: center;
font-weight: bold;
border: 1px solid silver;
background-color: #ececec;
border-radius: 3px:
z-index: 100;
}
#interactive_block a.reset:hover {
@ -99,67 +93,56 @@ margin-bottom:10px;
.gui_box grey .block {
float: left;
display: block;
margin-left: 10px;
border: 1px solid silver;
}
.gui_box grey .block .head {
display: block;
text-align: center;
line-height: 20px;
font-weight: bold;
border-bottom: 1px solid silver;
background-color: #ececec;
}
.gui_box grey .block.info {
display: inline-block;
margin-bottom: 10px;
vertical-align: top;
font-size: 12px;
border: 1px solid silver;
}
.tab-setup .block.info .fields {
.block.info .fields {
padding: 5px 5px 3px 5px;
}
.tab-setup .block.info dt {
.block.info dt {
float: left;
width: 99px;
height: 20px;
line-height: 20px;
}
.tab-setup .block.info dd {
.block.info dd {
width: 76px;
height: 20px;
line-height: 20px;
margin-left: 99px;
}
.tab-setup .block.gps {
.block.gps {
width: 185px;
margin-bottom: 10px;
}
.tab-setup .block.gps .fields {
.block.gps .fields {
padding: 5px 5px 3px 5px;
}
.tab-setup .block.gps dt {
.block.gps dt {
float: left;
width: 85px;
height: 20px;
margin-bottom: 2px;
line-height: 20px;
}
@ -167,27 +150,23 @@ margin-bottom:10px;
width: 285px;
align-content:center;
text-align:center;
ma
}
.buttons {
bottom: 20px;
}
.update {
display: block;
float: right;
height: 28px;
line-height: 28px;
padding: 0 15px 0 15px;
text-align: center;
font-weight: bold;
border: 1px solid silver;
background-color: #ececec;
}
.tab-setup .update:hover {
.update:hover {
background-color: #dedcdc;
}
@ -198,13 +177,26 @@ margin-bottom:10px;
}
@media only screen and (max-width: 1055px), only screen and (max-device-width: 1055px) {
.block.instrument .attitude {
width:50px !important;
height:50px !important;
}
.block.instrument .heading {
width:50px;
height:50px;
}
#interactive_block {
position: absolute;
width: calc(75% - 30px);
min-height:356px;
width: calc(75% - 20px);
min-height:300px;
height: calc(100% - 218px);
}

View file

@ -1,9 +1,8 @@
<div class="tab-setup">
<!-- should be the first DIV on each tab -->
<div class="cf_column full" style="margin-bottom:10px;">
<div class="tab_title" i18n="tabSetup">Setup</div>
<div class="cf_doc_version_bt">
<a id="button-documentation" href="https://github.com/cleanflight/cleanflight/releases" target="_blank"></a>
<a id="button-documentation" href="" target="_blank"></a>
</div>
<div class="cf_column fourth" style="min-height:100px; width:20%;">
<div class="spacer_right">
@ -16,21 +15,17 @@
</div>
</div>
<div class="half">
<div class="spacer_left">
<div class="default_btn half"><a class="restore" href="#" i18n="initialSetupButtonRestore"></a></div>
</div>
</div>
</div>
</div>
<div class="threefourth_right" style="width:80%;">
<div class="spacer_left">
<div class="cell_setup"><span i18n="initialSetupCalibrateAccelText"></span></div>
<div class="cell_setup"><span i18n="initialSetupCalibrateMagText"></span></div>
<div class="cell_setup"><span i18n="initialSetupResetText"></span></div>
<div class="cell_setup"><span i18n="initialSetupBackupRestoreText"></span></div>
</div>
</div>
</div>
<div style="clear:both; margin-bottom:5px;"></div>
<div class="cf_column threefourth_left" >
<div class="spacer_right">
@ -59,7 +54,6 @@
<div class="gui_box grey">
<div class="gui_box_titlebar">
<div class="spacer_box_title" i18n="initialSetupInfoHead"></div>
<div class="helpicon"></div>
</div>
<div class="spacer_box">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="cf_table">

View file

@ -35,6 +35,14 @@ TABS.setup.initialize = function (callback) {
MSP.send_message(MSP_codes.MSP_ACC_TRIM, false, false, load_status);
function process_html() {
// locating link to used CF version
var documentationButton = $('div#content #button-documentation');
documentationButton.html("Documentation for "+CONFIG.flightControllerVersion);
documentationButton.attr("href","https://github.com/cleanflight/cleanflight/tree/v{0}/docs".format(CONFIG.flightControllerVersion));
// translate to user-selected language
localize();