Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/betaflight/betaflight-configurator.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Efimov <gendalf44@yandex.ru>2022-04-15 04:21:44 +0300
committerGitHub <noreply@github.com>2022-04-15 04:21:44 +0300
commitfa662d2ba28983a5a42e98a03f0235f47afe1415 (patch)
treea76b95188e5e815e075c1b50e164c0a5b3d60ada
parent31aebead45e46a1484462cbb229b4046101d723e (diff)
parent9e4c84441709d207f3ce05bd1f8f22ca1334d525 (diff)
Merge pull request #2896 from haslinghuis/remove_duplicates10.8.0-RC5
[chore] remove_duplicates from receiver tab
-rw-r--r--src/js/tabs/receiver.js41
1 files changed, 10 insertions, 31 deletions
diff --git a/src/js/tabs/receiver.js b/src/js/tabs/receiver.js
index 3b0e8944..8c817af0 100644
--- a/src/js/tabs/receiver.js
+++ b/src/js/tabs/receiver.js
@@ -816,10 +816,10 @@ TABS.receiver.initModelPreview = function () {
this.model = new Model($('.model_preview'), $('.model_preview canvas'));
let useOldRateCurve = false;
- if (FC.CONFIG.flightControllerIdentifier === 'CLFL' && semver.lt(FC.CONFIG.apiVersion, '2.0.0')) {
- useOldRateCurve = true;
- }
- if (FC.CONFIG.flightControllerIdentifier === 'BTFL' && semver.lt(FC.CONFIG.flightControllerVersion, '2.8.0')) {
+ const cleanFlight = FC.CONFIG.flightControllerIdentifier === 'CLFL' && semver.lt(FC.CONFIG.apiVersion, '2.0.0');
+ const betaFlight = FC.CONFIG.flightControllerIdentifier === 'BTFL' && semver.lt(FC.CONFIG.flightControllerVersion, '2.8.0');
+
+ if (cleanFlight || betaFlight) {
useOldRateCurve = true;
}
@@ -837,33 +837,12 @@ TABS.receiver.renderModel = function () {
if (FC.RC.channels[0] && FC.RC.channels[1] && FC.RC.channels[2]) {
const delta = this.clock.getDelta();
- const roll = delta * this.rateCurve.rcCommandRawToDegreesPerSecond(
- FC.RC.channels[0],
- this.currentRates.roll_rate,
- this.currentRates.rc_rate,
- this.currentRates.rc_expo,
- this.currentRates.superexpo,
- this.currentRates.deadband,
- this.currentRates.roll_rate_limit,
- );
- const pitch = delta * this.rateCurve.rcCommandRawToDegreesPerSecond(
- FC.RC.channels[1],
- this.currentRates.pitch_rate,
- this.currentRates.rc_rate_pitch,
- this.currentRates.rc_pitch_expo,
- this.currentRates.superexpo,
- this.currentRates.deadband,
- this.currentRates.pitch_rate_limit,
- );
- const yaw = delta * this.rateCurve.rcCommandRawToDegreesPerSecond(
- FC.RC.channels[2],
- this.currentRates.yaw_rate,
- this.currentRates.rc_rate_yaw,
- this.currentRates.rc_yaw_expo,
- this.currentRates.superexpo,
- this.currentRates.yawDeadband,
- this.currentRates.yaw_rate_limit,
- );
+ const roll = delta * this.rateCurve.rcCommandRawToDegreesPerSecond(FC.RC.channels[0], this.currentRates.roll_rate, this.currentRates.rc_rate, this.currentRates.rc_expo,
+ this.currentRates.superexpo, this.currentRates.deadband, this.currentRates.roll_rate_limit);
+ const pitch = delta * this.rateCurve.rcCommandRawToDegreesPerSecond(FC.RC.channels[1], this.currentRates.pitch_rate, this.currentRates.rc_rate_pitch,
+ this.currentRates.rc_pitch_expo, this.currentRates.superexpo, this.currentRates.deadband, this.currentRates.pitch_rate_limit);
+ const yaw = delta * this.rateCurve.rcCommandRawToDegreesPerSecond(FC.RC.channels[2], this.currentRates.yaw_rate, this.currentRates.rc_rate_yaw,
+ this.currentRates.rc_yaw_expo, this.currentRates.superexpo, this.currentRates.yawDeadband, this.currentRates.yaw_rate_limit);
this.model.rotateBy(-degToRad(pitch), -degToRad(yaw), -degToRad(roll));
}