Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ _PackageInt
.rollup.cache
tsconfig.tsbuildinfo
.vs
examples/aircraft/NavigationDataInterfaceAircraftProject.xml.user
example/aircraft/NavigationDataInterfaceAircraftProject.xml.user
example/aircraft/PackageSources/html_ui/Pages/VCockpit/Instruments/Navigraph/NavigationDataInterfaceSample
example/aircraft/PackageSources/SimObjects/Airplanes/Navigraph_Navigation_Data_Interface_Aircraft/panel/msfs_navigation_data_interface.wasm

Expand Down
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ RUN cargo install --git https://github.com/navigraph/cargo-msfs
# Cache bust arg to re-install both SDKs
ARG CACHEBUST

# Install MSFS2020 and MSFS2024 SDK
RUN cargo-msfs install msfs2020 && \
cargo-msfs install msfs2024
# Install MSFS2020 SDK
RUN cargo-msfs install msfs2020

# Needed when running in CI/CD to avoid dubious ownership errors
RUN git config --global --add safe.directory /workspace
36 changes: 24 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,25 +70,37 @@ The default location for navigation data is `work/NavigationData`.
## Building the Sample Aircraft (MSFS2020)

> [!NOTE]
> This project is only meant to be tested in MSFS2020. We will add an example for MSFS2024 in the future.
> This project is meant to work in MSFS2020 and MSFS2024.

> [!IMPORTANT]
> Before building, make sure you have properly created and set an `.env` file in `example/gauge`! An example can be found in the `.env.example` file in that directory. Replace with your credentials.

1. Download and install [Bun](https://bun.sh/docs/installation)
2. Open this repository in a terminal
3. Run `bun i` the first time you build, in order to install dependencies
4. Change directory to [`example/gauge`](example/gauge/) using `cd example/gauge`
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).
6. Make sure the WASM module is included in the [`panel`](example/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) instructions
7. Open the `example/aircraft/NavigationDataInterfaceAircraftProject.xml` file in the simulator and build there
> [!IMPORTANT]
> Create a `.env` file in the root of this repository, containing a `SENTRY_URL` variable. Provide your own DSN, or leave it empty.

