2.0.0 • Published 7 years ago

xplane-udp v2.0.0

Weekly downloads
13
License
MIT
Repository
github
Last release
7 years ago

XPlane UDP Build Status

XPlane UDP Client for Node.js

Requirements

  • NodeJS (v6.X.X)
  • Xplane 11

Usage

// Import XPlane class from the package
import { XPlaneClient } from "xplane-udp"


// Create a client on a specific port (this is a value you define in your xplane game settings)
const client = new XPlaneClient(49000)

// Start the UDP listener
client.start()

// Subscribe to the updated event
// This will fire at the rate at which you send UDP updates (set in-game)
client.on("updated", (data) => {
    
    // Do something with the data
    console.log(data)

})

// You can also access the data directly from the client instance
callMeMaybe(() => {
    
    // Access data in the following format `<client>.data.<group>.<value>`
    console.log(client.data.time.real)
    console.log(client.data.airspeed.indicated)

})

Output Data Format (XPlaneUpdate interface)

Below is the structure of the data object returned in the updated event, or otherwise accesible directly from client.data.<group>.<value>.

  • time
  • airspeed
    • indicated - KIAS kts
    • equivalent - KEAS kts
    • true - KTAS kts
    • truegnd - KTGS kts
    • mph - IAS mph
    • mphair - mph
    • mphgnd - mph
  • gload
    • mach - Mach number ratio
    • vvi - VVI fpm
    • normal
    • axial
    • side
  • angularmoment
  • angularvelocity
  • attitude
  • aoa
  • compass
  • globalposition
  • simposition
  • throttlecommand
    • [1..8]
  • throttleactual
    • [1..8]
  • enginepower
    • [1..8] - hp
  • enginethrust
    • [1..8]
  • enginetorque
    • [1..8]
  • enginerpm
    • [1..8]
  • proprpm
    • [1..8]
  • proppitch
    • [1..8]
  • enginewash - propwash or jetwash
  • n1 - turbine N1 %
    • [1..8] - %
  • n2 - turbine N2 %
    • [1..8] - %
  • fuelflow
  • itt
  • egt
  • cht
  • oilpressure
  • oiltemp
  • fuelpressure
  • aeroforce
  • engineforce
    • normal - lb
    • axial - lb
    • side - lb

Contibute to the code

  1. Clone the Repo onto your local machine
  2. Install the dependancies: npm i
  3. Build the code (ts->js): npm run typescript (or typescript-watch to watch)
  4. Contribute!

Running the tests

  1. Clone the Repo onto your local machine
  2. Install the dependancies: npm i
  3. Build the code (ts->js): npm run typescript
  4. Run the tests: npm run test
2.0.0

7 years ago

1.1.0

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago