- Messages
- 468
- Country

I currently have a knob that is giving me grief and nothing I have tried has solved the problem. I have similar knobs that perform flawlessly (e.g. radio tuning knobs) but this one is being stupid. Here's the scenario:
The knob is for a remote altitude selection head and it needs to rotate through 360° many times in order to select the target altitude on the device. In every instance we have tried the knob either (a) refuses to move at all, or, (b) rotates to the end of its animation and then scoots back to the start of the animation before rotating again.
I've tried multiple code formats, checked the scale and reset the part, built a new part in case that was the issue and still nothing fixes the problem.
I have posted the current version of the code below but be aware that it is tied in with a 2D logic gauge that is controlling other inter-related functions of the auto-pilot head and the annunciator display panel hence the complex looking code. Ignore the funky L:Var name too as that was done in a moment of deep frustration!
Using the above code the mouse-over works perfectly (i.e. the selected altitude display changes as required) as does the rest of the system it's just the visible animation of the knob that is causing problems. It currently rotates then spins back instead of rotating for as long as either the mouse button is pressed or the mouse-wheel is rotated.
Any suggestions/solutions would be greatly appreciated as this is currently driving myself and Roman (Spokes2112) crazy as nothing we have tried has worked.
The knob is for a remote altitude selection head and it needs to rotate through 360° many times in order to select the target altitude on the device. In every instance we have tried the knob either (a) refuses to move at all, or, (b) rotates to the end of its animation and then scoots back to the start of the animation before rotating again.
I've tried multiple code formats, checked the scale and reset the part, built a new part in case that was the issue and still nothing fixes the problem.
I have posted the current version of the code below but be aware that it is tied in with a 2D logic gauge that is controlling other inter-related functions of the auto-pilot head and the annunciator display panel hence the complex looking code. Ignore the funky L:Var name too as that was done in a moment of deep frustration!
Code:
<PartInfo>
<Name>Mallard_ALT_sel_100's_knob</Name>
<AnimLength>360</AnimLength>
<Animation>
<Parameter>
<Code>
(L:Mallard_ALT_stupid_knob,enum)
</Code>
<Lag>100</Lag>
</Parameter>
</Animation>
<MouseRect>
<Cursor>Hand</Cursor>
<TooltipText>ALT_SELECT</TooltipText>
<MouseFlags>LeftSingle+RightSingle+WheelUp+WheelDown+DownRepeat</MouseFlags>
<CallbackCode>
(M:Event) 'LeftSingle' scmi 0 == (M:Event) 'WheelUp' scmi 0 == || if{
(L:Mallard_ALT_stupid_knob, enum) 14 - dnor (>L:Mallard_ALT_stupid_knob, enum)
(L:Mallard_ALT_sel_VAR, enum) 100 - -100 max (>L:Mallard_ALT_sel_VAR, enum)
(L:Mallard_Alt_Mode, enum) 2 == if{ 18 (>L:Mallard_I_ADJ_ALT_VAR, enum) (L:Mallard_ALT_sel_VAR, enum) (>K:AP_ALT_VAR_SET_ENGLISH) } }
(M:Event) 'RightSingle' scmi 0 == (M:Event) 'WheelDown' scmi 0 == || if{
(L:Mallard_ALT_stupid_knob, enum) 14 + dnor (>L:Mallard_ALT_stupid_knob, enum)
(L:Mallard_ALT_sel_VAR, enum) 100 + 35000 min (>L:Mallard_ALT_sel_VAR, enum)
(L:Mallard_Alt_Mode, enum) 2 == if{ 18 (>L:Mallard_I_ADJ_ALT_VAR, enum) (L:Mallard_ALT_sel_VAR, enum) (>K:AP_ALT_VAR_SET_ENGLISH) } }
</CallbackCode>
</MouseRect>
</PartInfo>
Using the above code the mouse-over works perfectly (i.e. the selected altitude display changes as required) as does the rest of the system it's just the visible animation of the knob that is causing problems. It currently rotates then spins back instead of rotating for as long as either the mouse button is pressed or the mouse-wheel is rotated.
Any suggestions/solutions would be greatly appreciated as this is currently driving myself and Roman (Spokes2112) crazy as nothing we have tried has worked.



