7DR wrote on Apr 4
th, 2025 at 4:21pm:
I'm building Air Manager instruments for the J model, and have questions on some autopilot functions.
Climb/Glide - using L:P17_002_KNB I can move the wheels fine, but nothing else happens. Using L:m133_AP_target_pitch seems to make control operate. Is this the best way?
Turn knob - L:P17_001_KNB will move the knob, but again, nothing else happens.
Heading Bug - L:L07_001_IND sets bug on HSI and that's it. I tried adding a number of different HEADING_ events with no success.
The problem is that not all controls work through only reading/writing the variable.
In some cases, when you click, additional actions occur, for example, default events of the sim are triggered, etc.
Moreover, some logic can be processed in wasm. Therefore, for example, rotating the Pitch/Turn knobs simply by assigning values to the P17_001_KNB/P17_002_KNB variables does not give the desired result. That is, it does not give the same effect as their full rotation by clicking or by assigned controls in the sim.
Of course, you can always change the code in xml, if you understand how. Therefore, I can only advise you to look at q135_302_interior.xml and cs130_interior_common.xml. Search for the elements of interest there, see how they work and try to change them to suit your needs.
Quote:Also, anybody know the readback variable for the DC power switch (off/bat/ext)?
Same story. There is no variable for the position of this switch. Its position depends on the default systems of the sim and is determined by the code:
<ANIM_CODE>(A:ELECTRICAL MASTER BATTERY:1, Bool) if{ 1 } els{ (A:EXTERNAL POWER ON:2, Bool) if{ 2 } els{ 0 } }</ANIM_CODE>
The click code is even more complicated.
I can only name the DC power code of the switch: O05_001_GL3. Search by this name in the above xml and see how it works.