Skip to content

Commit

Permalink
Merge branch 'master' into gpsAjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
HThuren authored Sep 9, 2023
2 parents fcaea74 + 5f13c07 commit 3dd9ddf
Show file tree
Hide file tree
Showing 113 changed files with 7,042 additions and 5,612 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,6 @@ module.exports = {
appAvailability: true,
// end cordova bindings
},
// ignore src/dist folders
ignorePatterns: ["src/dist/*"],
};
27 changes: 25 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,25 @@ Betaflight Configurator has been translated into several languages. The applicat

If you prefer to have the application in English or any other language, you can select your desired language in the first screen of the application.

## App build via Vite (web)

### Development

1. Install node.js (refer to [.nvmrc](./.nvmrc) for required version)
2. Install yarn: `npm install yarn -g`
3. Change to project folder and run `yarn install`.
4. Run `yarn dev`.

The web app will be available at http://localhost:8000 with full HMR.

### Build Preview

1. Run `yarn build`.
2. Run `yarn preview` after build has finished.
3. Alternatively run `yarn review` to build and preview in one step.

The web app should behave directly as in production, available at http://localhost:8080.

## App build via NW.js (windows/linux/macos) or Cordova (android)

### Development
Expand Down Expand Up @@ -106,7 +125,7 @@ List of possible values of `<task-name>`:
* **dist** copies all the JS and CSS files in the `./dist` folder [2].
* **apps** builds the apps in the `./apps` folder [1].
* **debug** builds debug version of the apps in the `./debug` folder [1][3].
* **release** zips up the apps into individual archives in the `./release` folder [1].
* **release** zips up the apps into individual archives in the `./release` folder [1].

[1] Running this task on macOS or Linux requires Wine, since it's needed to set the icon for the Windows app (build for specific platform to avoid errors).
[2] For Android platform, **dist** task will generate folders and files in the `./dist_cordova` folder.
Expand All @@ -117,14 +136,18 @@ To build or release only for one specific platform you can append the plaform af
If no platform is provided, the build for the host platform is run.

* **MacOS X** use `yarn gulp <task-name> --osx64`
* **Linux** use `yarn gulp <task-name> --linux64`
* **Linux** use `yarn gulp <task-name> --linux64`
* **Windows** use `yarn gulp <task-name> --win64`
* **Android** use `yarn gulp <task-name> --android`

**Note:** Support for cross-platform building is very limited due to the requirement for platform specific build tools. If in doubt, build on the target platform.

You can also use multiple platforms e.g. `yarn gulp <taskname> --osx64 --linux64`. Other platforms like `--win32`, `--linux32` and `--armv8` can be used too, but they are not officially supported, so use them at your own risk.

#### Leverage GitHub-Actions to build binaries

You can use the GitHub `Actions` tab in your fork to build binaries as well. Select `Actions`>`Manual Build`>`Run Workflow`. Choose your custom branch and click `Run workflow`. The workflow will dispatch in a few moments and upon completion, the build "Artifacts" will be available for download from within the workflow run.

## Support

