1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-16 21:05:28 +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){ if ("CLFL" == CONFIG.flightControllerIdentifier){
/* placing this elsewhere /* placing this elsewhere
var documentationButton = $('#button-documentation'); documentationButton.show();
documentationButton.show();
var documentationButton = $('div#content #button-documentation');
documentationButton.html("Documentation for "+CONFIG.flightControllerVersion); documentationButton.html("Documentation for "+CONFIG.flightControllerVersion);
documentationButton.attr("href","https://github.com/cleanflight/cleanflight/tree/v{0}/docs".format(CONFIG.flightControllerVersion)); documentationButton.attr("href","https://github.com/cleanflight/cleanflight/tree/v{0}/docs".format(CONFIG.flightControllerVersion));
*/
/* */ /* */
var sensor_state = $('#sensor-status'); 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 { .cf_doc_version_bt a:before {
content:"Documentation 1.10"; content:"Documentation 1.10";
} }
*/
.cf_doc_version_bt a { .cf_doc_version_bt a {
padding:1px 9px 1px 9px; padding:1px 9px 1px 9px;
@ -587,9 +588,16 @@ input[type="number"]::-webkit-inner-spin-button {
.logswitch a { .logswitch a {
color:#656565 !important; color:#656565 !important;
transition: all 0.3s;
} }
.logswitch a:hover {
color:#959595 !important;
text-decoration:none !important;
transition: all 0.3s;
}
.tab_container { .tab_container {
float:left; float:left;
@ -1062,15 +1070,15 @@ dialog {
.spacer_left { .spacer_left {
padding-left:7px; padding-left:15px;
float:left; float:left;
width:calc(100% - 7px); width:calc(100% - 15px);
} }
.spacer_right { .spacer_right {
padding-right:7px; padding-right:15px;
width:calc(100% - 7px); width:calc(100% - 15px);
float:left; float:left;
} }
@ -1095,13 +1103,13 @@ dialog {
.gui_box_titlebar { .gui_box_titlebar {
background-color:#e4e4e4; background-color:#e4e4e4;
border-radius:3px 3px 0px 0px; border-radius:3px 3px 0px 0px;
font-size:14px; font-size:13px;
width:100%; width:100%;
height:25px; height:27px;
padding-bottom:0px; padding-bottom:0px;
float:left; float:left;
margin-bottom:7px; margin-bottom:7px;
font-family: 'open_sansregular', Arial; font-family: 'open_sanssemibold', Arial;
} }
@ -1154,6 +1162,7 @@ dialog {
padding:0px; padding:0px;
padding-left:9px; padding-left:9px;
padding-right:9px; padding-right:9px;
line-height:28px;
} }
@ -1280,16 +1289,18 @@ dialog {
float:left; float:left;
margin-top:-5px; margin-top:-5px;
font-size:11px; font-size:11px;
width:100%;
} }
.cf_table td { .cf_table td {
border:0px; border:0px;
border-bottom: solid 1px #ccc; border-bottom: solid 1px #ccc;
padding-top:4px; padding-top:2px;
padding-bottom:4px; padding-bottom:5px;
border-style: dotted; border-style: dotted;
} }
.noboarder td{ .noboarder td{
border:none; border:none;
@ -1515,8 +1526,8 @@ body {
} }
.gui_box_titlebar { .gui_box_titlebar {
font-size:13px; font-size:12px;
height:22px; height:24px;
padding-bottom:0px; padding-bottom:0px;
margin-bottom:5px; margin-bottom:5px;
} }
@ -1524,7 +1535,7 @@ body {
.spacer_box_title { .spacer_box_title {
padding-left: 10px; padding-left: 10px;
padding-right: 10px; padding-right: 10px;
padding-top: 1px; padding-top: 3px;
margin-bottom: 0px; margin-bottom: 0px;
} }
@ -1542,5 +1553,17 @@ input {
width:14px; width:14px;
} }
.gps_false {
padding:0px 3px 0px 3px;
font-size:10px;
}
.gps_true {
padding:0px 3px 0px 3px;
font-size:10px;
}
} }

View file

@ -7,8 +7,8 @@
.tab-adjustments .range .marker, .tab-adjustments .range .marker,
.tab-adjustments .channel-slider .noUi-connect { .tab-adjustments .channel-slider .noUi-connect {
background: #92b67c; background: #92b67c;
box-shadow: inset 0 0px 2px rgba(0, 0, 0, 0.4),0px 1px 0px rgba(255, 255, 255, 0.6); box-shadow: inset 0 0px 2px rgba(0, 0, 0, 0.4),0px 1px 0px rgba(255, 255, 255, 0.6);
} }
@ -23,44 +23,63 @@
background: #D2D2D2; 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 { .tab-adjustments .adjustments {
width: 100%; width: 100%;
border-spacing: 0px; 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 { .tab-adjustments .adjustments thead td {
text-align: center; text-align: center;
white-space: nowrap; white-space: nowrap;
padding: 10px 10px; 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 { .tab-adjustments .adjustments thead td:last-child {
background-color: #ececec; border-top-right-radius: 5px;
} }
.tab-adjustments .adjustment:nth-child(odd) { .tab-adjustments .adjustment:nth-child(odd) {
background-color: #ffffff; background-color:#f4f4f4;
} }
.tab-adjustments .adjustments {
background-color:#e4e4e4;
}
.tab-adjustments .adjustment select { .tab-adjustments .adjustment select {
outline: 1px solid silver; /* outline: 1px solid silver; */
} border-radius: 3px;
border: 1px solid silver;#}
.tab-adjustments .adjustment td { .tab-adjustments .adjustment td {
text-align: center; text-align: center;
@ -81,7 +100,7 @@
} }
.tab-adjustments .adjustment .channelInfo .limits { .tab-adjustments .adjustment .channelInfo .limits {
padding: 10px 0px; padding: 5px 0px;
} }
.tab-adjustments .adjustment .range { .tab-adjustments .adjustment .range {
@ -115,26 +134,10 @@
width: 5%; width: 5%;
} }
.tab-adjustments > .buttons { .tab-adjustments .save_btn a {
margin-top: 10px; line-height: 28px;
} }
.tab-adjustments > .buttons a { .tab-adjustments .fixed_band {
float: right; margin-top: 5px;
height: 28px;
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;
} }

View file

@ -1,12 +1,20 @@
<div class="tab-adjustments"> <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="adjustmentsHelp"></p>
<p i18n="adjustmentsExamples"></p> <p i18n="adjustmentsExamples"></p>
<ul> <ul>
<li i18n="adjustmentsExample1"></li> <li i18n="adjustmentsExample1"></li>
<li i18n="adjustmentsExample2"></li> <li i18n="adjustmentsExample2"></li>
</ul> </ul>
</div>
</div> </div>
<table class="adjustments"> <table class="adjustments">
<thead> <thead>
<tr> <tr>
@ -28,9 +36,11 @@
</tbody> </tbody>
</table> </table>
<div class="buttons"> <div class="fixed_band">
<a class="save" href="#" i18n="adjustmentsSave"></a> <div class="save_btn"><a class="save" href="#" i18n="adjustmentsSave"></a></div>
</div> </div>
</div> </div>
<div id="tab-adjustments-templates"> <div id="tab-adjustments-templates">
@ -39,7 +49,7 @@
<tr class="adjustment"> <tr class="adjustment">
<td class="info"> <td class="info">
<div class="enabling"> <div class="enabling">
<input type="checkbox" class="enable"/> <input type="checkbox" class="enable" id="toggle" />
</div> </div>
</td> </td>
<td class="channelInfo"> <td class="channelInfo">

View file

@ -178,7 +178,22 @@ TABS.adjustments.initialize = function (callback) {
// translate to user-selected language // translate to user-selected language
localize(); localize();
// UI Hooks // 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 () { $('a.save').click(function () {
// update internal data structures based on current UI elements // update internal data structures based on current UI elements

View file

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

View file

@ -12,7 +12,7 @@
<tbody> <tbody>
</tbody> </tbody>
</table> </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 class="save_btn"><a class="save" href="#" i18n="auxiliaryButtonSave"></a></div>
</div> </div>
</div> </div>

View file

@ -23,6 +23,7 @@ TABS.auxiliary.initialize = function (callback) {
$('#content').load("./tabs/auxiliary.html", process_html); $('#content').load("./tabs/auxiliary.html", process_html);
} }
MSP.send_message(MSP_codes.MSP_BOXNAMES, false, false, get_mode_ranges); MSP.send_message(MSP_codes.MSP_BOXNAMES, false, false, get_mode_ranges);
function createMode(modeIndex, modeId) { function createMode(modeIndex, modeId) {
@ -168,7 +169,12 @@ TABS.auxiliary.initialize = function (callback) {
// translate to user-selected language // translate to user-selected language
localize(); localize();
// UI Hooks // 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 () { $('a.save').click(function () {
// update internal data structures based on current UI elements // update internal data structures based on current UI elements

View file

@ -305,6 +305,27 @@ height:21px;
float:left; 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 { .tab-configuration .gps .gui_box {
min-height:352px; min-height:352px;
float:left; float:left;
@ -354,10 +375,12 @@ height:21px;
} }
.tab-configuration .gui_box span { .tab-configuration .gui_box span {
font-style: italic; font-style: normal;
font-family: 'open_sansregular', Arial; font-family: 'open_sansregular', Arial;
line-height:19px; line-height:19px;
color:#7d7d7d; color:#7d7d7d;
font-size:11px;
} }
@ -367,6 +390,7 @@ height:21px;
.tab-configuration .gui_box span { .tab-configuration .gui_box span {
line-height:17px; line-height:17px;
} }
.tab-configuration .leftWrapper { .tab-configuration .leftWrapper {

View file

@ -67,7 +67,12 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
// translate to user-selected language // translate to user-selected language
localize(); localize();
var mixer_list_e = $('select.mixerList'); // 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++) { for (var i = 0; i < mixerList.length; i++) {
mixer_list_e.append('<option value="' + (i + 1) + '">' + mixerList[i].name + '</option>'); 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,7 +86,12 @@ TABS.dataflash.initialize = function (callback) {
// translate to user-selected language // translate to user-selected language
localize(); localize();
if (TABS.dataflash.available) { // 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; var supportsDataflash = DATAFLASH.totalSize > 0;
$(".tab-dataflash").toggleClass("supported", supportsDataflash); $(".tab-dataflash").toggleClass("supported", supportsDataflash);

View file

@ -1,30 +1,8 @@
.tab-gps { .tab-gps {
} }
.tab-gps .GPS_info { .tab-gps progress {
float: left; width:100%;
display: block; border-radius:3px;
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 .GPS_info .head, .tab-gps .GPS_info .head,
.tab-gps .GPS_signal_strength .head { .tab-gps .GPS_signal_strength .head {
@ -33,7 +11,6 @@
text-align: center; text-align: center;
line-height: 20px; line-height: 20px;
font-weight: bold; font-weight: bold;
border-bottom: 1px solid silver; border-bottom: 1px solid silver;
background-color: #ececec; background-color: #ececec;
} }
@ -42,4 +19,26 @@
} }
.tab-gps a:hover { .tab-gps a:hover {
text-decoration: underline; 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="tab-gps">
<div class="GPS_info"> <div class="tab_title" i18n="tabGPS">GPS</div>
<span class="head" i18n="gpsHead"></span> <div class="cf_doc_version_bt">
<table> <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> <tr>
<td style="width: 85px" i18n="gps3dFix"></td> <td style="width: 85px" i18n="gps3dFix"></td>
<td class="fix" i18n="gpsFixFalse"></td> <td class="fix" i18n="gpsFixFalse"></td>
@ -26,19 +37,27 @@
<td i18n="gpsSats"></td> <td i18n="gpsSats"></td>
<td class="sats">0</td> <td class="sats">0</td>
</tr> </tr>
<tr> <tr class="noboarder">
<td i18n="gpsDistToHome"></td> <td i18n="gpsDistToHome"></td>
<td class="distToHome"></td> <td class="distToHome"></td>
</tr> </tr>
</table> </table>
</div> </div>
<div class="GPS_signal_strength"> </div>
<span class="head" i18n="gpsSignalStrHead"></span> </div>
<table> </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"> <tr class="titles">
<td style="width: 40px;">Sat ID</td> <td style="width: 20%;">Sat ID</td>
<td style="width: 30px;">Qty</td> <td style="width: 15%;">Qty</td>
<td i18n="gpsSignalStr">Signal Strength</td> <td style="width: 65%;" i18n="gpsSignalStr">Signal Strength</td>
</tr> </tr>
<tr> <tr>
<td>0</td> <td>0</td>
@ -115,11 +134,15 @@
<td>0</td> <td>0</td>
<td><progress value="0" max="99"></progress></td> <td><progress value="0" max="99"></progress></td>
</tr> </tr>
<tr> <tr class="noboarder">
<td>0</td> <td>0</td>
<td>0</td> <td>0</td>
<td><progress value="0" max="99"></progress></td> <td><progress value="0" max="99"></progress></td>
</tr> </tr>
</table> </table>
</div> </div>
</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); MSP.send_message(MSP_codes.MSP_STATUS, false, false, load_html);
function process_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 // translate to user-selected language
localize(); localize();

View file

@ -1,7 +1,17 @@
<div class="tab-led-strip"> <div class="tab-led-strip">
<div class="help"> <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> <p i18n="ledStripHelp"></p>
</div>
</div> </div>
<div class="mainGrid"></div> <div class="mainGrid"></div>
<div class="gridSections"> <div class="gridSections">
<div class="block"></div> <div class="block"></div>
@ -78,7 +88,9 @@
<p>LEDs without wire ordering number will not be saved.</p> <p>LEDs without wire ordering number will not be saved.</p>
</div> </div>
<div class="clear-both"></div> <div class="clear-both"></div>
<div class="buttons">
<div class="buttons">
<a class="save" href="#" i18n="ledStripButtonSave"></a> <a class="save" href="#" i18n="ledStripButtonSave"></a>
</div> </div>

View file

@ -43,6 +43,11 @@ TABS.led_strip.initialize = function (callback, scrollPosition) {
localize(); 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 // Build Grid
var theHTML = []; var theHTML = [];
var theHTMLlength = 0; var theHTMLlength = 0;

View file

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

View file

@ -1,7 +1,16 @@
<div id="content-watermark"></div>
<div class="tab-logging"> <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>
<div class="properties"> <div class="properties">
<dl> <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> <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="logging" i18n="loggingStart"></a>
<a href="#" class="log_file" i18n="loggingButtonLogFile"></a> <a href="#" class="log_file" i18n="loggingButtonLogFile"></a>
</div> </div>
</div>

View file

@ -30,7 +30,13 @@ TABS.logging.initialize = function (callback) {
// translate to user-selected language // translate to user-selected language
localize(); localize();
// UI hooks
// 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); $('a.log_file').click(prepare_file);
$('a.logging').click(function () { $('a.logging').click(function () {

View file

@ -47,6 +47,11 @@ TABS.modes.initialize = function (callback) {
// translate to user-selected language // translate to user-selected language
localize(); 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 // generate table from the supplied AUX names and AUX data
for (var i = 0; i < AUX_CONFIG.length; i++) { for (var i = 0; i < AUX_CONFIG.length; i++) {
var line = '<tr class="switches">'; var line = '<tr class="switches">';

View file

@ -1,6 +1,9 @@
<div id="content-watermark"></div>
<div class="tab-motors"> <div class="tab-motors">
<div class="wrapper modelAndAccel"> <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"> <div class="mixerPreview">
<img src="./resources/motor_order/custom.svg" /> <img src="./resources/motor_order/custom.svg" />
</div> </div>
@ -112,4 +115,3 @@
</div> </div>
<div class="cler-both"></div> <div class="cler-both"></div>
</div> </div>
</div>

View file

@ -156,6 +156,11 @@ TABS.motors.initialize = function (callback) {
// translate to user-selected language // translate to user-selected language
localize(); 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'); $('#motorsEnableTestMode').prop('disabled', 'true');
update_model(CONFIG.multiType); update_model(CONFIG.multiType);

View file

@ -1,57 +1,114 @@
.tab-pid_tuning { .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 { .tab-pid_tuning input[type="number"]::-webkit-inner-spin-button {
border: 0; border: 0;
} }
.tab-pid_tuning table { .tab-pid_tuning table {
float: left; float: left;
margin:0px;
margin-bottom: 10px;
border-collapse: collapse; border-collapse: collapse;
width: calc(100% - -1px);
}
.tab-pid_tuning .pid_tuning {
} }
.tab-pid_tuning table, .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 { .tab-pid_tuning table td {
padding: 1px; 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) { .tab-pid_tuning table tr:nth-child(odd) {
background-color: #ececec;
} }
.tab-pid_tuning table input { .tab-pid_tuning table input {
display: block; display: block;
width: calc(100% - 2px);
width: 100%;
height: 20px; height: 20px;
line-height: 20px; line-height: 20px;
text-align: right; text-align: right;
border:0px solid #ccc;
border-radius:0px;
} }
.tab-pid_tuning .controller { .tab-pid_tuning .controller {
float: left; float: left;
width: calc(50% - 12px);
width: calc(40% - 10px);
margin-left: 10px; margin-left: 10px;
margin-bottom: 10px; margin-bottom: 10px;
border: 1px solid #8b8b8b; border-radius: 3px;
border: 1px solid #ccc;
} }
.tab-pid_tuning .controller .head { .tab-pid_tuning .controller .head {
display: block; display: block;
text-align: left;
text-align: center;
line-height: 20px; line-height: 20px;
font-weight: bold; font-weight: bold;
padding-left:5px;
border-bottom: 1px solid #8b8b8b; border-bottom: 1px solid #ccc;
background-color: #ececec; background-color: #ececec;
} }
.tab-pid_tuning .controller select { .tab-pid_tuning .controller select {
@ -61,19 +118,17 @@
} }
.tab-pid_tuning .profile { .tab-pid_tuning .profile {
float: left; float: left;
width: calc(25% - 2px); /* - border*/
width: calc(18% - 2px); /* - border*/ border: 1px solid #ccc;
border-radius: 3px;
border: 1px solid #8b8b8b;
} }
.tab-pid_tuning .profile .head { .tab-pid_tuning .profile .head {
display: block; display: block;
text-align: left;
text-align: center;
line-height: 20px; line-height: 20px;
font-weight: bold; font-weight: bold;
padding-left:5px;
border-bottom: 1px solid #8b8b8b; border-bottom: 1px solid #ccc;
background-color: #ececec; background-color: #ececec;
} }
.tab-pid_tuning .profile select { .tab-pid_tuning .profile select {
@ -82,9 +137,7 @@
height: 20px; height: 20px;
line-height: 20px; line-height: 20px;
} }
.tab-pid_tuning .pid_tuning {
width: 100%;
}
.tab-pid_tuning .pid_tuning .name { .tab-pid_tuning .pid_tuning .name {
width: 30%; width: 30%;
} }
@ -109,7 +162,7 @@
text-align: center; text-align: center;
font-weight: bold; font-weight: bold;
border: 1px solid silver; border: 1px solid #ccc;
background-color: #ececec; background-color: #ececec;
} }
.tab-pid_tuning .refresh { .tab-pid_tuning .refresh {
@ -124,19 +177,56 @@
} }
.tab-pid_tuning .fixed_band { .tab-pid_tuning .fixed_band {
position: fixed; position: absolute;
width: 100%; width: 100%;
bottom: 0px; 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) { @media only screen and (max-width: 1055px), only screen and (max-device-width: 1055px) {
.tab-pid_tuning .fixed_band { .tab-pid_tuning .fixed_band {
width: calc(100% - -5px); margin: 0px;
bottom: 0px; width: calc(100% - 0px);
margin-left: -15px;
} }
.tab-pid_tuning .fixed_band .save_btn a { .tab-pid_tuning .fixed_band .save_btn a {

View file

@ -1,187 +1,200 @@
<div class="tab-pid_tuning"> <div class="tab-pid_tuning">
<div class="tab_title" i18n="tabPidTuning"></div> <div class="tab_title" i18n="tabPidTuning"></div>
<div class="cf_doc_version_bt"> <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="https://github.com/cleanflight/cleanflight/releases" target="_blank"></a>
</div> </div>
<div class="cf_column half"> <div class="cf_column half">
<div class="spacer_right">
<div class="profile"> <div class="profile">
<span class="head" i18n="pidTuningProfileHead"></span> <span class="head" i18n="pidTuningProfileHead"></span>
<select name="profile"> <select name="profile">
<option value="0">1</option> <option value="0">1</option>
<option value="1">2</option> <option value="1">2</option>
<option value="2">3</option> <option value="2">3</option>
</select> </select>
</div> </div>
<div class="controller"> <div class="controller">
<span class="head" i18n="pidTuningControllerHead"></span> <span class="head" i18n="pidTuningControllerHead"></span>
<select name="controller"> <select name="controller">
<option value="0">0 - MultiWii (Old)</option> <option value="0">0 - MultiWii (Old)</option>
<option value="1">1 - MultiWii (rewrite)</option> <option value="1">1 - MultiWii (rewrite)</option>
<option value="2">2 - LuxFloat</option> <option value="2">2 - LuxFloat</option>
<option value="3">3 - MultiWii (2.3 - latest)</option> <option value="3">3 - MultiWii (2.3 - latest)</option>
<option value="4">4 - MultiWii (2.3 - hybrid)</option> <option value="4">4 - MultiWii (2.3 - hybrid)</option>
<option value="5">5 - Harakiri</option> <option value="5">5 - Harakiri</option>
</select> </select>
</div> </div>
</div> <div class="cf_column fourth">
</div> <div class="default_btn show"><a href="#" id="showAllPids">Show all PIDs</a></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>
</div>
<form name="pid-tuning" id="pid-tuning">
<div class="clear-both"></div>
<div class="cf_column third_right">
<div class="spacer_left">
<table class="rate-tpa">
<thead>
<tr>
<th class="roll-pitch" i18n="pidTuningRollPitchRate"></th>
<th class="roll" i18n="pidTuningRollRate"></th>
<th class="pitch" i18n="pidTuningPitchRate"></th>
<th i18n="pidTuningYawRate"></th>
</tr>
</thead>
<tbody>
<tr>
<td class="roll-pitch" ><input type="number" name="roll-pitch" step="0.01" min="0" max="1.00"/></td>
<td class="roll" ><input type="number" name="roll" step="0.01" min="0" max="1.00"/></td>
<td class="pitch" ><input type="number" name="pitch" step="0.01" min="0" max="1.00"/></td>
<td><input type="number" name="yaw" step="0.01" min="0" max="2.55"/></td>
</tr>
</tbody>
</table>
<table class="rate-tpa">
<thead>
<tr>
<th i18n="pidTuningTPA"></th>
<th class="tpa-breakpoint" i18n="pidTuningTPABreakPoint"></th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="number" name="tpa" step="0.01" min="0" max="1.00"/></td>
<td class="tpa-breakpoint"><input type="number" name="tpa-breakpoint" step="10" min="1000" max="2000" /></td>
</tr>
</tbody>
</table>
</div> </div>
</div> </div>
<div class="cf_column half"> <form name="pid-tuning" id="pid-tuning">
<div class="spacer_right"> <div class="clear-both"></div>
<table id="pid_main" class="pid_tuning"> <div class="cf_column half">
<tr class="title"> <div class="gui_box grey">
<th colspan="4">Basic/Acro</th> <table class="pid_titlebar">
</tr> <tr>
<tr> <th class="name" i18n="pidTuningName" style="width:25%;"></th>
<th class="name" i18n="pidTuningName"></th> <th class="proportional" i18n="pidTuningProportional" style="width:25%;"></th>
<th class="proportional" i18n="pidTuningProportional"></th> <th class="integral" i18n="pidTuningIntegral" style="width:25%;"></th>
<th class="integral" i18n="pidTuningIntegral"></th> <th class="derivative" i18n="pidTuningDerivative" style="width:25%;"></th>
<th class="derivative" i18n="pidTuningDerivative"></th> </tr>
</tr> </table>
<tr class="ROLL"> <table id="pid_main" class="pid_tuning">
<!-- 0 --> <tr>
<td></td> <th colspan="4">
<td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td> <div class="pid_mode">Basic/Acro</div>
<td><input type="number" name="i" step="0.001" min="0" max="0.255"/></td> </th>
<td><input type="number" name="d" step="1" min="0" max="255"/></td> </tr>
</tr> <tr class="ROLL">
<tr class="PITCH"> <!-- 0 -->
<!-- 1 --> <td></td>
<td></td> <td><input type="number" name="p" step="0.1" min="0" max="25.5"/></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="i" step="0.001" min="0" max="0.255"/></td> <td><input type="number" name="d" step="1" min="0" max="255"/></td>
<td><input type="number" name="d" step="1" min="0" max="255"/></td> </tr>
</tr> <tr class="PITCH">
<tr class="YAW"> <!-- 1 -->
<!-- 2 --> <td></td>
<td></td> <td><input type="number" name="p" step="0.1" min="0" max="25.5"/></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="i" step="0.001" min="0" max="0.255"/></td> <td><input type="number" name="d" step="1" min="0" max="255"/></td>
<td><input type="number" name="d" step="1" min="0" max="255"/></td> </tr>
</tr> <tr class="YAW">
</table> <!-- 2 -->
<table id="pid_accel" class="pid_tuning"> <td></td>
<tr class="title"> <td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td>
<th colspan="4">Accelerometer/Level</th> <td><input type="number" name="i" step="0.001" min="0" max="0.255"/></td>
</tr> <td><input type="number" name="d" step="1" min="0" max="255"/></td>
<tr class="LEVEL"> </tr>
<!-- 7 --> </table>
<td></td> <table id="pid_accel" class="pid_tuning">
<td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td> <tr>
<td><input type="number" name="i" step="0.001" min="0" max="0.255"/></td> <th colspan="4">
<td><input type="number" name="d" step="1" min="0" max="255"/></td> <div class="pid_mode">Accelerometer/Level</div>
</tr> </th>
</table> </tr>
<table id="pid_baro" class="pid_tuning"> <tr class="LEVEL">
<tr class="title"> <!-- 7 -->
<th colspan="4">Barometer/Altitude</th> <td></td>
</tr> <td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td>
<tr class="ALT"> <td><input type="number" name="i" step="0.001" min="0" max="0.255"/></td>
<!-- 3 --> <td><input type="number" name="d" step="1" min="0" max="255"/></td>
<td></td> </tr>
<td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td> </table>
<td><input type="number" name="i" step="0.001" min="0" max="0.255"/></td> <table id="pid_baro" class="pid_tuning">
<td><input type="number" name="d" step="1" min="0" max="255"/></td> <tr>
</tr> <th colspan="4">
</table> <div class="pid_mode">Barometer/Altitude</div>
<table id="pid_mag" class="pid_tuning"> </th>
<tr class="title"> </tr>
<th colspan="4">Magnometer/Heading</th> <tr class="ALT">
</tr> <!-- 3 -->
<tr class="MAG"> <td></td>
<!-- 8 --> <td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td>
<td></td> <td><input type="number" name="i" step="0.001" min="0" max="0.255"/></td>
<td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td> <td><input type="number" name="d" step="1" min="0" max="255"/></td>
</tr> </tr>
</table> </table>
<table id="pid_sonar" class="pid_tuning"> <table id="pid_mag" class="pid_tuning">
<tr class="title"> <tr>
<th colspan="4">Sonar</th> <th colspan="4">
</tr> <div class="pid_mode">Magnometer/Heading</div>
<tr class="Vario"> </th>
<!-- 9 --> </tr>
<td></td> <tr class="MAG">
<td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td> <!-- 8 -->
<td><input type="number" name="i" step="0.001" min="0" max="0.255"/></td> <td></td>
<td><input type="number" name="d" step="1" min="0" max="255"/></td> <td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td>
</tr> <td></td>
</table> <td></td>
<table id="pid_gps" class="pid_tuning"> </tr>
<tr class="title"> </table>
<th colspan="4">GPS Navigation</th> <table id="pid_sonar" class="pid_tuning">
</tr> <tr>
<tr class="Pos"> <th colspan="4">
<!-- 4 --> <div class="pid_mode">Sonar</div>
<td></td> </th>
<td><input type="number" name="p" step="0.01" min="0" max="2.55"/></td> </tr>
<td><input type="number" name="i" step="0.01" min="0" max="2.55"/></td> <tr class="Vario">
</tr> <!-- 9 -->
<tr class="PosR"> <td></td>
<!-- 5 --> <td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td>
<td></td> <td><input type="number" name="i" step="0.001" min="0" max="0.255"/></td>
<td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td> <td><input type="number" name="d" step="1" min="0" max="255"/></td>
<td><input type="number" name="i" step="0.01" min="0" max="2.55"/></td> </tr>
<td><input type="number" name="d" step="0.001" min="0" max="0.255"/></td> </table>
</tr> <table id="pid_gps" class="pid_tuning">
<tr class="NavR"> <tr>
<!-- 6 --> <th colspan="4">
<td></td> <div class="pid_mode">GPS Navigation</div>
<td><input type="number" name="p" step="0.1" min="0" max="25.5"/></td> </th>
<td><input type="number" name="i" step="0.01" min="0" max="2.55"/></td> </tr>
<td><input type="number" name="d" step="0.001" min="0" max="0.255"/></td> <tr class="Pos">
</tr> <!-- 4 -->
</table> <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>
</div> <div class="cf_column half">
</form> <div class="spacer_left">
<div class="clear-both"></div> <table class="rate-tpa">
<div class="fixed_band"> <thead>
<div class="save_btn"> <tr>
<a class="update" href="#" i18n="pidTuningButtonSave"></a> <th class="roll-pitch" i18n="pidTuningRollPitchRate"></th>
<a class="refresh" href="#" i18n="pidTuningButtonRefresh"></a> <th class="roll" i18n="pidTuningRollRate"></th>
</div> <th class="pitch" i18n="pidTuningPitchRate"></th>
</div> <th i18n="pidTuningYawRate"></th>
</tr>
</thead>
<tbody>
<tr>
<td class="roll-pitch" ><input type="number" name="roll-pitch" step="0.01" min="0" max="1.00"/></td>
<td class="roll" ><input type="number" name="roll" step="0.01" min="0" max="1.00"/></td>
<td class="pitch" ><input type="number" name="pitch" step="0.01" min="0" max="1.00"/></td>
<td><input type="number" name="yaw" step="0.01" min="0" max="2.55"/></td>
</tr>
</tbody>
</table>
<table class="rate-tpa">
<thead>
<tr>
<th i18n="pidTuningTPA"></th>
<th class="tpa-breakpoint" i18n="pidTuningTPABreakPoint"></th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="number" name="tpa" step="0.01" min="0" max="1.00"/></td>
<td class="tpa-breakpoint"><input type="number" name="tpa-breakpoint" step="10" min="1000" max="2000" /></td>
</tr>
</tbody>
</table>
</div>
</div>
</form>
<div class="clear-both"></div>
<div class="fixed_band">
<div class="save_btn">
<a class="update" href="#" i18n="pidTuningButtonSave"></a>
<a class="refresh" href="#" i18n="pidTuningButtonRefresh"></a>
</div>
</div>
</div> </div>

View file

@ -264,15 +264,21 @@ TABS.pid_tuning.initialize = function (callback) {
// translate to user-selected language // translate to user-selected language
localize(); 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); hideUnusedPids(CONFIG.activeSensors);
$('#showAllPids').on('click', function(){ $('#showAllPids').on('click', function(){
if($(this).text() == "Show All PIDs") { if($(this).text() == "Show all PIDs") {
$('.tab-pid_tuning table.pid_tuning').show(); $('.tab-pid_tuning table.pid_tuning').show();
$(this).text('Hide Unused PIDs'); $(this).text('Hide unused PIDs');
} else { } else {
hideUnusedPids(CONFIG.activeSensors); hideUnusedPids(CONFIG.activeSensors);
$(this).text('Show All PIDs'); $(this).text('Show all PIDs');
} }
}); });

View file

@ -1,5 +1,5 @@
.tab-ports { .tab-ports {
position: relative; position: absolute;
height: calc(100%; - 40px); height: calc(100%; - 40px);
} }
@ -7,12 +7,9 @@
display: none; display: none;
} }
.tab-ports table { .tab-ports table {
margin-bottom: 10px; margin-bottom: 10px;
width:100%; width:100%;
border-collapse:collapse; border-collapse:collapse;
} }
.tab-ports table, .tab-ports table,
@ -21,42 +18,38 @@
border-left:0px; border-left:0px;
border-right:0px; border-right:0px;
border-top:0px; border-top:0px;
border-right:1px solid #e4e4e4;
border-left:1px solid #e4e4e4;
} }
.tab-ports table tr td:first-child { .tab-ports table tr td:first-child {
text-align: left; 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 { .tab-ports table td {
border-bottom:1px solid #e4e4e4; border-bottom:1px solid #e4e4e4;
padding-top:4px; padding-top:6px;
padding-bottom:4px; padding-bottom:7px;
padding-left:5px; padding-left:5px;
padding-right:5px; padding-right:5px;
border-left:1px solid #e4e4e4;
border-right:1px solid #e4e4e4;
} }
.tab-ports table thead tr:first-child, .tab-ports table thead tr:first-child,
.tab-ports table tr:nth-child(even) { .tab-ports table tr:nth-child(even) {
background-color:#f9f9f9; } background-color:#f9f9f9;
}
.tab-ports table thead tr:first-child { .tab-ports table thead tr:first-child {
background-color:#e4e4e4; background-color:#e4e4e4;
font-size:14px; font-size:12px;
height:25px; height:25px;
font-family: 'open_sansregular', Arial; font-family: 'open_sansregular', Arial;
border-top:0px;
border-right:0px;
border-left:0px;
} }
.tab-ports .function input { .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; 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 { .tab-ports .require-support {
display:none; 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) { @media only screen and (max-width: 1055px), only screen and (max-device-width: 1055px) {

View file

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

View file

@ -73,10 +73,13 @@ TABS.ports.initialize = function (callback, scrollPosition) {
$('#content').load("./tabs/ports.html", on_tab_loaded_handler); $('#content').load("./tabs/ports.html", on_tab_loaded_handler);
board_definition = BOARD.find_board_definition(CONFIG.boardIdentifier); board_definition = BOARD.find_board_definition(CONFIG.boardIdentifier);
console.log('Using board definition', board_definition); console.log('Using board definition', board_definition);
} }
}
}
function update_ui() { function update_ui() {
@ -204,6 +207,11 @@ TABS.ports.initialize = function (callback, scrollPosition) {
localize(); 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(); 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 // translate to user-selected language
localize(); 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 // fill in data from RC_tuning
$('.tunings .throttle input[name="mid"]').val(RC_tuning.throttle_MID.toFixed(2)); $('.tunings .throttle input[name="mid"]').val(RC_tuning.throttle_MID.toFixed(2));
$('.tunings .throttle input[name="expo"]').val(RC_tuning.throttle_EXPO.toFixed(2)); $('.tunings .throttle input[name="expo"]').val(RC_tuning.throttle_EXPO.toFixed(2));

View file

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

View file

@ -1,20 +1,28 @@
<div id="content-watermark"></div>
<div class="tab-sensors"> <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"> <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"> <div class="checkboxes">
<label><input type="checkbox" name="gyro_on" class="first" />Gyroscope</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="accel_on"/>Accelerometer</label>
<label><input type="checkbox" name="mag_on" />Magnetometer</label> <label><input type="checkbox" name="mag_on"/>Magnetometer</label>
<label><input type="checkbox" name="baro_on" />Barometer</label> <label><input type="checkbox" name="baro_on"/>Barometer</label>
<label><input type="checkbox" name="sonar_on" />Sonar</label> <label><input type="checkbox" name="sonar_on"/>Sonar</label>
<label><input type="checkbox" name="debug_on" />Debug</label> <label><input type="checkbox" name="debug_on"/>Debug</label>
</div> </div>
</div> </div>
<div class="wrapper gyro"> <div class="wrapper gyro">
<div class="plot_control"> <div class="plot_control">
<div class="title">Gyroscope - deg/s</div> <div class="title">Gyroscope - deg/s</div>
@ -266,4 +274,3 @@
<g class="axis y" transform="translate(40, 10)"></g> <g class="axis y" transform="translate(40, 10)"></g>
</svg> </svg>
</div> </div>
</div>

View file

@ -184,6 +184,24 @@ TABS.sensors.initialize = function (callback) {
// translate to user-selected language // translate to user-selected language
localize(); 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 // disable graphs for sensors that are missing
var checkboxes = $('.tab-sensors .info .checkboxes input'); var checkboxes = $('.tab-sensors .info .checkboxes input');
if (!bit_check(CONFIG.activeSensors, 1)) { // baro if (!bit_check(CONFIG.activeSensors, 1)) { // baro

View file

@ -4,16 +4,15 @@
border: 0; border: 0;
} }
.tab-servos .title { .tab-servos .title {
margin-top: 10px; margin-top: 0px;
line-height: 30px;
line-height: 20px;
text-align: center; text-align: center;
font-weight: bold; font-weight: bold;
border: 1px solid #8b8b8b; border: 1px solid #8b8b8b;
border-bottom: 0; border-bottom: 0;
background-color: #ececec; background-color: #ececec;
float:left;
width: calc(100% - 2px);
} }
.tab-servos table.directions td.direction select { .tab-servos table.directions td.direction select {
height: 19px; height: 19px;
@ -22,6 +21,7 @@
.tab-servos table { .tab-servos table {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
float:left;
} }
.tab-servos table th { .tab-servos table th {
line-height: 20px; line-height: 20px;
@ -123,11 +123,10 @@
border: 1px solid silver; border: 1px solid silver;
background-color: #ececec; background-color: #ececec;
} }
.tab-servos .update:hover {
background-color: #dedcdc;
}
.tab-servos .require-support { .tab-servos .require-support {
float:left;
display:none; display:none;
} }
.tab-servos.supported .require-support { .tab-servos.supported .require-support {
@ -138,4 +137,35 @@
} }
.tab-servos.supported .require-upgrade { .tab-servos.supported .require-upgrade {
display:none; 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,5 +1,9 @@
<div class="tab-servos"> <div class="tab-servos">
<div class="require-support"> <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> <div class="title" i18n="servosChangeDirection"></div>
<table class="fields"> <table class="fields">
<tr class="main"> <tr class="main">
@ -16,13 +20,19 @@
</tr> </tr>
</table> </table>
<div class="live"> <div class="live">
<span i18n="servosLiveMode"></span> <input type="checkbox" /> <input type="checkbox" id="toggle" /> <span i18n="servosLiveMode"></span>
</div>
<div class="buttons">
<a class="update" href="#" i18n="servosButtonSave"></a>
</div> </div>
<div class="fixed_band">
<div class="save_btn"><a class="save" href="#" i18n="servosButtonSave"></a></div>
</div>
</div> </div>
<div class="note require-upgrade" i18n="servosFirmwareUpgradeRequired"> <div class="note require-upgrade">
</div> <div class="note_spacer">
<p i18n="servosFirmwareUpgradeRequired"></p>
</div>
</div>
</div> </div>

View file

@ -37,10 +37,12 @@ TABS.servos.initialize = function (callback) {
function load_html() { function load_html() {
$('#content').load("./tabs/servos.html", process_html); $('#content').load("./tabs/servos.html", process_html);
} }
MSP.send_message(MSP_codes.MSP_IDENT, false, false, get_servo_configurations);
MSP.send_message(MSP_codes.MSP_IDENT, false, false, get_servo_configurations);
function update_ui() { function update_ui() {
if (semver.lt(CONFIG.apiVersion, "1.12.0")) { 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); servos_update(true);
}); });
@ -187,6 +189,22 @@ TABS.servos.initialize = function (callback) {
// translate to user-selected language // translate to user-selected language
localize(); 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 // status data pulled via separate timer with static speed
GUI.interval_add('status_pull', function () { GUI.interval_add('status_pull', function () {
MSP.send_message(MSP_codes.MSP_STATUS); MSP.send_message(MSP_codes.MSP_STATUS);

View file

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

View file

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

View file

@ -35,7 +35,15 @@ TABS.setup.initialize = function (callback) {
MSP.send_message(MSP_codes.MSP_ACC_TRIM, false, false, load_status); MSP.send_message(MSP_codes.MSP_ACC_TRIM, false, false, load_status);
function process_html() { function process_html() {
// translate to user-selected language
// 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(); localize();
if (semver.lt(CONFIG.apiVersion, CONFIGURATOR.backupRestoreMinApiVersionAccepted)) { if (semver.lt(CONFIG.apiVersion, CONFIGURATOR.backupRestoreMinApiVersionAccepted)) {