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." "message": "Remember to set the NRF24 protocol after enabling."
}, },
"featureSOFTSPI": { "featureSOFTSPI": {
"message": "Enable CPU based SPI" "message": "CPU based SPI"
}, },
"featurePWM_SERVO_DRIVER": { "featurePWM_SERVO_DRIVER": {
"message": "Enable external PWM servo driver" "message": "External PWM servo driver"
}, },
"featurePWM_SERVO_DRIVERTip": { "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." "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} {bit: 27, group: 'other', name: 'PWM_SERVO_DRIVER', haveTip: true}
); );
} }
return features; return features.reverse();
}, },
isFeatureEnabled: function (featureName, features) { isFeatureEnabled: function (featureName, features) {
for (var i = 0; i < features.length; i++) { 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 { .tab-configuration {
position: relative; position: relative;
} }
@ -228,6 +198,7 @@ hr {
.config-section .checkbox, .config-section .checkbox,
.config-section .number { .config-section .number {
position: relative; position: relative;
height: 22px;
} }
.config-section label { .config-section label {
@ -240,14 +211,14 @@ hr {
position: inherit; position: inherit;
} }
.config-section .features label { .config-section select {
position: inherit;
}
.sensors select {
width: 8em; width: 8em;
} }
.tab-configuration .gps_ubx_sbas { .tab-configuration .gps_ubx_sbas {
width: 8em; width: 8em;
} }
.config-section .helpicon {
margin-top: 3px;
}

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

@ -134,18 +134,14 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
+ feature_tip_html + '</td></tr>'); + feature_tip_html + '</td></tr>');
radioGroups.push(features[i].group); radioGroups.push(features[i].group);
} else { } else {
row_e = $('<tr><td><input class="feature toggle"'
+ i row_e = $('<div class="checkbox">'
+ '" name="' + '<input type="checkbox" class="feature toggle" name="' + features[i].name + '" title="' + features[i].name + '">'
+ features[i].name + '<label>'
+ '" title="' + '<span data-i18n="feature' + features[i].name + '"></span>'
+ features[i].name + '</label>'
+ '" type="checkbox"/></td><td><label for="feature-' + feature_tip_html
+ i + '</div>');
+ '">'
+ features[i].name
+ '</label></td><td><span data-i18n="feature' + features[i].name + '"></span>'
+ feature_tip_html + '</td></tr>');
var feature_e = row_e.find('input.feature'); var feature_e = row_e.find('input.feature');
@ -155,7 +151,7 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
features_e.each(function () { features_e.each(function () {
if ($(this).hasClass(features[i].group)) { 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(); $('#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), var element = $(this),
index = element.data('bit'), index = element.data('bit'),
state = element.is(':checked'); state = element.is(':checked');

Loading…
Cancel
Save