NETWORK AIRCRAFT

The NetworkAircraft aircraft is a preset of the WASMAircraft modular aircraft, which shows an aircraft that has three different screens, each one using a specific method of working with the WASM Network API. Once the WASM Aircraft package has been built, this module will be available for flying from the aircraft selection screen:

Selecting The Network Aircraft In The Simulation

 

The WasmModules.sln file (found in the Sources folder of the project) will allow you to compile the source-code with Microsoft Visual Studio (2019 or 2022) in order to create the NetworkModule.wasm WebAssembly module which will then be loaded by the game. Once compiled, the module will automatically be copied into the following folder:

[ROOT]\PackageSources\SimObjects\Airplanes\MyCompany_Wasm_Aircraft\presets\mycompany\NetworkAircraft\panel

 

Note that if you make changes to the C++ code and recompile the network WASM module, you will have to build your package again. This can be done while the plane is used within the simulation.

 

 

Testing

Once you have built the aircraft and selected it, you can go into a Free Flight and you will see three panels in the cockpit:

The Cockpit Interior Of The Network Aircraft

 

Each screen is for showing a separate principle component of the Network API. These are:

 

  1. HttpGet (Loop): When you click on the screen, the gauge will make a request (GET) to an online website to get a random image and display it. It will also copy the image to the work folder, and you can click again and again to get a different image every time. Conceptually this gauge shows how to use the Network API using the "Loop" technique.
     
  2. HttpGet (Callback): This gauge has the exact same behaviour as the previously described gauge. However this gauge is conceptually different as it uses the "Callback" technique.
     
  3. HttpPut: For this last gauge, clicking it will make a request (PUT) to an online website and then copy the returned JSON file to the work folder. Once done, the gauge will display the path to the last JSON downloaded.

 

Examples Of The Three MapView Screens After Clicking