Heretic
Resource contributor
- Messages
- 6,830
- Country

Confirming Roy's observation, (A:PROP FEATHERED:index,bool) doesn't change to "1", even when the prop is at its feathered position.
Drew up some custom prop lever and feathering code which seems to work well.
Exemplary prop lever for the virtual cockpit (FSX syntax, requires animation header for the Modeldef):
Exemplary feather button for the virtual cockpit (FSX syntax, requires animation header for the Modeldef):
The rest of the feathering related code is executed in a 2D gauge, because I'm a lazy sod and save-compile-copy-paste-overwrite-reload is way too much work (save-reload is much faster).
FS9 syntax becasue why not. The value for the feathered prop beta is specified in the aircraft.cfg, in this case 89.5 degrees. Since this is an R1830 (see post #15 by Roy), the feather button will pop back out once the prop is feathered.
The event traps are necessary to avoid interference via keyboard when the prop is feathered.
Not sure whether use of external throttle quadrants with prop controls will pop the prop out of feather.
(Rinse and repeat for more engines.)
Note: No trap for PROP_PITCH1_DECR because it would lead to fatal command flooding when using the feathering button.
Note 2: You will still have to close the throttle or cut the mixture to stop the engine.
Drew up some custom prop lever and feathering code which seems to work well.
Exemplary prop lever for the virtual cockpit (FSX syntax, requires animation header for the Modeldef):
Code:
<PartInfo>
<Name>Prop_Lever_L</Name>
<AnimLength>100</AnimLength>
<Animation>
<Parameter>
<Code>(L:Prop Lever L, number)</Code>
<Lag>400</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<TooltipText>Left Propeller Lever: %((L:Prop Lever R, number))%!3.2f! Beta: %((A:PROP BETA:1, radians) rddg)%!2.1f! deg</TooltipText>
<MouseFlags>LeftSingle+LeftDrag+LeftRelease+WheelUp+WheelDown</MouseFlags>
<CallbackCode>
(M:Event) 'LeftSingle' scmp 0 ==
if{ (M:Y) (>L:MOUSEPOSY,number) (M:X) (>L:MOUSEPOSX,number) }
(M:Event) 'LeftRelease' scmp 0 ==
if{ (M:Y) (>L:MOUSEPOSY,number) (M:X) (>L:MOUSEPOSX,number) }
(M:Event) 'LeftDrag' scmp 0 ==
if{ (M:Y) (L:MOUSEPOSY,number) - 3 + 0 <
(M:X) (L:MOUSEPOSX,number) - 3 + 0 < or
if{ (L:Prop Lever L, number) (M:Y) (L:MOUSEPOSY,number) - (M:X) (L:MOUSEPOSX,number) - + abs 0.25 * + 100 min (>L:Prop Lever L, number) (M:Y) (>L:MOUSEPOSY,number) (M:X) (>L:MOUSEPOSX,number) }
(M:Y) (L:MOUSEPOSY,number) - 3 - 0 >
(M:X) (L:MOUSEPOSX,number) - 3 - 0 > or
if{ (L:Prop Lever L, number) (M:Y) (L:MOUSEPOSY,number) - (M:X) (L:MOUSEPOSX,number) - + abs 0.25 * - 0 max (>L:Prop Lever L, number) (M:Y) (>L:MOUSEPOSY,number) (M:X) (>L:MOUSEPOSX,number) } }
(M:Event) 'WheelUp' scmp 0 ==
if{ (L:Prop Lever L, number) ++ 100 min (>L:Prop Lever L, number) } }
(M:Event) 'WheelDown' scmp 0 ==
if{ (L:Prop Lever L, number) -- 0 max (>L:Prop Lever L, number) } }
</CallbackCode>
</MouseRect>
</PartInfo>
Exemplary feather button for the virtual cockpit (FSX syntax, requires animation header for the Modeldef):
Code:
<PartInfo>
<Name>Feather_Button_L</Name>
<AnimLength>50</AnimLength>
<Animation>
<Parameter>
<Code>(L:Feather Button L, bool) 50 *</Code>
<Lag>400</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<TooltipText>Feather Left Propeller%((L:Prop Feathered L, bool))%{if} (Feathered!)</TooltipText>
<MouseFlags>LeftSingle</MouseFlags>
<CallbackCode>
(L:Feather Button L, bool) ! (>L:Feather Button L, bool)
</CallbackCode>
</MouseRect>
</PartInfo>
The rest of the feathering related code is executed in a 2D gauge, because I'm a lazy sod and save-compile-copy-paste-overwrite-reload is way too much work (save-reload is much faster).
FS9 syntax becasue why not. The value for the feathered prop beta is specified in the aircraft.cfg, in this case 89.5 degrees. Since this is an R1830 (see post #15 by Roy), the feather button will pop back out once the prop is feathered.
The event traps are necessary to avoid interference via keyboard when the prop is feathered.
Not sure whether use of external throttle quadrants with prop controls will pop the prop out of feather.
Code:
<Gauge Name="Bjoern_K_is_the_smartest_person_on_the_planet" Version="2.0">
<Element>
<Select>
<Value>
(L:Feather Button L, bool)
if{ 0 (>K:PROP_PITCH1_SET) (>K:PROP_PITCH1_DECR) }
(A:PROP BETA:1, radians) rddg 89.5 ==
if{ 1 (>L:Prop Feathered L, bool) }
els{ (L:Prop Feathered L, bool) if{ 0 (>L:Prop Feathered L, bool) } }
(L:Prop Feathered L, bool)
(L:Feather Button L, bool) and
if{ 0 (>L:Feather Button L, bool) }
(L:Prop Feathered L, bool) !
(L:Feather Button L, bool) ! and
if{ (L:Prop Lever L, number) 163.83 * (>K:PROP_PITCH1_SET) }
</Value>
</Select>
</Element>
<Keys>
<!-- CTRL+F1/2/3/4 event traps -->
<On Event="PROP_PITCH_LO">
(L:Prop Feathered L, bool) ! (L:Feather Button L, bool) ! and if{ 100 (>L:Prop Lever L, number) } els{ 0 (>K:PROP_PITCH1_SET) (>K:PROP_PITCH1_DECR) }
</On>
<On Event="PROP_PITCH_INCR">
(L:Prop Feathered L, bool) ! (L:Feather Button L, bool) ! and if{ (L:Prop Lever L, number) 10 + 100 min (>L:Prop Lever L, number) } els{ 0 (>K:PROP_PITCH1_SET) (>K:PROP_PITCH1_DECR) }
</On>
<On Event="PROP_PITCH_INCR_SMALL">
(L:Prop Feathered L, bool) ! (L:Feather Button L, bool) ! and if{ (L:Prop Lever L, number) ++ 100 min (>L:Prop Lever L, number) } els{ 0 (>K:PROP_PITCH1_SET) (>K:PROP_PITCH1_DECR) }
</On>
<On Event="PROP_PITCH_DECR_SMALL">
(L:Prop Feathered L, bool) ! (L:Feather Button L, bool) ! and if{ (L:Prop Lever L, number) -- 0 max (>L:Prop Lever L, number) } els{ 0 (>K:PROP_PITCH1_SET) (>K:PROP_PITCH1_DECR) }
</On>
<On Event="PROP_PITCH_DECR">
(L:Prop Feathered L, bool) ! (L:Feather Button L, bool) ! and if{ (L:Prop Lever L, number) 10 - 0 max (>L:Prop Lever L, number) } els{ 0 (>K:PROP_PITCH1_SET) (>K:PROP_PITCH1_DECR) }
</On>
<On Event="PROP_PITCH_HI">
(L:Prop Feathered L, bool) ! (L:Feather Button L, bool) ! and if{ 0 (>L:Prop Lever L, number) } els{ 0 (>K:PROP_PITCH1_SET) (>K:PROP_PITCH1_DECR) }
</On>
<!-- Single engine event traps -->
<On Event="PROP_PITCH1_LO">
(L:Prop Feathered L, bool) ! (L:Feather Button L, bool) ! and if{ 100 (>L:Prop Lever L, number) } els{ 0 (>K:PROP_PITCH1_SET) (>K:PROP_PITCH1_DECR) }
</On>
<On Event="PROP_PITCH1_INCR">
(L:Prop Feathered L, bool) ! (L:Feather Button L, bool) ! and if{ (L:Prop Lever L, number) 10 + 100 min (>L:Prop Lever L, number) } els{ 0 (>K:PROP_PITCH1_SET) (>K:PROP_PITCH1_DECR) }
</On>
<On Event="PROP_PITCH1_INCR_SMALL">
(L:Prop Feathered L, bool) ! (L:Feather Button L, bool) ! and if{ (L:Prop Lever L, number) ++ 100 min (>L:Prop Lever L, number) } els{ 0 (>K:PROP_PITCH1_SET) (>K:PROP_PITCH1_DECR) }
</On>
<On Event="PROP_PITCH1_DECR_SMALL">
(L:Prop Feathered L, bool) ! (L:Feather Button L, bool) ! and if{ (L:Prop Lever L, number) -- 0 max (>L:Prop Lever L, number) } els{ 0 (>K:PROP_PITCH1_SET) (>K:PROP_PITCH1_DECR) }
</On>
<On Event="PROP_PITCH1_DECR">
(L:Prop Feathered L, bool) ! (L:Feather Button L, bool) ! and if{ (L:Prop Lever L, number) 10 - 0 max (>L:Prop Lever L, number) } els{ }
</On>
<On Event="PROP_PITCH1_HI">
(L:Prop Feathered L, bool) ! (L:Feather Button L, bool) ! and if{ 0 (>L:Prop Lever L, number) } els{ 0 (>K:PROP_PITCH1_SET) (>K:PROP_PITCH1_DECR) }
</On>
</Keys>
</Gauge>
(Rinse and repeat for more engines.)
Note: No trap for PROP_PITCH1_DECR because it would lead to fatal command flooding when using the feathering button.
Note 2: You will still have to close the throttle or cut the mixture to stop the engine.

