Skip to content

Commit

Permalink
Remove expo from the Receiver tab
Browse files Browse the repository at this point in the history
  • Loading branch information
DzikuVx committed May 14, 2024
1 parent d522dfd commit eac50a4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 90 deletions.
38 changes: 1 addition & 37 deletions tabs/receiver.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,43 +119,7 @@
</div>
</div>
</div>
<div class="gui_box grey">
<div class="spacer" style="margin-top: 10px; margin-bottom: 10px;">
<div class="fc_column curves" style="width: calc(50% - 10px);">
<table>
<tr>
<td>
<div class="pitch_roll_curve">
<canvas width="200" height="117"></canvas>
</div>
</td>
</tr>
</table>
</div>
<div class="fc_column half tunings">
<table class="rate">
<tr>
<th data-i18n="receiverRcExpo"></th>
<th data-i18n="receiverManualRcExpo"></th>
</tr>
<tr>
<td><input class="controlProfileHighlight" type="number" name="expo" step="0.01" min="0" max="2" /></td>
<td><input class="controlProfileHighlight" type="number" name="manual_expo" step="0.01" min="0" max="1" /></td>
</tr>
</table>
<table class="yaw_rate" style="margin-bottom: 0;">
<tr>
<th data-i18n="receiverRcYawExpo"></th>
<th data-i18n="receiverManualRcYawExpo"></th>
</tr>
<tr>
<td><input class="controlProfileHighlight" type="number" name="yaw_expo" step="0.01" min="0" max="2" /></td>
<td><input class="controlProfileHighlight" type="number" name="manual_yaw_expo" step="0.01" min="0" max="1" /></td>
</tr>
</table>
</div>
</div>
</div>

</div>
</div>
<div class="content_toolbar">
Expand Down
53 changes: 0 additions & 53 deletions tabs/receiver.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,41 +47,6 @@ TABS.receiver.initialize = function (callback) {
Settings.saveInputs(onComplete);
}

function drawRollPitchExpo() {
var pitch_roll_curve = $('.pitch_roll_curve canvas').get(0);
var context = pitch_roll_curve.getContext("2d");

var expoAVal = $('.tunings .rate input[name="expo"]');
var expoA = parseFloat(expoAVal.val());

var expoMVal = $('.tunings .rate input[name="manual_expo"]');
var expoM = parseFloat(expoMVal.val());

if (expoA <= parseFloat(expoAVal.prop('min')) || expoA >= parseFloat(expoAVal.prop('max')) ||
expoM <= parseFloat(expoMVal.prop('min')) || expoM >= parseFloat(expoMVal.prop('max'))) {
return;
}

var rateHeight = TABS.receiver.rateChartHeight;

// draw
context.clearRect(0, 0, 200, rateHeight);

context.beginPath();
context.moveTo(0, rateHeight);
context.quadraticCurveTo(110, rateHeight - ((rateHeight / 2) * (1 - expoA)), 200, 0);
context.lineWidth = 2;
context.strokeStyle = '#37a8db';
context.stroke();

context.beginPath();
context.moveTo(0, rateHeight);
context.quadraticCurveTo(110, rateHeight - ((rateHeight / 2) * (1 - expoM)), 200, 0);
context.lineWidth = 2;
context.strokeStyle = '#a837db';
context.stroke();
}

function process_html() {
// translate to user-selected language
i18n.localize();;
Expand Down Expand Up @@ -120,12 +85,6 @@ TABS.receiver.initialize = function (callback) {
$('.tunings .throttle input[name="mid"]').val(FC.RC_tuning.throttle_MID.toFixed(2));
$('.tunings .throttle input[name="expo"]').val(FC.RC_tuning.throttle_EXPO.toFixed(2));

$('.tunings .rate input[name="expo"]').val(FC.RC_tuning.RC_EXPO.toFixed(2));
$('.tunings .yaw_rate input[name="yaw_expo"]').val(FC.RC_tuning.RC_YAW_EXPO.toFixed(2));

$('.tunings .rate input[name="manual_expo"]').val(FC.RC_tuning.manual_RC_EXPO.toFixed(2));
$('.tunings .yaw_rate input[name="manual_yaw_expo"]').val(FC.RC_tuning.manual_RC_YAW_EXPO.toFixed(2));

$('.deadband input[name="yaw_deadband"]').val(FC.RC_deadband.yaw_deadband);
$('.deadband input[name="deadband"]').val(FC.RC_deadband.deadband);

Expand Down Expand Up @@ -284,23 +243,11 @@ TABS.receiver.initialize = function (callback) {
}, 0);
}).trigger('input');

$('.tunings .rate input').on('input change', function () {
setTimeout(function () { // let global validation trigger and adjust the values first
drawRollPitchExpo();
}, 0);
}).trigger('input');

$('a.update').on('click', function () {
// catch RC_tuning changes
FC.RC_tuning.throttle_MID = parseFloat($('.tunings .throttle input[name="mid"]').val());
FC.RC_tuning.throttle_EXPO = parseFloat($('.tunings .throttle input[name="expo"]').val());

FC.RC_tuning.RC_EXPO = parseFloat($('.tunings .rate input[name="expo"]').val());
FC.RC_tuning.RC_YAW_EXPO = parseFloat($('.tunings .yaw_rate input[name="yaw_expo"]').val());

FC.RC_tuning.manual_RC_EXPO = parseFloat($('.tunings .rate input[name="manual_expo"]').val());
FC.RC_tuning.manual_RC_YAW_EXPO = parseFloat($('.tunings .yaw_rate input[name="manual_yaw_expo"]').val());

FC.RC_deadband.yaw_deadband = parseInt($('.deadband input[name="yaw_deadband"]').val());
FC.RC_deadband.deadband = parseInt($('.deadband input[name="deadband"]').val());

Expand Down

0 comments on commit eac50a4

Please sign in to comment.