Merge pull request #962 from McGiverGim/bf-fix_msp_controls

Fix MSP controls
10.3.x-maintenance
Michael Keller 2018-03-04 00:49:28 +13:00 committed by GitHub
commit cd04c1e6f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 18 deletions

View File

@ -7,26 +7,26 @@ var
// What's the index of each channel in the MSP channel list? // What's the index of each channel in the MSP channel list?
channelMSPIndexes = { channelMSPIndexes = {
roll: 0, Roll: 0,
pitch: 1, Pitch: 1,
throttle: 2, Throttle: 2,
yaw: 3, Yaw: 3,
aux1: 4, Aux1: 4,
aux2: 5, Aux2: 5,
aux3: 6, Aux3: 6,
aux4: 7, Aux4: 7,
}, },
// Set reasonable initial stick positions (Mode 2) // Set reasonable initial stick positions (Mode 2)
stickValues = { stickValues = {
throttle: CHANNEL_MIN_VALUE, Throttle: CHANNEL_MIN_VALUE,
pitch: CHANNEL_MID_VALUE, Pitch: CHANNEL_MID_VALUE,
roll: CHANNEL_MID_VALUE, Roll: CHANNEL_MID_VALUE,
yaw: CHANNEL_MID_VALUE, Yaw: CHANNEL_MID_VALUE,
aux1: CHANNEL_MIN_VALUE, Aux1: CHANNEL_MIN_VALUE,
aux2: CHANNEL_MIN_VALUE, Aux2: CHANNEL_MIN_VALUE,
aux3: CHANNEL_MIN_VALUE, Aux3: CHANNEL_MIN_VALUE,
aux4: CHANNEL_MIN_VALUE Aux4: CHANNEL_MIN_VALUE
}, },
// First the vertical axis, then the horizontal: // First the vertical axis, then the horizontal:
@ -160,7 +160,7 @@ $(document).ready(function() {
$(".slider", sliderElems).each(function(sliderIndex) { $(".slider", sliderElems).each(function(sliderIndex) {
var var
initialValue = stickValues["aux" + (sliderIndex + 1)]; initialValue = stickValues["Aux" + (sliderIndex + 1)];
$(this) $(this)
.noUiSlider({ .noUiSlider({
@ -172,7 +172,7 @@ $(document).ready(function() {
}).on('slide change set', function(e, value) { }).on('slide change set', function(e, value) {
value = Math.round(parseFloat(value)); value = Math.round(parseFloat(value));
stickValues["aux" + (sliderIndex + 1)] = value; stickValues["Aux" + (sliderIndex + 1)] = value;
$(".tooltip", this).text(value); $(".tooltip", this).text(value);
}); });