1. Download and install [Bun](https://bun.sh/docs/installation).
2. Open this repository in a terminal.
3. Run `bun i` the first time you build, in order to install dependencies.
5. Run `bun run build:example`. This command will [build](#building-the-wasm-module-yourself) the wasm module, [build](#building-the-gauge-yourself) the gauge and [copy](#building-the-wasm-module-yourself) the module to the aircraft `panel` folder.
7. Open the `example/aircraft/NavigationDataInterfaceAircraftProject.xml` file in the simulator and build the package.

## Building the WASM Module Yourself

1. Create a `.env` file in the root of this repository, containing a `SENTRY_URL` variable. Provide your own DSN, or leave it empty.
2. Run `bun run build:wasm` at the root of the repository (requires Docker)
- This will take a while to download and build the first time, but subsequent runs will be quicker
3. The compiled WASM module will be copied to `dist/wasm`. There will be two folders - `2020` and `2024`, for each sim version
> [!IMPORTANT]
> Create a `.env` file in the root of this repository, containing a `SENTRY_URL` variable. Provide your own DSN, or leave it empty.

1. Run `bun run build:wasm` at the root of the repository (requires Docker)
- This will take a while to download and build the first time, but subsequent runs will be quicker.
- The WASM module will be compatible for MSFS 2020 & 2024.
2. Run `bun run copy:wasm` command to copy the wasm module or do it manually by copying the wasm module in the aircraft `panel` folder.

## Building the Gauge Yourself

> [!IMPORTANT]
> Before building, make sure you have properly created and set an `.env` file in `example/gauge`! An example can be found in the `.env.example` file in that directory. Replace with your credentials.

1. Change directory to [`example/gauge`](example/gauge/) using `cd example/gauge`
2. 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).

## Interfacing with the gauge manually

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,42 @@
<VisibleInStore>true</VisibleInStore>
<CanBeReferenced>true</CanBeReferenced>
</Flags>
<PackageOrderHint>CUSTOM_SIMOBJECTS</PackageOrderHint>
<AssetGroups>
<AssetGroup Name="ContentInfo">
<Type>Copy</Type>
<Type Version="0">Copy</Type>
<Flags>
<FSXCompatibility>false</FSXCompatibility>
</Flags>
<AssetDir>PackageDefinitions\navigraph-aircraft-navigation-data-interface-sample\ContentInfo\</AssetDir>
<OutputDir>ContentInfo\navigraph-aircraft-navigation-data-interface-sample\</OutputDir>
</AssetGroup>
<AssetGroup Name="Data">
<Type>Copy</Type>
<Type Version="0">Copy</Type>
<Flags>
<FSXCompatibility>false</FSXCompatibility>
</Flags>
<AssetDir>PackageSources\Data\</AssetDir>
<OutputDir>Data\</OutputDir>
</AssetGroup>
<AssetGroup Name="Navigraph">
<Type>Copy</Type>
<Type Version="0">Copy</Type>
<Flags>
<FSXCompatibility>false</FSXCompatibility>
</Flags>
<AssetDir>PackageSources\Navigraph\</AssetDir>
<OutputDir>Navigraph\</OutputDir>
</AssetGroup>
<AssetGroup Name="SimObject">
<Type>SimObject</Type>
<Type Version="1">SimObject</Type>
<Flags>
<FSXCompatibility>false</FSXCompatibility>
</Flags>
<AssetDir>PackageSources\SimObjects\Airplanes\Navigraph_Navigation_Data_Interface_Aircraft\</AssetDir>
<OutputDir>SimObjects\Airplanes\Navigraph_Navigation_Data_Interface_Aircraft\</OutputDir>
</AssetGroup>
<AssetGroup Name="html_ui">
<Type>Copy</Type>
<Type Version="0">Copy</Type>
<Flags>
<FSXCompatibility>false</FSXCompatibility>
</Flags>
Expand All @@ -53,3 +54,4 @@
</AssetGroup>
</AssetGroups>
</AssetPackage>

Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,15 @@
<LOD minSize="1" ModelFile="GaugeAircraft_Interior_LOD04.gltf"/>
</LODS>

<Behaviors>
<Include ModelBehaviorFile="Asobo\Common.xml"/>

<Component ID="SCREEN" Node="Screens">
<UseTemplate Name="ASOBO_GT_Emissive_Gauge">
<PART_ID>SCREEN</PART_ID>
<EMISSIVE_CODE>1</EMISSIVE_CODE>
</UseTemplate>
</Component>
</Behaviors>

</ModelInfo>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_DECAL0</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_DECAL0</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_DECAL0</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_DECAL0</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_DECAL0</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_METAL_ROUGH_AO</BitmapSlot>
<ForceNoAlpha>true</ForceNoAlpha>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_NORMAL</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_DECAL0</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_METAL_ROUGH_AO</BitmapSlot>
<ForceNoAlpha>true</ForceNoAlpha>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_NORMAL</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_DECAL0</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_METAL_ROUGH_AO</BitmapSlot>
<ForceNoAlpha>true</ForceNoAlpha>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_NORMAL</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_DECAL0</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_METAL_ROUGH_AO</BitmapSlot>
<ForceNoAlpha>true</ForceNoAlpha>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_NORMAL</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_DECAL0</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_METAL_ROUGH_AO</BitmapSlot>
<ForceNoAlpha>true</ForceNoAlpha>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_NORMAL</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_DECAL0</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_METAL_ROUGH_AO</BitmapSlot>
<ForceNoAlpha>true</ForceNoAlpha>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_NORMAL</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_DECAL0</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_METAL_ROUGH_AO</BitmapSlot>
<ForceNoAlpha>true</ForceNoAlpha>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_NORMAL</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_DECAL0</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_METAL_ROUGH_AO</BitmapSlot>
<ForceNoAlpha>true</ForceNoAlpha>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_NORMAL</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_DECAL0</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_METAL_ROUGH_AO</BitmapSlot>
<ForceNoAlpha>true</ForceNoAlpha>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_NORMAL</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_DECAL0</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_METAL_ROUGH_AO</BitmapSlot>
<ForceNoAlpha>true</ForceNoAlpha>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_NORMAL</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_NORMAL</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_DECAL0</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_METAL_ROUGH_AO</BitmapSlot>
<ForceNoAlpha>true</ForceNoAlpha>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_NORMAL</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_DECAL0</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_METAL_ROUGH_AO</BitmapSlot>
<ForceNoAlpha>true</ForceNoAlpha>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_EMISSIVE</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_NORMAL</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_DECAL0</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_METAL_ROUGH_AO</BitmapSlot>
<ForceNoAlpha>true</ForceNoAlpha>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_NORMAL</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_DECAL0</BitmapSlot>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_METAL_ROUGH_AO</BitmapSlot>
<ForceNoAlpha>true</ForceNoAlpha>
</BitmapConfiguration>

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<BitmapConfiguration>
<BitmapSlot>MTL_BITMAP_NORMAL</BitmapSlot>
</BitmapConfiguration>

Loading