CommBusAircraft
The CommBusAircraft
aircraft is a module of the WASMAircraft modular aircraft, which shows the use of the WebAssembly Communication API. Once the WASM Aircraft package has been built, this module will be available for flying from the aircraft selection screen:
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 that illustrate the communication between WASM and JS guages:
These screens correspond to the following:
-
WASM To Js
There is no equivalent of the coherent callGET_AIR_TRAFFIC
in WebAssembly, and so to get the number of aircraft around the user in a WASM module, a call to a JS event must be made. In this case, the WASM gauge on the left makes a call to the center JS gauge to execute the coherent call. The JS gauge returns the value in another event. -
JS To WASM
This center JS gauge has a number of buttons that, when pressed, will change the colour of the screens of the WASM gauges (left and right). -
WASM To WASM
The right hand gauge is another WASM gauge, which calculates a value and transmits it to the first WASM gauge (on the left). The value is displayed as "This Value Squared".