xplane udp
1.0.0
Cliente XPlane UDP para Node.js
// 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 )
} )
A continuación se muestra la estructura del objeto de datos devuelto en el evento updated
, o accesible directamente desde client.data.<group>.<value>
.
time
real
- [s]total
- [s]mission
- [s]timer
- [s]zulu
- [hh.ss]local
- [hh.ss]hobbs
airspeed
indicated
- KIAS [kts]equivalent
- KEAS [kts]true
- KTAS [kts]truegnd
- KTGS [kts]mph
- IAS [mph]mphair
- [mph]mphgnd
- [mph]gload
mach
- número de Mach [proporción]vvi
- VVI [pies por minuto]normal
axial
side
angularmoment
m
- [ftlb]l
- [ftlb]n
- [ftlb]angularvelocity
q
- [rad/s]p
- [rad/s]r
- [rad/s]attitude
pitch
- [grados]roll
- [grados]truehdg
- [grados]maghdg
- [grados]aoa
alpha
- [grados]beta
- [grados]hpath
- [grados]vpath
- [grados]slip
- [grados]compass
mag
- [comp]mavar
- [grados]globalposition
lat
- [grados]lon
- [grados]altmsl
- [pies]altagl
- [pies]runway
- [nº de pista]altind
- [pies]latnorm
lonnorm
simposition
x
- [metro]y
- [m]z
[m]vx
- [m/s]vy
- [m/s]vz
- [m/s]distft
- [pies]distnm
- [nm]throttlecommand
[1..8]
throttleactual
[1..8]
enginepower
[1..8]
- [CV]enginethrust
[1..8]
enginetorque
[1..8]
enginerpm
[1..8]
proprpm
[1..8]
proppitch
[1..8]
enginewash
- propwash o jetwash[1..8]
- [kts]n1
- turbina N1 %[1..8]
- [%]n2
- turbina N2 %[1..8]
- [%]fuelflow
[1..8]
- [libras/h]itt
[1..8]
- [grados]egt
[1..8]
- [grados]cht
[1..8]
- [grados]oilpressure
[1..8]
- [psi]oiltemp
[1..8]
- [grados]fuelpressure
[1..8]
- [psi]aeroforce
lift
- [libras]drag
- [libras]side
- [libras]engineforce
normal
- [libras]axial
- [libra]side
- [libras] npm i
npm run typescript
(o typescript-watch
para mirar)npm i
npm run typescript
npm run test