Pitot Heat Switch not responding to K events
-
Finally set up my yoke and switch box and started tinkering with the Commander this morning.
I noticed that using the stock K events for Pitot Heat, even though that's what the manual calls for and the Behaviors viewer in Dev Mode show up for the Pitot Heat switch, no amount of K:Pitot_Heat_On/Off or K:Pitot_Heat_Toggle would flip the switch. Using the LVar bool under the hood seems to be a workaround, though.
-
I ran into the same thing while setting up my Commander 114 with MobiFlight. I took a look at Commander114_INT.XML, and your LVar workaround is actually the right direction.
The cockpit pitot heat switch is driven by:
L:var_PitotHeatSwitchWhen the switch is clicked with the mouse, the aircraft first changes that LVar, then compares it to the actual simulator pitot heat state and sends PITOT_HEAT_TOGGLE if the two do not agree.
The relevant code is:
(L:var_PitotHeatSwitch, bool) ! (>L:var_PitotHeatSwitch, bool) (L:var_PitotHeatSwitch, bool) (A:PITOT HEAT SWITCH:1, bool) != if{ 1 (>K:PITOT_HEAT_TOGGLE) }The switch animation is also driven directly by L:var_PitotHeatSwitch.
For my physical two-position switch, I use:
ON
1 (>L:var_PitotHeatSwitch, bool) (L:var_PitotHeatSwitch, bool) (A:PITOT HEAT SWITCH:1, bool) != if{ 1 (>K:PITOT_HEAT_TOGGLE) }OFF
0 (>L:var_PitotHeatSwitch, bool) (L:var_PitotHeatSwitch, bool) (A:PITOT HEAT SWITCH:1, bool) != if{ 1 (>K:PITOT_HEAT_TOGGLE) }So it does not look like you are doing anything wrong with the K events. The Commander appears to use the LVar as the switch state, with the K event used to synchronize the underlying simulator pitot heat state.
There is also an update loop in the aircraft XML that performs essentially the same synchronization, so setting the LVar alone may work. I kept the comparison and K event in my MobiFlight configuration so everything synchronizes immediately.
-
The problem is that the manual specifically calls out the K events, so I'm assuming whatever Nick thinks should be happening when a user calls the K event/stock binding should be happening isn't.
But yes that's also the code I was seeing using the Behavior Viewer in dev mode, though you went far deeper down the rabbit hole with it than I did.