xplane udp
1.0.0
XPlane UDP-клиент для 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 )
} )
Ниже приведена структура объекта данных, возвращаемого в updated
событии или доступного иным образом непосредственно из client.data.<group>.<value>
.
time
real
- [с]total
- [с]mission
- [с]timer
- [с]zulu
- [чч.сс]local
- [хч.сс]hobbs
airspeed
indicated
- КИАС [уз]equivalent
- КЕАС [уз]true
- КТАС [кц]truegnd
- КТГС [кц]mph
- IAS [миль/ч]mphair
- [миль в час]mphgnd
- [миль/ч]gload
mach
- число Маха [отношение]vvi
- VVI [фут/мин]normal
axial
side
angularmoment
m
- [ftlb]l
- [ftlb]n
- [ftlb]angularvelocity
q
- [рад/с]p
- [рад/с]r
- [рад/с]attitude
pitch
- [град]roll
- [град]truehdg
- [градус]maghdg
- [градус]aoa
alpha
- [градус]beta
- [градус]hpath
- [градус]vpath
- [градус]slip
- [градус]compass
mag
- [комп]mavar
- [градус]globalposition
lat
- [градус]lon
- [градус]altmsl
- [футы]altagl
- [футы]runway
- [номер взлетно-посадочной полосы]altind
- [футы]latnorm
lonnorm
simposition
x
- [м]y
- [м]z
- [м]vx
- [м/с]vy
- [м/с]vz
- [м/с]distft
- [футы]distnm
- [нм]throttlecommand
[1..8]
throttleactual
[1..8]
enginepower
[1..8]
- [л.с.]enginethrust
[1..8]
enginetorque
[1..8]
enginerpm
[1..8]
proprpm
[1..8]
proppitch
[1..8]
enginewash
- пропеллерная или струйная промывка[1..8]
- [уз]n1
- турбина N1 %[1..8]
- [%]n2
- турбина N2 %[1..8]
- [%]fuelflow
[1..8]
- [фунт/ч]itt
[1..8]
- [град]egt
[1..8]
- [град]cht
[1..8]
- [град]oilpressure
[1..8]
- [psi]oiltemp
[1..8]
- [град]fuelpressure
[1..8]
- [psi]aeroforce
lift
- [фунт]drag
- [фунт]side
- [фунт]engineforce
normal
- [фунт]axial
- [фунт]side
- [фунт] npm i
npm run typescript
(или typescript-watch
для просмотра)npm i
npm run typescript
npm run test