Skip to content

Commit 9bd26e5

Browse files
committed
docs: update readme to align with rewrite
1 parent abd627c commit 9bd26e5

File tree

1 file changed

+26
-23
lines changed

1 file changed

+26
-23
lines changed

README.md

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
# Navigraph Navigation Data Interface for MSFS
1+
<div align="center" >
2+
<a href="https://navigraph.com">
3+
<img src="https://navigraph.com/assets/images/navigraph_logo_only.svg" alt="Logo" width="80" height="80">
4+
</a>
25

3-
The Navigraph Navigation Data Interface enables developers to download and integrate navigation data from Navigraph directly into add-on aircraft in MSFS.
6+
<div align="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>
414

515
## Key Features
616

@@ -14,23 +24,20 @@ The Navigraph Navigation Data Interface enables developers to download and integ
1424

1525
Here's an overview on the structure of this repository, which is designed to be as simple as possible to use
1626

17-
- `examples/`
18-
- Contains sample implementations for using the navigation data interface
27+
- `example/`
1928
- `aircraft/` includes a base aircraft to test in the sim
2029
- `gauge/` includes a very simple TypeScript instrument to communicate with the WASM module
2130
- `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
2633

2734
## Including in Your Aircraft
2835

2936
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).
3037
2. Add the WASM module into your `panel` folder in `PackageSources`
3138
3. Add the following entry into `panel.cfg` (make sure to replace `NN` with the proper `VCockpit` ID):
3239

33-
```
40+
```ini
3441
[VCockpitNN]
3542
size_mm=0,0
3643
pixel_size=0,0
@@ -60,34 +67,30 @@ If you bundle outdated navigation data in your aircraft and you want this module
6067

6168
The default location for navigation data is `work/NavigationData`.
6269

63-
## Building the Sample Aircraft
70+
## Building the Sample Aircraft (MSFS2020)
6471

6572
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
6673

67-
1. [Download](https://nodejs.org/en/download) and install Node.js
74+
1. Download and install [Bun](https://bun.sh/docs/installation)
6875
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
7681

7782
## Building the WASM Module Yourself
7883

7984
1. [Install](https://github.com/navigraph/cargo-msfs) cargo-msfs
80-
2. Run `npm run build:wasm` (must be on Windows)
85+
2. Run `bun run build:wasm` at the root of the repository (requires Docker)
8186
- 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
8388

8489
## Interfacing with the gauge manually
8590

8691
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).
8792

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)):
9194

9295
- `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
9396
- `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

Comments
 (0)