features non-radio rework

pull/85/head
Pawel Spychalski (DzikuVx) 8 years ago
parent 1b4c729e46
commit c6b2e40cbb

@ -547,10 +547,10 @@
"message": "Remember to set the NRF24 protocol after enabling."
},
"featureSOFTSPI": {
"message": "Enable CPU based SPI"
"message": "CPU based SPI"
},
"featurePWM_SERVO_DRIVER": {
"message": "Enable external PWM servo driver"
"message": "External PWM servo driver"
},
"featurePWM_SERVO_DRIVERTip": {
"message": "Use external PCA9685 PMW driver to connect up to 16 servos to flight controller. PCA9685 has to be connected to enable this feature."

@ -388,7 +388,7 @@ var FC = {
{bit: 27, group: 'other', name: 'PWM_SERVO_DRIVER', haveTip: true}
);
}
return features;
return features.reverse();
},
isFeatureEnabled: function (featureName, features) {
for (var i = 0; i < features.length; i++) {

@ -1,33 +1,3 @@
.tab-configuration table {
margin-bottom: 10px;
width: 100%;
float: left;
}
.tab-configuration table, .tab-configuration table th, .tab-configuration table td {
padding: 0;
text-align: left;
}
.tab-configuration table th {
padding: 3px;
border-bottom: 1px solid #ddd;
}
.tab-configuration table td {
padding-left: 5px;
border-bottom: 1px solid #ddd;
}
.tab-configuration table tr td:first-child {
text-align: left;
width: 55px;
}
.tab-configuration table td {
padding: 5px 0;
}
.tab-configuration {
position: relative;
}
@ -228,6 +198,7 @@ hr {
.config-section .checkbox,
.config-section .number {
position: relative;
height: 22px;
}
.config-section label {
@ -240,14 +211,14 @@ hr {
position: inherit;
}
.config-section .features label {
position: inherit;
}
.sensors select {
.config-section select {
width: 8em;
}
.tab-configuration .gps_ubx_sbas {
width: 8em;
}
.config-section .helpicon {
margin-top: 3px;
}

@ -114,18 +114,8 @@
<div class="spacer_box_title" data-i18n="configurationReceiver"></div>
</div>
<div class="spacer_box">
<table cellpadding="0" cellspacing="0">
<thead>
<tr>
<th data-i18n="configurationFeatureEnabled"></th>
<th data-i18n="configurationFeatureDescription"></th>
<th data-i18n="configurationFeatureName"></th>
</tr>
</thead>
<tbody class="features rxMode">
<!-- table generated here -->
</tbody>
</table>
<div class="features rxMode"></div>
<!--feature list goes here-->
</div>
<div class="spacer_box">
<h3 data-i18n="configurationSerialRX"></h3>
@ -156,11 +146,10 @@
<p data-i18n="configurationGPSHelp"></p>
</div>
</div>
<table cellpadding="0" cellspacing="0">
<tbody class="features gps">
<!-- table generated here -->
</tbody>
</table>
<div class="features gps"></div>
<!--feature list generated content-->
<div class="select">
<select id="gps_protocol" class="gps_protocol">
<!-- list generated here -->
@ -228,13 +217,8 @@
<div class="spacer_box_title" data-i18n="configurationEscFeatures"></div>
</div>
<div class="spacer_box">
<table cellpadding="0" cellspacing="0">
<tbody class="features esc-priority">
<!-- table generated here -->
</tbody>
</table>
<div class="features esc-priority"></div>
<!--list of generated features goes here-->
<div id="esc-protocols">
<div class="select">
<select name="esc-protocol" id="esc-protocol"></select>
@ -264,12 +248,8 @@
<div class="clear-both"></div>
</div>
<table cellpadding="0" cellspacing="0">
<tbody class="features esc">
<!-- table generated here -->
</tbody>
</table>
<!-- -->
<div class="features esc"></div>
<!--list of generated features goes here-->
<div class="checkbox">
<input type="checkbox" id="disarmkillswitch" name="disarmkillswitch" class="toggle" />
@ -280,8 +260,8 @@
</div>
<div class="number disarmdelay" style="display: none; margin-bottom: 5px;">
<input type="number" name="autodisarmdelay" min="0" max="60" />
<label>
<input type="number" id="autodisarmdelay" name="autodisarmdelay" min="0" max="60" />
<label for="autodisarmdelay">
<span data-i18n="configurationAutoDisarmDelay"></span>
</label>
<div class="helpicon cf_tip" data-i18n_title="configurationAutoDisarmDelayHelp"></div>
@ -378,11 +358,9 @@
<div class="spacer_box_title" data-i18n="configurationBatteryVoltage"></div>
</div>
<div class="spacer_box">
<table cellpadding="0" cellspacing="0">
<tbody class="features batteryVoltage">
<!-- table generated here -->
</tbody>
</table>
<div class="features batteryVoltage"></div>
<!--list of generated features goes here-->
<div class="number">
<input type="number" id="mincellvoltage" name="mincellvoltage" step="0.1" min="1" max="5" />
<label for="mincellvoltage"><span data-i18n="configurationBatteryMinimum"></span></label>
@ -418,11 +396,9 @@
<div class="spacer_box_title" data-i18n="configurationCurrent"></div>
</div>
<div class="spacer_box">
<table cellpadding="0" cellspacing="0">
<tbody class="features batteryCurrent">
<!-- table generated here -->
</tbody>
</table>
<div class="features batteryCurrent"></div>
<!--list of generated features goes here-->
<div class="number">
<input type="number" id="currentscale" name="currentscale" step="1" min="-1000" max="1000" />
<label for="currentscale">
@ -450,23 +426,14 @@
</div>
</div>
<div class="gui_box grey other">
<div class="config-section gui_box grey other">
<div class="gui_box_titlebar">
<div class="spacer_box_title" data-i18n="configurationFeatures"></div>
</div>
<div class="spacer_box">
<table cellpadding="0" cellspacing="0">
<thead>
<tr>
<th data-i18n="configurationFeatureEnabled"></th>
<th data-i18n="configurationFeatureDescription"></th>
<th data-i18n="configurationFeatureName"></th>
</tr>
</thead>
<tbody class="features other" id="noline">
<!-- table generated here -->
</tbody>
</table>
<div class="features other"></div>
<!--feature list generated content-->
</div>
</div>

@ -134,18 +134,14 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
+ feature_tip_html + '</td></tr>');
radioGroups.push(features[i].group);
} else {
row_e = $('<tr><td><input class="feature toggle"'
+ i
+ '" name="'
+ features[i].name
+ '" title="'
+ features[i].name
+ '" type="checkbox"/></td><td><label for="feature-'
+ i
+ '">'
+ features[i].name
+ '</label></td><td><span data-i18n="feature' + features[i].name + '"></span>'
+ feature_tip_html + '</td></tr>');
row_e = $('<div class="checkbox">'
+ '<input type="checkbox" class="feature toggle" name="' + features[i].name + '" title="' + features[i].name + '">'
+ '<label>'
+ '<span data-i18n="feature' + features[i].name + '"></span>'
+ '</label>'
+ feature_tip_html
+ '</div>');
var feature_e = row_e.find('input.feature');
@ -155,7 +151,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
features_e.each(function () {
if ($(this).hasClass(features[i].group)) {
$(this).append(row_e);
$(this).after(row_e);
}
});
}
@ -526,7 +522,9 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
$('#deadband-3d-throttle-container').remove();
}
$('input[type="checkbox"].feature', features_e).change(function () {
$('input[type="checkbox"].feature').change(function () {
console.log('we have change');
var element = $(this),
index = element.data('bit'),
state = element.is(':checked');

Loading…
Cancel
Save