You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Navigraph Navigation Data Interface enables developers to download and integrate navigation data from Navigraph directly into add-on aircraft in MSFS.
6
+
<divalign="center">
7
+
<h1>Navigraph Navigation Data Interface for MSFS</h1>
8
+
</div>
9
+
10
+
<p>The Navigraph Navigation Data Interface enables developers to download and integrate navigation data from Navigraph directly into add-on aircraft in MSFS.</p>
11
+
12
+
<br/>
13
+
</div>
4
14
5
15
## Key Features
6
16
@@ -14,23 +24,20 @@ The Navigraph Navigation Data Interface enables developers to download and integ
14
24
15
25
Here's an overview on the structure of this repository, which is designed to be as simple as possible to use
16
26
17
-
-`examples/`
18
-
- Contains sample implementations for using the navigation data interface
27
+
-`example/`
19
28
-`aircraft/` includes a base aircraft to test in the sim
20
29
-`gauge/` includes a very simple TypeScript instrument to communicate with the WASM module
21
30
-`src/`
22
-
-`database` Includes rust source code for interfacing with a DFD sqlite file (not WASM specific)
23
-
-`js` Includes source code for the JS interface for using the sdk
24
-
-`test` Includes code for testing the JS and Rust code using a Node runtime
25
-
-`wasm` includes the Rust source code for the WASM module which handles the downloading of the database file, and interfacing with the database implementation
31
+
-`ts` Includes source code for the JS interface for using the sdk
32
+
-`wasm` includes the Rust source code for the WASM module which handles the downloading of the database file, and interfacing with the database
26
33
27
34
## Including in Your Aircraft
28
35
29
36
1. You'll need to either build the WASM module yourself (not recommended, but documented further down) or download it from [the latest release](https://github.com/Navigraph/msfs-navigation-data-interface/releases) (alternatively you can download it off of a commit by looking at the uploaded artifacts).
30
37
2. Add the WASM module into your `panel` folder in `PackageSources`
31
38
3. Add the following entry into `panel.cfg` (make sure to replace `NN` with the proper `VCockpit` ID):
32
39
33
-
```
40
+
```ini
34
41
[VCockpitNN]
35
42
size_mm=0,0
36
43
pixel_size=0,0
@@ -60,34 +67,30 @@ If you bundle outdated navigation data in your aircraft and you want this module
60
67
61
68
The default location for navigation data is `work/NavigationData`.
62
69
63
-
## Building the Sample Aircraft
70
+
## Building the Sample Aircraft (MSFS2020)
64
71
65
72
Before building, make sure you have properly created and set an `.env` file in `examples/gauge`! An example can be found in the `.env.example` file in that directory. Replace with your credentials
66
73
67
-
1. [Download](https://nodejs.org/en/download) and install Node.js
74
+
1. Download and install [Bun](https://bun.sh/docs/installation)
68
75
2. Open the `msfs-navigation-data-interface` folder in a terminal
69
-
3. Run `npm i` the first time you build, in order to install dependencies
70
-
4. Change directory to `src/js` using `cd src/js`
71
-
5. Run `npm run build` to build the interface.
72
-
6. Change directory to `examples/gauge` using `cd ../../examples/gauge/`
73
-
7. Run `npm run build` to build into the `PackageSources` folder of the aircraft sample (or `npm run dev` to build into the `Packages` folder of the aircraft and listen to changes in the source).
74
-
8. Make sure the WASM module is included in the [`panel`](examples/aircraft/PackageSources/SimObjects/Airplanes/Navigraph_Navigation_Data_Interface_Aircraft/panel) folder! Look at either [Including in Your Aircraft](#including-in-your-aircraft) or [Building the WASM Module Yourself](#building-the-wasm-module-yourself) for info on that
75
-
9. Open the `examples/aircraft/NavigationDataInterfaceAircraftProject.xml` file in the simulator and build there
76
+
3. Run `bun i` the first time you build, in order to install dependencies
77
+
4. Change directory to `examples/gauge` using `cd example/gauge`
78
+
5. Run `bun run build` to build into the `PackageSources` folder of the aircraft sample (or `bun run dev` to build into the `Packages` folder of the aircraft and listen to changes in the source).
79
+
6. Make sure the WASM module is included in the [`panel`](examples/aircraft/PackageSources/SimObjects/Airplanes/Navigraph_Navigation_Data_Interface_Aircraft/panel) folder! Look at either [Including in Your Aircraft](#including-in-your-aircraft) or [Building the WASM Module Yourself](#building-the-wasm-module-yourself) for info on that
80
+
7. Open the `examples/aircraft/NavigationDataInterfaceAircraftProject.xml` file in the simulator and build there
2. Run `bun run build:wasm` at the root of the repository (requires Docker)
81
86
- This will take a while to download and build the first time, but subsequent runs will be quicker
82
-
3. The compiled WASM module will be copied to `out` **and** `examples/aircraft/PackageSources/SimObjects/Airplanes/Navigraph_Navigation_Data_Interface_Aircraft/panel`
87
+
3. The compiled WASM module will be copied to `dist/wasm`. There will be two folders - `2020` and `2024`, for each sim version
83
88
84
89
## Interfacing with the gauge manually
85
90
86
91
The navigation data interface acts as its own WASM gauge in sim, so in order to communicate with it, you must use the [CommBus](https://docs.flightsimulator.com/html/Programming_Tools/WASM/Communication_API/Communication_API.htm).
87
92
88
-
The gauge communicates using the following event names:
89
-
90
-
(Any types referenced can be found in `wasm/src/json_structs.rs`)
93
+
The gauge communicates using the following event names (all types referenced can be found [here](src/ts)):
91
94
92
95
- `NAVIGRAPH_CallFunction`: This event is received by the interface and is used to trigger one of the interfaces functions. It takes in arguments of type `CallFunction`. The available functions and their expected parameters can be found in the `json_structs.rs` file
93
96
- `NAVIGRAPH_FunctionResult`: This event is sent by the interface as a response to a previously triggered function. Its result will have the type `FunctionResult`, with the data field containing the expected return type of the function.
0 commit comments