xplane udp
1.0.0
Node.js 用 XPlane UDP クライアント
// 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 - [s]total - [秒]mission - [s]timer - [秒]zulu - [hh.ss]local - [hh.ss]hobbsairspeedindicated - KIAS [kts]equivalent - KEAS [kts]true - KTAS [kts]truegnd - KTGS [kts]mph - IAS [マイル/時]mphair - [マイル/時]mphgnd - [マイル/時]gloadmach - マッハ数[比]vvi - VVI [fpm]normalaxialsideangularmomentm - [フィートポンド]l - [フィートポンド]n - [フィートポンド]angularvelocityq - [rad/s]p - [rad/s]r - [rad/s]attitudepitch - [度]roll - [度]truehdg - [度]maghdg - [度]aoaalpha - [度]beta - [度]hpath - [度]vpath - [度]slip - [度]compassmag - [コンプ]mavar - [度]globalpositionlat - [度]lon - [度]altmsl - [フィート]altagl - [フィート]runway - [滑走路番号]altind - [フィート]latnormlonnormsimpositionx - [メートル]y - [メートル]z - [メートル]vx - [m/s]vy - [m/s]vz - [m/s]distft - [フィート]distnm - [nm]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 - プロップウォッシュまたはジェットウォッシュ[1..8] - [kts]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