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 - [s]total - [s]mission - [s]timer - [s]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 - [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 - propwash หรือ jetwash[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] - [ปอนด์/ตารางนิ้ว]oiltemp[1..8] - [องศา]fuelpressure[1..8] - [ปอนด์/ตารางนิ้ว]aeroforcelift - [ปอนด์]drag - [ปอนด์]side - [ปอนด์]engineforcenormal - [ปอนด์]axial - [ปอนด์]side - [ปอนด์] npm inpm run typescript (หรือ typescript-watch เพื่อดู)npm inpm run typescriptnpm run test