1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-26 09:45:28 +03:00

move tabs to use esm modules

This commit is contained in:
Tomas Chmelevskij 2022-04-14 22:51:42 +02:00
parent b7d1ec0837
commit 5a74094df1
25 changed files with 350 additions and 218 deletions

View file

@ -1,10 +1,10 @@
'use strict';
import { i18n } from '../localization';
TABS.setup = {
const setup = {
yaw_fix: 0.0,
};
TABS.setup.initialize = function (callback) {
setup.initialize = function (callback) {
const self = this;
if (GUI.active_tab != 'setup') {
@ -318,7 +318,7 @@ TABS.setup.initialize = function (callback) {
}
};
TABS.setup.initializeInstruments = function() {
setup.initializeInstruments = function() {
const options = {size:90, showBox : false, img_directory: 'images/flightindicators/'};
const attitude = $.flightIndicator('#attitude', 'attitude', options);
const heading = $.flightIndicator('#heading', 'heading', options);
@ -330,13 +330,13 @@ TABS.setup.initializeInstruments = function() {
};
};
TABS.setup.initModel = function () {
setup.initModel = function () {
this.model = new Model($('.model-and-info #canvas_wrapper'), $('.model-and-info #canvas'));
$(window).on('resize', $.proxy(this.model.resize, this.model));
};
TABS.setup.renderModel = function () {
setup.renderModel = function () {
const x = (FC.SENSOR_DATA.kinematics[1] * -1.0) * 0.017453292519943295,
y = ((FC.SENSOR_DATA.kinematics[2] * -1.0) - this.yaw_fix) * 0.017453292519943295,
z = (FC.SENSOR_DATA.kinematics[0] * -1.0) * 0.017453292519943295;
@ -344,7 +344,7 @@ TABS.setup.renderModel = function () {
this.model.rotateTo(x, y, z);
};
TABS.setup.cleanup = function (callback) {
setup.cleanup = function (callback) {
if (this.model) {
$(window).off('resize', $.proxy(this.model.resize, this.model));
this.model.dispose();
@ -352,3 +352,7 @@ TABS.setup.cleanup = function (callback) {
if (callback) callback();
};
window.TABS.setup = setup;
export { setup };