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> .
timereal - [с]total - [с]mission - [с]timer - [с]zulu - [чч.сс]local - [хч.сс]hobbsairspeedindicated - КИАС [уз]equivalent - КЕАС [уз]true - КТАС [кц]truegnd - КТГС [кц]mph - IAS [миль/ч]mphair - [миль в час]mphgnd - [миль/ч]gloadmach - число Маха [отношение]vvi - VVI [фут/мин]normalaxialsideangularmomentm - [ftlb]l - [ftlb]n - [ftlb]angularvelocityq - [рад/с]p - [рад/с]r - [рад/с]attitudepitch - [град]roll - [град]truehdg - [градус]maghdg - [градус]aoaalpha - [градус]beta - [градус]hpath - [градус]vpath - [градус]slip - [градус]compassmag - [комп]mavar - [градус]globalpositionlat - [градус]lon - [градус]altmsl - [футы]altagl - [футы]runway - [номер взлетно-посадочной полосы]altind - [футы]latnormlonnormsimpositionx - [м]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]aeroforcelift - [фунт]drag - [фунт]side - [фунт]engineforcenormal - [фунт]axial - [фунт]side - [фунт] npm inpm run typescript (или typescript-watch для просмотра)npm inpm run typescriptnpm run test