Circuit indexing

While working on our PC-12NG (SU5) we noticed that adding a circuit index to the systems.cfg will produce an error.

We are using indexed simvars (i.e. LIGHT PANEL:3) and they work, but without having explicit indices in systems.cfg, how can we correlate simvars to circuits without risking bugs if the modular merge changes the sequence of circuits?

Hello @SWS-AlexVletsas

This was discussed here: Modern fuel system electric pumps conflict - #23 by FlyingRaccoon

The indices being explicitly added to circuit type is a leftover from the 2020 design.
On 2024, such explicit indices will be ignored and the actual index is just an into increment.

On top of this, we recommend you use names instead of indices to reference your circuit elsewhere whenever possible, as index is likely to change with presets in the modular design.
There are still areas that do not support providing strings instead on integers, do not hesitate to report those in a bug report if you find one that isn’t reported yet.

Regards,
Sylvain

So if I want to turn on a panel light or fuel pump, I turn on the circuit? The simvars for lights are being deprecated?

Are you talking about LIGHT POTENTIOMETER variables? No they’re still valid and can take a name as a parameter.

No, I am asking about light simvars: panel, pedestal, beacon etc.

Hello @SWS-AlexVletsas

Lights simvars are directly tied to the electrical circuits.
You can pass the name of the circuit to the light simvars as an index, although this is not indicated in the documentation.

For example, to switch the breakers panel light on the 737, you can write 1 to LIGHT CABIN:'cabin_breakers'_n, which is the 4th CIRCUIT_LIGHT_CABIN typed circuit.

I’ll have the documentation reviewed.

Regards,
Sylvain

1 Like

Documentation has been updated.

Regards,
Sylvain

1 Like