mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-23 00:05:22 +03:00
Remove unused files
This commit is contained in:
parent
0a74b4420d
commit
a7ffd373f6
3 changed files with 0 additions and 231 deletions
|
@ -1,57 +0,0 @@
|
|||
.tab-modes .boxes {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.tab-modes .boxes th, .tab-modes .boxes td {
|
||||
line-height: 22px;
|
||||
text-align: center;
|
||||
border: 1px solid #8b8b8b;
|
||||
}
|
||||
|
||||
.tab-modes .boxes .heads {
|
||||
background-color: #ececec;
|
||||
}
|
||||
|
||||
.tab-modes .boxes .main {
|
||||
background-color: #ececec;
|
||||
}
|
||||
|
||||
.tab-modes .boxes .name {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.tab-modes .boxes .on {
|
||||
color: white;
|
||||
background-color: #0d8b13;
|
||||
}
|
||||
|
||||
.tab-modes .boxes .off {
|
||||
color: white;
|
||||
background-color: #be2222;
|
||||
}
|
||||
|
||||
.tab-modes .boxes td input {
|
||||
position: absolute;
|
||||
margin-top: -6px;
|
||||
margin-left: -6px;
|
||||
}
|
||||
|
||||
.tab-modes .boxes .switches:nth-child(odd) {
|
||||
background-color: #ececec;
|
||||
}
|
||||
|
||||
.tab-modes .boxes .heads th:first-child {
|
||||
border: 0;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.tab-modes .buttons {
|
||||
width: calc(100% - 20px);
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
}
|
||||
|
||||
.tab-modes .partone {
|
||||
width: 18%;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
<div class="tab-modes toolbar_fixed_bottom">
|
||||
<div class="content_wrapper">
|
||||
<table class="boxes">
|
||||
<tr class="heads">
|
||||
<th class="partone"></th>
|
||||
</tr>
|
||||
<tr class="main">
|
||||
<th i18n="auxiliaryName"></th>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="content_toolbar">
|
||||
<div class="btn save_btn">
|
||||
<a class="update" href="#" i18n="auxiliaryButtonSave"></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
157
tabs/modes.js
157
tabs/modes.js
|
@ -1,157 +0,0 @@
|
|||
// Disabled via main.js/main.html, cleanflight does not use MSP_BOX.
|
||||
|
||||
'use strict';
|
||||
|
||||
TABS.modes = {};
|
||||
TABS.modes.initialize = function (callback) {
|
||||
var self = this;
|
||||
|
||||
if (GUI.active_tab != 'modes') {
|
||||
GUI.active_tab = 'modes';
|
||||
}
|
||||
|
||||
function get_box_data() {
|
||||
MSP.send_message(MSP_codes.MSP_BOX, false, false, get_box_ids);
|
||||
}
|
||||
|
||||
function get_box_ids() {
|
||||
MSP.send_message(MSP_codes.MSP_BOXIDS, false, false, get_rc_data);
|
||||
}
|
||||
|
||||
function get_rc_data() {
|
||||
MSP.send_message(MSP_codes.MSP_RC, false, false, load_html);
|
||||
}
|
||||
|
||||
function load_html() {
|
||||
$('#content').load("./tabs/modes.html", process_html);
|
||||
}
|
||||
|
||||
MSP.send_message(MSP_codes.MSP_BOXNAMES, false, false, get_box_data);
|
||||
|
||||
function process_html() {
|
||||
// generate heads according to RC count
|
||||
var table_head = $('table.boxes .heads');
|
||||
var main_head = $('table.boxes .main');
|
||||
for (var i = 0; i < (RC.active_channels - 4); i++) {
|
||||
table_head.append('<th colspan="3">AUX ' + (i + 1) + '</th>');
|
||||
|
||||
// 3 columns per aux channel (this might be requested to change to 6 in the future, so watch out)
|
||||
main_head.append('\
|
||||
<th i18n="auxiliaryLow"></th>\
|
||||
<th i18n="auxiliaryMed"></th>\
|
||||
<th i18n="auxiliaryHigh"></th>\
|
||||
');
|
||||
}
|
||||
|
||||
// translate to user-selected language
|
||||
localize();
|
||||
|
||||
// generate table from the supplied AUX names and AUX data
|
||||
for (var i = 0; i < AUX_CONFIG.length; i++) {
|
||||
var line = '<tr class="switches">';
|
||||
line += '<td class="name">' + AUX_CONFIG[i] + '</td>';
|
||||
|
||||
for (var j = 0; j < (RC.active_channels - 4) * 3; j++) {
|
||||
if (bit_check(AUX_CONFIG_values[i], j)) {
|
||||
line += '<td><input type="checkbox" checked="checked" /></td>';
|
||||
} else {
|
||||
line += '<td><input type="checkbox" /></td>';
|
||||
}
|
||||
}
|
||||
|
||||
line += '</tr>';
|
||||
|
||||
$('.boxes > tbody:last').append(line);
|
||||
}
|
||||
|
||||
// UI Hooks
|
||||
$('a.update').click(function () {
|
||||
// catch the input changes
|
||||
var main_needle = 0,
|
||||
needle = 0;
|
||||
|
||||
$('.boxes input').each(function () {
|
||||
if ($(this).is(':checked')) {
|
||||
AUX_CONFIG_values[main_needle] = bit_set(AUX_CONFIG_values[main_needle], needle);
|
||||
} else {
|
||||
AUX_CONFIG_values[main_needle] = bit_clear(AUX_CONFIG_values[main_needle], needle);
|
||||
}
|
||||
|
||||
needle++;
|
||||
|
||||
if (needle >= (RC.active_channels - 4) * 3) { // 1 aux * 3 checkboxes, 4 AUX = 12 bits per line
|
||||
main_needle++;
|
||||
needle = 0;
|
||||
}
|
||||
});
|
||||
|
||||
function save_to_eeprom() {
|
||||
MSP.send_message(MSP_codes.MSP_EEPROM_WRITE, false, false, function () {
|
||||
GUI.log(chrome.i18n.getMessage('auxiliaryEepromSaved'));
|
||||
});
|
||||
}
|
||||
|
||||
MSP.send_message(MSP_codes.MSP_SET_BOX, MSP.crunch(MSP_codes.MSP_SET_BOX), false, save_to_eeprom);
|
||||
});
|
||||
|
||||
// val = channel value
|
||||
// aux_num = position of corresponding aux channel in the html table
|
||||
var switches_e = $('table.boxes .switches');
|
||||
function box_highlight(aux_num, val) {
|
||||
var pos = 0; // < 1300
|
||||
|
||||
if (val > 1300 && val < 1700) {
|
||||
pos = 1;
|
||||
} else if (val > 1700) {
|
||||
pos = 2;
|
||||
}
|
||||
|
||||
var highlight_column = (aux_num * 3) + pos + 2; // +2 to skip name column and index starting on 1 instead of 0
|
||||
var erase_columns = (aux_num * 3) + 2;
|
||||
|
||||
$('td:nth-child(n+' + erase_columns + '):nth-child(-n+' + (erase_columns + 2) + ')', switches_e).css('background-color', 'transparent');
|
||||
$('td:nth-child(' + highlight_column + ')', switches_e).css('background-color', 'orange');
|
||||
}
|
||||
|
||||
// data pulling functions used inside interval timer
|
||||
function get_rc_data() {
|
||||
MSP.send_message(MSP_codes.MSP_RC, false, false, update_ui);
|
||||
}
|
||||
|
||||
function update_ui() {
|
||||
for (var i = 0; i < AUX_CONFIG.length; i++) {
|
||||
if (bit_check(CONFIG.mode, i)) {
|
||||
$('td.name').eq(i).addClass('on').removeClass('off');
|
||||
} else {
|
||||
$('td.name').eq(i).removeClass('on').removeClass('off');
|
||||
|
||||
if (AUX_CONFIG_values[i] > 0) {
|
||||
$('td.name').eq(i).addClass('off');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
for (var i = 0; i < (RC.active_channels - 4); i++) {
|
||||
box_highlight(i, RC.channels[i + 4]);
|
||||
}
|
||||
}
|
||||
|
||||
// update ui instantly on first load
|
||||
update_ui();
|
||||
|
||||
// enable data pulling
|
||||
GUI.interval_add('aux_data_pull', get_rc_data, 50);
|
||||
|
||||
// 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);
|
||||
|
||||
GUI.content_ready(callback);
|
||||
}
|
||||
};
|
||||
|
||||
TABS.modes.cleanup = function (callback) {
|
||||
if (callback) callback();
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue