Hello, The event ELECTRICAL_CIRCUIT_BREAKER_TOGGLE given a circuit number via
WASM does nothing… the expectations is to cause this to “pull the breaker”
when a given circuit is given via WASM using the trigger_key_event
(ELECTRICAL_CIRCUIT_BREAKER_TOGGLE , circuit number)… However nothing
happens… In passing we are also still unable to use any event via WASM that
requires 2 parameters, trigger_key_event only allows 1 parameter to be send…
Best, Raul
@Arzop can you please have a look?
Raul, You could use execute_calculator_code instead - at least as a temporary
workaround. It’s required anyway for all those events that require two
parameters (>K:2:SOMETHING) as these are not supported by trigger_key_event
and send_key_event yet. Hans
And we already are tracking this issue. Not fixed yet but it should be
available soon enough.
Hi Hans, Many thanks for the suggestion, there were some issues reported here
implying that execute_calculator_code can leads to some performance issues, so
I am trying to stay away from it until it is confirmed as fixed. It is a big
vague if this is resolved or not to be honest:
https://devsupport.flightsimulator.com/t/3739 Some clarification needed on
that topic @FlyingRaccoon :). In any case, I would rather see the WASM trigger
event code to be expanded and supported correctly with multiple parameters, it
would also be lovely to allow us to write A:VARS or any vars directly without
the need of calculator code or SimConnect. In the meantime I used SimConnect
to pull the breakers, my hopes are, this event get’s fixed with SU9 or SU10
and then I can update my code to be more efficient since I am trying to avoid
Simconnect as much as possible inside WASM. Thanks to everyone for looking
into this, Raul
It wouldn’t do anything, because for some weird reason you first need to set
the ( > A:BUS LOOKUP INDEX, Number) before you can toggle a breaker. It’s the
weirdest construct I’ve seen in the sim so far. Not only do they break
consistency of A vars not being writable, it also makes no sense, since the
breakers should be indexed outside of their buses anyway…
Hi, What kind of electrical system are you using in your package? Is it a MSFS
system as you can find
here
(ELECTRICAL section) with circuit.N… Or is it more a FSX system? In the
second case, KEY_ELECTRICAL_CIRCUIT_BREAKER_TOGGLE didn’t exist in FSX, so
this is the expected behavior. Otherwise, there is a deeper issue. Best
regards Maxime
Hi Maxime, Thanks for your answer, I am using the new electrical system of
course… I have my circuit numbers set correctly and sequentially. The SDK
documentation states we can call the event
ELECTRICAL_CIRCUIT_BREAKER_TOGGLE with a circuit number, as you can see
below:
nothing happens… the breaker is never pulled or set… (toggle on / off) Via
WASM of course the equivalent is to use trigger_key_event
(KEY_ELECTRICAL_CIRCUIT_BREAKER_TOGGLE, CIRCUIT_NUMBER), that doesn’t work
either… the circuit breaker of any given circuit remains the same… I know my
electrical system is configured correctly because changing the breaker status
via the SimVar watcher or via SimConnect works… and I was able to confirm it
via the electrical debug tool available via behaviours / show electrical
system debug… However attempting to do the same via the SDK documented
electrical event generates zero results. Thanks again for investigating this
issue. Regards, Raul
Hi, I have tested this line:
1. trigger_key_event(KEY_ELECTRICAL_CIRCUIT_BREAKER_TOGGLE, 1);
in one of SDK’s sample (GaugeAircraft) by adding it in PANEL_SERVICE_PRE_DRAW
section, and it seems to work (execution seems right and simvars watcher
confirms it). Is it possible for you to provide me your package, so I can
investigate in “real” situation? If it is, you can follow this
[link](https://devsupport.flightsimulator.com/articles/5483/how-to-report-a-
bug-or-crash.html) (section 3) to help you. Best Regards Maxime
Hi Max, I am afraid I changed my project now far too much to be useful, since
this is not working for me I changed to do this via SimConnect to do it inside
my WASM modules by changing the BUS index, and then using the A:Var of
breakers. However, when I was trying to use the key even inside WASM, I was
using different circuit numbers from 1, can you test different circuit numbers
indexes? for example, a circuit index located on a different BUS from BUS
number one and bigger numbers? it is posible the bug is related to a circuit
number different from 1, I never tried to disconnect my starter. The other
alternative is that your version of MSFS has this fixed while SU8 in our side
is not… this is the difficulty for 3rd party devs like us when reporting
issues, many times we are several version behind of what you guys have… I was
trying several circuits some of them on BUS 2… I was also trying the circuits
attached to my navigation lights, this is my electrical section:
1. [ELECTRICAL]
2. max_battery_voltage = 12.7
3. bus.1 = Name:MAIN_BUS
4. bus.2 = Connections:bus.1#Name:AVIONICS_BUS
5. battery.1 = Connections:bus.1#Capacity:24#Voltage:curve.1#Name:MAIN_BATTERY ; Main Battery
6. alternator.1 = Connections:bus.1#iEng:0#RatedVoltage:14#Load:curve.2
7. curve.1 = 0:10.5, 0.1:11.31, 0.2:11.58, 0.3:11.75, 0.4:11.9, 0.5:12.06, 0.9:12.5, 1:12.7; Battery voltage for capacity %
8. curve.2 = 0.1:0, 0.15:30, 0.30:55, 0.8:60 ; Load from RPM table 30A at idle speed & 60 at 90%rpm
9. circuit.1 = Type:CIRCUIT_STARTER#Connections:bus.1#Power:1000, 1500, 11.5#Name:Starter_1 ; Starter 3500W
10. circuit.2 = Type:CIRCUIT_GENERAL_PANEL#Connections:bus.1#Power:0.5,1,10.5#Name:General_Panel ; General panel
11. circuit.3 = Type:CIRCUIT_FUEL_PUMP#Connections:bus.1#Power:20, 24, 11.3#Name:Fuel_Pump ; Fuel pump 12V DC @ 2A
12. circuit.4 = Type:CIRCUIT_FLAP_MOTOR#Connections:bus.1#Power:90, 100, 11.3#Name:Flaps_Motor ; Flaps motor
13. circuit.5 = Type:CIRCUIT_DIRECTIONAL_GYRO#Connections:bus.2#Power:10, 15, 11.3#Name:Directional_Gyro ; directional gyro 15W
14. circuit.6 = Type:CIRCUIT_STANDBY_VACUUM#Connections:bus.1#Power:5,10,11.3#Name:STBY_Vacuum ; stby vacuum
15. circuit.7 = Type:CIRCUIT_AUTOPILOT#Connections:bus.2#Power:10, 15, 11.3#Name:Autopilot ; Autopilot 15W
16. circuit.8 = Type:CIRCUIT_XPNDR#Connections:bus.2#Power:10, 18, 11.3#Name:Transponder ; Transponder 18W
17. circuit.9 = Type:CIRCUIT_ADF_DME#Connections:bus.2#Power:28, 35, 11.3#Name:ADF_DME ; ADF/DME 35W
18. circuit.10 = Type:CIRCUIT_GPS#Connections:bus.2#Power:30, 45, 11.3#Name:GPS ; AS530 45W
19. circuit.11 = Type:CIRCUIT_AVIONICS#Connections:bus.2#Power:20,25,10.8#Name:Avionics_1 ; avionics 1
20. circuit.12 = Type:CIRCUIT_AUDIO#Connections:bus.2#Power:10, 15, 11.1#Name:Audio ; Audio 15W
21. circuit.13 = Type:CIRCUIT_PITOT_HEAT#Connections:bus.1#Power:30, 40, 11.8#Name:Pitot_Heat ; pitot_heat 40W
22. circuit.14 = Type:CIRCUIT_NAV:1#Connections:bus.2#Power:4, 5, 11.0#Name:NAV1 ; NAV 1 5W
23. circuit.15 = Type:CIRCUIT_COM:1#Connections:bus.2#Power:4, 5, 11.0#Name:COM1 ; COM 1 5W
24. circuit.16 = Type:CIRCUIT_NAV:2#Connections:bus.2#Power:4, 5, 11.0#Name:NAV2 ; NAV 2 5W
25. circuit.17 = Type:CIRCUIT_COM:2#Connections:bus.2#Power:4, 5, 11.0#Name:COM2 ; COM 2 5W
26. circuit.18 = Type:CIRCUIT_LIGHT_LANDING#Connections:bus.1#Power:35, 40, 11.3#Name:Landing_Light ; Landing LEDs light 20W x 2
27. circuit.19 = Type:CIRCUIT_LIGHT_BEACON#Connections:bus.1#Power:6, 8, 11.3#Name:Beacon_Light ; 8W
28. circuit.20 = Type:CIRCUIT_LIGHT_PANEL#Connections:bus.1#Power:2, 5, 11.3#Name:Instruments_Lights ; panel lights 5W
29. circuit.21 = Type:CIRCUIT_LIGHT_NAV#Connections:bus.1#Power:10, 15, 11.3#Name:Nav_Light_1 ; nav 1 light 15W
30. circuit.22 = Type:CIRCUIT_LIGHT_STROBE#Connections:bus.1#Power:20, 25, 11.3#Name:Strobe_Light_1 ; strobe light 25W
31. circuit.23 = Type:CIRCUIT_XML:1#Connections:bus.1#Power:16, 50, 11.8#Name:SEAT_HEAT_1 ; Heated Seat 50W
32. circuit.24 = Type:CIRCUIT_XML:2#Connections:bus.1#Power:16, 50, 11.8#Name:SEAT_HEAT_2 ; Heated Seat 50W
I think a big issue with this will be that to toggle the breakers, you need to
also set the: ( > A:BUS LOOKUP INDEX, Number) (Which makes no sense to begin
with, but here we are…) So it will probably not be enough to simply add the
event for toggling the breaker, because we also need some way to “set” this
Simvar with the right bus.
Hi, There is indeed a bug with index != 1. Thanks for reporting it. Best
Regards Maxime