diff --git a/.gitignore b/.gitignore index 875f3c012..0fba08d7d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ npm-debug.log npm-debug.log inav-configurator.iml /out +/.vite .eslintrc.json /.project /cache/ @@ -16,4 +17,4 @@ inav-configurator.iml *.swp *.bak eeprom.bin -yarn.lock \ No newline at end of file +yarn.lock diff --git a/.vscode/launch.json b/.vscode/launch.json index f8efa898f..9b30c7adf 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -12,7 +12,8 @@ "args": ["--inspect"], "env": { "NODE_ENV": "development", - "NODE_PATH": "${workspaceFolder}/js/" + "NODE_PATH": "${workspaceFolder}/js/", + "DEV_TOOLS_MODE": "undocked" // left, right, bottom, undocked, detach }, "cwd": "${workspaceFolder}", "console": "integratedTerminal" diff --git a/README.md b/README.md index da656326f..f4b93662a 100644 --- a/README.md +++ b/README.md @@ -81,8 +81,8 @@ sudo mv inav-configurator.desktop /usr/share/applications/ For local development, the **node.js** build system is used. 1. Install node.js -1. From the project folder run `yarn install` and then `npm install` -1. To build the and start the configurator: +1. From the project folder run `npm install` and then `npm install` +1. To build the and start the configurator: - Run `npm start`. To build the App run `npm run make` to build for your platform. @@ -114,7 +114,9 @@ To be able to open Inspector, set environment variable `NODE_ENV` to `developmen ```NODE_ENV=development npm start``` or ```$env:NODE_ENV="development" | npm start``` for Windows PowerShell -Or use vscode and start a debug session `Debug Configurator` (Just hit F5!) +Or use VScode and start a debug session `Debug Configurator` (Just hit F5!) + +To debug the main thread (source files in `js/main`), just set a breakpoint in VScode. ## Different map providers diff --git a/forge.config.js b/forge.config.js index 223287f53..f143c35ec 100644 --- a/forge.config.js +++ b/forge.config.js @@ -1,24 +1,47 @@ -const path = require('path'); -const fs = require('fs'); +import path from 'node:path'; +import fs from 'node:fs'; +import { fileURLToPath } from 'node:url'; -module.exports = { +const __dirname = path.dirname(fileURLToPath(import.meta.url)); + +export default { packagerConfig: { executableName: "inav-configurator", asar: false, icon: 'images/inav', - ignore: [ - "^(\/\.vscode$)", - "^(\/support$)", - ".gitattributes", - ".gitignore", - "3D_model_creation.md", - "LICENSE", - "MAPPROXY.md", - "package-lock.json", - "README.md", - "inav_icon_128.psd", - ] }, + rebuildConfig: {}, + plugins: [ + { + name: '@electron-forge/plugin-vite', + config: { + build: [ + { + entry: 'js/main/main.js', + config: 'vite.main.config.js', + }, + { + entry: 'js/main/preload.js', + config: 'vite.preload.config.js', + }, + { + entry: 'js/libraries/bluetooth-device-chooser/bt-device-chooser-preload.js', + config: 'vite.preload.config.js', + }, + ], + renderer: [ + { + name: 'bt_device_chooser', + config: 'vite.bt-dc-renderer.config.js', + }, + { + name: 'main_window', + config: 'vite.main-renderer.config.js', + }, + ], + }, + }, + ], hooks: { // Uniform artifact file names postMake: async (config, makeResults) => { @@ -31,9 +54,8 @@ module.exports = { console.log('Artifact: ' + newPath); }); }); - } + }, }, - rebuildConfig: {}, makers: [ { name: '@electron-forge/maker-wix', @@ -48,7 +70,7 @@ module.exports = { appUserModelId: "com.inav.configurator", icon: path.join(__dirname, "./assets/windows/inav_installer_icon.ico"), upgradeCode: "13606ff3-b0bc-4dde-8fac-805bc8aed2f8", - ui : { + ui: { enabled: false, chooseDirectory: true, images: { diff --git a/images/flightindicators/altitude_pressure.svg b/images/flightindicators/fi_altitude_pressure.svg similarity index 100% rename from images/flightindicators/altitude_pressure.svg rename to images/flightindicators/fi_altitude_pressure.svg diff --git a/images/flightindicators/altitude_ticks.svg b/images/flightindicators/fi_altitude_ticks.svg similarity index 100% rename from images/flightindicators/altitude_ticks.svg rename to images/flightindicators/fi_altitude_ticks.svg diff --git a/images/flightindicators/fi_box.svg b/images/flightindicators/fi_fi_box.svg similarity index 100% rename from images/flightindicators/fi_box.svg rename to images/flightindicators/fi_fi_box.svg diff --git a/images/flightindicators/fi_circle.svg b/images/flightindicators/fi_fi_circle.svg similarity index 100% rename from images/flightindicators/fi_circle.svg rename to images/flightindicators/fi_fi_circle.svg diff --git a/images/flightindicators/fi_needle.svg b/images/flightindicators/fi_fi_needle.svg similarity index 100% rename from images/flightindicators/fi_needle.svg rename to images/flightindicators/fi_fi_needle.svg diff --git a/images/flightindicators/fi_needle_small.svg b/images/flightindicators/fi_fi_needle_small.svg similarity index 100% rename from images/flightindicators/fi_needle_small.svg rename to images/flightindicators/fi_fi_needle_small.svg diff --git a/images/flightindicators/fi_tc_airplane.svg b/images/flightindicators/fi_fi_tc_airplane.svg similarity index 100% rename from images/flightindicators/fi_tc_airplane.svg rename to images/flightindicators/fi_fi_tc_airplane.svg diff --git a/images/flightindicators/heading_mechanics.svg b/images/flightindicators/fi_heading_mechanics.svg similarity index 100% rename from images/flightindicators/heading_mechanics.svg rename to images/flightindicators/fi_heading_mechanics.svg diff --git a/images/flightindicators/heading_yaw.svg b/images/flightindicators/fi_heading_yaw.svg similarity index 100% rename from images/flightindicators/heading_yaw.svg rename to images/flightindicators/fi_heading_yaw.svg diff --git a/images/flightindicators/horizon_back.svg b/images/flightindicators/fi_horizon_back.svg similarity index 100% rename from images/flightindicators/horizon_back.svg rename to images/flightindicators/fi_horizon_back.svg diff --git a/images/flightindicators/horizon_ball.svg b/images/flightindicators/fi_horizon_ball.svg similarity index 100% rename from images/flightindicators/horizon_ball.svg rename to images/flightindicators/fi_horizon_ball.svg diff --git a/images/flightindicators/horizon_circle.svg b/images/flightindicators/fi_horizon_circle.svg similarity index 100% rename from images/flightindicators/horizon_circle.svg rename to images/flightindicators/fi_horizon_circle.svg diff --git a/images/flightindicators/horizon_mechanics.svg b/images/flightindicators/fi_horizon_mechanics.svg similarity index 100% rename from images/flightindicators/horizon_mechanics.svg rename to images/flightindicators/fi_horizon_mechanics.svg diff --git a/images/flightindicators/speed_mechanics.svg b/images/flightindicators/fi_speed_mechanics.svg similarity index 100% rename from images/flightindicators/speed_mechanics.svg rename to images/flightindicators/fi_speed_mechanics.svg diff --git a/images/flightindicators/turn_coordinator.svg b/images/flightindicators/fi_turn_coordinator.svg similarity index 100% rename from images/flightindicators/turn_coordinator.svg rename to images/flightindicators/fi_turn_coordinator.svg diff --git a/images/flightindicators/vertical_mechanics.svg b/images/flightindicators/fi_vertical_mechanics.svg similarity index 100% rename from images/flightindicators/vertical_mechanics.svg rename to images/flightindicators/fi_vertical_mechanics.svg diff --git a/images/icons/cf_icon_RTH.png b/images/icons/map/cf_icon_RTH.png similarity index 100% rename from images/icons/cf_icon_RTH.png rename to images/icons/map/cf_icon_RTH.png diff --git a/images/icons/cf_icon_arrow.png b/images/icons/map/cf_icon_arrow.png similarity index 100% rename from images/icons/cf_icon_arrow.png rename to images/icons/map/cf_icon_arrow.png diff --git a/images/icons/cf_icon_elevation_white.svg b/images/icons/map/cf_icon_elevation_white.svg similarity index 100% rename from images/icons/cf_icon_elevation_white.svg rename to images/icons/map/cf_icon_elevation_white.svg diff --git a/images/icons/cf_icon_geozone_excl.png b/images/icons/map/cf_icon_geozone_excl.png old mode 100755 new mode 100644 similarity index 100% rename from images/icons/cf_icon_geozone_excl.png rename to images/icons/map/cf_icon_geozone_excl.png diff --git a/images/icons/cf_icon_geozone_incl.png b/images/icons/map/cf_icon_geozone_incl.png old mode 100755 new mode 100644 similarity index 100% rename from images/icons/cf_icon_geozone_incl.png rename to images/icons/map/cf_icon_geozone_incl.png diff --git a/images/icons/cf_icon_geozone_white.svg b/images/icons/map/cf_icon_geozone_white.svg old mode 100755 new mode 100644 similarity index 100% rename from images/icons/cf_icon_geozone_white.svg rename to images/icons/map/cf_icon_geozone_white.svg diff --git a/images/icons/cf_icon_home.png b/images/icons/map/cf_icon_home.png similarity index 100% rename from images/icons/cf_icon_home.png rename to images/icons/map/cf_icon_home.png diff --git a/images/icons/icon_mission_airplane.png b/images/icons/map/cf_icon_mission_airplane.png similarity index 100% rename from images/icons/icon_mission_airplane.png rename to images/icons/map/cf_icon_mission_airplane.png diff --git a/images/icons/map/cf_icon_multimission_white.svg b/images/icons/map/cf_icon_multimission_white.svg new file mode 100644 index 000000000..2ea81e957 --- /dev/null +++ b/images/icons/map/cf_icon_multimission_white.svg @@ -0,0 +1,50 @@ + + + + diff --git a/images/icons/cf_icon_position.png b/images/icons/map/cf_icon_position.png similarity index 64% rename from images/icons/cf_icon_position.png rename to images/icons/map/cf_icon_position.png index b90f80e1c..55d48622d 100644 Binary files a/images/icons/cf_icon_position.png and b/images/icons/map/cf_icon_position.png differ diff --git a/images/icons/cf_icon_position_LDG.png b/images/icons/map/cf_icon_position_LDG.png similarity index 100% rename from images/icons/cf_icon_position_LDG.png rename to images/icons/map/cf_icon_position_LDG.png diff --git a/images/icons/cf_icon_position_LDG_edit.png b/images/icons/map/cf_icon_position_LDG_edit.png similarity index 100% rename from images/icons/cf_icon_position_LDG_edit.png rename to images/icons/map/cf_icon_position_LDG_edit.png diff --git a/images/icons/cf_icon_position_PH.png b/images/icons/map/cf_icon_position_PH.png similarity index 100% rename from images/icons/cf_icon_position_PH.png rename to images/icons/map/cf_icon_position_PH.png diff --git a/images/icons/cf_icon_position_PH_edit.png b/images/icons/map/cf_icon_position_PH_edit.png similarity index 100% rename from images/icons/cf_icon_position_PH_edit.png rename to images/icons/map/cf_icon_position_PH_edit.png diff --git a/images/icons/cf_icon_position_POI.png b/images/icons/map/cf_icon_position_POI.png similarity index 100% rename from images/icons/cf_icon_position_POI.png rename to images/icons/map/cf_icon_position_POI.png diff --git a/images/icons/cf_icon_position_POI_edit.png b/images/icons/map/cf_icon_position_POI_edit.png similarity index 100% rename from images/icons/cf_icon_position_POI_edit.png rename to images/icons/map/cf_icon_position_POI_edit.png diff --git a/images/icons/cf_icon_position_WP.png b/images/icons/map/cf_icon_position_WP.png similarity index 100% rename from images/icons/cf_icon_position_WP.png rename to images/icons/map/cf_icon_position_WP.png diff --git a/images/icons/cf_icon_position_WP_edit.png b/images/icons/map/cf_icon_position_WP_edit.png similarity index 100% rename from images/icons/cf_icon_position_WP_edit.png rename to images/icons/map/cf_icon_position_WP_edit.png diff --git a/images/icons/cf_icon_position_edit.png b/images/icons/map/cf_icon_position_edit.png similarity index 100% rename from images/icons/cf_icon_position_edit.png rename to images/icons/map/cf_icon_position_edit.png diff --git a/images/icons/cf_icon_position_head.png b/images/icons/map/cf_icon_position_head.png similarity index 100% rename from images/icons/cf_icon_position_head.png rename to images/icons/map/cf_icon_position_head.png diff --git a/images/icons/cf_icon_safehome.png b/images/icons/map/cf_icon_safehome.png similarity index 100% rename from images/icons/cf_icon_safehome.png rename to images/icons/map/cf_icon_safehome.png diff --git a/images/icons/cf_icon_safehome_used.png b/images/icons/map/cf_icon_safehome_used.png similarity index 100% rename from images/icons/cf_icon_safehome_used.png rename to images/icons/map/cf_icon_safehome_used.png diff --git a/images/icons/cf_icon_safehome_white.svg b/images/icons/map/cf_icon_safehome_white.svg similarity index 100% rename from images/icons/cf_icon_safehome_white.svg rename to images/icons/map/cf_icon_safehome_white.svg diff --git a/images/icons/map/cf_settings_white.svg b/images/icons/map/cf_settings_white.svg new file mode 100644 index 000000000..58d66d1dd --- /dev/null +++ b/images/icons/map/cf_settings_white.svg @@ -0,0 +1,22 @@ + + + diff --git a/index.html b/index.html index d7681ca2d..062b6f579 100644 --- a/index.html +++ b/index.html @@ -3,12 +3,6 @@
- - - - - -