If you need help please reach out on the [betaflightgroup](https://betaflightgroup.slack.com) slack channel before raising issues on github. Register and [request slack access here](https://slack.betaflight.com).
Expand Down
18 changes: 16 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const NODE_ENV = process.env.NODE_ENV || 'production';
const NAME_REGEX = /-/g;

const nwBuilderOptions = {
version: '0.77.0',
version: '0.72.0',
files: `${DIST_DIR}**/*`,
macIcns: './src/images/bf_icon.icns',
macPlist: { 'CFBundleDisplayName': 'Betaflight Configurator'},
Expand Down Expand Up @@ -280,6 +280,11 @@ function processPackage(done, gitRevision, isReleaseBuild) {

// remove gulp-appdmg from the package.json we're going to write
delete pkg.optionalDependencies['gulp-appdmg'];
// keeping this package in `package.json` for some reason
// breaks the nwjs builds. This is not really needed for
// nwjs nor it's imported anywhere at runtime ¯\_(ツ)_/¯
// this probably can go away if we fully move to pwa.
delete pkg.dependencies['@vitejs/plugin-vue2'];

pkg.gitRevision = gitRevision;
if (!isReleaseBuild) {
Expand Down Expand Up @@ -403,6 +408,7 @@ function dist_rollup() {
// I will be picked up by rollup and bundled accordingly.
'js/main_cordova': 'src/js/main_cordova.js',
'js/utils/common': 'src/js/utils/common.js',
'js/jquery': 'src/js/jquery.js',
'js/main': 'src/js/main.js',
'js/tabs/receiver_msp': 'src/js/tabs/receiver_msp.js',
},
Expand Down Expand Up @@ -437,8 +443,16 @@ function dist_rollup() {
sourcemap: true,
// put any 3rd party module in vendor.js
manualChunks(id) {
/**
* This splits every npm module loaded in into it's own package
* to preserve the loading order. This is to prevent issues
* where after bundling some modules are loaded in the wrong order.
*/
if (id.includes('node_modules')) {
return 'vendor';
const parts = id.split(/[\\/]/);
const nodeModulesIndex = parts.indexOf('node_modules');
const packageName = parts[nodeModulesIndex + 1];
return packageName;
}
},
dir: DIST_DIR,
Expand Down
96 changes: 61 additions & 35 deletions locales/ca/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -745,12 +745,6 @@
"message": "Títol:",
"description": "Heading shown on Setup tab"
},
"initialSetupPitch": {
"message": "Pitch:"
},
"initialSetupRoll": {
"message": "Roll:"
},
"initialSetupMixerHead": {
"message": "Tipus de Mixer"
},
Expand Down Expand Up @@ -784,6 +778,12 @@
"initialSetupAccelTrimsHead": {
"message": "Trim d'acceleròmetre"
},
"initialSetupPitch": {
"message": "Pitch:"
},
"initialSetupRoll": {
"message": "Roll:"
},
"initialSetupMagHead": {
"message": "Magnetòmetre"
},
Expand Down Expand Up @@ -2686,7 +2686,8 @@
"description": "Show GPS position - Latitude / Longitude"
},
"gpsHeading": {
"message": "Encapçalament:"
"message": "Encapçalament Mag / GPS:",
"description": "Show GPS heading - Magnetic / GPS course over ground"
},
"gpsSpeed": {
"message": "Velocitat:"
Expand Down Expand Up @@ -4513,56 +4514,81 @@
"failsafeProcedureItemSelect4": {
"message": "Rescat GPS"
},
"failsafeGpsRescueItemAltitudeMode": {
"message": "Mode altitud"
},
"failsafeGpsRescueItemAltitudeModeMaxAlt": {
"message": "Altitud màxima"
},
"failsafeGpsRescueItemAltitudeModeFixedAlt": {
"message": "Altitud fixada"
},
"failsafeGpsRescueItemAltitudeModeCurrentAlt": {
"message": "Altitud actual"
},
"failsafeGpsRescueInitialClimb": {
"message": "Desnivell inicial (metres)"
},
"failsafeGpsRescueInitialClimbHelp": {
"message": "La distància que pujarà el quad, per sobre de l'altitud actual, quan s'inicia un rescat i el mode d'altitud s'estableix en Altitud ACTUAL; també s'ha afegit quan està en mode d'altitud MAX."
},
"failsafeGpsRescueItemReturnAltitude": {
"message": "​Altitud de retorn (metres) - <strong>només s'aplica al mode d'altitud fixa</strong>"
},
"failsafeGpsRescueItemAscendRate": {
"message": "Taxa d’ascens (metres/segon)"
},
"failsafeGpsRescueItemGroundSpeed": {
"message": "Velocitat de retorn (metres/segon)"
},
"failsafeGpsRescueItemAngle": {
"message": "Angle"
"message": "Angle de pas màxim"
},
"failsafeGpsRescueItemInitialAltitude": {
"message": "Altitud inicial (metres)"
"failsafeGpsRescueAngleHelp": {
"message": "Angles màxims més alts condueixen a retorns més agressius i velocitats d'avançament més altes. Pot ser útil per a quads més pesades, de gran arrossegament o de baixa autoritat, o per utilitzar-les amb vents més forts. ADVERTÈNCIA: l'accelerador de rescat normalment s'ha d'augmentar si augmenta l'angle màxim. En cas contrari, el quad pot perdre alçada i estavellar-se!"
},
"failsafeGpsRescueItemDescentDistance": {
"message": "Distància de baixada (metres)"
},
"failsafeGpsRescueItemMinDth": {
"message": "Distància mínima fins a casa (metres)"
"failsafeGpsRescueItemDescendRate": {
"message": "Taxa de descens (metres/segon)"
},
"failsafeGpsRescueItemMinDthHelp": {
"message": "La distància mínima a casa necessària per activar el rescat GPS"
"failsafeGpsRescueDescendRateHelp": {
"message": "La velocitat de descens inicial s'estableix en 3 vegades aquest valor, disminuint fins al valor establert a l'altitud d'aterratge."
},
"failsafeGpsRescueItemGroundSpeed": {
"message": "Velocitat del sòl (metres/segon)"
"failsafeGpsRescueItemMinStartDistHelp": {
"message": "Si el rescat comença massa a prop de casa (dins d'aquesta distància mínima), l'embarcació volarà lluny, en el seu rumb actual, fins almenys a aquesta distància de casa, i després començarà un comportament de rescat normal",
"description": "Updated help text for the minimum start distance needed for GPS rescue to activate"
},
"failsafeGpsRescueItemThrottleMin": {
"message": "Throttle mínim"
},
"failsafeGpsRescueItemThrottleMax": {
"message": "Throttle màxim"
},
"failsafeGpsRescueThrottleMaxHelp": {
"message": "S'hauria d'augmentar per a quads més pesades, d'arrossegament elevat o de baixa autoritat, si és probable un retorn contra vents forts, o si s'augmenta l'angle d'inclinació màxim."
},
"failsafeGpsRescueItemThrottleHover": {
"message": "Throttle mitja"
"message": "Hover de l'accelerador - <span class=\"message-negative\">IMPORTANT: establiu aquest valor amb precisió</span>"
},
"failsafeGpsRescueItemAscendRate": {
"message": "Taxa d’ascens (metres/segon)"
"failsafeGpsRescueThrottleHoverHelp": {
"message": "Per trobar el valor correcte, configureu l'acció del commutador Failsafe a l'etapa 2, configureu el procediment Failsafe de l'etapa 2 a Aterratge i ajusteu el valor de l'accelerador que s'utilitza durant l'aterratge fins que el quad surti o baixi lentament. A continuació, configureu el gir de l'accelerador de rescat de GPS i el valor de reserva del canal de l'etapa 1 per a l'accelerador en aquest valor."
},
"failsafeGpsRescueItemDescendRate": {
"message": "Taxa de descens (metres/segon)"
"failsafeGpsRescueItemMinDth": {
"message": "Distància mínima fins a casa (metres)"
},
"failsafeGpsRescueItemMinDthHelp": {
"message": "La distància mínima a casa necessària per activar el rescat GPS"
},
"failsafeGpsRescueItemMinSats": {
"message": "Satèl·lits mínims"
},
"failsafeGpsRescueItemAllowArmingWithoutFix": {
"message": "Permet armar sense fixar - <span class=\"message-negative\">ADVERTIMENT: el rescat GPS no estarà disponible</span>"
"message": "Permetre l'armament sense correcció - <span class=\"message-negative\">ADVERTIMENT: No hi ha cap solució = desarmar a seguretat contra errors!</span>"
},
"failsafeGpsRescueItemAltitudeMode": {
"message": "Mode altitud"
},
"failsafeGpsRescueItemAltitudeModeMaxAlt": {
"message": "Altitud màxima"
},
"failsafeGpsRescueItemAltitudeModeFixedAlt": {
"message": "Altitud fixada"
},
"failsafeGpsRescueItemAltitudeModeCurrentAlt": {
"message": "Altitud actual"
"failsafeGpsRescueArmWithoutFixHelp": {
"message": "No es recomana. Permet armar sense que s'estableixi un punt d'inici, però el quad es desarmarà i s'estavellarà amb una veritable seguretat de pèrdua de Rx. Si es prova amb un interruptor, hi ha un breu període de no fer res abans del desarmament."
},
"failsafeGpsRescueItemSanityChecks": {
"message": "Controls de sanejament"
Expand Down Expand Up @@ -5002,7 +5028,7 @@
"message": "Imatge personalitzada:"
},
"osdSetupCustomLogoInfoImageSize": {
"message": "La mida ha de ser de $t(logoWidthPx)×$t(logoHeightPx) pixels"
"message": "La mida ha de ser de $t(logoWidthPx)x$t(logoHeightPx) píxels"
},
"osdSetupCustomLogoInfoColorMap": {
"message": "Ha de contenir píxels verds, blancs i negres"
Expand All @@ -5011,7 +5037,7 @@
"message": "Prem <b>$t(osdSetupUploadFont.message)</b> per a desar la imatge personalitzada"
},
"osdSetupCustomLogoImageSizeError": {
"message": "Mida de la imatge no vàlida: {{width}}×{{height}} (expected $t(logoWidthPx)×$t(logoHeightPx))"
"message": "Mida de la imatge no vàlida: {{width}}x{{height}} (s'esperava $t(logoWidthPx)×$t(logoHeightPx))"
},
"osdSetupCustomLogoColorMapError": {
"message": "L'imatge conte píxels invàlids: rgb({{valueR}}, {{valueG}}, {{valueB}}) a les coordenades {{posX}}×{{posY}}"
Expand Down
Loading

0 comments on commit 3dd9ddf

Please sign in to comment.