rssi_aux_channel support in receiver tab, hybrid box bugfixes

10.3.x-maintenance
cTn 2014-09-24 16:01:23 +02:00
parent 4719d1562d
commit fe4240deb7
5 changed files with 62 additions and 8 deletions

View File

@ -446,6 +446,9 @@
"receiverChannelMap": {
"message": "Channel Map"
},
"receiverRssiAux": {
"message": "RSSI on AUX"
},
"receiverRefreshRateTitle": {
"message": "Graph refresh rate"
},

View File

@ -444,7 +444,7 @@ var MSP = {
}
break;
case MSP_codes.MSP_SET_RCMAP:
console.log('RCMAP Updated');
console.log('RCMAP saved');
break;
case MSP_codes.MSP_CONFIG:
BF_CONFIG.mixerConfiguration = data.getUint8(0);

View File

@ -126,14 +126,40 @@
line-height: 20px;
text-align: right;
}
.tab-receiver .rssi_aux_wrapper {
float: right;
margin: 10px 0 0 0;
width: 126px;
border: 1px solid #8b8b8b;
border-left: 0;
}
.tab-receiver .rssi_aux_wrapper .head {
height: 15px;
padding: 4px;
text-align: center;
font-weight: bold;
border-bottom: 1px solid #8b8b8b;
background-color: #ececec;
}
.tab-receiver .rssi_aux_wrapper select {
width: 100%;
height: 22px;
padding-left: 5px;
}
.tab-receiver .rcmap_wrapper {
float: right;
position: relative;
width: 126px;
margin: 10px 0 0 0;
width: 126px;
border: 1px solid #8b8b8b;
}
.tab-receiver .rcmap_wrapper .head {

View File

@ -22,6 +22,16 @@
<td><input type="number" name="expo" step="0.01" min="0" max="1" /></td>
</tr>
</table>
<div class="rssi_aux_wrapper">
<div class="head" i18n="receiverRssiAux"></div>
<select name="rssi_aux_channel">
<option value="0">Disabled</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
</div>
<div class="rcmap_wrapper">
<div class="head" i18n="receiverChannelMap"></div>
<div class="hybrid_element">

View File

@ -6,6 +6,11 @@ TABS.receiver.initialize = function (callback) {
GUI.active_tab = 'receiver';
googleAnalytics.sendAppView('Receiver Page');
function get_misc_data() {
MSP.send_message(MSP_codes.MSP_MISC, false, false, get_rc_data);
}
function get_rc_data() {
MSP.send_message(MSP_codes.MSP_RC, false, false, get_rc_map);
}
@ -23,7 +28,7 @@ TABS.receiver.initialize = function (callback) {
$('#content').load("./tabs/receiver.html", process_html);
}
MSP.send_message(MSP_codes.MSP_RC_TUNING, false, false, get_rc_data);
MSP.send_message(MSP_codes.MSP_RC_TUNING, false, false, get_misc_data);
function process_html() {
// translate to user-selected language
@ -99,7 +104,7 @@ TABS.receiver.initialize = function (callback) {
}
}).resize(); // trigger so labels get correctly aligned on creation
// handle rcmap
// handle rcmap & rssi aux channel
if (bit_check(CONFIG.capability, 30)) {
var RC_MAP_Letters = ['A', 'E', 'R', 'T', '1', '2', '3', '4'];
@ -154,12 +159,15 @@ TABS.receiver.initialize = function (callback) {
});
// handle helper
// TODO fix this
$('select[name="rcmap_helper"]').val(0); // go out of bounds
$('select[name="rcmap_helper"]').change(function () {
$('input[name="rcmap"]').val($(this).val());
});
// rssi aux
$('select[name="rssi_aux_channel"]').val(MISC.rssi_aux_channel);
} else {
$('.rcmap_wrapper').hide();
$('.rcmap_wrapper, .rssi_aux_wrapper').hide();
}
// UI Hooks
@ -268,8 +276,15 @@ TABS.receiver.initialize = function (callback) {
RC_MAP[i] = strBuffer.indexOf(RC_MAP_Letters[i]);
}
// catch rssi aux
MISC.rssi_aux_channel = parseInt($('select[name="rssi_aux_channel"]').val());
function save_rc_map() {
MSP.send_message(MSP_codes.MSP_SET_RCMAP, MSP.crunch(MSP_codes.MSP_SET_RCMAP), false, save_to_eeprom);
MSP.send_message(MSP_codes.MSP_SET_RCMAP, MSP.crunch(MSP_codes.MSP_SET_RCMAP), false, save_misc);
}
function save_misc() {
MSP.send_message(MSP_codes.MSP_SET_MISC, MSP.crunch(MSP_codes.MSP_SET_MISC), false, save_to_eeprom);
}
function save_to_eeprom() {