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>
から直接アクセスできるデータ オブジェクトの構造です。
time
real
- [s]total
- [秒]mission
- [s]timer
- [秒]zulu
- [hh.ss]local
- [hh.ss]hobbs
airspeed
indicated
- KIAS [kts]equivalent
- KEAS [kts]true
- KTAS [kts]truegnd
- KTGS [kts]mph
- IAS [マイル/時]mphair
- [マイル/時]mphgnd
- [マイル/時]gload
mach
- マッハ数[比]vvi
- VVI [fpm]normal
axial
side
angularmoment
m
- [フィートポンド]l
- [フィートポンド]n
- [フィートポンド]angularvelocity
q
- [rad/s]p
- [rad/s]r
- [rad/s]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
- [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]aeroforce
lift
- [ポンド]drag
- [ポンド]side
- [ポンド]engineforce
normal
- [ポンド]axial
- [ポンド]side
- [ポンド] npm i
npm run typescript
(またはtypescript-watch
で監視)npm i
npm run typescript
npm run test