Comments (2)
Not able to check atm, but I think all buttons in the PMDG aircraft has a dedicated event id. Perhaps you need to use those instead of the simulation variables?
from node-simconnect.
In the PMDG SDK docs they use SimConnect_SetClientData
for writing control events. With node-simconnect
that would be something like this:
const PMDG_NG3_CONTROL_NAME = "PMDG_NG3_Control"
const PMDG_NG3_CONTROL_ID = 0x4E473333
const PMDG_NG3_CONTROL_DEFINITION = 0x4E473334
const dataToSet = new RawBuffer(0);
dataToSet.clear();
dataToSet.writeInt32(THIRD_PARTY_EVENT_ID_MIN + 573); // EVT_CDU_L_A found in PMDG_NG3_SDK.h
dataToSet.writeInt32(1); // 100 gave me a SIMCONNECT_EXCEPTION_OUT_OF_BOUNDS
handle.mapClientDataNameToID(PMDG_NG3_CONTROL_NAME, PMDG_NG3_CONTROL_ID)
handle.addToClientDataDefinition(PMDG_NG3_CONTROL_DEFINITION, 0, 64, 0, 0) // 64 bits
handle.setClientData(PMDG_NG3_CONTROL_ID, PMDG_NG3_CONTROL_DEFINITION, 0, 0, 64, dataToSet.getBuffer()) // 64 bits
According to the manual this will write to a "command area" which the aircraft is continuously checking for new content, and you will need to wait for this area to be cleared (by subscribing for changes) before doing a new write.
However, the manual also shows how to use direct event triggering, which I was talking about. This seems like a simpler approach, but I guess it depends on your use case. I have added code for this in the PMDG sample
I'm a bit curious to why setDataOnSimObject
(almost) works though. Did you try with the value 1 instead of 100? Did you get a SimConnect exception? Have you found an example where SimConnect_SetDataOnSimObject
is used?
from node-simconnect.
Related Issues (20)
- Multibyte chars in Paths - Size Mismatch HOT 4
- Need example on how to write simulation variables HOT 6
- Bytebuffer format on electron. HOT 6
- Add some code to the README.md to show how to get and set values? HOT 14
- add .once and .off to SimConnectConnection? HOT 1
- "Title" causes a node-simconnect crash HOT 11
- It looks like open() logs a registry key on failure HOT 4
- How to call transmitClientEvent HOT 2
- Write data variables into created ia aircraft not working HOT 1
- Post NZ World Update 11 - FaclityDataRequest issue crashes sim HOT 1
- Having some issues with `unSubscribeToFacilitiesEx1` HOT 10
- Is it possible to read pmdg CDU screen data? HOT 1
- Not a real issue, just a heck of a lot of appreciation. HOT 2
- Better type safety for `DataRequestId`, `DataDefinitionId`, `ClientDataDefinitionId`, etc
- Implement new input events API
- Implement SimConnect_EnumerateControllers
- Implement data definition filter API
- Busy-loop caused by subscribeToFacilitiesEx1 HOT 3
- Inconsistent increment/decrement when sending input events
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-simconnect.